Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/CF Implementation.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/CF Implementation.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/CF Implementation.cs	(revision 9616)
@@ -0,0 +1,392 @@
+﻿#region TODO
+//TODO: Add the "DataBar" extended options
+//TODO: Add tests for all the rules
+//TODO: Add the IconSet options
+//TODO: Add all the "extList" options
+#endregion
+
+#region §18.3.1.18 conditionalFormatting (Conditional Formatting)
+//Childs:
+//cfRule          (Conditional Formatting Rule) §18.3.1.10
+//extLst          (Future Feature Data Storage Area) §18.2.10
+
+//Attributes:
+//pivot
+//sqref           ST_Sqref simple type (§18.18.76)
+#endregion
+
+#region §18.3.1.10 cfRule (Conditional Formatting Rule)
+//Childs:
+//colorScale      (Color Scale) §18.3.1.16
+//dataBar         (Data Bar) §18.3.1.28
+//extLst          (Future Feature Data Storage Area) §18.2.10
+//formula         (Formula) §18.3.1.43
+//iconSet         (Icon Set) §18.3.1.49
+
+//Attributes:
+//-----------
+//priority        (Priority) The priority of this conditional formatting rule. This value is used to determine which
+//                format should be evaluated and rendered. Lower numeric values are higher priority than
+//                higher numeric values, where 1 is the highest priority.
+//stopIfTrue      (Stop If True) If this flag is 1, no rules with lower priority shall be applied over this rule, when this rule
+//                evaluates to true.
+//type            (Type) Type of conditional formatting rule. ST_CfType §18.18.12.
+//aboveAverage    Indicates whether the rule is an "above average" rule. 1 indicates 'above average'.
+//                This attribute is ignored if type is not equal to aboveAverage.
+//equalAverage    (Equal Average)
+//                Flag indicating whether the 'aboveAverage' and 'belowAverage' criteria is inclusive of the
+//                average itself, or exclusive of that value. 1 indicates to include the average value in the
+//                criteria. This attribute is ignored if type is not equal to aboveAverage.
+//bottom          (Bottom N) Indicates whether a "top/bottom n" rule is a "bottom n" rule. 1 indicates 'bottom'.
+//                This attribute is ignored if type is not equal to top10.
+//dxfId           (Differential Formatting Id)
+//                This is an index to a dxf element in the Styles Part indicating which cell formatting to
+//                apply when the conditional formatting rule criteria is met. ST_DxfId simple type (§18.18.25).
+//operator        (Operator) The operator in a "cell value is" conditional formatting rule. This attribute is ignored if
+//                type is not equal to cellIs. The possible values ST_ConditionalFormattingOperator simple type (§18.18.15).
+//percent         (Top 10 Percent)
+//                Indicates whether a "top/bottom n" rule is a "top/bottom n percent" rule. This attribute
+//                is ignored if type is not equal to top10.
+//rank            (Rank) The value of "n" in a "top/bottom n" conditional formatting rule. This attribute is ignored
+//                if type is not equal to top10.
+//stdDev          (StdDev) The number of standard deviations to include above or below the average in the
+//                conditional formatting rule. This attribute is ignored if type is not equal to aboveAverage.
+//                If a value is present for stdDev and the rule type = aboveAverage, then this rule is automatically an
+//                "above or below N standard deviations" rule.
+//text            (Text) The text value in a "text contains" conditional formatting rule. This attribute is ignored if
+//                type is not equal to containsText.
+//timePeriod      (Time Period) The applicable time period in a "date occurring…" conditional formatting rule. This
+//                attribute is ignored if type is not equal to timePeriod. ST_TimePeriod §18.18.82.
+#endregion
+
+#region Conditional Formatting XML examples
+// All the examples are assumed to be inside <conditionalFormatting sqref="A1:A10">
+
+#region Example "beginsWith"
+//<x:cfRule type="beginsWith" dxfId="6" priority="5" operator="beginsWith" text="a">
+//  <x:formula>LEFT(A1,LEN("a"))="a"</x:formula>
+//</x:cfRule>
+
+//<x:cfRule type="beginsWith" dxfId="5" priority="14" operator="beginsWith" text="&quot;&lt;&gt;">
+//  <x:formula>LEFT(A3,LEN("""&lt;&gt;"))="""&lt;&gt;"</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "between"
+//<x:cfRule type="cellIs" dxfId="8" priority="10" operator="between">
+//  <x:formula>3</x:formula>
+//  <x:formula>7</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "containsText"
+//<x:cfRule type="containsText" dxfId="5" priority="4" operator="containsText" text="c">
+//  <x:formula>NOT(ISERROR(SEARCH("c",A1)))</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "endsWith"
+//<x:cfRule type="endsWith" dxfId="9" priority="11" operator="endsWith" text="c">
+//  <x:formula>RIGHT(A1,LEN("c"))="c"</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "equal"
+//<x:cfRule type="cellIs" dxfId="7" priority="8" operator="equal">
+//  <x:formula>"ab"</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "greaterThan"
+//<x:cfRule type="cellIs" dxfId="6" priority="7" operator="greaterThan">
+//  <x:formula>4</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "greaterThanOrEqual"
+//<x:cfRule type="cellIs" dxfId="3" priority="4" operator="greaterThanOrEqual">
+//  <x:formula>4</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "lessThan"
+//<x:cfRule type="cellIs" dxfId="5" priority="6" operator="lessThan">
+//  <x:formula>4</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "lessThanOrEqual"
+//<x:cfRule type="cellIs" dxfId="4" priority="5" operator="lessThanOrEqual">
+//  <x:formula>4</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "notBetween"
+//<x:cfRule type="cellIs" dxfId="2" priority="3" operator="notBetween">
+//  <x:formula>3</x:formula>
+//  <x:formula>7</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "notContainsText"
+//<x:cfRule type="notContainsText" dxfId="4" priority="3" operator="notContains" text="c">
+//  <x:formula>ISERROR(SEARCH("c",A1))</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "notEqual"
+//<x:cfRule type="cellIs" dxfId="1" priority="2" operator="notEqual">
+//  <x:formula>"ab"</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "containsBlanks"
+//<x:cfRule type="containsBlanks" dxfId="20" priority="37">
+//  <x:formula>LEN(TRIM(A1))=0</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "containsErrors"
+//<x:cfRule type="containsErrors" dxfId="15" priority="19">
+//  <x:formula>ISERROR(A1)</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "expression"
+//<x:cfRule type="expression" dxfId="0" priority="1">
+//  <x:formula>RIGHT(J16,1)="b"</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "duplicateValues"
+//<x:cfRule type="duplicateValues" dxfId="14" priority="16" />
+#endregion
+
+#region Example "notContainsBlanks"
+//<x:cfRule type="notContainsBlanks" dxfId="12" priority="14">
+//  <x:formula>LEN(TRIM(A1))&gt;0</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "notContainsErrors"
+//<x:cfRule type="notContainsErrors" dxfId="11" priority="36">
+//  <x:formula>NOT(ISERROR(A1))</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "uniqueValues"
+//<x:cfRule type="uniqueValues" dxfId="13" priority="15" />
+#endregion
+
+#region Example "last7Days"
+//<x:cfRule type="timePeriod" dxfId="39" priority="10" timePeriod="last7Days">
+//  <x:formula>AND(TODAY()-FLOOR(A1,1)&lt;=6,FLOOR(A1,1)&lt;=TODAY())</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "lastMonth"
+//<x:cfRule type="timePeriod" dxfId="38" priority="9" timePeriod="lastMonth">
+//  <x:formula>AND(MONTH(A1)=MONTH(EDATE(TODAY(),0-1)),YEAR(A1)=YEAR(EDATE(TODAY(),0-1)))</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "lastWeek"
+//<x:cfRule type="timePeriod" dxfId="37" priority="8" timePeriod="lastWeek">
+//  <x:formula>AND(TODAY()-ROUNDDOWN(A1,0)&gt;=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(A1,0)&lt;(WEEKDAY(TODAY())+7))</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "nextMonth"
+//<x:cfRule type="timePeriod" dxfId="36" priority="7" timePeriod="nextMonth">
+//  <x:formula>AND(MONTH(A1)=MONTH(EDATE(TODAY(),0+1)),YEAR(A1)=YEAR(EDATE(TODAY(),0+1)))</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "nextWeek"
+//<x:cfRule type="timePeriod" dxfId="35" priority="6" timePeriod="nextWeek">
+//  <x:formula>AND(ROUNDDOWN(A1,0)-TODAY()&gt;(7-WEEKDAY(TODAY())),ROUNDDOWN(A1,0)-TODAY()&lt;(15-WEEKDAY(TODAY())))</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "thisMonth"
+//<x:cfRule type="timePeriod" dxfId="34" priority="5" timePeriod="thisMonth">
+//  <x:formula>AND(MONTH(A1)=MONTH(TODAY()),YEAR(A1)=YEAR(TODAY()))</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "thisWeek"
+//<x:cfRule type="timePeriod" dxfId="33" priority="4" timePeriod="thisWeek">
+//  <x:formula>AND(TODAY()-ROUNDDOWN(A1,0)&lt;=WEEKDAY(TODAY())-1,ROUNDDOWN(A1,0)-TODAY()&lt;=7-WEEKDAY(TODAY()))</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "today"
+//<x:cfRule type="timePeriod" dxfId="32" priority="3" timePeriod="today">
+//  <x:formula>FLOOR(A1,1)=TODAY()</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "tomorrow"
+//<x:cfRule type="timePeriod" dxfId="31" priority="2" timePeriod="tomorrow">
+//  <x:formula>FLOOR(A1,1)=TODAY()+1</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "yesterday"
+//<x:cfRule type="timePeriod" dxfId="1" priority="1" timePeriod="yesterday">
+//  <x:formula>FLOOR(A1,1)=TODAY()-1</x:formula>
+//</x:cfRule>
+#endregion
+
+#region Example "twoColorScale"
+//<cfRule type="colorScale" priority="1">
+//  <colorScale>
+//    <cfvo type="min"/>
+//    <cfvo type="max"/>
+//    <color rgb="FFF8696B"/>
+//    <color rgb="FF63BE7B"/>
+//  </colorScale>
+//</cfRule>
+#endregion
+
+#region Examples "iconSet3" (x all the 3 IconSet options)
+//<x:cfRule type="iconSet" priority="30">
+//  <x:iconSet>
+//    <x:cfvo type="percent" val="0" />
+//    <x:cfvo type="percent" val="33" />
+//    <x:cfvo type="percent" val="67" />
+//  </x:iconSet>
+//</x:cfRule>
+
+//<x:cfRule type="iconSet" priority="38">
+//  <x:iconSet iconSet="3Arrows">
+//    <x:cfvo type="percent" val="0" />
+//    <x:cfvo type="percent" val="33" />
+//    <x:cfvo type="percent" val="67" />
+//  </x:iconSet>
+//</x:cfRule>
+#endregion
+
+#region Examples "iconSet4" (x all the 4 IconSet options)
+//<x:cfRule type="iconSet" priority="34">
+//  <x:iconSet iconSet="4ArrowsGray">
+//    <x:cfvo type="percent" val="0" />
+//    <x:cfvo type="percent" val="25" />
+//    <x:cfvo type="percent" val="50" />
+//    <x:cfvo type="percent" val="75" />
+//  </x:iconSet>
+//</x:cfRule>
+#endregion
+
+#region Examples "iconSet5" (x all the 5 IconSet options)
+//<x:cfRule type="iconSet" priority="32">
+//  <x:iconSet iconSet="5ArrowsGray">
+//    <x:cfvo type="percent" val="0" />
+//    <x:cfvo type="percent" val="20" />
+//    <x:cfvo type="percent" val="40" />
+//    <x:cfvo type="percent" val="60" />
+//    <x:cfvo type="percent" val="80" />
+//  </x:iconSet>
+//</x:cfRule>
+#endregion
+
+#region Examples "iconSet" Extended (not implemented yet)
+//<x:extLst>
+//  <x:ext xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main" uri="{78C0D931-6437-407d-A8EE-F0AAD7539E65}">
+//    <x14:conditionalFormattings>
+//      <x14:conditionalFormatting xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
+//        <x14:cfRule type="iconSet" priority="35" id="{F5114369-080A-47E6-B7EE-499137A3C896}">
+//          <x14:iconSet iconSet="3Triangles">
+//            <x14:cfvo type="percent">
+//              <xm:f>0</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>33</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>67</xm:f>
+//            </x14:cfvo>
+//          </x14:iconSet>
+//        </x14:cfRule>
+//        <xm:sqref>C3:C12</xm:sqref>
+//      </x14:conditionalFormatting>
+//      <x14:conditionalFormatting xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
+//        <x14:cfRule type="iconSet" priority="6" id="{0A327384-BF2F-4BF5-9767-123CD690A536}">
+//          <x14:iconSet iconSet="3Stars">
+//            <x14:cfvo type="percent">
+//              <xm:f>0</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>33</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>67</xm:f>
+//            </x14:cfvo>
+//          </x14:iconSet>
+//        </x14:cfRule>
+//        <xm:sqref>A16:A25</xm:sqref>
+//      </x14:conditionalFormatting>
+//      <x14:conditionalFormatting xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
+//        <x14:cfRule type="iconSet" priority="19" id="{0DDCA3E4-3536-44B3-A663-4877587295B8}">
+//          <x14:iconSet iconSet="3Triangles">
+//            <x14:cfvo type="percent">
+//              <xm:f>0</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>33</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>67</xm:f>
+//            </x14:cfvo>
+//          </x14:iconSet>
+//        </x14:cfRule>
+//        <xm:sqref>C16:C25</xm:sqref>
+//      </x14:conditionalFormatting>
+//      <x14:conditionalFormatting xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
+//        <x14:cfRule type="iconSet" priority="2" id="{E4EDD7FB-880C-408F-B87C-C8DA446AEB78}">
+//          <x14:iconSet iconSet="5Boxes">
+//            <x14:cfvo type="percent">
+//              <xm:f>0</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>20</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>40</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>60</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="percent">
+//              <xm:f>80</xm:f>
+//            </x14:cfvo>
+//          </x14:iconSet>
+//        </x14:cfRule>
+//        <xm:sqref>E16:E25</xm:sqref>
+//      </x14:conditionalFormatting>
+//      <x14:conditionalFormatting xmlns:xm="http://schemas.microsoft.com/office/excel/2006/main">
+//        <x14:cfRule type="iconSet" priority="1" id="{4CC82060-CB0A-4A31-AEF2-D1A587AC1674}">
+//          <x14:iconSet iconSet="3Stars" showValue="0" custom="1">
+//            <x14:cfvo type="percent">
+//              <xm:f>0</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="formula">
+//              <xm:f>$F$17</xm:f>
+//            </x14:cfvo>
+//            <x14:cfvo type="num">
+//              <xm:f>4</xm:f>
+//            </x14:cfvo>
+//            <x14:cfIcon iconSet="3Triangles" iconId="1" />
+//            <x14:cfIcon iconSet="4RedToBlack" iconId="3" />
+//            <x14:cfIcon iconSet="3Stars" iconId="2" />
+//          </x14:iconSet>
+//        </x14:cfRule>
+//        <xm:sqref>F16:F25</xm:sqref>
+//      </x14:conditionalFormatting>
+//    </x14:conditionalFormattings>
+//  </x:ext>
+//</x:extLst>
+#endregion
+
+
+#endregion
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingAverageGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingAverageGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingAverageGroup.cs	(revision 9616)
@@ -0,0 +1,49 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingAverageGroup
+  /// </summary>
+  public interface IExcelConditionalFormattingAverageGroup
+    : IExcelConditionalFormattingRule
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingBeginsWith.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingBeginsWith.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingBeginsWith.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingBeginsWith
+  /// </summary>
+  public interface IExcelConditionalFormattingBeginsWith
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithText
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingBetween.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingBetween.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingBetween.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingBetween
+  /// </summary>
+  public interface IExcelConditionalFormattingBetween
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithFormula2
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingColorScaleGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingColorScaleGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingColorScaleGroup.cs	(revision 9616)
@@ -0,0 +1,49 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+	/// <summary>
+  /// IExcelConditionalFormattingColorScaleGroup
+	/// </summary>
+  public interface IExcelConditionalFormattingColorScaleGroup
+		: IExcelConditionalFormattingRule
+	{
+		#region Public Properties
+		#endregion Public Properties
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingContainsBlanks.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingContainsBlanks.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingContainsBlanks.cs	(revision 9616)
@@ -0,0 +1,49 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingContainsBlanks
+  /// </summary>
+  public interface IExcelConditionalFormattingContainsBlanks
+    : IExcelConditionalFormattingRule
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingContainsErrors.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingContainsErrors.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingContainsErrors.cs	(revision 9616)
@@ -0,0 +1,49 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingContainsErrors
+  /// </summary>
+  public interface IExcelConditionalFormattingContainsErrors
+    : IExcelConditionalFormattingRule
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingContainsText.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingContainsText.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingContainsText.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingContainsText
+  /// </summary>
+  public interface IExcelConditionalFormattingContainsText
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithText
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingDataBarGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingDataBarGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingDataBarGroup.cs	(revision 9616)
@@ -0,0 +1,67 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+using System.Drawing;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+	/// <summary>
+	/// IExcelConditionalFormattingDataBar
+	/// </summary>
+	public interface IExcelConditionalFormattingDataBarGroup
+        : IExcelConditionalFormattingRule
+	{
+		#region Public Properties
+        /// <summary>
+        /// ShowValue
+        /// </summary>
+        bool ShowValue { get; set; }
+        /// <summary>
+        /// Databar Low Value
+        /// </summary>
+        ExcelConditionalFormattingIconDataBarValue LowValue { get;  }
+
+        /// <summary>
+        /// Databar High Value
+        /// </summary>
+        ExcelConditionalFormattingIconDataBarValue HighValue { get; }
+        /// <summary>
+        /// The color of the databar
+        /// </summary>
+        Color Color { get; set;}
+        #endregion Public Properties
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingDuplicateValues.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingDuplicateValues.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingDuplicateValues.cs	(revision 9616)
@@ -0,0 +1,49 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingDuplicateValues
+  /// </summary>
+  public interface IExcelConditionalFormattingDuplicateValues
+    : IExcelConditionalFormattingRule
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingEndsWith.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingEndsWith.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingEndsWith.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingEndsWith
+  /// </summary>
+  public interface IExcelConditionalFormattingEndsWith
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithText
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingEqual.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingEqual.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingEqual.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingEqual
+  /// </summary>
+  public interface IExcelConditionalFormattingEqual
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithFormula
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingExpression.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingExpression.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingExpression.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingExpression
+  /// </summary>
+  public interface IExcelConditionalFormattingExpression
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithFormula
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingFiveIconSet.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingFiveIconSet.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingFiveIconSet.cs	(revision 9616)
@@ -0,0 +1,52 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingFiveIconSet
+  /// </summary>eExcelconditionalFormatting4IconsSetType
+    public interface IExcelConditionalFormattingFiveIconSet : IExcelConditionalFormattingFourIconSet<eExcelconditionalFormatting5IconsSetType>
+  {
+    #region Public Properties
+    /// <summary>
+    /// Icon5 (part of the 5 Icon Set)
+    /// </summary>
+      ExcelConditionalFormattingIconDataBarValue Icon5 { get; }
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingFourIconSet.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingFourIconSet.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingFourIconSet.cs	(revision 9616)
@@ -0,0 +1,52 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingFourIconSet
+  /// </summary>
+    public interface IExcelConditionalFormattingFourIconSet<T> : IExcelConditionalFormattingThreeIconSet<T>
+  {
+    #region Public Properties
+    /// <summary>
+    /// Icon4 (part of the 4 ou 5 Icon Set)
+    /// </summary>
+      ExcelConditionalFormattingIconDataBarValue Icon4 { get; }      
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingGreaterThan.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingGreaterThan.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingGreaterThan.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingGreaterThan
+  /// </summary>
+  public interface IExcelConditionalFormattingGreaterThan
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithFormula
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingGreaterThanOrEqual.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingGreaterThanOrEqual.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingGreaterThanOrEqual.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingGreaterThanOrEqual
+  /// </summary>
+  public interface IExcelConditionalFormattingGreaterThanOrEqual
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithFormula
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingIconSetGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingIconSetGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingIconSetGroup.cs	(revision 9616)
@@ -0,0 +1,63 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+	/// <summary>
+	/// IExcelConditionalFormattingIconSetGroup
+	/// </summary>
+	public interface IExcelConditionalFormattingIconSetGroup<T>
+		: IExcelConditionalFormattingRule
+	{
+		#region Public Properties
+    /// <summary>
+    /// Reverse
+    /// </summary>
+    bool Reverse { get; set; }
+
+    /// <summary>
+    /// ShowValue
+    /// </summary>
+    bool ShowValue { get; set; }
+
+    /// <summary>
+    /// IconSet (3, 4 ou 5 IconSet)
+    /// </summary>
+    T IconSet { get; set; }
+    #endregion Public Properties
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingLessThan.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingLessThan.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingLessThan.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingLessThan
+  /// </summary>
+  public interface IExcelConditionalFormattingLessThan
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithFormula
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingLessThanOrEqual.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingLessThanOrEqual.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingLessThanOrEqual.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingGreaterThanOrEqual
+  /// </summary>
+  public interface IExcelConditionalFormattingLessThanOrEqual
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithFormula
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotBetween.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotBetween.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotBetween.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingNotBetween
+  /// </summary>
+  public interface IExcelConditionalFormattingNotBetween
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithFormula2
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotContainsBlanks.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotContainsBlanks.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotContainsBlanks.cs	(revision 9616)
@@ -0,0 +1,49 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingNotContainsBlanks
+  /// </summary>
+  public interface IExcelConditionalFormattingNotContainsBlanks
+    : IExcelConditionalFormattingRule
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotContainsErrors.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotContainsErrors.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotContainsErrors.cs	(revision 9616)
@@ -0,0 +1,49 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingNotContainsErrors
+  /// </summary>
+  public interface IExcelConditionalFormattingNotContainsErrors
+    : IExcelConditionalFormattingRule
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotContainsText.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotContainsText.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotContainsText.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingNotContainsText
+  /// </summary>
+  public interface IExcelConditionalFormattingNotContainsText
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithText
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotEqual.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotEqual.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingNotEqual.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingNotEqual
+  /// </summary>
+  public interface IExcelConditionalFormattingNotEqual
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithFormula
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingRule.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingRule.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingRule.cs	(revision 9616)
@@ -0,0 +1,87 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						              Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting         2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style.Dxf;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+	/// <summary>
+	/// Interface for conditional formatting rule
+	/// </summary>
+	public interface IExcelConditionalFormattingRule
+	{
+    /// <summary>
+    /// The 'cfRule' XML node
+    /// </summary>
+    XmlNode Node { get; }
+
+    /// <summary>
+    /// Type of conditional formatting rule. ST_CfType §18.18.12.
+    /// </summary>
+    eExcelConditionalFormattingRuleType Type { get; }
+
+    /// <summary>
+    /// <para>Range over which these conditional formatting rules apply.</para>
+    /// <para>The possible values for this attribute are defined by the
+    /// ST_Sqref simple type (§18.18.76).</para>
+    /// </summary>
+    ExcelAddress Address { get; set; }
+
+		/// <summary>
+		/// The priority of this conditional formatting rule. This value is used to determine
+		/// which format should be evaluated and rendered. Lower numeric values are higher
+		/// priority than higher numeric values, where 1 is the highest priority.
+		/// </summary>
+    int Priority { get; set; }
+
+    /// <summary>
+    /// If this flag is 1, no rules with lower priority shall be applied over this rule,
+    /// when this rule evaluates to true.
+    /// </summary>
+    bool StopIfTrue { get; set; }
+
+    ///// <summary>
+    ///// <para>This is an index to a dxf element in the Styles Part indicating which cell
+    ///// formatting to apply when the conditional formatting rule criteria is met.</para>
+    ///// <para>The possible values for this attribute are defined by the ST_DxfId simple type
+    ///// (§18.18.25).</para>
+    ///// </summary>
+//    int DxfId { get; set; }
+    /// <summary>
+    /// Gives access to the differencial styling (DXF) for the rule.
+    /// </summary>
+    ExcelDxfStyleConditionalFormatting Style{ get; }
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingStdDevGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingStdDevGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingStdDevGroup.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+	/// <summary>
+  /// IExcelConditionalFormattingStdDevGroup
+	/// </summary>
+  public interface IExcelConditionalFormattingStdDevGroup
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithStdDev
+  {
+		#region Public Properties
+		#endregion Public Properties
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingThreeColorScale.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingThreeColorScale.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingThreeColorScale.cs	(revision 9616)
@@ -0,0 +1,53 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+	/// <summary>
+	/// IExcelConditionalFormattingThreeColorScale
+	/// </summary>
+	public interface IExcelConditionalFormattingThreeColorScale
+    : IExcelConditionalFormattingTwoColorScale
+	{
+		#region Public Properties
+		/// <summary>
+		/// Three Color Scale Middle Value
+		/// </summary>
+		ExcelConditionalFormattingColorScaleValue MiddleValue { get; set; }
+		#endregion Public Properties
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingThreeIconSet.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingThreeIconSet.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingThreeIconSet.cs	(revision 9616)
@@ -0,0 +1,63 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+	/// <summary>
+	/// IExcelConditionalFormattingThreeIconSet
+	/// </summary>
+	public interface IExcelConditionalFormattingThreeIconSet<T>
+    : IExcelConditionalFormattingIconSetGroup<T>
+	{
+		#region Public Properties
+    /// <summary>
+    /// Icon1 (part of the 3, 4 ou 5 Icon Set)
+    /// </summary>
+        ExcelConditionalFormattingIconDataBarValue Icon1 { get; }
+
+    /// <summary>
+    /// Icon2 (part of the 3, 4 ou 5 Icon Set)
+    /// </summary>
+    ExcelConditionalFormattingIconDataBarValue Icon2 { get;  }
+
+    /// <summary>
+    /// Icon3 (part of the 3, 4 ou 5 Icon Set)
+    /// </summary>
+    ExcelConditionalFormattingIconDataBarValue Icon3 { get; }
+    #endregion Public Properties
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingTimePeriodGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingTimePeriodGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingTimePeriodGroup.cs	(revision 9616)
@@ -0,0 +1,49 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+	/// <summary>
+	/// IExcelConditionalFormattingTimePeriod
+	/// </summary>
+	public interface IExcelConditionalFormattingTimePeriodGroup
+		: IExcelConditionalFormattingRule
+	{
+		#region Public Properties
+		#endregion Public Properties
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingTopBottomGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingTopBottomGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingTopBottomGroup.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingTopBottomGroup
+  /// </summary>
+  public interface IExcelConditionalFormattingTopBottomGroup
+    : IExcelConditionalFormattingRule,
+    IExcelConditionalFormattingWithRank
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingTwoColorScale.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingTwoColorScale.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingTwoColorScale.cs	(revision 9616)
@@ -0,0 +1,58 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+	/// <summary>
+	/// IExcelConditionalFormattingTwoColorScale
+	/// </summary>
+	public interface IExcelConditionalFormattingTwoColorScale
+		: IExcelConditionalFormattingColorScaleGroup
+	{
+		#region Public Properties
+    /// <summary>
+    /// Two Color Scale Low Value
+    /// </summary>
+    ExcelConditionalFormattingColorScaleValue LowValue { get; set; }
+
+    /// <summary>
+    /// Two Color Scale High Value
+    /// </summary>
+    ExcelConditionalFormattingColorScaleValue HighValue { get; set; }
+    #endregion Public Properties
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingUniqueValues.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingUniqueValues.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingUniqueValues.cs	(revision 9616)
@@ -0,0 +1,49 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingUniqueValues
+  /// </summary>
+  public interface IExcelConditionalFormattingUniqueValues
+    : IExcelConditionalFormattingRule
+  {
+    #region Public Properties
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithFormula.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithFormula.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithFormula.cs	(revision 9616)
@@ -0,0 +1,52 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingWithFormula
+  /// </summary>
+  public interface IExcelConditionalFormattingWithFormula
+  {
+    #region Public Properties
+    /// <summary>
+    /// Formula Attribute
+    /// </summary>
+    string Formula { get; set; }
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithFormula2.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithFormula2.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithFormula2.cs	(revision 9616)
@@ -0,0 +1,53 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingWithFormula2
+  /// </summary>
+  public interface IExcelConditionalFormattingWithFormula2
+    : IExcelConditionalFormattingWithFormula
+  {
+    #region Public Properties
+    /// <summary>
+    /// Formula2 Attribute
+    /// </summary>
+    string Formula2 { get; set; }
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithRank.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithRank.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithRank.cs	(revision 9616)
@@ -0,0 +1,52 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingWithRank
+  /// </summary>
+  public interface IExcelConditionalFormattingWithRank
+  {
+    #region Public Properties
+    /// <summary>
+    /// Rank Attribute
+    /// </summary>
+    UInt16 Rank { get; set; }
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithReverse.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithReverse.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithReverse.cs	(revision 9616)
@@ -0,0 +1,52 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingWithReverse
+  /// </summary>
+  public interface IExcelConditionalFormattingWithReverse
+  {
+    #region Public Properties
+    /// <summary>
+    /// Reverse Attribute
+    /// </summary>
+    bool Reverse { get; set; }
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithShowValue.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithShowValue.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithShowValue.cs	(revision 9616)
@@ -0,0 +1,52 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingWithShowValue
+  /// </summary>
+  public interface IExcelConditionalFormattingWithShowValue
+  {
+    #region Public Properties
+    /// <summary>
+    /// ShowValue Attribute
+    /// </summary>
+    bool ShowValue { get; set; }
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithStdDev.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithStdDev.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithStdDev.cs	(revision 9616)
@@ -0,0 +1,52 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingWithStdDev
+  /// </summary>
+  public interface IExcelConditionalFormattingWithStdDev
+  {
+    #region Public Properties
+    /// <summary>
+    /// StdDev Attribute
+    /// </summary>
+    UInt16 StdDev { get; set; }
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithText.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithText.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IExcelConditionalFormattingWithText.cs	(revision 9616)
@@ -0,0 +1,52 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+using OfficeOpenXml.ConditionalFormatting;
+
+namespace OfficeOpenXml.ConditionalFormatting.Contracts
+{
+  /// <summary>
+  /// IExcelConditionalFormattingWithText
+  /// </summary>
+  public interface IExcelConditionalFormattingWithText
+  {
+    #region Public Properties
+    /// <summary>
+    /// Text Attribute
+    /// </summary>
+    string Text { get; set; }
+    #endregion Public Properties
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IRangeConditionalFormatting.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IRangeConditionalFormatting.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Contracts/IRangeConditionalFormatting.cs	(revision 9616)
@@ -0,0 +1,313 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author             Change                    Date
+ * ******************************************************************************
+ * Eyal Seagull		    Conditional Formatting    2012-04-03
+ *******************************************************************************/
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+using System.Drawing;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+	/// <summary>
+	/// Provides functionality for adding Conditional Formatting to a range (<see cref="ExcelRangeBase"/>).
+	/// Each method will return a configurable condtional formatting type.
+	/// </summary>
+	public interface IRangeConditionalFormatting
+	{
+    /// <summary>
+    /// Adds a Above Average rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingAverageGroup AddAboveAverage();
+
+    /// <summary>
+    /// Adds a Above Or Equal Average rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingAverageGroup AddAboveOrEqualAverage();
+
+    /// <summary>
+    /// Adds a Below Average rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingAverageGroup AddBelowAverage();
+
+    /// <summary>
+    /// Adds a Below Or Equal Average rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingAverageGroup AddBelowOrEqualAverage();
+
+    /// <summary>
+    /// Adds a Above StdDev rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingStdDevGroup AddAboveStdDev();
+
+    /// <summary>
+    /// Adds a Below StdDev rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingStdDevGroup AddBelowStdDev();
+
+    /// <summary>
+    /// Adds a Bottom rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTopBottomGroup AddBottom();
+
+    /// <summary>
+    /// Adds a Bottom Percent rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTopBottomGroup AddBottomPercent();
+
+    /// <summary>
+    /// Adds a Top rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTopBottomGroup AddTop();
+
+    /// <summary>
+    /// Adds a Top Percent rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTopBottomGroup AddTopPercent();
+
+    /// <summary>
+    /// Adds a Last 7 Days rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddLast7Days();
+
+    /// <summary>
+    /// Adds a Last Month rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddLastMonth();
+
+    /// <summary>
+    /// Adds a Last Week rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddLastWeek();
+
+    /// <summary>
+    /// Adds a Next Month rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddNextMonth();
+
+    /// <summary>
+    /// Adds a Next Week rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddNextWeek();
+
+    /// <summary>
+    /// Adds a This Month rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddThisMonth();
+
+    /// <summary>
+    /// Adds a This Week rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddThisWeek();
+
+    /// <summary>
+    /// Adds a Today rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddToday();
+
+    /// <summary>
+    /// Adds a Tomorrow rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddTomorrow();
+
+    /// <summary>
+    /// Adds a Yesterday rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTimePeriodGroup AddYesterday();
+
+    /// <summary>
+    /// Adds a Begins With rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingBeginsWith AddBeginsWith();
+
+    /// <summary>
+    /// Adds a Between rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingBetween AddBetween();
+
+    /// <summary>
+    /// Adds a ContainsBlanks rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingContainsBlanks AddContainsBlanks();
+
+    /// <summary>
+    /// Adds a ContainsErrors rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingContainsErrors AddContainsErrors();
+
+    /// <summary>
+    /// Adds a ContainsText rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingContainsText AddContainsText();
+
+    /// <summary>
+    /// Adds a DuplicateValues rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingDuplicateValues AddDuplicateValues();
+
+    /// <summary>
+    /// Adds a EndsWith rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingEndsWith AddEndsWith();
+
+    /// <summary>
+    /// Adds a Equal rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingEqual AddEqual();
+
+    /// <summary>
+    /// Adds a Expression rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingExpression AddExpression();
+
+    /// <summary>
+    /// Adds a GreaterThan rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingGreaterThan AddGreaterThan();
+
+    /// <summary>
+    /// Adds a GreaterThanOrEqual rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingGreaterThanOrEqual AddGreaterThanOrEqual();
+
+    /// <summary>
+    /// Adds a LessThan rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingLessThan AddLessThan();
+
+    /// <summary>
+    /// Adds a LessThanOrEqual rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingLessThanOrEqual AddLessThanOrEqual();
+
+    /// <summary>
+    /// Adds a NotBetween rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingNotBetween AddNotBetween();
+
+    /// <summary>
+    /// Adds a NotContainsBlanks rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingNotContainsBlanks AddNotContainsBlanks();
+
+    /// <summary>
+    /// Adds a NotContainsErrors rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingNotContainsErrors AddNotContainsErrors();
+
+    /// <summary>
+    /// Adds a NotContainsText rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingNotContainsText AddNotContainsText();
+
+    /// <summary>
+    /// Adds a NotEqual rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingNotEqual AddNotEqual();
+
+    /// <summary>
+    /// Adds a UniqueValues rule to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingUniqueValues AddUniqueValues();
+
+    /// <summary>
+    /// Adds a <see cref="ExcelConditionalFormattingThreeColorScale"/> to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingThreeColorScale AddThreeColorScale();
+
+    /// <summary>
+    /// Adds a <see cref="ExcelConditionalFormattingTwoColorScale"/> to the range
+    /// </summary>
+    /// <returns></returns>
+    IExcelConditionalFormattingTwoColorScale AddTwoColorScale();
+
+    /// <summary>
+    /// Adds a <see cref="IExcelConditionalFormattingThreeIconSet&lt;eExcelconditionalFormatting3IconsSetType&gt;"/> to the range
+    /// </summary>
+    /// <param name="IconSet"></param>
+    /// <returns></returns>
+    IExcelConditionalFormattingThreeIconSet<eExcelconditionalFormatting3IconsSetType> AddThreeIconSet(eExcelconditionalFormatting3IconsSetType IconSet);
+    /// <summary>
+    /// Adds a <see cref="IExcelConditionalFormattingFourIconSet&lt;eExcelconditionalFormatting4IconsSetType&gt;"/> to the range
+    /// </summary>
+    /// <param name="IconSet"></param>
+    /// <returns></returns>
+    IExcelConditionalFormattingFourIconSet<eExcelconditionalFormatting4IconsSetType> AddFourIconSet(eExcelconditionalFormatting4IconsSetType IconSet);
+    /// <summary>
+    /// Adds a <see cref="IExcelConditionalFormattingFiveIconSet"/> to the range
+    /// </summary>
+    /// <param name="IconSet"></param>
+    /// <returns></returns>
+    IExcelConditionalFormattingFiveIconSet AddFiveIconSet(eExcelconditionalFormatting5IconsSetType IconSet);
+    /// <summary>
+    /// Adds a <see cref="IExcelConditionalFormattingDataBarGroup"/> to the range
+    /// </summary>
+    /// <param name="color"></param>
+    /// <returns></returns>
+    IExcelConditionalFormattingDataBarGroup AddDatabar(Color color);
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingCollection.cs	(revision 9616)
@@ -0,0 +1,999 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author					Change						                Date
+ * ******************************************************************************
+ * Eyal Seagull		Conditional Formatting            2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Collections;
+using OfficeOpenXml.Utils;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+using System.Text.RegularExpressions;
+using System.Drawing;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// Collection of <see cref="ExcelConditionalFormattingRule"/>.
+  /// This class is providing the API for EPPlus conditional formatting.
+  /// </summary>
+  /// <remarks>
+  /// <para>
+  /// The public methods of this class (Add[...]ConditionalFormatting) will create a ConditionalFormatting/CfRule entry in the worksheet. When this
+  /// Conditional Formatting has been created changes to the properties will affect the workbook immediately.
+  /// </para>
+  /// <para>
+  /// Each type of Conditional Formatting Rule has diferente set of properties.
+  /// </para>
+  /// <code>
+  /// // Add a Three Color Scale conditional formatting
+  /// var cf = worksheet.ConditionalFormatting.AddThreeColorScale(new ExcelAddress("A1:C10"));
+  /// // Set the conditional formatting properties
+  /// cf.LowValue.Type = ExcelConditionalFormattingValueObjectType.Min;
+  /// cf.LowValue.Color = Color.White;
+  /// cf.MiddleValue.Type = ExcelConditionalFormattingValueObjectType.Percent;
+  /// cf.MiddleValue.Value = 50;
+  /// cf.MiddleValue.Color = Color.Blue;
+  /// cf.HighValue.Type = ExcelConditionalFormattingValueObjectType.Max;
+  /// cf.HighValue.Color = Color.Black;
+  /// </code>
+  /// </remarks>
+  public class ExcelConditionalFormattingCollection
+    : XmlHelper,
+    IEnumerable<IExcelConditionalFormattingRule>
+  {
+    /****************************************************************************************/
+
+    #region Private Properties
+    private List<IExcelConditionalFormattingRule> _rules = new List<IExcelConditionalFormattingRule>();
+    private ExcelWorksheet _worksheet = null;
+    #endregion Private Properties
+
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// Initialize the <see cref="ExcelConditionalFormattingCollection"/>
+    /// </summary>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingCollection(
+      ExcelWorksheet worksheet)
+      : base(
+        worksheet.NameSpaceManager,
+        worksheet.WorksheetXml.DocumentElement)
+    {
+      Require.Argument(worksheet).IsNotNull("worksheet");
+
+      _worksheet = worksheet;
+      SchemaNodeOrder = _worksheet.SchemaNodeOrder;
+
+      // Look for all the <conditionalFormatting>
+      var conditionalFormattingNodes = TopNode.SelectNodes(
+        "//" + ExcelConditionalFormattingConstants.Paths.ConditionalFormatting,
+        _worksheet.NameSpaceManager);
+
+      // Check if we found at least 1 node
+      if ((conditionalFormattingNodes != null)
+        && (conditionalFormattingNodes.Count > 0))
+      {
+        // Foreach <conditionalFormatting>
+        foreach (XmlNode conditionalFormattingNode in conditionalFormattingNodes)
+        {
+          // Check if @sqref attribute exists
+          if (conditionalFormattingNode.Attributes[ExcelConditionalFormattingConstants.Attributes.Sqref] == null)
+          {
+            throw new Exception(
+              ExcelConditionalFormattingConstants.Errors.MissingSqrefAttribute);
+          }
+
+          // Get the @sqref attribute
+          ExcelAddress address = new ExcelAddress(
+            conditionalFormattingNode.Attributes[ExcelConditionalFormattingConstants.Attributes.Sqref].Value);
+
+          // Check for all the <cfRules> nodes and load them
+          var cfRuleNodes = conditionalFormattingNode.SelectNodes(
+            ExcelConditionalFormattingConstants.Paths.CfRule,
+            _worksheet.NameSpaceManager);
+
+          // Foreach <cfRule> inside the current <conditionalFormatting>
+          foreach (XmlNode cfRuleNode in cfRuleNodes)
+          {
+            // Check if @type attribute exists
+            if (cfRuleNode.Attributes[ExcelConditionalFormattingConstants.Attributes.Type] == null)
+            {
+              throw new Exception(
+                ExcelConditionalFormattingConstants.Errors.MissingTypeAttribute);
+            }
+
+            // Check if @priority attribute exists
+            if (cfRuleNode.Attributes[ExcelConditionalFormattingConstants.Attributes.Priority] == null)
+            {
+              throw new Exception(
+                ExcelConditionalFormattingConstants.Errors.MissingPriorityAttribute);
+            }
+
+            // Get the <cfRule> main attributes
+            string typeAttribute = ExcelConditionalFormattingHelper.GetAttributeString(
+              cfRuleNode,
+              ExcelConditionalFormattingConstants.Attributes.Type);
+
+            int priority = ExcelConditionalFormattingHelper.GetAttributeInt(
+              cfRuleNode,
+              ExcelConditionalFormattingConstants.Attributes.Priority);
+
+            // Transform the @type attribute to EPPlus Rule Type (slighty diferente)
+            var type = ExcelConditionalFormattingRuleType.GetTypeByAttrbiute(
+              typeAttribute,
+              cfRuleNode,
+              _worksheet.NameSpaceManager);
+
+            // Create the Rule according to the correct type, address and priority
+            var cfRule = ExcelConditionalFormattingRuleFactory.Create(
+              type,
+              address,
+              priority,
+              _worksheet,
+              cfRuleNode);
+
+            // Add the new rule to the list
+            if(cfRule!=null)
+              _rules.Add(cfRule);
+          }
+        }
+      }
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+
+    #region Methods
+    /// <summary>
+    /// 
+    /// </summary>
+    private void EnsureRootElementExists()
+    {
+      // Find the <worksheet> node
+      if (_worksheet.WorksheetXml.DocumentElement == null)
+      {
+        throw new Exception(
+          ExcelConditionalFormattingConstants.Errors.MissingWorksheetNode);
+      }
+    }
+
+    /// <summary>
+    /// GetRootNode
+    /// </summary>
+    /// <returns></returns>
+    private XmlNode GetRootNode()
+    {
+      EnsureRootElementExists();
+      return _worksheet.WorksheetXml.DocumentElement;
+    }
+
+    /// <summary>
+    /// Validates address - not empty (collisions are allowded)
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    private ExcelAddress ValidateAddress(
+      ExcelAddress address)
+    {
+      Require.Argument(address).IsNotNull("address");
+
+      //TODO: Are there any other validation we need to do?
+      return address;
+    }
+
+    /// <summary>
+    /// Get the next priority sequencial number
+    /// </summary>
+    /// <returns></returns>
+    private int GetNextPriority()
+    {
+      // Consider zero as the last priority when we have no CF rules
+      int lastPriority = 0;
+
+      // Search for the last priority
+      foreach (var cfRule in _rules)
+      {
+        if (cfRule.Priority > lastPriority)
+        {
+          lastPriority = cfRule.Priority;
+        }
+      }
+
+      // Our next priority is the last plus one
+      return lastPriority + 1;
+    }
+    #endregion Methods
+
+    /****************************************************************************************/
+
+    #region IEnumerable<IExcelConditionalFormatting>
+    /// <summary>
+    /// Number of validations
+    /// </summary>
+    public int Count
+    {
+      get { return _rules.Count; }
+    }
+
+    /// <summary>
+    /// Index operator, returns by 0-based index
+    /// </summary>
+    /// <param name="index"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingRule this[int index]
+    {
+      get { return _rules[index]; }
+      set { _rules[index] = value; }
+    }
+
+    /// <summary>
+    /// Get the 'cfRule' enumerator
+    /// </summary>
+    /// <returns></returns>
+    IEnumerator<IExcelConditionalFormattingRule> IEnumerable<IExcelConditionalFormattingRule>.GetEnumerator()
+    {
+      return _rules.GetEnumerator();
+    }
+
+    /// <summary>
+    /// Get the 'cfRule' enumerator
+    /// </summary>
+    /// <returns></returns>
+    IEnumerator System.Collections.IEnumerable.GetEnumerator()
+    {
+      return _rules.GetEnumerator();
+    }
+
+    /// <summary>
+    /// Removes all 'cfRule' from the collection and from the XML.
+    /// <remarks>
+    /// This is the same as removing all the 'conditionalFormatting' nodes.
+    /// </remarks>
+    /// </summary>
+    public void RemoveAll()
+    {
+      // Look for all the <conditionalFormatting> nodes
+      var conditionalFormattingNodes = TopNode.SelectNodes(
+        "//" + ExcelConditionalFormattingConstants.Paths.ConditionalFormatting,
+        _worksheet.NameSpaceManager);
+
+      // Remove all the <conditionalFormatting> nodes one by one
+      foreach (XmlNode conditionalFormattingNode in conditionalFormattingNodes)
+      {
+        conditionalFormattingNode.ParentNode.RemoveChild(conditionalFormattingNode);
+      }
+
+      // Clear the <cfRule> item list
+      _rules.Clear();
+    }
+
+    /// <summary>
+    /// Remove a Conditional Formatting Rule by its object
+    /// </summary>
+    /// <param name="item"></param>
+    public void Remove(
+      IExcelConditionalFormattingRule item)
+    {
+      Require.Argument(item).IsNotNull("item");
+
+      try
+      {
+        // Point to the parent node
+        var oldParentNode = item.Node.ParentNode;
+
+        // Remove the <cfRule> from the old <conditionalFormatting> parent node
+        oldParentNode.RemoveChild(item.Node);
+
+        // Check if the old <conditionalFormatting> parent node has <cfRule> node inside it
+        if (!oldParentNode.HasChildNodes)
+        {
+          // Remove the old parent node
+          oldParentNode.ParentNode.RemoveChild(oldParentNode);
+        }
+
+        _rules.Remove(item);
+      }
+      catch
+      {
+        throw new Exception(
+          ExcelConditionalFormattingConstants.Errors.InvalidRemoveRuleOperation);
+      }
+    }
+
+    /// <summary>
+    /// Remove a Conditional Formatting Rule by its 0-based index
+    /// </summary>
+    /// <param name="index"></param>
+    public void RemoveAt(
+      int index)
+    {
+      Require.Argument(index).IsInRange(0, this.Count - 1, "index");
+
+      Remove(this[index]);
+    }
+
+    /// <summary>
+    /// Remove a Conditional Formatting Rule by its priority
+    /// </summary>
+    /// <param name="priority"></param>
+    public void RemoveByPriority(
+      int priority)
+    {
+      try
+      {
+        Remove(RulesByPriority(priority));
+      }
+      catch
+      {
+      }
+    }
+
+    /// <summary>
+    /// Get a rule by its priority
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingRule RulesByPriority(
+      int priority)
+    {
+      return _rules.Find(x => x.Priority == priority);
+    }
+    #endregion IEnumerable<IExcelConditionalFormatting>
+
+    /****************************************************************************************/
+
+    #region Conditional Formatting Rules
+    /// <summary>
+    /// Add rule (internal)
+    /// </summary>
+    /// <param name="type"></param>
+    /// <param name="address"></param>
+    /// <returns></returns>F
+    internal IExcelConditionalFormattingRule AddRule(
+      eExcelConditionalFormattingRuleType type,
+      ExcelAddress address)
+    {
+      Require.Argument(address).IsNotNull("address");
+
+      address = ValidateAddress(address);
+      EnsureRootElementExists();
+
+      // Create the Rule according to the correct type, address and priority
+      IExcelConditionalFormattingRule cfRule = ExcelConditionalFormattingRuleFactory.Create(
+        type,
+        address,
+        GetNextPriority(),
+        _worksheet,
+        null);
+
+      // Add the newly created rule to the list
+      _rules.Add(cfRule);
+
+      // Return the newly created rule
+      return cfRule;
+    }
+
+    /// <summary>
+    /// Add AboveAverage Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingAverageGroup AddAboveAverage(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingAverageGroup)AddRule(
+        eExcelConditionalFormattingRuleType.AboveAverage,
+        address);
+    }
+
+    /// <summary>
+    /// Add AboveOrEqualAverage Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingAverageGroup AddAboveOrEqualAverage(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingAverageGroup)AddRule(
+        eExcelConditionalFormattingRuleType.AboveOrEqualAverage,
+        address);
+    }
+
+    /// <summary>
+    /// Add BelowAverage Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingAverageGroup AddBelowAverage(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingAverageGroup)AddRule(
+        eExcelConditionalFormattingRuleType.BelowAverage,
+        address);
+    }
+
+    /// <summary>
+    /// Add BelowOrEqualAverage Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingAverageGroup AddBelowOrEqualAverage(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingAverageGroup)AddRule(
+        eExcelConditionalFormattingRuleType.BelowOrEqualAverage,
+        address);
+    }
+
+    /// <summary>
+    /// Add AboveStdDev Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingStdDevGroup AddAboveStdDev(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingStdDevGroup)AddRule(
+        eExcelConditionalFormattingRuleType.AboveStdDev,
+        address);
+    }
+
+    /// <summary>
+    /// Add BelowStdDev Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingStdDevGroup AddBelowStdDev(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingStdDevGroup)AddRule(
+        eExcelConditionalFormattingRuleType.BelowStdDev,
+        address);
+    }
+
+    /// <summary>
+    /// Add Bottom Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTopBottomGroup AddBottom(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTopBottomGroup)AddRule(
+        eExcelConditionalFormattingRuleType.Bottom,
+        address);
+    }
+
+    /// <summary>
+    /// Add BottomPercent Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTopBottomGroup AddBottomPercent(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTopBottomGroup)AddRule(
+        eExcelConditionalFormattingRuleType.BottomPercent,
+        address);
+    }
+
+    /// <summary>
+    /// Add Top Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTopBottomGroup AddTop(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTopBottomGroup)AddRule(
+        eExcelConditionalFormattingRuleType.Top,
+        address);
+    }
+
+    /// <summary>
+    /// Add TopPercent Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTopBottomGroup AddTopPercent(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTopBottomGroup)AddRule(
+        eExcelConditionalFormattingRuleType.TopPercent,
+        address);
+    }
+
+    /// <summary>
+    /// Add Last7Days Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddLast7Days(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.Last7Days,
+        address);
+    }
+
+    /// <summary>
+    /// Add LastMonth Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddLastMonth(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.LastMonth,
+        address);
+    }
+
+    /// <summary>
+    /// Add LastWeek Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddLastWeek(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.LastWeek,
+        address);
+    }
+
+    /// <summary>
+    /// Add NextMonth Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddNextMonth(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.NextMonth,
+        address);
+    }
+
+    /// <summary>
+    /// Add NextWeek Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddNextWeek(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.NextWeek,
+        address);
+    }
+
+    /// <summary>
+    /// Add ThisMonth Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddThisMonth(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.ThisMonth,
+        address);
+    }
+
+    /// <summary>
+    /// Add ThisWeek Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddThisWeek(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.ThisWeek,
+        address);
+    }
+
+    /// <summary>
+    /// Add Today Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddToday(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.Today,
+        address);
+    }
+
+    /// <summary>
+    /// Add Tomorrow Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddTomorrow(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.Tomorrow,
+        address);
+    }
+
+    /// <summary>
+    /// Add Yesterday Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddYesterday(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTimePeriodGroup)AddRule(
+        eExcelConditionalFormattingRuleType.Yesterday,
+        address);
+    }
+
+    /// <summary>
+    /// Add BeginsWith Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingBeginsWith AddBeginsWith(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingBeginsWith)AddRule(
+        eExcelConditionalFormattingRuleType.BeginsWith,
+        address);
+    }
+
+    /// <summary>
+    /// Add Between Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingBetween AddBetween(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingBetween)AddRule(
+        eExcelConditionalFormattingRuleType.Between,
+        address);
+    }
+
+    /// <summary>
+    /// Add ContainsBlanks Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingContainsBlanks AddContainsBlanks(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingContainsBlanks)AddRule(
+        eExcelConditionalFormattingRuleType.ContainsBlanks,
+        address);
+    }
+
+    /// <summary>
+    /// Add ContainsErrors Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingContainsErrors AddContainsErrors(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingContainsErrors)AddRule(
+        eExcelConditionalFormattingRuleType.ContainsErrors,
+        address);
+    }
+
+    /// <summary>
+    /// Add ContainsText Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingContainsText AddContainsText(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingContainsText)AddRule(
+        eExcelConditionalFormattingRuleType.ContainsText,
+        address);
+    }
+
+    /// <summary>
+    /// Add DuplicateValues Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingDuplicateValues AddDuplicateValues(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingDuplicateValues)AddRule(
+        eExcelConditionalFormattingRuleType.DuplicateValues,
+        address);
+    }
+
+    /// <summary>
+    /// Add EndsWith Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingEndsWith AddEndsWith(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingEndsWith)AddRule(
+        eExcelConditionalFormattingRuleType.EndsWith,
+        address);
+    }
+
+    /// <summary>
+    /// Add Equal Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingEqual AddEqual(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingEqual)AddRule(
+        eExcelConditionalFormattingRuleType.Equal,
+        address);
+    }
+
+    /// <summary>
+    /// Add Expression Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingExpression AddExpression(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingExpression)AddRule(
+        eExcelConditionalFormattingRuleType.Expression,
+        address);
+    }
+
+    /// <summary>
+    /// Add GreaterThan Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingGreaterThan AddGreaterThan(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingGreaterThan)AddRule(
+        eExcelConditionalFormattingRuleType.GreaterThan,
+        address);
+    }
+
+    /// <summary>
+    /// Add GreaterThanOrEqual Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingGreaterThanOrEqual AddGreaterThanOrEqual(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingGreaterThanOrEqual)AddRule(
+        eExcelConditionalFormattingRuleType.GreaterThanOrEqual,
+        address);
+    }
+
+    /// <summary>
+    /// Add LessThan Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingLessThan AddLessThan(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingLessThan)AddRule(
+        eExcelConditionalFormattingRuleType.LessThan,
+        address);
+    }
+
+    /// <summary>
+    /// Add LessThanOrEqual Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingLessThanOrEqual AddLessThanOrEqual(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingLessThanOrEqual)AddRule(
+        eExcelConditionalFormattingRuleType.LessThanOrEqual,
+        address);
+    }
+
+    /// <summary>
+    /// Add NotBetween Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingNotBetween AddNotBetween(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingNotBetween)AddRule(
+        eExcelConditionalFormattingRuleType.NotBetween,
+        address);
+    }
+
+    /// <summary>
+    /// Add NotContainsBlanks Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingNotContainsBlanks AddNotContainsBlanks(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingNotContainsBlanks)AddRule(
+        eExcelConditionalFormattingRuleType.NotContainsBlanks,
+        address);
+    }
+
+    /// <summary>
+    /// Add NotContainsErrors Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingNotContainsErrors AddNotContainsErrors(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingNotContainsErrors)AddRule(
+        eExcelConditionalFormattingRuleType.NotContainsErrors,
+        address);
+    }
+
+    /// <summary>
+    /// Add NotContainsText Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingNotContainsText AddNotContainsText(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingNotContainsText)AddRule(
+        eExcelConditionalFormattingRuleType.NotContainsText,
+        address);
+    }
+
+    /// <summary>
+    /// Add NotEqual Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingNotEqual AddNotEqual(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingNotEqual)AddRule(
+        eExcelConditionalFormattingRuleType.NotEqual,
+        address);
+    }
+
+    /// <summary>
+    /// Add Unique Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingUniqueValues AddUniqueValues(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingUniqueValues)AddRule(
+        eExcelConditionalFormattingRuleType.UniqueValues,
+        address);
+    }
+
+    /// <summary>
+    /// Add ThreeColorScale Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingThreeColorScale AddThreeColorScale(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingThreeColorScale)AddRule(
+        eExcelConditionalFormattingRuleType.ThreeColorScale,
+        address);
+    }
+
+    /// <summary>
+    /// Add TwoColorScale Rule
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingTwoColorScale AddTwoColorScale(
+      ExcelAddress address)
+    {
+      return (IExcelConditionalFormattingTwoColorScale)AddRule(
+        eExcelConditionalFormattingRuleType.TwoColorScale,
+        address);
+    }
+
+    /// <summary>
+    /// Add ThreeIconSet Rule
+    /// </summary>
+    /// <param name="Address">The address</param>
+    /// <param name="IconSet">Type of iconset</param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingThreeIconSet<eExcelconditionalFormatting3IconsSetType> AddThreeIconSet(ExcelAddress Address, eExcelconditionalFormatting3IconsSetType IconSet)
+    {
+        var icon = (IExcelConditionalFormattingThreeIconSet<eExcelconditionalFormatting3IconsSetType>)AddRule(
+            eExcelConditionalFormattingRuleType.ThreeIconSet,
+            Address);
+        icon.IconSet = IconSet;
+        return icon;
+    }
+    /// <summary>
+    /// Adds a FourIconSet rule
+    /// </summary>
+    /// <param name="Address"></param>
+    /// <param name="IconSet"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingFourIconSet<eExcelconditionalFormatting4IconsSetType> AddFourIconSet(ExcelAddress Address, eExcelconditionalFormatting4IconsSetType IconSet)
+    {
+        var icon = (IExcelConditionalFormattingFourIconSet<eExcelconditionalFormatting4IconsSetType>)AddRule(
+            eExcelConditionalFormattingRuleType.FourIconSet,
+            Address);
+        icon.IconSet = IconSet;
+        return icon;
+    }
+    /// <summary>
+    /// Adds a FiveIconSet rule
+    /// </summary>
+    /// <param name="Address"></param>
+    /// <param name="IconSet"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingFiveIconSet AddFiveIconSet(ExcelAddress Address, eExcelconditionalFormatting5IconsSetType IconSet)
+    {
+        var icon = (IExcelConditionalFormattingFiveIconSet)AddRule(
+            eExcelConditionalFormattingRuleType.FiveIconSet,
+            Address);
+        icon.IconSet = IconSet;
+        return icon;
+    }
+    /// <summary>
+    /// Adds a databar rule
+    /// </summary>
+    /// <param name="Address"></param>
+    /// <param name="color"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingDataBarGroup AddDatabar(ExcelAddress Address, Color color)
+    {
+        var dataBar = (IExcelConditionalFormattingDataBarGroup)AddRule(
+            eExcelConditionalFormattingRuleType.DataBar,
+            Address);
+        dataBar.Color=color;
+        return dataBar;
+    }
+    #endregion Conditional Formatting Rules
+
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingColorScaleValue.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingColorScaleValue.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingColorScaleValue.cs	(revision 9616)
@@ -0,0 +1,511 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.Utils;
+using System.Text.RegularExpressions;
+using System.Globalization;
+using System.Security;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+	/// <summary>
+	/// 18.3.1.11 cfvo (Conditional Format Value Object)
+	/// Describes the values of the interpolation points in a gradient scale.
+	/// </summary>
+	public class ExcelConditionalFormattingColorScaleValue
+		: XmlHelper
+	{
+		/****************************************************************************************/
+
+		#region Private Properties
+		private eExcelConditionalFormattingValueObjectPosition _position;
+		private eExcelConditionalFormattingRuleType _ruleType;
+		private ExcelWorksheet _worksheet;
+		#endregion Private Properties
+
+		/****************************************************************************************/
+
+		#region Constructors
+    /// <summary>
+    /// Initialize the cfvo (§18.3.1.11) node
+    /// </summary>
+    /// <param name="position"></param>
+    /// <param name="type"></param>
+    /// <param name="color"></param>
+    /// <param name="value"></param>
+    /// <param name="formula"></param>
+    /// <param name="ruleType"></param>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode">The cfvo (§18.3.1.11) node parent. Can be any of the following:
+    /// colorScale (§18.3.1.16); dataBar (§18.3.1.28); iconSet (§18.3.1.49)</param>
+    /// <param name="namespaceManager"></param>
+		internal ExcelConditionalFormattingColorScaleValue(
+			eExcelConditionalFormattingValueObjectPosition position,
+			eExcelConditionalFormattingValueObjectType type,
+			Color color,
+			double value,
+			string formula,
+			eExcelConditionalFormattingRuleType ruleType,
+      ExcelAddress address,
+      int priority,
+			ExcelWorksheet worksheet,
+			XmlNode itemElementNode,
+			XmlNamespaceManager namespaceManager)
+			: base(
+				namespaceManager,
+				itemElementNode)
+		{
+			Require.Argument(priority).IsInRange(1, int.MaxValue, "priority");
+			Require.Argument(address).IsNotNull("address");
+			Require.Argument(worksheet).IsNotNull("worksheet");
+
+			// Save the worksheet for private methods to use
+			_worksheet = worksheet;
+
+			// Schema order list
+			SchemaNodeOrder = new string[]
+			{
+        ExcelConditionalFormattingConstants.Nodes.Cfvo,
+        ExcelConditionalFormattingConstants.Nodes.Color
+			};
+
+			// Check if the parent does not exists
+			if (itemElementNode == null)
+			{
+				// Get the parent node path by the rule type
+				string parentNodePath = ExcelConditionalFormattingValueObjectType.GetParentPathByRuleType(
+					ruleType);
+
+				// Check for en error (rule type does not have <cfvo>)
+				if (parentNodePath == string.Empty)
+				{
+					throw new Exception(
+						ExcelConditionalFormattingConstants.Errors.MissingCfvoParentNode);
+				}
+
+				// Point to the <cfvo> parent node
+        itemElementNode = _worksheet.WorksheetXml.SelectSingleNode(
+					string.Format(
+						"//{0}[{1}='{2}']/{3}[{4}='{5}']/{6}",
+					// {0}
+						ExcelConditionalFormattingConstants.Paths.ConditionalFormatting,
+					// {1}
+						ExcelConditionalFormattingConstants.Paths.SqrefAttribute,
+					// {2}
+						address.Address,
+					// {3}
+						ExcelConditionalFormattingConstants.Paths.CfRule,
+					// {4}
+						ExcelConditionalFormattingConstants.Paths.PriorityAttribute,
+					// {5}
+						priority,
+					// {6}
+						parentNodePath),
+					_worksheet.NameSpaceManager);
+
+				// Check for en error (rule type does not have <cfvo>)
+        if (itemElementNode == null)
+				{
+					throw new Exception(
+						ExcelConditionalFormattingConstants.Errors.MissingCfvoParentNode);
+				}
+			}
+
+			// Point to the <cfvo> parent node (<colorScale>, <dataBar> or <iconSet>)
+      // This is different than normal, as TopNode does not point to the node itself but to
+      // its PARENT. Later, in the CreateNodeByOrdem method the TopNode will be updated.
+      TopNode = itemElementNode;
+
+			// Save the attributes
+			Position = position;
+			RuleType = ruleType;
+			Type = type;
+			Color = color;
+			Value = value;
+			Formula = formula;
+		}
+
+		/// <summary>
+		/// Initialize the <see cref="ExcelConditionalFormattingColorScaleValue"/>
+		/// </summary>
+		/// <param name="position"></param>
+		/// <param name="type"></param>
+		/// <param name="color"></param>
+		/// <param name="value"></param>
+		/// <param name="formula"></param>
+		/// <param name="ruleType"></param>
+		/// <param name="priority"></param>
+		/// <param name="address"></param>
+		/// <param name="worksheet"></param>
+		/// <param name="namespaceManager"></param>
+		internal ExcelConditionalFormattingColorScaleValue(
+			eExcelConditionalFormattingValueObjectPosition position,
+			eExcelConditionalFormattingValueObjectType type,
+			Color color,
+			double value,
+			string formula,
+			eExcelConditionalFormattingRuleType ruleType,
+      ExcelAddress address,
+      int priority,
+			ExcelWorksheet worksheet,
+			XmlNamespaceManager namespaceManager)
+			: this(
+				position,
+				type,
+				color,
+				value,
+				formula,
+				ruleType,
+        address,
+        priority,
+				worksheet,
+				null,
+				namespaceManager)
+		{
+		}
+
+		/// <summary>
+		/// Initialize the <see cref="ExcelConditionalFormattingColorScaleValue"/>
+		/// </summary>
+		/// <param name="position"></param>
+		/// <param name="type"></param>
+		/// <param name="color"></param>
+		/// <param name="ruleType"></param>
+		/// <param name="priority"></param>
+		/// <param name="address"></param>
+		/// <param name="worksheet"></param>
+		/// <param name="namespaceManager"></param>
+		internal ExcelConditionalFormattingColorScaleValue(
+			eExcelConditionalFormattingValueObjectPosition position,
+			eExcelConditionalFormattingValueObjectType type,
+			Color color,
+			eExcelConditionalFormattingRuleType ruleType,
+      ExcelAddress address,
+      int priority,
+			ExcelWorksheet worksheet,
+			XmlNamespaceManager namespaceManager)
+			: this(
+				position,
+				type,
+				color,
+				0,
+				null,
+				ruleType,
+        address,
+        priority,
+				worksheet,
+				null,
+				namespaceManager)
+		{
+		}
+		#endregion Constructors
+
+		/****************************************************************************************/
+
+		#region Methods
+		/// <summary>
+		/// Get the node order (1, 2 ou 3) according to the Position (Low, Middle and High)
+		/// and the Rule Type (TwoColorScale ou ThreeColorScale).
+		/// </summary>
+		/// <returns></returns>
+		private int GetNodeOrder()
+		{
+			return ExcelConditionalFormattingValueObjectType.GetOrderByPosition(
+				Position,
+				RuleType);
+		}
+
+		/// <summary>
+		/// Create the 'cfvo'/'color' nodes in the right order. They should appear like this:
+		///		"cfvo"   --> Low Value (value object)
+		///		"cfvo"   --> Middle Value (value object)
+		///		"cfvo"   --> High Value (value object)
+		///		"color"  --> Low Value (color)
+		///		"color"  --> Middle Value (color)
+		///		"color"  --> High Value (color)
+		/// </summary>
+		/// <param name="nodeType"></param>
+		/// <param name="attributePath"></param>
+		/// <param name="attributeValue"></param>
+		private void CreateNodeByOrdem(
+			eExcelConditionalFormattingValueObjectNodeType nodeType,
+			string attributePath,
+			string attributeValue)
+		{
+      // Save the current TopNode
+      XmlNode currentTopNode = TopNode;
+
+      string nodePath = ExcelConditionalFormattingValueObjectType.GetNodePathByNodeType(nodeType);
+			int nodeOrder = GetNodeOrder();
+			eNodeInsertOrder nodeInsertOrder = eNodeInsertOrder.SchemaOrder;
+			XmlNode referenceNode = null;
+
+			if (nodeOrder > 1)
+			{
+				// Find the node just before the one we need to include
+				referenceNode = TopNode.SelectSingleNode(
+					string.Format(
+						"{0}[position()={1}]",
+					// {0}
+						nodePath,
+					// {1}
+						nodeOrder - 1),
+					_worksheet.NameSpaceManager);
+
+				// Only if the prepend node exists than insert after
+				if (referenceNode != null)
+				{
+					nodeInsertOrder = eNodeInsertOrder.After;
+				}
+			}
+
+			// Create the node in the right order
+			var node = CreateComplexNode(
+				TopNode,
+				string.Format(
+					"{0}[position()={1}]",
+				// {0}
+					nodePath,
+				// {1}
+					nodeOrder),
+				nodeInsertOrder,
+				referenceNode);
+
+      // Point to the new node as the temporary TopNode (we need it for the XmlHelper functions)
+      TopNode = node;
+
+      // Add/Remove the attribute (if the attributeValue is empty then it will be removed)
+      SetXmlNodeString(
+        node,
+        attributePath,
+        attributeValue,
+        true);
+
+      // Point back to the <cfvo>/<color> parent node
+      TopNode = currentTopNode;
+		}
+		#endregion Methos
+
+		/****************************************************************************************/
+
+		#region Exposed Properties
+		/// <summary>
+		/// 
+		/// </summary>
+		internal eExcelConditionalFormattingValueObjectPosition Position
+		{
+			get { return _position; }
+			set { _position = value; }
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		internal eExcelConditionalFormattingRuleType RuleType
+		{
+			get { return _ruleType; }
+			set { _ruleType = value; }
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		public eExcelConditionalFormattingValueObjectType Type
+		{
+			get
+			{
+				var typeAttribute = GetXmlNodeString(
+					string.Format(
+						"{0}[position()={1}]/{2}",
+					// {0}
+						ExcelConditionalFormattingConstants.Paths.Cfvo,
+					// {1}
+						GetNodeOrder(),
+					// {2}
+						ExcelConditionalFormattingConstants.Paths.TypeAttribute));
+
+				return ExcelConditionalFormattingValueObjectType.GetTypeByAttrbiute(typeAttribute);
+			}
+			set
+			{
+				CreateNodeByOrdem(
+					eExcelConditionalFormattingValueObjectNodeType.Cfvo,
+					ExcelConditionalFormattingConstants.Paths.TypeAttribute,
+					ExcelConditionalFormattingValueObjectType.GetAttributeByType(value));
+
+				bool removeValAttribute = false;
+
+				// Make sure unnecessary attributes are removed (occures when we change
+				// the value object type)
+				switch (Type)
+				{
+					case eExcelConditionalFormattingValueObjectType.Min:
+					case eExcelConditionalFormattingValueObjectType.Max:
+						removeValAttribute = true;
+						break;
+				}
+
+				// Check if we need to remove the @val attribute
+				if (removeValAttribute)
+				{
+				  string nodePath = ExcelConditionalFormattingValueObjectType.GetNodePathByNodeType(
+						eExcelConditionalFormattingValueObjectNodeType.Cfvo);
+				  int nodeOrder = GetNodeOrder();
+
+					// Remove the attribute (removed when the value = '')
+				  CreateComplexNode(
+				    TopNode,
+				    string.Format(
+				      "{0}[position()={1}]/{2}=''",
+				    // {0}
+				      nodePath,
+				    // {1}
+				      nodeOrder,
+				    // {2}
+				      ExcelConditionalFormattingConstants.Paths.ValAttribute));
+				}
+			}
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		public Color Color
+		{
+			get
+			{
+				// Color Code like "FF5B34F2"
+				var colorCode = GetXmlNodeString(
+					string.Format(
+						"{0}[position()={1}]/{2}",
+					// {0}
+						ExcelConditionalFormattingConstants.Paths.Color,
+					// {1}
+						GetNodeOrder(),
+					// {2}
+						ExcelConditionalFormattingConstants.Paths.RgbAttribute));
+
+				return ExcelConditionalFormattingHelper.ConvertFromColorCode(colorCode);
+			}
+			set
+			{
+				// Use the color code to store (Ex. "FF5B35F2")
+				CreateNodeByOrdem(
+					eExcelConditionalFormattingValueObjectNodeType.Color,
+					ExcelConditionalFormattingConstants.Paths.RgbAttribute,
+					value.ToArgb().ToString("x"));
+			}
+		}
+
+		/// <summary>
+		/// Get/Set the 'cfvo' node @val attribute
+		/// </summary>
+		public Double Value
+		{
+			get
+			{
+				return GetXmlNodeDouble(
+					string.Format(
+						"{0}[position()={1}]/{2}",
+					// {0}
+						ExcelConditionalFormattingConstants.Paths.Cfvo,
+					// {1}
+						GetNodeOrder(),
+					// {2}
+						ExcelConditionalFormattingConstants.Paths.ValAttribute));
+			}
+			set
+			{
+				string valueToStore = string.Empty;
+
+				// Only some types use the @val attribute
+				if ((Type == eExcelConditionalFormattingValueObjectType.Num)
+					|| (Type == eExcelConditionalFormattingValueObjectType.Percent)
+					|| (Type == eExcelConditionalFormattingValueObjectType.Percentile))
+				{
+					valueToStore = value.ToString();
+				}
+
+				CreateNodeByOrdem(
+					eExcelConditionalFormattingValueObjectNodeType.Cfvo,
+					ExcelConditionalFormattingConstants.Paths.ValAttribute,
+					valueToStore);
+			}
+		}
+
+		/// <summary>
+		/// Get/Set the Formula of the Object Value (uses the same attribute as the Value)
+		/// </summary>
+		public string Formula
+		{
+			get
+			{
+				// Return empty if the Object Value type is not Formula
+				if (Type != eExcelConditionalFormattingValueObjectType.Formula)
+				{
+					return string.Empty;
+				}
+
+				// Excel stores the formula in the @val attribute
+				return GetXmlNodeString(
+					string.Format(
+						"{0}[position()={1}]/{2}",
+					// {0}
+						ExcelConditionalFormattingConstants.Paths.Cfvo,
+					// {1}
+						GetNodeOrder(),
+					// {2}
+						ExcelConditionalFormattingConstants.Paths.ValAttribute));
+			}
+			set
+			{
+				// Only store the formula if the Object Value type is Formula
+				if (Type == eExcelConditionalFormattingValueObjectType.Formula)
+				{
+					CreateNodeByOrdem(
+						eExcelConditionalFormattingValueObjectNodeType.Cfvo,
+						ExcelConditionalFormattingConstants.Paths.ValAttribute,
+						(value == null) ? string.Empty : value.ToString());
+				}
+			}
+		}
+		#endregion Exposed Properties
+
+		/****************************************************************************************/
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingConstants.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingConstants.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingConstants.cs	(revision 9616)
@@ -0,0 +1,283 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// The conditional formatting constants
+  /// </summary>
+  internal static class ExcelConditionalFormattingConstants
+  {
+    #region Errors
+    internal class Errors
+    {
+      internal const string CommaSeparatedAddresses = @"Multiple addresses may not be commaseparated, use space instead";
+      internal const string InvalidCfruleObject = @"The supplied item must inherit OfficeOpenXml.ConditionalFormatting.ExcelConditionalFormattingRule";
+      internal const string InvalidConditionalFormattingObject = @"The supplied item must inherit OfficeOpenXml.ConditionalFormatting.ExcelConditionalFormatting";
+      internal const string InvalidPriority = @"Invalid priority number. Must be bigger than zero";
+      internal const string InvalidRemoveRuleOperation = @"Invalid remove rule operation";
+      internal const string MissingCfvoNode = @"Missing 'cfvo' node in Conditional Formatting";
+      internal const string MissingCfvoParentNode = @"Missing 'cfvo' parent node in Conditional Formatting";
+      internal const string MissingConditionalFormattingNode = @"Missing 'conditionalFormatting' node in Conditional Formatting";
+      internal const string MissingItemRuleList = @"Missing item with address '{0}' in Conditional Formatting Rule List";
+      internal const string MissingPriorityAttribute = @"Missing 'priority' attribute in Conditional Formatting Rule";
+      internal const string MissingRuleType = @"Missing eExcelConditionalFormattingRuleType Type in Conditional Formatting";
+      internal const string MissingSqrefAttribute = @"Missing 'sqref' attribute in Conditional Formatting";
+      internal const string MissingTypeAttribute = @"Missing 'type' attribute in Conditional Formatting Rule";
+      internal const string MissingWorksheetNode = @"Missing 'worksheet' node";
+      internal const string NonSupportedRuleType = @"Non supported conditionalFormattingType: {0}";
+      internal const string UnexistentCfvoTypeAttribute = @"Unexistent eExcelConditionalFormattingValueObjectType attribute in Conditional Formatting";
+      internal const string UnexistentOperatorTypeAttribute = @"Unexistent eExcelConditionalFormattingOperatorType attribute in Conditional Formatting";
+      internal const string UnexistentTimePeriodTypeAttribute = @"Unexistent eExcelConditionalFormattingTimePeriodType attribute in Conditional Formatting";
+      internal const string UnexpectedRuleTypeAttribute = @"Unexpected eExcelConditionalFormattingRuleType attribute in Conditional Formatting Rule";
+      internal const string UnexpectedRuleTypeName = @"Unexpected eExcelConditionalFormattingRuleType TypeName in Conditional Formatting Rule";
+      internal const string WrongNumberCfvoColorNodes = @"Wrong number of 'cfvo'/'color' nodes in Conditional Formatting Rule";
+    }
+    #endregion Errors
+
+    #region Nodes
+    internal class Nodes
+    {
+      internal const string Worksheet = "worksheet";
+      internal const string ConditionalFormatting = "conditionalFormatting";
+      internal const string CfRule = "cfRule";
+      internal const string ColorScale = "colorScale";
+      internal const string Cfvo = "cfvo";
+      internal const string Color = "color";
+      internal const string DataBar = "dataBar";
+      internal const string IconSet = "iconSet";
+      internal const string Formula = "formula";
+    }
+    #endregion Nodes
+
+    #region Attributes
+    internal class Attributes
+    {
+      internal const string AboveAverage = "aboveAverage";
+      internal const string Bottom = "bottom";
+      internal const string DxfId = "dxfId";
+      internal const string EqualAverage = "equalAverage";
+      internal const string IconSet = "iconSet";
+      internal const string Operator = "operator";
+      internal const string Percent = "percent";
+      internal const string Priority = "priority";
+      internal const string Rank = "rank";
+      internal const string Reverse = "reverse";
+      internal const string Rgb = "rgb";
+      internal const string ShowValue = "showValue";
+      internal const string Sqref = "sqref";
+      internal const string StdDev = "stdDev";
+      internal const string StopIfTrue = "stopIfTrue";
+      internal const string Text = "text";
+      internal const string Theme = "theme";
+      internal const string TimePeriod = "timePeriod";
+      internal const string Tint = "tint";
+      internal const string Type = "type";
+      internal const string Val = "val";
+    }
+    #endregion Attributes
+
+    #region XML Paths
+    internal class Paths
+    {
+      // Main node and attributes
+      internal const string Worksheet = "d:" + Nodes.Worksheet;
+
+      // <conditionalFormatting> §18.3.1.18 node
+      // can appear more than once in a worksheet
+      internal const string ConditionalFormatting = "d:" + Nodes.ConditionalFormatting;
+
+      // <cfRule> §18.3.1.10 node
+      // can appear more than once in a <conditionalFormatting>
+      internal const string CfRule = "d:" + Nodes.CfRule;
+
+      // <colorScale> §18.3.1.16 node
+      internal const string ColorScale = "d:" + Nodes.ColorScale;
+
+      // <cfvo> §18.3.1.11 node
+      internal const string Cfvo = "d:" + Nodes.Cfvo;
+
+      // <color> §18.3.1.15 node
+      internal const string Color = "d:" + Nodes.Color;
+
+      // <dataBar> §18.3.1.28 node
+      internal const string DataBar = "d:" + Nodes.DataBar;
+
+      // <iconSet> §18.3.1.49 node
+      internal const string IconSet = "d:" + Nodes.IconSet;
+
+      // <formula> §18.3.1.43 node
+      internal const string Formula = "d:" + Nodes.Formula;
+
+      // Attributes (for all the nodes)
+      internal const string AboveAverageAttribute = "@" + Attributes.AboveAverage;
+      internal const string BottomAttribute = "@" + Attributes.Bottom;
+      internal const string DxfIdAttribute = "@" + Attributes.DxfId;
+      internal const string EqualAverageAttribute = "@" + Attributes.EqualAverage;
+      internal const string IconSetAttribute = "@" + Attributes.IconSet;
+      internal const string OperatorAttribute = "@" + Attributes.Operator;
+      internal const string PercentAttribute = "@" + Attributes.Percent;
+      internal const string PriorityAttribute = "@" + Attributes.Priority;
+      internal const string RankAttribute = "@" + Attributes.Rank;
+      internal const string ReverseAttribute = "@" + Attributes.Reverse;
+      internal const string RgbAttribute = "@" + Attributes.Rgb;
+      internal const string ShowValueAttribute = "@" + Attributes.ShowValue;
+      internal const string SqrefAttribute = "@" + Attributes.Sqref;
+      internal const string StdDevAttribute = "@" + Attributes.StdDev;
+      internal const string StopIfTrueAttribute = "@" + Attributes.StopIfTrue;
+      internal const string TextAttribute = "@" + Attributes.Text;
+      internal const string ThemeAttribute = "@" + Attributes.Theme;
+      internal const string TimePeriodAttribute = "@" + Attributes.TimePeriod;
+      internal const string TintAttribute = "@" + Attributes.Tint;
+      internal const string TypeAttribute = "@" + Attributes.Type;
+      internal const string ValAttribute = "@" + Attributes.Val;
+    }
+    #endregion XML Paths
+
+    #region Rule Type ST_CfType §18.18.12 (with small EPPlus changes)
+    internal class RuleType
+    {
+      internal const string AboveAverage = "aboveAverage";
+      internal const string BeginsWith = "beginsWith";
+      internal const string CellIs = "cellIs";
+      internal const string ColorScale = "colorScale";
+      internal const string ContainsBlanks = "containsBlanks";
+      internal const string ContainsErrors = "containsErrors";
+      internal const string ContainsText = "containsText";
+      internal const string DataBar = "dataBar";
+      internal const string DuplicateValues = "duplicateValues";
+      internal const string EndsWith = "endsWith";
+      internal const string Expression = "expression";
+      internal const string IconSet = "iconSet";
+      internal const string NotContainsBlanks = "notContainsBlanks";
+      internal const string NotContainsErrors = "notContainsErrors";
+      internal const string NotContainsText = "notContainsText";
+      internal const string TimePeriod = "timePeriod";
+      internal const string Top10 = "top10";
+      internal const string UniqueValues = "uniqueValues";
+
+      // EPPlus Extended Types
+      internal const string AboveOrEqualAverage = "aboveOrEqualAverage";
+      internal const string AboveStdDev = "aboveStdDev";
+      internal const string BelowAverage = "belowAverage";
+      internal const string BelowOrEqualAverage = "belowOrEqualAverage";
+      internal const string BelowStdDev = "belowStdDev";
+      internal const string Between = "between";
+      internal const string Bottom = "bottom";
+      internal const string BottomPercent = "bottomPercent";
+      internal const string Equal = "equal";
+      internal const string GreaterThan = "greaterThan";
+      internal const string GreaterThanOrEqual = "greaterThanOrEqual";
+      internal const string IconSet3 = "iconSet3";
+      internal const string IconSet4 = "iconSet4";
+      internal const string IconSet5 = "iconSet5";
+      internal const string Last7Days = "last7Days";
+      internal const string LastMonth = "lastMonth";
+      internal const string LastWeek = "lastWeek";
+      internal const string LessThan = "lessThan";
+      internal const string LessThanOrEqual = "lessThanOrEqual";
+      internal const string NextMonth = "nextMonth";
+      internal const string NextWeek = "nextWeek";
+      internal const string NotBetween = "notBetween";
+      internal const string NotEqual = "notEqual";
+      internal const string ThisMonth = "thisMonth";
+      internal const string ThisWeek = "thisWeek";
+      internal const string ThreeColorScale = "threeColorScale";
+      internal const string Today = "today";
+      internal const string Tomorrow = "tomorrow";
+      internal const string Top = "top";
+      internal const string TopPercent = "topPercent";
+      internal const string TwoColorScale = "twoColorScale";
+      internal const string Yesterday = "yesterday";
+    }
+    #endregion Rule Type ST_CfType §18.18.12 (with small EPPlus changes)
+
+    #region CFVO Type ST_CfvoType §18.18.13
+    internal class CfvoType
+    {
+      internal const string Min = "min";
+      internal const string Max = "max";
+      internal const string Num = "num";
+      internal const string Formula = "formula";
+      internal const string Percent = "percent";
+      internal const string Percentile = "percentile";
+    }
+    #endregion CFVO Type ST_CfvoType §18.18.13
+
+    #region Operator Type ST_ConditionalFormattingOperator §18.18.15
+    internal class Operators
+    {
+      internal const string BeginsWith = "beginsWith";
+      internal const string Between = "between";
+      internal const string ContainsText = "containsText";
+      internal const string EndsWith = "endsWith";
+      internal const string Equal = "equal";
+      internal const string GreaterThan = "greaterThan";
+      internal const string GreaterThanOrEqual = "greaterThanOrEqual";
+      internal const string LessThan = "lessThan";
+      internal const string LessThanOrEqual = "lessThanOrEqual";
+      internal const string NotBetween = "notBetween";
+      internal const string NotContains = "notContains";
+      internal const string NotEqual = "notEqual";
+    }
+    #endregion Operator Type ST_ConditionalFormattingOperator §18.18.15
+
+    #region Time Period Type ST_TimePeriod §18.18.82
+    internal class TimePeriods
+    {
+      internal const string Last7Days = "last7Days";
+      internal const string LastMonth = "lastMonth";
+      internal const string LastWeek = "lastWeek";
+      internal const string NextMonth = "nextMonth";
+      internal const string NextWeek = "nextWeek";
+      internal const string ThisMonth = "thisMonth";
+      internal const string ThisWeek = "thisWeek";
+      internal const string Today = "today";
+      internal const string Tomorrow = "tomorrow";
+      internal const string Yesterday = "yesterday";
+    }
+    #endregion Time Period Type ST_TimePeriod §18.18.82
+
+    #region Colors
+    internal class Colors
+    {
+      internal const string CfvoLowValue = @"#FFF8696B";
+      internal const string CfvoMiddleValue = @"#FFFFEB84";
+      internal const string CfvoHighValue = @"#FF63BE7B";
+    }
+    #endregion Colors
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingEnums.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingEnums.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingEnums.cs	(revision 9616)
@@ -0,0 +1,694 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// Enum for Conditional Format Type ST_CfType §18.18.12. With some changes.
+  /// </summary>
+  public enum eExcelConditionalFormattingRuleType
+  {
+    #region Average
+    /// <summary>
+    /// This conditional formatting rule highlights cells that are above the average
+    /// for all values in the range.
+    /// </summary>
+    /// <remarks>AboveAverage Excel CF Rule Type</remarks>
+    AboveAverage,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells that are above or equal
+    /// the average for all values in the range.
+    /// </summary>
+    /// <remarks>AboveAverage Excel CF Rule Type</remarks>
+    AboveOrEqualAverage,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells that are below the average
+    /// for all values in the range.
+    /// </summary>
+    /// <remarks>AboveAverage Excel CF Rule Type</remarks>
+    BelowAverage,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells that are below or equal
+    /// the average for all values in the range.
+    /// </summary>
+    /// <remarks>AboveAverage Excel CF Rule Type</remarks>
+    BelowOrEqualAverage,
+    #endregion
+
+    #region StdDev
+    /// <summary>
+    /// This conditional formatting rule highlights cells that are above the standard
+    /// deviationa for all values in the range.
+    /// <remarks>AboveAverage Excel CF Rule Type</remarks>
+    /// </summary>
+    AboveStdDev,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells that are below the standard
+    /// deviationa for all values in the range.
+    /// </summary>
+    /// <remarks>AboveAverage Excel CF Rule Type</remarks>
+    BelowStdDev,
+    #endregion
+
+    #region TopBottom
+    /// <summary>
+    /// This conditional formatting rule highlights cells whose values fall in the
+    /// bottom N bracket as specified.
+    /// </summary>
+    /// <remarks>Top10 Excel CF Rule Type</remarks>
+    Bottom,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells whose values fall in the
+    /// bottom N percent as specified.
+    /// </summary>
+    /// <remarks>Top10 Excel CF Rule Type</remarks>
+    BottomPercent,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells whose values fall in the
+    /// top N bracket as specified.
+    /// </summary>
+    /// <remarks>Top10 Excel CF Rule Type</remarks>
+    Top,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells whose values fall in the
+    /// top N percent as specified.
+    /// </summary>
+    /// <remarks>Top10 Excel CF Rule Type</remarks>
+    TopPercent,
+    #endregion
+
+    #region TimePeriod
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing dates in the
+    /// last 7 days.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    Last7Days,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing dates in the
+    /// last month.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    LastMonth,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing dates in the
+    /// last week.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    LastWeek,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing dates in the
+    /// next month.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    NextMonth,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing dates in the
+    /// next week.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    NextWeek,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing dates in this
+    /// month.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    ThisMonth,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing dates in this
+    /// week.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    ThisWeek,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing today dates.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    Today,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing tomorrow dates.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    Tomorrow,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells containing yesterday dates.
+    /// </summary>
+    /// <remarks>TimePeriod Excel CF Rule Type</remarks>
+    Yesterday,
+    #endregion
+
+    #region CellIs
+    /// <summary>
+    /// This conditional formatting rule highlights cells in the range that begin with
+    /// the given text.
+    /// </summary>
+    /// <remarks>
+    /// Equivalent to using the LEFT() sheet function and comparing values.
+    /// </remarks>
+    /// <remarks>BeginsWith Excel CF Rule Type</remarks>
+    BeginsWith,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells in the range between the
+    /// given two formulas.
+    /// </summary>
+    /// <remarks>CellIs Excel CF Rule Type</remarks>
+    Between,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells that are completely blank.
+    /// </summary>
+    /// <remarks>
+    /// Equivalent of using LEN(TRIM()). This means that if the cell contains only
+    /// characters that TRIM() would remove, then it is considered blank. An empty cell
+    /// is also considered blank.
+    /// </remarks>
+    /// <remarks>ContainsBlanks Excel CF Rule Type</remarks>
+    ContainsBlanks,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells with formula errors.
+    /// </summary>
+    /// <remarks>
+    /// Equivalent to using ISERROR() sheet function to determine if there is
+    /// a formula error.
+    /// </remarks>
+    /// <remarks>ContainsErrors Excel CF Rule Type</remarks>
+    ContainsErrors,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells in the range that begin with
+    /// the given text.
+    /// </summary>
+    /// <remarks>
+    /// Equivalent to using the LEFT() sheet function and comparing values.
+    /// </remarks>
+    /// <remarks>ContainsText Excel CF Rule Type</remarks>
+    ContainsText,
+
+    /// <summary>
+    /// This conditional formatting rule highlights duplicated values.
+    /// </summary>
+    /// <remarks>DuplicateValues Excel CF Rule Type</remarks>
+    DuplicateValues,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells ending with given text.
+    /// </summary>
+    /// <remarks>
+    /// Equivalent to using the RIGHT() sheet function and comparing values.
+    /// </remarks>
+    /// <remarks>EndsWith Excel CF Rule Type</remarks>
+    EndsWith,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells equals to with given formula.
+    /// </summary>
+    /// <remarks>CellIs Excel CF Rule Type</remarks>
+    Equal,
+
+    /// <summary>
+    /// This conditional formatting rule contains a formula to evaluate. When the 
+    /// formula result is true, the cell is highlighted.
+    /// </summary>
+    /// <remarks>Expression Excel CF Rule Type</remarks>
+    Expression,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells greater than the given formula.
+    /// </summary>
+    /// <remarks>CellIs Excel CF Rule Type</remarks>
+    GreaterThan,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells greater than or equal the
+    /// given formula.
+    /// </summary>
+    /// <remarks>CellIs Excel CF Rule Type</remarks>
+    GreaterThanOrEqual,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells less than the given formula.
+    /// </summary>
+    /// <remarks>CellIs Excel CF Rule Type</remarks>
+    LessThan,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells less than or equal the
+    /// given formula.
+    /// </summary>
+    /// <remarks>CellIs Excel CF Rule Type</remarks>
+    LessThanOrEqual,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells outside the range in
+    /// given two formulas.
+    /// </summary>
+    /// <remarks>CellIs Excel CF Rule Type</remarks>
+    NotBetween,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells that does not contains the
+    /// given formula.
+    /// </summary>
+    /// <remarks>CellIs Excel CF Rule Type</remarks>
+    NotContains,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells that are not blank.
+    /// </summary>
+    /// <remarks>
+    /// Equivalent of using LEN(TRIM()). This means that if the cell contains only
+    /// characters that TRIM() would remove, then it is considered blank. An empty cell
+    /// is also considered blank.
+    /// </remarks>
+    /// <remarks>NotContainsBlanks Excel CF Rule Type</remarks>
+    NotContainsBlanks,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells without formula errors.
+    /// </summary>
+    /// <remarks>
+    /// Equivalent to using ISERROR() sheet function to determine if there is a
+    /// formula error.
+    /// </remarks>
+    /// <remarks>NotContainsErrors Excel CF Rule Type</remarks>
+    NotContainsErrors,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells that do not contain
+    /// the given text.
+    /// </summary>
+    /// <remarks>
+    /// Equivalent to using the SEARCH() sheet function.
+    /// </remarks>
+    /// <remarks>NotContainsText Excel CF Rule Type</remarks>
+    NotContainsText,
+
+    /// <summary>
+    /// This conditional formatting rule highlights cells not equals to with
+    /// given formula.
+    /// </summary>
+    /// <remarks>CellIs Excel CF Rule Type</remarks>
+    NotEqual,
+
+    /// <summary>
+    /// This conditional formatting rule highlights unique values in the range.
+    /// </summary>
+    /// <remarks>UniqueValues Excel CF Rule Type</remarks>
+    UniqueValues,
+    #endregion
+
+    #region ColorScale
+    /// <summary>
+    /// Three Color Scale (Low, Middle and High Color Scale)
+    /// </summary>
+    /// <remarks>ColorScale Excel CF Rule Type</remarks>
+    ThreeColorScale,
+
+    /// <summary>
+    /// Two Color Scale (Low and High Color Scale)
+    /// </summary>
+    /// <remarks>ColorScale Excel CF Rule Type</remarks>
+    TwoColorScale,
+    #endregion
+
+    #region IconSet
+    /// <summary>
+    /// This conditional formatting rule applies a 3 set icons to cells according
+    /// to their values.
+    /// </summary>
+    /// <remarks>IconSet Excel CF Rule Type</remarks>
+    ThreeIconSet,
+
+    /// <summary>
+    /// This conditional formatting rule applies a 4 set icons to cells according
+    /// to their values.
+    /// </summary>
+    /// <remarks>IconSet Excel CF Rule Type</remarks>
+    FourIconSet,
+
+    /// <summary>
+    /// This conditional formatting rule applies a 5 set icons to cells according
+    /// to their values.
+    /// </summary>
+    /// <remarks>IconSet Excel CF Rule Type</remarks>
+    FiveIconSet,
+    #endregion
+
+    #region DataBar
+    /// <summary>
+    /// This conditional formatting rule displays a gradated data bar in the range of cells.
+    /// </summary>
+    /// <remarks>DataBar Excel CF Rule Type</remarks>
+    DataBar
+    #endregion
+  }
+
+  /// <summary>
+  /// Enum for Conditional Format Value Object Type ST_CfvoType §18.18.13
+  /// </summary>
+  public enum eExcelConditionalFormattingValueObjectType
+  {
+    /// <summary>
+    /// Formula
+    /// </summary>
+    Formula,
+
+    /// <summary>
+    /// Maximum Value
+    /// </summary>
+    Max,
+
+    /// <summary>
+    /// Minimum Value
+    /// </summary>
+    Min,
+
+    /// <summary>
+    /// Number Value
+    /// </summary>
+    Num,
+
+    /// <summary>
+    /// Percent
+    /// </summary>
+    Percent,
+
+    /// <summary>
+    /// Percentile
+    /// </summary>
+    Percentile
+  }
+
+  /// <summary>
+  /// Enum for Conditional Formatting Value Object Position
+  /// </summary>
+  public enum eExcelConditionalFormattingValueObjectPosition
+  {
+    /// <summary>
+    /// The lower position for both TwoColorScale and ThreeColorScale
+    /// </summary>
+    Low,
+
+    /// <summary>
+    /// The middle position only for ThreeColorScale
+    /// </summary>
+    Middle,
+
+    /// <summary>
+    /// The highest position for both TwoColorScale and ThreeColorScale
+    /// </summary>
+    High
+  }
+
+  /// <summary>
+  /// Enum for Conditional Formatting Value Object Node Type
+  /// </summary>
+  public enum eExcelConditionalFormattingValueObjectNodeType
+  {
+    /// <summary>
+    /// 'cfvo' node
+    /// </summary>
+    Cfvo,
+
+    /// <summary>
+    /// 'color' node
+    /// </summary>
+    Color
+  }
+
+  /// <summary>
+  /// Enum for Conditional Formatting Operartor Type ST_ConditionalFormattingOperator §18.18.15
+  /// </summary>
+  public enum eExcelConditionalFormattingOperatorType
+  {
+    /// <summary>
+    /// Begins With. 'Begins with' operator
+    /// </summary>
+    BeginsWith,
+
+    /// <summary>
+    /// Between. 'Between' operator
+    /// </summary>
+    Between,
+
+    /// <summary>
+    /// Contains. 'Contains' operator
+    /// </summary>
+    ContainsText,
+
+    /// <summary>
+    /// Ends With. 'Ends with' operator
+    /// </summary>
+    EndsWith,
+
+    /// <summary>
+    /// Equal. 'Equal to' operator
+    /// </summary>
+    Equal,
+
+    /// <summary>
+    /// Greater Than. 'Greater than' operator
+    /// </summary>
+    GreaterThan,
+
+    /// <summary>
+    /// Greater Than Or Equal. 'Greater than or equal to' operator
+    /// </summary>
+    GreaterThanOrEqual,
+
+    /// <summary>
+    /// Less Than. 'Less than' operator
+    /// </summary>
+    LessThan,
+
+    /// <summary>
+    /// Less Than Or Equal. 'Less than or equal to' operator
+    /// </summary>
+    LessThanOrEqual,
+
+    /// <summary>
+    /// Not Between. 'Not between' operator
+    /// </summary>
+    NotBetween,
+
+    /// <summary>
+    /// Does Not Contain. 'Does not contain' operator
+    /// </summary>
+    NotContains,
+
+    /// <summary>
+    /// Not Equal. 'Not equal to' operator
+    /// </summary>
+    NotEqual
+  }
+
+  /// <summary>
+  /// Enum for Conditional Formatting Time Period Type ST_TimePeriod §18.18.82
+  /// </summary>
+  public enum eExcelConditionalFormattingTimePeriodType
+  {
+    /// <summary>
+    /// Last 7 Days. A date in the last seven days.
+    /// </summary>
+    Last7Days,
+
+    /// <summary>
+    /// Last Month. A date occuring in the last calendar month.
+    /// </summary>
+    LastMonth,
+
+    /// <summary>
+    /// Last Week. A date occuring last week.
+    /// </summary>
+    LastWeek,
+
+    /// <summary>
+    /// Next Month. A date occuring in the next calendar month.
+    /// </summary>
+    NextMonth,
+
+    /// <summary>
+    /// Next Week. A date occuring next week.
+    /// </summary>
+    NextWeek,
+
+    /// <summary>
+    /// This Month. A date occuring in this calendar month.
+    /// </summary>
+    ThisMonth,
+
+    /// <summary>
+    /// This Week. A date occuring this week.
+    /// </summary>
+    ThisWeek,
+
+    /// <summary>
+    /// Today. Today's date.
+    /// </summary>
+    Today,
+
+    /// <summary>
+    /// Tomorrow. Tomorrow's date.
+    /// </summary>
+    Tomorrow,
+
+    /// <summary>
+    /// Yesterday. Yesterday's date.
+    /// </summary>
+    Yesterday
+  }
+
+  /// <summary>
+  /// 18.18.42 ST_IconSetType (Icon Set Type) - Only 3 icons
+  /// </summary>
+  public enum eExcelconditionalFormatting3IconsSetType
+  {
+    /// <summary>
+    /// (3 Arrows) 3 arrows icon set.
+    /// </summary>
+    Arrows,
+
+    /// <summary>
+    /// (3 Arrows (Gray)) 3 gray arrows icon set.
+    /// </summary>
+    ArrowsGray,
+
+    /// <summary>
+    /// (3 Flags) 3 flags icon set. 
+    /// </summary>
+    Flags,
+
+    /// <summary>
+    /// (3 Signs) 3 signs icon set.
+    /// </summary>
+    Signs,
+
+    /// <summary>
+    /// (3 Symbols Circled) 3 symbols icon set.
+    /// </summary>
+    Symbols,
+
+    /// <summary>
+    /// (3 Symbols) 3 Symbols icon set.
+    /// </summary>
+    Symbols2,
+
+    /// <summary>
+    /// (3 Traffic Lights) 3 traffic lights icon set (#1).
+    /// </summary>
+    TrafficLights1,
+
+    /// <summary>
+    /// (3 Traffic Lights Black) 3 traffic lights icon set with thick black border.
+    /// </summary>
+    TrafficLights2
+  }
+
+  /// <summary>
+  /// 18.18.42 ST_IconSetType (Icon Set Type) - Only 4 icons
+  /// </summary>
+  public enum eExcelconditionalFormatting4IconsSetType
+  {
+    /// <summary>
+    /// (4 Arrows) 4 arrows icon set.
+    /// </summary>
+    Arrows,
+
+    /// <summary>
+    /// (4 Arrows (Gray)) 4 gray arrows icon set.
+    /// </summary>
+    ArrowsGray,
+
+    /// <summary>
+    /// (4 Ratings) 4 ratings icon set.
+    /// </summary>
+    Rating,
+
+    /// <summary>
+    /// (4 Red To Black) 4 'red to black' icon set.
+    /// </summary>
+    RedToBlack,
+
+    /// <summary>
+    /// (4 Traffic Lights) 4 traffic lights icon set.
+    /// </summary>
+    TrafficLights
+  }
+
+  /// <summary>
+  /// 18.18.42 ST_IconSetType (Icon Set Type) - Only 5 icons
+  /// </summary>
+  public enum eExcelconditionalFormatting5IconsSetType
+  {
+    /// <summary>
+    /// (5 Arrows) 5 arrows icon set.
+    /// </summary>
+    Arrows,
+
+    /// <summary>
+    /// (5 Arrows (Gray)) 5 gray arrows icon set.
+    /// </summary>
+    ArrowsGray,
+
+    /// <summary>
+    /// (5 Quarters) 5 quarters icon set.
+    /// </summary>
+    Quarters,
+
+    /// <summary>
+    /// (5 Ratings Icon Set) 5 rating icon set.
+    /// </summary>
+    Rating
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingHelper.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingHelper.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingHelper.cs	(revision 9616)
@@ -0,0 +1,274 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using OfficeOpenXml.Utils;
+using System.Drawing;
+using System.Globalization;
+using System.Xml;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// Conditional formatting helper
+  /// </summary>
+  internal static class ExcelConditionalFormattingHelper
+  {
+    /// <summary>
+    /// Check and fix an address (string address)
+    /// </summary>
+    /// <param name="address"></param>
+    /// <returns></returns>
+    public static string CheckAndFixRangeAddress(
+      string address)
+    {
+      if (address.Contains(','))
+      {
+        throw new FormatException(
+          ExcelConditionalFormattingConstants.Errors.CommaSeparatedAddresses);
+      }
+
+      address = address.ToUpper();
+
+      if (Regex.IsMatch(address, @"[A-Z]+:[A-Z]+"))
+      {
+        address = AddressUtility.ParseEntireColumnSelections(address);
+      }
+
+      return address;
+    }
+
+    /// <summary>
+    /// Convert a color code to Color Object
+    /// </summary>
+    /// <param name="colorCode">Color Code (Ex. "#FFB43C53" or "FFB43C53")</param>
+    /// <returns></returns>
+    public static Color ConvertFromColorCode(
+      string colorCode)
+    {
+      try
+      {
+        return Color.FromArgb(Int32.Parse(colorCode.Replace("#", ""), NumberStyles.HexNumber));
+      }
+      catch
+      {
+        // Assume white is the default color (instead of giving an error)
+        return Color.White;
+      }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="node"></param>
+    /// <param name="attribute"></param>
+    /// <returns></returns>
+    public static string GetAttributeString(
+      XmlNode node,
+      string attribute)
+    {
+      try
+      {
+        var value = node.Attributes[attribute].Value;
+        return (value == null) ? string.Empty : value;
+      }
+      catch
+      {
+        return string.Empty;
+      }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="node"></param>
+    /// <param name="attribute"></param>
+    /// <returns></returns>
+    public static int GetAttributeInt(
+      XmlNode node,
+      string attribute)
+    {
+      try
+      {
+        var value = node.Attributes[attribute].Value;
+        return int.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
+      }
+      catch
+      {
+        return int.MinValue;
+      }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="node"></param>
+    /// <param name="attribute"></param>
+    /// <returns></returns>
+    public static int? GetAttributeIntNullable(
+      XmlNode node,
+      string attribute)
+    {
+      try
+      {
+          if (node.Attributes[attribute] == null)
+          {
+              return null;
+          }
+          else
+          {
+              var value = node.Attributes[attribute].Value;
+              return int.Parse(value, NumberStyles.Integer, CultureInfo.InvariantCulture);
+          }
+      }
+      catch
+      {
+        return null;
+      }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="node"></param>
+    /// <param name="attribute"></param>
+    /// <returns></returns>
+    public static bool GetAttributeBool(
+      XmlNode node,
+      string attribute)
+    {
+      try
+      {
+        var value = node.Attributes[attribute].Value;
+        return (value == "1" || value == "-1" || value.ToUpper() == "TRUE");
+      }
+      catch
+      {
+        return false;
+      }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="node"></param>
+    /// <param name="attribute"></param>
+    /// <returns></returns>
+    public static bool? GetAttributeBoolNullable(
+      XmlNode node,
+      string attribute)
+    {
+      try
+      {
+          if (node.Attributes[attribute] == null)
+          {
+              return null;
+          }
+          else
+          {
+              var value = node.Attributes[attribute].Value;
+              return (value == "1" || value == "-1" || value.ToUpper() == "TRUE");
+          }
+      }
+      catch
+      {
+        return null;
+      }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="node"></param>
+    /// <param name="attribute"></param>
+    /// <returns></returns>
+    public static double GetAttributeDouble(
+      XmlNode node,
+      string attribute)
+    {
+      try
+      {
+        var value = node.Attributes[attribute].Value;
+        return double.Parse(value, NumberStyles.Number, CultureInfo.InvariantCulture);
+      }
+      catch
+      {
+        return double.NaN;
+      }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="node"></param>
+    /// <param name="attribute"></param>
+    /// <returns></returns>
+    public static decimal GetAttributeDecimal(
+      XmlNode node,
+      string attribute)
+    {
+      try
+      {
+        var value = node.Attributes[attribute].Value;
+        return decimal.Parse(value, NumberStyles.Any, CultureInfo.InvariantCulture);
+      }
+      catch
+      {
+        return decimal.MinValue;
+      }
+    }
+
+    /// <summary>
+    /// Encode to XML (special characteres: &apos; &quot; &gt; &lt; &amp;)
+    /// </summary>
+    /// <param name="s"></param>
+    /// <returns></returns>
+    public static string EncodeXML(
+      this string s)
+    {
+      return s.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("\"", "&quot;").Replace("'", "&apos;");
+    }
+
+    /// <summary>
+    /// Decode from XML (special characteres: &apos; &quot; &gt; &lt; &amp;)
+    /// </summary>
+    /// <param name="s"></param>
+    /// <returns></returns>
+    public static string DecodeXML(
+      this string s)
+    {
+      return s.Replace("'", "&apos;").Replace("\"", "&quot;").Replace(">", "&gt;").Replace("<", "&lt;").Replace("&", "&amp;");
+    }
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingIconDatabarValue.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingIconDatabarValue.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingIconDatabarValue.cs	(revision 9616)
@@ -0,0 +1,358 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.Utils;
+using System.Text.RegularExpressions;
+using System.Globalization;
+using System.Security;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+	/// <summary>
+	/// 18.3.1.11 cfvo (Conditional Format Value Object)
+	/// Describes the values of the interpolation points in a gradient scale.
+	/// </summary>
+	public class ExcelConditionalFormattingIconDataBarValue
+		: XmlHelper
+	{
+		/****************************************************************************************/
+
+		#region Private Properties
+		private eExcelConditionalFormattingRuleType _ruleType;
+		private ExcelWorksheet _worksheet;
+		#endregion Private Properties
+
+		/****************************************************************************************/
+
+		#region Constructors
+    /// <summary>
+    /// Initialize the cfvo (§18.3.1.11) node
+    /// </summary>
+    /// <param name="type"></param>
+    /// <param name="value"></param>
+    /// <param name="formula"></param>
+    /// <param name="ruleType"></param>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode">The cfvo (§18.3.1.11) node parent. Can be any of the following:
+    /// colorScale (§18.3.1.16); dataBar (§18.3.1.28); iconSet (§18.3.1.49)</param>
+    /// <param name="namespaceManager"></param>
+		internal ExcelConditionalFormattingIconDataBarValue(
+			eExcelConditionalFormattingValueObjectType type,
+			double value,
+			string formula,
+			eExcelConditionalFormattingRuleType ruleType,
+            ExcelAddress address,
+            int priority,
+			ExcelWorksheet worksheet,
+			XmlNode itemElementNode,
+			XmlNamespaceManager namespaceManager)
+			: this(
+            ruleType,
+            address,
+            worksheet,
+            itemElementNode,
+			namespaceManager)
+		{
+			Require.Argument(priority).IsInRange(1, int.MaxValue, "priority");
+
+            // Check if the parent does not exists
+			if (itemElementNode == null)
+			{
+				// Get the parent node path by the rule type
+				string parentNodePath = ExcelConditionalFormattingValueObjectType.GetParentPathByRuleType(
+					ruleType);
+
+				// Check for en error (rule type does not have <cfvo>)
+				if (parentNodePath == string.Empty)
+				{
+					throw new Exception(
+						ExcelConditionalFormattingConstants.Errors.MissingCfvoParentNode);
+				}
+
+				// Point to the <cfvo> parent node
+        itemElementNode = _worksheet.WorksheetXml.SelectSingleNode(
+					string.Format(
+						"//{0}[{1}='{2}']/{3}[{4}='{5}']/{6}",
+					// {0}
+						ExcelConditionalFormattingConstants.Paths.ConditionalFormatting,
+					// {1}
+						ExcelConditionalFormattingConstants.Paths.SqrefAttribute,
+					// {2}
+						address.Address,
+					// {3}
+						ExcelConditionalFormattingConstants.Paths.CfRule,
+					// {4}
+						ExcelConditionalFormattingConstants.Paths.PriorityAttribute,
+					// {5}
+						priority,
+					// {6}
+						parentNodePath),
+					_worksheet.NameSpaceManager);
+
+				// Check for en error (rule type does not have <cfvo>)
+                if (itemElementNode == null)
+				{
+					throw new Exception(
+						ExcelConditionalFormattingConstants.Errors.MissingCfvoParentNode);
+				}
+			}
+
+            TopNode = itemElementNode;
+
+			// Save the attributes
+			RuleType = ruleType;
+			Type = type;
+			Value = value;
+			Formula = formula;
+		}
+    /// <summary>
+    /// Initialize the cfvo (§18.3.1.11) node
+    /// </summary>
+    /// <param name="ruleType"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode">The cfvo (§18.3.1.11) node parent. Can be any of the following:
+    /// colorScale (§18.3.1.16); dataBar (§18.3.1.28); iconSet (§18.3.1.49)</param>
+    /// <param name="namespaceManager"></param>
+        internal ExcelConditionalFormattingIconDataBarValue(
+            eExcelConditionalFormattingRuleType ruleType,
+            ExcelAddress address,
+            ExcelWorksheet worksheet,
+            XmlNode itemElementNode,
+            XmlNamespaceManager namespaceManager)
+            : base(
+                namespaceManager,
+                itemElementNode)
+        {
+            Require.Argument(address).IsNotNull("address");
+            Require.Argument(worksheet).IsNotNull("worksheet");
+
+            // Save the worksheet for private methods to use
+            _worksheet = worksheet;
+
+            // Schema order list
+            SchemaNodeOrder = new string[]
+			{
+                ExcelConditionalFormattingConstants.Nodes.Cfvo,
+			};
+
+            //Check if the parent does not exists
+            if (itemElementNode == null)
+            {
+                // Get the parent node path by the rule type
+                string parentNodePath = ExcelConditionalFormattingValueObjectType.GetParentPathByRuleType(
+                    ruleType);
+
+                // Check for en error (rule type does not have <cfvo>)
+                if (parentNodePath == string.Empty)
+                {
+                    throw new Exception(
+                        ExcelConditionalFormattingConstants.Errors.MissingCfvoParentNode);
+                }
+            }
+            RuleType = ruleType;            
+        }
+		/// <summary>
+		/// Initialize the <see cref="ExcelConditionalFormattingColorScaleValue"/>
+		/// </summary>
+		/// <param name="type"></param>
+		/// <param name="value"></param>
+		/// <param name="formula"></param>
+		/// <param name="ruleType"></param>
+		/// <param name="priority"></param>
+		/// <param name="address"></param>
+		/// <param name="worksheet"></param>
+		/// <param name="namespaceManager"></param>
+		internal ExcelConditionalFormattingIconDataBarValue(
+			eExcelConditionalFormattingValueObjectType type,
+			double value,
+			string formula,
+			eExcelConditionalFormattingRuleType ruleType,
+            ExcelAddress address,
+            int priority,
+			ExcelWorksheet worksheet,
+			XmlNamespaceManager namespaceManager)
+			: this(
+				type,
+				value,
+				formula,
+				ruleType,
+                address,
+                priority,
+				worksheet,
+				null,
+				namespaceManager)
+		{
+            
+		}
+		/// <summary>
+		/// Initialize the <see cref="ExcelConditionalFormattingColorScaleValue"/>
+		/// </summary>
+		/// <param name="type"></param>
+		/// <param name="color"></param>
+		/// <param name="ruleType"></param>
+		/// <param name="priority"></param>
+		/// <param name="address"></param>
+		/// <param name="worksheet"></param>
+		/// <param name="namespaceManager"></param>
+		internal ExcelConditionalFormattingIconDataBarValue(
+			eExcelConditionalFormattingValueObjectType type,
+			Color color,
+			eExcelConditionalFormattingRuleType ruleType,
+            ExcelAddress address,
+            int priority,
+			ExcelWorksheet worksheet,
+			XmlNamespaceManager namespaceManager)
+			: this(
+				type,
+				0,
+				null,
+				ruleType,
+                address,
+                priority,
+				worksheet,
+				null,
+				namespaceManager)
+		{
+		}
+		#endregion Constructors
+
+		/****************************************************************************************/
+
+		#region Methods
+        #endregion
+
+        /****************************************************************************************/
+
+		#region Exposed Properties
+
+		/// <summary>
+		/// 
+		/// </summary>
+		internal eExcelConditionalFormattingRuleType RuleType
+		{
+			get { return _ruleType; }
+			set { _ruleType = value; }
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		public eExcelConditionalFormattingValueObjectType Type
+		{
+			get
+			{
+				var typeAttribute = GetXmlNodeString(ExcelConditionalFormattingConstants.Paths.TypeAttribute);
+
+				return ExcelConditionalFormattingValueObjectType.GetTypeByAttrbiute(typeAttribute);
+			}
+			set
+			{
+                if ((_ruleType==eExcelConditionalFormattingRuleType.ThreeIconSet || _ruleType==eExcelConditionalFormattingRuleType.FourIconSet || _ruleType==eExcelConditionalFormattingRuleType.FiveIconSet) &&
+                    (value == eExcelConditionalFormattingValueObjectType.Min || value == eExcelConditionalFormattingValueObjectType.Max))
+                {
+                    throw(new ArgumentException("Value type can't be Min or Max for icon sets"));
+                }
+                SetXmlNodeString(ExcelConditionalFormattingConstants.Paths.TypeAttribute, value.ToString().ToLower());                
+			}
+		}
+
+		/// <summary>
+		/// Get/Set the 'cfvo' node @val attribute
+		/// </summary>
+		public Double Value
+		{
+			get
+			{
+                if ((Type == eExcelConditionalFormattingValueObjectType.Num)
+                    || (Type == eExcelConditionalFormattingValueObjectType.Percent)
+                    || (Type == eExcelConditionalFormattingValueObjectType.Percentile))
+                {
+                    return GetXmlNodeDouble(ExcelConditionalFormattingConstants.Paths.ValAttribute);
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+			set
+			{
+				string valueToStore = string.Empty;
+
+				// Only some types use the @val attribute
+				if ((Type == eExcelConditionalFormattingValueObjectType.Num)
+					|| (Type == eExcelConditionalFormattingValueObjectType.Percent)
+					|| (Type == eExcelConditionalFormattingValueObjectType.Percentile))
+				{
+					valueToStore = value.ToString(CultureInfo.InvariantCulture);
+				}
+
+                SetXmlNodeString(ExcelConditionalFormattingConstants.Paths.ValAttribute, valueToStore);
+			}
+		}
+
+		/// <summary>
+		/// Get/Set the Formula of the Object Value (uses the same attribute as the Value)
+		/// </summary>
+		public string Formula
+		{
+			get
+			{
+				// Return empty if the Object Value type is not Formula
+				if (Type != eExcelConditionalFormattingValueObjectType.Formula)
+				{
+					return string.Empty;
+				}
+
+				// Excel stores the formula in the @val attribute
+				return GetXmlNodeString(ExcelConditionalFormattingConstants.Paths.ValAttribute);
+			}
+			set
+			{
+				// Only store the formula if the Object Value type is Formula
+				if (Type == eExcelConditionalFormattingValueObjectType.Formula)
+				{
+                    SetXmlNodeString(ExcelConditionalFormattingConstants.Paths.ValAttribute, value);
+				}
+			}
+		}
+		#endregion Exposed Properties
+
+		/****************************************************************************************/
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingOperatorType.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingOperatorType.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingOperatorType.cs	(revision 9616)
@@ -0,0 +1,145 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-17
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+	/// <summary>
+  /// Functions related to the <see cref="ExcelConditionalFormattingOperatorType"/>
+	/// </summary>
+  internal static class ExcelConditionalFormattingOperatorType
+	{
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="type"></param>
+		/// <returns></returns>
+		internal static string GetAttributeByType(
+			eExcelConditionalFormattingOperatorType type)
+		{
+			switch (type)
+			{
+        case eExcelConditionalFormattingOperatorType.BeginsWith:
+          return ExcelConditionalFormattingConstants.Operators.BeginsWith;
+
+        case eExcelConditionalFormattingOperatorType.Between:
+          return ExcelConditionalFormattingConstants.Operators.Between;
+
+        case eExcelConditionalFormattingOperatorType.ContainsText:
+          return ExcelConditionalFormattingConstants.Operators.ContainsText;
+
+        case eExcelConditionalFormattingOperatorType.EndsWith:
+          return ExcelConditionalFormattingConstants.Operators.EndsWith;
+
+        case eExcelConditionalFormattingOperatorType.Equal:
+          return ExcelConditionalFormattingConstants.Operators.Equal;
+
+        case eExcelConditionalFormattingOperatorType.GreaterThan:
+          return ExcelConditionalFormattingConstants.Operators.GreaterThan;
+
+        case eExcelConditionalFormattingOperatorType.GreaterThanOrEqual:
+          return ExcelConditionalFormattingConstants.Operators.GreaterThanOrEqual;
+
+        case eExcelConditionalFormattingOperatorType.LessThan:
+          return ExcelConditionalFormattingConstants.Operators.LessThan;
+
+        case eExcelConditionalFormattingOperatorType.LessThanOrEqual:
+          return ExcelConditionalFormattingConstants.Operators.LessThanOrEqual;
+
+        case eExcelConditionalFormattingOperatorType.NotBetween:
+          return ExcelConditionalFormattingConstants.Operators.NotBetween;
+
+        case eExcelConditionalFormattingOperatorType.NotContains:
+          return ExcelConditionalFormattingConstants.Operators.NotContains;
+
+        case eExcelConditionalFormattingOperatorType.NotEqual:
+          return ExcelConditionalFormattingConstants.Operators.NotEqual;
+			}
+
+			return string.Empty;
+		}
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// param name="attribute"
+    /// <returns></returns>
+    internal static eExcelConditionalFormattingOperatorType GetTypeByAttribute(
+      string attribute)
+    {
+      switch (attribute)
+      {
+        case ExcelConditionalFormattingConstants.Operators.BeginsWith:
+          return eExcelConditionalFormattingOperatorType.BeginsWith;
+
+        case ExcelConditionalFormattingConstants.Operators.Between:
+          return eExcelConditionalFormattingOperatorType.Between;
+
+        case ExcelConditionalFormattingConstants.Operators.ContainsText:
+          return eExcelConditionalFormattingOperatorType.ContainsText;
+
+        case ExcelConditionalFormattingConstants.Operators.EndsWith:
+          return eExcelConditionalFormattingOperatorType.EndsWith;
+
+        case ExcelConditionalFormattingConstants.Operators.Equal:
+          return eExcelConditionalFormattingOperatorType.Equal;
+
+        case ExcelConditionalFormattingConstants.Operators.GreaterThan:
+          return eExcelConditionalFormattingOperatorType.GreaterThan;
+
+        case ExcelConditionalFormattingConstants.Operators.GreaterThanOrEqual:
+          return eExcelConditionalFormattingOperatorType.GreaterThanOrEqual;
+
+        case ExcelConditionalFormattingConstants.Operators.LessThan:
+          return eExcelConditionalFormattingOperatorType.LessThan;
+
+        case ExcelConditionalFormattingConstants.Operators.LessThanOrEqual:
+          return eExcelConditionalFormattingOperatorType.LessThanOrEqual;
+
+        case ExcelConditionalFormattingConstants.Operators.NotBetween:
+          return eExcelConditionalFormattingOperatorType.NotBetween;
+
+        case ExcelConditionalFormattingConstants.Operators.NotContains:
+          return eExcelConditionalFormattingOperatorType.NotContains;
+
+        case ExcelConditionalFormattingConstants.Operators.NotEqual:
+          return eExcelConditionalFormattingOperatorType.NotEqual;
+      }
+
+      throw new Exception(
+        ExcelConditionalFormattingConstants.Errors.UnexistentOperatorTypeAttribute);
+    }
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingRuleFactory.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingRuleFactory.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingRuleFactory.cs	(revision 9616)
@@ -0,0 +1,388 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ *  * Author							Change						      Date
+ * ******************************************************************************
+ * Eyal Seagull		    Conditional Formatting      2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Utils;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+	/// <summary>
+	/// Factory class for ExcelConditionalFormatting.
+	/// </summary>
+	internal static class ExcelConditionalFormattingRuleFactory
+	{
+		public static ExcelConditionalFormattingRule Create(
+			eExcelConditionalFormattingRuleType type,
+      ExcelAddress address,
+      int priority,
+			ExcelWorksheet worksheet,
+			XmlNode itemElementNode)
+		{
+			Require.Argument(type);
+      Require.Argument(address).IsNotNull("address");
+      Require.Argument(priority).IsInRange(1, int.MaxValue, "priority");
+			Require.Argument(worksheet).IsNotNull("worksheet");
+			
+			// According the conditional formatting rule type
+			switch (type)
+			{
+        case eExcelConditionalFormattingRuleType.AboveAverage:
+          return new ExcelConditionalFormattingAboveAverage(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.AboveOrEqualAverage:
+          return new ExcelConditionalFormattingAboveOrEqualAverage(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.BelowAverage:
+          return new ExcelConditionalFormattingBelowAverage(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.BelowOrEqualAverage:
+          return new ExcelConditionalFormattingBelowOrEqualAverage(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.AboveStdDev:
+          return new ExcelConditionalFormattingAboveStdDev(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.BelowStdDev:
+          return new ExcelConditionalFormattingBelowStdDev(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.Bottom:
+          return new ExcelConditionalFormattingBottom(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.BottomPercent:
+          return new ExcelConditionalFormattingBottomPercent(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.Top:
+          return new ExcelConditionalFormattingTop(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.TopPercent:
+          return new ExcelConditionalFormattingTopPercent(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.Last7Days:
+          return new ExcelConditionalFormattingLast7Days(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+
+        case eExcelConditionalFormattingRuleType.LastMonth:
+          return new ExcelConditionalFormattingLastMonth(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.LastWeek:
+          return new ExcelConditionalFormattingLastWeek(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.NextMonth:
+          return new ExcelConditionalFormattingNextMonth(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.NextWeek:
+          return new ExcelConditionalFormattingNextWeek(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.ThisMonth:
+          return new ExcelConditionalFormattingThisMonth(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.ThisWeek:
+          return new ExcelConditionalFormattingThisWeek(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.Today:
+          return new ExcelConditionalFormattingToday(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.Tomorrow:
+          return new ExcelConditionalFormattingTomorrow(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.Yesterday:
+          return new ExcelConditionalFormattingYesterday(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.BeginsWith:
+          return new ExcelConditionalFormattingBeginsWith(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.Between:
+          return new ExcelConditionalFormattingBetween(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.ContainsBlanks:
+          return new ExcelConditionalFormattingContainsBlanks(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.ContainsErrors:
+          return new ExcelConditionalFormattingContainsErrors(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.ContainsText:
+          return new ExcelConditionalFormattingContainsText(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.DuplicateValues:
+          return new ExcelConditionalFormattingDuplicateValues(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.EndsWith:
+          return new ExcelConditionalFormattingEndsWith(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.Equal:
+          return new ExcelConditionalFormattingEqual(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.Expression:
+          return new ExcelConditionalFormattingExpression(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.GreaterThan:
+          return new ExcelConditionalFormattingGreaterThan(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.GreaterThanOrEqual:
+          return new ExcelConditionalFormattingGreaterThanOrEqual(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.LessThan:
+          return new ExcelConditionalFormattingLessThan(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.LessThanOrEqual:
+          return new ExcelConditionalFormattingLessThanOrEqual(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.NotBetween:
+          return new ExcelConditionalFormattingNotBetween(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.NotContainsBlanks:
+          return new ExcelConditionalFormattingNotContainsBlanks(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.NotContainsErrors:
+          return new ExcelConditionalFormattingNotContainsErrors(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.NotContainsText:
+          return new ExcelConditionalFormattingNotContainsText(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.NotEqual:
+          return new ExcelConditionalFormattingNotEqual(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.UniqueValues:
+          return new ExcelConditionalFormattingUniqueValues(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.ThreeColorScale:
+          return new ExcelConditionalFormattingThreeColorScale(
+            address,
+            priority,
+            worksheet,
+            itemElementNode);
+
+        case eExcelConditionalFormattingRuleType.TwoColorScale:
+          return new ExcelConditionalFormattingTwoColorScale(
+            address,
+            priority,
+						worksheet,
+						itemElementNode);
+        case eExcelConditionalFormattingRuleType.ThreeIconSet:
+          return new ExcelConditionalFormattingThreeIconSet(
+            address,
+            priority,
+            worksheet,
+            itemElementNode,
+            null);
+        case eExcelConditionalFormattingRuleType.FourIconSet:
+          return new ExcelConditionalFormattingFourIconSet(
+            address,
+            priority,
+            worksheet,
+            itemElementNode,
+            null);
+        case eExcelConditionalFormattingRuleType.FiveIconSet:
+          return new ExcelConditionalFormattingFiveIconSet(
+            address,
+            priority,
+            worksheet,
+            itemElementNode,
+            null);
+        case eExcelConditionalFormattingRuleType.DataBar:
+          return new ExcelConditionalFormattingDataBar(
+            eExcelConditionalFormattingRuleType.DataBar,
+            address,
+            priority,
+            worksheet,
+            itemElementNode,
+            null);
+
+
+        //TODO: Add DataBar
+			}
+
+			throw new InvalidOperationException(
+        string.Format(
+          ExcelConditionalFormattingConstants.Errors.NonSupportedRuleType,
+          type.ToString()));
+		}
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingRuleType.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingRuleType.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingRuleType.cs	(revision 9616)
@@ -0,0 +1,539 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// Functions related to the ExcelConditionalFormattingRule
+  /// </summary>
+  internal static class ExcelConditionalFormattingRuleType
+  {
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="attribute"></param>
+    /// <param name="topNode"></param>
+    /// <param name="nameSpaceManager"></param>
+    /// <returns></returns>
+    internal static eExcelConditionalFormattingRuleType GetTypeByAttrbiute(
+      string attribute,
+      XmlNode topNode,
+      XmlNamespaceManager nameSpaceManager)
+    {
+      switch (attribute)
+      {
+        case ExcelConditionalFormattingConstants.RuleType.AboveAverage:
+          return GetAboveAverageType(
+            topNode,
+            nameSpaceManager);
+
+        case ExcelConditionalFormattingConstants.RuleType.Top10:
+          return GetTop10Type(
+            topNode,
+            nameSpaceManager);
+
+        case ExcelConditionalFormattingConstants.RuleType.TimePeriod:
+          return GetTimePeriodType(
+            topNode,
+            nameSpaceManager);
+        case ExcelConditionalFormattingConstants.RuleType.CellIs:
+          return GetCellIs((XmlElement)topNode);
+        case ExcelConditionalFormattingConstants.RuleType.BeginsWith:
+          return eExcelConditionalFormattingRuleType.BeginsWith;
+
+        //case ExcelConditionalFormattingConstants.RuleType.Between:
+        //  return eExcelConditionalFormattingRuleType.Between;
+
+        case ExcelConditionalFormattingConstants.RuleType.ContainsBlanks:
+          return eExcelConditionalFormattingRuleType.ContainsBlanks;
+
+        case ExcelConditionalFormattingConstants.RuleType.ContainsErrors:
+          return eExcelConditionalFormattingRuleType.ContainsErrors;
+
+        case ExcelConditionalFormattingConstants.RuleType.ContainsText:
+          return eExcelConditionalFormattingRuleType.ContainsText;
+
+        case ExcelConditionalFormattingConstants.RuleType.DuplicateValues:
+          return eExcelConditionalFormattingRuleType.DuplicateValues;
+
+        case ExcelConditionalFormattingConstants.RuleType.EndsWith:
+          return eExcelConditionalFormattingRuleType.EndsWith;
+
+        //case ExcelConditionalFormattingConstants.RuleType.Equal:
+        //  return eExcelConditionalFormattingRuleType.Equal;
+
+        case ExcelConditionalFormattingConstants.RuleType.Expression:
+          return eExcelConditionalFormattingRuleType.Expression;
+
+        //case ExcelConditionalFormattingConstants.RuleType.GreaterThan:
+        //  return eExcelConditionalFormattingRuleType.GreaterThan;
+
+        //case ExcelConditionalFormattingConstants.RuleType.GreaterThanOrEqual:
+        //  return eExcelConditionalFormattingRuleType.GreaterThanOrEqual;
+
+        //case ExcelConditionalFormattingConstants.RuleType.LessThan:
+        //  return eExcelConditionalFormattingRuleType.LessThan;
+
+        //case ExcelConditionalFormattingConstants.RuleType.LessThanOrEqual:
+        //  return eExcelConditionalFormattingRuleType.LessThanOrEqual;
+
+        //case ExcelConditionalFormattingConstants.RuleType.NotBetween:
+        //  return eExcelConditionalFormattingRuleType.NotBetween;
+
+        case ExcelConditionalFormattingConstants.RuleType.NotContainsBlanks:
+          return eExcelConditionalFormattingRuleType.NotContainsBlanks;
+
+        case ExcelConditionalFormattingConstants.RuleType.NotContainsErrors:
+          return eExcelConditionalFormattingRuleType.NotContainsErrors;
+
+        case ExcelConditionalFormattingConstants.RuleType.NotContainsText:
+          return eExcelConditionalFormattingRuleType.NotContainsText;
+
+        //case ExcelConditionalFormattingConstants.RuleType.NotEqual:
+        //  return eExcelConditionalFormattingRuleType.NotEqual;
+
+        case ExcelConditionalFormattingConstants.RuleType.UniqueValues:
+          return eExcelConditionalFormattingRuleType.UniqueValues;
+
+        case ExcelConditionalFormattingConstants.RuleType.ColorScale:
+          return GetColorScaleType(
+            topNode,
+            nameSpaceManager);        
+        case ExcelConditionalFormattingConstants.RuleType.IconSet:
+            return GetIconSetType(topNode, nameSpaceManager);
+        case ExcelConditionalFormattingConstants.RuleType.DataBar:
+            return eExcelConditionalFormattingRuleType.DataBar;
+     }
+
+      throw new Exception(
+        ExcelConditionalFormattingConstants.Errors.UnexpectedRuleTypeAttribute);
+    }
+
+    private static eExcelConditionalFormattingRuleType GetCellIs(XmlElement node)
+    {
+        switch(node.GetAttribute("operator"))
+        {
+            case ExcelConditionalFormattingConstants.Operators.BeginsWith:
+              return eExcelConditionalFormattingRuleType.BeginsWith;
+            case ExcelConditionalFormattingConstants.Operators.Between:
+              return eExcelConditionalFormattingRuleType.Between;
+
+            case ExcelConditionalFormattingConstants.Operators.ContainsText:
+              return eExcelConditionalFormattingRuleType.ContainsText;
+
+            case ExcelConditionalFormattingConstants.Operators.EndsWith:
+              return eExcelConditionalFormattingRuleType.EndsWith;
+
+            case ExcelConditionalFormattingConstants.Operators.Equal:
+              return eExcelConditionalFormattingRuleType.Equal;
+
+            case ExcelConditionalFormattingConstants.Operators.GreaterThan:
+              return eExcelConditionalFormattingRuleType.GreaterThan;
+
+            case ExcelConditionalFormattingConstants.Operators.GreaterThanOrEqual:
+              return eExcelConditionalFormattingRuleType.GreaterThanOrEqual;
+
+            case ExcelConditionalFormattingConstants.Operators.LessThan:
+              return eExcelConditionalFormattingRuleType.LessThan;
+
+            case ExcelConditionalFormattingConstants.Operators.LessThanOrEqual:
+              return eExcelConditionalFormattingRuleType.LessThanOrEqual;
+
+            case ExcelConditionalFormattingConstants.Operators.NotBetween:
+              return eExcelConditionalFormattingRuleType.NotBetween;
+
+            case ExcelConditionalFormattingConstants.Operators.NotContains:
+              return eExcelConditionalFormattingRuleType.NotContains;
+
+            case ExcelConditionalFormattingConstants.Operators.NotEqual:
+              return eExcelConditionalFormattingRuleType.NotEqual;
+            default:
+              throw new Exception(
+                ExcelConditionalFormattingConstants.Errors.UnexistentOperatorTypeAttribute);
+        }
+    }
+    private static eExcelConditionalFormattingRuleType GetIconSetType(XmlNode topNode, XmlNamespaceManager nameSpaceManager)
+    {
+        var node = topNode.SelectSingleNode("d:iconSet/@iconSet", nameSpaceManager);
+        if (node == null)
+        {
+            return eExcelConditionalFormattingRuleType.ThreeIconSet;
+        }
+        else
+        {
+            var v = node.Value;
+
+            if (v[0] == '3')
+            {
+                return eExcelConditionalFormattingRuleType.ThreeIconSet;
+            }
+            else if (v[0] == '4')
+            {
+                return eExcelConditionalFormattingRuleType.FourIconSet;
+            }
+            else
+            {
+                return eExcelConditionalFormattingRuleType.FiveIconSet;
+            }
+        }
+    }
+
+    /// <summary>
+    /// Get the "colorScale" rule type according to the number of "cfvo" and "color" nodes.
+    /// If we have excatly 2 "cfvo" and "color" childs, then we return "twoColorScale"
+    /// </summary>
+    /// <returns>TwoColorScale or ThreeColorScale</returns>
+    internal static eExcelConditionalFormattingRuleType GetColorScaleType(
+      XmlNode topNode,
+      XmlNamespaceManager nameSpaceManager)
+    {
+      // Get the <cfvo> nodes
+      var cfvoNodes = topNode.SelectNodes(
+        string.Format(
+          "{0}/{1}",
+          ExcelConditionalFormattingConstants.Paths.ColorScale,
+          ExcelConditionalFormattingConstants.Paths.Cfvo),
+        nameSpaceManager);
+
+      // Get the <color> nodes
+      var colorNodes = topNode.SelectNodes(
+        string.Format(
+          "{0}/{1}",
+          ExcelConditionalFormattingConstants.Paths.ColorScale,
+          ExcelConditionalFormattingConstants.Paths.Color),
+        nameSpaceManager);
+
+      // We determine if it is "TwoColorScale" or "ThreeColorScale" by the
+      // number of <cfvo> and <color> inside the <colorScale> node
+      if ((cfvoNodes == null) || (cfvoNodes.Count < 2) || (cfvoNodes.Count > 3)
+        || (colorNodes == null) || (colorNodes.Count < 2) || (colorNodes.Count > 3)
+        || (cfvoNodes.Count != colorNodes.Count))
+      {
+        throw new Exception(
+          ExcelConditionalFormattingConstants.Errors.WrongNumberCfvoColorNodes);
+      }
+
+      // Return the corresponding rule type (TwoColorScale or ThreeColorScale)
+      return (cfvoNodes.Count == 2)
+        ? eExcelConditionalFormattingRuleType.TwoColorScale
+        : eExcelConditionalFormattingRuleType.ThreeColorScale;
+    }
+
+    /// <summary>
+    /// Get the "aboveAverage" rule type according to the follwoing attributes:
+    /// "AboveAverage", "EqualAverage" and "StdDev".
+    /// 
+    /// @StdDev greater than "0"                              == AboveStdDev
+    /// @StdDev less than "0"                                 == BelowStdDev
+    /// @AboveAverage = "1"/null and @EqualAverage = "0"/null == AboveAverage
+    /// @AboveAverage = "1"/null and @EqualAverage = "1"      == AboveOrEqualAverage
+    /// @AboveAverage = "0" and @EqualAverage = "0"/null      == BelowAverage
+    /// @AboveAverage = "0" and @EqualAverage = "1"           == BelowOrEqualAverage
+    /// /// </summary>
+    /// <returns>AboveAverage, AboveOrEqualAverage, BelowAverage or BelowOrEqualAverage</returns>
+    internal static eExcelConditionalFormattingRuleType GetAboveAverageType(
+      XmlNode topNode,
+      XmlNamespaceManager nameSpaceManager)
+    {
+      // Get @StdDev attribute
+      int? stdDev = ExcelConditionalFormattingHelper.GetAttributeIntNullable(
+        topNode,
+        ExcelConditionalFormattingConstants.Attributes.StdDev);
+
+      if (stdDev > 0)
+      {
+        // @StdDev > "0" --> AboveStdDev
+        return eExcelConditionalFormattingRuleType.AboveStdDev;
+      }
+
+      if (stdDev < 0)
+      {
+        // @StdDev < "0" --> BelowStdDev
+        return eExcelConditionalFormattingRuleType.BelowStdDev;
+      }
+
+      // Get @AboveAverage attribute
+      bool? isAboveAverage = ExcelConditionalFormattingHelper.GetAttributeBoolNullable(
+        topNode,
+        ExcelConditionalFormattingConstants.Attributes.AboveAverage);
+
+      // Get @EqualAverage attribute
+      bool? isEqualAverage = ExcelConditionalFormattingHelper.GetAttributeBoolNullable(
+        topNode,
+        ExcelConditionalFormattingConstants.Attributes.EqualAverage);
+
+      if ((isAboveAverage == null) || (isAboveAverage == true))
+      {
+        if (isEqualAverage == true)
+        {
+          // @AboveAverage = "1"/null and @EqualAverage = "1" == AboveOrEqualAverage
+          return eExcelConditionalFormattingRuleType.AboveOrEqualAverage;
+        }
+
+        // @AboveAverage = "1"/null and @EqualAverage = "0"/null == AboveAverage
+        return eExcelConditionalFormattingRuleType.AboveAverage;
+      }
+
+      if (isEqualAverage == true)
+      {
+        // @AboveAverage = "0" and @EqualAverage = "1" == BelowOrEqualAverage
+        return eExcelConditionalFormattingRuleType.BelowOrEqualAverage;
+      }
+
+      // @AboveAverage = "0" and @EqualAverage = "0"/null == BelowAverage
+      return eExcelConditionalFormattingRuleType.BelowAverage;
+    }
+
+    /// <summary>
+    /// Get the "top10" rule type according to the follwoing attributes:
+    /// "Bottom" and "Percent"
+    /// 
+    /// @Bottom = "1" and @Percent = "0"/null       == Bottom
+    /// @Bottom = "1" and @Percent = "1"            == BottomPercent
+    /// @Bottom = "0"/null and @Percent = "0"/null  == Top
+    /// @Bottom = "0"/null and @Percent = "1"       == TopPercent
+    /// /// </summary>
+    /// <returns>Top, TopPercent, Bottom or BottomPercent</returns>
+    public static eExcelConditionalFormattingRuleType GetTop10Type(
+      XmlNode topNode,
+      XmlNamespaceManager nameSpaceManager)
+    {
+      // Get @Bottom attribute
+      bool? isBottom = ExcelConditionalFormattingHelper.GetAttributeBoolNullable(
+        topNode,
+        ExcelConditionalFormattingConstants.Attributes.Bottom);
+
+      // Get @Percent attribute
+      bool? isPercent = ExcelConditionalFormattingHelper.GetAttributeBoolNullable(
+        topNode,
+        ExcelConditionalFormattingConstants.Attributes.Percent);
+
+      if (isBottom == true)
+      {
+        if (isPercent == true)
+        {
+          // @Bottom = "1" and @Percent = "1" == BottomPercent
+          return eExcelConditionalFormattingRuleType.BottomPercent;
+        }
+
+        // @Bottom = "1" and @Percent = "0"/null == Bottom
+        return eExcelConditionalFormattingRuleType.Bottom;
+      }
+
+      if (isPercent == true)
+      {
+        // @Bottom = "0"/null and @Percent = "1" == TopPercent
+        return eExcelConditionalFormattingRuleType.TopPercent;
+      }
+
+      // @Bottom = "0"/null and @Percent = "0"/null == Top
+      return eExcelConditionalFormattingRuleType.Top;
+    }
+
+    /// <summary>
+    /// Get the "timePeriod" rule type according to "TimePeriod" attribute.
+    /// /// </summary>
+    /// <returns>Last7Days, LastMonth etc.</returns>
+    public static eExcelConditionalFormattingRuleType GetTimePeriodType(
+      XmlNode topNode,
+      XmlNamespaceManager nameSpaceManager)
+    {
+      eExcelConditionalFormattingTimePeriodType timePeriod = ExcelConditionalFormattingTimePeriodType.GetTypeByAttribute(
+        ExcelConditionalFormattingHelper.GetAttributeString(
+          topNode,
+          ExcelConditionalFormattingConstants.Attributes.TimePeriod));
+
+      switch (timePeriod)
+      {
+        case eExcelConditionalFormattingTimePeriodType.Last7Days:
+          return eExcelConditionalFormattingRuleType.Last7Days;
+
+        case eExcelConditionalFormattingTimePeriodType.LastMonth:
+          return eExcelConditionalFormattingRuleType.LastMonth;
+
+        case eExcelConditionalFormattingTimePeriodType.LastWeek:
+          return eExcelConditionalFormattingRuleType.LastWeek;
+
+        case eExcelConditionalFormattingTimePeriodType.NextMonth:
+          return eExcelConditionalFormattingRuleType.NextMonth;
+
+        case eExcelConditionalFormattingTimePeriodType.NextWeek:
+          return eExcelConditionalFormattingRuleType.NextWeek;
+
+        case eExcelConditionalFormattingTimePeriodType.ThisMonth:
+          return eExcelConditionalFormattingRuleType.ThisMonth;
+
+        case eExcelConditionalFormattingTimePeriodType.ThisWeek:
+          return eExcelConditionalFormattingRuleType.ThisWeek;
+
+        case eExcelConditionalFormattingTimePeriodType.Today:
+          return eExcelConditionalFormattingRuleType.Today;
+
+        case eExcelConditionalFormattingTimePeriodType.Tomorrow:
+          return eExcelConditionalFormattingRuleType.Tomorrow;
+
+        case eExcelConditionalFormattingTimePeriodType.Yesterday:
+          return eExcelConditionalFormattingRuleType.Yesterday;
+      }
+
+      throw new Exception(
+        ExcelConditionalFormattingConstants.Errors.UnexistentTimePeriodTypeAttribute);
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="type"></param>
+    /// <returns></returns>
+    public static string GetAttributeByType(
+      eExcelConditionalFormattingRuleType type)
+    {
+      switch (type)
+      {
+        case eExcelConditionalFormattingRuleType.AboveAverage:
+        case eExcelConditionalFormattingRuleType.AboveOrEqualAverage:
+        case eExcelConditionalFormattingRuleType.BelowAverage:
+        case eExcelConditionalFormattingRuleType.BelowOrEqualAverage:
+        case eExcelConditionalFormattingRuleType.AboveStdDev:
+        case eExcelConditionalFormattingRuleType.BelowStdDev:
+          return ExcelConditionalFormattingConstants.RuleType.AboveAverage;
+
+        case eExcelConditionalFormattingRuleType.Bottom:
+        case eExcelConditionalFormattingRuleType.BottomPercent:
+        case eExcelConditionalFormattingRuleType.Top:
+        case eExcelConditionalFormattingRuleType.TopPercent:
+          return ExcelConditionalFormattingConstants.RuleType.Top10;
+
+        case eExcelConditionalFormattingRuleType.Last7Days:
+        case eExcelConditionalFormattingRuleType.LastMonth:
+        case eExcelConditionalFormattingRuleType.LastWeek:
+        case eExcelConditionalFormattingRuleType.NextMonth:
+        case eExcelConditionalFormattingRuleType.NextWeek:
+        case eExcelConditionalFormattingRuleType.ThisMonth:
+        case eExcelConditionalFormattingRuleType.ThisWeek:
+        case eExcelConditionalFormattingRuleType.Today:
+        case eExcelConditionalFormattingRuleType.Tomorrow:
+        case eExcelConditionalFormattingRuleType.Yesterday:
+          return ExcelConditionalFormattingConstants.RuleType.TimePeriod;
+
+        case eExcelConditionalFormattingRuleType.Between:
+        case eExcelConditionalFormattingRuleType.Equal:
+        case eExcelConditionalFormattingRuleType.GreaterThan:
+        case eExcelConditionalFormattingRuleType.GreaterThanOrEqual:
+        case eExcelConditionalFormattingRuleType.LessThan:
+        case eExcelConditionalFormattingRuleType.LessThanOrEqual:
+        case eExcelConditionalFormattingRuleType.NotBetween:
+        case eExcelConditionalFormattingRuleType.NotEqual:
+          return ExcelConditionalFormattingConstants.RuleType.CellIs;
+
+        case eExcelConditionalFormattingRuleType.ThreeIconSet:
+        case eExcelConditionalFormattingRuleType.FourIconSet:
+        case eExcelConditionalFormattingRuleType.FiveIconSet:
+          return ExcelConditionalFormattingConstants.RuleType.IconSet;
+
+        case eExcelConditionalFormattingRuleType.ThreeColorScale:
+        case eExcelConditionalFormattingRuleType.TwoColorScale:
+          return ExcelConditionalFormattingConstants.RuleType.ColorScale;
+
+        case eExcelConditionalFormattingRuleType.BeginsWith:
+          return ExcelConditionalFormattingConstants.RuleType.BeginsWith;
+
+        case eExcelConditionalFormattingRuleType.ContainsBlanks:
+          return ExcelConditionalFormattingConstants.RuleType.ContainsBlanks;
+
+        case eExcelConditionalFormattingRuleType.ContainsErrors:
+          return ExcelConditionalFormattingConstants.RuleType.ContainsErrors;
+
+        case eExcelConditionalFormattingRuleType.ContainsText:
+          return ExcelConditionalFormattingConstants.RuleType.ContainsText;
+
+        case eExcelConditionalFormattingRuleType.DuplicateValues:
+          return ExcelConditionalFormattingConstants.RuleType.DuplicateValues;
+
+        case eExcelConditionalFormattingRuleType.EndsWith:
+          return ExcelConditionalFormattingConstants.RuleType.EndsWith;
+
+        case eExcelConditionalFormattingRuleType.Expression:
+          return ExcelConditionalFormattingConstants.RuleType.Expression;
+
+        case eExcelConditionalFormattingRuleType.NotContainsBlanks:
+          return ExcelConditionalFormattingConstants.RuleType.NotContainsBlanks;
+
+        case eExcelConditionalFormattingRuleType.NotContainsErrors:
+          return ExcelConditionalFormattingConstants.RuleType.NotContainsErrors;
+
+        case eExcelConditionalFormattingRuleType.NotContainsText:
+          return ExcelConditionalFormattingConstants.RuleType.NotContainsText;
+
+        case eExcelConditionalFormattingRuleType.UniqueValues:
+          return ExcelConditionalFormattingConstants.RuleType.UniqueValues;
+
+        case eExcelConditionalFormattingRuleType.DataBar:
+          return ExcelConditionalFormattingConstants.RuleType.DataBar;
+      }
+
+      throw new Exception(
+        ExcelConditionalFormattingConstants.Errors.MissingRuleType);
+    }
+
+    /// <summary>
+    /// Return cfvo §18.3.1.11 parent according to the rule type
+    /// </summary>
+    /// <param name="type"></param>
+    /// <returns></returns>
+    public static string GetCfvoParentPathByType(
+      eExcelConditionalFormattingRuleType type)
+    {
+      switch (type)
+      {
+        case eExcelConditionalFormattingRuleType.TwoColorScale:
+        case eExcelConditionalFormattingRuleType.ThreeColorScale:
+          return ExcelConditionalFormattingConstants.Paths.ColorScale;
+
+        case eExcelConditionalFormattingRuleType.ThreeIconSet:
+        case eExcelConditionalFormattingRuleType.FourIconSet:
+        case eExcelConditionalFormattingRuleType.FiveIconSet:
+          return ExcelConditionalFormattingConstants.RuleType.IconSet;
+
+        case eExcelConditionalFormattingRuleType.DataBar:
+          return ExcelConditionalFormattingConstants.RuleType.DataBar;
+      }
+
+      throw new Exception(
+        ExcelConditionalFormattingConstants.Errors.MissingRuleType);
+    }
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingTimePeriodType.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingTimePeriodType.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingTimePeriodType.cs	(revision 9616)
@@ -0,0 +1,133 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-17
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+	/// <summary>
+  /// Functions related to the <see cref="ExcelConditionalFormattingTimePeriodType"/>
+	/// </summary>
+  internal static class ExcelConditionalFormattingTimePeriodType
+	{
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="type"></param>
+		/// <returns></returns>
+		public static string GetAttributeByType(
+			eExcelConditionalFormattingTimePeriodType type)
+		{
+			switch (type)
+			{
+        case eExcelConditionalFormattingTimePeriodType.Last7Days:
+          return ExcelConditionalFormattingConstants.TimePeriods.Last7Days;
+
+        case eExcelConditionalFormattingTimePeriodType.LastMonth:
+          return ExcelConditionalFormattingConstants.TimePeriods.LastMonth;
+
+        case eExcelConditionalFormattingTimePeriodType.LastWeek:
+          return ExcelConditionalFormattingConstants.TimePeriods.LastWeek;
+
+        case eExcelConditionalFormattingTimePeriodType.NextMonth:
+          return ExcelConditionalFormattingConstants.TimePeriods.NextMonth;
+
+        case eExcelConditionalFormattingTimePeriodType.NextWeek:
+          return ExcelConditionalFormattingConstants.TimePeriods.NextWeek;
+
+        case eExcelConditionalFormattingTimePeriodType.ThisMonth:
+          return ExcelConditionalFormattingConstants.TimePeriods.ThisMonth;
+
+        case eExcelConditionalFormattingTimePeriodType.ThisWeek:
+          return ExcelConditionalFormattingConstants.TimePeriods.ThisWeek;
+
+        case eExcelConditionalFormattingTimePeriodType.Today:
+          return ExcelConditionalFormattingConstants.TimePeriods.Today;
+
+        case eExcelConditionalFormattingTimePeriodType.Tomorrow:
+          return ExcelConditionalFormattingConstants.TimePeriods.Tomorrow;
+
+        case eExcelConditionalFormattingTimePeriodType.Yesterday:
+          return ExcelConditionalFormattingConstants.TimePeriods.Yesterday;
+			}
+
+			return string.Empty;
+		}
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="attribute"></param>
+    /// <returns></returns>
+    public static eExcelConditionalFormattingTimePeriodType GetTypeByAttribute(
+      string attribute)
+    {
+      switch (attribute)
+      {
+        case ExcelConditionalFormattingConstants.TimePeriods.Last7Days:
+          return eExcelConditionalFormattingTimePeriodType.Last7Days;
+
+        case ExcelConditionalFormattingConstants.TimePeriods.LastMonth:
+          return eExcelConditionalFormattingTimePeriodType.LastMonth;
+
+        case ExcelConditionalFormattingConstants.TimePeriods.LastWeek:
+          return eExcelConditionalFormattingTimePeriodType.LastWeek;
+
+        case ExcelConditionalFormattingConstants.TimePeriods.NextMonth:
+          return eExcelConditionalFormattingTimePeriodType.NextMonth;
+
+        case ExcelConditionalFormattingConstants.TimePeriods.NextWeek:
+          return eExcelConditionalFormattingTimePeriodType.NextWeek;
+
+        case ExcelConditionalFormattingConstants.TimePeriods.ThisMonth:
+          return eExcelConditionalFormattingTimePeriodType.ThisMonth;
+
+        case ExcelConditionalFormattingConstants.TimePeriods.ThisWeek:
+          return eExcelConditionalFormattingTimePeriodType.ThisWeek;
+
+        case ExcelConditionalFormattingConstants.TimePeriods.Today:
+          return eExcelConditionalFormattingTimePeriodType.Today;
+
+        case ExcelConditionalFormattingConstants.TimePeriods.Tomorrow:
+          return eExcelConditionalFormattingTimePeriodType.Tomorrow;
+
+        case ExcelConditionalFormattingConstants.TimePeriods.Yesterday:
+          return eExcelConditionalFormattingTimePeriodType.Yesterday;
+      }
+
+      throw new Exception(
+        ExcelConditionalFormattingConstants.Errors.UnexistentTimePeriodTypeAttribute);
+    }
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingValueObjectType.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingValueObjectType.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/ExcelConditionalFormattingValueObjectType.cs	(revision 9616)
@@ -0,0 +1,222 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author          Change						                  Date
+ * ******************************************************************************
+ * Eyal Seagull    Conditional Formatting Adaption    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+	/// <summary>
+	/// Functions related to the <see cref="ExcelConditionalFormattingColorScaleValue"/>
+	/// </summary>
+	internal static class ExcelConditionalFormattingValueObjectType
+	{
+		/// <summary>
+		/// Get the sequencial order of a cfvo/color by its position.
+		/// </summary>
+		/// <param name="position"></param>
+        /// <param name="ruleType"></param>
+		/// <returns>1, 2 or 3</returns>
+		internal static int GetOrderByPosition(
+			eExcelConditionalFormattingValueObjectPosition position,
+			eExcelConditionalFormattingRuleType ruleType)
+		{
+			switch (position)
+			{
+				case eExcelConditionalFormattingValueObjectPosition.Low:
+					return 1;
+
+				case eExcelConditionalFormattingValueObjectPosition.Middle:
+					return 2;
+
+				case eExcelConditionalFormattingValueObjectPosition.High:
+					// Check if the rule type is TwoColorScale.
+					if (ruleType == eExcelConditionalFormattingRuleType.TwoColorScale)
+					{
+						// There are only "Low" and "High". So "High" is the second
+						return 2;
+					}
+
+					// There are "Low", "Middle" and "High". So "High" is the third
+					return 3;
+			}
+
+			return 0;
+		}
+
+		/// <summary>
+		/// Get the CFVO type by its @type attribute
+		/// </summary>
+		/// <param name="attribute"></param>
+		/// <returns></returns>
+		public static eExcelConditionalFormattingValueObjectType GetTypeByAttrbiute(
+			string attribute)
+		{
+			switch (attribute)
+			{
+				case ExcelConditionalFormattingConstants.CfvoType.Min:
+					return eExcelConditionalFormattingValueObjectType.Min;
+
+        case ExcelConditionalFormattingConstants.CfvoType.Max:
+					return eExcelConditionalFormattingValueObjectType.Max;
+
+        case ExcelConditionalFormattingConstants.CfvoType.Num:
+					return eExcelConditionalFormattingValueObjectType.Num;
+
+        case ExcelConditionalFormattingConstants.CfvoType.Formula:
+					return eExcelConditionalFormattingValueObjectType.Formula;
+
+        case ExcelConditionalFormattingConstants.CfvoType.Percent:
+					return eExcelConditionalFormattingValueObjectType.Percent;
+
+        case ExcelConditionalFormattingConstants.CfvoType.Percentile:
+					return eExcelConditionalFormattingValueObjectType.Percentile;
+			}
+
+			throw new Exception(
+        ExcelConditionalFormattingConstants.Errors.UnexistentCfvoTypeAttribute);
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="position"></param>
+		///<param name="ruleType"></param>
+        /// <param name="topNode"></param>
+		/// <param name="nameSpaceManager"></param>
+		/// <returns></returns>
+		public static XmlNode GetCfvoNodeByPosition(
+			eExcelConditionalFormattingValueObjectPosition position,
+			eExcelConditionalFormattingRuleType ruleType,
+			XmlNode topNode,
+			XmlNamespaceManager nameSpaceManager)
+		{
+			// Get the corresponding <cfvo> node (by the position)
+			var node = topNode.SelectSingleNode(
+				string.Format(
+					"{0}[position()={1}]",
+				// {0}
+					ExcelConditionalFormattingConstants.Paths.Cfvo,
+				// {1}
+					ExcelConditionalFormattingValueObjectType.GetOrderByPosition(position, ruleType)),
+				nameSpaceManager);
+
+			if (node == null)
+			{
+				throw new Exception(
+          ExcelConditionalFormattingConstants.Errors.MissingCfvoNode);
+			}
+
+			return node;
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="type"></param>
+		/// <returns></returns>
+		public static string GetAttributeByType(
+			eExcelConditionalFormattingValueObjectType type)
+		{
+			switch (type)
+			{
+				case eExcelConditionalFormattingValueObjectType.Min:
+					return ExcelConditionalFormattingConstants.CfvoType.Min;
+
+				case eExcelConditionalFormattingValueObjectType.Max:
+          return ExcelConditionalFormattingConstants.CfvoType.Max;
+
+				case eExcelConditionalFormattingValueObjectType.Num:
+          return ExcelConditionalFormattingConstants.CfvoType.Num;
+
+				case eExcelConditionalFormattingValueObjectType.Formula:
+          return ExcelConditionalFormattingConstants.CfvoType.Formula;
+
+				case eExcelConditionalFormattingValueObjectType.Percent:
+          return ExcelConditionalFormattingConstants.CfvoType.Percent;
+
+				case eExcelConditionalFormattingValueObjectType.Percentile:
+          return ExcelConditionalFormattingConstants.CfvoType.Percentile;
+			}
+
+			return string.Empty;
+		}
+
+		/// <summary>
+		/// Get the cfvo (§18.3.1.11) node parent by the rule type. Can be any of the following:
+		/// "colorScale" (§18.3.1.16); "dataBar" (§18.3.1.28); "iconSet" (§18.3.1.49)
+		/// </summary>
+		/// <param name="ruleType"></param>
+		/// <returns></returns>
+		public static string GetParentPathByRuleType(
+			eExcelConditionalFormattingRuleType ruleType)
+		{
+			switch (ruleType)
+			{
+				case eExcelConditionalFormattingRuleType.TwoColorScale:
+				case eExcelConditionalFormattingRuleType.ThreeColorScale:
+					return ExcelConditionalFormattingConstants.Paths.ColorScale;
+
+				case eExcelConditionalFormattingRuleType.ThreeIconSet:
+                case eExcelConditionalFormattingRuleType.FourIconSet:
+                case eExcelConditionalFormattingRuleType.FiveIconSet:
+					        return ExcelConditionalFormattingConstants.Paths.IconSet;
+
+                case eExcelConditionalFormattingRuleType.DataBar:
+                  return ExcelConditionalFormattingConstants.Paths.DataBar;
+              }
+
+			return string.Empty;
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="nodeType"></param>
+		/// <returns></returns>
+		public static string GetNodePathByNodeType(
+			eExcelConditionalFormattingValueObjectNodeType nodeType)
+		{
+			switch(nodeType)
+			{
+				case eExcelConditionalFormattingValueObjectNodeType.Cfvo:
+					return ExcelConditionalFormattingConstants.Paths.Cfvo;
+
+				case eExcelConditionalFormattingValueObjectNodeType.Color:
+					return ExcelConditionalFormattingConstants.Paths.Color;
+			}
+
+			return string.Empty;
+		}
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/RangeConditionalFormatting.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/RangeConditionalFormatting.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/RangeConditionalFormatting.cs	(revision 9616)
@@ -0,0 +1,531 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author             Change                    Date
+ * ******************************************************************************
+ * Eyal Seagull       Conditional Formatting    2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.Utils;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  internal class RangeConditionalFormatting
+    : IRangeConditionalFormatting
+  {
+    #region Public Properties
+    public ExcelWorksheet _worksheet;
+    public ExcelAddress _address;
+    #endregion Public Properties
+
+    #region Constructors
+    public RangeConditionalFormatting(
+      ExcelWorksheet worksheet,
+      ExcelAddress address)
+    {
+      Require.Argument(worksheet).IsNotNull("worksheet");
+      Require.Argument(address).IsNotNull("address");
+
+      _worksheet = worksheet;
+      _address = address;
+    }
+    #endregion Constructors
+
+    #region Conditional Formatting Rule Types
+    /// <summary>
+    /// Add AboveOrEqualAverage Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingAverageGroup AddAboveAverage()
+    {
+      return _worksheet.ConditionalFormatting.AddAboveAverage(
+        _address);
+    }
+
+    /// <summary>
+    /// Add AboveOrEqualAverage Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingAverageGroup AddAboveOrEqualAverage()
+    {
+      return _worksheet.ConditionalFormatting.AddAboveOrEqualAverage(
+        _address);
+    }
+
+    /// <summary>
+    /// Add BelowOrEqualAverage Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingAverageGroup AddBelowAverage()
+    {
+      return _worksheet.ConditionalFormatting.AddBelowAverage(
+        _address);
+    }
+
+    /// <summary>
+    /// Add BelowOrEqualAverage Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingAverageGroup AddBelowOrEqualAverage()
+    {
+      return _worksheet.ConditionalFormatting.AddBelowOrEqualAverage(
+        _address);
+    }
+
+    /// <summary>
+    /// Add AboveStdDev Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingStdDevGroup AddAboveStdDev()
+    {
+      return _worksheet.ConditionalFormatting.AddAboveStdDev(
+        _address);
+    }
+
+    /// <summary>
+    /// Add BelowStdDev Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingStdDevGroup AddBelowStdDev()
+    {
+      return _worksheet.ConditionalFormatting.AddBelowStdDev(
+        _address);
+    }
+
+    /// <summary>
+    /// Add Bottom Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTopBottomGroup AddBottom()
+    {
+      return _worksheet.ConditionalFormatting.AddBottom(
+        _address);
+    }
+
+    /// <summary>
+    /// Add BottomPercent Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTopBottomGroup AddBottomPercent()
+    {
+      return _worksheet.ConditionalFormatting.AddBottomPercent(
+        _address);
+    }
+
+    /// <summary>
+    /// Add Top Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTopBottomGroup AddTop()
+    {
+      return _worksheet.ConditionalFormatting.AddTop(
+        _address);
+    }
+
+    /// <summary>
+    /// Add TopPercent Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTopBottomGroup AddTopPercent()
+    {
+      return _worksheet.ConditionalFormatting.AddTopPercent(
+        _address);
+    }
+
+    /// <summary>
+    /// Add Last7Days Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddLast7Days()
+    {
+      return _worksheet.ConditionalFormatting.AddLast7Days(
+        _address);
+    }
+
+    /// <summary>
+    /// Add LastMonth Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddLastMonth()
+    {
+      return _worksheet.ConditionalFormatting.AddLastMonth(
+        _address);
+    }
+
+    /// <summary>
+    /// Add LastWeek Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddLastWeek()
+    {
+      return _worksheet.ConditionalFormatting.AddLastWeek(
+        _address);
+    }
+
+    /// <summary>
+    /// Add NextMonth Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddNextMonth()
+    {
+      return _worksheet.ConditionalFormatting.AddNextMonth(
+        _address);
+    }
+
+    /// <summary>
+    /// Add NextWeek Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddNextWeek()
+    {
+      return _worksheet.ConditionalFormatting.AddNextWeek(
+        _address);
+    }
+
+    /// <summary>
+    /// Add ThisMonth Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddThisMonth()
+    {
+      return _worksheet.ConditionalFormatting.AddThisMonth(
+        _address);
+    }
+
+    /// <summary>
+    /// Add ThisWeek Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddThisWeek()
+    {
+      return _worksheet.ConditionalFormatting.AddThisWeek(
+        _address);
+    }
+
+    /// <summary>
+    /// Add Today Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddToday()
+    {
+      return _worksheet.ConditionalFormatting.AddToday(
+        _address);
+    }
+
+    /// <summary>
+    /// Add Tomorrow Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddTomorrow()
+    {
+      return _worksheet.ConditionalFormatting.AddTomorrow(
+        _address);
+    }
+
+    /// <summary>
+    /// Add Yesterday Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTimePeriodGroup AddYesterday()
+    {
+      return _worksheet.ConditionalFormatting.AddYesterday(
+        _address);
+    }
+
+    /// <summary>
+    /// Add BeginsWith Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingBeginsWith AddBeginsWith()
+    {
+      return _worksheet.ConditionalFormatting.AddBeginsWith(
+        _address);
+    }
+
+    /// <summary>
+    /// Add Between Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingBetween AddBetween()
+    {
+      return _worksheet.ConditionalFormatting.AddBetween(
+        _address);
+    }
+
+    /// <summary>
+    /// Add ContainsBlanks Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingContainsBlanks AddContainsBlanks()
+    {
+      return _worksheet.ConditionalFormatting.AddContainsBlanks(
+        _address);
+    }
+
+    /// <summary>
+    /// Add ContainsErrors Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingContainsErrors AddContainsErrors()
+    {
+      return _worksheet.ConditionalFormatting.AddContainsErrors(
+        _address);
+    }
+
+    /// <summary>
+    /// Add ContainsText Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingContainsText AddContainsText()
+    {
+      return _worksheet.ConditionalFormatting.AddContainsText(
+        _address);
+    }
+
+    /// <summary>
+    /// Add DuplicateValues Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingDuplicateValues AddDuplicateValues()
+    {
+      return _worksheet.ConditionalFormatting.AddDuplicateValues(
+        _address);
+    }
+
+    /// <summary>
+    /// Add EndsWith Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingEndsWith AddEndsWith()
+    {
+      return _worksheet.ConditionalFormatting.AddEndsWith(
+        _address);
+    }
+
+    /// <summary>
+    /// Add Equal Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingEqual AddEqual()
+    {
+      return _worksheet.ConditionalFormatting.AddEqual(
+        _address);
+    }
+
+    /// <summary>
+    /// Add Expression Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingExpression AddExpression()
+    {
+      return _worksheet.ConditionalFormatting.AddExpression(
+        _address);
+    }
+
+    /// <summary>
+    /// Add GreaterThan Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingGreaterThan AddGreaterThan()
+    {
+      return _worksheet.ConditionalFormatting.AddGreaterThan(
+        _address);
+    }
+
+    /// <summary>
+    /// Add GreaterThanOrEqual Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingGreaterThanOrEqual AddGreaterThanOrEqual()
+    {
+      return _worksheet.ConditionalFormatting.AddGreaterThanOrEqual(
+        _address);
+    }
+
+    /// <summary>
+    /// Add LessThan Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingLessThan AddLessThan()
+    {
+      return _worksheet.ConditionalFormatting.AddLessThan(
+        _address);
+    }
+
+    /// <summary>
+    /// Add LessThanOrEqual Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingLessThanOrEqual AddLessThanOrEqual()
+    {
+      return _worksheet.ConditionalFormatting.AddLessThanOrEqual(
+        _address);
+    }
+
+    /// <summary>
+    /// Add NotBetween Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingNotBetween AddNotBetween()
+    {
+      return _worksheet.ConditionalFormatting.AddNotBetween(
+        _address);
+    }
+
+    /// <summary>
+    /// Add NotContainsBlanks Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingNotContainsBlanks AddNotContainsBlanks()
+    {
+      return _worksheet.ConditionalFormatting.AddNotContainsBlanks(
+        _address);
+    }
+
+    /// <summary>
+    /// Add NotContainsErrors Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingNotContainsErrors AddNotContainsErrors()
+    {
+      return _worksheet.ConditionalFormatting.AddNotContainsErrors(
+        _address);
+    }
+
+    /// <summary>
+    /// Add NotContainsText Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingNotContainsText AddNotContainsText()
+    {
+      return _worksheet.ConditionalFormatting.AddNotContainsText(
+        _address);
+    }
+
+    /// <summary>
+    /// Add NotEqual Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingNotEqual AddNotEqual()
+    {
+      return _worksheet.ConditionalFormatting.AddNotEqual(
+        _address);
+    }
+
+    /// <summary>
+    /// Add UniqueValues Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingUniqueValues AddUniqueValues()
+    {
+      return _worksheet.ConditionalFormatting.AddUniqueValues(
+        _address);
+    }
+
+    /// <summary>
+    /// Add ThreeColorScale Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingThreeColorScale AddThreeColorScale()
+    {
+      return (IExcelConditionalFormattingThreeColorScale)(_worksheet.ConditionalFormatting.AddRule(
+        eExcelConditionalFormattingRuleType.ThreeColorScale,
+        _address));
+    }
+
+    /// <summary>
+    /// Add TwoColorScale Conditional Formatting
+    /// </summary>
+    ///  <returns></returns>
+    public IExcelConditionalFormattingTwoColorScale AddTwoColorScale()
+    {
+      return (IExcelConditionalFormattingTwoColorScale)(_worksheet.ConditionalFormatting.AddRule(
+        eExcelConditionalFormattingRuleType.TwoColorScale,
+        _address));
+    }
+
+    /// <summary>
+    /// Adds a ThreeIconSet rule 
+    /// </summary>
+    /// <param name="IconSet"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingThreeIconSet<eExcelconditionalFormatting3IconsSetType> AddThreeIconSet(eExcelconditionalFormatting3IconsSetType IconSet)
+    {
+        var rule = (IExcelConditionalFormattingThreeIconSet<eExcelconditionalFormatting3IconsSetType>)(_worksheet.ConditionalFormatting.AddRule(
+          eExcelConditionalFormattingRuleType.ThreeIconSet,
+          _address));
+        rule.IconSet = IconSet;
+        return rule;
+    }
+
+    /// <summary>
+    /// Adds a FourIconSet rule 
+    /// </summary>
+    /// <param name="IconSet"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingFourIconSet<eExcelconditionalFormatting4IconsSetType> AddFourIconSet(eExcelconditionalFormatting4IconsSetType IconSet)
+    {
+        var rule = (IExcelConditionalFormattingFourIconSet<eExcelconditionalFormatting4IconsSetType>)(_worksheet.ConditionalFormatting.AddRule(
+          eExcelConditionalFormattingRuleType.FourIconSet,
+          _address));
+        rule.IconSet = IconSet;
+        return rule;
+    }
+
+    /// <summary>
+    /// Adds a FiveIconSet rule 
+    /// </summary>
+    /// <param name="IconSet"></param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingFiveIconSet AddFiveIconSet(eExcelconditionalFormatting5IconsSetType IconSet)
+    {
+        var rule = (IExcelConditionalFormattingFiveIconSet)(_worksheet.ConditionalFormatting.AddRule(
+          eExcelConditionalFormattingRuleType.FiveIconSet,
+          _address));
+        rule.IconSet = IconSet;
+        return rule;
+    }
+
+    /// <summary>
+    /// Adds a Databar rule 
+    /// </summary>
+    /// <param name="Color">The color of the databar</param>
+    /// <returns></returns>
+    public IExcelConditionalFormattingDataBarGroup AddDatabar(System.Drawing.Color Color)
+    {
+        var rule = (IExcelConditionalFormattingDataBarGroup)(_worksheet.ConditionalFormatting.AddRule(
+          eExcelConditionalFormattingRuleType.DataBar,
+          _address));
+        rule.Color = Color;
+        return rule;
+    }
+    #endregion Conditional Formatting Rule Types
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAboveAverage.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAboveAverage.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAboveAverage.cs	(revision 9616)
@@ -0,0 +1,122 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingAboveAverage
+  /// </summary>
+  public class ExcelConditionalFormattingAboveAverage
+    : ExcelConditionalFormattingAverageGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingAboveAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.AboveAverage,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            AboveAverage = true;
+            EqualAverage = false;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingAboveAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingAboveAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAboveOrEqualAverage.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAboveOrEqualAverage.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAboveOrEqualAverage.cs	(revision 9616)
@@ -0,0 +1,122 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingAboveOrEqualAverage
+  /// </summary>
+  public class ExcelConditionalFormattingAboveOrEqualAverage
+    : ExcelConditionalFormattingAverageGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingAboveOrEqualAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.AboveOrEqualAverage,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            AboveAverage = true;
+            EqualAverage = true;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingAboveOrEqualAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingAboveOrEqualAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAboveStdDev.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAboveStdDev.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAboveStdDev.cs	(revision 9616)
@@ -0,0 +1,123 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingAboveStdDev
+  /// </summary>
+  public class ExcelConditionalFormattingAboveStdDev
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingStdDevGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingAboveStdDev(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.AboveStdDev,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            AboveAverage = true;
+            StdDev = 1;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingAboveStdDev(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingAboveStdDev(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAverageGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAverageGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingAverageGroup.cs	(revision 9616)
@@ -0,0 +1,126 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingAverageGroup
+  /// </summary>
+  public class ExcelConditionalFormattingAverageGroup
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingAverageGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="type"></param>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingAverageGroup(
+      eExcelConditionalFormattingRuleType type,
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        type,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    ///<param name="type"></param>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingAverageGroup(
+      eExcelConditionalFormattingRuleType type,
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        type,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    ///<param name="type"></param>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingAverageGroup(
+      eExcelConditionalFormattingRuleType type,
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        type,
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBeginsWith.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBeginsWith.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBeginsWith.cs	(revision 9616)
@@ -0,0 +1,150 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingBeginsWith
+  /// </summary>
+  public class ExcelConditionalFormattingBeginsWith
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingBeginsWith
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingBeginsWith(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.BeginsWith,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.BeginsWith;
+            Text = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingBeginsWith(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingBeginsWith(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+
+    #region Exposed Properties
+    /// <summary>
+    /// The text to search in the beginning of the cell
+    /// </summary>
+    public string Text
+    {
+      get
+      {
+        return GetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TextAttribute);
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TextAttribute,
+          value);
+
+        Formula = string.Format(
+          "LEFT({0},LEN(\"{1}\"))=\"{1}\"",
+          Address.Start.Address,
+          value.Replace("\"", "\"\""));
+      }
+    }
+    #endregion Exposed Properties
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBelowAverage.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBelowAverage.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBelowAverage.cs	(revision 9616)
@@ -0,0 +1,122 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingBelowAverage
+  /// </summary>
+  public class ExcelConditionalFormattingBelowAverage
+    : ExcelConditionalFormattingAverageGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingBelowAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.BelowAverage,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            AboveAverage = false;
+            EqualAverage = false;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingBelowAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingBelowAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBelowOrEqualAverage.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBelowOrEqualAverage.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBelowOrEqualAverage.cs	(revision 9616)
@@ -0,0 +1,122 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingBelowOrEqualAverage
+  /// </summary>
+  public class ExcelConditionalFormattingBelowOrEqualAverage
+    : ExcelConditionalFormattingAverageGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingBelowOrEqualAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.BelowOrEqualAverage,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            AboveAverage = false;
+            EqualAverage = true;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingBelowOrEqualAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingBelowOrEqualAverage(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBelowStdDev.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBelowStdDev.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBelowStdDev.cs	(revision 9616)
@@ -0,0 +1,123 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingBelowStdDev
+  /// </summary>
+  public class ExcelConditionalFormattingBelowStdDev
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingStdDevGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingBelowStdDev(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.BelowStdDev,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            AboveAverage = false;
+            StdDev = 1;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingBelowStdDev(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingBelowStdDev(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBetween.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBetween.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBetween.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingBetween
+  /// </summary>
+  public class ExcelConditionalFormattingBetween
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingBetween
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingBetween(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.Between,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.Between;
+            Formula = string.Empty;
+            Formula2 = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingBetween(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingBetween(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBottom.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBottom.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBottom.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingBottom
+  /// </summary>
+  public class ExcelConditionalFormattingBottom
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingTopBottomGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingBottom(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.Bottom,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Bottom = true;
+            Percent = false;
+            Rank = 10;  // Last 10 values
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingBottom(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingBottom(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBottomPercent.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBottomPercent.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingBottomPercent.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingBottomPercent
+  /// </summary>
+  public class ExcelConditionalFormattingBottomPercent
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingTopBottomGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingBottomPercent(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.BottomPercent,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Bottom = true;
+            Percent = true;
+            Rank = 10;  // Last 10 percent
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingBottomPercent(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingBottomPercent(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingContainsBlanks.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingContainsBlanks.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingContainsBlanks.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingContainsBlanks
+  /// </summary>
+  public class ExcelConditionalFormattingContainsBlanks
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingContainsBlanks
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingContainsBlanks(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.ContainsBlanks,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Formula = string.Format(
+              "LEN(TRIM({0}))=0",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingContainsBlanks(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingContainsBlanks(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingContainsErrors.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingContainsErrors.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingContainsErrors.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingContainsErrors
+  /// </summary>
+  public class ExcelConditionalFormattingContainsErrors
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingContainsErrors
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingContainsErrors(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.ContainsErrors,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Formula = string.Format(
+              "ISERROR({0})",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingContainsErrors(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingContainsErrors(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingContainsText.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingContainsText.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingContainsText.cs	(revision 9616)
@@ -0,0 +1,150 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingContainsText
+  /// </summary>
+  public class ExcelConditionalFormattingContainsText
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingContainsText
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingContainsText(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.ContainsText,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.ContainsText;
+            Text = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingContainsText(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingContainsText(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+
+    #region Exposed Properties
+    /// <summary>
+    /// The text to search inside the cell
+    /// </summary>
+    public string Text
+    {
+      get
+      {
+        return GetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TextAttribute);
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TextAttribute,
+          value);
+
+        Formula = string.Format(
+          "NOT(ISERROR(SEARCH(\"{1}\",{0})))",
+          Address.Start.Address,
+          value.Replace("\"", "\"\""));
+      }
+    }
+    #endregion Exposed Properties
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingDataBar.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingDataBar.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingDataBar.cs	(revision 9616)
@@ -0,0 +1,233 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+using System.Globalization;
+namespace OfficeOpenXml.ConditionalFormatting
+{
+    /// <summary>
+    /// Databar
+    /// </summary>
+    public class ExcelConditionalFormattingDataBar
+      : ExcelConditionalFormattingRule,
+        IExcelConditionalFormattingDataBarGroup
+    {
+        /****************************************************************************************/
+
+        #region Private Properties
+
+        #endregion Private Properties
+
+        /****************************************************************************************/
+
+        #region Constructors
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="type"></param>
+        /// <param name="priority"></param>
+        /// <param name="address"></param>
+        /// <param name="worksheet"></param>
+        /// <param name="itemElementNode"></param>
+        /// <param name="namespaceManager"></param>
+        internal ExcelConditionalFormattingDataBar(
+          eExcelConditionalFormattingRuleType type,
+          ExcelAddress address,
+          int priority,
+          ExcelWorksheet worksheet,
+          XmlNode itemElementNode,
+          XmlNamespaceManager namespaceManager)
+            : base(
+              type,
+              address,
+              priority,
+              worksheet,
+              itemElementNode,
+              (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+        {
+            SchemaNodeOrder = new string[] { "cfvo", "color" };
+            //Create the <dataBar> node inside the <cfRule> node
+            if (itemElementNode!=null && itemElementNode.HasChildNodes)
+            {
+                bool high=false;
+                foreach (XmlNode node in itemElementNode.SelectNodes("d:dataBar/d:cfvo", NameSpaceManager))
+                {
+                    if (high == false)
+                    {
+                        LowValue = new ExcelConditionalFormattingIconDataBarValue(
+                                type,
+                                address,
+                                worksheet,
+                                node,
+                                namespaceManager);
+                        high = true;
+                    }
+                    else
+                    {
+                        HighValue = new ExcelConditionalFormattingIconDataBarValue(
+                                type,
+                                address,
+                                worksheet,
+                                node,
+                                namespaceManager);
+                    }
+                }
+            }
+            else
+            {
+                var iconSetNode = CreateComplexNode(
+                  Node,
+                  ExcelConditionalFormattingConstants.Paths.DataBar);
+
+                var lowNode = iconSetNode.OwnerDocument.CreateElement(ExcelConditionalFormattingConstants.Paths.Cfvo, ExcelPackage.schemaMain);
+                iconSetNode.AppendChild(lowNode);
+                LowValue = new ExcelConditionalFormattingIconDataBarValue(eExcelConditionalFormattingValueObjectType.Min,
+                        0,
+                        "",
+                        eExcelConditionalFormattingRuleType.DataBar,
+                        address,
+                        priority,
+                        worksheet,
+                        lowNode,
+                        namespaceManager);
+
+                var highNode = iconSetNode.OwnerDocument.CreateElement(ExcelConditionalFormattingConstants.Paths.Cfvo, ExcelPackage.schemaMain);
+                iconSetNode.AppendChild(highNode);
+                HighValue = new ExcelConditionalFormattingIconDataBarValue(eExcelConditionalFormattingValueObjectType.Max,
+                        0,
+                        "",
+                        eExcelConditionalFormattingRuleType.DataBar,
+                        address,
+                        priority,
+                        worksheet,
+                        highNode,
+                        namespaceManager);
+            }
+            Type = type;
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="type"></param>
+        /// <param name="priority"></param>
+        /// <param name="address"></param>
+        /// <param name="worksheet"></param>
+        /// <param name="itemElementNode"></param>
+        internal ExcelConditionalFormattingDataBar(
+          eExcelConditionalFormattingRuleType type,
+          ExcelAddress address,
+          int priority,
+          ExcelWorksheet worksheet,
+          XmlNode itemElementNode)
+            : this(
+              type,
+              address,
+              priority,
+              worksheet,
+              itemElementNode,
+              null)
+        {
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="type"></param>
+        /// <param name="priority"></param>
+        /// <param name="address"></param>
+        /// <param name="worksheet"></param>
+        internal ExcelConditionalFormattingDataBar(
+          eExcelConditionalFormattingRuleType type,
+          ExcelAddress address,
+          int priority,
+          ExcelWorksheet worksheet)
+            : this(
+              type,
+              address,
+              priority,
+              worksheet,
+              null,
+              null)
+        {
+        }
+        #endregion Constructors
+        private const string _showValuePath="d:dataBar/@showValue";
+        public bool ShowValue
+        {
+            get
+            {
+                return GetXmlNodeBool(_showValuePath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_showValuePath, value);
+            }
+        }
+
+
+        public ExcelConditionalFormattingIconDataBarValue LowValue
+        {
+            get;
+            internal set;
+        }
+
+        public ExcelConditionalFormattingIconDataBarValue HighValue
+        {
+            get;
+            internal set;
+        }
+
+
+        private const string _colorPath = "d:dataBar/d:color/@rgb";
+        public Color Color
+        {
+            get
+            {
+                var rgb=GetXmlNodeString(_colorPath);
+                if(!string.IsNullOrEmpty(rgb))
+                {
+                    return Color.FromArgb(int.Parse(rgb, NumberStyles.HexNumber));
+                }
+                return Color.White;
+            }
+            set
+            {
+                SetXmlNodeString(_colorPath, value.ToArgb().ToString("X"));
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingDuplicateValues.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingDuplicateValues.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingDuplicateValues.cs	(revision 9616)
@@ -0,0 +1,118 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingDuplicateValues
+  /// </summary>
+  public class ExcelConditionalFormattingDuplicateValues
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingDuplicateValues
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingDuplicateValues(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.DuplicateValues,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingDuplicateValues(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingDuplicateValues(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingEndsWith.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingEndsWith.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingEndsWith.cs	(revision 9616)
@@ -0,0 +1,150 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingEndsWith
+  /// </summary>
+  public class ExcelConditionalFormattingEndsWith
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingEndsWith
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingEndsWith(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.EndsWith,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.EndsWith;
+            Text = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingEndsWith(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingEndsWith(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+
+    #region Exposed Properties
+    /// <summary>
+    /// The text to search in the end of the cell
+    /// </summary>
+    public string Text
+    {
+      get
+      {
+        return GetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TextAttribute);
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TextAttribute,
+          value);
+
+        Formula = string.Format(
+          "RIGHT({0},LEN(\"{1}\"))=\"{1}\"",
+          Address.Start.Address,
+          value.Replace("\"", "\"\""));
+      }
+    }
+    #endregion Exposed Properties
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingEqual.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingEqual.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingEqual.cs	(revision 9616)
@@ -0,0 +1,123 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingEqual
+  /// </summary>
+  public class ExcelConditionalFormattingEqual
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingEqual
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.Equal,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.Equal;
+            Formula = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingExpression.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingExpression.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingExpression.cs	(revision 9616)
@@ -0,0 +1,122 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingExpression
+  /// </summary>
+  public class ExcelConditionalFormattingExpression
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingExpression
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingExpression(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.Expression,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Formula = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingExpression(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingExpression(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingFiveIconSet.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingFiveIconSet.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingFiveIconSet.cs	(revision 9616)
@@ -0,0 +1,180 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingThreeIconSet
+  /// </summary>
+  public class ExcelConditionalFormattingFiveIconSet
+    : ExcelConditionalFormattingIconSetBase<eExcelconditionalFormatting5IconsSetType>, IExcelConditionalFormattingFiveIconSet
+  {
+    /****************************************************************************************/
+
+    #region Private Properties
+
+    #endregion Private Properties
+
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingFiveIconSet(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.FiveIconSet,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode != null && itemElementNode.HasChildNodes)
+        {
+            XmlNode iconNode4 = TopNode.SelectSingleNode("d:iconSet/d:cfvo[position()=4]", NameSpaceManager);
+            Icon4 = new ExcelConditionalFormattingIconDataBarValue(
+                    eExcelConditionalFormattingRuleType.FiveIconSet,
+                    address,
+                    worksheet,
+                    iconNode4,
+                    namespaceManager);
+            
+            XmlNode iconNode5 = TopNode.SelectSingleNode("d:iconSet/d:cfvo[position()=5]", NameSpaceManager);
+            Icon5 = new ExcelConditionalFormattingIconDataBarValue(
+                    eExcelConditionalFormattingRuleType.FiveIconSet,
+                    address,
+                    worksheet,
+                    iconNode5,
+                    namespaceManager);
+        }
+        else
+        {
+            XmlNode iconSetNode = TopNode.SelectSingleNode("d:iconSet", NameSpaceManager);
+            var iconNode4 = iconSetNode.OwnerDocument.CreateElement(ExcelConditionalFormattingConstants.Paths.Cfvo, ExcelPackage.schemaMain);
+            iconSetNode.AppendChild(iconNode4);
+
+            Icon4 = new ExcelConditionalFormattingIconDataBarValue(eExcelConditionalFormattingValueObjectType.Percent,
+                    60,
+                    "",
+                    eExcelConditionalFormattingRuleType.ThreeIconSet,
+                    address,
+                    priority,
+                    worksheet,
+                    iconNode4,
+                    namespaceManager);
+
+            var iconNode5 = iconSetNode.OwnerDocument.CreateElement(ExcelConditionalFormattingConstants.Paths.Cfvo, ExcelPackage.schemaMain);
+            iconSetNode.AppendChild(iconNode5);
+
+            Icon5 = new ExcelConditionalFormattingIconDataBarValue(eExcelConditionalFormattingValueObjectType.Percent,
+                    80,
+                    "",
+                    eExcelConditionalFormattingRuleType.ThreeIconSet,
+                    address,
+                    priority,
+                    worksheet,
+                    iconNode5,
+                    namespaceManager);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingFiveIconSet(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingFiveIconSet(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    public ExcelConditionalFormattingIconDataBarValue Icon5
+    {
+        get;
+        internal set;
+    }
+
+    public ExcelConditionalFormattingIconDataBarValue Icon4
+    {
+        get;
+        internal set;
+    }
+  }
+  }
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingFourIconSet.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingFourIconSet.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingFourIconSet.cs	(revision 9616)
@@ -0,0 +1,154 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingThreeIconSet
+  /// </summary>
+  public class ExcelConditionalFormattingFourIconSet
+    : ExcelConditionalFormattingIconSetBase<eExcelconditionalFormatting4IconsSetType>, IExcelConditionalFormattingFourIconSet<eExcelconditionalFormatting4IconsSetType>
+  {
+    /****************************************************************************************/
+
+    #region Private Properties
+
+    #endregion Private Properties
+
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingFourIconSet(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.FourIconSet,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if(itemElementNode!=null && itemElementNode.HasChildNodes)
+        {
+            XmlNode iconNode4 = TopNode.SelectSingleNode("d:iconSet/d:cfvo[position()=4]", NameSpaceManager);
+            Icon4 = new ExcelConditionalFormattingIconDataBarValue(
+                    eExcelConditionalFormattingRuleType.FourIconSet,
+                    address,
+                    worksheet,
+                    iconNode4,
+                    namespaceManager);
+        }
+        else
+        {
+            XmlNode iconSetNode = TopNode.SelectSingleNode("d:iconSet", NameSpaceManager);
+            var iconNode4 = iconSetNode.OwnerDocument.CreateElement(ExcelConditionalFormattingConstants.Paths.Cfvo, ExcelPackage.schemaMain);
+            iconSetNode.AppendChild(iconNode4);
+
+
+            Icon4 = new ExcelConditionalFormattingIconDataBarValue(eExcelConditionalFormattingValueObjectType.Percent,
+                    75,
+                    "",
+                    eExcelConditionalFormattingRuleType.ThreeIconSet,
+                    address,
+                    priority,
+                    worksheet,
+                    iconNode4,
+                    namespaceManager);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingFourIconSet(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingFourIconSet(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    public ExcelConditionalFormattingIconDataBarValue Icon4
+    {
+        get;
+        internal set;
+    }
+    }
+  }
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingGreaterThan.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingGreaterThan.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingGreaterThan.cs	(revision 9616)
@@ -0,0 +1,123 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingGreaterThan
+  /// </summary>
+  public class ExcelConditionalFormattingGreaterThan
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingGreaterThan
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingGreaterThan(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.GreaterThan,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.GreaterThan;
+            Formula = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingGreaterThan(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingGreaterThan(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingGreaterThanOrEqual.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingGreaterThanOrEqual.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingGreaterThanOrEqual.cs	(revision 9616)
@@ -0,0 +1,123 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingGreaterThanOrEqual
+  /// </summary>
+  public class ExcelConditionalFormattingGreaterThanOrEqual
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingGreaterThanOrEqual
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingGreaterThanOrEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.GreaterThanOrEqual,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.GreaterThanOrEqual;
+            Formula = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingGreaterThanOrEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingGreaterThanOrEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLast7Days.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLast7Days.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLast7Days.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingLast7Days
+  /// </summary>
+  public class ExcelConditionalFormattingLast7Days
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingLast7Days(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.Last7Days,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.Last7Days;
+            Formula = string.Format(
+              "AND(TODAY()-FLOOR({0},1)<=6,FLOOR({0},1)<=TODAY())",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingLast7Days(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingLast7Days(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLastMonth.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLastMonth.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLastMonth.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingLastMonth
+  /// </summary>
+  public class ExcelConditionalFormattingLastMonth
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingLastMonth(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.LastMonth,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.LastMonth;
+            Formula = string.Format(
+              "AND(MONTH({0})=MONTH(EDATE(TODAY(),0-1)),YEAR({0})=YEAR(EDATE(TODAY(),0-1)))",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingLastMonth(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingLastMonth(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLastWeek.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLastWeek.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLastWeek.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingLastWeek
+  /// </summary>
+  public class ExcelConditionalFormattingLastWeek
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+      /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingLastWeek(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.LastWeek,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.LastWeek;
+            Formula = string.Format(
+              "AND(TODAY()-ROUNDDOWN({0},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN({0},0)<(WEEKDAY(TODAY())+7))",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingLastWeek(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingLastWeek(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLessThan.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLessThan.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLessThan.cs	(revision 9616)
@@ -0,0 +1,123 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingLessThan
+  /// </summary>
+  public class ExcelConditionalFormattingLessThan
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingLessThan
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="address"></param>
+      /// <param name="priority"></param>
+      /// <param name="worksheet"></param>
+      /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingLessThan(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.LessThan,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.LessThan;
+            Formula = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingLessThan(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingLessThan(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLessThanOrEqual.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLessThanOrEqual.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingLessThanOrEqual.cs	(revision 9616)
@@ -0,0 +1,123 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingLessThanOrEqual
+  /// </summary>
+  public class ExcelConditionalFormattingLessThanOrEqual
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingLessThanOrEqual
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingLessThanOrEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.LessThanOrEqual,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.LessThanOrEqual;
+            Formula = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingLessThanOrEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingLessThanOrEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNextMonth.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNextMonth.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNextMonth.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingNextMonth
+  /// </summary>
+  public class ExcelConditionalFormattingNextMonth
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingNextMonth(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.NextMonth,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.NextMonth;
+            Formula = string.Format(
+              "AND(MONTH({0})=MONTH(EDATE(TODAY(),0+1)), YEAR({0})=YEAR(EDATE(TODAY(),0+1)))",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingNextMonth(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingNextMonth(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNextWeek.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNextWeek.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNextWeek.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingNextWeek
+  /// </summary>
+  public class ExcelConditionalFormattingNextWeek
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingNextWeek(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.NextWeek,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.NextWeek;
+            Formula = string.Format(
+              "AND(ROUNDDOWN({0},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN({0},0)-TODAY()<(15-WEEKDAY(TODAY())))",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingNextWeek(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingNextWeek(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotBetween.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotBetween.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotBetween.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingNotBetween
+  /// </summary>
+  public class ExcelConditionalFormattingNotBetween
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingNotBetween
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingNotBetween(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.NotBetween,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.NotBetween;
+            Formula = string.Empty;
+            Formula2 = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingNotBetween(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingNotBetween(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotContainsBlanks.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotContainsBlanks.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotContainsBlanks.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingNotContainsBlanks
+  /// </summary>
+  public class ExcelConditionalFormattingNotContainsBlanks
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingNotContainsBlanks
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingNotContainsBlanks(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.NotContainsBlanks,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Formula = string.Format(
+              "LEN(TRIM({0}))>0",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingNotContainsBlanks(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingNotContainsBlanks(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotContainsErrors.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotContainsErrors.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotContainsErrors.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingNotContainsErrors
+  /// </summary>
+  public class ExcelConditionalFormattingNotContainsErrors
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingNotContainsErrors
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingNotContainsErrors(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.NotContainsErrors,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Formula = string.Format(
+              "NOT(ISERROR({0}))",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingNotContainsErrors(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingNotContainsErrors(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotContainsText.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotContainsText.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotContainsText.cs	(revision 9616)
@@ -0,0 +1,150 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingNotContainsText
+  /// </summary>
+  public class ExcelConditionalFormattingNotContainsText
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingNotContainsText
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingNotContainsText(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.NotContainsText,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.NotContains;
+            Text = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingNotContainsText(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingNotContainsText(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+
+    #region Exposed Properties
+    /// <summary>
+    /// The text to search inside the cell
+    /// </summary>
+    public string Text
+    {
+      get
+      {
+        return GetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TextAttribute);
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TextAttribute,
+          value);
+
+        Formula = string.Format(
+          "ISERROR(SEARCH(\"{1}\",{0}))",
+          Address.Start.Address,
+          value.Replace("\"", "\"\""));
+      }
+    }
+    #endregion Exposed Properties
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotEqual.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotEqual.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingNotEqual.cs	(revision 9616)
@@ -0,0 +1,123 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingNotEqual
+  /// </summary>
+  public class ExcelConditionalFormattingNotEqual
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingNotEqual
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingNotEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.NotEqual,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Operator = eExcelConditionalFormattingOperatorType.NotEqual;
+            Formula = string.Empty;
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingNotEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingNotEqual(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingRule.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingRule.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingRule.cs	(revision 9616)
@@ -0,0 +1,628 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.Utils;
+using System.Text.RegularExpressions;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+using OfficeOpenXml.Style.Dxf;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// 
+  /// </summary>
+  public abstract class ExcelConditionalFormattingRule
+    : XmlHelper,
+    IExcelConditionalFormattingRule
+  {
+    /****************************************************************************************/
+
+    #region Private Properties
+    private eExcelConditionalFormattingRuleType? _type;
+    private ExcelWorksheet _worksheet;
+
+    /// <summary>
+    /// Sinalize that we are in a Cnaging Priorities opeartion so that we won't enter
+    /// a recursive loop.
+    /// </summary>
+    private static bool _changingPriority = false;
+    #endregion Private Properties
+
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// Initialize the <see cref="ExcelConditionalFormattingRule"/>
+    /// </summary>
+    /// <param name="type"></param>
+    /// <param name="address"></param>
+    /// <param name="priority">Used also as the cfRule unique key</param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingRule(
+      eExcelConditionalFormattingRuleType type,
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        namespaceManager,
+        itemElementNode)
+    {
+      Require.Argument(address).IsNotNull("address");
+      Require.Argument(priority).IsInRange(1, int.MaxValue, "priority");
+      Require.Argument(worksheet).IsNotNull("worksheet");
+
+      _type = type;
+      _worksheet = worksheet;
+      SchemaNodeOrder = _worksheet.SchemaNodeOrder;
+
+      if (itemElementNode == null)
+      {
+        // Create/Get the <cfRule> inside <conditionalFormatting>
+        itemElementNode = CreateComplexNode(
+          _worksheet.WorksheetXml.DocumentElement,
+          string.Format(
+            "{0}[{1}='{2}']/{1}='{2}'/{3}[{4}='{5}']/{4}='{5}'",
+          //{0}
+            ExcelConditionalFormattingConstants.Paths.ConditionalFormatting,
+          // {1}
+            ExcelConditionalFormattingConstants.Paths.SqrefAttribute,
+          // {2}
+            address.AddressSpaceSeparated,          //CF node don't what to have comma between multi addresses, use space instead.
+          // {3}
+            ExcelConditionalFormattingConstants.Paths.CfRule,
+          //{4}
+            ExcelConditionalFormattingConstants.Paths.PriorityAttribute,
+          //{5}
+            priority));
+      }
+
+      // Point to <cfRule>
+      TopNode = itemElementNode;
+
+      Address = address;
+      Priority = priority;
+      Type = type;
+      if (DxfId >= 0)
+      {
+          worksheet.Workbook.Styles.Dxfs[DxfId].AllowChange = true;  //This Id is referenced by CF, so we can use it when we save.
+          _style = worksheet.Workbook.Styles.Dxfs[DxfId].Clone();    //Clone, so it can be altered without effecting other dxf styles
+      }
+    }
+
+    /// <summary>
+    /// Initialize the <see cref="ExcelConditionalFormattingRule"/>
+    /// </summary>
+    /// <param name="type"></param>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingRule(
+      eExcelConditionalFormattingRuleType type,
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNamespaceManager namespaceManager)
+      : this(
+        type,
+        address,
+        priority,
+        worksheet,
+        null,
+        namespaceManager)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+
+    #region Methods
+    #endregion Methods
+
+    /****************************************************************************************/
+
+    #region Exposed Properties
+    /// <summary>
+    /// Get the &lt;cfRule&gt; node
+    /// </summary>
+    public XmlNode Node
+    {
+      get { return TopNode; }
+    }
+
+    /// <summary>
+    /// Address of the conditional formatting rule
+    /// </summary>
+    /// <remarks>
+    /// The address is stores in a parent node called &lt;conditionalFormatting&gt; in the
+    /// @sqref attribute. Excel groups rules that have the same address inside one node.
+    /// </remarks>
+    public ExcelAddress Address
+    {
+      get
+      {
+        return new ExcelAddress(
+          Node.ParentNode.Attributes[ExcelConditionalFormattingConstants.Attributes.Sqref].Value);
+      }
+      set
+      {
+        // Check if the address is to be changed
+        if (Address.Address != value.Address)
+        {
+          // Save the old parente node
+          XmlNode oldNode = Node;
+          XmlNode oldParentNode = Node.ParentNode;
+
+          // Create/Get the new <conditionalFormatting> parent node
+          XmlNode newParentNode = CreateComplexNode(
+            _worksheet.WorksheetXml.DocumentElement,
+            string.Format(
+              "{0}[{1}='{2}']/{1}='{2}'",
+            //{0}
+              ExcelConditionalFormattingConstants.Paths.ConditionalFormatting,
+            // {1}
+              ExcelConditionalFormattingConstants.Paths.SqrefAttribute,
+            // {2}
+              value.AddressSpaceSeparated)); 
+
+          // Move the <cfRule> node to the new <conditionalFormatting> parent node
+          TopNode = newParentNode.AppendChild(Node);
+
+          // Check if the old <conditionalFormatting> parent node has <cfRule> node inside it
+          if (!oldParentNode.HasChildNodes)
+          {
+            // Remove the old parent node
+            oldParentNode.ParentNode.RemoveChild(oldParentNode);
+          }
+        }
+      }
+    }
+
+    /// <summary>
+    /// Type of conditional formatting rule. ST_CfType §18.18.12.
+    /// </summary>
+    public eExcelConditionalFormattingRuleType Type
+    {
+      get
+      {
+        // Transform the @type attribute to EPPlus Rule Type (slighty diferente)
+        if(_type==null)
+        {
+          _type = ExcelConditionalFormattingRuleType.GetTypeByAttrbiute(
+          GetXmlNodeString(ExcelConditionalFormattingConstants.Paths.TypeAttribute),
+          TopNode,
+          _worksheet.NameSpaceManager);
+        }
+        return (eExcelConditionalFormattingRuleType)_type;
+      }
+      internal set
+      {
+          _type = value;
+          // Transform the EPPlus Rule Type to @type attribute (slighty diferente)
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TypeAttribute,
+          ExcelConditionalFormattingRuleType.GetAttributeByType(value),
+          true);
+      }
+    }
+
+    /// <summary>
+    /// The priority of this conditional formatting rule. This value is used to determine
+    /// which format should be evaluated and rendered. Lower numeric values are higher
+    /// priority than higher numeric values, where 1 is the highest priority.
+    /// </summary>
+    public int Priority
+    {
+      get
+      {
+        return GetXmlNodeInt(
+          ExcelConditionalFormattingConstants.Paths.PriorityAttribute);
+      }
+      set
+      {
+        // Save the current CF rule priority
+        int priority = Priority;
+
+        // Check if the @priority is to be changed
+        if (priority != value)
+        {
+          // Check if we are not already inside a "Change Priority" operation
+          if (!_changingPriority)
+          {
+            if (value < 1)
+            {
+              throw new IndexOutOfRangeException(
+                ExcelConditionalFormattingConstants.Errors.InvalidPriority);
+            }
+
+            // Sinalize that we are already changing cfRules priorities
+            _changingPriority = true;
+
+            // Check if we lowered the priority
+            if (priority > value)
+            {
+              for (int i = priority - 1; i >= value; i--)
+              {
+                var cfRule = _worksheet.ConditionalFormatting.RulesByPriority(i);
+
+                if (cfRule != null)
+                {
+                  cfRule.Priority++;
+                }
+              }
+            }
+            else
+            {
+              for (int i = priority + 1; i <= value; i++)
+              {
+                var cfRule = _worksheet.ConditionalFormatting.RulesByPriority(i);
+
+                if (cfRule != null)
+                {
+                  cfRule.Priority--;
+                }
+              }
+            }
+
+            // Sinalize that we are no longer changing cfRules priorities
+            _changingPriority = false;
+          }
+
+          // Change the priority in the XML
+          SetXmlNodeString(
+            ExcelConditionalFormattingConstants.Paths.PriorityAttribute,
+            value.ToString(),
+            true);
+        }
+      }
+    }
+
+    /// <summary>
+    /// If this flag is true, no rules with lower priority shall be applied over this rule,
+    /// when this rule evaluates to true.
+    /// </summary>
+    public bool StopIfTrue
+    {
+      get
+      {
+        return GetXmlNodeBool(
+          ExcelConditionalFormattingConstants.Paths.StopIfTrueAttribute);
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.StopIfTrueAttribute,
+          (value == true) ? "1" : string.Empty,
+          true);
+      }
+    }
+
+    /// <summary>
+    /// DxfId Style Attribute
+    /// </summary>
+    internal int DxfId
+    {
+      get
+      {
+        return GetXmlNodeInt(
+          ExcelConditionalFormattingConstants.Paths.DxfIdAttribute);
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.DxfIdAttribute,
+          (value == int.MinValue) ? string.Empty : value.ToString(),
+          true);
+      }
+    }
+    internal ExcelDxfStyleConditionalFormatting _style = null;
+    public ExcelDxfStyleConditionalFormatting Style
+    {
+        get
+        {
+            if (_style == null)
+            {
+                _style = new ExcelDxfStyleConditionalFormatting(NameSpaceManager, null, _worksheet.Workbook.Styles);
+            }
+            return _style;
+        }
+    }
+    /// <summary>
+    /// StdDev (zero is not allowed and will be converted to 1)
+    /// </summary>
+    public UInt16 StdDev
+    {
+      get
+      {
+        return Convert.ToUInt16(GetXmlNodeInt(
+          ExcelConditionalFormattingConstants.Paths.StdDevAttribute));
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.StdDevAttribute,
+          (value == 0) ? "1" : value.ToString(),
+          true);
+      }
+    }
+
+    /// <summary>
+    /// Rank (zero is not allowed and will be converted to 1)
+    /// </summary>
+    public UInt16 Rank
+    {
+      get
+      {
+        return Convert.ToUInt16(GetXmlNodeInt(
+          ExcelConditionalFormattingConstants.Paths.RankAttribute));
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.RankAttribute,
+          (value == 0) ? "1" : value.ToString(),
+          true);
+      }
+    }
+    #endregion Exposed Properties
+
+    /****************************************************************************************/
+
+    #region Internal Properties
+    /// <summary>
+    /// AboveAverage
+    /// </summary>
+    internal protected bool? AboveAverage
+    {
+      get
+      {
+        bool? aboveAverage = GetXmlNodeBoolNullable(
+          ExcelConditionalFormattingConstants.Paths.AboveAverageAttribute);
+
+        // Above Avarege if TRUE or if attribute does not exists
+        return (aboveAverage == true) || (aboveAverage == null);
+      }
+      set
+      {
+        string aboveAverageValue = string.Empty;
+
+        // Only the types that needs the @AboveAverage
+        if ((_type == eExcelConditionalFormattingRuleType.BelowAverage)
+          || (_type == eExcelConditionalFormattingRuleType.BelowOrEqualAverage)
+          || (_type == eExcelConditionalFormattingRuleType.BelowStdDev))
+        {
+          aboveAverageValue = "0";
+        }
+
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.AboveAverageAttribute,
+          aboveAverageValue,
+          true);
+      }
+    }
+
+    /// <summary>
+    /// EqualAverage
+    /// </summary>
+    internal protected bool? EqualAverage
+    {
+      get
+      {
+        bool? equalAverage = GetXmlNodeBoolNullable(
+          ExcelConditionalFormattingConstants.Paths.EqualAverageAttribute);
+
+        // Equal Avarege only if TRUE
+        return (equalAverage == true);
+      }
+      set
+      {
+        string equalAverageValue = string.Empty;
+
+        // Only the types that needs the @EqualAverage
+        if ((_type == eExcelConditionalFormattingRuleType.AboveOrEqualAverage)
+          || (_type == eExcelConditionalFormattingRuleType.BelowOrEqualAverage))
+        {
+          equalAverageValue = "1";
+        }
+
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.EqualAverageAttribute,
+          equalAverageValue,
+          true);
+      }
+    }
+
+    /// <summary>
+    /// Bottom attribute
+    /// </summary>
+    internal protected bool? Bottom
+    {
+      get
+      {
+        bool? bottom = GetXmlNodeBoolNullable(
+          ExcelConditionalFormattingConstants.Paths.BottomAttribute);
+
+        // Bottom if TRUE
+        return (bottom == true);
+      }
+      set
+      {
+        string bottomValue = string.Empty;
+
+        // Only the types that needs the @Bottom
+        if ((_type == eExcelConditionalFormattingRuleType.Bottom)
+          || (_type == eExcelConditionalFormattingRuleType.BottomPercent))
+        {
+          bottomValue = "1";
+        }
+
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.BottomAttribute,
+          bottomValue,
+          true);
+      }
+    }
+
+    /// <summary>
+    /// Percent attribute
+    /// </summary>
+    internal protected bool? Percent
+    {
+      get
+      {
+        bool? percent = GetXmlNodeBoolNullable(
+          ExcelConditionalFormattingConstants.Paths.PercentAttribute);
+
+        // Bottom if TRUE
+        return (percent == true);
+      }
+      set
+      {
+        string percentValue = string.Empty;
+
+        // Only the types that needs the @Bottom
+        if ((_type == eExcelConditionalFormattingRuleType.BottomPercent)
+          || (_type == eExcelConditionalFormattingRuleType.TopPercent))
+        {
+          percentValue = "1";
+        }
+
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.PercentAttribute,
+          percentValue,
+          true);
+      }
+    }
+
+    /// <summary>
+    /// TimePeriod
+    /// </summary>
+    internal protected eExcelConditionalFormattingTimePeriodType TimePeriod
+    {
+      get
+      {
+        return ExcelConditionalFormattingTimePeriodType.GetTypeByAttribute(
+          GetXmlNodeString(ExcelConditionalFormattingConstants.Paths.TimePeriodAttribute));
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.TimePeriodAttribute,
+          ExcelConditionalFormattingTimePeriodType.GetAttributeByType(value),
+          true);
+      }
+    }
+
+    /// <summary>
+    /// Operator
+    /// </summary>
+    internal protected eExcelConditionalFormattingOperatorType Operator
+    {
+      get
+      {
+        return ExcelConditionalFormattingOperatorType.GetTypeByAttribute(
+          GetXmlNodeString(ExcelConditionalFormattingConstants.Paths.OperatorAttribute));
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.OperatorAttribute,
+          ExcelConditionalFormattingOperatorType.GetAttributeByType(value),
+          true);
+      }
+    }
+
+    /// <summary>
+    /// Formula
+    /// </summary>
+    public string Formula
+    {
+      get
+      {
+        return GetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.Formula);
+      }
+      set
+      {
+        SetXmlNodeString(
+          ExcelConditionalFormattingConstants.Paths.Formula,
+          value);
+      }
+    }
+
+    /// <summary>
+    /// Formula2
+    /// </summary>
+    public string Formula2
+    {
+      get
+      {
+        return GetXmlNodeString(
+          string.Format(
+            "{0}[position()=2]",
+          // {0}
+            ExcelConditionalFormattingConstants.Paths.Formula));
+      }
+      set
+      {
+        // Create/Get the first <formula> node (ensure that it exists)
+        var firstNode = CreateComplexNode(
+          TopNode,
+          string.Format(
+            "{0}[position()=1]",
+          // {0}
+            ExcelConditionalFormattingConstants.Paths.Formula));
+
+        // Create/Get the seconde <formula> node (ensure that it exists)
+        var secondNode = CreateComplexNode(
+          TopNode,
+          string.Format(
+            "{0}[position()=2]",
+          // {0}
+            ExcelConditionalFormattingConstants.Paths.Formula));
+
+        // Save the formula in the second <formula> node
+        secondNode.InnerText = value;
+      }
+    }
+    #endregion Internal Properties
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThisMonth.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThisMonth.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThisMonth.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingThisMonth
+  /// </summary>
+  public class ExcelConditionalFormattingThisMonth
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingThisMonth(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.ThisMonth,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.ThisMonth;
+            Formula = string.Format(
+              "AND(MONTH({0})=MONTH(TODAY()), YEAR({0})=YEAR(TODAY()))",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingThisMonth(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingThisMonth(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThisWeek.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThisWeek.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThisWeek.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingThisWeek
+  /// </summary>
+  public class ExcelConditionalFormattingThisWeek
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingThisWeek(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.ThisWeek,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.ThisWeek;
+            Formula = string.Format(
+              "AND(TODAY()-ROUNDDOWN({0},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN({0},0)-TODAY()<=7-WEEKDAY(TODAY()))",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingThisWeek(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingThisWeek(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThreeColorScale.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThreeColorScale.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThreeColorScale.cs	(revision 9616)
@@ -0,0 +1,207 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingThreeColorScale
+  /// </summary>
+  public class ExcelConditionalFormattingThreeColorScale
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingThreeColorScale
+  {
+    /****************************************************************************************/
+
+    #region Private Properties
+    /// <summary>
+    /// Private Low Value
+    /// </summary>
+    private ExcelConditionalFormattingColorScaleValue _lowValue;
+
+    /// <summary>
+    /// Private Middle Value
+    /// </summary>
+    private ExcelConditionalFormattingColorScaleValue _middleValue;
+
+    /// <summary>
+    /// Private High Value
+    /// </summary>
+    private ExcelConditionalFormattingColorScaleValue _highValue;
+    #endregion Private Properties
+
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+     /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingThreeColorScale(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.ThreeColorScale,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+      // Create the <colorScale> node inside the <cfRule> node
+      var colorScaleNode = CreateComplexNode(
+        Node,
+        ExcelConditionalFormattingConstants.Paths.ColorScale);
+
+      // LowValue default
+      LowValue = new ExcelConditionalFormattingColorScaleValue(
+        eExcelConditionalFormattingValueObjectPosition.Low,
+        eExcelConditionalFormattingValueObjectType.Min,
+        ColorTranslator.FromHtml(ExcelConditionalFormattingConstants.Colors.CfvoLowValue),
+        eExcelConditionalFormattingRuleType.ThreeColorScale,
+        address,
+        priority,
+        worksheet,
+        NameSpaceManager);
+
+      // MiddleValue default
+      MiddleValue = new ExcelConditionalFormattingColorScaleValue(
+        eExcelConditionalFormattingValueObjectPosition.Middle,
+        eExcelConditionalFormattingValueObjectType.Percent,
+        ColorTranslator.FromHtml(ExcelConditionalFormattingConstants.Colors.CfvoMiddleValue),
+        50,
+        string.Empty,
+        eExcelConditionalFormattingRuleType.ThreeColorScale,
+        address,
+        priority,
+        worksheet,
+        NameSpaceManager);
+
+      // HighValue default
+      HighValue = new ExcelConditionalFormattingColorScaleValue(
+        eExcelConditionalFormattingValueObjectPosition.High,
+        eExcelConditionalFormattingValueObjectType.Max,
+        ColorTranslator.FromHtml(ExcelConditionalFormattingConstants.Colors.CfvoHighValue),
+        eExcelConditionalFormattingRuleType.ThreeColorScale,
+        address,
+        priority,
+        worksheet,
+        NameSpaceManager);
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingThreeColorScale(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingThreeColorScale(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+
+    #region Public Properties
+    /// <summary>
+    /// Low Value for Three Color Scale Object Value
+    /// </summary>
+    public ExcelConditionalFormattingColorScaleValue LowValue
+    {
+      get { return _lowValue; }
+      set { _lowValue = value; }
+    }
+
+    /// <summary>
+    /// Middle Value for Three Color Scale Object Value
+    /// </summary>
+    public ExcelConditionalFormattingColorScaleValue MiddleValue
+    {
+      get { return _middleValue; }
+      set { _middleValue = value; }
+    }
+
+    /// <summary>
+    /// High Value for Three Color Scale Object Value
+    /// </summary>
+    public ExcelConditionalFormattingColorScaleValue HighValue
+    {
+      get { return _highValue; }
+      set { _highValue = value; }
+    }
+    #endregion Public Properties
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThreeIconSet.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThreeIconSet.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingThreeIconSet.cs	(revision 9616)
@@ -0,0 +1,380 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+    public class ExcelConditionalFormattingThreeIconSet : ExcelConditionalFormattingIconSetBase<eExcelconditionalFormatting3IconsSetType>
+    {
+        internal ExcelConditionalFormattingThreeIconSet(
+        ExcelAddress address,
+        int priority,
+        ExcelWorksheet worksheet,
+        XmlNode itemElementNode,
+        XmlNamespaceManager namespaceManager)
+            : base(
+              eExcelConditionalFormattingRuleType.ThreeIconSet,
+              address,
+              priority,
+              worksheet,
+              itemElementNode,
+              (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+        {
+        }
+    }
+    /// <summary>
+    /// ExcelConditionalFormattingThreeIconSet
+    /// </summary>
+    public class ExcelConditionalFormattingIconSetBase<T>
+      : ExcelConditionalFormattingRule,
+        IExcelConditionalFormattingThreeIconSet<T>
+    {
+        /****************************************************************************************/
+
+        #region Private Properties
+
+        #endregion Private Properties
+
+        /****************************************************************************************/
+
+        #region Constructors
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="type"></param>
+        /// <param name="address"></param>
+        /// <param name="priority"></param>
+        /// <param name="worksheet"></param>
+        /// <param name="itemElementNode"></param>
+        /// <param name="namespaceManager"></param>
+        internal ExcelConditionalFormattingIconSetBase(
+          eExcelConditionalFormattingRuleType type,
+          ExcelAddress address,
+          int priority,
+          ExcelWorksheet worksheet,
+          XmlNode itemElementNode,
+          XmlNamespaceManager namespaceManager)
+            : base(
+              type,
+              address,
+              priority,
+              worksheet,
+              itemElementNode,
+              (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+        {
+            if (itemElementNode != null && itemElementNode.HasChildNodes)
+            {
+                int pos = 1;
+                foreach (XmlNode node in itemElementNode.SelectNodes("d:iconSet/d:cfvo", NameSpaceManager))
+                {
+                    if(pos==1)
+                    {
+                        Icon1 = new ExcelConditionalFormattingIconDataBarValue(
+                                type,
+                                address,
+                                worksheet,
+                                node,
+                                namespaceManager);
+                    }
+                    else if (pos == 2)
+                    {
+                        Icon2 = new ExcelConditionalFormattingIconDataBarValue(
+                                type,
+                                address,
+                                worksheet,
+                                node,
+                                namespaceManager);
+                    }
+                    else if (pos == 3)
+                    {
+                        Icon3 = new ExcelConditionalFormattingIconDataBarValue(
+                                type,
+                                address,
+                                worksheet,
+                                node,
+                                namespaceManager);
+                    }
+                    else
+                    {
+                        break;
+                    }
+                    pos++;
+                }
+            }
+            else
+            {
+                var iconSetNode = CreateComplexNode(
+                  Node,
+                  ExcelConditionalFormattingConstants.Paths.IconSet);
+
+                //Create the <iconSet> node inside the <cfRule> node
+                double spann;
+                if (type == eExcelConditionalFormattingRuleType.ThreeIconSet)
+                {
+                    spann = 3;
+                }
+                else if (type == eExcelConditionalFormattingRuleType.FourIconSet)
+                {
+                    spann = 4;
+                }
+                else
+                {
+                    spann = 5;
+                }
+
+                var iconNode1 = iconSetNode.OwnerDocument.CreateElement(ExcelConditionalFormattingConstants.Paths.Cfvo, ExcelPackage.schemaMain);
+                iconSetNode.AppendChild(iconNode1);
+                Icon1 = new ExcelConditionalFormattingIconDataBarValue(eExcelConditionalFormattingValueObjectType.Percent,
+                        0,
+                        "",
+                        eExcelConditionalFormattingRuleType.ThreeIconSet,
+                        address,
+                        priority,
+                        worksheet,
+                        iconNode1,
+                        namespaceManager);
+
+                var iconNode2 = iconSetNode.OwnerDocument.CreateElement(ExcelConditionalFormattingConstants.Paths.Cfvo, ExcelPackage.schemaMain);
+                iconSetNode.AppendChild(iconNode2);
+                Icon2 = new ExcelConditionalFormattingIconDataBarValue(eExcelConditionalFormattingValueObjectType.Percent,
+                        Math.Round(100D / spann, 0),
+                        "",
+                        eExcelConditionalFormattingRuleType.ThreeIconSet,
+                        address,
+                        priority,
+                        worksheet,
+                        iconNode2,
+                        namespaceManager);
+
+                var iconNode3 = iconSetNode.OwnerDocument.CreateElement(ExcelConditionalFormattingConstants.Paths.Cfvo, ExcelPackage.schemaMain);
+                iconSetNode.AppendChild(iconNode3);
+                Icon3 = new ExcelConditionalFormattingIconDataBarValue(eExcelConditionalFormattingValueObjectType.Percent,
+                        Math.Round(100D * (2D / spann), 0),
+                        "",
+                        eExcelConditionalFormattingRuleType.ThreeIconSet,
+                        address,
+                        priority,
+                        worksheet,
+                        iconNode3,
+                        namespaceManager);
+                Type = type;
+            }
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        ///<param name="type"></param>
+        /// <param name="priority"></param>
+        /// <param name="address"></param>
+        /// <param name="worksheet"></param>
+        /// <param name="itemElementNode"></param>
+        internal ExcelConditionalFormattingIconSetBase(
+          eExcelConditionalFormattingRuleType type,
+          ExcelAddress address,
+          int priority,
+          ExcelWorksheet worksheet,
+          XmlNode itemElementNode)
+            : this(
+              type,
+              address,
+              priority,
+              worksheet,
+              itemElementNode,
+              null)
+        {
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        ///<param name="type"></param>
+        /// <param name="priority"></param>
+        /// <param name="address"></param>
+        /// <param name="worksheet"></param>
+        internal ExcelConditionalFormattingIconSetBase(
+          eExcelConditionalFormattingRuleType type,
+          ExcelAddress address,
+          int priority,
+          ExcelWorksheet worksheet)
+            : this(
+              type,
+              address,
+              priority,
+              worksheet,
+              null,
+              null)
+        {
+        }
+        #endregion Constructors
+
+        /// <summary>
+        /// Settings for icon 1 in the iconset
+        /// </summary>
+        public ExcelConditionalFormattingIconDataBarValue Icon1
+        {
+            get;
+            internal set;
+        }
+
+        /// <summary>
+        /// Settings for icon 2 in the iconset
+        /// </summary>
+        public ExcelConditionalFormattingIconDataBarValue Icon2
+        {
+            get;
+            internal set;
+        }
+        /// <summary>
+        /// Settings for icon 2 in the iconset
+        /// </summary>
+        public ExcelConditionalFormattingIconDataBarValue Icon3
+        {
+            get;
+            internal set;
+        }
+        private const string _reversePath = "d:iconSet/@reverse";
+        /// <summary>
+        /// Reverse the order of the icons
+        /// </summary>
+        public bool Reverse
+        {
+            get
+            {
+                return GetXmlNodeBool(_reversePath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_reversePath, value);
+            }
+        }
+
+        private const string _showValuePath = "d:iconSet/@showValue";
+        /// <summary>
+        /// If the cell values are visible
+        /// </summary>
+        public bool ShowValue
+        {
+            get
+            {
+                return GetXmlNodeBool(_showValuePath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_showValuePath, value);
+            }
+        }
+        private const string _iconSetPath = "d:iconSet/@iconSet";
+        /// <summary>
+        /// Type of iconset
+        /// </summary>
+        public T IconSet
+        {
+            get
+            {
+                var v = GetXmlNodeString(_iconSetPath);
+                v = v.Substring(1); //Skip first icon.
+                return (T)Enum.Parse(typeof(T), v, true);
+            }
+            set
+            {
+                SetXmlNodeString(_iconSetPath, GetIconSetString(value));
+            }
+        }
+        private string GetIconSetString(T value)
+        {
+            if (Type == eExcelConditionalFormattingRuleType.FourIconSet)
+            {
+                switch (value.ToString())
+                {
+                    case "Arrows":
+                        return "4Arrows";
+                    case "ArrowsGray":
+                        return "4ArrowsGray";
+                    case "Rating":
+                        return "4Rating";
+                    case "RedToBlack":
+                        return "4RedToBlack";
+                    case "TrafficLights":
+                        return "4TrafficLights";
+                    default:
+                        throw (new ArgumentException("Invalid type"));
+                }
+            }
+            else if (Type == eExcelConditionalFormattingRuleType.FiveIconSet)
+            {
+                switch (value.ToString())
+                {
+                    case "Arrows":
+                        return "5Arrows";
+                    case "ArrowsGray":
+                        return "5ArrowsGray";
+                    case "Quarters":
+                        return "5Quarters";
+                    case "Rating":
+                        return "5Rating";
+                    default:
+                        throw (new ArgumentException("Invalid type"));
+                }
+            }
+            else
+            {
+                switch (value.ToString())
+                {
+                    case "Arrows":
+                        return "3Arrows";
+                    case "ArrowsGray":
+                        return "3ArrowsGray";
+                    case "Flags":
+                        return "3Flags";
+                    case "Signs":
+                        return "3Signs";
+                    case "Symbols":
+                        return "3Symbols";
+                    case "Symbols2":
+                        return "3Symbols";
+                    case "TrafficLights1":
+                        return "3TrafficLights1";
+                    case "TrafficLights2":
+                        return "3TrafficLights2";
+                    default:
+                        throw (new ArgumentException("Invalid type"));
+                }
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTimePeriodGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTimePeriodGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTimePeriodGroup.cs	(revision 9616)
@@ -0,0 +1,126 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingTimePeriodGroup
+  /// </summary>
+  public class ExcelConditionalFormattingTimePeriodGroup
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="type"></param>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingTimePeriodGroup(
+      eExcelConditionalFormattingRuleType type,
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        type,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+      /// <param name="type"></param>
+      /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingTimePeriodGroup(
+      eExcelConditionalFormattingRuleType type,
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        type,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="type"></param>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingTimePeriodGroup(
+      eExcelConditionalFormattingRuleType type,
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        type,
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingToday.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingToday.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingToday.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingToday
+  /// </summary>
+  public class ExcelConditionalFormattingToday
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingToday(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.Today,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.Today;
+            Formula = string.Format(
+              "FLOOR({0},1)=TODAY()",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingToday(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingToday(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTomorrow.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTomorrow.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTomorrow.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingTomorrow
+  /// </summary>
+  public class ExcelConditionalFormattingTomorrow
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingTomorrow(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.Tomorrow,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.Tomorrow;
+            Formula = string.Format(
+              "FLOOR({0},1)=TODAY()+1",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingTomorrow(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingTomorrow(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTop.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTop.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTop.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingTop
+  /// </summary>
+  public class ExcelConditionalFormattingTop
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingTopBottomGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingTop(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.Top,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Bottom = false;
+            Percent = false;
+            Rank = 10;  // First 10 values
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingTop(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingTop(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTopPercent.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTopPercent.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTopPercent.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingTopPercent
+  /// </summary>
+  public class ExcelConditionalFormattingTopPercent
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingTopBottomGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingTopPercent(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.TopPercent,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            Bottom = false;
+            Percent = true;
+            Rank = 10;  // First 10 percent
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingTopPercent(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingTopPercent(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTwoColorScale.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTwoColorScale.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingTwoColorScale.cs	(revision 9616)
@@ -0,0 +1,180 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingTwoColorScale
+  /// </summary>
+  public class ExcelConditionalFormattingTwoColorScale
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingTwoColorScale
+  {
+    /****************************************************************************************/
+
+    #region Private Properties
+    /// <summary>
+    /// Private Low Value
+    /// </summary>
+    private ExcelConditionalFormattingColorScaleValue _lowValue;
+
+    /// <summary>
+    /// Private High Value
+    /// </summary>
+    private ExcelConditionalFormattingColorScaleValue _highValue;
+    #endregion Private Properties
+
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingTwoColorScale(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.TwoColorScale,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+      // Create the <colorScale> node inside the <cfRule> node
+      var colorScaleNode = CreateComplexNode(
+        Node,
+        ExcelConditionalFormattingConstants.Paths.ColorScale);
+
+      // LowValue default
+      LowValue = new ExcelConditionalFormattingColorScaleValue(
+        eExcelConditionalFormattingValueObjectPosition.Low,
+        eExcelConditionalFormattingValueObjectType.Min,
+        ColorTranslator.FromHtml(ExcelConditionalFormattingConstants.Colors.CfvoLowValue),
+        eExcelConditionalFormattingRuleType.TwoColorScale,
+        address,
+        priority,
+        worksheet,
+        NameSpaceManager);
+
+      // HighValue default
+      HighValue = new ExcelConditionalFormattingColorScaleValue(
+        eExcelConditionalFormattingValueObjectPosition.High,
+        eExcelConditionalFormattingValueObjectType.Max,
+        ColorTranslator.FromHtml(ExcelConditionalFormattingConstants.Colors.CfvoHighValue),
+        eExcelConditionalFormattingRuleType.TwoColorScale,
+        address,
+        priority,
+        worksheet,
+        NameSpaceManager);
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingTwoColorScale(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingTwoColorScale(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+
+    #region Public Properties
+    /// <summary>
+    /// Low Value for Two Color Scale Object Value
+    /// </summary>
+    public ExcelConditionalFormattingColorScaleValue LowValue
+    {
+      get { return _lowValue; }
+      set { _lowValue = value; }
+    }
+
+    /// <summary>
+    /// High Value for Two Color Scale Object Value
+    /// </summary>
+    public ExcelConditionalFormattingColorScaleValue HighValue
+    {
+      get { return _highValue; }
+      set { _highValue = value; }
+    }
+    #endregion Public Properties
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingUniqueValues.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingUniqueValues.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingUniqueValues.cs	(revision 9616)
@@ -0,0 +1,118 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingUniqueValues
+  /// </summary>
+  public class ExcelConditionalFormattingUniqueValues
+    : ExcelConditionalFormattingRule,
+    IExcelConditionalFormattingUniqueValues
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="address"></param>
+    /// <param name="priority"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingUniqueValues(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.UniqueValues,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingUniqueValues(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingUniqueValues(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingYesterday.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingYesterday.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ConditionalFormatting/Rules/ExcelConditionalFormattingYesterday.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Eyal Seagull        Added       		  2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml.ConditionalFormatting
+{
+  /// <summary>
+  /// ExcelConditionalFormattingYesterday
+  /// </summary>
+  public class ExcelConditionalFormattingYesterday
+    : ExcelConditionalFormattingTimePeriodGroup
+  {
+    /****************************************************************************************/
+
+    #region Constructors
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    /// <param name="namespaceManager"></param>
+    internal ExcelConditionalFormattingYesterday(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode,
+      XmlNamespaceManager namespaceManager)
+      : base(
+        eExcelConditionalFormattingRuleType.Yesterday,
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        (namespaceManager == null) ? worksheet.NameSpaceManager : namespaceManager)
+    {
+        if (itemElementNode==null) //Set default values and create attributes if needed
+        {
+            TimePeriod = eExcelConditionalFormattingTimePeriodType.Yesterday;
+            Formula = string.Format(
+              "FLOOR({0},1)=TODAY()-1",
+              Address.Start.Address);
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    /// <param name="itemElementNode"></param>
+    internal ExcelConditionalFormattingYesterday(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet,
+      XmlNode itemElementNode)
+      : this(
+        address,
+        priority,
+        worksheet,
+        itemElementNode,
+        null)
+    {
+    }
+
+    /// <summary>
+    /// 
+    /// </summary>
+    /// <param name="priority"></param>
+    /// <param name="address"></param>
+    /// <param name="worksheet"></param>
+    internal ExcelConditionalFormattingYesterday(
+      ExcelAddress address,
+      int priority,
+      ExcelWorksheet worksheet)
+      : this(
+        address,
+        priority,
+        worksheet,
+        null,
+        null)
+    {
+    }
+    #endregion Constructors
+
+    /****************************************************************************************/
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidation.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidation.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidation.cs	(revision 9616)
@@ -0,0 +1,64 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    /// <summary>
+    /// Interface for data validation
+    /// </summary>
+    public interface IExcelDataValidation
+    {
+        /// <summary>
+        /// Address of data validation
+        /// </summary>
+        ExcelAddress Address { get; }
+        /// <summary>
+        /// Validation type
+        /// </summary>
+        ExcelDataValidationType ValidationType { get; }
+        /// <summary>
+        /// Controls how Excel will handle invalid values.
+        /// </summary>
+        ExcelDataValidationWarningStyle ErrorStyle{ get; set; }
+        /// <summary>
+        /// True if input message should be shown
+        /// </summary>
+        bool? AllowBlank { get; set; }
+        /// <summary>
+        /// True if input message should be shown
+        /// </summary>
+        bool? ShowInputMessage { get; set; }
+        /// <summary>
+        /// True if error message should be shown.
+        /// </summary>
+        bool? ShowErrorMessage { get; set; }
+        /// <summary>
+        /// Title of error message box (see property ShowErrorMessage)
+        /// </summary>
+        string ErrorTitle { get; set; }
+        /// <summary>
+        /// Error message box text (see property ShowErrorMessage)
+        /// </summary>
+        string Error { get; set; }
+        /// <summary>
+        /// Title of info box if input message should be shown (see property ShowInputMessage)
+        /// </summary>
+        string PromptTitle { get; set; }
+        /// <summary>
+        /// Info message text (see property ShowErrorMessage)
+        /// </summary>
+        string Prompt { get; set; }
+        /// <summary>
+        /// True if the current validation type allows operator.
+        /// </summary>
+        bool AllowsOperator { get; }
+        /// <summary>
+        /// Validates the state of the validation.
+        /// </summary>
+        void Validate();
+
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationCustom.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationCustom.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationCustom.cs	(revision 9616)
@@ -0,0 +1,15 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    /// <summary>
+    /// Data validation interface for custom validation.
+    /// </summary>
+    public interface IExcelDataValidationCustom : IExcelDataValidationWithFormula<IExcelDataValidationFormula>, IExcelDataValidationWithOperator
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationDateTime.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationDateTime.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationDateTime.cs	(revision 9616)
@@ -0,0 +1,15 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    /// <summary>
+    /// Validation interface for datetime validations
+    /// </summary>
+    public interface IExcelDataValidationDateTime : IExcelDataValidationWithFormula2<IExcelDataValidationFormulaDateTime>, IExcelDataValidationWithOperator
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationDecimal.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationDecimal.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationDecimal.cs	(revision 9616)
@@ -0,0 +1,15 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    /// <summary>
+    /// Data validation interface for decimal values
+    /// </summary>
+    public interface IExcelDataValidationDecimal : IExcelDataValidationWithFormula2<IExcelDataValidationFormulaDecimal>, IExcelDataValidationWithOperator
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationInt.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationInt.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationInt.cs	(revision 9616)
@@ -0,0 +1,12 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    public interface IExcelDataValidationInt : IExcelDataValidationWithFormula2<IExcelDataValidationFormulaInt>, IExcelDataValidationWithOperator
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationList.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationList.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationList.cs	(revision 9616)
@@ -0,0 +1,12 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    public interface IExcelDataValidationList : IExcelDataValidationWithFormula<IExcelDataValidationFormulaList>
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationTime.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationTime.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationTime.cs	(revision 9616)
@@ -0,0 +1,15 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    /// <summary>
+    /// Data validation interface for time validation.
+    /// </summary>
+    public interface IExcelDataValidationTime : IExcelDataValidationWithFormula2<IExcelDataValidationFormulaTime>, IExcelDataValidationWithOperator
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationWithFormula.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationWithFormula.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationWithFormula.cs	(revision 9616)
@@ -0,0 +1,14 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    public interface IExcelDataValidationWithFormula<T> : IExcelDataValidation
+        where T : IExcelDataValidationFormula
+    {
+        T Formula { get; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationWithFormula2.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationWithFormula2.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationWithFormula2.cs	(revision 9616)
@@ -0,0 +1,21 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    /// <summary>
+    /// Interface for a data validation with two formulas
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    public interface IExcelDataValidationWithFormula2<T> : IExcelDataValidationWithFormula<T>
+        where T : IExcelDataValidationFormula
+    {
+        /// <summary>
+        /// Formula 2
+        /// </summary>
+        T Formula2 { get; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationWithOperator.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationWithOperator.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Contracts/IExcelDataValidationWithOperator.cs	(revision 9616)
@@ -0,0 +1,18 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation.Contracts
+{
+    /// <summary>
+    /// Represents a validation with an operator
+    /// </summary>
+    public interface IExcelDataValidationWithOperator
+    {
+        /// <summary>
+        /// Operator type
+        /// </summary>
+        ExcelDataValidationOperator Operator { get; set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidation.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidation.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidation.cs	(revision 9616)
@@ -0,0 +1,402 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.Utils;
+using System.Xml;
+using System.Text.RegularExpressions;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using OfficeOpenXml.DataValidation.Contracts;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Excel datavalidation
+    /// </summary>
+    public abstract class ExcelDataValidation : XmlHelper, IExcelDataValidation  
+    {
+        private const string _itemElementNodeName = "d:dataValidation";
+
+
+        private readonly string _errorStylePath = "@errorStyle";
+        private readonly string _errorTitlePath = "@errorTitle";
+        private readonly string _errorPath = "@error";
+        private readonly string _promptTitlePath = "@promptTitle";
+        private readonly string _promptPath = "@prompt";
+        private readonly string _operatorPath = "@operator";
+        private readonly string _showErrorMessagePath = "@showErrorMessage";
+        private readonly string _showInputMessagePath = "@showInputMessage";
+        private readonly string _typeMessagePath = "@type";
+        private readonly string _sqrefPath = "@sqref";
+        private readonly string _allowBlankPath = "@allowBlank";
+        protected readonly string _formula1Path = "d:formula1";
+        protected readonly string _formula2Path = "d:formula2";
+
+        internal ExcelDataValidation(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType)
+            : this(worksheet, address, validationType, null)
+        { }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet">worksheet that owns the validation</param>
+        /// <param name="itemElementNode">Xml top node (dataValidations)</param>
+        /// <param name="validationType">Data validation type</param>
+        /// <param name="address">address for data validation</param>
+        internal ExcelDataValidation(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode)
+            : this(worksheet, address, validationType, itemElementNode, null)
+        {
+
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet">worksheet that owns the validation</param>
+        /// <param name="itemElementNode">Xml top node (dataValidations) when importing xml</param>
+        /// <param name="validationType">Data validation type</param>
+        /// <param name="address">address for data validation</param>
+        /// <param name="namespaceManager">Xml Namespace manager</param>
+        internal ExcelDataValidation(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode, XmlNamespaceManager namespaceManager)
+            : base(namespaceManager != null ? namespaceManager : worksheet.NameSpaceManager)
+        {
+            Require.Argument(address).IsNotNullOrEmpty("address");
+            address = CheckAndFixRangeAddress(address);
+            if (itemElementNode == null)
+            {
+                //var xmlDoc = worksheet.WorksheetXml;
+                TopNode = worksheet.WorksheetXml.SelectSingleNode("//d:dataValidations", worksheet.NameSpaceManager);
+                // did not succeed using the XmlHelper methods here... so I'm creating the new node using XmlDocument...
+                var nsUri = NameSpaceManager.LookupNamespace("d");
+                //itemElementNode = TopNode.OwnerDocument.CreateElement(_itemElementNodeName, nsUri);
+                itemElementNode = TopNode.OwnerDocument.CreateElement(_itemElementNodeName.Split(':')[1], nsUri);
+                TopNode.AppendChild(itemElementNode);
+            }
+            TopNode = itemElementNode;
+            ValidationType = validationType;
+            Address = new ExcelAddress(address);
+            if (validationType.AllowOperator)
+            {
+                Operator = ExcelDataValidationOperator.any;
+            }
+            Init();
+        }
+
+        private void Init()
+        {
+            // set schema node order
+            SchemaNodeOrder = new string[]{ 
+                "type", 
+                "errorStyle", 
+                "operator", 
+                "allowBlank",
+                "showInputMessage", 
+                "showErrorMessage", 
+                "errorTitle", 
+                "error", 
+                "promptTitle", 
+                "prompt", 
+                "sqref",
+                "formula1",
+                "formula2"
+            };
+        }
+
+        private string CheckAndFixRangeAddress(string address)
+        {
+            if (address.Contains(','))
+            {
+                throw new FormatException("Multiple addresses may not be commaseparated, use space instead");
+            }
+            address = address.ToUpper();
+            if (Regex.IsMatch(address, @"[A-Z]+:[A-Z]+"))
+            {
+                address = AddressUtility.ParseEntireColumnSelections(address);
+            }
+            return address;
+        }
+
+        private void SetNullableBoolValue(string path, bool? val)
+        {
+            if (val.HasValue)
+            {
+                SetXmlNodeBool(path, val.Value);
+            }
+            else
+            {
+                DeleteNode(path);
+            }
+        }
+
+        /// <summary>
+        /// This method will validate the state of the validation
+        /// </summary>
+        /// <exception cref="InvalidOperationException">If the state breaks the rules of the validation</exception>
+        public virtual void Validate()
+        {
+            var address = Address.Address;
+            // validate Formula1
+            if (string.IsNullOrEmpty(Formula1Internal))
+            {
+                throw new InvalidOperationException("Validation of " + address + " failed: Formula1 cannot be empty");
+            }
+        }
+
+        #region Public properties
+
+        /// <summary>
+        /// True if the validation type allows operator to be set.
+        /// </summary>
+        public bool AllowsOperator
+        {
+            get
+            {
+                return ValidationType.AllowOperator;
+            }
+        }
+
+        /// <summary>
+        /// Address of data validation
+        /// </summary>
+        public ExcelAddress Address
+        {
+            get
+            {
+                return new ExcelAddress(GetXmlNodeString(_sqrefPath));
+            }
+            private set
+            {
+                var address = AddressUtility.ParseEntireColumnSelections(value.Address);
+                SetXmlNodeString(_sqrefPath, address);
+            }
+        }
+        /// <summary>
+        /// Validation type
+        /// </summary>
+        public ExcelDataValidationType ValidationType
+        {
+            get
+            {
+                var typeString = GetXmlNodeString(_typeMessagePath);
+                return ExcelDataValidationType.GetBySchemaName(typeString);
+            }
+            private set
+            {
+                SetXmlNodeString(_typeMessagePath, value.SchemaName);
+            }
+        }
+
+        /// <summary>
+        /// Operator for comparison between the entered value and Formula/Formulas.
+        /// </summary>
+        public ExcelDataValidationOperator Operator
+        {
+            get
+            {
+                var operatorString = GetXmlNodeString(_operatorPath);
+                if (!string.IsNullOrEmpty(operatorString))
+                {
+                    return (ExcelDataValidationOperator)Enum.Parse(typeof(ExcelDataValidationOperator), operatorString);
+                }
+                return default(ExcelDataValidationOperator);
+            }
+            set
+            {
+                if (!ValidationType.AllowOperator)
+                {
+                    throw new InvalidOperationException("The current validation type does not allow operator to be set");
+                }
+                SetXmlNodeString(_operatorPath, value.ToString());
+            }
+        }
+
+        /// <summary>
+        /// Warning style
+        /// </summary>
+        public ExcelDataValidationWarningStyle ErrorStyle
+        {
+            get
+            {
+                var errorStyleString = GetXmlNodeString(_errorStylePath);
+                if (!string.IsNullOrEmpty(errorStyleString))
+                {
+                    return (ExcelDataValidationWarningStyle)Enum.Parse(typeof(ExcelDataValidationWarningStyle), errorStyleString);
+                }
+                return ExcelDataValidationWarningStyle.undefined;
+            }
+            set
+            {
+                if(value == ExcelDataValidationWarningStyle.undefined)
+                {
+                    DeleteNode(_errorStylePath);
+                }
+                SetXmlNodeString(_errorStylePath, value.ToString());
+            }
+        }
+
+        /// <summary>
+        /// True if blanks should be allowed
+        /// </summary>
+        public bool? AllowBlank
+        {
+            get
+            {
+                return GetXmlNodeBoolNullable(_allowBlankPath);
+            }
+            set
+            {
+                SetNullableBoolValue(_allowBlankPath, value);
+            }
+        }
+
+        /// <summary>
+        /// True if input message should be shown
+        /// </summary>
+        public bool? ShowInputMessage
+        {
+            get
+            {
+                return GetXmlNodeBoolNullable(_showInputMessagePath);
+            }
+            set
+            {
+                SetNullableBoolValue(_showInputMessagePath, value);
+            }
+        }
+
+        /// <summary>
+        /// True if error message should be shown
+        /// </summary>
+        public bool? ShowErrorMessage
+        {
+            get
+            {
+                return GetXmlNodeBoolNullable(_showErrorMessagePath);
+            }
+            set
+            {
+                SetNullableBoolValue(_showErrorMessagePath, value);
+            }
+        }
+
+        /// <summary>
+        /// Title of error message box
+        /// </summary>
+        public string ErrorTitle
+        {
+            get
+            {
+                return GetXmlNodeString(_errorTitlePath);
+            }
+            set
+            {
+                SetXmlNodeString(_errorTitlePath, value);
+            }
+        }
+
+        /// <summary>
+        /// Error message box text
+        /// </summary>
+        public string Error
+        {
+            get
+            {
+                return GetXmlNodeString(_errorPath);
+            }
+            set
+            {
+                SetXmlNodeString(_errorPath, value);
+            }
+        }
+
+        public string PromptTitle
+        {
+            get
+            {
+                return GetXmlNodeString(_promptTitlePath);
+            }
+            set
+            {
+                SetXmlNodeString(_promptTitlePath, value);
+            }
+        }
+
+        public string Prompt
+        {
+            get
+            {
+                return GetXmlNodeString(_promptPath);
+            }
+            set
+            {
+                SetXmlNodeString(_promptPath, value);
+            }
+        }
+
+        /// <summary>
+        /// Formula 1
+        /// </summary>
+        protected string Formula1Internal
+        {
+            get
+            {
+                return GetXmlNodeString(_formula1Path);
+            }
+        }
+
+        /// <summary>
+        /// Formula 2
+        /// </summary>
+        protected string Formula2Internal
+        {
+            get
+            {
+                return GetXmlNodeString(_formula2Path);
+            }
+        }
+
+        #endregion
+
+        protected void SetValue<T>(Nullable<T> val, string path)
+            where T : struct
+        {
+            if (!val.HasValue)
+            {
+                DeleteNode(path);
+            }
+            var stringValue = val.Value.ToString().Replace(',', '.');
+            SetXmlNodeString(path, stringValue);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationCollection.cs	(revision 9616)
@@ -0,0 +1,390 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Mats Alm                         Applying patch submitted    2011-11-14
+ *                                  by Ted Heatherington
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Collections;
+using OfficeOpenXml.Utils;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Contracts;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// <para>
+    /// Collection of <see cref="ExcelDataValidation"/>. This class is providing the API for EPPlus data validation.
+    /// </para>
+    /// <para>
+    /// The public methods of this class (Add[...]Validation) will create a datavalidation entry in the worksheet. When this
+    /// validation has been created changes to the properties will affect the workbook immediately.
+    /// </para>
+    /// <para>
+    /// Each type of validation has either a formula or a typed value/values, except for custom validation which has a formula only.
+    /// </para>
+    /// <code>
+    /// // Add a date time validation
+    /// var validation = worksheet.DataValidation.AddDateTimeValidation("A1");
+    /// // set validation properties
+    /// validation.ShowErrorMessage = true;
+    /// validation.ErrorTitle = "An invalid date was entered";
+    /// validation.Error = "The date must be between 2011-01-31 and 2011-12-31";
+    /// validation.Prompt = "Enter date here";
+    /// validation.Formula.Value = DateTime.Parse("2011-01-01");
+    /// validation.Formula2.Value = DateTime.Parse("2011-12-31");
+    /// validation.Operator = ExcelDataValidationOperator.between;
+    /// </code>
+    /// </summary>
+    public class ExcelDataValidationCollection : XmlHelper, IEnumerable<IExcelDataValidation>
+    {
+        private List<IExcelDataValidation> _validations = new List<IExcelDataValidation>();
+        private ExcelWorksheet _worksheet = null;
+
+        private const string DataValidationPath = "//d:dataValidations";
+        private readonly string DataValidationItemsPath = string.Format("{0}/d:dataValidation", DataValidationPath);
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        internal ExcelDataValidationCollection(ExcelWorksheet worksheet)
+            : base(worksheet.NameSpaceManager, worksheet.WorksheetXml.DocumentElement)
+        {
+            Require.Argument(worksheet).IsNotNull("worksheet");
+            _worksheet = worksheet;
+            SchemaNodeOrder = worksheet.SchemaNodeOrder;
+
+            // check existing nodes and load them
+            var dataValidationNodes = worksheet.WorksheetXml.SelectNodes(DataValidationItemsPath, worksheet.NameSpaceManager);
+            if (dataValidationNodes != null && dataValidationNodes.Count > 0)
+            {
+                foreach (XmlNode node in dataValidationNodes)
+                {
+                    if (node.Attributes["sqref"] == null || node.Attributes["type"] == null) continue;
+
+                    var addr = node.Attributes["sqref"].Value;
+
+                    var type = ExcelDataValidationType.GetBySchemaName(node.Attributes["type"].Value);
+                    _validations.Add(ExcelDataValidationFactory.Create(type, worksheet, addr, node));
+                }
+            }
+            if (_validations.Count > 0)
+            {
+                OnValidationCountChanged();
+            }
+        }
+
+        private void EnsureRootElementExists()
+        {
+            var node = _worksheet.WorksheetXml.SelectSingleNode(DataValidationPath, _worksheet.NameSpaceManager);
+            if (node == null)
+            {
+                CreateNode(DataValidationPath.TrimStart('/'));
+            }
+        }
+
+        private void OnValidationCountChanged()
+        {
+            if (TopNode != null)
+            {
+                SetXmlNodeString("@count", _validations.Count.ToString());
+            }
+        }
+
+        private XmlNode GetRootNode()
+        {
+            EnsureRootElementExists();
+            TopNode = _worksheet.WorksheetXml.SelectSingleNode(DataValidationPath, _worksheet.NameSpaceManager);
+            return TopNode;
+        }
+
+        /// <summary>
+        /// Validates address - not empty, collisions
+        /// </summary>
+        /// <param name="address"></param>
+        /// <param name="validatingValidation"></param>
+        private void ValidateAddress(string address, IExcelDataValidation validatingValidation)
+        {
+            Require.Argument(address).IsNotNullOrEmpty("address");
+            
+            // ensure that the new address does not collide with an existing validation.
+            var newAddress = new ExcelAddress(address);
+            if (_validations.Count > 0)
+            {
+                foreach (var validation in _validations)
+                {
+                    if (validatingValidation != null && validatingValidation == validation)
+                    {
+                        continue;
+                    }
+                    var result = validation.Address.Collide(newAddress);
+                    if (result != ExcelAddressBase.eAddressCollition.No)
+                    {
+                        throw new InvalidOperationException(string.Format("The address ({0}) collides with an existing validation ({1})", address, validation.Address.Address));
+                    }
+                }
+            }
+        }
+
+        private void ValidateAddress(string address)
+        {
+            ValidateAddress(address, null);
+        }
+
+        /// <summary>
+        /// Validates all data validations.
+        /// </summary>
+        internal void ValidateAll()
+        {
+            foreach (var validation in _validations)
+            {
+                validation.Validate();
+
+                ValidateAddress(validation.Address.Address, validation);
+            }
+        }
+
+        /// <summary>
+        /// Adds an <see cref="IExcelDataValidationInt"/> to the worksheet. Whole means that the only accepted values
+        /// are integer values.
+        /// </summary>
+        /// <param name="address">the range/address to validate</param>
+        public IExcelDataValidationInt AddIntegerValidation(string address)
+        {
+            ValidateAddress(address);
+            EnsureRootElementExists(); 
+            var item = new ExcelDataValidationInt(_worksheet, address, ExcelDataValidationType.Whole);
+            _validations.Add(item);
+            OnValidationCountChanged();
+            return item;
+        }
+
+        /// <summary>
+        /// Addes an <see cref="IExcelDataValidationDecimal"/> to the worksheet. The only accepted values are
+        /// decimal values.
+        /// </summary>
+        /// <param name="address">The range/address to validate</param>
+        /// <returns></returns>
+        public IExcelDataValidationDecimal AddDecimalValidation(string address)
+        {
+            ValidateAddress(address);
+            EnsureRootElementExists();
+            var item = new ExcelDataValidationDecimal(_worksheet, address, ExcelDataValidationType.Decimal);
+            _validations.Add(item);
+            OnValidationCountChanged();
+            return item;
+        }
+
+        /// <summary>
+        /// Adds an <see cref="IExcelDataValidationList"/> to the worksheet. The accepted values are defined
+        /// in a list.
+        /// </summary>
+        /// <param name="address">The range/address to validate</param>
+        /// <returns></returns>
+        public IExcelDataValidationList AddListValidation(string address)
+        {
+            ValidateAddress(address);
+            EnsureRootElementExists();
+            var item = new ExcelDataValidationList(_worksheet, address, ExcelDataValidationType.List);
+            _validations.Add(item);
+            OnValidationCountChanged();
+            return item;
+        }
+
+        /// <summary>
+        /// Adds an <see cref="IExcelDataValidationInt"/> regarding text length to the worksheet.
+        /// </summary>
+        /// <param name="address">The range/address to validate</param>
+        /// <returns></returns>
+        public IExcelDataValidationInt AddTextLengthValidation(string address)
+        {
+            ValidateAddress(address);
+            EnsureRootElementExists();
+            var item = new ExcelDataValidationInt(_worksheet, address, ExcelDataValidationType.TextLength);
+            _validations.Add(item);
+            OnValidationCountChanged();
+            return item;
+        }
+
+        /// <summary>
+        /// Adds an <see cref="IExcelDataValidationDateTime"/> to the worksheet.
+        /// </summary>
+        /// <param name="address">The range/address to validate</param>
+        /// <returns></returns>
+        public IExcelDataValidationDateTime AddDateTimeValidation(string address)
+        {
+            ValidateAddress(address);
+            EnsureRootElementExists();
+            var item = new ExcelDataValidationDateTime(_worksheet, address, ExcelDataValidationType.DateTime);
+            _validations.Add(item);
+            OnValidationCountChanged();
+            return item;
+        }
+
+        
+        public IExcelDataValidationTime AddTimeValidation(string address)
+        {
+            ValidateAddress(address);
+            EnsureRootElementExists();
+            var item = new ExcelDataValidationTime(_worksheet, address, ExcelDataValidationType.Time);
+            _validations.Add(item);
+            OnValidationCountChanged();
+            return item;
+        }
+        /// <summary>
+        /// Adds a <see cref="ExcelDataValidationCustom"/> to the worksheet.
+        /// </summary>
+        /// <param name="address">The range/address to validate</param>
+        /// <returns></returns>
+        public IExcelDataValidationCustom AddCustomValidation(string address)
+        {
+            ValidateAddress(address);
+            EnsureRootElementExists();
+            var item = new ExcelDataValidationCustom(_worksheet, address, ExcelDataValidationType.Custom);
+            _validations.Add(item);
+            OnValidationCountChanged();
+            return item;
+        }
+
+        /// <summary>
+        /// Removes an <see cref="ExcelDataValidation"/> from the collection.
+        /// </summary>
+        /// <param name="item">The item to remove</param>
+        /// <returns>True if remove succeeds, otherwise false</returns>
+        /// <exception cref="ArgumentNullException">if <paramref name="item"/> is null</exception>
+        public bool Remove(IExcelDataValidation item)
+        {
+            if (!(item is ExcelDataValidation))
+            {
+                throw new InvalidCastException("The supplied item must inherit OfficeOpenXml.DataValidation.ExcelDataValidation");
+            }
+            Require.Argument(item).IsNotNull("item");
+            TopNode.RemoveChild(((ExcelDataValidation)item).TopNode);
+            var retVal = _validations.Remove(item);
+            if (retVal) OnValidationCountChanged();
+            return retVal;
+        }
+
+        /// <summary>
+        /// Number of validations
+        /// </summary>
+        public int Count
+        {
+            get { return _validations.Count; }
+        }
+
+        /// <summary>
+        /// Index operator, returns by 0-based index
+        /// </summary>
+        /// <param name="index"></param>
+        /// <returns></returns>
+        public IExcelDataValidation this[int index]
+        {
+            get { return _validations[index]; }
+            set { _validations[index] = value; }
+        }
+
+        /// <summary>
+        /// Index operator, returns a data validation which address partly or exactly matches the searched address.
+        /// </summary>
+        /// <param name="address">A cell address or range</param>
+        /// <returns>A <see cref="ExcelDataValidation"/> or null if no match</returns>
+        public IExcelDataValidation this[string address]
+        {
+            get
+            {
+                var searchedAddress = new ExcelAddress(address);
+                return _validations.Find(x => x.Address.Collide(searchedAddress) != ExcelAddressBase.eAddressCollition.No);
+            }
+        }
+
+        /// <summary>
+        /// Returns all validations that matches the supplied predicate <paramref name="match"/>.
+        /// </summary>
+        /// <param name="match">predicate to filter out matching validations</param>
+        /// <returns></returns>
+        public IEnumerable<IExcelDataValidation> FindAll(Predicate<IExcelDataValidation> match)
+        {
+            return _validations.FindAll(match);
+        }
+
+        /// <summary>
+        /// Returns the first matching validation.
+        /// </summary>
+        /// <param name="match"></param>
+        /// <returns></returns>
+        public IExcelDataValidation Find(Predicate<IExcelDataValidation> match)
+        {
+            return _validations.Find(match);
+        }
+
+        /// <summary>
+        /// Removes all validations from the collection.
+        /// </summary>
+        public void Clear()
+        {
+            DeleteAllNode(DataValidationItemsPath.TrimStart('/'));
+            _validations.Clear();
+        }
+
+        /// <summary>
+        /// Removes the validations that matches the predicate
+        /// </summary>
+        /// <param name="match"></param>
+        public void RemoveAll(Predicate<IExcelDataValidation> match)
+        {
+            var matches = _validations.FindAll(match);
+            foreach (var m in matches)
+            {
+                if (!(m is ExcelDataValidation))
+                {
+                    throw new InvalidCastException("The supplied item must inherit OfficeOpenXml.DataValidation.ExcelDataValidation");
+                }
+                TopNode.SelectSingleNode(DataValidationPath.TrimStart('/'), NameSpaceManager).RemoveChild(((ExcelDataValidation)m).TopNode);
+            }
+            _validations.RemoveAll(match);
+            OnValidationCountChanged();
+        }
+
+        IEnumerator<IExcelDataValidation> IEnumerable<IExcelDataValidation>.GetEnumerator()
+        {
+            return _validations.GetEnumerator();
+        }
+
+        IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _validations.GetEnumerator();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationCustom.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationCustom.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationCustom.cs	(revision 9616)
@@ -0,0 +1,87 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using OfficeOpenXml.DataValidation.Formulas;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Contracts;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Custom validation, i.e. a formula.
+    /// </summary>
+    public class ExcelDataValidationCustom : ExcelDataValidationWithFormula<IExcelDataValidationFormula>, IExcelDataValidationCustom
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        internal ExcelDataValidationCustom(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType)
+            : base(worksheet, address, validationType)
+        {
+            Formula = new ExcelDataValidationFormulaCustom(NameSpaceManager, TopNode, _formula1Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        internal ExcelDataValidationCustom(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode)
+            : base(worksheet, address, validationType, itemElementNode)
+        {
+            Formula = new ExcelDataValidationFormulaCustom(NameSpaceManager, TopNode, _formula1Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        /// <param name="namespaceManager"></param>
+        internal ExcelDataValidationCustom(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode, XmlNamespaceManager namespaceManager)
+            : base(worksheet, address, validationType, itemElementNode, namespaceManager)
+        {
+            Formula = new ExcelDataValidationFormulaCustom(NameSpaceManager, TopNode, _formula1Path);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationDateTime.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationDateTime.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationDateTime.cs	(revision 9616)
@@ -0,0 +1,90 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using OfficeOpenXml.DataValidation.Formulas;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Contracts;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Validation for <see cref="DateTime"/>.
+    /// </summary>
+    public class ExcelDataValidationDateTime : ExcelDataValidationWithFormula2<IExcelDataValidationFormulaDateTime>, IExcelDataValidationDateTime
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        internal ExcelDataValidationDateTime(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType)
+            : base(worksheet, address, validationType)
+        {
+            Formula = new ExcelDataValidationFormulaDateTime(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaDateTime(NameSpaceManager, TopNode, _formula2Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        internal ExcelDataValidationDateTime(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode)
+            : base(worksheet, address, validationType, itemElementNode)
+        {
+            Formula = new ExcelDataValidationFormulaDateTime(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaDateTime(NameSpaceManager, TopNode, _formula2Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        /// <param name="namespaceManager"></param>
+        internal ExcelDataValidationDateTime(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode, XmlNamespaceManager namespaceManager)
+            : base(worksheet, address, validationType, itemElementNode, namespaceManager)
+        {
+            Formula = new ExcelDataValidationFormulaDateTime(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaDateTime(NameSpaceManager, TopNode, _formula2Path);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationDecimal.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationDecimal.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationDecimal.cs	(revision 9616)
@@ -0,0 +1,91 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Globalization;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using OfficeOpenXml.DataValidation.Formulas;
+using OfficeOpenXml.DataValidation.Contracts;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Data validation for decimal values
+    /// </summary>
+    public class ExcelDataValidationDecimal : ExcelDataValidationWithFormula2<IExcelDataValidationFormulaDecimal>, IExcelDataValidationDecimal
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        internal ExcelDataValidationDecimal(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType)
+            : base(worksheet, address, validationType)
+        {
+            Formula = new ExcelDataValidationFormulaDecimal(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaDecimal(NameSpaceManager, TopNode, _formula2Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        internal ExcelDataValidationDecimal(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode)
+            : base(worksheet, address, validationType, itemElementNode)
+        {
+            Formula = new ExcelDataValidationFormulaDecimal(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaDecimal(NameSpaceManager, TopNode, _formula2Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        /// <param name="namespaceManager">For test purposes</param>
+        internal ExcelDataValidationDecimal(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode, XmlNamespaceManager namespaceManager)
+            : base(worksheet, address, validationType, itemElementNode, namespaceManager)
+        {
+            Formula = new ExcelDataValidationFormulaDecimal(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaDecimal(NameSpaceManager, TopNode, _formula2Path);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationFactory.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationFactory.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationFactory.cs	(revision 9616)
@@ -0,0 +1,77 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Utils;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Factory class for ExcelDataValidation.
+    /// </summary>
+    internal static class ExcelDataValidationFactory
+    {
+        /// <summary>
+        /// Creates an instance of <see cref="ExcelDataValidation"/> out of the given parameters.
+        /// </summary>
+        /// <param name="type"></param>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="itemElementNode"></param>
+        /// <returns></returns>
+        public static ExcelDataValidation Create(ExcelDataValidationType type, ExcelWorksheet worksheet, string address, XmlNode itemElementNode)
+        {
+            Require.Argument(type).IsNotNull("validationType");
+            switch (type.Type)
+            {
+                case eDataValidationType.TextLength:
+                case eDataValidationType.Whole:
+                    return new ExcelDataValidationInt(worksheet, address, type, itemElementNode);
+                case eDataValidationType.Decimal:
+                    return new ExcelDataValidationDecimal(worksheet, address, type, itemElementNode);
+                case eDataValidationType.List:
+                    return new ExcelDataValidationList(worksheet, address, type, itemElementNode);
+                case eDataValidationType.DateTime:
+                    return new ExcelDataValidationDateTime(worksheet, address, type, itemElementNode);
+                case eDataValidationType.Time:
+                    return new ExcelDataValidationTime(worksheet, address, type, itemElementNode);
+                case eDataValidationType.Custom:
+                    return new ExcelDataValidationCustom(worksheet, address, type, itemElementNode);
+                default:
+                    throw new InvalidOperationException("Non supported validationtype: " + type.Type.ToString());
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationInt.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationInt.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationInt.cs	(revision 9616)
@@ -0,0 +1,90 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Contracts;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Data validation for integer values.
+    /// </summary>
+    public class ExcelDataValidationInt : ExcelDataValidationWithFormula2<IExcelDataValidationFormulaInt>, IExcelDataValidationInt
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        internal ExcelDataValidationInt(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType)
+            : base(worksheet, address, validationType)
+        {
+            Formula = new ExcelDataValidationFormulaInt(worksheet.NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaInt(worksheet.NameSpaceManager, TopNode, _formula2Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        internal ExcelDataValidationInt(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode)
+            : base(worksheet, address, validationType, itemElementNode)
+        {
+            Formula = new ExcelDataValidationFormulaInt(worksheet.NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaInt(worksheet.NameSpaceManager, TopNode, _formula2Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        /// <param name="namespaceManager">For test purposes</param>
+        internal ExcelDataValidationInt(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode, XmlNamespaceManager namespaceManager)
+            : base(worksheet, address, validationType, itemElementNode, namespaceManager)
+        {
+            Formula = new ExcelDataValidationFormulaInt(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaInt(NameSpaceManager, TopNode, _formula2Path);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationList.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationList.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationList.cs	(revision 9616)
@@ -0,0 +1,88 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using OfficeOpenXml.DataValidation.Formulas;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Contracts;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// This class represents an List data validation.
+    /// </summary>
+    public class ExcelDataValidationList : ExcelDataValidationWithFormula<IExcelDataValidationFormulaList>, IExcelDataValidationList
+    {
+       
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        internal ExcelDataValidationList(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType)
+            : base(worksheet, address, validationType)
+        {
+            Formula = new ExcelDataValidationFormulaList(NameSpaceManager, TopNode, _formula1Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        internal ExcelDataValidationList(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode)
+            : base(worksheet, address, validationType, itemElementNode)
+        {
+            Formula = new ExcelDataValidationFormulaList(NameSpaceManager, TopNode, _formula1Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        /// <param name="namespaceManager">Namespace manager, for test purposes</param>
+        internal ExcelDataValidationList(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode, XmlNamespaceManager namespaceManager)
+            : base(worksheet, address, validationType, itemElementNode, namespaceManager)
+        {
+            Formula = new ExcelDataValidationFormulaList(NameSpaceManager, TopNode, _formula1Path);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationOperator.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationOperator.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationOperator.cs	(revision 9616)
@@ -0,0 +1,54 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Operator for comparison between Formula and Formula2 in a validation.
+    /// </summary>
+    public enum ExcelDataValidationOperator
+    {
+        any,
+        equal,
+        notEqual,
+        lessThan,
+        lessThanOrEqual,
+        greaterThan,
+        greaterThanOrEqual,
+        between,
+        notBetween
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationTime.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationTime.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationTime.cs	(revision 9616)
@@ -0,0 +1,91 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using OfficeOpenXml.DataValidation.Formulas;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Contracts;
+using System.Runtime.CompilerServices;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Validation for times (<see cref="OfficeOpenXml.DataValidation.ExcelTime"/>).
+    /// </summary>
+    public class ExcelDataValidationTime : ExcelDataValidationWithFormula2<IExcelDataValidationFormulaTime>, IExcelDataValidationTime
+    {
+         /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        internal ExcelDataValidationTime(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType)
+            : base(worksheet, address, validationType)
+        {
+            Formula = new ExcelDataValidationFormulaTime(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaTime(NameSpaceManager, TopNode, _formula2Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        internal ExcelDataValidationTime(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode)
+            : base(worksheet, address, validationType, itemElementNode)
+        {
+            Formula = new ExcelDataValidationFormulaTime(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaTime(NameSpaceManager, TopNode, _formula2Path);
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        /// <param name="itemElementNode"></param>
+        /// <param name="namespaceManager"></param>
+        internal ExcelDataValidationTime(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode, XmlNamespaceManager namespaceManager)
+            : base(worksheet, address, validationType, itemElementNode, namespaceManager)
+        {
+            Formula = new ExcelDataValidationFormulaTime(NameSpaceManager, TopNode, _formula1Path);
+            Formula2 = new ExcelDataValidationFormulaTime(NameSpaceManager, TopNode, _formula2Path);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationType.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationType.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationType.cs	(revision 9616)
@@ -0,0 +1,293 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Enum for available data validation types
+    /// </summary>
+    public enum eDataValidationType
+    {
+        /// <summary>
+        /// Integer value
+        /// </summary>
+        Whole,
+        /// <summary>
+        /// Decimal values
+        /// </summary>
+        Decimal,
+        /// <summary>
+        /// List of values
+        /// </summary>
+        List,
+        /// <summary>
+        /// Text length validation
+        /// </summary>
+        TextLength,
+        /// <summary>
+        /// DateTime validation
+        /// </summary>
+        DateTime,
+        /// <summary>
+        /// Time validation
+        /// </summary>
+        Time,
+        /// <summary>
+        /// Custom validation
+        /// </summary>
+        Custom
+    }
+
+    internal static class DataValidationSchemaNames
+    {
+        public const string Whole = "whole";
+        public const string Decimal = "decimal";
+        public const string List = "list";
+        public const string TextLength = "textLength";
+        public const string Date = "date";
+        public const string Time = "time";
+        public const string Custom = "custom";
+    }
+
+    /// <summary>
+    /// Types of datavalidation
+    /// </summary>
+    public class ExcelDataValidationType
+    {
+        private ExcelDataValidationType(eDataValidationType validationType, bool allowOperator, string schemaName)
+        {
+            Type = validationType;
+            AllowOperator = allowOperator;
+            SchemaName = schemaName;
+        }
+
+        /// <summary>
+        /// Validation type
+        /// </summary>
+        public eDataValidationType Type
+        {
+            get;
+            private set;
+        }
+
+        internal string SchemaName
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// This type allows operator to be set
+        /// </summary>
+        internal bool AllowOperator
+        {
+
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// Returns a validation type by <see cref="eDataValidationType"/>
+        /// </summary>
+        /// <param name="type"></param>
+        /// <returns></returns>
+        internal static ExcelDataValidationType GetByValidationType(eDataValidationType type)
+        {
+            switch (type)
+            {
+                case eDataValidationType.Whole:
+                    return ExcelDataValidationType.Whole;
+                case eDataValidationType.List:
+                    return ExcelDataValidationType.List;
+                case eDataValidationType.Decimal:
+                    return ExcelDataValidationType.Decimal;
+                case eDataValidationType.TextLength:
+                    return ExcelDataValidationType.TextLength;
+                case eDataValidationType.DateTime:
+                    return ExcelDataValidationType.DateTime;
+                case eDataValidationType.Time:
+                    return ExcelDataValidationType.Time;
+                case eDataValidationType.Custom:
+                    return ExcelDataValidationType.Custom;
+                default:
+                    throw new InvalidOperationException("Non supported Validationtype : " + type.ToString());
+            }
+        }
+
+        internal static ExcelDataValidationType GetBySchemaName(string schemaName)
+        {
+            switch (schemaName)
+            {
+                case DataValidationSchemaNames.Whole:
+                    return ExcelDataValidationType.Whole;
+                case DataValidationSchemaNames.Decimal:
+                    return ExcelDataValidationType.Decimal;
+                case DataValidationSchemaNames.List:
+                    return ExcelDataValidationType.List;
+                case DataValidationSchemaNames.TextLength:
+                    return ExcelDataValidationType.TextLength;
+                case DataValidationSchemaNames.Date:
+                    return ExcelDataValidationType.DateTime;
+                case DataValidationSchemaNames.Time:
+                    return ExcelDataValidationType.Time;
+                case DataValidationSchemaNames.Custom:
+                    return ExcelDataValidationType.Custom;
+                default:
+                    throw new ArgumentException("Invalid schemaname: " + schemaName);
+            }
+        }
+
+        /// <summary>
+        /// Overridden Equals, compares on internal validation type
+        /// </summary>
+        /// <param name="obj"></param>
+        /// <returns></returns>
+        public override bool Equals(object obj)
+        {
+            if (!(obj is ExcelDataValidationType))
+            {
+                return false;
+            }
+            return ((ExcelDataValidationType)obj).Type == Type;
+        }
+
+        /// <summary>
+        /// Overrides GetHashCode()
+        /// </summary>
+        /// <returns></returns>
+        public override int GetHashCode()
+        {
+            return base.GetHashCode();
+        }
+
+        /// <summary>
+        /// Integer values
+        /// </summary>
+        private static ExcelDataValidationType _whole;
+        public static ExcelDataValidationType Whole
+        {
+            get 
+            {
+                if(_whole == null)
+                {
+                    _whole = new ExcelDataValidationType(eDataValidationType.Whole, true, DataValidationSchemaNames.Whole); 
+                }
+                return _whole;
+            }
+        }
+
+        /// <summary>
+        /// List of allowed values
+        /// </summary>
+        private static ExcelDataValidationType _list;
+        public static ExcelDataValidationType List
+        {
+            get
+            {
+                if (_list == null)
+                {
+                    _list = new ExcelDataValidationType(eDataValidationType.List, false, DataValidationSchemaNames.List);
+                }
+                return _list;
+            }
+        }
+
+        private static ExcelDataValidationType _decimal;
+        public static ExcelDataValidationType Decimal
+        {
+            get
+            {
+                if (_decimal == null)
+                {
+                    _decimal = new ExcelDataValidationType(eDataValidationType.Decimal, true, DataValidationSchemaNames.Decimal);
+                }
+                return _decimal;
+            }
+        }
+
+        private static ExcelDataValidationType _textLength;
+        public static ExcelDataValidationType TextLength
+        {
+            get
+            {
+                if (_textLength == null)
+                {
+                    _textLength = new ExcelDataValidationType(eDataValidationType.TextLength, true, DataValidationSchemaNames.TextLength);
+                }
+                return _textLength;
+            }
+        }
+
+        private static ExcelDataValidationType _dateTime;
+        public static ExcelDataValidationType DateTime
+        {
+            get
+            {
+                if (_dateTime == null)
+                {
+                    _dateTime = new ExcelDataValidationType(eDataValidationType.DateTime, true, DataValidationSchemaNames.Date);
+                }
+                return _dateTime;
+            }
+        }
+
+        private static ExcelDataValidationType _time;
+        public static ExcelDataValidationType Time
+        {
+            get
+            {
+                if (_time == null)
+                {
+                    _time = new ExcelDataValidationType(eDataValidationType.Time, true, DataValidationSchemaNames.Time);
+                }
+                return _time;
+            }
+        }
+
+        private static ExcelDataValidationType _custom;
+        public static ExcelDataValidationType Custom
+        {
+            get
+            {
+                if (_custom == null)
+                {
+                    _custom = new ExcelDataValidationType(eDataValidationType.Custom, true, DataValidationSchemaNames.Custom);
+                }
+                return _custom;
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationWarningStyle.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationWarningStyle.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationWarningStyle.cs	(revision 9616)
@@ -0,0 +1,61 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// warning style, controls how Excel will handle invalid changes.
+    /// </summary>
+    public enum ExcelDataValidationWarningStyle
+    {
+        /// <summary>
+        /// warning style will be excluded
+        /// </summary>
+        undefined,
+        /// <summary>
+        /// stop warning style, invalid changes will not be accepted
+        /// </summary>
+        stop,
+        /// <summary>
+        /// warning will be presented when an attempt to an invalid change is done, but the change will be accepted.
+        /// </summary>
+        warning,
+        /// <summary>
+        /// information warning style.
+        /// </summary>
+        information
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationWithFormula.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationWithFormula.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationWithFormula.cs	(revision 9616)
@@ -0,0 +1,109 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using System.Xml;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// A validation containing a formula
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    public class ExcelDataValidationWithFormula<T> : ExcelDataValidation
+        where T : IExcelDataValidationFormula
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        internal ExcelDataValidationWithFormula(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType)
+            : this(worksheet, address, validationType, null)
+        {
+
+        }
+
+         /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet">Worksheet that owns the validation</param>
+        /// <param name="itemElementNode">Xml top node (dataValidations)</param>
+        /// <param name="validationType">Data validation type</param>
+        /// <param name="address">address for data validation</param>
+        internal ExcelDataValidationWithFormula(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode)
+            : base(worksheet, address, validationType, itemElementNode)
+        {
+            
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet">Worksheet that owns the validation</param>
+        /// <param name="itemElementNode">Xml top node (dataValidations)</param>
+        /// <param name="validationType">Data validation type</param>
+        /// <param name="address">address for data validation</param>
+        /// <param name="namespaceManager">for test purposes</param>
+        internal ExcelDataValidationWithFormula(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode, XmlNamespaceManager namespaceManager)
+            : base(worksheet, address, validationType, itemElementNode, namespaceManager)
+        {
+
+        }
+
+
+        /// <summary>
+        /// Formula - Either a {T} value (except for custom validation) or a spreadsheet formula
+        /// </summary>
+        public T Formula
+        {
+            get;
+            protected set;
+        }
+
+        public override void Validate()
+        {
+            base.Validate();
+            if (Operator == ExcelDataValidationOperator.between || Operator == ExcelDataValidationOperator.notBetween)
+            {
+                if (string.IsNullOrEmpty(Formula2Internal))
+                {
+                    throw new InvalidOperationException("Validation of " + Address.Address + " failed: Formula2 must be set if operator is 'between' or 'notBetween'");
+                }
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationWithFormula2.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationWithFormula2.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelDataValidationWithFormula2.cs	(revision 9616)
@@ -0,0 +1,91 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using System.Xml;
+
+namespace OfficeOpenXml.DataValidation
+{
+    public class ExcelDataValidationWithFormula2<T> : ExcelDataValidationWithFormula<T>
+        where T : IExcelDataValidationFormula
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet"></param>
+        /// <param name="address"></param>
+        /// <param name="validationType"></param>
+        internal ExcelDataValidationWithFormula2(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType)
+            : this(worksheet, address, validationType, null)
+        {
+
+        }
+
+         /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet">Worksheet that owns the validation</param>
+        /// <param name="itemElementNode">Xml top node (dataValidations)</param>
+        /// <param name="validationType">Data validation type</param>
+        /// <param name="address">address for data validation</param>
+        internal ExcelDataValidationWithFormula2(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode)
+            : base(worksheet, address, validationType, itemElementNode)
+        {
+            
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="worksheet">Worksheet that owns the validation</param>
+        /// <param name="itemElementNode">Xml top node (dataValidations)</param>
+        /// <param name="validationType">Data validation type</param>
+        /// <param name="address">address for data validation</param>
+        /// <param name="namespaceManager">for test purposes</param>
+        internal ExcelDataValidationWithFormula2(ExcelWorksheet worksheet, string address, ExcelDataValidationType validationType, XmlNode itemElementNode, XmlNamespaceManager namespaceManager)
+            : base(worksheet, address, validationType, itemElementNode, namespaceManager)
+        {
+
+        }
+        /// <summary>
+        /// Formula - Either a {T} value or a spreadsheet formula
+        /// </summary>
+        public T Formula2
+        {
+            get;
+            protected set;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelTime.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelTime.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/ExcelTime.cs	(revision 9616)
@@ -0,0 +1,269 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Globalization;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Represents a time between 00:00:00 and 23:59:59
+    /// </summary>
+    public class ExcelTime
+    {
+        private event EventHandler _timeChanged;
+        private readonly decimal SecondsPerDay = 3600 * 24;
+        private readonly decimal SecondsPerHour = 3600;
+        private readonly decimal SecondsPerMinute = 60;
+        /// <summary>
+        /// Max number of decimals when rounding.
+        /// </summary>
+        public const int NumberOfDecimals = 15;
+
+        /// <summary>
+        /// Default constructor
+        /// </summary>
+        public ExcelTime()
+        {
+
+        }
+
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="value">An existing time for initialization</param>
+        public ExcelTime(decimal value)
+        {
+            if (value < 0M)
+            {
+                throw new ArgumentException("Value cannot be less than 0");
+            }
+            else if (value >= 1M)
+            {
+                throw new ArgumentException("Value cannot be greater or equal to 1");
+            }
+            Init(value);
+        }
+
+        private void Init(decimal value)
+        {
+            // handle hour
+            decimal totalSeconds = value * SecondsPerDay;
+            decimal hour = Math.Floor(totalSeconds / SecondsPerHour);
+            Hour = (int)hour;
+
+            // handle minute
+            decimal remainingSeconds = totalSeconds - ((decimal)Hour * SecondsPerHour);
+            decimal minute = Math.Floor(remainingSeconds / SecondsPerMinute);
+            Minute = (int)minute;
+
+            // handle second
+            remainingSeconds = totalSeconds - ((decimal)Hour * SecondsPerHour) - ((decimal)Minute * SecondsPerMinute);
+            decimal second = Math.Round(remainingSeconds, MidpointRounding.AwayFromZero);
+            // Second might be rounded to 60... the SetSecond method handles that.
+            SetSecond((int)second);
+        }
+
+        /// <summary>
+        /// If we are unlucky second might be rounded up to 60. This will have the minute to be raised and might affect the hour.
+        /// </summary>
+        /// <param name="value"></param>
+        private void SetSecond(int value)
+        {
+            if (value == 60)
+            {
+                Second = 0;
+                var minute = Minute + 1;
+                SetMinute(minute);
+            }
+            else
+            {
+                Second = value;
+            }
+        }
+
+        private void SetMinute(int value)
+        {
+            if (value == 60)
+            {
+                Minute = 0;
+                var hour = Hour + 1;
+                SetHour(hour);
+            }
+            else
+            {
+                Minute = value;
+            }
+        }
+
+        private void SetHour(int value)
+        {
+            if (value == 24)
+            {
+                Hour = 0;
+            }
+        }
+
+        internal event EventHandler TimeChanged
+        {
+            add { _timeChanged += value; }
+            remove { _timeChanged -= value; }
+        }
+
+        private void OnTimeChanged()
+        {
+            if (_timeChanged != null)
+            {
+                _timeChanged(this, EventArgs.Empty);
+            }
+        }
+
+        private int _hour;
+        /// <summary>
+        /// Hour between 0 and 23
+        /// </summary>
+        public int Hour 
+        {
+            get
+            {
+                return _hour;
+            }
+            set
+            {
+                if (value < 0)
+                {
+                    throw new InvalidOperationException("Value for hour cannot be negative");
+                }
+                if (value > 23)
+                {
+                    throw new InvalidOperationException("Value for hour cannot be greater than 23");
+                }
+                _hour = value;
+                OnTimeChanged();
+            }
+        }
+
+        private int _minute;
+        /// <summary>
+        /// Minute between 0 and 59
+        /// </summary>
+        public int Minute
+        {
+            get
+            {
+                return _minute;
+            }
+            set
+            {
+                if (value < 0)
+                {
+                    throw new InvalidOperationException("Value for minute cannot be negative");
+                }
+                if (value > 59)
+                {
+                    throw new InvalidOperationException("Value for minute cannot be greater than 59");
+                }
+                _minute = value;
+                OnTimeChanged();
+            }
+        }
+
+        private int? _second;
+        /// <summary>
+        /// Second between 0 and 59
+        /// </summary>
+        public int? Second
+        {
+            get
+            {
+                return _second;
+            }
+            set
+            {
+                if (value < 0)
+                {
+                    throw new InvalidOperationException("Value for second cannot be negative");
+                }
+                if (value > 59)
+                {
+                    throw new InvalidOperationException("Value for second cannot be greater than 59");
+                }
+                _second = value;
+                OnTimeChanged();
+            }
+        }
+
+        private decimal Round(decimal value)
+        {
+            return Math.Round(value, NumberOfDecimals);
+        }
+
+        private decimal ToSeconds()
+        {
+            var result = Hour * SecondsPerHour;
+            result += Minute * SecondsPerMinute;
+            result += Second ?? 0;
+            return (decimal)result;
+        }
+
+        /// <summary>
+        /// Returns the excel decimal representation of a time.
+        /// </summary>
+        /// <returns></returns>
+        public decimal ToExcelTime()
+        {
+            var seconds = ToSeconds();
+            return Round(seconds / (decimal)SecondsPerDay);
+        }
+
+        /// <summary>
+        /// Returns the excel decimal representation of a time as a string.
+        /// </summary>
+        /// <returns></returns>
+        public string ToExcelString()
+        {
+            return ToExcelTime().ToString(CultureInfo.InvariantCulture);
+        }
+
+        public override string ToString()
+        {
+            var second = Second ?? 0;
+            return string.Format("{0}:{1}:{2}",
+                Hour < 10 ? "0" + Hour.ToString() : Hour.ToString(),
+                Minute < 10 ? "0" + Minute.ToString() : Minute.ToString(),
+                second < 10 ? "0" + second.ToString() : second.ToString());
+        }
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormula.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormula.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormula.cs	(revision 9616)
@@ -0,0 +1,46 @@
+﻿/* 
+ * You may amend and distribute as you like, but don't remove this header!
+ * 
+ * EPPlus provides server-side generation of Excel 2007 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ * 
+ * All rights reserved.
+ * 
+ * EPPlus is an Open Source project provided under the 
+ * GNU General Public License (GPL) as published by the 
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * 
+ * The GNU General Public License can be viewed at http://www.opensource.org/licenses/gpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ * 
+ * The code for this project may be used and redistributed by any means PROVIDING it is 
+ * not sold for profit without the author's written consent, and providing that this notice 
+ * and the author's name and all copyright notices remain intact.
+ * 
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ *  Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation.Formulas.Contracts
+{
+    /// <summary>
+    /// Interface for a data validation formula
+    /// </summary>
+    public interface IExcelDataValidationFormula
+    {
+        /// <summary>
+        /// An excel formula
+        /// </summary>
+        string ExcelFormula { get; set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaDateTime.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaDateTime.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaDateTime.cs	(revision 9616)
@@ -0,0 +1,42 @@
+﻿/* 
+ * You may amend and distribute as you like, but don't remove this header!
+ * 
+ * EPPlus provides server-side generation of Excel 2007 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ * 
+ * All rights reserved.
+ * 
+ * EPPlus is an Open Source project provided under the 
+ * GNU General Public License (GPL) as published by the 
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * 
+ * The GNU General Public License can be viewed at http://www.opensource.org/licenses/gpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ * 
+ * The code for this project may be used and redistributed by any means PROVIDING it is 
+ * not sold for profit without the author's written consent, and providing that this notice 
+ * and the author's name and all copyright notices remain intact.
+ * 
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ *  Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation.Formulas.Contracts
+{
+    /// <summary>
+    /// Validation formula interface for <see cref="DateTime"/>
+    /// </summary>
+    public interface IExcelDataValidationFormulaDateTime : IExcelDataValidationFormulaWithValue<DateTime?>
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaDecimal.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaDecimal.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaDecimal.cs	(revision 9616)
@@ -0,0 +1,42 @@
+﻿/* 
+ * You may amend and distribute as you like, but don't remove this header!
+ * 
+ * EPPlus provides server-side generation of Excel 2007 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ * 
+ * All rights reserved.
+ * 
+ * EPPlus is an Open Source project provided under the 
+ * GNU General Public License (GPL) as published by the 
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * 
+ * The GNU General Public License can be viewed at http://www.opensource.org/licenses/gpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ * 
+ * The code for this project may be used and redistributed by any means PROVIDING it is 
+ * not sold for profit without the author's written consent, and providing that this notice 
+ * and the author's name and all copyright notices remain intact.
+ * 
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ *  Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation.Formulas.Contracts
+{
+    /// <summary>
+    /// Interface for a data validation formula of <see cref="System.Single">float</see> value
+    /// </summary>
+    public interface IExcelDataValidationFormulaDecimal : IExcelDataValidationFormulaWithValue<double?>
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaInt.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaInt.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaInt.cs	(revision 9616)
@@ -0,0 +1,42 @@
+﻿/* 
+ * You may amend and distribute as you like, but don't remove this header!
+ * 
+ * EPPlus provides server-side generation of Excel 2007 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ * 
+ * All rights reserved.
+ * 
+ * EPPlus is an Open Source project provided under the 
+ * GNU General Public License (GPL) as published by the 
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * 
+ * The GNU General Public License can be viewed at http://www.opensource.org/licenses/gpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ * 
+ * The code for this project may be used and redistributed by any means PROVIDING it is 
+ * not sold for profit without the author's written consent, and providing that this notice 
+ * and the author's name and all copyright notices remain intact.
+ * 
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ *  Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation.Formulas.Contracts
+{
+    /// <summary>
+    /// Interface for a data validation formula of <see cref="System.Int32"/> value
+    /// </summary>
+    public interface IExcelDataValidationFormulaInt : IExcelDataValidationFormulaWithValue<int?>
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaList.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaList.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaList.cs	(revision 9616)
@@ -0,0 +1,46 @@
+﻿/* 
+ * You may amend and distribute as you like, but don't remove this header!
+ * 
+ * EPPlus provides server-side generation of Excel 2007 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ * 
+ * All rights reserved.
+ * 
+ * EPPlus is an Open Source project provided under the 
+ * GNU General Public License (GPL) as published by the 
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * 
+ * The GNU General Public License can be viewed at http://www.opensource.org/licenses/gpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ * 
+ * The code for this project may be used and redistributed by any means PROVIDING it is 
+ * not sold for profit without the author's written consent, and providing that this notice 
+ * and the author's name and all copyright notices remain intact.
+ * 
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ *  Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation.Formulas.Contracts
+{
+    /// <summary>
+    /// Interface for a data validation of list type
+    /// </summary>
+    public interface IExcelDataValidationFormulaList : IExcelDataValidationFormula
+    {
+        /// <summary>
+        /// A list of value strings.
+        /// </summary>
+        IList<string> Values { get; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaTime.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaTime.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaTime.cs	(revision 9616)
@@ -0,0 +1,40 @@
+﻿/* 
+ * You may amend and distribute as you like, but don't remove this header!
+ * 
+ * EPPlus provides server-side generation of Excel 2007 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ * 
+ * All rights reserved.
+ * 
+ * EPPlus is an Open Source project provided under the 
+ * GNU General Public License (GPL) as published by the 
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * 
+ * The GNU General Public License can be viewed at http://www.opensource.org/licenses/gpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ * 
+ * The code for this project may be used and redistributed by any means PROVIDING it is 
+ * not sold for profit without the author's written consent, and providing that this notice 
+ * and the author's name and all copyright notices remain intact.
+ * 
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ *  Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation;
+
+namespace OfficeOpenXml.DataValidation.Formulas.Contracts
+{
+    public interface IExcelDataValidationFormulaTime : IExcelDataValidationFormulaWithValue<ExcelTime>
+    {
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaWithValue.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaWithValue.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/Contracts/IExcelDataValidationFormulaWithValue.cs	(revision 9616)
@@ -0,0 +1,47 @@
+﻿/* 
+ * You may amend and distribute as you like, but don't remove this header!
+ * 
+ * EPPlus provides server-side generation of Excel 2007 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ * 
+ * All rights reserved.
+ * 
+ * EPPlus is an Open Source project provided under the 
+ * GNU General Public License (GPL) as published by the 
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * 
+ * The GNU General Public License can be viewed at http://www.opensource.org/licenses/gpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ * 
+ * The code for this project may be used and redistributed by any means PROVIDING it is 
+ * not sold for profit without the author's written consent, and providing that this notice 
+ * and the author's name and all copyright notices remain intact.
+ * 
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ *  Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.DataValidation.Formulas.Contracts
+{
+    /// <summary>
+    /// Interface for a formula with a value
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    public interface IExcelDataValidationFormulaWithValue<T> : IExcelDataValidationFormula
+    {
+        /// <summary>
+        /// The value.
+        /// </summary>
+        T Value { get; set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormula.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormula.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormula.cs	(revision 9616)
@@ -0,0 +1,138 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Utils;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+
+namespace OfficeOpenXml.DataValidation.Formulas
+{
+    /// <summary>
+    /// Enumeration representing the state of an <see cref="ExcelDataValidationFormulaValue{T}"/>
+    /// </summary>
+    internal enum FormulaState
+    {
+        /// <summary>
+        /// Value is set
+        /// </summary>
+        Value,
+        /// <summary>
+        /// Formula is set
+        /// </summary>
+        Formula
+    }
+
+    /// <summary>
+    /// Base class for a formula
+    /// </summary>
+    internal abstract class ExcelDataValidationFormula : XmlHelper
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="namespaceManager">Namespacemanger of the worksheet</param>
+        /// <param name="topNode">validation top node</param>
+        /// <param name="formulaPath">xml path of the current formula</param>
+        public ExcelDataValidationFormula(XmlNamespaceManager namespaceManager, XmlNode topNode, string formulaPath)
+            : base(namespaceManager, topNode)
+        {
+            Require.Argument(formulaPath).IsNotNullOrEmpty("formulaPath");
+            FormulaPath = formulaPath;
+        }
+
+        private string _formula;
+
+        protected string FormulaPath
+        {
+            get;
+            private set;
+        }
+
+        /// <summary>
+        /// State of the validationformula, i.e. tells if value or formula is set
+        /// </summary>
+        protected FormulaState State
+        {
+            get;
+            set;
+        }
+
+        /// <summary>
+        /// A formula which output must match the current validation type
+        /// </summary>
+        public string ExcelFormula
+        {
+            get
+            {
+                return _formula;
+            }
+            set
+            {
+                if (!string.IsNullOrEmpty(value))
+                {
+                    ResetValue();
+                    State = FormulaState.Formula;
+                }
+                if (value != null && value.Length > 255)
+                {
+                    throw new InvalidOperationException("The length of a DataValidation formula cannot exceed 255 characters");
+                }
+                //var val = SqRefUtility.ToSqRefAddress(value);
+                _formula = value;
+                SetXmlNodeString(FormulaPath, value);
+            }
+        }
+
+        internal abstract void ResetValue();
+
+        /// <summary>
+        /// This value will be stored in the xml. Can be overridden by subclasses
+        /// </summary>
+        internal virtual string GetXmlValue()
+        {
+            if (State == FormulaState.Formula)
+            {
+                return ExcelFormula;
+            }
+            return GetValueAsString();
+        }
+
+        /// <summary>
+        /// Returns the value as a string. Must be implemented by subclasses
+        /// </summary>
+        /// <returns></returns>
+        protected abstract string GetValueAsString();
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaCustom.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaCustom.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaCustom.cs	(revision 9616)
@@ -0,0 +1,72 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using System.Xml;
+
+namespace OfficeOpenXml.DataValidation.Formulas
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    internal class ExcelDataValidationFormulaCustom : ExcelDataValidationFormula, IExcelDataValidationFormula
+    {
+        public ExcelDataValidationFormulaCustom(XmlNamespaceManager namespaceManager, XmlNode topNode, string formulaPath)
+            : base(namespaceManager, topNode, formulaPath)
+        {
+            var value = GetXmlNodeString(formulaPath);
+            if (!string.IsNullOrEmpty(value))
+            {
+                ExcelFormula = value;
+            }
+            State = FormulaState.Formula;
+        }
+
+        internal override string GetXmlValue()
+        {
+            return ExcelFormula;
+        }
+
+        protected override string GetValueAsString()
+        {
+            return ExcelFormula;
+        }
+
+        internal override void ResetValue()
+        {
+            ExcelFormula = null;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaDateTime.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaDateTime.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaDateTime.cs	(revision 9616)
@@ -0,0 +1,68 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using System.Globalization;
+
+namespace OfficeOpenXml.DataValidation.Formulas
+{
+    internal class ExcelDataValidationFormulaDateTime : ExcelDataValidationFormulaValue<DateTime?>, IExcelDataValidationFormulaDateTime
+    {
+        public ExcelDataValidationFormulaDateTime(XmlNamespaceManager namespaceManager, XmlNode topNode, string formulaPath)
+            : base(namespaceManager, topNode, formulaPath)
+        {
+            var value = GetXmlNodeString(formulaPath);
+            if (!string.IsNullOrEmpty(value))
+            {
+                double oADate = default(double);
+                if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out oADate))
+                {
+                    Value = DateTime.FromOADate(oADate);
+                }
+                else
+                {
+                    ExcelFormula = value;
+                }
+            }
+        }
+
+        protected override string GetValueAsString()
+        {
+            return Value.HasValue ? Value.Value.ToOADate().ToString(CultureInfo.InvariantCulture) : string.Empty;
+        }
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaDecimal.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaDecimal.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaDecimal.cs	(revision 9616)
@@ -0,0 +1,70 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using System.Globalization;
+
+namespace OfficeOpenXml.DataValidation.Formulas
+{
+    /// <summary>
+    /// 
+    /// </summary>
+    internal class ExcelDataValidationFormulaDecimal : ExcelDataValidationFormulaValue<double?>, IExcelDataValidationFormulaDecimal
+    {
+        public ExcelDataValidationFormulaDecimal(XmlNamespaceManager namespaceManager, XmlNode topNode, string formulaPath)
+            : base(namespaceManager, topNode, formulaPath)
+        {
+            var value = GetXmlNodeString(formulaPath);
+            if (!string.IsNullOrEmpty(value))
+            {
+                double dValue = default(double);
+                if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out dValue))
+                {
+                    Value = dValue;
+                }
+                else
+                {
+                    ExcelFormula = value;
+                }
+            }
+        }
+
+        protected override string GetValueAsString()
+        {
+            return Value.HasValue ? Value.Value.ToString("g15", CultureInfo.InvariantCulture) : string.Empty;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaInt.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaInt.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaInt.cs	(revision 9616)
@@ -0,0 +1,67 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using System.Globalization;
+
+namespace OfficeOpenXml.DataValidation.Formulas
+{
+    internal class ExcelDataValidationFormulaInt : ExcelDataValidationFormulaValue<int?>, IExcelDataValidationFormulaInt
+    {
+        public ExcelDataValidationFormulaInt(XmlNamespaceManager namespaceManager, XmlNode topNode, string formulaPath)
+            : base(namespaceManager, topNode, formulaPath)
+        {
+            var value = GetXmlNodeString(formulaPath);
+            if (!string.IsNullOrEmpty(value))
+            {
+                int intValue = default(int);
+                if (int.TryParse(value, out intValue))
+                {
+                    Value = intValue;
+                }
+                else
+                {
+                    ExcelFormula = value;
+                }
+            }
+        }
+
+        protected override string GetValueAsString()
+        {
+            return Value.HasValue ? Value.Value.ToString() : string.Empty;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaList.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaList.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaList.cs	(revision 9616)
@@ -0,0 +1,242 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Utils;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using System.Text.RegularExpressions;
+using System.Collections;
+
+namespace OfficeOpenXml.DataValidation.Formulas
+{
+    internal class ExcelDataValidationFormulaList : ExcelDataValidationFormula, IExcelDataValidationFormulaList
+    {
+        #region class DataValidationList
+        private class DataValidationList : IList<string>, ICollection
+        {
+            private IList<string> _items = new List<string>();
+            private EventHandler<EventArgs> _listChanged;
+
+            public event EventHandler<EventArgs> ListChanged
+            {
+                add { _listChanged += value; }
+                remove { _listChanged -= value; }
+            }
+
+            private void OnListChanged()
+            {
+                if (_listChanged != null)
+                {
+                    _listChanged(this, EventArgs.Empty);
+                }
+            }
+
+            #region IList members
+            int IList<string>.IndexOf(string item)
+            {
+                return _items.IndexOf(item);
+            }
+
+            void IList<string>.Insert(int index, string item)
+            {
+                _items.Insert(index, item);
+                OnListChanged();
+            }
+
+            void IList<string>.RemoveAt(int index)
+            {
+                _items.RemoveAt(index);
+                OnListChanged();
+            }
+
+            string IList<string>.this[int index]
+            {
+                get
+                {
+                    return _items[index];
+                }
+                set
+                {
+                    _items[index] = value;
+                    OnListChanged();
+                }
+            }
+
+            void ICollection<string>.Add(string item)
+            {
+                _items.Add(item);
+                OnListChanged();
+            }
+
+            void ICollection<string>.Clear()
+            {
+                _items.Clear();
+                OnListChanged();
+            }
+
+            bool ICollection<string>.Contains(string item)
+            {
+                return _items.Contains(item);
+            }
+
+            void ICollection<string>.CopyTo(string[] array, int arrayIndex)
+            {
+                _items.CopyTo(array, arrayIndex);
+            }
+
+            int ICollection<string>.Count
+            {
+                get { return _items.Count; }
+            }
+
+            bool ICollection<string>.IsReadOnly
+            {
+                get { return false; }
+            }
+
+            bool ICollection<string>.Remove(string item)
+            {
+                var retVal = _items.Remove(item);
+                OnListChanged();
+                return retVal;
+            }
+
+            IEnumerator<string> IEnumerable<string>.GetEnumerator()
+            {
+                return _items.GetEnumerator();
+            }
+
+            System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+            {
+                return _items.GetEnumerator();
+            }
+            #endregion
+
+            public void CopyTo(Array array, int index)
+            {
+                _items.CopyTo((string[])array, index);
+            }
+
+            int ICollection.Count
+            {
+                get { return _items.Count; }
+            }
+
+            public bool IsSynchronized
+            {
+                get { return ((ICollection)_items).IsSynchronized; }
+            }
+
+            public object SyncRoot
+            {
+                get { return ((ICollection)_items).SyncRoot; }
+            }
+        }
+        #endregion
+
+        public ExcelDataValidationFormulaList(XmlNamespaceManager namespaceManager, XmlNode itemNode, string formulaPath)
+            : base(namespaceManager, itemNode, formulaPath)
+        {
+            Require.Argument(formulaPath).IsNotNullOrEmpty("formulaPath");
+            _formulaPath = formulaPath;
+            var values = new DataValidationList();
+            values.ListChanged += new EventHandler<EventArgs>(values_ListChanged);
+            Values = values;
+            SetInitialValues();
+        }
+
+        private string _formulaPath;
+
+        private void SetInitialValues()
+        {
+            var @value = GetXmlNodeString(_formulaPath);
+            if (!string.IsNullOrEmpty(@value))
+            {
+                if (@value.StartsWith("\"") && @value.EndsWith("\""))
+                {
+                    @value = @value.TrimStart('"').TrimEnd('"');
+                    var items = @value.Split(new char[]{','}, StringSplitOptions.RemoveEmptyEntries);
+                    foreach (var item in items)
+                    {
+                        Values.Add(item);
+                    }
+                }
+                else
+                {
+                    ExcelFormula = @value;
+                }
+            }
+        }
+
+        void values_ListChanged(object sender, EventArgs e)
+        {
+            if (Values.Count > 0)
+            {
+                State = FormulaState.Value;
+            }
+            SetXmlNodeString(_formulaPath, GetValueAsString());
+        }
+
+        public IList<string> Values
+        {
+            get;
+            private set;
+        }
+
+        protected override string  GetValueAsString()
+        {
+            var sb = new StringBuilder();
+            foreach (var val in Values)
+            {
+                if (sb.Length == 0)
+                {
+                    sb.Append("\"");
+                    sb.Append(val);
+                }
+                else
+                {
+                    sb.AppendFormat(", {0}", val);
+                }
+            }
+            sb.Append("\"");
+            return sb.ToString();
+        }
+
+        internal override void ResetValue()
+        {
+            Values.Clear();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaTime.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaTime.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaTime.cs	(revision 9616)
@@ -0,0 +1,88 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Formulas.Contracts;
+using OfficeOpenXml.DataValidation;
+using System.Xml;
+using System.Globalization;
+
+namespace OfficeOpenXml.DataValidation.Formulas
+{
+    internal class ExcelDataValidationFormulaTime : ExcelDataValidationFormulaValue<ExcelTime>, IExcelDataValidationFormulaTime
+    {
+        public ExcelDataValidationFormulaTime(XmlNamespaceManager namespaceManager, XmlNode topNode, string formulaPath)
+            : base(namespaceManager, topNode, formulaPath)
+        {
+            var value = GetXmlNodeString(formulaPath);
+            if (!string.IsNullOrEmpty(value))
+            {
+                decimal time = default(decimal);
+                if (decimal.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out time))
+                {
+                    Value = new ExcelTime(time);
+                }
+                else
+                {
+                    Value = new ExcelTime();
+                    ExcelFormula = value;
+                }
+            }
+            else
+            {
+                Value = new ExcelTime();
+            }
+            Value.TimeChanged += new EventHandler(Value_TimeChanged);
+        }
+
+        void Value_TimeChanged(object sender, EventArgs e)
+        {
+            SetXmlNodeString(FormulaPath, Value.ToExcelString());
+        }
+
+        protected override string GetValueAsString()
+        {
+            if (State == FormulaState.Value)
+            {
+                return Value.ToExcelString();
+            }
+            return string.Empty;
+        }
+
+        internal override void ResetValue()
+        {
+            Value = new ExcelTime();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaValue.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaValue.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/Formulas/ExcelDataValidationFormulaValue.cs	(revision 9616)
@@ -0,0 +1,84 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-08
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.Utils;
+using System.Xml;
+
+namespace OfficeOpenXml.DataValidation.Formulas
+{
+
+    /// <summary>
+    /// This class represents a validation formula. Its value can be specified as a value of the specified datatype or as a formula.
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    internal abstract class ExcelDataValidationFormulaValue<T> : ExcelDataValidationFormula
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="namespaceManager">Namespacemanger of the worksheet</param>
+        /// <param name="topNode">validation top node</param>
+        /// <param name="formulaPath">xml path of the current formula</param>
+        public ExcelDataValidationFormulaValue(XmlNamespaceManager namespaceManager, XmlNode topNode, string formulaPath)
+            : base(namespaceManager, topNode, formulaPath)
+        {
+
+        }
+
+        private T _value;
+        /// <summary>
+        /// Typed value
+        /// </summary>
+        public T Value 
+        {
+            get
+            {
+                return _value;
+            }
+            set
+            {
+                State = FormulaState.Value;
+                _value = value;
+                SetXmlNodeString(FormulaPath, GetValueAsString());
+            }
+        }
+
+        internal override void ResetValue()
+        {
+            Value = default(T);
+        }
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/IRangeDataValidation.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/IRangeDataValidation.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/IRangeDataValidation.cs	(revision 9616)
@@ -0,0 +1,80 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-03-23
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.DataValidation.Contracts;
+
+namespace OfficeOpenXml.DataValidation
+{
+    /// <summary>
+    /// Provides functionality for adding datavalidation to a range (<see cref="ExcelRangeBase"/>). Each method will
+    /// return a configurable validation.
+    /// </summary>
+    public interface IRangeDataValidation
+    {
+        /// <summary>
+        /// Adds a <see cref="IExcelDataValidationInt"/> to the range
+        /// </summary>
+        /// <returns>A <see cref="ExcelDataValidationInt"/> that can be configured for integer data validation</returns>
+        IExcelDataValidationInt AddIntegerDataValidation();
+        /// <summary>
+        /// Adds a <see cref="ExcelDataValidationDecimal"/> to the range
+        /// </summary>
+        /// <returns>A <see cref="ExcelDataValidationDecimal"/> that can be configured for decimal data validation</returns>
+        IExcelDataValidationDecimal AddDecimalDataValidation();
+        /// <summary>
+        /// Adds a <see cref="ExcelDataValidationDateTime"/> to the range
+        /// </summary>
+        /// <returns>A <see cref="ExcelDataValidationDecimal"/> that can be configured for datetime data validation</returns>
+        IExcelDataValidationDateTime AddDateTimeDataValidation();
+        /// <summary>
+        /// Adds a <see cref="IExcelDataValidationList"/> to the range
+        /// </summary>
+        /// <returns>A <see cref="ExcelDataValidationList"/> that can be configured for datetime data validation</returns>
+        IExcelDataValidationList AddListDataValidation();
+        /// <summary>
+        /// Adds a <see cref="IExcelDataValidationInt"/> regarding text length validation to the range.
+        /// </summary>
+        /// <returns></returns>
+        IExcelDataValidationInt AddTextLengthDataValidation();
+        /// <summary>
+        /// Adds a <see cref="IExcelDataValidationTime"/> to the range.
+        /// </summary>
+        /// <returns>A <see cref="IExcelDataValidationTime"/> that can be configured for time data validation</returns>
+        IExcelDataValidationTime AddTimeDataValidation();
+        /// <summary>
+        /// Adds a <see cref="IExcelDataValidationCustom"/> to the range.
+        /// </summary>
+        /// <returns>A <see cref="IExcelDataValidationCustom"/> that can be configured for custom validation</returns>
+        IExcelDataValidationCustom AddCustomDataValidation();
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/RangeDataValidation.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/RangeDataValidation.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/DataValidation/RangeDataValidation.cs	(revision 9616)
@@ -0,0 +1,89 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-03-23
+ * Jan Källman		                License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using OfficeOpenXml.Utils;
+using OfficeOpenXml.DataValidation.Contracts;
+
+namespace OfficeOpenXml.DataValidation
+{
+    internal class RangeDataValidation : IRangeDataValidation
+    {
+        public RangeDataValidation(ExcelWorksheet worksheet, string address)
+        {
+            Require.Argument(worksheet).IsNotNull("worksheet");
+            Require.Argument(address).IsNotNullOrEmpty("address");
+            _worksheet = worksheet;
+            _address = address;
+        }
+
+        ExcelWorksheet _worksheet;
+        string _address;
+
+        public IExcelDataValidationInt AddIntegerDataValidation()
+        {
+            return _worksheet.DataValidations.AddIntegerValidation(_address);
+        }
+
+        public IExcelDataValidationDecimal AddDecimalDataValidation()
+        {
+            return _worksheet.DataValidations.AddDecimalValidation(_address);
+        }
+
+        public IExcelDataValidationDateTime AddDateTimeDataValidation()
+        {
+            return _worksheet.DataValidations.AddDateTimeValidation(_address);
+        }
+
+        public IExcelDataValidationList AddListDataValidation()
+        {
+            return _worksheet.DataValidations.AddListValidation(_address);
+        }
+
+        public IExcelDataValidationInt AddTextLengthDataValidation()
+        {
+            return _worksheet.DataValidations.AddTextLengthValidation(_address);
+        }
+
+        public IExcelDataValidationTime AddTimeDataValidation()
+        {
+            return _worksheet.DataValidations.AddTimeValidation(_address);
+        }
+
+        public IExcelDataValidationCustom AddCustomDataValidation()
+        {
+            return _worksheet.DataValidations.AddCustomValidation(_address);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelBarChart.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelBarChart.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelBarChart.cs	(revision 9616)
@@ -0,0 +1,493 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Table.PivotTable;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Bar chart
+    /// </summary>
+    public sealed class ExcelBarChart : ExcelChart
+    {
+        #region "Constructors"
+        //internal ExcelBarChart(ExcelDrawings drawings, XmlNode node) :
+        //    base(drawings, node/*, 1*/)
+        //{
+        //    SetChartNodeText("");
+        //}
+        //internal ExcelBarChart(ExcelDrawings drawings, XmlNode node, eChartType type) :
+        //    base(drawings, node, type)
+        //{
+        //    SetChartNodeText("");
+
+        //    SetTypeProperties(drawings, type);
+        //}
+        internal ExcelBarChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) :
+            base(drawings, node, type, topChart, PivotTableSource)
+        {
+            SetChartNodeText("");
+
+            SetTypeProperties(drawings, type);
+        }
+
+        internal ExcelBarChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, System.IO.Packaging.PackagePart part, XmlDocument chartXml, XmlNode chartNode) :
+           base(drawings, node, uriChart, part, chartXml, chartNode)
+        {
+            SetChartNodeText(chartNode.Name);
+        }
+
+        internal ExcelBarChart(ExcelChart topChart, XmlNode chartNode) : 
+            base(topChart, chartNode)
+        {
+            SetChartNodeText(chartNode.Name);
+        }
+        #endregion
+        #region "Private functions"
+        //string _chartTopPath="c:chartSpace/c:chart/c:plotArea/{0}";
+        private void SetChartNodeText(string chartNodeText)
+        {
+            if(string.IsNullOrEmpty(chartNodeText))
+            {
+                chartNodeText = GetChartNodeText();
+            }
+            //_chartTopPath = string.Format(_chartTopPath, chartNodeText);
+            //_directionPath = string.Format(_directionPath, _chartTopPath);
+            //_shapePath = string.Format(_shapePath, _chartTopPath);
+        }
+        private void SetTypeProperties(ExcelDrawings drawings, eChartType type)
+        {
+            /******* Bar direction *******/
+            if (type == eChartType.BarClustered ||
+                type == eChartType.BarStacked ||
+                type == eChartType.BarStacked100 ||
+                type == eChartType.BarClustered3D ||
+                type == eChartType.BarStacked3D ||
+                type == eChartType.BarStacked1003D ||
+                type == eChartType.ConeBarClustered ||
+                type == eChartType.ConeBarStacked ||
+                type == eChartType.ConeBarStacked100 ||
+                type == eChartType.CylinderBarClustered ||
+                type == eChartType.CylinderBarStacked ||
+                type == eChartType.CylinderBarStacked100 ||
+                type == eChartType.PyramidBarClustered ||
+                type == eChartType.PyramidBarStacked ||
+                type == eChartType.PyramidBarStacked100)
+            {
+                Direction = eDirection.Bar;
+            }
+            else if (
+                type == eChartType.ColumnClustered ||
+                type == eChartType.ColumnStacked ||
+                type == eChartType.ColumnStacked100 ||
+                type == eChartType.Column3D ||
+                type == eChartType.ColumnClustered3D ||
+                type == eChartType.ColumnStacked3D ||
+                type == eChartType.ColumnStacked1003D ||
+                type == eChartType.ConeCol ||
+                type == eChartType.ConeColClustered ||
+                type == eChartType.ConeColStacked ||
+                type == eChartType.ConeColStacked100 ||
+                type == eChartType.CylinderCol ||
+                type == eChartType.CylinderColClustered ||
+                type == eChartType.CylinderColStacked ||
+                type == eChartType.CylinderColStacked100 ||
+                type == eChartType.PyramidCol ||
+                type == eChartType.PyramidColClustered ||
+                type == eChartType.PyramidColStacked ||
+                type == eChartType.PyramidColStacked100)
+            {
+                Direction = eDirection.Column;
+            }
+
+            /****** Shape ******/
+            if (/*type == eChartType.ColumnClustered ||
+                type == eChartType.ColumnStacked ||
+                type == eChartType.ColumnStacked100 ||*/
+                type == eChartType.Column3D ||
+                type == eChartType.ColumnClustered3D ||
+                type == eChartType.ColumnStacked3D ||
+                type == eChartType.ColumnStacked1003D ||
+                /*type == eChartType.BarClustered ||
+                type == eChartType.BarStacked ||
+                type == eChartType.BarStacked100 ||*/
+                type == eChartType.BarClustered3D ||
+                type == eChartType.BarStacked3D ||
+                type == eChartType.BarStacked1003D)
+            {
+                Shape = eShape.Box;
+            }
+            else if (
+                type == eChartType.CylinderBarClustered ||
+                type == eChartType.CylinderBarStacked ||
+                type == eChartType.CylinderBarStacked100 ||
+                type == eChartType.CylinderCol ||
+                type == eChartType.CylinderColClustered ||
+                type == eChartType.CylinderColStacked ||
+                type == eChartType.CylinderColStacked100)
+            {
+                Shape = eShape.Cylinder;
+            }
+            else if (
+                type == eChartType.ConeBarClustered ||
+                type == eChartType.ConeBarStacked ||
+                type == eChartType.ConeBarStacked100 ||
+                type == eChartType.ConeCol ||
+                type == eChartType.ConeColClustered ||
+                type == eChartType.ConeColStacked ||
+                type == eChartType.ConeColStacked100)
+            {
+                Shape = eShape.Cone;
+            }
+            else if (
+                type == eChartType.PyramidBarClustered ||
+                type == eChartType.PyramidBarStacked ||
+                type == eChartType.PyramidBarStacked100 ||
+                type == eChartType.PyramidCol ||
+                type == eChartType.PyramidColClustered ||
+                type == eChartType.PyramidColStacked ||
+                type == eChartType.PyramidColStacked100)
+            {
+                Shape = eShape.Pyramid;
+            }
+        }
+        #endregion
+        #region "Properties"
+        string _directionPath = "c:barDir/@val";
+        /// <summary>
+        /// Direction, Bar or columns
+        /// </summary>
+        public eDirection Direction
+        {
+            get
+            {
+                return GetDirectionEnum(_chartXmlHelper.GetXmlNodeString(_directionPath));
+            }
+            internal set
+            {
+                _chartXmlHelper.SetXmlNodeString(_directionPath, GetDirectionText(value));
+            }
+        }
+        string _shapePath = "c:shape/@val";
+        /// <summary>
+        /// The shape of the bar/columns
+        /// </summary>
+        public eShape Shape
+        {
+            get
+            {
+                return GetShapeEnum(_chartXmlHelper.GetXmlNodeString(_shapePath));
+            }
+            internal set
+            {
+                _chartXmlHelper.SetXmlNodeString(_shapePath, GetShapeText(value));
+            }
+        }
+        ExcelChartDataLabel _DataLabel = null;
+        /// <summary>
+        /// Access to datalabel properties
+        /// </summary>
+        public ExcelChartDataLabel DataLabel
+        {
+            get
+            {
+                if (_DataLabel == null)
+                {
+                    _DataLabel = new ExcelChartDataLabel(NameSpaceManager, ChartNode);
+                }
+                return _DataLabel;
+            }
+        }
+        #endregion
+        #region "Direction Enum Traslation"
+        private string GetDirectionText(eDirection direction)
+        {
+            switch (direction)
+            {
+                case eDirection.Bar:
+                    return "bar";
+                default:
+                    return "col";
+            }
+        }
+
+        private eDirection GetDirectionEnum(string direction)
+        {
+            switch (direction)
+            {
+                case "bar":
+                    return eDirection.Bar;
+                default:
+                    return eDirection.Column;
+            }
+        }
+        #endregion
+        #region "Shape Enum Translation"
+        private string GetShapeText(eShape Shape)
+        {
+            switch (Shape)
+            {
+                case eShape.Box:
+                    return "box";
+                case eShape.Cone:
+                    return "cone";
+                case eShape.ConeToMax:
+                    return "coneToMax";
+                case eShape.Cylinder:
+                    return "cylinder";
+                case eShape.Pyramid:
+                    return "pyramid";
+                case eShape.PyramidToMax:
+                    return "pyramidToMax";
+                default:
+                    return "box";
+            }
+        }
+
+        private eShape GetShapeEnum(string text)
+        {
+            switch (text)
+            {
+                case "box":
+                    return eShape.Box;
+                case "cone":
+                    return eShape.Cone;
+                case "coneToMax":
+                    return eShape.ConeToMax;
+                case "cylinder":
+                    return eShape.Cylinder;
+                case "pyramid":
+                    return eShape.Pyramid;
+                case "pyramidToMax":
+                    return eShape.PyramidToMax;
+                default:
+                    return eShape.Box;
+            }
+        }
+        #endregion
+        internal override eChartType GetChartType(string name)
+        {
+            if (name == "barChart")
+            {
+                if (this.Direction == eDirection.Bar)
+                {
+                    if (Grouping == eGrouping.Stacked)
+                    {
+                        return eChartType.BarStacked;
+                    }
+                    else if (Grouping == eGrouping.PercentStacked)
+                    {
+                        return eChartType.BarStacked100;
+                    }
+                    else
+                    {
+                        return eChartType.BarClustered;
+                    }
+                }
+                else
+                {
+                    if (Grouping == eGrouping.Stacked)
+                    {
+                        return eChartType.ColumnStacked;
+                    }
+                    else if (Grouping == eGrouping.PercentStacked)
+                    {
+                        return eChartType.ColumnStacked100;
+                    }
+                    else
+                    {
+                        return eChartType.ColumnClustered;
+                    }
+                }
+            }
+            if (name == "bar3DChart")
+            {
+                #region "Bar Shape"
+                if (this.Shape==eShape.Box)
+                {
+                    if (this.Direction == eDirection.Bar)
+                    {
+                        if (Grouping == eGrouping.Stacked)
+                        {
+                            return eChartType.BarStacked3D;
+                        }
+                        else if (Grouping == eGrouping.PercentStacked)
+                        {
+                            return eChartType.BarStacked1003D;
+                        }
+                        else
+                        {
+                            return eChartType.BarClustered3D;
+                        }
+                    }
+                    else
+                    {
+                        if (Grouping == eGrouping.Stacked)
+                        {
+                            return eChartType.ColumnStacked3D;
+                        }
+                        else if (Grouping == eGrouping.PercentStacked)
+                        {
+                            return eChartType.ColumnStacked1003D;
+                        }
+                        else
+                        {
+                            return eChartType.ColumnClustered3D;
+                        }
+                    }
+                }
+                #endregion
+                #region "Cone Shape"
+                if (this.Shape == eShape.Cone || this.Shape == eShape.ConeToMax)
+                {
+                    if (this.Direction == eDirection.Bar)
+                    {
+                        if (Grouping == eGrouping.Stacked)
+                        {
+                            return eChartType.ConeBarStacked;
+                        }
+                        else if (Grouping == eGrouping.PercentStacked)
+                        {
+                            return eChartType.ConeBarStacked100;
+                        }
+                        else if (Grouping == eGrouping.Clustered)
+                        {
+                            return eChartType.ConeBarClustered;
+                        }
+                    }
+                    else
+                    {
+                        if (Grouping == eGrouping.Stacked)
+                        {
+                            return eChartType.ConeColStacked;
+                        }
+                        else if (Grouping == eGrouping.PercentStacked)
+                        {
+                            return eChartType.ConeColStacked100;
+                        }
+                        else if (Grouping == eGrouping.Clustered)
+                        {
+                            return eChartType.ConeColClustered;
+                        }
+                        else
+                        {
+                            return eChartType.ConeCol;
+                        }
+                    }
+                }
+                #endregion
+                #region "Cylinder Shape"
+                if (this.Shape == eShape.Cylinder)
+                {
+                    if (this.Direction == eDirection.Bar)
+                    {
+                        if (Grouping == eGrouping.Stacked)
+                        {
+                            return eChartType.CylinderBarStacked;
+                        }
+                        else if (Grouping == eGrouping.PercentStacked)
+                        {
+                            return eChartType.CylinderBarStacked100;
+                        }
+                        else if (Grouping == eGrouping.Clustered)
+                        {
+                            return eChartType.CylinderBarClustered;
+                        }
+                    }
+                    else
+                    {
+                        if (Grouping == eGrouping.Stacked)
+                        {
+                            return eChartType.CylinderColStacked;
+                        }
+                        else if (Grouping == eGrouping.PercentStacked)
+                        {
+                            return eChartType.CylinderColStacked100;
+                        }
+                        else if (Grouping == eGrouping.Clustered)
+                        {
+                            return eChartType.CylinderColClustered;
+                        }
+                        else
+                        {
+                            return eChartType.CylinderCol;
+                        }
+                    }
+                }
+                #endregion
+                #region "Pyramide Shape"
+                if (this.Shape == eShape.Pyramid || this.Shape == eShape.PyramidToMax)
+                {
+                    if (this.Direction == eDirection.Bar)
+                    {
+                        if (Grouping == eGrouping.Stacked)
+                        {
+                            return eChartType.PyramidBarStacked;
+                        }
+                        else if (Grouping == eGrouping.PercentStacked)
+                        {
+                            return eChartType.PyramidBarStacked100;
+                        }
+                        else if (Grouping == eGrouping.Clustered)
+                        {
+                            return eChartType.PyramidBarClustered;
+                        }
+                    }
+                    else
+                    {
+                        if (Grouping == eGrouping.Stacked)
+                        {
+                            return eChartType.PyramidColStacked;
+                        }
+                        else if (Grouping == eGrouping.PercentStacked)
+                        {
+                            return eChartType.PyramidColStacked100;
+                        }
+                        else if (Grouping == eGrouping.Clustered)
+                        {
+                            return eChartType.PyramidColClustered;
+                        }
+                        else
+                        {
+                            return eChartType.PyramidCol;
+                        }
+                    }
+                }
+                #endregion
+            }
+            return base.GetChartType(name);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChart.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChart.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChart.cs	(revision 9616)
@@ -0,0 +1,1804 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using System.IO;
+using OfficeOpenXml.Table.PivotTable;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    #region "Chart Enums"
+    /// <summary>
+    /// Chart type
+    /// </summary>
+    public enum eChartType
+    {
+        Area3D=-4098,
+        AreaStacked3D=78,
+        AreaStacked1003D=79,
+        BarClustered3D= 60,
+        BarStacked3D=61,
+        BarStacked1003D=62,
+        Column3D=-4100,
+        ColumnClustered3D=54,
+        ColumnStacked3D=55,
+        ColumnStacked1003D=56,
+        Line3D=-4101,
+        Pie3D=-4102,
+        PieExploded3D=70,
+        Area=1,
+        AreaStacked=76,
+        AreaStacked100=77,
+        BarClustered=57,
+        BarOfPie=71,
+        BarStacked=58,
+        BarStacked100=59,
+        Bubble=15,
+        Bubble3DEffect=87,
+        ColumnClustered=51,
+        ColumnStacked=52,
+        ColumnStacked100=53,
+        ConeBarClustered=102,
+        ConeBarStacked=103,
+        ConeBarStacked100=104,
+        ConeCol=105,
+        ConeColClustered=99,
+        ConeColStacked=100,
+        ConeColStacked100=101,
+        CylinderBarClustered=95,
+        CylinderBarStacked=96,
+        CylinderBarStacked100=97,
+        CylinderCol=98,
+        CylinderColClustered=92,
+        CylinderColStacked=93,
+        CylinderColStacked100=94,
+        Doughnut=-4120,
+        DoughnutExploded=80,
+        Line=4,
+        LineMarkers=65,
+        LineMarkersStacked=66,
+        LineMarkersStacked100=67,
+        LineStacked=63,
+        LineStacked100=64,
+        Pie=5,
+        PieExploded=69,
+        PieOfPie=68,
+        PyramidBarClustered=109,
+        PyramidBarStacked=110,
+        PyramidBarStacked100=111,
+        PyramidCol=112,
+        PyramidColClustered=106,
+        PyramidColStacked=107,
+        PyramidColStacked100=108,
+        Radar=-4151,
+        RadarFilled=82,
+        RadarMarkers=81,
+        StockHLC=88,
+        StockOHLC=89,
+        StockVHLC=90,
+        StockVOHLC=91,
+        Surface=83,
+        SurfaceTopView=85,
+        SurfaceTopViewWireframe=86,
+        SurfaceWireframe=84,
+        XYScatter=-4169,
+        XYScatterLines=74,
+        XYScatterLinesNoMarkers=75,
+        XYScatterSmooth=72,
+        XYScatterSmoothNoMarkers=73
+}
+    /// <summary>
+    /// Bar or column
+    /// </summary>
+    public enum eDirection
+    {
+        Column,
+        Bar
+    }
+    /// <summary>
+    /// How the series are grouped
+    /// </summary>
+    public enum eGrouping
+    {
+        Standard,
+        Clustered,
+        Stacked,
+        PercentStacked
+    }
+    /// <summary>
+    /// Shape for bar charts
+    /// </summary>
+    public enum eShape
+    {
+        Box,
+        Cone,
+        ConeToMax,
+        Cylinder,
+        Pyramid,
+        PyramidToMax
+    }
+    /// <summary>
+    /// Smothe Lines or lines
+    /// </summary>
+    public enum eScatterStyle
+    {
+        LineMarker,
+        SmoothMarker,
+     }
+    /// <summary>
+    /// Bar or pie
+    /// </summary>
+    public enum ePieType
+    {
+        Bar,
+        Pie
+    }
+    /// <summary>
+    /// Position of the labels
+    /// </summary>
+    public enum eLabelPosition
+    {
+        BestFit,
+        Left,
+        Right,
+        Center,
+        Top,
+        Bottom,
+        InBase,
+        InEnd,
+        OutEnd
+    }
+    /// <summary>
+    /// Axis label position
+    /// </summary>
+    public enum eTickLabelPosition
+    {
+        High,
+        Low,
+        NextTo,
+        None
+    }
+    /// <summary>
+    /// Markerstyle
+    /// </summary>
+    public enum eMarkerStyle
+    {        
+        Circle,
+        Dash,
+        Diamond,
+        Dot,
+        None,
+        Picture,
+        Plus,
+        Square,
+        Star,
+        Triangle,
+        X,
+    }
+    /// <summary>
+    /// The build in style of the chart.
+    /// </summary>
+    public enum eChartStyle
+    {
+        None,
+        Style1,
+        Style2,
+        Style3,
+        Style4,
+        Style5,
+        Style6,
+        Style7,
+        Style8,
+        Style9,
+        Style10,
+        Style11,
+        Style12,
+        Style13,
+        Style14,
+        Style15,
+        Style16,
+        Style17,
+        Style18,
+        Style19,
+        Style20,
+        Style21,
+        Style22,
+        Style23,
+        Style24,
+        Style25,
+        Style26,
+        Style27,
+        Style28,
+        Style29,
+        Style30,
+        Style31,
+        Style32,
+        Style33,
+        Style34,
+        Style35,
+        Style36,
+        Style37,
+        Style38,
+        Style39,
+        Style40,
+        Style41,
+        Style42,
+        Style43,
+        Style44,
+        Style45,
+        Style46,
+        Style47,
+        Style48
+    }
+    /// <summary>
+    /// Type of Trendline for a chart
+    /// </summary>
+    public enum eTrendLine
+    {
+        /// <summary>
+        /// Specifies the trendline shall be an exponential curve in the form
+        /// </summary>
+        Exponential,
+        /// <summary>
+        /// Specifies the trendline shall be a logarithmic curve in the form , where log is the natural
+        /// </summary>
+        Linear,
+        /// <summary>
+        /// Specifies the trendline shall be a logarithmic curve in the form , where log is the natural
+        /// </summary>
+        Logarithmic,
+        /// <summary>
+        /// Specifies the trendline shall be a moving average of period Period
+        /// </summary>
+        MovingAvgerage,
+        /// <summary>
+        /// Specifies the trendline shall be a polynomial curve of order Order in the form 
+        /// </summary>
+        Polynomial,
+        /// <summary>
+        /// Specifies the trendline shall be a power curve in the form
+        /// </summary>
+        Power
+    }
+    /// <summary>
+    /// Specifies the possible ways to display blanks
+    /// </summary>
+    public enum eDisplayBlanksAs
+    {
+        /// <summary>
+        /// Blank values shall be left as a gap
+        /// </summary>
+        Gap,
+        /// <summary>
+        /// Blank values shall be spanned with a line (Line charts)
+        /// </summary>
+        Span,
+        /// <summary>
+        /// Blank values shall be treated as zero
+        /// </summary>
+        Zero
+    }
+    #endregion
+    
+    
+    /// <summary>
+   /// Base class for Chart object.
+   /// </summary>
+    public class ExcelChart : ExcelDrawing
+    {
+       const string rootPath = "c:chartSpace/c:chart/c:plotArea";
+       //string _chartPath;
+       ExcelChartSeries _chartSeries;
+       internal ExcelChartAxis[] _axis;
+       protected XmlHelper _chartXmlHelper;
+       #region "Constructors"
+       internal ExcelChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) :
+           base(drawings, node, "xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/@name")
+       {
+           ChartType = type;
+           CreateNewChart(drawings, type, null);
+
+           Init(drawings, _chartNode);
+
+           _chartSeries = new ExcelChartSeries(this, drawings.NameSpaceManager, _chartNode, isPivot);
+
+           SetTypeProperties(drawings);
+           LoadAxis();
+       }
+       internal ExcelChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) :
+           base(drawings, node, "xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/@name")
+       {
+           ChartType = type;
+           CreateNewChart(drawings, type, topChart);
+
+           Init(drawings, _chartNode);
+
+           _chartSeries = new ExcelChartSeries(this, drawings.NameSpaceManager, _chartNode, PivotTableSource!=null);
+           if (PivotTableSource != null) SetPivotSource(PivotTableSource);
+
+           SetTypeProperties(drawings);
+           if (topChart == null)
+               LoadAxis();
+           else
+           {
+               _axis = topChart.Axis;
+               if (_axis.Length > 0)
+               {
+                   XAxis = _axis[0];
+                   YAxis = _axis[1];
+               }
+           }
+       }
+       internal ExcelChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, PackagePart part, XmlDocument chartXml, XmlNode chartNode) :
+           base(drawings, node, "xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/@name")
+       {
+           UriChart = uriChart;
+           Part = part;
+           ChartXml = chartXml;
+           _chartNode = chartNode;
+           InitChartLoad(drawings, chartNode);
+           ChartType = GetChartType(chartNode.LocalName);
+       }
+       internal ExcelChart(ExcelChart topChart, XmlNode chartNode) :
+           base(topChart._drawings, topChart.TopNode, "xdr:graphicFrame/xdr:nvGraphicFramePr/xdr:cNvPr/@name")
+       {
+           UriChart = topChart.UriChart;
+           Part = topChart.Part;
+           ChartXml = topChart.ChartXml;
+           _plotArea = topChart.PlotArea;
+           _chartNode = chartNode;
+
+           InitChartLoad(topChart._drawings, chartNode);
+       }
+       private void InitChartLoad(ExcelDrawings drawings, XmlNode chartNode)
+       {
+           //SetChartType();
+           bool isPivot = false;
+           Init(drawings, chartNode);
+           _chartSeries = new ExcelChartSeries(this, drawings.NameSpaceManager, _chartNode, isPivot /*ChartXml.SelectSingleNode(_chartPath, drawings.NameSpaceManager)*/);
+           LoadAxis();
+       }
+
+       private void Init(ExcelDrawings drawings, XmlNode chartNode)
+       {
+           //_chartXmlHelper = new XmlHelper(drawings.NameSpaceManager, chartNode);
+           _chartXmlHelper = XmlHelperFactory.Create(drawings.NameSpaceManager, chartNode);
+           _chartXmlHelper.SchemaNodeOrder = new string[] { "title", "pivotFmt", "view3D", "plotArea", "barDir", "grouping", "scatterStyle", "varyColors", "ser", "dLbls", "dropLines", "upDownBars", "marker", "smooth", "shape", "legend", "plotVisOnly","dispBlanksAs", "overlap", "axId", "spPr", "printSettings" };
+           WorkSheet = drawings.Worksheet;
+       }
+       #endregion
+       #region "Private functions"
+       private void SetTypeProperties(ExcelDrawings drawings)
+       {
+           /******* Grouping *******/
+           if (IsTypeClustered())
+           {
+               Grouping = eGrouping.Clustered;
+           }
+           else if (
+               IsTypeStacked())
+           {
+               Grouping = eGrouping.Stacked;
+           }
+           else if (
+           IsTypePercentStacked())
+           {
+               Grouping = eGrouping.PercentStacked;
+           }
+
+           /***** 3D Perspective *****/
+           if (IsType3D())             
+           {
+               View3D.RotY = 20;
+               View3D.Perspective = 30;    //Default to 30
+               if (IsTypePieDoughnut())
+               {
+                   View3D.RotX = 30;
+               }
+               else
+               {
+                   View3D.RotX = 15;
+               }
+           }
+       }
+       private void CreateNewChart(ExcelDrawings drawings, eChartType type, ExcelChart topChart)
+       {
+           if (topChart == null)
+           {
+               XmlElement graphFrame = TopNode.OwnerDocument.CreateElement("graphicFrame", ExcelPackage.schemaSheetDrawings);
+               graphFrame.SetAttribute("macro", "");
+               TopNode.AppendChild(graphFrame); 
+               graphFrame.InnerXml = string.Format("<xdr:nvGraphicFramePr><xdr:cNvPr id=\"{0}\" name=\"Chart 1\" /><xdr:cNvGraphicFramePr /></xdr:nvGraphicFramePr><xdr:xfrm><a:off x=\"0\" y=\"0\" /> <a:ext cx=\"0\" cy=\"0\" /></xdr:xfrm><a:graphic><a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\"><c:chart xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"rId1\" />   </a:graphicData>  </a:graphic>",_id);
+               TopNode.AppendChild(TopNode.OwnerDocument.CreateElement("clientData", ExcelPackage.schemaSheetDrawings));
+
+               Package package = drawings.Worksheet._package.Package;
+               UriChart = GetNewUri(package, "/xl/charts/chart{0}.xml");
+
+               ChartXml = new XmlDocument();
+               ChartXml.PreserveWhitespace = ExcelPackage.preserveWhitespace;
+               LoadXmlSafe(ChartXml, ChartStartXml(type), Encoding.UTF8);
+
+               // save it to the package
+               Part = package.CreatePart(UriChart, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml", _drawings._package.Compression);
+
+               StreamWriter streamChart = new StreamWriter(Part.GetStream(FileMode.Create, FileAccess.Write));
+               ChartXml.Save(streamChart);
+               streamChart.Close();
+               package.Flush();
+
+               PackageRelationship chartRelation = drawings.Part.CreateRelationship(PackUriHelper.GetRelativeUri(drawings.UriDrawing, UriChart), TargetMode.Internal, ExcelPackage.schemaRelationships + "/chart");
+               graphFrame.SelectSingleNode("a:graphic/a:graphicData/c:chart", NameSpaceManager).Attributes["r:id"].Value = chartRelation.Id;
+               package.Flush();
+               _chartNode = ChartXml.SelectSingleNode(string.Format("c:chartSpace/c:chart/c:plotArea/{0}", GetChartNodeText()), NameSpaceManager);
+           }
+           else
+           {
+               ChartXml = topChart.ChartXml;
+               Part = topChart.Part;
+               _plotArea = topChart.PlotArea;
+               UriChart = topChart.UriChart;
+               _axis = topChart._axis;
+
+               XmlNode preNode = _plotArea.ChartTypes[_plotArea.ChartTypes.Count - 1].ChartNode;
+               _chartNode = ((XmlDocument)ChartXml).CreateElement(GetChartNodeText(), ExcelPackage.schemaChart);
+               preNode.ParentNode.InsertAfter(_chartNode, preNode);
+               if (topChart.Axis.Length == 0)
+               {
+                   AddAxis();
+               }
+               string serieXML = GetChartSerieStartXml(type, int.Parse(topChart.Axis[0].Id), int.Parse(topChart.Axis[1].Id));
+               _chartNode.InnerXml = serieXML;
+           }
+       }
+       private void LoadAxis()
+       {
+           XmlNodeList nl = _chartNode.SelectNodes("c:axId", NameSpaceManager);
+           List<ExcelChartAxis> l = new List<ExcelChartAxis>();
+           foreach (XmlNode node in nl)
+           {
+               string id = node.Attributes["val"].Value;
+               var axNode = ChartXml.SelectNodes(rootPath + string.Format("/*/c:axId[@val=\"{0}\"]", id), NameSpaceManager);
+               if (axNode != null && axNode.Count>1)
+               {
+                   foreach (XmlNode axn in axNode)
+                   {
+                       if (axn.ParentNode.LocalName.EndsWith("Ax"))
+                       {
+                           XmlNode axisNode = axNode[1].ParentNode;
+                           ExcelChartAxis ax = new ExcelChartAxis(NameSpaceManager, axisNode);
+                           l.Add(ax);
+                       }
+                   }
+               }
+           }
+           _axis = l.ToArray();
+
+           if(_axis.Length > 0) XAxis = _axis[0];
+           if (_axis.Length > 1) YAxis = _axis[1];
+       }
+       //private void SetChartType()
+       //{
+       //    ChartType = 0;
+       //    //_plotArea = new ExcelChartPlotArea(NameSpaceManager, ChartXml.SelectSingleNode("c:chartSpace/c:chart/c:plotArea", NameSpaceManager));
+       //    int pos=0;
+       //    foreach (XmlElement n in ChartXml.SelectSingleNode(rootPath, _drawings.NameSpaceManager).ChildNodes)
+       //    {
+       //        if (pos == 0)
+       //        {
+       //            ChartType = GetChartType(n.Name);
+       //            if (ChartType != 0)
+       //            {
+       //                //_chartPath = rootPath + "/" + n.Name;
+       //                PlotArea.ChartTypes.Add(this);
+       //            }
+       //        }
+       //        else
+       //        {
+       //            var chartSerieType = GetChart(_drawings, TopNode/*, n*/);
+       //            chartSerieType = GetChart(n, _drawings, TopNode, UriChart, Part, ChartXml, null, isPivot);
+       //            PlotArea.ChartTypes.Add(chartSerieType);
+       //            //var chartType = GetChartType(n.Name);
+       //        }
+       //        if (ChartType != 0)
+       //        {
+       //            pos++;
+       //        }
+       //    }
+       //}
+
+       internal virtual eChartType GetChartType(string name)
+       {
+           
+           switch (name)
+           {
+               case "area3DChart":
+                   if(Grouping==eGrouping.Stacked)
+                   {
+                       return eChartType.AreaStacked3D;
+                   }
+                   else if (Grouping == eGrouping.PercentStacked)
+                   {
+                       return eChartType.AreaStacked1003D;
+                   }
+                   else
+                   {
+                       return eChartType.Area3D;
+                   }
+               case "areaChart":
+                   if (Grouping == eGrouping.Stacked)
+                   {
+                       return eChartType.AreaStacked;
+                   }
+                   else if (Grouping == eGrouping.PercentStacked)
+                   {
+                       return eChartType.AreaStacked100;
+                   }
+                   else
+                   {
+                       return eChartType.Area;
+                   }
+               case "bubbleChart":
+                   return eChartType.Bubble;
+               case "doughnutChart":
+                   return eChartType.Doughnut;
+               case "pie3DChart":
+                   return eChartType.Pie3D;
+               case "pieChart":
+                   return eChartType.Pie;
+               case "radarChart":
+                   return eChartType.Radar;
+               case "scatterChart":
+                   return eChartType.XYScatter;
+               case "surface3DChart":
+               case "surfaceChart":
+                   return eChartType.Surface;
+               case "stockChart":
+                   return eChartType.StockHLC;
+               default:
+                   return 0;
+           }           
+       }
+       #region "Xml init Functions"
+       private string ChartStartXml(eChartType type)
+       {
+           StringBuilder xml=new StringBuilder();
+           int axID=1;
+           int xAxID=2;
+
+           xml.Append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
+           xml.AppendFormat("<c:chartSpace xmlns:c=\"{0}\" xmlns:a=\"{1}\" xmlns:r=\"{2}\">", ExcelPackage.schemaChart, ExcelPackage.schemaDrawings, ExcelPackage.schemaRelationships);       
+           xml.Append("<c:chart>");
+           xml.AppendFormat("{0}<c:plotArea><c:layout/>",AddPerspectiveXml(type));
+
+           string chartNodeText = GetChartNodeText();
+           xml.AppendFormat("<{0}>", chartNodeText);
+           xml.Append(GetChartSerieStartXml(type, axID, xAxID));
+           xml.AppendFormat("</{0}>", chartNodeText);
+
+           //Axis
+           if (!IsTypePieDoughnut())
+           {
+               if (IsTypeScatter())
+               {
+                   xml.AppendFormat("<c:valAx><c:axId val=\"{0}\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling><c:delete val=\"0\"/><c:axPos val=\"b\"/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"{1}\"/><c:crosses val=\"autoZero\"/></c:valAx>", axID, xAxID);
+               }
+               else
+               {
+                   xml.AppendFormat("<c:catAx><c:axId val=\"{0}\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling><c:delete val=\"0\"/><c:axPos val=\"b\"/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"{1}\"/><c:crosses val=\"autoZero\"/><c:auto val=\"1\"/><c:lblAlgn val=\"ctr\"/><c:lblOffset val=\"100\"/></c:catAx>", axID, xAxID);
+               }
+               xml.AppendFormat("<c:valAx><c:axId val=\"{1}\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling><c:delete val=\"0\"/><c:axPos val=\"l\"/><c:majorGridlines/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"1\"/><c:crosses val=\"autoZero\"/><c:crossBetween val=\"between\"/></c:valAx>", axID, xAxID);
+           }
+
+           xml.AppendFormat("</c:plotArea><c:legend><c:legendPos val=\"r\"/><c:layout/><c:overlay val=\"0\" /></c:legend><c:plotVisOnly val=\"1\"/></c:chart>", axID, xAxID);
+
+           xml.Append("<c:printSettings><c:headerFooter/><c:pageMargins b=\"0.75\" l=\"0.7\" r=\"0.7\" t=\"0.75\" header=\"0.3\" footer=\"0.3\"/><c:pageSetup/></c:printSettings></c:chartSpace>");          
+           return xml.ToString();
+       }
+
+       private string GetChartSerieStartXml(eChartType type, int axID, int xAxID)
+       {
+           StringBuilder xml = new StringBuilder();
+
+           xml.Append(AddScatterType(type));
+           xml.Append(AddBarDir(type));
+           xml.Append(AddGrouping());
+           xml.Append(AddVaryColors());
+           xml.Append(AddHasMarker(type));
+           xml.Append(AddShape(type));
+           xml.Append(AddFirstSliceAng(type));
+           xml.Append(AddHoleSize(type));
+           if (ChartType == eChartType.BarStacked100 || 
+               ChartType == eChartType.BarStacked ||
+               ChartType == eChartType.ColumnStacked ||
+               ChartType == eChartType.ColumnStacked100)
+           {
+               xml.Append("<c:overlap val=\"100\"/>");
+           }
+           xml.Append(AddAxisId(axID, xAxID));
+
+           return xml.ToString();
+       }
+       private string AddAxisId(int axID,int xAxID)
+       {
+           if (!IsTypePieDoughnut())
+           {
+               return string.Format("<c:axId val=\"{0}\"/><c:axId val=\"{1}\"/>",axID, xAxID);
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddAxType()
+       {
+           switch(ChartType)
+           {
+               case eChartType.XYScatter:
+               case eChartType.XYScatterLines:
+               case eChartType.XYScatterLinesNoMarkers:
+               case eChartType.XYScatterSmooth:
+               case eChartType.XYScatterSmoothNoMarkers:
+                   return "valAx";
+               default:
+                   return "catAx";
+           }
+       }
+       private string AddScatterType(eChartType type)
+       {
+           if (type == eChartType.XYScatter ||
+               type == eChartType.XYScatterLines ||
+               type == eChartType.XYScatterLinesNoMarkers ||
+               type == eChartType.XYScatterSmooth ||
+               type == eChartType.XYScatterSmoothNoMarkers)
+           {
+               return "<c:scatterStyle val=\"\" />";
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddGrouping()
+       {
+           //IsTypeClustered() || IsTypePercentStacked() || IsTypeStacked() || 
+           if(IsTypeShape() || IsTypeLine())
+           {
+               return "<c:grouping val=\"standard\"/>";
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddHoleSize(eChartType type)
+       {
+           if (type == eChartType.Doughnut ||
+               type == eChartType.DoughnutExploded)
+           {
+               return "<c:holeSize val=\"50\" />";
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddFirstSliceAng(eChartType type)
+       {
+           if (type == eChartType.Doughnut ||
+               type == eChartType.DoughnutExploded)
+           {
+               return "<c:firstSliceAng val=\"0\" />";
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddVaryColors()
+       {
+           if (IsTypePieDoughnut())
+           {
+               return "<c:varyColors val=\"1\" />";
+           }
+           else
+           {
+               return "<c:varyColors val=\"0\" />";
+           }
+       }
+       private string AddHasMarker(eChartType type)
+       {
+           if (type == eChartType.LineMarkers ||
+               type == eChartType.LineMarkersStacked ||
+               type == eChartType.LineMarkersStacked100 /*||
+               type == eChartType.XYScatterLines ||
+               type == eChartType.XYScatterSmooth*/)
+           {
+               return "<c:marker val=\"1\"/>";
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddShape(eChartType type)
+       {
+           if (IsTypeShape())
+           {
+               return "<c:shape val=\"box\" />";
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddBarDir(eChartType type)
+       {
+           if (IsTypeShape())
+            {
+                return "<c:barDir val=\"col\" />";
+            }
+            else
+            {
+                return "";
+            }
+       }
+       private string AddPerspectiveXml(eChartType type)
+        {
+ 	        //Add for 3D sharts
+            if (IsType3D())
+            {
+                return "<c:view3D><c:perspective val=\"30\" /></c:view3D>";
+            }
+            else
+            {
+                return "";
+            }
+        }
+       #endregion
+       #endregion
+       #region "Chart type functions
+       internal static bool IsType3D(eChartType chartType)
+        {
+            return chartType == eChartType.Area3D ||
+                            chartType == eChartType.AreaStacked3D ||
+                            chartType == eChartType.AreaStacked1003D ||
+                            chartType == eChartType.BarClustered3D ||
+                            chartType == eChartType.BarStacked3D ||
+                            chartType == eChartType.BarStacked1003D ||
+                            chartType == eChartType.Column3D ||
+                            chartType == eChartType.ColumnClustered3D ||
+                            chartType == eChartType.ColumnStacked3D ||
+                            chartType == eChartType.ColumnStacked1003D ||
+                            chartType == eChartType.Line3D ||
+                            chartType == eChartType.Pie3D ||
+                            chartType == eChartType.PieExploded3D ||
+                            chartType == eChartType.Bubble3DEffect ||
+                            chartType == eChartType.ConeBarClustered ||
+                            chartType == eChartType.ConeBarStacked ||
+                            chartType == eChartType.ConeBarStacked100 ||
+                            chartType == eChartType.ConeCol ||
+                            chartType == eChartType.ConeColClustered ||
+                            chartType == eChartType.ConeColStacked ||
+                            chartType == eChartType.ConeColStacked100 ||
+                            chartType == eChartType.CylinderBarClustered ||
+                            chartType == eChartType.CylinderBarStacked ||
+                            chartType == eChartType.CylinderBarStacked100 ||
+                            chartType == eChartType.CylinderCol ||
+                            chartType == eChartType.CylinderColClustered ||
+                            chartType == eChartType.CylinderColStacked ||
+                            chartType == eChartType.CylinderColStacked100 ||
+                            chartType == eChartType.PyramidBarClustered ||
+                            chartType == eChartType.PyramidBarStacked ||
+                            chartType == eChartType.PyramidBarStacked100 ||
+                            chartType == eChartType.PyramidCol ||
+                            chartType == eChartType.PyramidColClustered ||
+                            chartType == eChartType.PyramidColStacked ||
+                            chartType == eChartType.PyramidColStacked100 /*||
+                            chartType == eChartType.Doughnut ||
+                            chartType == eChartType.DoughnutExploded*/;
+        }
+       internal protected bool IsType3D()
+       {
+            return IsType3D(ChartType);
+       }
+       protected bool IsTypeLine()
+       {
+           return ChartType == eChartType.Line ||
+                   ChartType == eChartType.LineMarkers ||
+                   ChartType == eChartType.LineMarkersStacked100 ||
+                   ChartType == eChartType.LineStacked ||
+                   ChartType == eChartType.LineStacked100 ||
+                   ChartType == eChartType.Line3D;
+       }
+       protected bool IsTypeScatter()
+       {
+           return ChartType == eChartType.XYScatter ||
+                   ChartType == eChartType.XYScatterLines ||
+                   ChartType == eChartType.XYScatterLinesNoMarkers ||
+                   ChartType == eChartType.XYScatterSmooth ||
+                   ChartType == eChartType.XYScatterSmoothNoMarkers;
+       }
+        protected bool IsTypeShape()
+       {
+            return ChartType == eChartType.BarClustered3D ||
+                    ChartType == eChartType.BarStacked3D ||
+                    ChartType == eChartType.BarStacked1003D ||
+                    ChartType == eChartType.BarClustered3D ||
+                    ChartType == eChartType.BarStacked3D ||
+                    ChartType == eChartType.BarStacked1003D ||
+                    ChartType == eChartType.Column3D ||
+                    ChartType == eChartType.ColumnClustered3D ||
+                    ChartType == eChartType.ColumnStacked3D ||
+                    ChartType == eChartType.ColumnStacked1003D ||
+                //ChartType == eChartType.3DPie ||
+                //ChartType == eChartType.3DPieExploded ||
+                    ChartType == eChartType.Bubble3DEffect ||
+                    ChartType == eChartType.ConeBarClustered ||
+                    ChartType == eChartType.ConeBarStacked ||
+                    ChartType == eChartType.ConeBarStacked100 ||
+                    ChartType == eChartType.ConeCol ||
+                    ChartType == eChartType.ConeColClustered ||
+                    ChartType == eChartType.ConeColStacked ||
+                    ChartType == eChartType.ConeColStacked100 ||
+                    ChartType == eChartType.CylinderBarClustered ||
+                    ChartType == eChartType.CylinderBarStacked ||
+                    ChartType == eChartType.CylinderBarStacked100 ||
+                    ChartType == eChartType.CylinderCol ||
+                    ChartType == eChartType.CylinderColClustered ||
+                    ChartType == eChartType.CylinderColStacked ||
+                    ChartType == eChartType.CylinderColStacked100 ||
+                    ChartType == eChartType.PyramidBarClustered ||
+                    ChartType == eChartType.PyramidBarStacked ||
+                    ChartType == eChartType.PyramidBarStacked100 ||
+                    ChartType == eChartType.PyramidCol ||
+                    ChartType == eChartType.PyramidColClustered ||
+                    ChartType == eChartType.PyramidColStacked ||
+                    ChartType == eChartType.PyramidColStacked100; //||
+                    //ChartType == eChartType.Doughnut ||
+                    //ChartType == eChartType.DoughnutExploded;
+        }
+        protected internal bool IsTypePercentStacked()
+        {
+            return ChartType == eChartType.AreaStacked100 ||
+                           ChartType == eChartType.BarStacked100 ||
+                           ChartType == eChartType.BarStacked1003D ||
+                           ChartType == eChartType.ColumnStacked100 ||
+                           ChartType == eChartType.ColumnStacked1003D ||
+                           ChartType == eChartType.ConeBarStacked100 ||
+                           ChartType == eChartType.ConeColStacked100 ||
+                           ChartType == eChartType.CylinderBarStacked100 ||
+                           ChartType == eChartType.CylinderColStacked ||
+                           ChartType == eChartType.LineMarkersStacked100 ||
+                           ChartType == eChartType.LineStacked100 ||
+                           ChartType == eChartType.PyramidBarStacked100 ||
+                           ChartType == eChartType.PyramidColStacked100;
+        }
+        protected internal bool IsTypeStacked()
+        {
+            return ChartType == eChartType.AreaStacked ||
+                           ChartType == eChartType.AreaStacked3D ||
+                           ChartType == eChartType.BarStacked ||
+                           ChartType == eChartType.BarStacked3D ||
+                           ChartType == eChartType.ColumnStacked3D ||
+                           ChartType == eChartType.ColumnStacked ||
+                           ChartType == eChartType.ConeBarStacked ||
+                           ChartType == eChartType.ConeColStacked ||
+                           ChartType == eChartType.CylinderBarStacked ||
+                           ChartType == eChartType.CylinderColStacked ||
+                           ChartType == eChartType.LineMarkersStacked ||
+                           ChartType == eChartType.LineStacked ||
+                           ChartType == eChartType.PyramidBarStacked ||
+                           ChartType == eChartType.PyramidColStacked;
+        }
+        protected bool IsTypeClustered()
+        {
+            return ChartType == eChartType.BarClustered ||
+                           ChartType == eChartType.BarClustered3D ||
+                           ChartType == eChartType.ColumnClustered3D ||
+                           ChartType == eChartType.ColumnClustered ||
+                           ChartType == eChartType.ConeBarClustered ||
+                           ChartType == eChartType.ConeColClustered ||
+                           ChartType == eChartType.CylinderBarClustered ||
+                           ChartType == eChartType.CylinderColClustered ||
+                           ChartType == eChartType.PyramidBarClustered ||
+                           ChartType == eChartType.PyramidColClustered;
+        }
+        protected internal bool IsTypePieDoughnut()
+        {
+            return ChartType == eChartType.Pie ||
+                           ChartType == eChartType.PieExploded ||
+                           ChartType == eChartType.PieOfPie ||
+                           ChartType == eChartType.Pie3D ||
+                           ChartType == eChartType.PieExploded3D ||
+                           ChartType == eChartType.BarOfPie ||
+                           ChartType == eChartType.Doughnut ||
+                           ChartType == eChartType.DoughnutExploded;
+        }
+        #endregion
+       /// <summary>
+       /// Get the name of the chart node
+       /// </summary>
+       /// <returns>The name</returns>
+        protected string GetChartNodeText()
+        {
+            switch (ChartType)
+            {
+                case eChartType.Area3D:
+                case eChartType.AreaStacked3D:
+                case eChartType.AreaStacked1003D:
+                    return "c:area3DChart";
+                case eChartType.Area:
+                case eChartType.AreaStacked:
+                case eChartType.AreaStacked100:
+                    return "c:areaChart";
+                case eChartType.BarClustered:
+                case eChartType.BarStacked:
+                case eChartType.BarStacked100:
+                case eChartType.ColumnClustered:
+                case eChartType.ColumnStacked:
+                case eChartType.ColumnStacked100:
+                    return "c:barChart";
+                case eChartType.BarClustered3D:
+                case eChartType.BarStacked3D:
+                case eChartType.BarStacked1003D:
+                case eChartType.ColumnClustered3D:
+                case eChartType.ColumnStacked3D:
+                case eChartType.ColumnStacked1003D:
+                case eChartType.ConeBarClustered:
+                case eChartType.ConeBarStacked:
+                case eChartType.ConeBarStacked100:
+                case eChartType.ConeCol:
+                case eChartType.ConeColClustered:
+                case eChartType.ConeColStacked:
+                case eChartType.ConeColStacked100:
+                case eChartType.CylinderBarClustered:
+                case eChartType.CylinderBarStacked:
+                case eChartType.CylinderBarStacked100:
+                case eChartType.CylinderCol:
+                case eChartType.CylinderColClustered:
+                case eChartType.CylinderColStacked:
+                case eChartType.CylinderColStacked100:
+                case eChartType.PyramidBarClustered:
+                case eChartType.PyramidBarStacked:
+                case eChartType.PyramidBarStacked100:
+                case eChartType.PyramidCol:
+                case eChartType.PyramidColClustered:
+                case eChartType.PyramidColStacked:
+                case eChartType.PyramidColStacked100:
+                    return "c:bar3DChart";
+                case eChartType.Bubble:
+                    return "c:bubbleChart";
+                case eChartType.Doughnut:
+                case eChartType.DoughnutExploded:
+                    return "c:doughnutChart";
+                case eChartType.Line:
+                case eChartType.LineMarkers:
+                case eChartType.LineMarkersStacked:
+                case eChartType.LineMarkersStacked100:
+                case eChartType.LineStacked:
+                case eChartType.LineStacked100:
+                    return "c:lineChart";
+                case eChartType.Line3D:
+                    return "c:line3DChart";
+                case eChartType.Pie:
+                case eChartType.PieExploded:
+                    return "c:pieChart";
+                case eChartType.BarOfPie:
+                case eChartType.PieOfPie:
+                    return "c:ofPieChart";
+                case eChartType.Pie3D:
+                case eChartType.PieExploded3D:
+                    return "c:pie3DChart";
+                case eChartType.Radar:
+                case eChartType.RadarFilled:
+                case eChartType.RadarMarkers:
+                    return "c:radarChart";
+                case eChartType.XYScatter:
+                case eChartType.XYScatterLines:
+                case eChartType.XYScatterLinesNoMarkers:
+                case eChartType.XYScatterSmooth:
+                case eChartType.XYScatterSmoothNoMarkers:
+                    return "c:scatterChart";
+                case eChartType.Surface:
+                    return "c:surfaceChart";
+                case eChartType.StockHLC:
+                    return "c:stockChart";
+                default:
+                    throw(new NotImplementedException("Chart type not implemented"));
+            }
+        }
+        /// <summary>
+        /// Add a secondary axis
+        /// </summary>
+        internal void AddAxis()
+        {
+            XmlElement catAx = ChartXml.CreateElement(string.Format("c:{0}",AddAxType()), ExcelPackage.schemaChart);
+            int axID;
+            if (_axis.Length == 0)
+            {
+                _plotArea.TopNode.AppendChild(catAx);
+                axID = 1;
+            }
+            else
+            {
+                _axis[0].TopNode.ParentNode.InsertAfter(catAx, _axis[_axis.Length-1].TopNode);
+                axID = int.Parse(_axis[0].Id) < int.Parse(_axis[1].Id) ? int.Parse(_axis[1].Id) + 1 : int.Parse(_axis[0].Id) + 1;
+            }
+
+
+            XmlElement valAx = ChartXml.CreateElement("c:valAx", ExcelPackage.schemaChart);
+            catAx.ParentNode.InsertAfter(valAx, catAx);
+
+            if (_axis.Length == 0)
+            {
+                catAx.InnerXml = string.Format("<c:axId val=\"{0}\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling><c:delete val=\"0\" /><c:axPos val=\"b\"/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"{1}\"/><c:crosses val=\"autoZero\"/><c:auto val=\"1\"/><c:lblAlgn val=\"ctr\"/><c:lblOffset val=\"100\"/>", axID, axID + 1);
+                valAx.InnerXml = string.Format("<c:axId val=\"{1}\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling><c:delete val=\"0\" /><c:axPos val=\"l\"/><c:majorGridlines/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"{0}\"/><c:crosses val=\"autoZero\"/><c:crossBetween val=\"between\"/>", axID, axID + 1);
+            }
+            else
+            {
+                catAx.InnerXml = string.Format("<c:axId val=\"{0}\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling><c:delete val=\"1\" /><c:axPos val=\"b\"/><c:tickLblPos val=\"none\"/><c:crossAx val=\"{1}\"/><c:crosses val=\"autoZero\"/>", axID, axID + 1);
+                valAx.InnerXml = string.Format("<c:axId val=\"{0}\"/><c:scaling><c:orientation val=\"minMax\"/></c:scaling><c:delete val=\"0\" /><c:axPos val=\"r\"/><c:tickLblPos val=\"nextTo\"/><c:crossAx val=\"{1}\"/><c:crosses val=\"max\"/><c:crossBetween val=\"between\"/>", axID + 1, axID);
+            }
+
+            if (_axis.Length == 0)
+            {
+                _axis = new ExcelChartAxis[2];
+            }
+            else
+            {
+                ExcelChartAxis[] newAxis = new ExcelChartAxis[_axis.Length + 2];
+                Array.Copy(_axis, newAxis, _axis.Length);
+                _axis = newAxis;
+            }
+
+            _axis[_axis.Length - 2] = new ExcelChartAxis(NameSpaceManager, catAx);
+            _axis[_axis.Length - 1] = new ExcelChartAxis(NameSpaceManager, valAx);
+            foreach (var chart in _plotArea.ChartTypes)
+            {
+                chart._axis = _axis;
+            }
+        }
+        internal void RemoveSecondaryAxis()
+        {
+            throw (new NotImplementedException("Not yet implemented"));
+        }
+        #region "Properties"
+        /// <summary>
+        /// Reference to the worksheet
+        /// </summary>
+        public ExcelWorksheet WorkSheet { get; internal set; }
+        /// <summary>
+        /// The chart xml document
+        /// </summary>
+        public XmlDocument ChartXml { get; internal set; }
+        /// <summary>
+        /// Type of chart
+        /// </summary>
+        public eChartType ChartType { get; internal set; }
+        XmlNode _chartNode = null;
+        internal XmlNode ChartNode
+        {
+            get
+            {
+                return _chartNode;
+            }
+        }
+        /// <summary>
+        /// Titel of the chart
+        /// </summary>
+        public ExcelChartTitle Title
+        {
+            get
+            {
+                if (_title == null)
+                {
+                    _title = new ExcelChartTitle(NameSpaceManager, ChartXml.SelectSingleNode("c:chartSpace/c:chart", NameSpaceManager));
+                }
+                return _title;
+            }
+        }
+        /// <summary>
+        /// Chart series
+        /// </summary>
+        public ExcelChartSeries Series
+        {
+            get
+            {
+                return _chartSeries;
+            }
+        }
+        /// <summary>
+        /// An array containg all axis of all Charttypes
+        /// </summary>
+        public ExcelChartAxis[] Axis
+        {
+            get
+            {
+                return _axis;
+            }
+        }
+        /// <summary>
+        /// The XAxis
+        /// </summary>
+        public ExcelChartAxis XAxis
+        {
+            get;
+            private set;
+        }
+        /// <summary>
+        /// The YAxis
+        /// </summary>
+        public ExcelChartAxis YAxis
+        {
+            get;
+            private set;
+        }
+        bool _secondaryAxis=false;
+        /// <summary>
+        /// If true the charttype will use the secondary axis.
+        /// The chart must contain a least one other charttype that uses the primary axis.
+        /// </summary>
+        public bool UseSecondaryAxis
+        {
+            get
+            {
+                return _secondaryAxis;
+            }
+            set
+            {
+                 if (_secondaryAxis != value)
+                {
+                    if (value)
+                    {
+                        if (IsTypePieDoughnut())
+                        {
+                            throw (new Exception("Pie charts do not support axis"));
+                        }
+                        else if (HasPrimaryAxis() == false)
+                        {
+                            throw (new Exception("Can't set to secondary axis when no serie uses the primary axis"));
+                        }
+                        if (Axis.Length == 2)
+                        {
+                            AddAxis();
+                        }
+                        var nl = ChartNode.SelectNodes("c:axId", NameSpaceManager);
+                        nl[0].Attributes["val"].Value = Axis[2].Id;
+                        nl[1].Attributes["val"].Value = Axis[3].Id;
+                        XAxis = Axis[2];
+                        YAxis = Axis[3];
+                    }
+                    else
+                    {
+                        var nl = ChartNode.SelectNodes("c:axId", NameSpaceManager);
+                        nl[0].Attributes["val"].Value = Axis[0].Id;
+                        nl[1].Attributes["val"].Value = Axis[1].Id;
+                        XAxis = Axis[0];
+                        YAxis = Axis[1];
+                    }
+                    _secondaryAxis = value;
+                }
+            }
+        }
+        /// <summary>
+        /// The build-in chart styles. 
+        /// </summary>
+        public eChartStyle Style
+        {
+            get
+            {
+                XmlNode node = ChartXml.SelectSingleNode("c:chartSpace/c:style/@val", NameSpaceManager);
+                if (node == null)
+                {
+                    return eChartStyle.None;
+                }
+                else
+                {
+                    int v;
+                    if (int.TryParse(node.Value, out v))
+                    {
+                        return (eChartStyle)v;
+                    }
+                    else
+                    {
+                        return eChartStyle.None;
+                    }
+                }
+
+            }
+            set
+            {
+                if (value == eChartStyle.None)
+                {
+                    XmlElement element = ChartXml.SelectSingleNode("c:chartSpace/c:style", NameSpaceManager) as XmlElement;
+                    if (element != null)
+                    {
+                        element.ParentNode.RemoveChild(element);
+                    }
+                }
+                else
+                {
+                    XmlElement element = ChartXml.CreateElement("c:style", ExcelPackage.schemaChart);
+                    element.SetAttribute("val", ((int)value).ToString());
+                    XmlElement parent = ChartXml.SelectSingleNode("c:chartSpace", NameSpaceManager) as XmlElement;
+                    parent.InsertBefore(element, parent.SelectSingleNode("c:chart", NameSpaceManager));
+                }
+            }
+        }
+        const string _plotVisibleOnlyPath="../../c:plotVisOnly/@val";
+        /// <summary>
+        /// Show data in hidden rows and columns
+        /// </summary>
+        public bool ShowHiddenData
+        {
+            get
+            {
+                //!!Inverted value!!
+                return !_chartXmlHelper.GetXmlNodeBool(_plotVisibleOnlyPath);
+            }
+            set
+            {
+                //!!Inverted value!!
+                _chartXmlHelper.SetXmlNodeBool(_plotVisibleOnlyPath, !value);
+            }
+        }
+        const string _displayBlanksAsPath = "../../c:dispBlanksAs/@val";
+        /// <summary>
+        /// Specifies the possible ways to display blanks
+        /// </summary>
+        public eDisplayBlanksAs DisplayBlanksAs
+        {
+            get
+            {
+                string v=_chartXmlHelper.GetXmlNodeString(_displayBlanksAsPath);
+                if (string.IsNullOrEmpty(v))
+                {
+                    return eDisplayBlanksAs.Gap;
+                }
+                else
+                {
+                    return (eDisplayBlanksAs)Enum.Parse(typeof(eDisplayBlanksAs), v, true);
+                }
+            }
+            set
+            {
+                if (value == eDisplayBlanksAs.Gap)
+                {
+                    _chartSeries.DeleteNode(_displayBlanksAsPath);
+                }
+                else
+                {
+                    _chartSeries.SetXmlNodeString(_displayBlanksAsPath, value.ToString().ToLower());
+                }
+            }
+        }
+        private bool HasPrimaryAxis()
+        {
+            if (_plotArea.ChartTypes.Count == 1)
+            {
+                return false;
+            }
+            foreach (var chart in _plotArea.ChartTypes)
+            {
+                if (chart != this)
+                {
+                    if (chart.UseSecondaryAxis == false && chart.IsTypePieDoughnut()==false)
+                    {
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
+        ///// <summary>
+        ///// Sets position of the axis of a chart-serie
+        ///// </summary>
+        ///// <param name="XAxis">Left or Right</param>
+        ///// <param name="YAxis">Top or Bottom</param>
+        //internal void SetAxis(eXAxisPosition XAxis, eYAxisPosition YAxis)
+        //{
+        //    bool xAxisExists = false, yAxisExists = false;
+        //    foreach (var axis in _axis)
+        //    {
+        //        if (axis.AxisPosition == (eAxisPosition)XAxis)
+        //        {
+        //            //Found
+        //            xAxisExists=true;
+        //            if (axis != this.XAxis)
+        //            {
+        //                CheckRemoveAxis(this.XAxis);
+        //                this.XAxis = axis;
+        //            }
+        //        }
+        //        else if (axis.AxisPosition == (eAxisPosition)YAxis)
+        //        {
+        //            yAxisExists = true;
+        //            if (axis != this.YAxis)
+        //            {
+        //                CheckRemoveAxis(this.YAxis);
+        //                this.YAxis = axis;
+        //            }
+        //        }
+        //    }
+
+        //    if (!xAxisExists)
+        //    {
+        //        if (ExistsAxis(this.XAxis))
+        //        {
+        //            AddAxis((eAxisPosition)XAxis);
+        //            this.XAxis = Axis[Axis.Length - 1];
+        //        }
+        //        else
+        //        {
+        //            this.XAxis.AxisPosition = (eAxisPosition)XAxis;
+        //        }
+        //    }
+        //    if (!yAxisExists)
+        //    {
+        //        if (ExistsAxis(this.XAxis))
+        //        {
+        //            AddAxis((eAxisPosition)YAxis);
+        //            this.YAxis = Axis[Axis.Length - 1];
+        //        }
+        //        else
+        //        {
+        //            this.YAxis.AxisPosition = (eAxisPosition)YAxis;
+        //        }
+        //    }
+        //}
+
+        /// <summary>
+        /// Remove all axis that are not used any more
+        /// </summary>
+        /// <param name="excelChartAxis"></param>
+        private void CheckRemoveAxis(ExcelChartAxis excelChartAxis)
+        {
+            if (ExistsAxis(excelChartAxis))
+            {
+                //Remove the axis
+                ExcelChartAxis[] newAxis = new ExcelChartAxis[Axis.Length - 1];
+                int pos = 0;
+                foreach (var ax in Axis)
+                {
+                    if (ax != excelChartAxis)
+                    {
+                        newAxis[pos] = ax;
+                    }
+                }
+
+                //Update all charttypes.
+                foreach (ExcelChart chartType in _plotArea.ChartTypes)
+                {
+                    chartType._axis = newAxis;
+                }
+            }
+        }
+
+        private bool ExistsAxis(ExcelChartAxis excelChartAxis)
+        {
+            foreach (ExcelChart chartType in _plotArea.ChartTypes)
+            {
+                if (chartType != this)
+                {
+                    if (chartType.XAxis.AxisPosition == excelChartAxis.AxisPosition ||
+                       chartType.YAxis.AxisPosition == excelChartAxis.AxisPosition)
+                    {
+                        //The axis exists
+                        return true;
+                    }
+                }
+            }
+            return false;
+        }
+        ExcelChartPlotArea _plotArea = null;
+        /// <summary>
+        /// Plotarea
+        /// </summary>
+        public ExcelChartPlotArea PlotArea
+        {
+            get
+            {
+                if (_plotArea == null)
+                {
+                    _plotArea = new ExcelChartPlotArea(NameSpaceManager, ChartXml.SelectSingleNode("c:chartSpace/c:chart/c:plotArea", NameSpaceManager), this); 
+                }
+                return _plotArea;
+            }
+        }
+        ExcelChartLegend _legend = null;
+        /// <summary>
+        /// Legend
+        /// </summary>
+        public ExcelChartLegend Legend
+        {
+            get
+            {
+                if (_legend == null)
+                {
+                    _legend = new ExcelChartLegend(NameSpaceManager, ChartXml.SelectSingleNode("c:chartSpace/c:chart/c:legend", NameSpaceManager), this);
+                }
+                return _legend;
+            }
+
+        }
+        ExcelDrawingBorder _border = null;
+        /// <summary>
+        /// Border
+        /// </summary>
+        public ExcelDrawingBorder Border
+        {
+            get
+            {
+                if (_border == null)
+                {
+                    _border = new ExcelDrawingBorder(NameSpaceManager, ChartXml.SelectSingleNode("c:chartSpace",NameSpaceManager), "c:spPr/a:ln"); 
+                }
+                return _border;
+            }
+        }
+        ExcelDrawingFill _fill = null;
+        /// <summary>
+        /// Fill
+        /// </summary>
+        public ExcelDrawingFill Fill
+        {
+            get
+            {
+                if (_fill == null)
+                {
+                    _fill = new ExcelDrawingFill(NameSpaceManager, ChartXml.SelectSingleNode("c:chartSpace", NameSpaceManager), "c:spPr");
+                }
+                return _fill;
+            }
+        }
+        /// <summary>
+        /// 3D-settings
+        /// </summary>
+        public ExcelView3D View3D
+        {
+            get
+            {
+                if (IsType3D())
+                {
+                    return new ExcelView3D(NameSpaceManager, ChartXml.SelectSingleNode("//c:view3D", NameSpaceManager));
+                }
+                else
+                {
+                    throw (new Exception("Charttype does not support 3D"));
+                }
+
+            }
+        }
+        //string _groupingPath = "c:chartSpace/c:chart/c:plotArea/{0}/c:grouping/@val";
+        string _groupingPath = "c:grouping/@val";
+        public eGrouping Grouping
+        {
+            get
+            {
+                return GetGroupingEnum(_chartXmlHelper.GetXmlNodeString(_groupingPath));
+            }
+            internal set
+            {
+                _chartXmlHelper.SetXmlNodeString(_groupingPath, GetGroupingText(value));
+            }
+        }
+        //string _varyColorsPath = "c:chartSpace/c:chart/c:plotArea/{0}/c:varyColors/@val";
+        string _varyColorsPath = "c:varyColors/@val";
+        /// <summary>
+        /// If the chart has only one serie this varies the colors for each point.
+        /// </summary>
+        public bool VaryColors
+        {
+            get
+            {
+                return _chartXmlHelper.GetXmlNodeBool(_varyColorsPath);
+            }
+            set
+            {
+                if (value)
+                {
+                    _chartXmlHelper.SetXmlNodeString(_varyColorsPath, "1");
+                }
+                else
+                {
+                    _chartXmlHelper.SetXmlNodeString(_varyColorsPath, "0");
+                }
+            }
+        }
+        internal PackagePart Part { get; set; }
+        /// <summary>
+        /// Package internal URI
+        /// </summary>
+        internal Uri UriChart { get; set; }
+        internal new string Id
+        {
+            get { return ""; }
+        }
+        ExcelChartTitle _title = null;
+        #endregion
+       #region "Grouping Enum Translation"
+        private string GetGroupingText(eGrouping grouping)
+       {
+           switch (grouping)
+           {
+               case eGrouping.Clustered:
+                   return "clustered";
+               case eGrouping.Stacked:
+                   return "stacked";
+               case eGrouping.PercentStacked:
+                   return "percentStacked";
+               default:
+                   return "standard";
+
+           }
+       }
+       private eGrouping GetGroupingEnum(string grouping)
+       {
+           switch (grouping)
+           {
+               case "stacked":
+                   return eGrouping.Stacked;
+               case "percentStacked":
+                   return eGrouping.PercentStacked;
+               default: //"clustered":               
+                   return eGrouping.Clustered;
+           }         
+       }
+       #endregion
+       internal static ExcelChart GetChart(ExcelDrawings drawings, XmlNode node/*, XmlNode chartTypeNode*/)
+       {
+           XmlNode chartNode = node.SelectSingleNode("xdr:graphicFrame/a:graphic/a:graphicData/c:chart", drawings.NameSpaceManager);
+           if (chartNode != null)
+           {
+               PackageRelationship drawingRelation = drawings.Part.GetRelationship(chartNode.Attributes["r:id"].Value);
+               var uriChart = PackUriHelper.ResolvePartUri(drawings.UriDrawing, drawingRelation.TargetUri);
+
+               var part = drawings.Part.Package.GetPart(uriChart);
+               var chartXml = new XmlDocument();
+               LoadXmlSafe(chartXml, part.GetStream()); 
+
+               ExcelChart topChart = null;
+               foreach (XmlElement n in chartXml.SelectSingleNode(rootPath, drawings.NameSpaceManager).ChildNodes)
+                {
+                    if (topChart == null)
+                    {
+                        topChart = GetChart(n, drawings, node, uriChart, part, chartXml, null);
+                        if(topChart!=null)
+                        {
+                            topChart.PlotArea.ChartTypes.Add(topChart);
+                        }
+                    }
+                    else
+                    {
+                        var subChart = GetChart(n, null, null, null, null, null, topChart);
+                        if (subChart != null)
+                        {
+                            topChart.PlotArea.ChartTypes.Add(subChart);
+                        }
+                    }
+                }               
+                return topChart;
+           }
+           else
+           {
+               return null;
+           }           
+       }
+       internal static ExcelChart GetChart(XmlElement chartNode, ExcelDrawings drawings, XmlNode node,  Uri uriChart, PackagePart part, XmlDocument chartXml, ExcelChart topChart)
+       {
+           switch (chartNode.LocalName)
+           {
+               case "area3DChart":
+               case "areaChart":
+               case "bubbleChart":
+               case "radarChart":
+               case "surface3DChart":
+               case "surfaceChart":
+               case "stockChart":
+                   if (topChart == null)
+                   {
+                       return new ExcelChart(drawings, node, uriChart, part, chartXml, chartNode);
+                   }
+                   else
+                   {
+                       return new ExcelChart(topChart, chartNode);
+                   }
+               case "barChart":
+               case "bar3DChart":
+                   if (topChart == null)
+                   {
+                       return new ExcelBarChart(drawings, node, uriChart, part, chartXml, chartNode);
+                   }
+                   else
+                   {
+                       return new ExcelBarChart(topChart, chartNode);
+                   }
+               case "doughnutChart":
+                   if (topChart == null)
+                   {
+                       return new ExcelDoughnutChart(drawings, node, uriChart, part, chartXml, chartNode);
+                   }
+                   else
+                   {
+                       return new ExcelDoughnutChart(topChart, chartNode);
+                   }
+               case "pie3DChart":
+               case "pieChart":
+                   if (topChart == null)
+                   {
+                       return new ExcelPieChart(drawings, node, uriChart, part, chartXml, chartNode);
+                   }
+                   else
+                   {
+                       return new ExcelPieChart(topChart, chartNode);
+                   }
+           case "ofPieChart":
+                   if (topChart == null)
+                   {
+                       return new ExcelOfPieChart(drawings, node, uriChart, part, chartXml, chartNode);
+                   }
+                   else
+                   {
+                       return new ExcelBarChart(topChart, chartNode);
+                   }
+               case "lineChart":
+               case "line3DChart":
+                   if (topChart == null)
+                   {
+                       return new ExcelLineChart(drawings, node, uriChart, part, chartXml, chartNode);
+                   }
+                   else
+                   {
+                       return new ExcelLineChart(topChart, chartNode);
+                   }
+               case "scatterChart":
+                   if (topChart == null)
+                   {
+                       return new ExcelScatterChart(drawings, node, uriChart, part, chartXml, chartNode);
+                   }
+                   else
+                   {
+                       return new ExcelScatterChart(topChart, chartNode);
+                   }
+               default:
+                   return null;
+           }       
+       }
+       internal static ExcelChart GetNewChart(ExcelDrawings drawings, XmlNode drawNode, eChartType chartType, ExcelChart topChart, ExcelPivotTable PivotTableSource)
+       {
+            switch(chartType)
+            {
+                case eChartType.Pie:
+                case eChartType.PieExploded:
+                case eChartType.Pie3D:
+                case eChartType.PieExploded3D:
+                    return new ExcelPieChart(drawings, drawNode, chartType, topChart, PivotTableSource);
+                case eChartType.BarOfPie:
+                case eChartType.PieOfPie:
+                    return new ExcelOfPieChart(drawings, drawNode, chartType, topChart, PivotTableSource);
+                case eChartType.Doughnut:
+                case eChartType.DoughnutExploded:
+                    return new ExcelDoughnutChart(drawings, drawNode, chartType, topChart, PivotTableSource);
+                case eChartType.BarClustered:
+                case eChartType.BarStacked:
+                case eChartType.BarStacked100:
+                case eChartType.BarClustered3D:
+                case eChartType.BarStacked3D:
+                case eChartType.BarStacked1003D:
+                case eChartType.ConeBarClustered:
+                case eChartType.ConeBarStacked:
+                case eChartType.ConeBarStacked100:
+                case eChartType.CylinderBarClustered:
+                case eChartType.CylinderBarStacked:
+                case eChartType.CylinderBarStacked100:
+                case eChartType.PyramidBarClustered:
+                case eChartType.PyramidBarStacked:
+                case eChartType.PyramidBarStacked100:
+                case eChartType.ColumnClustered:
+                case eChartType.ColumnStacked:
+                case eChartType.ColumnStacked100:
+                case eChartType.Column3D:
+                case eChartType.ColumnClustered3D:
+                case eChartType.ColumnStacked3D:
+                case eChartType.ColumnStacked1003D:
+                case eChartType.ConeCol:
+                case eChartType.ConeColClustered:
+                case eChartType.ConeColStacked:
+                case eChartType.ConeColStacked100:
+                case eChartType.CylinderCol:
+                case eChartType.CylinderColClustered:
+                case eChartType.CylinderColStacked:
+                case eChartType.CylinderColStacked100:
+                case eChartType.PyramidCol:
+                case eChartType.PyramidColClustered:
+                case eChartType.PyramidColStacked:
+                case eChartType.PyramidColStacked100:
+                    return new ExcelBarChart(drawings, drawNode, chartType, topChart, PivotTableSource);
+                case eChartType.XYScatter:
+                case eChartType.XYScatterLines:
+                case eChartType.XYScatterLinesNoMarkers:
+                case eChartType.XYScatterSmooth:
+                case eChartType.XYScatterSmoothNoMarkers:
+                    return new ExcelScatterChart(drawings, drawNode, chartType, topChart, PivotTableSource);
+                case eChartType.Line:
+                case eChartType.Line3D:
+                case eChartType.LineMarkers:
+                case eChartType.LineMarkersStacked:
+                case eChartType.LineMarkersStacked100:
+                case eChartType.LineStacked:
+                case eChartType.LineStacked100:
+                    return new ExcelLineChart(drawings, drawNode, chartType, topChart, PivotTableSource);
+                default:
+                    return new ExcelChart(drawings, drawNode, chartType, topChart, PivotTableSource);
+            }
+        }
+        public ExcelPivotTable PivotTableSource
+        {
+            get;
+            private set;
+        }
+       internal void SetPivotSource(ExcelPivotTable pivotTableSource)
+       {
+           PivotTableSource = pivotTableSource;
+           XmlElement chart = ChartXml.SelectSingleNode("c:chartSpace/c:chart", NameSpaceManager) as XmlElement;
+
+           var pivotSource = ChartXml.CreateElement("pivotSource", ExcelPackage.schemaChart);
+           chart.ParentNode.InsertBefore(pivotSource, chart);
+           pivotSource.InnerXml = string.Format("<c:name>[]{0}!{1}</c:name><c:fmtId val=\"0\"/>", PivotTableSource.WorkSheet.Name, pivotTableSource.Name);
+
+           var fmts = ChartXml.CreateElement("pivotFmts", ExcelPackage.schemaChart);
+           chart.PrependChild(fmts);
+           fmts.InnerXml = "<c:pivotFmt><c:idx val=\"0\"/><c:marker><c:symbol val=\"none\"/></c:marker></c:pivotFmt>";
+
+           Series.AddPivotSerie(pivotTableSource);
+       }
+       internal override void DeleteMe()
+       {
+           try
+           {
+               foreach (var rel in Part.GetRelationships())
+               {
+                   Part.DeleteRelationship(rel.Id);
+               }
+               Part.Package.DeletePart(UriChart);               
+           }
+           catch (Exception ex)
+           {
+               throw (new InvalidDataException("EPPlus internal error when deleteing chart.", ex));
+           }
+           base.DeleteMe();
+       }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartAxis.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartAxis.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartAxis.cs	(revision 9616)
@@ -0,0 +1,620 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style;
+using System.Globalization;
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Position of the axis.
+    /// </summary>
+    public enum eAxisPosition
+    {
+        Left = 0,
+        Bottom = 1,
+        Right = 2,
+        Top = 3
+    }
+    /// <summary>
+    /// Position of the Y-Axis
+    /// </summary>
+    public enum eYAxisPosition
+    {
+        Left = 0,
+        Right = 2,
+    }
+    /// <summary>
+    /// Position of the X-Axis
+    /// </summary>
+    public enum eXAxisPosition
+    {
+        Bottom = 1,
+        Top = 3
+    }
+    /// <summary>
+    /// Axis orientaion
+    /// </summary>
+    public enum eAxisOrientation
+    {
+        MaxMin,
+        MinMax
+    }
+    /// <summary>
+    /// How the axis are crossed
+    /// </summary>
+    public enum eCrossBetween
+    {
+        /// <summary>
+        /// Specifies the value axis shall cross the category axis between data markers
+        /// </summary>
+        Between,
+        /// <summary>
+        /// Specifies the value axis shall cross the category axis at the midpoint of a category.
+        /// </summary>
+        MidCat
+    }
+    /// <summary>
+    /// Where the axis cross. 
+    /// </summary>
+    public enum eCrosses
+    {
+        /// <summary>
+        /// (Axis Crosses at Zero) The category axis crosses at the zero point of the valueaxis (if possible), or the minimum value (if theminimum is greater than zero) or the maximum (if the maximum is less than zero).
+        /// </summary>
+        AutoZero,
+        /// <summary>
+        /// The axis crosses at the maximum value
+        /// </summary>
+        Max,
+        /// <summary>
+        /// (Axis crosses at the minimum value of the chart.
+        /// </summary>
+        Min
+    }
+    /// <summary>
+    /// Tickmarks
+    /// </summary>
+    public enum eAxisTickMark
+    {
+        /// <summary>
+        /// Specifies the tick marks shall cross the axis. 
+        /// </summary>
+        Cross,   
+        /// <summary>
+        /// Specifies the tick marks shall be inside the plot area. 
+        /// </summary>
+        In,     
+        /// <summary>
+        /// Specifies there shall be no tick marks.
+        /// </summary>
+        None,    
+        /// <summary>
+        /// Specifies the tick marks shall be outside the plot area.
+        /// </summary>
+        Out
+    }
+    /// <summary>
+    /// An axis for a chart
+    /// </summary>
+    public sealed class ExcelChartAxis : XmlHelper
+    {
+        /// <summary>
+        /// Type of axis
+        /// </summary>
+        internal enum eAxisType
+        {
+            /// <summary>
+            /// Value axis
+            /// </summary>
+            Val,
+            /// <summary>
+            /// Category axis
+            /// </summary>
+            Cat,
+            /// <summary>
+            /// Date axis
+            /// </summary>
+            Date
+        }
+        internal ExcelChartAxis(XmlNamespaceManager nameSpaceManager, XmlNode topNode) :
+            base(nameSpaceManager, topNode)
+        {
+            SchemaNodeOrder = new string[] { "axId", "scaling", "logBase", "orientation", "max", "min", "delete", "axPos", "majorGridlines", "title", "numFmt", "majorTickMark", "minorTickMark", "tickLblPos", "spPr", "txPr", "crossAx", "crossesAt", "crosses", "crossBetween", "auto", "lblOffset", "majorUnit", "minorUnit", "dispUnits", "spPr", "txPr" };
+        }
+        internal string Id
+        {
+            get
+            {
+                return GetXmlNodeString("c:axId/@val");
+            }
+        }
+        const string _majorTickMark = "c:majorTickMark/@val";
+        /// <summary>
+        /// majorTickMark 
+        /// This element specifies the major tick marks for the axis. 
+        /// </summary>
+        public eAxisTickMark MajorTickMark
+        {
+            get
+            {
+                return (eAxisTickMark)Enum.Parse( typeof( eAxisTickMark ), GetXmlNodeString( _majorTickMark ) );
+            }
+            set
+            {
+                SetXmlNodeString( _majorTickMark, value.ToString().ToLower() );
+            }
+        }
+
+        const string _minorTickMark = "c:minorTickMark/@val";
+        /// <summary>
+        /// minorTickMark 
+        /// This element specifies the minor tick marks for the axis. 
+        /// </summary>
+        public eAxisTickMark MinorTickMark
+        {
+            get
+            {
+                return (eAxisTickMark)Enum.Parse(typeof(eAxisTickMark), GetXmlNodeString( _minorTickMark ) );
+            }
+            set
+            {
+                SetXmlNodeString(_minorTickMark, value.ToString().ToLower());
+            }
+        }
+         /// <summary>
+        /// Type of axis
+        /// </summary>
+        internal eAxisType AxisType
+        {
+            get
+            {
+                try
+                {
+                    return (eAxisType)Enum.Parse(typeof(eAxisType), TopNode.LocalName.Substring(0,3), true);
+                }
+                catch
+                {
+                    return eAxisType.Val;
+                }
+            }
+        }
+        private string AXIS_POSITION_PATH = "c:axPos/@val";
+        /// <summary>
+        /// Where the axis is located
+        /// </summary>
+        public eAxisPosition AxisPosition
+        {
+            get
+            {                
+                switch(GetXmlNodeString(AXIS_POSITION_PATH))
+                {
+                    case "b":
+                        return eAxisPosition.Bottom;
+                    case "r":
+                        return eAxisPosition.Right;
+                    case "t":
+                        return eAxisPosition.Top;
+                    default: 
+                        return eAxisPosition.Left;
+                }
+            }
+            internal set
+            {
+                SetXmlNodeString(AXIS_POSITION_PATH, value.ToString().ToLower().Substring(0,1));
+            }
+        }
+        const string _crossesPath = "c:crosses/@val";
+        /// <summary>
+        /// Where the axis cross
+        /// </summary>
+        public eCrosses Crosses
+        {
+            get
+            {
+                return (eCrosses)Enum.Parse(typeof(eCrosses), GetXmlNodeString(_crossesPath), true);
+            }
+            set
+            {
+                var v = value.ToString();
+                v = v.Substring(1).ToLower() + v.Substring(1, v.Length - 1);
+                SetXmlNodeString(_crossesPath, v);
+            }
+
+        }
+        const string _crossBetweenPath = "c:crossBetween/@val";
+        /// <summary>
+        /// How the axis are crossed
+        /// </summary>
+        public eCrossBetween CrossBetween
+        {
+            get
+            {
+                return (eCrossBetween)Enum.Parse(typeof(eCrossBetween), GetXmlNodeString(_crossBetweenPath), true);
+            }
+            set
+            {
+                var v = value.ToString();
+                v = v.Substring(1).ToLower() + v.Substring(1, v.Length - 1);
+                SetXmlNodeString(_crossBetweenPath, v);
+            }
+
+        }
+        const string _crossesAtPath = "c:crossesAt/@val";
+        /// <summary>
+        /// The value where the axis cross. 
+        /// Null is automatic
+        /// </summary>
+        public double? CrossesAt
+        {
+            get
+            {
+                return GetXmlNodeDoubleNull(_crossesAtPath);
+            }
+            set
+            {
+                if (value == null)
+                {
+                    DeleteNode(_crossesAtPath);
+                }
+                else
+                {
+                    SetXmlNodeString(_crossesAtPath, ((double)value).ToString(CultureInfo.InvariantCulture));
+                }
+            }
+        }
+        const string _formatPath = "c:numFmt/@formatCode";
+        /// <summary>
+        /// Numberformat
+        /// </summary>
+        public string Format 
+        {
+            get
+            {
+                return GetXmlNodeString(_formatPath);
+            }
+            set
+            {
+                SetXmlNodeString(_formatPath,value);
+            }
+        }
+
+        const string _lblPos = "c:tickLblPos/@val";
+        /// <summary>
+        /// Position of the labels
+        /// </summary>
+        public eTickLabelPosition LabelPosition
+        {
+            get
+            {
+                return (eTickLabelPosition)Enum.Parse(typeof(eTickLabelPosition), GetXmlNodeString(_lblPos), true);
+            }
+            set
+            {
+                string lp = value.ToString();
+                SetXmlNodeString(_lblPos, lp.Substring(0, 1).ToLower() + lp.Substring(1, lp.Length - 1));
+            }
+        }
+        ExcelDrawingFill _fill = null;
+        /// <summary>
+        /// Access to fill properties
+        /// </summary>
+        public ExcelDrawingFill Fill
+        {
+            get
+            {
+                if (_fill == null)
+                {
+                    _fill = new ExcelDrawingFill(NameSpaceManager, TopNode, "c:spPr");
+                }
+                return _fill;
+            }
+        }
+        ExcelDrawingBorder _border = null;
+        /// <summary>
+        /// Access to border properties
+        /// </summary>
+        public ExcelDrawingBorder Border
+        {
+            get
+            {
+                if (_border == null)
+                {
+                    _border = new ExcelDrawingBorder(NameSpaceManager, TopNode, "c:spPr/a:ln");
+                }
+                return _border;
+            }
+        }
+        ExcelTextFont _font = null;
+        /// <summary>
+        /// Access to font properties
+        /// </summary>
+        public ExcelTextFont Font
+        {
+            get
+            {
+                if (_font == null)
+                {
+                    if (TopNode.SelectSingleNode("c:txPr", NameSpaceManager) == null)
+                    {
+                        CreateNode("c:txPr/a:bodyPr");
+                        CreateNode("c:txPr/a:lstStyle");
+                    }
+                    _font = new ExcelTextFont(NameSpaceManager, TopNode, "c:txPr/a:p/a:pPr/a:defRPr", new string[] { "pPr", "defRPr", "solidFill", "uFill", "latin", "cs", "r", "rPr", "t" });
+                }
+                return _font;
+            }
+        }
+        /// <summary>
+        /// If the axis is deleted
+        /// </summary>
+        public bool Deleted 
+        {
+            get
+            {
+                return GetXmlNodeBool("c:delete/@val");
+            }
+            set
+            {
+                SetXmlNodeBool("c:delete/@val", value);
+            }
+        }
+        const string _ticLblPos_Path = "c:tickLblPos/@val";
+        /// <summary>
+        /// Position of the Lables
+        /// </summary>
+        public eTickLabelPosition TickLabelPosition 
+        {
+            get
+            {
+                string v = GetXmlNodeString(_ticLblPos_Path);
+                if (v == "")
+                {
+                    return eTickLabelPosition.None;
+                }
+                else
+                {
+                    return (eTickLabelPosition)Enum.Parse(typeof(eTickLabelPosition), v, true);
+                }
+            }
+            set
+            {
+                string v = value.ToString();
+                v=v.Substring(0, 1).ToLower() + v.Substring(1, v.Length - 1);
+                SetXmlNodeString(_ticLblPos_Path,v);
+            }
+        }
+        ExcelChartTitle _title = null;
+        /// <summary>
+        /// Chart axis title
+        /// </summary>
+        public ExcelChartTitle Title
+        {
+            get
+            {
+                if (_title == null)
+                {
+                    var node = TopNode.SelectSingleNode("c:title", NameSpaceManager);
+                    if (node == null)
+                    {
+                        CreateNode("c:title");
+                        node = TopNode.SelectSingleNode("c:title", NameSpaceManager);
+                        node.InnerXml = "<c:tx><c:rich><a:bodyPr /><a:lstStyle /><a:p><a:r><a:t /></a:r></a:p></c:rich></c:tx><c:layout /><c:overlay val=\"0\" />";
+                    }
+                    _title = new ExcelChartTitle(NameSpaceManager, TopNode);
+                }
+                return _title;
+            }            
+        }
+        #region "Scaling"
+        const string _minValuePath = "c:scaling/c:min/@val";
+        /// <summary>
+        /// Minimum value for the axis.
+        /// Null is automatic
+        /// </summary>
+        public double? MinValue
+        {
+            get
+            {
+                return GetXmlNodeDoubleNull(_minValuePath);
+            }
+            set
+            {
+                if (value == null)
+                {
+                    DeleteNode(_minValuePath);
+                }
+                else
+                {
+                    SetXmlNodeString(_minValuePath, ((double)value).ToString(CultureInfo.InvariantCulture));
+                }
+            }
+        }
+        const string _maxValuePath = "c:scaling/c:max/@val";
+        /// <summary>
+        /// Max value for the axis.
+        /// Null is automatic
+        /// </summary>
+        public double? MaxValue
+        {
+            get
+            {
+                return GetXmlNodeDoubleNull(_maxValuePath);
+            }
+            set
+            {
+                if (value == null)
+                {
+                    DeleteNode(_maxValuePath);
+                }
+                else
+                {
+                    SetXmlNodeString(_maxValuePath, ((double)value).ToString(CultureInfo.InvariantCulture));
+                }
+            }
+        }
+        const string _majorUnitPath = "c:majorUnit/@val";
+        const string _majorUnitCatPath = "c:tickLblSkip/@val";
+        /// <summary>
+        /// Major unit for the axis.
+        /// Null is automatic
+        /// </summary>
+        public double? MajorUnit
+        {
+            get
+            {
+                if (AxisType == eAxisType.Cat)
+                {
+                    return GetXmlNodeDoubleNull(_majorUnitCatPath);
+                }
+                else
+                {
+                    return GetXmlNodeDoubleNull(_majorUnitPath);
+                }
+            }
+            set
+            {
+                if (value == null)
+                {
+                    DeleteNode(_majorUnitPath);
+                    DeleteNode(_majorUnitCatPath);
+                }
+                else
+                {
+                    if (AxisType == eAxisType.Cat)
+                    {
+                        SetXmlNodeString(_majorUnitCatPath, ((double)value).ToString(CultureInfo.InvariantCulture));
+                    }
+                    else
+                    {
+                        SetXmlNodeString(_majorUnitPath, ((double)value).ToString(CultureInfo.InvariantCulture));
+                    }
+                }
+            }
+        }
+        const string _minorUnitPath = "c:minorUnit/@val";
+        const string _minorUnitCatPath = "c:tickMarkSkip/@val";
+        /// <summary>
+        /// Minor unit for the axis.
+        /// Null is automatic
+        /// </summary>
+        public double? MinorUnit
+        {
+            get
+            {
+                if (AxisType == eAxisType.Cat)
+                {
+                    return GetXmlNodeDoubleNull(_minorUnitCatPath);
+                }
+                else
+                {
+                    return GetXmlNodeDoubleNull(_minorUnitPath);
+                }
+            }
+            set
+            {
+                if (value == null)
+                {
+                    DeleteNode(_minorUnitPath);
+                    DeleteNode(_minorUnitCatPath);
+                }
+                else
+                {
+                    if (AxisType == eAxisType.Cat)
+                    {
+                        SetXmlNodeString(_minorUnitCatPath, ((double)value).ToString(CultureInfo.InvariantCulture));
+                    }
+                    else
+                    {
+                        SetXmlNodeString(_minorUnitPath, ((double)value).ToString(CultureInfo.InvariantCulture));
+                    }
+                }
+            }
+        }
+        const string _logbasePath = "c:scaling/c:logBase/@val";
+        /// <summary>
+        /// The base for a logaritmic scale
+        /// Null for a normal scale
+        /// </summary>
+        public double? LogBase
+        {
+            get
+            {
+                return GetXmlNodeDoubleNull(_logbasePath);
+            }
+            set
+            {
+                if (value == null)
+                {
+                    DeleteNode(_logbasePath);
+                }
+                else
+                {
+                    double v = ((double)value);
+                    if (v < 2 || v > 1000)
+                    {
+                        throw(new ArgumentOutOfRangeException("Value must be between 2 and 1000"));
+                    }
+                    SetXmlNodeString(_logbasePath, v.ToString("0.0", CultureInfo.InvariantCulture));
+                }
+            }
+        }
+        const string _orientationPath = "c:scaling/c:orientation/@val";
+        /// <summary>
+        /// 
+        /// </summary>
+        public eAxisOrientation Orientation
+        {
+            get
+            {
+                string v = GetXmlNodeString(_orientationPath);
+                if (v == "")
+                {
+                    return eAxisOrientation.MinMax;
+                }
+                else
+                {
+                    return (eAxisOrientation)Enum.Parse(typeof(eAxisOrientation), v, true);
+                }
+            }
+            set
+            {
+                string s=value.ToString();
+                s=s.Substring(0,1).ToLower() + s.Substring(1,s.Length-1);
+                SetXmlNodeString(_orientationPath, s);
+            }
+        }
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartCollection.cs	(revision 9616)
@@ -0,0 +1,108 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Enumerates charttypes 
+    /// </summary>
+    public class ExcelChartCollection : IEnumerable<ExcelChart>
+    {
+        List<ExcelChart> _list = new List<ExcelChart>();
+        ExcelChart _topChart;
+        internal ExcelChartCollection(ExcelChart chart)
+        {
+            _topChart = chart;
+            _list.Add(chart);
+        }
+        internal void Add(ExcelChart chart)
+        {
+            _list.Add(chart);
+        }
+        /// <summary>
+        /// Add a new charttype to the chart
+        /// </summary>
+        /// <param name="chartType">The type of the new chart</param>
+        /// <returns></returns>
+        public ExcelChart Add(eChartType chartType)
+        {
+            if (_topChart.PivotTableSource != null)
+            {
+                throw (new InvalidOperationException("Can not add other charttypes to a pivot chart"));
+            }
+            else if (ExcelChart.IsType3D(chartType) || _list[0].IsType3D())
+            {
+                throw(new InvalidOperationException("3D charts can not be combined with other charttypes"));
+            }
+
+            var prependingChartNode = _list[_list.Count - 1].TopNode;
+            ExcelChart chart = ExcelChart.GetNewChart(_topChart.WorkSheet.Drawings, _topChart.TopNode, chartType, _topChart, null);
+
+            _list.Add(chart);
+            return chart;
+        }
+        public int Count
+        {
+            get
+            {
+                return _list.Count;
+            }
+        }
+        IEnumerator<ExcelChart> IEnumerable<ExcelChart>.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+        /// <summary>
+        /// Returns a chart at the specific position.  
+        /// </summary>
+        /// <param name="PositionID">The position of the chart. 0-base</param>
+        /// <returns></returns>
+        public ExcelChart this[int PositionID]
+        {
+            get
+            {
+                return (_list[PositionID]);
+            }
+        }
+
+
+}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartDataLabel.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartDataLabel.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartDataLabel.cs	(revision 9616)
@@ -0,0 +1,290 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-12-30
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Datalabel on chart level. 
+    /// This class is inherited by ExcelChartSerieDataLabel
+    /// </summary>
+    public class ExcelChartDataLabel : XmlHelper
+    {
+       internal ExcelChartDataLabel(XmlNamespaceManager ns, XmlNode node)
+           : base(ns,node)
+       {
+           XmlNode topNode = node.SelectSingleNode("c:dLbls", NameSpaceManager);
+           if (topNode == null)
+           {
+               topNode = node.OwnerDocument.CreateElement("c", "dLbls", ExcelPackage.schemaChart);
+               //node.InsertAfter(_topNode, node.SelectSingleNode("c:order", NameSpaceManager));
+               InserAfter(node, "c:marker,c:tx,c:order,c:ser", topNode);
+               SchemaNodeOrder = new string[] { "spPr", "txPr", "dLblPos", "showLegendKey", "showVal", "showCatName", "showSerName", "showPercent", "showBubbleSize", "separator", "showLeaderLines" };
+               topNode.InnerXml = "<c:showLegendKey val=\"0\" /><c:showVal val=\"0\" /><c:showCatName val=\"0\" /><c:showSerName val=\"0\" /><c:showPercent val=\"0\" /><c:showBubbleSize val=\"0\" /> <c:separator>\r\n</c:separator><c:showLeaderLines val=\"0\" />";                      
+           }
+           TopNode = topNode;
+       }
+       #region "Public properties"
+       const string showValPath = "c:showVal/@val";
+       /// <summary>
+       /// Show the values 
+       /// </summary>
+        public bool ShowValue
+       {
+           get
+           {
+               return GetXmlNodeBool(showValPath);
+           }
+           set
+           {
+               SetXmlNodeString(showValPath, value ? "1" : "0");
+           }
+       }
+       const string showCatPath = "c:showCatName/@val";
+       /// <summary>
+       /// Show category names
+       /// </summary>
+        public bool ShowCategory
+       {
+           get
+           {
+               return GetXmlNodeBool(showCatPath);
+           }
+           set
+           {
+               SetXmlNodeString(showCatPath, value ? "1" : "0");
+           }
+       }
+       const string showSerPath = "c:showSerName/@val";
+       /// <summary>
+       /// Show series names
+       /// </summary>
+        public bool ShowSeriesName
+       {
+           get
+           {
+               return GetXmlNodeBool(showSerPath);
+           }
+           set
+           {
+               SetXmlNodeString(showSerPath, value ? "1" : "0");
+           }
+       }
+       const string showPerentPath = "c:showPercent/@val";
+       /// <summary>
+       /// Show percent values
+       /// </summary>
+        public bool ShowPercent
+       {
+           get
+           {
+               return GetXmlNodeBool(showPerentPath);
+           }
+           set
+           {
+               SetXmlNodeString(showPerentPath, value ? "1" : "0");
+           }
+       }
+       const string showLeaderLinesPath = "c:showLeaderLines/@val";
+       /// <summary>
+       /// Show the leader lines
+       /// </summary>
+        public bool ShowLeaderLines
+       {
+           get
+           {
+               return GetXmlNodeBool(showLeaderLinesPath);
+           }
+           set
+           {
+               SetXmlNodeString(showLeaderLinesPath, value ? "1" : "0");
+           }
+       }
+       const string showBubbleSizePath = "c:showBubbleSize/@val";
+       /// <summary>
+       /// Bubble Size.
+       /// </summary>
+        public bool ShowBubbleSize
+       {
+           get
+           {
+               return GetXmlNodeBool(showBubbleSizePath);
+           }
+           set
+           {
+               SetXmlNodeString(showBubbleSizePath, value ? "1" : "0");
+           }
+       }
+       const string showLegendKeyPath = "c:showLegendKey/@val";
+       public bool ShowLegendKey
+       {
+           get
+           {
+               return GetXmlNodeBool(showLegendKeyPath);
+           }
+           set
+           {
+               SetXmlNodeString(showLegendKeyPath, value ? "1" : "0");
+           }
+       }
+       const string separatorPath = "c:separator";
+       /// <summary>
+       /// Separator string 
+       /// </summary>
+        public string Separator
+       {
+           get
+           {
+               return GetXmlNodeString(separatorPath);
+           }
+           set
+           {
+               if (string.IsNullOrEmpty(value))
+               {
+                   DeleteNode(separatorPath);
+               }
+               else
+               {
+                   SetXmlNodeString(separatorPath, value);
+               }
+           }
+       }
+
+       ExcelDrawingFill _fill = null;
+       /// <summary>
+       /// Access fill properties
+       /// </summary>
+       public ExcelDrawingFill Fill
+       {
+           get
+           {
+               if (_fill == null)
+               {
+                   _fill = new ExcelDrawingFill(NameSpaceManager, TopNode, "c:spPr");
+               }
+               return _fill;
+           }
+       }
+       ExcelDrawingBorder _border = null;
+       /// <summary>
+       /// Access border properties
+       /// </summary>
+       public ExcelDrawingBorder Border
+       {
+           get
+           {
+               if (_border == null)
+               {
+                   _border = new ExcelDrawingBorder(NameSpaceManager, TopNode, "c:spPr/a:ln");
+               }
+               return _border;
+           }
+       }
+       string[] _paragraphSchemaOrder = new string[] { "spPr", "txPr", "dLblPos", "showVal", "showCatName", "showSerName", "showPercent", "separator", "showLeaderLines", "pPr", "defRPr", "solidFill", "uFill", "latin", "cs", "r", "rPr", "t" };
+       ExcelTextFont _font = null;
+       /// <summary>
+       /// Access font properties
+       /// </summary>
+       public ExcelTextFont Font
+       {
+           get
+           {
+               if (_font == null)
+               {
+                   if (TopNode.SelectSingleNode("c:txPr", NameSpaceManager) == null)
+                   {
+                       CreateNode("c:txPr/a:bodyPr");
+                       CreateNode("c:txPr/a:lstStyle");
+                   }
+                   _font = new ExcelTextFont(NameSpaceManager, TopNode, "c:txPr/a:p/a:pPr/a:defRPr", _paragraphSchemaOrder);
+               }
+               return _font;
+           }
+       }
+       #endregion
+       #region "Position Enum Translation"
+       protected string GetPosText(eLabelPosition pos)
+       {
+           switch (pos)
+           {
+               case eLabelPosition.Bottom:
+                   return "b";
+               case eLabelPosition.Center:
+                   return "ctr";
+               case eLabelPosition.InBase:
+                   return "inBase";
+               case eLabelPosition.InEnd:
+                   return "inEnd";
+               case eLabelPosition.Left:
+                   return "l";
+               case eLabelPosition.Right:
+                   return "r";
+               case eLabelPosition.Top:
+                   return "t";
+               case eLabelPosition.OutEnd:
+                   return "outEnd";
+               default:
+                   return "bestFit";
+           }
+       }
+
+       protected eLabelPosition GetPosEnum(string pos)
+       {
+           switch (pos)
+           {
+               case "b":
+                   return eLabelPosition.Bottom;
+               case "ctr":
+                   return eLabelPosition.Center;
+               case "inBase":
+                   return eLabelPosition.InBase;
+               case "inEnd":
+                   return eLabelPosition.InEnd;
+               case "l":
+                   return eLabelPosition.Left;
+               case "r":
+                   return eLabelPosition.Right;
+               case "t":
+                   return eLabelPosition.Top;
+               case "outEnd":
+                   return eLabelPosition.OutEnd;
+               default:
+                   return eLabelPosition.BestFit;
+           }
+       }
+    #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartLegend.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartLegend.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartLegend.cs	(revision 9616)
@@ -0,0 +1,199 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Position of the legend
+    /// </summary>
+    public enum eLegendPosition
+    {
+        Top,
+        Left,
+        Right,
+        Bottom,
+        TopRight
+    }
+    /// <summary>
+    /// Chart ledger
+    /// </summary>
+    public class ExcelChartLegend : XmlHelper
+    {
+        ExcelChart _chart;
+        internal ExcelChartLegend(XmlNamespaceManager ns, XmlNode node, ExcelChart chart)
+           : base(ns,node)
+       {
+           _chart=chart;
+           SchemaNodeOrder = new string[] { "legendPos", "layout","overlay", "txPr", "bodyPr", "lstStyle", "spPr" };
+       }
+        const string POSITION_PATH = "c:legendPos/@val";
+        /// <summary>
+        /// Position of the Legend
+        /// </summary>
+        public eLegendPosition Position 
+        {
+            get
+            {
+                switch(GetXmlNodeString(POSITION_PATH).ToLower())
+                {
+                    case "t":
+                        return eLegendPosition.Top;
+                    case "b":
+                        return eLegendPosition.Bottom;
+                    case "l":
+                        return eLegendPosition.Left;
+                    case "tr":
+                        return eLegendPosition.TopRight;
+                    default:
+                        return eLegendPosition.Right;
+                }
+            }
+            set
+            {
+                if (TopNode == null) throw(new Exception("Can't set position. Chart has no legend"));
+                switch (value)
+                {
+                    case eLegendPosition.Top:
+                        SetXmlNodeString(POSITION_PATH, "t");
+                        break;
+                    case eLegendPosition.Bottom:
+                        SetXmlNodeString(POSITION_PATH, "b");
+                        break;
+                    case eLegendPosition.Left:
+                        SetXmlNodeString(POSITION_PATH, "l");
+                        break;
+                    case eLegendPosition.TopRight:
+                        SetXmlNodeString(POSITION_PATH, "tr");
+                        break;
+                    default:
+                        SetXmlNodeString(POSITION_PATH, "r");
+                        break;
+                }
+            }
+        }
+        const string OVERLAY_PATH = "c:overlay/@val";
+        /// <summary>
+        /// If the legend overlays other objects
+        /// </summary>
+        public bool Overlay
+        {
+            get
+            {
+                return GetXmlNodeBool(OVERLAY_PATH);
+            }
+            set
+            {
+                if (TopNode == null) throw (new Exception("Can't set overlay. Chart has no legend"));
+                SetXmlNodeBool(OVERLAY_PATH, value);
+            }
+        }
+        ExcelDrawingFill _fill = null;
+        /// <summary>
+        /// Fill style
+        /// </summary>
+        public ExcelDrawingFill Fill
+        {
+            get
+            {
+                if (_fill == null)
+                {
+                    _fill = new ExcelDrawingFill(NameSpaceManager, TopNode, "c:spPr");
+                }
+                return _fill;
+            }
+        }
+        ExcelDrawingBorder _border = null;
+        /// <summary>
+        /// Border style
+        /// </summary>
+        public ExcelDrawingBorder Border
+        {
+            get
+            {
+                if (_border == null)
+                {
+                    _border = new ExcelDrawingBorder(NameSpaceManager, TopNode, "c:spPr/a:ln");
+                }
+                return _border;
+            }
+        }
+        ExcelTextFont _font = null;
+        /// <summary>
+        /// Font properties
+        /// </summary>
+        public ExcelTextFont Font
+        {
+            get
+            {
+                if (_font == null)
+                {
+                    if (TopNode.SelectSingleNode("c:txPr",NameSpaceManager) == null)
+                    {
+                        CreateNode("c:txPr/a:bodyPr");
+                        CreateNode("c:txPr/a:lstStyle");
+                    }
+                    _font = new ExcelTextFont(NameSpaceManager, TopNode, "c:txPr/a:p/a:pPr/a:defRPr", new string[] { "legendPos", "layout", "pPr", "defRPr", "solidFill", "uFill", "latin", "cs", "r", "rPr", "t" });
+                }
+                return _font;
+            }
+        }
+        /// <summary>
+        /// Remove the legend
+        /// </summary>
+        public void Remove()
+        {
+            if (TopNode == null) return;
+            TopNode.ParentNode.RemoveChild(TopNode);
+            TopNode = null;
+        }
+        /// <summary>
+        /// Add a legend to the chart
+        /// </summary>
+        public void Add()
+        {
+            if(TopNode!=null) return;
+
+            //XmlHelper xml = new XmlHelper(NameSpaceManager, _chart.ChartXml);
+            XmlHelper xml = XmlHelperFactory.Create(NameSpaceManager, _chart.ChartXml);
+            xml.SchemaNodeOrder=_chart.SchemaNodeOrder;
+
+            xml.CreateNode("c:chartSpace/c:chart/c:legend");
+            TopNode = _chart.ChartXml.SelectSingleNode("c:chartSpace/c:chart/c:legend", NameSpaceManager);
+            TopNode.InnerXml="<c:legendPos val=\"r\" /><c:layout />";                        
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartPlotArea.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartPlotArea.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartPlotArea.cs	(revision 9616)
@@ -0,0 +1,88 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-12-30
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// A charts plot area
+    /// </summary>
+    public sealed class ExcelChartPlotArea :  XmlHelper
+    {
+        ExcelChart _firstChart;
+        internal ExcelChartPlotArea(XmlNamespaceManager ns, XmlNode node, ExcelChart firstChart)
+           : base(ns,node)
+       {
+           _firstChart = firstChart;
+       }
+
+        ExcelChartCollection _chartTypes;
+        public ExcelChartCollection ChartTypes
+        {
+            get
+            {
+                if (_chartTypes == null)
+                {
+                    _chartTypes = new ExcelChartCollection(_firstChart); 
+                }
+                return _chartTypes;
+            }
+        }
+        ExcelDrawingFill _fill = null;
+        public ExcelDrawingFill Fill
+        {
+            get
+            {
+                if (_fill == null)
+                {
+                    _fill = new ExcelDrawingFill(NameSpaceManager, TopNode, "c:spPr");
+                }
+                return _fill;
+            }
+        }
+        ExcelDrawingBorder _border = null;
+        public ExcelDrawingBorder Border
+        {
+            get
+            {
+                if (_border == null)
+                {
+                    _border = new ExcelDrawingBorder(NameSpaceManager, TopNode, "c:spPr/a:ln");
+                }
+                return _border;
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartSerie.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartSerie.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartSerie.cs	(revision 9616)
@@ -0,0 +1,225 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-12-30
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using System.Collections;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+   /// <summary>
+   /// A chart serie
+   /// </summary>
+    public class ExcelChartSerie : XmlHelper
+   {
+       internal ExcelChartSeries _chartSeries;
+       protected XmlNode _node;
+       protected XmlNamespaceManager _ns;
+        /// <summary>
+        /// Default constructor
+        /// </summary>
+        /// <param name="chartSeries">Parent collection</param>
+        /// <param name="ns">Namespacemanager</param>
+        /// <param name="node">Topnode</param>
+       /// <param name="isPivot">Is pivotchart</param>
+       internal ExcelChartSerie(ExcelChartSeries chartSeries, XmlNamespaceManager ns, XmlNode node, bool isPivot)
+           : base(ns,node)
+       {
+           _chartSeries = chartSeries;
+           _node=node;
+           _ns=ns;
+           SchemaNodeOrder = new string[] { "idx", "order", "tx", "marker","trendline", "explosion", "dLbls", "cat", "val", "yVal","xVal", "smooth" };
+
+           if (chartSeries.Chart.ChartType == eChartType.XYScatter ||
+               chartSeries.Chart.ChartType == eChartType.XYScatterLines ||
+               chartSeries.Chart.ChartType == eChartType.XYScatterLinesNoMarkers ||
+               chartSeries.Chart.ChartType == eChartType.XYScatterSmooth ||
+               chartSeries.Chart.ChartType == eChartType.XYScatterSmoothNoMarkers)
+           {
+               _seriesTopPath = "c:yVal";
+               _xSeriesTopPath = "c:xVal";
+           }
+           else
+           {
+               _seriesTopPath = "c:val";
+               _xSeriesTopPath = "c:cat";
+           }
+           _seriesPath = string.Format(_seriesPath, _seriesTopPath);
+           _xSeriesPath = string.Format(_xSeriesPath, _xSeriesTopPath, isPivot ? "c:multiLvlStrRef" : "c:numRef");
+       }
+       internal void SetID(string id)
+       {
+           SetXmlNodeString("c:idx/@val",id);
+           SetXmlNodeString("c:order/@val", id);
+       }
+       const string headerPath="c:tx/c:v";
+       /// <summary>
+       /// Header for the serie.
+       /// </summary>
+       public string Header 
+       {
+           get
+           {
+                return GetXmlNodeString(headerPath);
+            }
+            set
+            {
+                Cleartx();
+                SetXmlNodeString(headerPath, value);            
+            }
+        }
+
+       private void Cleartx()
+       {
+           var n = TopNode.SelectSingleNode("c:tx", NameSpaceManager);
+           if (n != null)
+           {
+               n.InnerXml = "";
+           }
+       }
+       const string headerAddressPath = "c:tx/c:strRef/c:f";
+        /// <summary>
+       /// Header address for the serie.
+       /// </summary>
+       public ExcelAddressBase HeaderAddress
+       {
+           get
+           {
+               string address = GetXmlNodeString(headerAddressPath);
+               if (address == "")
+               {
+                   return null;
+               }
+               else
+               {
+                   return new ExcelAddressBase(address);
+               }
+            }
+            set
+            {
+                if (value._fromCol != value._toCol || value._fromRow != value._toRow || value.Addresses != null)
+                {
+                    throw (new Exception("Address must be a single cell"));
+                }
+
+                Cleartx();
+                SetXmlNodeString(headerAddressPath, ExcelCell.GetFullAddress(value.WorkSheet, value.Address));
+                SetXmlNodeString("c:tx/c:strRef/c:strCache/c:ptCount/@val", "0");
+            }
+        }        
+        string _seriesTopPath;
+        string _seriesPath = "{0}/c:numRef/c:f";       
+       /// <summary>
+       /// Set this to a valid address or the drawing will be invalid.
+       /// </summary>
+       public string Series
+       {
+           get
+           {
+               return GetXmlNodeString(_seriesPath);
+           }
+           set
+           {
+               if (_chartSeries.Chart.ChartType == eChartType.Bubble)
+               {
+                   throw(new Exception("Bubble charts is not supported yet"));
+               }
+               CreateNode(_seriesPath,true);
+               SetXmlNodeString(_seriesPath, ExcelCellBase.GetFullAddress(_chartSeries.Chart.WorkSheet.Name, value));
+               
+               XmlNode cache = TopNode.SelectSingleNode(string.Format("{0}/c:numRef/c:numCache",_seriesTopPath), _ns);
+               if (cache != null)
+               {
+                   cache.ParentNode.RemoveChild(cache);
+               }
+
+               if (_chartSeries.Chart.PivotTableSource != null)
+               {
+                   SetXmlNodeString(string.Format("{0}/c:numRef/c:numCache", _seriesTopPath), "General");
+               }
+               
+               XmlNode lit = TopNode.SelectSingleNode(string.Format("{0}/c:numLit",_seriesTopPath), _ns);
+               if (lit != null)
+               {
+                   lit.ParentNode.RemoveChild(lit);
+               }
+           }
+
+       }
+       string _xSeriesTopPath;
+       string _xSeriesPath = "{0}/{1}/c:f";
+       /// <summary>
+       /// Set an address for the horisontal labels
+       /// </summary>
+       public string XSeries
+       {
+           get
+           {
+               return GetXmlNodeString(_xSeriesPath);
+           }
+           set
+           {
+               CreateNode(_xSeriesPath, true);
+               SetXmlNodeString(_xSeriesPath, ExcelCellBase.GetFullAddress(_chartSeries.Chart.WorkSheet.Name, value));
+
+               XmlNode cache = TopNode.SelectSingleNode(string.Format("{0}/c:numRef/c:numCache",_xSeriesTopPath), _ns);
+               if (cache != null)
+               {
+                   cache.ParentNode.RemoveChild(cache);
+               }
+
+               XmlNode lit = TopNode.SelectSingleNode(string.Format("{0}/c:numLit",_xSeriesTopPath), _ns);
+               if (lit != null)
+               {
+                   lit.ParentNode.RemoveChild(lit);
+               }
+           }
+       }
+       ExcelChartTrendlineCollection _trendLines = null;
+       /// <summary>
+       /// Access to the trendline collection
+       /// </summary>
+        public ExcelChartTrendlineCollection TrendLines
+        {
+            get
+            {
+                if (_trendLines == null)
+                {
+                    _trendLines = new ExcelChartTrendlineCollection(this);
+                }
+                return _trendLines;
+            }
+        }
+   }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartSerieDataLabel.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartSerieDataLabel.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartSerieDataLabel.cs	(revision 9616)
@@ -0,0 +1,118 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Datalabel properties
+    /// </summary>
+    public sealed class ExcelChartSerieDataLabel : ExcelChartDataLabel
+    {
+       internal ExcelChartSerieDataLabel(XmlNamespaceManager ns, XmlNode node)
+           : base(ns,node)
+       {
+           CreateNode(positionPath);
+           Position = eLabelPosition.Center;
+       }
+
+       const string positionPath="c:dLblPos/@val";
+       /// <summary>
+       /// Position of the labels
+       /// </summary>
+       public eLabelPosition Position
+       {
+           get
+           {
+               return GetPosEnum(GetXmlNodeString(positionPath));
+           }
+           set
+           {
+               SetXmlNodeString(positionPath,GetPosText(value));
+           }
+       }
+       ExcelDrawingFill _fill = null;
+       /// <summary>
+       /// Access fill properties
+       /// </summary>
+        public new ExcelDrawingFill Fill
+       {
+           get
+           {
+               if (_fill == null)
+               {
+                   _fill = new ExcelDrawingFill(NameSpaceManager, TopNode, "c:spPr");
+               }    
+               return _fill;
+           }
+       }
+       ExcelDrawingBorder _border = null;
+       /// <summary>
+       /// Access border properties
+       /// </summary>
+        public new ExcelDrawingBorder Border
+       {
+           get
+           {
+               if (_border == null)
+               {
+                   _border = new ExcelDrawingBorder(NameSpaceManager, TopNode, "c:spPr/a:ln");
+               }
+               return _border;
+           }
+       }
+       ExcelTextFont _font = null;
+       /// <summary>
+       /// Access font properties
+       /// </summary>
+        public new ExcelTextFont Font
+       {
+           get
+           {
+               if (_font == null)
+               {
+                   if (TopNode.SelectSingleNode("c:txPr", NameSpaceManager) == null)
+                   {
+                       CreateNode("c:txPr/a:bodyPr");
+                       CreateNode("c:txPr/a:lstStyle");
+                   }
+                   _font = new ExcelTextFont(NameSpaceManager, TopNode, "c:txPr/a:p/a:pPr/a:defRPr", new string[] { "spPr", "txPr", "dLblPos", "showVal", "showCatName ", "pPr", "defRPr", "solidFill", "uFill", "latin", "cs", "r", "rPr", "t" });
+               }
+               return _font;
+           }
+       }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartSeries.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartSeries.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartSeries.cs	(revision 9616)
@@ -0,0 +1,333 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using System.Collections;
+using OfficeOpenXml.Table.PivotTable;
+namespace OfficeOpenXml.Drawing.Chart
+{
+   /// <summary>
+   /// Collection class for chart series
+   /// </summary>
+    public sealed class ExcelChartSeries : XmlHelper, IEnumerable
+    {
+       List<ExcelChartSerie> _list=new List<ExcelChartSerie>();
+       internal ExcelChart _chart;
+       XmlNode _node;
+       XmlNamespaceManager _ns;
+       internal ExcelChartSeries(ExcelChart chart, XmlNamespaceManager ns, XmlNode node, bool isPivot)
+           : base(ns,node)
+       {
+           _ns = ns;
+           _chart=chart;
+           _node=node;
+           _isPivot = isPivot;
+           SchemaNodeOrder = new string[] { "view3D", "plotArea", "barDir", "grouping", "scatterStyle", "varyColors", "ser", "explosion", "dLbls", "firstSliceAng", "holeSize", "shape", "legend", "axId" };
+           foreach(XmlNode n in node.SelectNodes("c:ser",ns))
+           {
+               ExcelChartSerie s;
+               if (chart.ChartNode.LocalName == "scatterChart")
+               {
+                   s = new ExcelScatterChartSerie(this, ns, n, isPivot);
+               }
+               else if (chart.ChartNode.LocalName == "lineChart")
+               {
+                   s = new ExcelLineChartSerie(this, ns, n, isPivot);
+               }
+               else if (chart.ChartNode.LocalName == "pieChart" ||
+                        chart.ChartNode.LocalName == "ofPieChart" ||
+                        chart.ChartNode.LocalName == "pie3DChart" ||
+                        chart.ChartNode.LocalName == "doughnutChart")                                                                       
+               {
+                   s = new ExcelPieChartSerie(this, ns, n, isPivot);
+               }
+               else
+               {
+                   s = new ExcelChartSerie(this, ns, n, isPivot);
+               }
+               _list.Add(s);
+           }
+       }
+
+       #region IEnumerable Members
+
+       public IEnumerator GetEnumerator()
+       {
+           return (_list.GetEnumerator());
+       }
+       /// <summary>
+       /// Returns the serie at the specified position.  
+       /// </summary>
+       /// <param name="PositionID">The position of the series.</param>
+       /// <returns></returns>
+       public ExcelChartSerie this[int PositionID]
+       {
+           get
+           {
+               return (_list[PositionID]);
+           }
+       }
+       public int Count
+       {
+           get
+           {
+               return _list.Count;
+           }
+       }
+       /// <summary>
+       /// Delete the chart at the specific position
+       /// </summary>
+       /// <param name="PositionID">Zero based</param>
+       public void Delete(int PositionID)
+       {
+           ExcelChartSerie ser = _list[PositionID];
+           ser.TopNode.ParentNode.RemoveChild(ser.TopNode);
+           _list.RemoveAt(PositionID);
+       }
+       #endregion
+       /// <summary>
+       /// A reference to the chart object
+       /// </summary>
+       public ExcelChart Chart
+       {
+           get
+           {
+               return _chart;
+           }
+       }
+       #region "Add Series"
+
+       /// <summary>
+       /// Add a new serie to the chart. Do not apply to pivotcharts.
+       /// </summary>
+       /// <param name="Serie">The Y-Axis range</param>
+       /// <param name="XSerie">The X-Axis range</param>
+       /// <returns></returns>
+       public ExcelChartSerie Add(ExcelRangeBase Serie, ExcelRangeBase XSerie)
+       {
+           if (_chart.PivotTableSource != null)
+           {
+               throw (new InvalidOperationException("Can't add a serie to a pivotchart"));
+           }
+           return AddSeries(Serie.FullAddressAbsolute, XSerie.FullAddressAbsolute);
+       }
+       /// <summary>
+       /// Add a new serie to the chart.Do not apply to pivotcharts.
+       /// </summary>
+       /// <param name="SerieAddress">The Y-Axis range</param>
+       /// <param name="XSerieAddress">The X-Axis range</param>
+       /// <returns></returns>
+       public ExcelChartSerie Add(string SerieAddress, string XSerieAddress)
+       {
+           if (_chart.PivotTableSource != null)
+           {
+               throw (new InvalidOperationException("Can't add a serie to a pivotchart"));
+           }
+           return AddSeries(SerieAddress, XSerieAddress);
+       }
+       private ExcelChartSerie AddSeries(string SeriesAddress, string XSeriesAddress)
+        {
+               XmlElement ser = _node.OwnerDocument.CreateElement("ser", ExcelPackage.schemaChart);
+               XmlNodeList node = _node.SelectNodes("c:ser", _ns);
+               if (node.Count > 0)
+               {
+                   _node.InsertAfter(ser, node[node.Count-1]);
+               }
+               else
+               {
+                   InserAfter(_node, "c:varyColors,c:grouping,c:barDir,c:scatterStyle", ser);
+                }
+               int idx = FindIndex();
+               ser.InnerXml = string.Format("<c:idx val=\"{1}\" /><c:order val=\"{1}\" /><c:tx><c:strRef><c:f></c:f><c:strCache><c:ptCount val=\"1\" /></c:strCache></c:strRef></c:tx>{5}{0}{2}{3}{4}", AddExplosion(Chart.ChartType), idx, AddScatterPoint(Chart.ChartType), AddAxisNodes(Chart.ChartType), AddSmooth(Chart.ChartType), AddMarker(Chart.ChartType));
+               ExcelChartSerie serie;
+               switch (Chart.ChartType)
+               {
+                   case eChartType.XYScatter:
+                   case eChartType.XYScatterLines:
+                   case eChartType.XYScatterLinesNoMarkers:
+                   case eChartType.XYScatterSmooth:
+                   case eChartType.XYScatterSmoothNoMarkers:
+                       serie = new ExcelScatterChartSerie(this, NameSpaceManager, ser, _isPivot);
+                       break;
+                   case eChartType.Pie:
+                   case eChartType.Pie3D:
+                   case eChartType.PieExploded:
+                   case eChartType.PieExploded3D:
+                   case eChartType.PieOfPie:
+                   case eChartType.Doughnut:
+                   case eChartType.DoughnutExploded:
+                   case eChartType.BarOfPie:
+                       serie = new ExcelPieChartSerie(this, NameSpaceManager, ser, _isPivot);
+                       break;
+                   case eChartType.Line:
+                   case eChartType.LineMarkers:
+                   case eChartType.LineMarkersStacked:
+                   case eChartType.LineMarkersStacked100:
+                   case eChartType.LineStacked:
+                   case eChartType.LineStacked100:
+                       serie = new ExcelLineChartSerie(this, NameSpaceManager, ser, _isPivot);
+                       if (Chart.ChartType == eChartType.LineMarkers ||
+                           Chart.ChartType == eChartType.LineMarkersStacked ||
+                           Chart.ChartType == eChartType.LineMarkersStacked100)
+                       {
+                           ((ExcelLineChartSerie)serie).Marker = eMarkerStyle.Square;
+                       }
+                       ((ExcelLineChartSerie)serie).Smooth = ((ExcelLineChart)Chart).Smooth;
+                       break;
+
+                   default:
+                       serie = new ExcelChartSerie(this, NameSpaceManager, ser, _isPivot);
+                       break;
+               }               
+               serie.Series = SeriesAddress;
+               serie.XSeries = XSeriesAddress;               
+           _list.Add(serie);
+               return serie;
+        }
+       bool _isPivot;
+       internal void AddPivotSerie(ExcelPivotTable pivotTableSource)
+       {
+           var r=pivotTableSource.WorkSheet.Cells[pivotTableSource.Address.Address];
+           _isPivot = true;
+           AddSeries(r.Offset(0, 1, r._toRow - r._fromRow + 1, 1).FullAddressAbsolute, r.Offset(0, 0, r._toRow - r._fromRow + 1, 1).FullAddressAbsolute);
+       }
+       private int FindIndex()
+       {    
+           int ret = 0, newID=0;
+           if (_chart.PlotArea.ChartTypes.Count > 1)
+           {
+               foreach (var chart in _chart.PlotArea.ChartTypes)
+               {
+                   if (newID>0)
+                   {
+                       foreach (ExcelChartSerie serie in chart.Series)
+                       {
+                           serie.SetID((++newID).ToString());
+                       }
+                   }
+                   else
+                   {
+                       if (chart == _chart)
+                       {
+                           ret += _list.Count + 1;
+                           newID=ret;
+                       }
+                       else
+                       {
+                           ret += chart.Series.Count;
+                       }
+                   }
+               }
+               return ret-1;
+           }
+           else
+           {
+               return _list.Count;
+           }
+       }
+       #endregion
+       #region "Xml init Functions"
+       private string AddMarker(eChartType chartType)
+       {
+           if (chartType == eChartType.Line ||
+               chartType == eChartType.LineStacked ||
+               chartType == eChartType.LineStacked100 ||
+               chartType == eChartType.XYScatterLines ||
+               chartType == eChartType.XYScatterSmooth ||
+               chartType == eChartType.XYScatterLinesNoMarkers ||
+               chartType == eChartType.XYScatterSmoothNoMarkers)
+           {
+               return "<c:marker><c:symbol val=\"none\" /></c:marker>";
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddScatterPoint(eChartType chartType)
+       {
+           if (chartType == eChartType.XYScatter)
+           {
+               return "<c:spPr><a:ln w=\"28575\"><a:noFill /></a:ln></c:spPr>";
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddAxisNodes(eChartType chartType)
+       {
+           if ( chartType == eChartType.XYScatter ||
+                chartType == eChartType.XYScatterLines ||
+                chartType == eChartType.XYScatterLinesNoMarkers ||
+                chartType == eChartType.XYScatterSmooth ||
+                chartType == eChartType.XYScatterSmoothNoMarkers)
+           {
+               return "<c:xVal /><c:yVal />";
+           }
+           else
+           {
+               return "<c:val />";
+           }
+       }
+
+       private string AddExplosion(eChartType chartType)
+       {
+           if (chartType == eChartType.PieExploded3D ||
+              chartType == eChartType.PieExploded ||
+               chartType == eChartType.DoughnutExploded)
+           {
+               return "<c:explosion val=\"25\" />"; //Default 25;
+           }
+           else
+           {
+               return "";
+           }
+       }
+       private string AddSmooth(eChartType chartType)
+       {
+           if (chartType == eChartType.XYScatterSmooth ||
+              chartType == eChartType.XYScatterSmoothNoMarkers)
+           {
+               return "<c:smooth val=\"1\" />"; //Default 25;
+           }
+           else
+           {
+               return "";
+           }
+       }
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartTitle.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartTitle.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartTitle.cs	(revision 9616)
@@ -0,0 +1,236 @@
+﻿/************** *****************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// The title of a chart
+    /// </summary>
+    public class ExcelChartTitle : XmlHelper
+    {
+        internal ExcelChartTitle(XmlNamespaceManager nameSpaceManager, XmlNode node) :
+            base(nameSpaceManager, node)
+        {
+            XmlNode topNode = node.SelectSingleNode("c:title", NameSpaceManager);
+            if (topNode == null)
+            {
+                topNode = node.OwnerDocument.CreateElement("c", "title", ExcelPackage.schemaChart);
+                node.InsertBefore(topNode, node.ChildNodes[0]);
+                topNode.InnerXml = "<c:tx><c:rich><a:bodyPr /><a:lstStyle /><a:p><a:r><a:t /></a:r></a:p></c:rich></c:tx><c:layout /><c:overlay val=\"0\" />";
+            }
+            TopNode = topNode;
+            SchemaNodeOrder = new string[] { "tx","bodyPr", "lstStyle", "layout", "overlay" };
+        }
+        const string titlePath = "c:tx/c:rich/a:p/a:r/a:t";
+        /// <summary>
+        /// The text
+        /// </summary>
+        public string Text
+        {
+            get
+            {
+                //return GetXmlNode(titlePath);
+                return RichText.Text;
+            }
+            set
+            {
+                //SetXmlNode(titlePath, value);
+                RichText.Text = value;
+            }
+        }
+        ExcelDrawingBorder _border = null;
+        /// <summary>
+        /// A reference to the border properties
+        /// </summary>
+        public ExcelDrawingBorder Border
+        {
+            get
+            {
+                if (_border == null)
+                {
+                    _border = new ExcelDrawingBorder(NameSpaceManager, TopNode, "c:spPr/a:ln");
+                }
+                return _border;
+            }
+        }
+        ExcelDrawingFill _fill = null;
+        /// <summary>
+        /// A reference to the fill properties
+        /// </summary>
+        public ExcelDrawingFill Fill
+        {
+            get
+            {
+                if (_fill == null)
+                {
+                    _fill = new ExcelDrawingFill(NameSpaceManager, TopNode, "c:spPr");
+                }
+                return _fill;
+            }
+        }
+        //ExcelTextFont _font = null;
+        /// <summary>
+        /// A reference to the font properties
+        /// </summary>
+        public ExcelTextFont Font
+        {
+            get
+            {
+                //if (_font == null)
+                //{
+                //    _font = new ExcelTextFont(NameSpaceManager, TopNode, "c:tx/c:rich/a:p/a:r/a:rPr", new string[] { "rPr", "solidFill", "uFill", "latin", "cs", "r", "rPr", "t" });
+                //}
+                //return _font;
+                if (_richText==null || _richText.Count == 0)
+                {
+                    RichText.Add("");
+                }
+                return _richText[0];
+            }
+        }
+        string[] paragraphNodeOrder = new string[] { "pPr", "defRPr", "solidFill", "uFill", "latin", "cs", "r", "rPr", "t" };
+        ExcelParagraphCollection _richText = null;
+        /// <summary>
+        /// Richtext
+        /// </summary>
+        public ExcelParagraphCollection RichText
+        {
+            get
+            {
+                if (_richText == null)
+                {
+                    _richText = new ExcelParagraphCollection(NameSpaceManager, TopNode, "c:tx/c:rich/a:p", paragraphNodeOrder);
+                }
+                return _richText;
+            }
+        }
+        /// <summary>
+        /// Show without overlaping the chart.
+        /// </summary>
+        public bool Overlay
+        {
+            get
+            {
+                return GetXmlNodeBool("c:overlay/@val");
+            }
+            set
+            {
+                SetXmlNodeBool("c:overlay/@val", value);
+            }
+        }
+        /// <summary>
+        /// Specifies the centering of the text box. 
+        /// The way it works fundamentally is to determine the smallest possible "bounds box" for the text and then to center that "bounds box" accordingly. 
+        /// This is different than paragraph alignment, which aligns the text within the "bounds box" for the text. 
+        /// This flag is compatible with all of the different kinds of anchoring. 
+        /// If this attribute is omitted, then a value of 0 or false is implied.
+        /// </summary>
+        public bool AnchorCtr
+        {
+            get
+            {
+                return GetXmlNodeBool("c:tx/c:rich/a:bodyPr/@anchorCtr", false);
+            }
+            set
+            {
+                SetXmlNodeBool("c:tx/c:rich/a:bodyPr/@anchorCtr", value, false);
+            }
+        }
+        public eTextAnchoringType Anchor
+        {
+            get
+            {
+                return ExcelDrawing.GetTextAchoringEnum(GetXmlNodeString("c:tx/c:rich/a:bodyPr/@anchor"));
+            }
+            set
+            {
+                SetXmlNodeString("c:tx/c:rich/a:bodyPr/@anchorCtr", ExcelDrawing.GetTextAchoringText(value));
+            }
+        }
+        const string TextVerticalPath = "xdr:sp/xdr:txBody/a:bodyPr/@vert";
+        /// <summary>
+        /// Vertical text
+        /// </summary>
+        public eTextVerticalType TextVertical
+        {
+            get
+            {
+                return ExcelDrawing.GetTextVerticalEnum(GetXmlNodeString("c:tx/c:rich/a:bodyPr/@vert"));
+            }
+            set
+            {
+                SetXmlNodeString("c:tx/c:rich/a:bodyPr/@vert", ExcelDrawing.GetTextVerticalText(value));
+            }
+        }
+        /// <summary>
+        /// Rotation in degrees (0-360)
+        /// </summary>
+        public double Rotation
+        {
+            get
+            {
+                var i=GetXmlNodeInt("c:tx/c:rich/a:bodyPr/@rot");
+                if (i < 0)
+                {
+                    return 360 - (i / 60000);
+                }
+                else
+                {
+                    return (i / 60000);
+                }
+            }
+            set
+            {
+                int v;
+                if(value <0 || value > 360)
+                {
+                    throw(new ArgumentOutOfRangeException("Rotation must be between 0 and 360"));
+                }
+
+                if (value > 180)
+                {
+                    v = (int)((value - 360) * 60000);
+                }
+                else
+                {
+                    v = (int)(value * 60000);
+                }
+                SetXmlNodeString("c:tx/c:rich/a:bodyPr/@rot", v.ToString());
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartTrendline.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartTrendline.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelChartTrendline.cs	(revision 9616)
@@ -0,0 +1,298 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2011-05-25
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// A collection of trendlines.
+    /// </summary>
+    public class ExcelChartTrendlineCollection : IEnumerable<ExcelChartTrendline>
+    {
+        List<ExcelChartTrendline> _list = new List<ExcelChartTrendline>();
+        ExcelChartSerie _serie;
+        internal ExcelChartTrendlineCollection(ExcelChartSerie serie)
+        {
+            _serie = serie;
+            foreach (XmlNode node in _serie.TopNode.SelectNodes("c:trendline", _serie.NameSpaceManager))
+            {
+                _list.Add(new ExcelChartTrendline(_serie.NameSpaceManager, node));
+            }
+        }
+        /// <summary>
+        /// Add a new trendline
+        /// </summary>
+        /// <param name="Type"></param>
+        /// <returns>The trendline</returns>
+        public ExcelChartTrendline Add(eTrendLine Type)
+        {
+            if (_serie._chartSeries._chart.IsType3D() ||
+                _serie._chartSeries._chart.IsTypePercentStacked() ||
+                _serie._chartSeries._chart.IsTypeStacked() ||
+                _serie._chartSeries._chart.IsTypePieDoughnut())
+            {
+                throw(new ArgumentException("Trendlines don't apply to 3d-charts, stacked charts, pie charts or doughnut charts"));
+            }
+            ExcelChartTrendline tl;
+            XmlNode insertAfter;
+            if (_list.Count > 0)
+            {
+                insertAfter = _list[_list.Count - 1].TopNode;
+            }
+            else
+            {
+                insertAfter = _serie.TopNode.SelectSingleNode("c:marker", _serie.NameSpaceManager);
+                if (insertAfter == null)
+                {
+                    insertAfter = _serie.TopNode.SelectSingleNode("c:tx", _serie.NameSpaceManager);
+                    if (insertAfter == null)
+                    {
+                        insertAfter = _serie.TopNode.SelectSingleNode("c:order", _serie.NameSpaceManager);
+                    }
+                }
+            }
+            var node=_serie.TopNode.OwnerDocument.CreateElement("c","trendline", ExcelPackage.schemaChart);
+            _serie.TopNode.InsertAfter(node, insertAfter);
+
+            tl = new ExcelChartTrendline(_serie.NameSpaceManager, node);
+            tl.Type = Type;
+            return tl;
+        }
+        IEnumerator<ExcelChartTrendline> IEnumerable<ExcelChartTrendline>.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+    }
+    /// <summary>
+    /// A trendline object
+    /// </summary>
+    public class ExcelChartTrendline : XmlHelper
+    {
+        internal ExcelChartTrendline(XmlNamespaceManager namespaceManager, XmlNode topNode) :
+            base(namespaceManager,topNode)
+
+        {
+            SchemaNodeOrder = new string[] { "name", "trendlineType","order","period", "forward","backward","intercept", "dispRSqr", "dispEq", "trendlineLbl" };
+        }
+        const string TRENDLINEPATH = "c:trendlineType/@val";
+        /// <summary>
+        /// Type of Trendline
+        /// </summary>
+        public eTrendLine Type
+        {
+           get
+           {
+               switch (GetXmlNodeString(TRENDLINEPATH).ToLower())
+               {
+                   case "exp":
+                       return eTrendLine.Exponential;
+                   case "log":
+                        return eTrendLine.Logarithmic;
+                   case "poly":
+                       return eTrendLine.Polynomial;
+                   case "movingavg":
+                       return eTrendLine.MovingAvgerage;
+                   case "power":
+                       return eTrendLine.Power;
+                   default:
+                       return eTrendLine.Linear;
+               }
+           }
+           set
+           {
+                switch (value)
+                {
+                    case eTrendLine.Exponential:
+                        SetXmlNodeString(TRENDLINEPATH, "exp");
+                        break;
+                    case eTrendLine.Logarithmic:
+                        SetXmlNodeString(TRENDLINEPATH, "log");
+                        break;
+                    case eTrendLine.Polynomial:
+                        SetXmlNodeString(TRENDLINEPATH, "poly");
+                        Order = 2;
+                        break;
+                    case eTrendLine.MovingAvgerage:
+                        SetXmlNodeString(TRENDLINEPATH, "movingAvg");
+                        Period = 2;
+                        break;
+                    case eTrendLine.Power:
+                        SetXmlNodeString(TRENDLINEPATH, "power");
+                        break;
+                    default: 
+                        SetXmlNodeString(TRENDLINEPATH, "linear");
+                        break;
+                }
+           }
+        }
+        const string NAMEPATH = "c:name";
+        /// <summary>
+        /// Name in the legend
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return GetXmlNodeString(NAMEPATH);
+            }
+            set
+            {
+                SetXmlNodeString(NAMEPATH, value, true);
+            }
+        }
+        const string ORDERPATH = "c:order/@val";
+        /// <summary>
+        /// Order for polynominal trendlines
+        /// </summary>
+        public decimal Order
+        {
+            get
+            {
+                return GetXmlNodeDecimal(ORDERPATH);
+            }
+            set
+            {
+                if (Type == eTrendLine.MovingAvgerage)
+                {
+                    throw (new ArgumentException("Can't set period for trendline type MovingAvgerage"));
+                }
+                DeleteAllNode(PERIODPATH);
+                SetXmlNodeString(ORDERPATH, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string PERIODPATH = "c:period/@val";
+        /// <summary>
+        /// Period for monthly average trendlines
+        /// </summary>
+        public decimal Period
+        {
+            get
+            {
+                return GetXmlNodeDecimal(PERIODPATH);
+            }
+            set
+            {
+                if (Type == eTrendLine.Polynomial)
+                {
+                    throw (new ArgumentException("Can't set period for trendline type Polynomial"));
+                }
+                DeleteAllNode(ORDERPATH);
+                SetXmlNodeString(PERIODPATH, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string FORWARDPATH = "c:forward/@val";
+        /// <summary>
+        /// Forcast forward periods
+        /// </summary>
+        public decimal Forward
+        {
+            get
+            {
+                return GetXmlNodeDecimal(FORWARDPATH);
+            }
+            set
+            {
+                SetXmlNodeString(FORWARDPATH, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string BACKWARDPATH = "c:backward/@val";
+        /// <summary>
+        /// Forcast backwards periods
+        /// </summary>
+        public decimal Backward
+        {
+            get
+            {
+                return GetXmlNodeDecimal(BACKWARDPATH);
+            }
+            set
+            {
+                SetXmlNodeString(BACKWARDPATH, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string INTERCEPTPATH = "c:intercept/@val";
+        /// <summary>
+        /// Specify the point where the trendline crosses the vertical axis
+        /// </summary>
+        public decimal Intercept
+        {
+            get
+            {
+                return GetXmlNodeDecimal(INTERCEPTPATH);
+            }
+            set
+            {
+                SetXmlNodeString(INTERCEPTPATH, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string DISPLAYRSQUAREDVALUEPATH = "c:dispRSqr/@val";
+        /// <summary>
+        /// Display the R-squared value for a trendline
+        /// </summary>
+        public bool DisplayRSquaredValue
+        {
+            get
+            {
+                return GetXmlNodeBool(DISPLAYRSQUAREDVALUEPATH, false);
+            }
+            set
+            {
+                SetXmlNodeBool(DISPLAYRSQUAREDVALUEPATH,value, false);
+            }
+        }
+        const string DISPLAYEQUATIONPATH = "c:dispEq/@val";
+        /// <summary>
+        /// Display the trendline equation on the chart
+        /// </summary>
+        public bool DisplayEquation
+        {
+            get
+            {
+                return GetXmlNodeBool(DISPLAYEQUATIONPATH, false);
+            }
+            set
+            {
+                SetXmlNodeBool(DISPLAYEQUATIONPATH, value, false);
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelDoughnutChart.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelDoughnutChart.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelDoughnutChart.cs	(revision 9616)
@@ -0,0 +1,127 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+using OfficeOpenXml.Table.PivotTable;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Provides access to doughnut chart specific properties
+    /// </summary>
+    public class ExcelDoughnutChart : ExcelPieChart
+    {
+        //internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node) :
+        //    base(drawings, node)
+        //{
+        //    SetPaths();
+        //}
+        internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) :
+            base(drawings, node, type, isPivot)
+        {
+            //SetPaths();
+        }
+        internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) :
+            base(drawings, node, type, topChart, PivotTableSource)
+        {
+            //SetPaths();
+        }        
+        internal ExcelDoughnutChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, System.IO.Packaging.PackagePart part, XmlDocument chartXml, XmlNode chartNode) :
+           base(drawings, node, uriChart, part, chartXml, chartNode)
+        {
+            //SetPaths();
+        }
+
+        internal ExcelDoughnutChart(ExcelChart topChart, XmlNode chartNode) :
+            base(topChart, chartNode)
+        {
+            //SetPaths();
+        }
+
+        //private void SetPaths()
+        //{
+        //    string chartNodeText = GetChartNodeText();
+        //    _firstSliceAngPath = string.Format(_firstSliceAngPath, chartNodeText);
+        //    _holeSizePath = string.Format(_holeSizePath, chartNodeText);
+        //}
+        //string _firstSliceAngPath = "c:chartSpace/c:chart/c:plotArea/{0}/c:firstSliceAng/@val";
+        string _firstSliceAngPath = "c:firstSliceAng/@val";
+        /// <summary>
+        /// Angle of the first slize
+        /// </summary>
+        public decimal FirstSliceAngle
+        {
+            get
+            {
+                return _chartXmlHelper.GetXmlNodeDecimal(_firstSliceAngPath);
+            }
+            internal set
+            {
+                _chartXmlHelper.SetXmlNodeString(_firstSliceAngPath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        //string _holeSizePath = "c:chartSpace/c:chart/c:plotArea/{0}/c:holeSize/@val";
+        string _holeSizePath = "c:holeSize/@val";
+        /// <summary>
+        /// Size of the doubnut hole
+        /// </summary>
+        public decimal HoleSize
+        {
+            get
+            {
+                return _chartXmlHelper.GetXmlNodeDecimal(_holeSizePath);
+            }
+            internal set
+            {
+                _chartXmlHelper.SetXmlNodeString(_holeSizePath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        internal override eChartType GetChartType(string name)
+        {
+            if (name == "doughnutChart")
+            {
+                if (((ExcelPieChartSerie)Series[0]).Explosion > 0)
+                {
+                    return eChartType.DoughnutExploded;
+                }
+                else
+                {
+                    return eChartType.Doughnut;
+                }
+            }
+            return base.GetChartType(name);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelLineChart.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelLineChart.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelLineChart.cs	(revision 9616)
@@ -0,0 +1,151 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using OfficeOpenXml.Table.PivotTable;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Provides access to line chart specific properties
+    /// </summary>
+    public class ExcelLineChart : ExcelChart
+    {
+        #region "Constructors"
+        internal ExcelLineChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, PackagePart part, XmlDocument chartXml, XmlNode chartNode) :
+            base(drawings, node, uriChart, part, chartXml, chartNode)
+        {
+        }
+
+        internal ExcelLineChart(ExcelChart topChart, XmlNode chartNode) :
+            base(topChart, chartNode)
+        {
+        }
+        internal ExcelLineChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) :
+            base(drawings, node, type, topChart, PivotTableSource)
+        {
+            Smooth = false;
+        }
+        #endregion
+        string MARKER_PATH="c:marker/@val";
+        /// <summary>
+        /// If the series has markers
+        /// </summary>
+        public bool Marker
+        {
+            get
+            {
+                return _chartXmlHelper.GetXmlNodeBool(MARKER_PATH, false);
+            }
+            set
+            {
+                _chartXmlHelper.SetXmlNodeBool(MARKER_PATH, value, false);
+            }
+        }
+
+        string SMOOTH_PATH = "c:smooth/@val";
+        /// <summary>
+        /// If the series has smooth lines
+        /// </summary>
+        public bool Smooth
+        {
+            get
+            {
+                return _chartXmlHelper.GetXmlNodeBool(SMOOTH_PATH, false);
+            }
+            set
+            {
+                _chartXmlHelper.SetXmlNodeBool(SMOOTH_PATH, value);
+            }
+        }
+        //string _chartTopPath = "c:chartSpace/c:chart/c:plotArea/{0}";
+        ExcelChartDataLabel _DataLabel = null;
+        /// <summary>
+        /// Access to datalabel properties
+        /// </summary>
+        public ExcelChartDataLabel DataLabel
+        {
+            get
+            {
+                if (_DataLabel == null)
+                {
+                    _DataLabel = new ExcelChartDataLabel(NameSpaceManager, ChartNode);
+                }
+                return _DataLabel;
+            }
+        }
+        internal override eChartType GetChartType(string name)
+        {
+               if(name=="lineChart")
+               {
+                   if(Marker)
+                   {
+                       if(Grouping==eGrouping.Stacked)
+                       {
+                           return eChartType.LineMarkersStacked;
+                       }
+                       else if (Grouping == eGrouping.PercentStacked)
+                       {
+                           return eChartType.LineMarkersStacked100;
+                       }
+                       else
+                       {
+                           return eChartType.LineMarkers;
+                       }
+                   }
+                   else
+                   {
+                       if(Grouping==eGrouping.Stacked)
+                       {
+                           return eChartType.LineStacked;
+                       }
+                       else if (Grouping == eGrouping.PercentStacked)
+                       {
+                           return eChartType.LineStacked100;
+                       }
+                       else
+                       {
+                           return eChartType.Line;
+                       }
+                   }
+               }
+               else if (name=="line3DChart")
+               {
+                   return eChartType.Line3D;               
+               }
+               return base.GetChartType(name);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelLineChartSerie.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelLineChartSerie.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelLineChartSerie.cs	(revision 9616)
@@ -0,0 +1,109 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// A serie for a line chart
+    /// </summary>
+    public sealed class ExcelLineChartSerie : ExcelChartSerie
+    {
+        /// <summary>
+        /// Default constructor
+        /// </summary>
+        /// <param name="chartSeries">Parent collection</param>
+        /// <param name="ns">Namespacemanager</param>
+        /// <param name="node">Topnode</param>
+        /// <param name="isPivot">Is pivotchart</param>
+        internal ExcelLineChartSerie(ExcelChartSeries chartSeries, XmlNamespaceManager ns, XmlNode node, bool isPivot) :
+            base(chartSeries, ns, node, isPivot)
+        {
+        }
+        ExcelChartSerieDataLabel _DataLabel = null;
+        /// <summary>
+        /// Datalabels
+        /// </summary>
+        public ExcelChartSerieDataLabel DataLabel
+        {
+            get
+            {
+                if (_DataLabel == null)
+                {
+                    _DataLabel = new ExcelChartSerieDataLabel(_ns, _node);
+                }
+                return _DataLabel;
+            }
+        }
+        const string markerPath = "c:marker/c:symbol/@val";
+        /// <summary>
+        /// Marker symbol 
+        /// </summary>
+        public eMarkerStyle Marker
+        {
+            get
+            {
+                string marker = GetXmlNodeString(markerPath);
+                if (marker == "")
+                {
+                    return eMarkerStyle.None;
+                }
+                else
+                {
+                    return (eMarkerStyle)Enum.Parse(typeof(eMarkerStyle), marker, true);
+                }
+            }
+            set
+            {
+                SetXmlNodeString(markerPath, value.ToString().ToLower());
+            }
+        }
+        const string smoothPath = "c:smooth/@val";
+        /// <summary>
+        /// Smoth lines
+        /// </summary>
+        public bool Smooth
+        {
+            get
+            {
+                return GetXmlNodeBool(smoothPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(smoothPath, value);
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelOfPieChart.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelOfPieChart.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelOfPieChart.cs	(revision 9616)
@@ -0,0 +1,117 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using OfficeOpenXml.Table.PivotTable;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Provides access to ofpie-chart specific properties
+    /// </summary>
+    public class ExcelOfPieChart : ExcelPieChart
+    {
+        //internal ExcelOfPieChart(ExcelDrawings drawings, XmlNode node) :
+        //    base(drawings, node)
+        //{
+
+        //}
+        internal ExcelOfPieChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) :
+            base(drawings, node, type, isPivot)
+        {
+                SetTypeProperties();
+        }
+        internal ExcelOfPieChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) :
+            base(drawings, node, type, topChart, PivotTableSource)
+        {
+            SetTypeProperties();
+        }
+
+        internal ExcelOfPieChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, PackagePart part, XmlDocument chartXml, XmlNode chartNode) :
+           base(drawings, node, uriChart, part, chartXml, chartNode)
+        {
+            SetTypeProperties();
+        }
+
+        private void SetTypeProperties()
+        {
+            if (ChartType == eChartType.BarOfPie)
+            {
+                OfPieType = ePieType.Bar;
+            }
+            else
+            {
+                OfPieType = ePieType.Pie;
+            }
+        }
+
+        const string pieTypePath = "c:chartSpace/c:chart/c:plotArea/c:ofPieChart/c:ofPieType/@val";
+        /// <summary>
+        /// Type, pie or bar
+        /// </summary>
+        public ePieType OfPieType
+        {
+            get
+            {
+                if (_chartXmlHelper.GetXmlNodeString(pieTypePath) == "bar")
+                    return ePieType.Bar;
+                else
+                {
+                    return ePieType.Pie;
+                }
+            }
+            internal set
+            {
+                _chartXmlHelper.CreateNode(pieTypePath,true);
+                _chartXmlHelper.SetXmlNodeString(pieTypePath, value == ePieType.Bar ? "bar" : "pie");
+            }
+        }
+        internal override eChartType GetChartType(string name)
+        {
+            if (name == "ofPieChart")
+            {
+                if (OfPieType==ePieType.Bar)
+                {
+                    return eChartType.BarOfPie;
+                }
+                else
+                {
+                    return eChartType.PieOfPie;
+                }
+            }
+            return base.GetChartType(name);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelPieChart.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelPieChart.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelPieChart.cs	(revision 9616)
@@ -0,0 +1,107 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using OfficeOpenXml.Table.PivotTable;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Provides access to pie chart specific properties
+    /// </summary>
+    public class ExcelPieChart : ExcelChart
+    {
+        internal ExcelPieChart(ExcelDrawings drawings, XmlNode node, eChartType type, bool isPivot) :
+            base(drawings, node, type, isPivot)
+        {
+        }
+        internal ExcelPieChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) :
+            base(drawings, node, type, topChart, PivotTableSource)
+        {
+        }
+
+        internal ExcelPieChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, PackagePart part, XmlDocument chartXml, XmlNode chartNode) :
+           base(drawings, node, uriChart, part, chartXml, chartNode)
+        {
+        }
+
+        internal ExcelPieChart(ExcelChart topChart, XmlNode chartNode) :
+            base(topChart, chartNode)
+        {
+        }
+        ExcelChartDataLabel _DataLabel = null;
+        /// <summary>
+        /// Access to datalabel properties
+        /// </summary>
+        public ExcelChartDataLabel DataLabel
+        {
+            get
+            {
+                if (_DataLabel == null)
+                {
+                    _DataLabel = new ExcelChartDataLabel(NameSpaceManager, ChartNode);
+                }
+                return _DataLabel;
+            }
+        }
+
+        internal override eChartType GetChartType(string name)
+        {
+            if (name == "pieChart")
+            {
+                if (Series.Count > 0 && ((ExcelPieChartSerie)Series[0]).Explosion>0)
+                {
+                    return eChartType.PieExploded;
+                }
+                else
+                {
+                    return eChartType.Pie;
+                }
+            }
+            else if (name == "pie3DChart")
+            {
+                if (Series.Count > 0 && ((ExcelPieChartSerie)Series[0]).Explosion > 0)
+                {
+                    return eChartType.PieExploded3D;
+                }
+                else
+                {
+                    return eChartType.Pie3D;
+                }
+            }
+            return base.GetChartType(name);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelPieChartSerie.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelPieChartSerie.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelPieChartSerie.cs	(revision 9616)
@@ -0,0 +1,92 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// A serie for a pie chart
+    /// </summary>
+    public sealed class ExcelPieChartSerie : ExcelChartSerie
+    {
+        /// <summary>
+        /// Default constructor
+        /// </summary>
+        /// <param name="chartSeries">Parent collection</param>
+        /// <param name="ns">Namespacemanager</param>
+        /// <param name="node">Topnode</param>
+        /// <param name="isPivot">Is pivotchart</param>
+        internal ExcelPieChartSerie(ExcelChartSeries chartSeries, XmlNamespaceManager ns, XmlNode node, bool isPivot) :
+            base(chartSeries, ns, node, isPivot)
+        {
+
+        }
+        const string explosionPath = "c:explosion/@val";
+        /// <summary>
+        /// Explosion for Piecharts
+        /// </summary>
+        public int Explosion
+        {
+            get
+            {
+                return GetXmlNodeInt(explosionPath);
+            }
+            set
+            {
+                if (value < 0 || value > 400)
+                {
+                    throw(new ArgumentOutOfRangeException("Explosion range is 0-400"));
+                }
+                SetXmlNodeString(explosionPath, value.ToString());
+            }
+        }
+        ExcelChartSerieDataLabel _DataLabel = null;
+        /// <summary>
+        /// DataLabels
+        /// </summary>
+        public ExcelChartSerieDataLabel DataLabel
+        {
+            get
+            {
+                if (_DataLabel == null)
+                {
+                    _DataLabel = new ExcelChartSerieDataLabel(_ns, _node);
+                }
+                return _DataLabel;
+            }
+        }
+       
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelScatterChart.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelScatterChart.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelScatterChart.cs	(revision 9616)
@@ -0,0 +1,172 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using OfficeOpenXml.Table.PivotTable;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// Provides access to scatter chart specific properties
+    /// </summary>
+    public sealed class ExcelScatterChart : ExcelChart
+    {
+        internal ExcelScatterChart(ExcelDrawings drawings, XmlNode node, eChartType type, ExcelChart topChart, ExcelPivotTable PivotTableSource) :
+            base(drawings, node, type, topChart, PivotTableSource)
+        {
+            SetTypeProperties();
+        }
+
+        internal ExcelScatterChart(ExcelDrawings drawings, XmlNode node, Uri uriChart, PackagePart part, XmlDocument chartXml, XmlNode chartNode) :
+            base(drawings, node, uriChart, part, chartXml, chartNode)
+        {
+            SetTypeProperties();
+        }
+
+        internal ExcelScatterChart(ExcelChart topChart, XmlNode chartNode) :
+            base(topChart, chartNode)
+        {
+            SetTypeProperties();
+        }
+        private void SetTypeProperties()
+        {
+           /***** ScatterStyle *****/
+           if(ChartType == eChartType.XYScatter ||
+              ChartType == eChartType.XYScatterLines ||
+              ChartType == eChartType.XYScatterLinesNoMarkers)
+           {
+               ScatterStyle = eScatterStyle.LineMarker;
+          }
+           else if (
+              ChartType == eChartType.XYScatterSmooth ||
+              ChartType == eChartType.XYScatterSmoothNoMarkers) 
+           {
+               ScatterStyle = eScatterStyle.SmoothMarker;
+           }
+        }
+        #region "Grouping Enum Translation"
+        string _scatterTypePath = "c:scatterStyle/@val";
+        private eScatterStyle GetScatterEnum(string text)
+        {
+            switch (text)
+            {
+                case "smoothMarker":
+                    return eScatterStyle.SmoothMarker;
+                default:
+                    return eScatterStyle.LineMarker;
+            }
+        }
+
+        private string GetScatterText(eScatterStyle shatterStyle)
+        {
+            switch (shatterStyle)
+            {
+                case eScatterStyle.SmoothMarker:
+                    return "smoothMarker";
+                default:
+                    return "lineMarker";
+            }
+        }
+        #endregion
+        /// <summary>
+        /// If the scatter has LineMarkers or SmoothMarkers
+        /// </summary>
+        public eScatterStyle ScatterStyle
+        {
+            get
+            {
+                return GetScatterEnum(_chartXmlHelper.GetXmlNodeString(_scatterTypePath));
+            }
+            internal set
+            {
+                _chartXmlHelper.CreateNode(_scatterTypePath, true);
+                _chartXmlHelper.SetXmlNodeString(_scatterTypePath, GetScatterText(value));
+            }
+        }
+        string MARKER_PATH = "c:marker/@val";
+        /// <summary>
+        /// If the series has markers
+        /// </summary>
+        public bool Marker
+        {
+            get
+            {
+                return GetXmlNodeBool(MARKER_PATH, false);
+            }
+            set
+            {
+                SetXmlNodeBool(MARKER_PATH, value, false);
+            }
+        }
+
+        internal override eChartType GetChartType(string name)
+        {
+            if (name == "scatterChart")
+            {
+                if (ScatterStyle==eScatterStyle.LineMarker)
+                {
+                    if (((ExcelScatterChartSerie)Series[0]).Marker == eMarkerStyle.None)
+                    {
+                        return eChartType.XYScatterLinesNoMarkers;
+                    }
+                    else
+                    {
+                        if(ExistNode("c:ser/c:spPr/a:ln/noFill"))
+                        {
+                            return eChartType.XYScatter;
+                        }
+                        else
+                        {
+                            return eChartType.XYScatterLines;
+                        }
+                    }
+                }
+                else if (ScatterStyle == eScatterStyle.SmoothMarker)
+                {
+                    if (((ExcelScatterChartSerie)Series[0]).Marker == eMarkerStyle.None)
+                    {
+                        return eChartType.XYScatterSmoothNoMarkers;
+                    }
+                    else
+                    {
+                        return eChartType.XYScatterSmooth;
+                    }
+                }
+            }
+            return base.GetChartType(name);
+        }
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelScatterChartSerie.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelScatterChartSerie.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Chart/ExcelScatterChartSerie.cs	(revision 9616)
@@ -0,0 +1,124 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Drawing.Chart
+{
+    /// <summary>
+    /// A serie for a scatter chart
+    /// </summary>
+    public sealed class ExcelScatterChartSerie : ExcelChartSerie
+    {
+        /// <summary>
+        /// Default constructor
+        /// </summary>
+        /// <param name="chartSeries">Parent collection</param>
+        /// <param name="ns">Namespacemanager</param>
+        /// <param name="node">Topnode</param>
+        /// <param name="isPivot">Is pivotchart</param>
+        internal ExcelScatterChartSerie(ExcelChartSeries chartSeries, XmlNamespaceManager ns, XmlNode node, bool isPivot) :
+            base(chartSeries, ns, node, isPivot)
+        {
+            if (chartSeries.Chart.ChartType == eChartType.XYScatterLines ||
+                chartSeries.Chart.ChartType == eChartType.XYScatterSmooth)
+            {
+                Marker = eMarkerStyle.Square;
+            }
+
+            if (chartSeries.Chart.ChartType == eChartType.XYScatterSmooth ||
+                chartSeries.Chart.ChartType == eChartType.XYScatterSmoothNoMarkers)
+            {
+                Smooth = 1;
+            }
+            else
+            {
+                Smooth = 0;
+            }
+        }
+        ExcelChartSerieDataLabel _DataLabel = null;
+        /// <summary>
+        /// Datalabel
+        /// </summary>
+        public ExcelChartSerieDataLabel DataLabel
+        {
+            get
+            {
+                if (_DataLabel == null)
+                {
+                    _DataLabel = new ExcelChartSerieDataLabel(_ns, _node);
+                }
+                return _DataLabel;
+            }
+        }
+        const string smoothPath = "c:smooth/@val";
+        /// <summary>
+        /// Smooth for scattercharts
+        /// </summary>
+        public int Smooth
+        {
+            get
+            {
+                return GetXmlNodeInt(smoothPath);
+            }
+            internal set
+            {
+                SetXmlNodeString(smoothPath, value.ToString());
+            }
+        }
+        const string markerPath = "c:marker/c:symbol/@val";
+        /// <summary>
+        /// Marker symbol 
+        /// </summary>
+        public eMarkerStyle Marker
+        {
+            get
+            {
+                string marker = GetXmlNodeString(markerPath);
+                if (marker == "")
+                {
+                    return eMarkerStyle.None;
+                }
+                else
+                {
+                    return (eMarkerStyle)Enum.Parse(typeof(eMarkerStyle), marker, true);
+                }
+            }
+            internal set
+            {
+                SetXmlNodeString(markerPath, value.ToString().ToLower());
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawingBase.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawingBase.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawingBase.cs	(revision 9616)
@@ -0,0 +1,650 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2010-06-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Drawing.Chart;
+namespace OfficeOpenXml.Drawing
+{
+    /// <summary>
+    /// Text anchoring
+    /// </summary>
+    public enum eTextAnchoringType
+    {
+        Bottom,
+        Center,
+        Distributed,
+        Justify,
+        Top
+    }
+    /// <summary>
+    /// Vertical text type
+    /// </summary>
+    public enum eTextVerticalType
+    {
+        EastAsianVertical,
+        Horizontal,
+        MongolianVertical,
+        Vertical,
+        Vertical270,
+        WordArtVertical,
+        WordArtVerticalRightToLeft
+
+    }
+    /// <summary>
+    /// How the drawing will be resized.
+    /// </summary>
+    public enum eEditAs
+    {
+        /// <summary>
+        /// Specifies that the current start and end positions shall
+        /// be maintained with respect to the distances from the
+        /// absolute start point of the worksheet.
+        /// </summary>
+        Absolute,
+        /// <summary>
+        /// Specifies that the current drawing shall move with its
+        ///row and column (i.e. the object is anchored to the
+        /// actual from row and column), but that the size shall
+        ///remain absolute.
+        /// </summary>
+        OneCell,
+        /// <summary>
+        /// Specifies that the current drawing shall move and
+        /// resize to maintain its row and column anchors (i.e. the
+        /// object is anchored to the actual from and to row and column).
+        /// </summary>
+        TwoCell
+    }
+    /// <summary>
+    /// Base class for drawings. 
+    /// Drawings are Charts, shapes and Pictures.
+    /// </summary>
+    public class ExcelDrawing : XmlHelper 
+    {
+        /// <summary>
+        /// Position of the a drawing.
+        /// </summary>
+        public class ExcelPosition : XmlHelper
+        {
+            XmlNode _node;
+            XmlNamespaceManager _ns;            
+            internal ExcelPosition(XmlNamespaceManager ns, XmlNode node) :
+                base (ns,node)
+            {
+                _node = node;
+                _ns = ns;
+            }
+            const string colPath="xdr:col";
+            public int Column
+            {
+                get
+                {
+                    return GetXmlNodeInt(colPath);
+                }
+                set
+                {
+                    SetXmlNodeString(colPath, value.ToString());
+                }
+            }
+            const string rowPath="xdr:row";
+            public int Row
+            {
+                get
+                {
+                    return GetXmlNodeInt(rowPath);
+                }
+                set
+                {
+                    SetXmlNodeString(rowPath, value.ToString());
+                }
+            }
+            const string colOffPath = "xdr:colOff";
+            /// <summary>
+            /// Column Offset
+            /// 
+            /// EMU units   1cm         =   1/360000 
+            ///             1US inch    =   1/914400
+            ///             1pixel      =   1/9525
+            /// </summary>
+            public int ColumnOff
+            {
+                get
+                {
+                    return GetXmlNodeInt(colOffPath);
+                }
+                set
+                {
+                    SetXmlNodeString(colOffPath, value.ToString());
+                }
+            }
+            const string rowOffPath = "xdr:rowOff";
+            /// <summary>
+            /// Row Offset
+            /// 
+            /// EMU units   1cm         =   1/360000 
+            ///             1US inch    =   1/914400
+            ///             1pixel      =   1/9525
+            /// </summary>
+            public int RowOff
+            {
+                get
+                {
+                    return GetXmlNodeInt(rowOffPath);
+                }
+                set
+                {
+                    SetXmlNodeString(rowOffPath, value.ToString());
+                }
+            }
+        }
+        protected ExcelDrawings _drawings;
+        protected XmlNode _topNode;
+        string _nameXPath;
+        protected internal int _id;
+        const float STANDARD_DPI = 96;
+        public const int EMU_PER_PIXEL = 9525;
+
+        internal ExcelDrawing(ExcelDrawings drawings, XmlNode node, string nameXPath) :
+            base(drawings.NameSpaceManager, node)
+        {
+            _drawings = drawings;
+            _topNode = node;
+            _id = drawings.Worksheet.Workbook._nextDrawingID++;
+            XmlNode posNode = node.SelectSingleNode("xdr:from", drawings.NameSpaceManager);
+            if (node != null)
+            {
+                From = new ExcelPosition(drawings.NameSpaceManager, posNode);
+            }
+            posNode = node.SelectSingleNode("xdr:to", drawings.NameSpaceManager);
+            if (node != null)
+            {
+                To = new ExcelPosition(drawings.NameSpaceManager, posNode);
+            }
+            _nameXPath = nameXPath;
+            SchemaNodeOrder = new string[] { "from", "to", "graphicFrame", "sp", "clientData"  };
+        }
+        internal ExcelDrawing(XmlNamespaceManager nameSpaceManager, XmlNode node) :
+            base(nameSpaceManager, node)
+        {
+        }
+        /// <summary>
+        /// The name of the drawing object
+        /// </summary>
+        public string Name 
+        {
+            get
+            {
+                try
+                {
+                    if (_nameXPath == "") return "";
+                    return GetXmlNodeString(_nameXPath);
+                }
+                catch
+                {
+                    return ""; 
+                }
+            }
+            set
+            {
+                try
+                {
+                    if (_nameXPath == "") throw new NotImplementedException();
+                    SetXmlNodeString(_nameXPath, value);
+                }
+                catch
+                {
+                    throw new NotImplementedException();
+                }
+            }
+        }
+        /// <summary>
+        /// How Excel resize drawings when the column width is changed within Excel.
+        /// The width of drawings are currently NOT resized in EPPLus when the column width changes
+        /// </summary>
+        public eEditAs EditAs
+        {
+            get
+            {
+                try
+                {
+                    string s = GetXmlNodeString("@editAs");
+                    if (s == "")
+                    {
+                        return eEditAs.TwoCell;
+                    }
+                    else
+                    {
+                        return (eEditAs)Enum.Parse(typeof(eEditAs), s,true);
+                    }
+                }
+                catch
+                {
+                    return eEditAs.TwoCell;
+                }
+            }
+            set
+            {
+                string s=value.ToString();
+                SetXmlNodeString("@editAs", s.Substring(0,1).ToLower()+s.Substring(1,s.Length-1));
+            }
+        }
+        const string lockedPath="xdr:clientData/@fLocksWithSheet";
+        /// <summary>
+        /// Lock drawing
+        /// </summary>
+        public bool Locked
+        {
+            get
+            {
+                return GetXmlNodeBool(lockedPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(lockedPath, value);
+            }
+        }
+        const string printPath = "xdr:clientData/@fPrintsWithSheet";
+        /// <summary>
+        /// Print drawing with sheet
+        /// </summary>
+        public bool Print
+        {
+            get
+            {
+                return GetXmlNodeBool(printPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(printPath, value);
+            }
+        }        /// <summary>
+        /// Top Left position
+        /// </summary>
+        public ExcelPosition From { get; set; }
+        /// <summary>
+        /// Bottom right position
+        /// </summary>
+        public ExcelPosition To { get; set; }
+        /// <summary>
+        /// Add new Drawing types here
+        /// </summary>
+        /// <param name="drawings">The drawing collection</param>
+        /// <param name="node">Xml top node</param>
+        /// <returns>The Drawing object</returns>
+        internal static ExcelDrawing GetDrawing(ExcelDrawings drawings, XmlNode node)
+        {
+            if (node.SelectSingleNode("xdr:sp", drawings.NameSpaceManager) != null)
+            {
+                return new ExcelShape(drawings, node);
+            }
+            else if (node.SelectSingleNode("xdr:pic", drawings.NameSpaceManager) != null)
+            {
+                return new ExcelPicture(drawings, node);
+            }
+            else if (node.SelectSingleNode("xdr:graphicFrame", drawings.NameSpaceManager) != null)
+            {
+                return ExcelChart.GetChart(drawings, node);
+            }
+            else
+            {
+                return new ExcelDrawing(drawings, node, "");
+            }
+        }
+        internal string Id
+        {
+            get { return _id.ToString(); }
+        }
+        #region "Internal sizing functions"
+        internal int GetPixelLeft()
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+            decimal mdw=ws.Workbook.MaxFontWidth;
+
+            int pix = 0;
+            for (int col = 0; col < From.Column; col++)
+            {
+                pix += (int)decimal.Truncate(((256 * GetColumnWidth(col+1) + decimal.Truncate(128 / (decimal)mdw)) / 256) * mdw);
+            }
+            pix += From.ColumnOff / EMU_PER_PIXEL;
+            return pix;
+        }
+        internal int GetPixelTop()
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+            int pix = 0;
+            for (int row = 0; row < From.Row; row++)
+            {
+                pix += (int)(GetRowWidth(row+1) / 0.75);
+            }
+            pix += From.RowOff / EMU_PER_PIXEL;
+            return pix;
+        }
+        internal int GetPixelWidth()
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+            decimal mdw = ws.Workbook.MaxFontWidth;
+
+            int pix = -From.ColumnOff / EMU_PER_PIXEL;
+            for (int col = From.Column + 1; col <= To.Column; col++)
+            {
+                pix += (int)decimal.Truncate(((256 * GetColumnWidth(col) + decimal.Truncate(128 / (decimal)mdw)) / 256) * mdw);
+            }
+            pix += To.ColumnOff / EMU_PER_PIXEL;
+            return pix;
+        }
+        internal int GetPixelHeight()
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+
+            int pix = -(From.RowOff / EMU_PER_PIXEL);
+            for (int row = From.Row + 1; row <= To.Row; row++)
+            {
+                pix += (int)(GetRowWidth(row) / 0.75);
+            }
+            pix += To.RowOff / EMU_PER_PIXEL;
+            return pix;
+        }
+
+        private decimal GetColumnWidth(int col)
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+            if (ws._columns.ContainsKey(ExcelColumn.GetColumnID(ws.SheetID, col)))   //Check that the column exists
+            {
+                return (decimal)ws.Column(col).VisualWidth;
+            }
+            else
+            {
+                return (decimal)ws.DefaultColWidth;
+            }
+        }
+        private double GetRowWidth(int row)
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+            if (ws._rows.ContainsKey(ExcelRow.GetRowID(ws.SheetID, row)))   //Check that the row exists
+            {
+                return (double)ws.Row(row).Height;
+            }
+            else
+            {
+                return (double)ws.DefaultRowHeight;
+            }
+        }
+        internal void SetPixelTop(int pixels)
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+            decimal mdw = ws.Workbook.MaxFontWidth;
+            int prevPix = 0;
+            int pix = (int)(GetRowWidth(1) / 0.75);
+            int row = 2;
+
+            while (pix < pixels)
+            {
+                prevPix = pix;
+                pix += (int)(GetRowWidth(row++) / 0.75);
+            }
+
+            if (pix == pixels)
+            {
+                From.Row = row - 1;
+                From.RowOff = 0;
+            }   
+            else
+            {
+                From.Row = row - 2;
+                From.RowOff = (pixels - prevPix) * EMU_PER_PIXEL;
+            }
+        }
+        internal void SetPixelLeft(int pixels)
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+            decimal mdw = ws.Workbook.MaxFontWidth;
+            int prevPix = 0;
+            int pix = (int)decimal.Truncate(((256 * GetColumnWidth(1) + decimal.Truncate(128 / (decimal)mdw)) / 256) * mdw);
+            int col = 2;
+
+            while (pix < pixels)
+            {
+                prevPix = pix;
+                pix += (int)decimal.Truncate(((256 * GetColumnWidth(col++) + decimal.Truncate(128 / (decimal)mdw)) / 256) * mdw);
+            }
+            if (pix == pixels)
+            {
+                From.Column = col - 1;
+                From.ColumnOff = 0;
+            }
+            else
+            {
+                From.Column = col - 2;
+                From.ColumnOff = (pixels - prevPix) * EMU_PER_PIXEL;
+            }
+        }
+        internal void SetPixelHeight(int pixels)
+        {
+            SetPixelHeight(pixels, STANDARD_DPI);
+        }
+        internal void SetPixelHeight(int pixels, float dpi)
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+            //decimal mdw = ws.Workbook.MaxFontWidth;
+            pixels = (int)(pixels / (dpi / STANDARD_DPI) + .5);
+            int pixOff = pixels - ((int)(ws.Row(From.Row + 1).Height / 0.75) - (int)(From.RowOff / EMU_PER_PIXEL));
+            int prevPixOff = pixels;
+            int row = From.Row+1;
+
+            while (pixOff >= 0)
+            {
+                prevPixOff = pixOff;
+                pixOff -= (int)(GetRowWidth(++row) / 0.75);
+            }
+            To.Row = row - 1;
+            if (From.Row == To.Row)
+            {
+                To.RowOff = From.RowOff + (pixels) * EMU_PER_PIXEL;
+            }
+            else
+            {
+                To.RowOff = prevPixOff * EMU_PER_PIXEL;
+            }
+        }
+        internal void SetPixelWidth(int pixels)
+        {
+            SetPixelWidth(pixels, STANDARD_DPI);
+        }
+        internal void SetPixelWidth(int pixels, float dpi)
+        {
+            ExcelWorksheet ws = _drawings.Worksheet;
+            decimal mdw = ws.Workbook.MaxFontWidth;
+
+            pixels = (int)(pixels / (dpi / STANDARD_DPI) + .5);
+            int pixOff = (int)pixels - ((int)decimal.Truncate(((256 * GetColumnWidth(From.Column + 1) + decimal.Truncate(128 / (decimal)mdw)) / 256) * mdw) - From.ColumnOff / EMU_PER_PIXEL);
+            int prevPixOff = From.ColumnOff / EMU_PER_PIXEL + (int)pixels;
+            int col = From.Column + 2;
+
+            while (pixOff >= 0)
+            {
+                prevPixOff = pixOff;
+                pixOff -= (int)decimal.Truncate(((256 * GetColumnWidth(col++) + decimal.Truncate(128 / (decimal)mdw)) / 256) * mdw);
+            }
+
+            To.Column = col - 2;
+            To.ColumnOff = prevPixOff * EMU_PER_PIXEL;
+        }
+        #endregion
+        #region "Public sizing functions"
+        /// <summary>
+        /// Set the top left corner of a drawing. 
+        /// Note that resizing columns / rows after using this function will effect the position of the drawing
+        /// </summary>
+        /// <param name="PixelTop">Top pixel</param>
+        /// <param name="PixelLeft">Left pixel</param>
+        public void SetPosition(int PixelTop, int PixelLeft)
+        {
+            int width = GetPixelWidth();
+            int height = GetPixelHeight();
+
+            SetPixelTop(PixelTop);
+            SetPixelLeft(PixelLeft);
+
+            SetPixelWidth(width);
+            SetPixelHeight(height);
+        }
+        /// <summary>
+        /// Set the top left corner of a drawing. 
+        /// Note that resizing columns / rows after using this function will effect the position of the drawing
+        /// </summary>
+        /// <param name="Row">Start row</param>
+        /// <param name="RowOffsetPixels">Offset in pixels</param>
+        /// <param name="Column">Start Column</param>
+        /// <param name="ColumnOffsetPixels">Offset in pixels</param>
+        public void SetPosition(int Row, int RowOffsetPixels, int Column, int ColumnOffsetPixels)
+        {
+            int width = GetPixelWidth();
+            int height = GetPixelHeight();
+
+            From.Row = Row;
+            From.RowOff = RowOffsetPixels * EMU_PER_PIXEL;
+            From.Column = Column;
+            From.ColumnOff = ColumnOffsetPixels * EMU_PER_PIXEL;
+
+            SetPixelWidth(width);
+            SetPixelHeight(height);
+        }
+        /// <summary>
+        /// Set size in Percent
+        /// Note that resizing columns / rows after using this function will effect the size of the drawing
+        /// </summary>
+        /// <param name="Percent"></param>
+        public virtual void SetSize(int Percent)
+        {
+            int width = GetPixelWidth();
+            int height = GetPixelHeight();
+
+            width = (int)(width * ((decimal)Percent / 100));
+            height = (int)(height * ((decimal)Percent / 100));
+
+            SetPixelWidth(width, 96);
+            SetPixelHeight(height, 96);
+        }
+        /// <summary>
+        /// Set size in pixels
+        /// Note that resizing columns / rows after using this function will effect the size of the drawing
+        /// </summary>
+        /// <param name="PixelWidth">Width in pixels</param>
+        /// <param name="PixelHeight">Height in pixels</param>
+        public void SetSize(int PixelWidth, int PixelHeight)
+        {
+            SetPixelWidth(PixelWidth);
+            SetPixelHeight(PixelHeight);
+        }
+        #endregion
+
+        internal static string GetTextAchoringText(eTextAnchoringType value)
+        {
+            switch (value)
+            {
+                case eTextAnchoringType.Bottom:
+                    return "b";
+                case eTextAnchoringType.Center:
+                    return "ctr";
+                case eTextAnchoringType.Distributed:
+                    return "dist";
+                case eTextAnchoringType.Justify:
+                    return "just";
+                default:
+                    return "t";
+            }
+        }
+        internal static eTextAnchoringType GetTextAchoringEnum(string text)
+        {
+            switch (text)
+            {
+                case "b":
+                    return eTextAnchoringType.Bottom;
+                case "ctr":
+                    return eTextAnchoringType.Center;
+                case "dist":
+                    return eTextAnchoringType.Distributed;
+                case "just":
+                    return eTextAnchoringType.Justify;
+                default:
+                    return eTextAnchoringType.Top;
+            }
+        }
+        internal static string GetTextVerticalText(eTextVerticalType value)
+        {
+            switch (value)
+            {
+                case eTextVerticalType.EastAsianVertical:
+                    return "eaVert";
+                case eTextVerticalType.MongolianVertical:
+                    return "mongolianVert";
+                case eTextVerticalType.Vertical:
+                    return "vert";
+                case eTextVerticalType.Vertical270:
+                    return "vert270";
+                case eTextVerticalType.WordArtVertical:
+                    return "wordArtVert";
+                case eTextVerticalType.WordArtVerticalRightToLeft:
+                    return "wordArtVertRtl";
+                default:
+                    return "horz";
+            }
+        }
+        internal static eTextVerticalType GetTextVerticalEnum(string text)
+        {
+            switch (text)
+            {
+                case "eaVert":
+                    return eTextVerticalType.EastAsianVertical;
+                case "mongolianVert":
+                    return eTextVerticalType.MongolianVertical;
+                case "vert":
+                    return eTextVerticalType.Vertical;
+                case "vert270":
+                    return eTextVerticalType.Vertical270;
+                case "wordArtVert":
+                    return eTextVerticalType.WordArtVertical;
+                case "wordArtVertRtl":
+                    return eTextVerticalType.WordArtVerticalRightToLeft;
+                default:
+                    return eTextVerticalType.Horizontal;
+            }
+        }
+        internal virtual void DeleteMe()
+        {
+            TopNode.ParentNode.RemoveChild(TopNode);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawingBorder.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawingBorder.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawingBorder.cs	(revision 9616)
@@ -0,0 +1,226 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-12-22
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Drawing;
+
+namespace OfficeOpenXml.Drawing
+{
+    /// <summary>
+    /// Type of Line cap
+    /// </summary>
+    public enum eLineCap
+    {
+        Flat,   //flat
+        Round,  //rnd
+        Square  //Sq
+    }
+    /// <summary>
+    /// Line style.
+    /// </summary>
+    public enum eLineStyle
+    {
+        Dash,
+        DashDot,
+        Dot,
+        LongDash,
+        LongDashDot,
+        LongDashDotDot,
+        Solid,
+        SystemDash,
+        SystemDashDot,
+        SystemDashDotDot,
+        SystemDot
+    }
+    /// <summary>
+    /// Border for drawings
+    /// </summary>    
+    public sealed class ExcelDrawingBorder : XmlHelper
+    {
+        string _linePath;
+        internal ExcelDrawingBorder(XmlNamespaceManager nameSpaceManager, XmlNode topNode, string linePath) : 
+            base(nameSpaceManager, topNode)
+        {
+            SchemaNodeOrder = new string[] { "chart","tickLblPos", "spPr", "txPr","crossAx", "printSettings", "showVal", "showCatName", "showSerName", "showPercent", "separator", "showLeaderLines", "noFill", "solidFill", "blipFill", "gradFill", "noFill", "pattFill", "prstDash" };
+            _linePath = linePath;   
+            _lineStylePath = string.Format(_lineStylePath, linePath);
+            _lineCapPath = string.Format(_lineCapPath, linePath);
+            _lineWidth = string.Format(_lineWidth, linePath);
+        }
+        #region "Public properties"
+        ExcelDrawingFill _fill = null;
+        /// <summary>
+        /// Fill
+        /// </summary>
+        public ExcelDrawingFill Fill
+        {
+            get
+            {
+                if (_fill == null)
+                {
+                    _fill = new ExcelDrawingFill(NameSpaceManager, TopNode, _linePath);
+                }
+                return _fill;
+            }
+        }
+        string _lineStylePath = "{0}/a:prstDash/@val";
+        /// <summary>
+        /// Linestyle
+        /// </summary>
+        public eLineStyle LineStyle
+        {
+            get
+            {
+                return TranslateLineStyle(GetXmlNodeString(_lineStylePath));
+            }
+            set
+            {
+                CreateNode(_linePath, false);
+                SetXmlNodeString(_lineStylePath, TranslateLineStyleText(value));
+            }
+        }
+        string _lineCapPath = "{0}/@cap";
+        /// <summary>
+        /// Linecap
+        /// </summary>
+        public eLineCap LineCap
+        {
+            get
+            {
+                return TranslateLineCap(GetXmlNodeString(_lineCapPath));
+            }
+            set
+            {
+                CreateNode(_linePath, false);
+                SetXmlNodeString(_lineCapPath, TranslateLineCapText(value));
+            }
+        }
+        string _lineWidth = "{0}/@w";
+        /// <summary>
+        /// Width in pixels
+        /// </summary>
+        public int Width
+        {
+            get
+            {
+                return GetXmlNodeInt(_lineWidth) / 12700;
+            }
+            set
+            {
+                SetXmlNodeString(_lineWidth, (value * 12700).ToString());
+            }
+        }
+        #endregion
+        #region "Translate Enum functions"
+        private string TranslateLineStyleText(eLineStyle value)
+        {
+            string text=value.ToString();
+            switch (value)
+            {
+                case eLineStyle.Dash:
+                case eLineStyle.Dot:
+                case eLineStyle.DashDot:
+                case eLineStyle.Solid:
+                    return text.Substring(0,1).ToLower() + text.Substring(1,text.Length-1); //First to Lower case.
+                case eLineStyle.LongDash:
+                case eLineStyle.LongDashDot:
+                case eLineStyle.LongDashDotDot:
+                    return "lg" + text.Substring(4, text.Length - 4);
+                case eLineStyle.SystemDash:
+                case eLineStyle.SystemDashDot:
+                case eLineStyle.SystemDashDotDot:
+                case eLineStyle.SystemDot:
+                    return "sys" + text.Substring(6, text.Length - 6);
+                default:
+                    throw(new Exception("Invalid Linestyle"));
+            }
+        }
+        private eLineStyle TranslateLineStyle(string text)
+        {
+            switch (text)
+            {
+                case "dash":
+                case "dot":
+                case "dashDot":
+                case "solid":
+                    return (eLineStyle)Enum.Parse(typeof(eLineStyle), text, true);
+                case "lgDash":
+                case "lgDashDot":
+                case "lgDashDotDot":
+                    return (eLineStyle)Enum.Parse(typeof(eLineStyle), "Long" + text.Substring(2, text.Length - 2));
+                case "sysDash":
+                case "sysDashDot":
+                case "sysDashDotDot":
+                case "sysDot":
+                    return (eLineStyle)Enum.Parse(typeof(eLineStyle), "System" + text.Substring(3, text.Length - 3));
+                default:
+                    throw (new Exception("Invalid Linestyle"));
+            }
+        }
+        private string TranslateLineCapText(eLineCap value)
+        {
+            switch (value)
+            {
+                case eLineCap.Round:
+                    return "rnd";
+                case eLineCap.Square:
+                    return "sq";
+                default:
+                    return "flat";
+            }
+        }
+        private eLineCap TranslateLineCap(string text)
+        {
+            switch (text)
+            {
+                case "rnd":
+                    return eLineCap.Round;
+                case "sq":
+                    return eLineCap.Square;
+                default:
+                    return eLineCap.Flat;
+            }
+        }
+        #endregion
+
+        
+        //public ExcelDrawingFont Font
+        //{
+        //    get
+        //    { 
+            
+        //    }
+        //}
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawingFill.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawingFill.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawingFill.cs	(revision 9616)
@@ -0,0 +1,204 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-12-22
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Drawing;
+
+namespace OfficeOpenXml.Drawing
+{
+    /// <summary>
+    /// Fill properties for drawing objects
+    /// </summary>
+    public sealed class ExcelDrawingFill : XmlHelper
+    {
+        //ExcelShape _shp;                
+        string _fillPath;
+        XmlNode _fillNode;
+        internal ExcelDrawingFill(XmlNamespaceManager nameSpaceManager, XmlNode topNode, string fillPath) : 
+            base(nameSpaceManager, topNode)
+        {
+          //  _shp=shp;
+            _fillPath = fillPath;
+            _fillNode = topNode.SelectSingleNode(_fillPath, NameSpaceManager);
+            SchemaNodeOrder = new string[] { "tickLblPos", "spPr", "txPr","dLblPos", "crossAx", "printSettings", "showVal", "prstGeom", "noFill", "solidFill", "blipFill", "gradFill", "noFill", "pattFill", "ln", "prstDash" };
+            //Setfill node
+            if (_fillNode != null)
+            {
+                _fillTypeNode = topNode.SelectSingleNode("solidFill");
+                if (_fillTypeNode == null) _fillTypeNode = topNode.SelectSingleNode("noFill");
+                if (_fillTypeNode == null) _fillTypeNode = topNode.SelectSingleNode("blipFill");
+                if (_fillTypeNode == null) _fillTypeNode = topNode.SelectSingleNode("gradFill");
+                if (_fillTypeNode == null) _fillTypeNode = topNode.SelectSingleNode("pattFill");
+            }
+        }
+        eFillStyle _style;
+        XmlNode _fillTypeNode = null;
+        /// <summary>
+        /// Fill style
+        /// </summary>
+        public eFillStyle Style
+        {
+            get
+            {
+                if (_fillTypeNode == null)
+                {
+                    return eFillStyle.SolidFill;
+                }
+                else
+                {
+                    _style=GetStyleEnum(_fillTypeNode.Name);
+                }
+                return _style;
+            }
+            set
+            {
+                if (value == eFillStyle.NoFill || value == eFillStyle.SolidFill)
+                {
+                    _style = value;
+                    CreateFillTopNode(value);
+                }
+                else
+                {
+                    throw new NotImplementedException("Fillstyle not implemented");
+                }
+            }
+        }
+
+        private void CreateFillTopNode(eFillStyle value)
+        {
+            if (_fillTypeNode != null)
+            {
+                TopNode.RemoveChild(_fillTypeNode);
+            }
+            CreateNode(_fillPath + "/a:" + GetStyleText(value), false);
+            _fillNode=TopNode.SelectSingleNode(_fillPath + "/a:" + GetStyleText(value), NameSpaceManager);
+        }
+
+        private eFillStyle GetStyleEnum(string name)
+        {
+            switch(name)
+            {
+                case "noFill":
+                    return eFillStyle.NoFill;
+                case "blipFill":
+                    return eFillStyle.BlipFill;
+                case "gradFill":
+                    return eFillStyle.GradientFill;
+                case "grpFill":
+                    return eFillStyle.GroupFill;
+                case "pattFill":
+                    return eFillStyle.PatternFill;
+                default:
+                    return eFillStyle.SolidFill;
+            }
+        }
+
+        private string GetStyleText(eFillStyle style)
+        {
+            switch (style)
+            {
+                case eFillStyle.BlipFill:
+                    return "blipFill";
+                case eFillStyle.GradientFill:
+                    return "gradFill";
+                case eFillStyle.GroupFill:
+                    return "grpFill";
+                case eFillStyle.NoFill:
+                    return "noFill";                
+                case eFillStyle.PatternFill:
+                    return "pattFill";
+                default:
+                    return "solidFill";
+            }
+        }
+
+        const string ColorPath = "/a:solidFill/a:srgbClr/@val";
+        /// <summary>
+        /// Fill color for solid fills
+        /// </summary>
+        public Color Color
+        {
+            get
+            {
+                string col = GetXmlNodeString(_fillPath + ColorPath);
+                if (col == "")
+                {
+                    return Color.FromArgb(79, 129, 189);
+                }
+                else
+                {
+                    return Color.FromArgb(int.Parse(col,System.Globalization.NumberStyles.AllowHexSpecifier));
+                }
+            }
+            set
+            {
+                if (_fillTypeNode == null)
+                {
+                    _style = eFillStyle.SolidFill;
+                }
+                else if (_style != eFillStyle.SolidFill)
+                {
+                    throw new Exception("FillStyle must be set to SolidFill");
+                }
+                CreateNode(_fillPath, false);
+                SetXmlNodeString(_fillPath + ColorPath, value.ToArgb().ToString("X").Substring(2, 6));
+            }
+        }
+        const string alphaPath = "/a:solidFill/a:srgbClr/a:alpha/@val";
+        /// <summary>
+        /// Transparancy in percent
+        /// </summary>
+        public int Transparancy
+        {
+            get
+            {
+                return 100 - (GetXmlNodeInt(_fillPath + alphaPath) / 1000);
+            }
+            set
+            {
+                if (_fillTypeNode == null)
+                {
+                    _style = eFillStyle.SolidFill;
+                    Color = Color.FromArgb(79, 129, 189);   //Set a Default color
+                }
+                else if (_style != eFillStyle.SolidFill)
+                {
+                    throw new Exception("FillStyle must be set to SolidFill");
+                }
+                //CreateNode(_fillPath, false);
+                SetXmlNodeString(_fillPath + alphaPath, ((100 - value) * 1000).ToString());
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawings.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawings.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelDrawings.cs	(revision 9616)
@@ -0,0 +1,515 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-12-22
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO.Packaging;
+using System.Xml;
+using System.Collections;
+using System.IO;
+using System.Drawing;
+using System.Linq;
+using OfficeOpenXml.Drawing.Chart;
+using OfficeOpenXml.Table.PivotTable;
+namespace OfficeOpenXml.Drawing
+{
+    /// <summary>
+    /// Collection for Drawing objects.
+    /// </summary>
+    public class ExcelDrawings : IEnumerable<ExcelDrawing>
+    {
+        private XmlDocument _drawingsXml=new XmlDocument();
+        private Dictionary<string, int> _drawingNames;
+        private List<ExcelDrawing> _drawings;
+        internal class ImageCompare
+        {
+            internal byte[] image { get; set; }
+            internal string relID { get; set; }
+
+            internal bool Comparer(byte[] compareImg)
+            {
+                if (compareImg.Length != image.Length)
+                {
+                    return false;
+                }
+
+                for (int i = 0; i < image.Length; i++)
+                {
+                    if (image[i] != compareImg[i])
+                    {
+                        return false;
+                    }
+                }
+                return true; //Equal
+            }
+        }
+        //internal List<ImageCompare> _pics = new List<ImageCompare>();
+        internal Dictionary<string, string> _hashes = new Dictionary<string, string>();
+        internal ExcelPackage _package;
+        internal PackageRelationship _drawingRelation=null;
+        internal ExcelDrawings(ExcelPackage xlPackage, ExcelWorksheet sheet)
+        {
+                _drawingsXml = new XmlDocument();                
+                _drawingsXml.PreserveWhitespace = false;
+                _drawings = new List<ExcelDrawing>();
+                _drawingNames = new Dictionary<string,int>();
+                _package = xlPackage;
+                Worksheet = sheet;
+                XmlNode node = sheet.WorksheetXml.SelectSingleNode("//d:drawing", sheet.NameSpaceManager);
+                CreateNSM();
+                if (node != null)
+                {
+                    _drawingRelation = sheet.Part.GetRelationship(node.Attributes["r:id"].Value);
+                    _uriDrawing = PackUriHelper.ResolvePartUri(sheet.WorksheetUri, _drawingRelation.TargetUri);
+
+                    _part = xlPackage.Package.GetPart(_uriDrawing);
+                    XmlHelper.LoadXmlSafe(_drawingsXml, _part.GetStream()); 
+
+                    AddDrawings();
+                }
+         }
+        internal ExcelWorksheet Worksheet { get; set; }
+        /// <summary>
+        /// A reference to the drawing xml document
+        /// </summary>
+        public XmlDocument DrawingXml
+        {
+            get
+            {
+                return _drawingsXml;
+            }
+        }
+        private void AddDrawings()
+        {
+            XmlNodeList list = _drawingsXml.SelectNodes("//xdr:twoCellAnchor", NameSpaceManager);
+
+            foreach (XmlNode node in list)
+            {
+                ExcelDrawing dr = ExcelDrawing.GetDrawing(this, node);
+                _drawings.Add(dr);
+                if (!_drawingNames.ContainsKey(dr.Name.ToLower()))
+                {
+                    _drawingNames.Add(dr.Name.ToLower(), _drawings.Count - 1);
+                }
+            }
+        }
+
+
+        #region NamespaceManager
+        /// <summary>
+        /// Creates the NamespaceManager. 
+        /// </summary>
+        private void CreateNSM()
+        {
+            NameTable nt = new NameTable();
+            _nsManager = new XmlNamespaceManager(nt);
+            _nsManager.AddNamespace("a", ExcelPackage.schemaDrawings);
+            _nsManager.AddNamespace("xdr", ExcelPackage.schemaSheetDrawings);
+            _nsManager.AddNamespace("c", ExcelPackage.schemaChart);
+            _nsManager.AddNamespace("r", ExcelPackage.schemaRelationships);
+        }
+        /// <summary>
+        /// Provides access to a namespace manager instance to allow XPath searching
+        /// </summary>
+        XmlNamespaceManager _nsManager=null;
+        public XmlNamespaceManager NameSpaceManager
+        {
+            get
+            {
+                return _nsManager;
+            }
+        }
+        #endregion
+        #region IEnumerable Members
+
+        public IEnumerator GetEnumerator()
+        {
+            return (_drawings.GetEnumerator());
+        }
+        #region IEnumerable<ExcelDrawing> Members
+
+        IEnumerator<ExcelDrawing> IEnumerable<ExcelDrawing>.GetEnumerator()
+        {
+            return (_drawings.GetEnumerator());
+        }
+
+        #endregion
+
+        /// <summary>
+        /// Returns the drawing at the specified position.  
+        /// </summary>
+        /// <param name="PositionID">The position of the drawing. 0-base</param>
+        /// <returns></returns>
+        public ExcelDrawing this[int PositionID]
+        {
+            get
+            {
+                return (_drawings[PositionID]);
+            }
+        }
+
+        /// <summary>
+        /// Returns the drawing matching the specified name
+        /// </summary>
+        /// <param name="Name">The name of the worksheet</param>
+        /// <returns></returns>
+        public ExcelDrawing this[string Name]
+        {
+            get
+            {
+                if (_drawingNames.ContainsKey(Name.ToLower()))
+                {
+                    return _drawings[_drawingNames[Name.ToLower()]];
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+        public int Count
+        {
+            get
+            {
+                if (_drawings == null)
+                {
+                    return 0;
+                }
+                else
+                {
+                    return _drawings.Count;
+                }
+            }
+        }
+        PackagePart _part=null;
+        internal PackagePart Part
+        {
+            get
+            {
+                return _part;
+            }        
+        }
+        Uri _uriDrawing=null;
+        public Uri UriDrawing
+        {
+            get
+            {
+                return _uriDrawing;
+            }
+        }
+        #endregion
+        #region Add functions
+            /// <summary>
+            /// Add a new chart to the worksheet.
+            /// Do not support Bubble-, Radar-, Stock- or Surface charts. 
+            /// </summary>
+            /// <param name="Name"></param>
+            /// <param name="ChartType">Type of chart</param>
+            /// <param name="PivotTableSource">The pivottable source for a pivotchart</param>    
+            /// <returns>The chart</returns>
+            public ExcelChart AddChart(string Name, eChartType ChartType, ExcelPivotTable PivotTableSource)
+            {
+                if(_drawingNames.ContainsKey(Name.ToLower()))
+                {
+                    throw new Exception("Name already exists in the drawings collection");
+                }
+
+                if (ChartType == eChartType.Bubble ||
+                    ChartType == eChartType.Bubble3DEffect ||
+                    ChartType == eChartType.Radar ||
+                    ChartType == eChartType.RadarFilled ||
+                    ChartType == eChartType.RadarMarkers ||
+                    ChartType == eChartType.StockHLC ||
+                    ChartType == eChartType.StockOHLC ||
+                    ChartType == eChartType.StockVOHLC ||
+                    ChartType == eChartType.Surface ||
+                    ChartType == eChartType.SurfaceTopView ||
+                    ChartType == eChartType.SurfaceTopViewWireframe ||
+                    ChartType == eChartType.SurfaceWireframe)
+                {
+                    throw(new NotImplementedException("Chart type is not supported in the current version"));
+                }
+
+                XmlElement drawNode = CreateDrawingXml();
+
+                ExcelChart chart = ExcelChart.GetNewChart(this, drawNode, ChartType, null, PivotTableSource);
+                chart.Name = Name;
+                _drawings.Add(chart);
+                _drawingNames.Add(Name.ToLower(), _drawings.Count - 1);
+                return chart;
+            }
+            /// <summary>
+            /// Add a new chart to the worksheet.
+            /// Do not support Bubble-, Radar-, Stock- or Surface charts. 
+            /// </summary>
+            /// <param name="Name"></param>
+            /// <param name="ChartType">Type of chart</param>
+            /// <returns>The chart</returns>
+            public ExcelChart AddChart(string Name, eChartType ChartType)
+            {
+                return AddChart(Name, ChartType, null);
+            }
+            /// <summary>
+            /// Add a picure to the worksheet
+            /// </summary>
+            /// <param name="Name"></param>
+            /// <param name="image">An image. Allways saved in then JPeg format</param>
+            /// <returns></returns>
+            public ExcelPicture AddPicture(string Name, Image image)
+            {
+               return AddPicture(Name, image, null);
+            }
+            /// <summary>
+            /// Add a picure to the worksheet
+            /// </summary>
+            /// <param name="Name"></param>
+            /// <param name="image">An image. Allways saved in then JPeg format</param>
+            /// <param name="Hyperlink">Picture Hyperlink</param>
+            /// <returns></returns>
+            public ExcelPicture AddPicture(string Name, Image image, Uri Hyperlink)
+            {
+                if (image != null)
+                {
+                    if (_drawingNames.ContainsKey(Name.ToLower()))
+                    {
+                        throw new Exception("Name already exists in the drawings collection");
+                    }
+                    XmlElement drawNode = CreateDrawingXml();
+                    drawNode.SetAttribute("editAs", "oneCell");
+                    ExcelPicture pic = new ExcelPicture(this, drawNode, image, Hyperlink);
+                    pic.Name = Name;
+                    _drawings.Add(pic);
+                    _drawingNames.Add(Name.ToLower(), _drawings.Count - 1);
+                    return pic;
+                }
+                throw (new Exception("AddPicture: Image can't be null"));
+            }
+            /// <summary>
+            /// Add a picure to the worksheet
+            /// </summary>
+            /// <param name="Name"></param>
+            /// <param name="ImageFile">The image file</param>
+            /// <returns></returns>
+            public ExcelPicture AddPicture(string Name, FileInfo ImageFile)
+            {
+               return AddPicture(Name, ImageFile, null);
+            }
+            /// <summary>
+            /// Add a picure to the worksheet
+            /// </summary>
+            /// <param name="Name"></param>
+            /// <param name="ImageFile">The image file</param>
+            /// <param name="Hyperlink">Picture Hyperlink</param>
+            /// <returns></returns>
+            public ExcelPicture AddPicture(string Name, FileInfo ImageFile, Uri Hyperlink)
+            {
+               if (ImageFile != null)
+               {
+                  if (_drawingNames.ContainsKey(Name.ToLower()))
+                  {
+                     throw new Exception("Name already exists in the drawings collection");
+                  }
+                  XmlElement drawNode = CreateDrawingXml();
+                  drawNode.SetAttribute("editAs", "oneCell");
+                  ExcelPicture pic = new ExcelPicture(this, drawNode, ImageFile, Hyperlink);
+                  pic.Name = Name;
+                  _drawings.Add(pic);
+                  _drawingNames.Add(Name.ToLower(), _drawings.Count - 1);
+                  return pic;
+               }
+               throw (new Exception("AddPicture: ImageFile can't be null"));
+            }
+
+        /// <summary>
+        /// Add a new shape to the worksheet
+        /// </summary>
+        /// <param name="Name">Name</param>
+        /// <param name="Style">Shape style</param>
+        /// <returns>The shape object</returns>
+    
+        public ExcelShape AddShape(string Name, eShapeStyle Style)
+            {
+                if (_drawingNames.ContainsKey(Name.ToLower()))
+                {
+                    throw new Exception("Name already exists in the drawings collection");
+                }
+                XmlElement drawNode = CreateDrawingXml();
+                ExcelShape shape = new ExcelShape(this, drawNode, Style);
+                shape.Name = Name;
+                shape.Style = Style;
+                _drawings.Add(shape);
+                _drawingNames.Add(Name.ToLower(), _drawings.Count - 1);
+                return shape;
+            }
+            private XmlElement CreateDrawingXml()
+            {
+                if (DrawingXml.OuterXml == "")
+                {
+                    DrawingXml.LoadXml(string.Format("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?><xdr:wsDr xmlns:xdr=\"{0}\" xmlns:a=\"{1}\" />", ExcelPackage.schemaSheetDrawings, ExcelPackage.schemaDrawings));
+                    _uriDrawing = new Uri(string.Format("/xl/drawings/drawing{0}.xml", Worksheet.SheetID),UriKind.Relative);
+
+                    Package package = Worksheet._package.Package;
+                    _part = package.CreatePart(_uriDrawing, "application/vnd.openxmlformats-officedocument.drawing+xml", _package.Compression);
+
+                    StreamWriter streamChart = new StreamWriter(_part.GetStream(FileMode.Create, FileAccess.Write));
+                    DrawingXml.Save(streamChart);
+                    streamChart.Close();
+                    package.Flush();
+
+                    _drawingRelation = Worksheet.Part.CreateRelationship(PackUriHelper.GetRelativeUri(Worksheet.WorksheetUri, _uriDrawing), TargetMode.Internal, ExcelPackage.schemaRelationships + "/drawing");
+                    XmlElement e = Worksheet.WorksheetXml.CreateElement("drawing", ExcelPackage.schemaMain);
+                    e.SetAttribute("id",ExcelPackage.schemaRelationships, _drawingRelation.Id);
+
+                    Worksheet.WorksheetXml.DocumentElement.AppendChild(e);
+                    package.Flush();                    
+                }
+                XmlNode colNode = _drawingsXml.SelectSingleNode("//xdr:wsDr", NameSpaceManager);
+                XmlElement drawNode = _drawingsXml.CreateElement("xdr", "twoCellAnchor", ExcelPackage.schemaSheetDrawings);
+                colNode.AppendChild(drawNode);
+
+                //Add from position Element;
+                XmlElement fromNode = _drawingsXml.CreateElement("xdr","from", ExcelPackage.schemaSheetDrawings);
+                drawNode.AppendChild(fromNode);
+                fromNode.InnerXml = "<xdr:col>0</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>0</xdr:row><xdr:rowOff>0</xdr:rowOff>";
+
+                //Add to position Element;
+                XmlElement toNode = _drawingsXml.CreateElement("xdr", "to", ExcelPackage.schemaSheetDrawings);
+                drawNode.AppendChild(toNode);
+                toNode.InnerXml = "<xdr:col>10</xdr:col><xdr:colOff>0</xdr:colOff><xdr:row>10</xdr:row><xdr:rowOff>0</xdr:rowOff>";
+                return drawNode;
+            }
+        #endregion
+        #region Remove methods
+            /// <summary>
+            /// Removes a drawing.
+            /// </summary>
+            /// <param name="Index">The index of the drawing</param>
+            public void Remove(int Index)
+        {
+            var draw=_drawings[Index];
+            draw.DeleteMe();
+            for (int i = Index + 1; i < _drawings.Count; i++)
+            {
+                _drawingNames[_drawings[i].Name.ToLower()]--;
+            }
+            _drawingNames.Remove(draw.Name.ToLower());
+            _drawings.Remove(draw);
+        }
+        /// <summary>
+        /// Removes a drawing.
+        /// </summary>
+        /// <param name="Drawing">The drawing</param>
+        public void Remove(ExcelDrawing Drawing)
+        {
+            Remove(_drawingNames[Drawing.Name.ToLower()]);
+        }
+        /// <summary>
+        /// Removes a drawing.
+        /// </summary>
+        /// <param name="Name">The name of the drawing</param>
+        public void Remove(string Name)
+        {
+            Remove(_drawingNames[Name.ToLower()]);
+        }
+        /// <summary>
+        /// Removes all drawings from the collection
+        /// </summary>
+        public void Clear()
+        {
+            while (Count > 0)
+            {
+                Remove(0);
+            }
+        }
+        #endregion
+            internal void AdjustWidth(int[,] pos)
+            {
+                var ix = 0;
+                //Now set the size for all drawings depending on the editAs property.
+                foreach (OfficeOpenXml.Drawing.ExcelDrawing d in this)
+                {
+                    if (d.EditAs != Drawing.eEditAs.TwoCell)
+                    {
+                        if (d.EditAs == Drawing.eEditAs.Absolute)
+                        {
+                            d.SetPixelLeft(pos[ix, 0]);
+                        }
+                        d.SetPixelWidth(pos[ix, 1]);
+                        
+                    }
+                    ix++;
+                }
+            }
+            internal void AdjustHeight(int[,] pos)
+            {
+                var ix = 0;
+                //Now set the size for all drawings depending on the editAs property.
+                foreach (OfficeOpenXml.Drawing.ExcelDrawing d in this)
+                {
+                    if (d.EditAs != Drawing.eEditAs.TwoCell)
+                    {
+                        if (d.EditAs == Drawing.eEditAs.Absolute)
+                        {
+                            d.SetPixelTop(pos[ix, 0]);
+                        }
+                        d.SetPixelHeight(pos[ix, 1]);
+
+                    }
+                    ix++;
+                }
+            }
+            internal int[,] GetDrawingWidths()
+            {
+                int[,] pos = new int[Count, 2];
+                int ix = 0;
+                //Save the size for all drawings
+                foreach (ExcelDrawing d in this)
+                {
+                    pos[ix, 0] = d.GetPixelLeft();
+                    pos[ix++, 1] = d.GetPixelWidth();
+                }
+                return pos;
+            }
+            internal int[,] GetDrawingHeight()
+            {
+                int[,] pos = new int[Count, 2];
+                int ix = 0;
+                //Save the size for all drawings
+                foreach (ExcelDrawing d in this)
+                {
+                    pos[ix, 0] = d.GetPixelTop();
+                    pos[ix++, 1] = d.GetPixelHeight();
+                }
+                return pos;
+            }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelPicture.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelPicture.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelPicture.cs	(revision 9616)
@@ -0,0 +1,398 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO;
+using System.IO.Packaging;
+using System.Drawing;
+using System.Drawing.Imaging;
+using System.Diagnostics;
+
+namespace OfficeOpenXml.Drawing
+{
+    /// <summary>
+    /// An image object
+    /// </summary>
+    public sealed class ExcelPicture : ExcelDrawing
+    {
+        #region "Constructors"
+        internal ExcelPicture(ExcelDrawings drawings, XmlNode node) :
+            base(drawings, node, "xdr:pic/xdr:nvPicPr/xdr:cNvPr/@name")
+        {
+            XmlNode picNode = node.SelectSingleNode("xdr:pic/xdr:blipFill/a:blip", drawings.NameSpaceManager);
+            if (picNode != null)
+            {
+                RelPic = drawings.Part.GetRelationship(picNode.Attributes["r:embed"].Value);
+                UriPic = PackUriHelper.ResolvePartUri(drawings.UriDrawing, RelPic.TargetUri);
+
+                Part = drawings.Part.Package.GetPart(UriPic);
+                FileInfo f = new FileInfo(UriPic.OriginalString);
+                ContentType = GetContentType(f.Extension);
+                _image = Image.FromStream(Part.GetStream());
+                ImageConverter ic=new ImageConverter();
+                var iby=(byte[])ic.ConvertTo(_image, typeof(byte[]));
+                var ii = _drawings._package.LoadImage(iby, UriPic, Part);
+                ImageHash = ii.Hash;
+
+                string relID = GetXmlNodeString("xdr:pic/xdr:nvPicPr/xdr:cNvPr/a:hlinkClick/@r:id");
+                if (!string.IsNullOrEmpty(relID))
+                {
+                    HypRel = drawings.Part.GetRelationship(relID);
+                    if (HypRel.TargetUri.IsAbsoluteUri)
+                    {
+                        _hyperlink = new ExcelHyperLink(HypRel.TargetUri.AbsoluteUri);
+                    }
+                    else
+                    {
+                        _hyperlink = new ExcelHyperLink(HypRel.TargetUri.OriginalString, UriKind.Relative);
+                    }
+                    ((ExcelHyperLink)_hyperlink).ToolTip = GetXmlNodeString("xdr:pic/xdr:nvPicPr/xdr:cNvPr/a:hlinkClick/@tooltip");
+                }
+            }
+        }
+        internal ExcelPicture(ExcelDrawings drawings, XmlNode node, Image image) :
+           this(drawings, node, image, null)
+        {
+        }
+        internal ExcelPicture(ExcelDrawings drawings, XmlNode node, Image image, Uri hyperlink) :
+            base(drawings, node, "xdr:pic/xdr:nvPicPr/xdr:cNvPr/@name")
+        {
+            XmlElement picNode = node.OwnerDocument.CreateElement("xdr", "pic", ExcelPackage.schemaSheetDrawings);
+            node.InsertAfter(picNode,node.SelectSingleNode("xdr:to",NameSpaceManager));
+            _hyperlink = hyperlink;
+            picNode.InnerXml = PicStartXml();
+
+            node.InsertAfter(node.OwnerDocument.CreateElement("xdr", "clientData", ExcelPackage.schemaSheetDrawings), picNode);
+
+            Package package = drawings.Worksheet._package.Package;
+            //Get the picture if it exists or save it if not.
+            _image = image;
+            string relID = SavePicture(image);
+
+            //Create relationship
+            node.SelectSingleNode("xdr:pic/xdr:blipFill/a:blip/@r:embed", NameSpaceManager).Value = relID;
+
+            SetPosDefaults(image);
+            package.Flush();
+        }
+        internal ExcelPicture(ExcelDrawings drawings, XmlNode node, FileInfo imageFile) :
+           this(drawings,node,imageFile,null)
+        {
+        }
+        internal ExcelPicture(ExcelDrawings drawings, XmlNode node, FileInfo imageFile, Uri hyperlink) :
+            base(drawings, node, "xdr:pic/xdr:nvPicPr/xdr:cNvPr/@name")
+        {
+            XmlElement picNode = node.OwnerDocument.CreateElement("xdr", "pic", ExcelPackage.schemaSheetDrawings);
+            node.InsertAfter(picNode, node.SelectSingleNode("xdr:to", NameSpaceManager));
+            _hyperlink = hyperlink;
+            picNode.InnerXml = PicStartXml();
+
+            node.InsertAfter(node.OwnerDocument.CreateElement("xdr", "clientData", ExcelPackage.schemaSheetDrawings), picNode);
+
+            //Changed to stream 2/4-13 (issue 14834). Thnx SClause
+            var package = drawings.Worksheet._package.Package;
+            ContentType = GetContentType(imageFile.Extension);
+            var imagestream = new FileStream(imageFile.FullName, FileMode.Open, FileAccess.Read);
+            _image = Image.FromStream(imagestream);
+            ImageConverter ic = new ImageConverter();
+            var img = (byte[])ic.ConvertTo(_image, typeof(byte[]));
+            imagestream.Close();
+
+            UriPic = GetNewUri(package, "/xl/media/{0}" + imageFile.Name);
+            var ii = _drawings._package.AddImage(img, UriPic, ContentType);
+            string relID;
+            if(!drawings._hashes.ContainsKey(ii.Hash))
+            {
+                Part = ii.Part;
+                RelPic = drawings.Part.CreateRelationship(PackUriHelper.GetRelativeUri(drawings.UriDrawing, ii.Uri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/image");
+                relID = RelPic.Id;
+                _drawings._hashes.Add(ii.Hash, relID);
+                AddNewPicture(img, relID);
+            }
+            else
+            {
+                relID = drawings._hashes[ii.Hash];
+                var rel = _drawings.Part.GetRelationship(relID);
+                UriPic = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+            }
+            SetPosDefaults(Image);
+            //Create relationship
+            node.SelectSingleNode("xdr:pic/xdr:blipFill/a:blip/@r:embed", NameSpaceManager).Value = relID;
+            package.Flush();
+        }
+
+        internal static string GetContentType(string extension)
+        {
+            switch (extension.ToLower())
+            {
+                case ".bmp":
+                    return  "image/bmp";
+                case ".jpg":
+                case ".jpeg":
+                    return "image/jpeg";
+                case ".gif":
+                    return "image/gif";
+                case ".png":
+                    return "image/png";
+                case ".cgm":
+                    return "image/cgm";
+                case ".emf":
+                    return "image/x-emf";
+                case ".eps":
+                    return "image/x-eps";
+                case ".pcx":
+                    return "image/x-pcx";
+                case ".tga":
+                    return "image/x-tga";
+                case ".tif":
+                case ".tiff":
+                    return "image/x-tiff";
+                case ".wmf":
+                    return "image/x-wmf";
+                default:
+                    return "image/jpeg";
+
+            }
+        }
+        //Add a new image to the compare collection
+        private void AddNewPicture(byte[] img, string relID)
+        {
+            var newPic = new ExcelDrawings.ImageCompare();
+            newPic.image = img;
+            newPic.relID = relID;
+            //_drawings._pics.Add(newPic);
+        }
+        #endregion
+        private string SavePicture(Image image)
+        {
+            ImageConverter ic = new ImageConverter();
+            byte[] img = (byte[])ic.ConvertTo(image, typeof(byte[]));
+            var ii = _drawings._package.AddImage(img);
+
+            if (_drawings._hashes.ContainsKey(ii.Hash))
+            {
+                var relID = _drawings._hashes[ii.Hash];
+                var rel = _drawings.Part.GetRelationship(relID);
+                UriPic = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+                return relID;
+            }
+            else
+            {
+                UriPic = ii.Uri;
+            }
+
+            //Set the Image and save it to the package.
+            RelPic = _drawings.Part.CreateRelationship(PackUriHelper.GetRelativeUri(_drawings.UriDrawing, UriPic), TargetMode.Internal, ExcelPackage.schemaRelationships + "/image");
+            
+            //AddNewPicture(img, picRelation.Id);
+            _drawings._hashes.Add(ii.Hash, RelPic.Id);
+            ImageHash = ii.Hash;
+
+            return RelPic.Id;
+        }
+        private void SetPosDefaults(Image image)
+        {
+            EditAs = eEditAs.OneCell;
+            SetPixelWidth(image.Width, image.HorizontalResolution);
+            SetPixelHeight(image.Height, image.VerticalResolution);
+        }
+
+        private string PicStartXml()
+        {
+            StringBuilder xml = new StringBuilder();
+            
+            xml.Append("<xdr:nvPicPr>");
+            
+            if (_hyperlink == null)
+            {
+                xml.AppendFormat("<xdr:cNvPr id=\"{0}\" descr=\"\" />", _id);
+            }
+            else
+            {
+               HypRel = _drawings.Part.CreateRelationship(_hyperlink, TargetMode.External, ExcelPackage.schemaHyperlink);
+               xml.AppendFormat("<xdr:cNvPr id=\"{0}\" descr=\"\">", _id);
+               if (HypRel != null)
+               {
+                   if (_hyperlink is ExcelHyperLink)
+                   {
+                       xml.AppendFormat("<a:hlinkClick xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"{0}\" tooltip=\"{1}\"/>",
+                         HypRel.Id, ((ExcelHyperLink)_hyperlink).ToolTip);
+                   }
+                   else
+                   {
+                       xml.AppendFormat("<a:hlinkClick xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"{0}\" />",
+                         HypRel.Id);
+                   }
+               }
+               xml.Append("</xdr:cNvPr>");
+            }
+           
+            xml.Append("<xdr:cNvPicPr><a:picLocks noChangeAspect=\"1\" /></xdr:cNvPicPr></xdr:nvPicPr><xdr:blipFill><a:blip xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:embed=\"\" cstate=\"print\" /><a:stretch><a:fillRect /> </a:stretch> </xdr:blipFill> <xdr:spPr> <a:xfrm> <a:off x=\"0\" y=\"0\" />  <a:ext cx=\"0\" cy=\"0\" /> </a:xfrm> <a:prstGeom prst=\"rect\"> <a:avLst /> </a:prstGeom> </xdr:spPr>");
+
+            return xml.ToString();
+        }
+
+        internal string ImageHash { get; set; }
+        Image _image = null;
+        /// <summary>
+        /// The Image
+        /// </summary>
+        public Image Image 
+        {
+            get
+            {
+                return _image;
+            }
+            set
+            {
+                if (value != null)
+                {
+                    _image = value;
+                    try
+                    {
+                        string relID = SavePicture(value);
+
+                        //Create relationship
+                        TopNode.SelectSingleNode("xdr:pic/xdr:blipFill/a:blip/@r:embed", NameSpaceManager).Value = relID;
+                        //_image.Save(Part.GetStream(FileMode.Create, FileAccess.Write), _imageFormat);   //Always JPEG here at this point. 
+                    }
+                    catch(Exception ex)
+                    {
+                        throw(new Exception("Can't save image - " + ex.Message, ex));
+                    }
+                }
+            }
+        }
+        ImageFormat _imageFormat=ImageFormat.Jpeg;
+        /// <summary>
+        /// Image format
+        /// If the picture is created from an Image this type is always Jpeg
+        /// </summary>
+        public ImageFormat ImageFormat
+        {
+            get
+            {
+                return _imageFormat;
+            }
+            internal set
+            {
+                _imageFormat = value;
+            }
+        }
+        internal string ContentType
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// Set the size of the image in percent from the orginal size
+        /// Note that resizing columns / rows after using this function will effect the size of the picture
+        /// </summary>
+        /// <param name="Percent">Percent</param>
+        public override void SetSize(int Percent)
+        {
+            if(Image == null)
+            {
+                base.SetSize(Percent);
+            }
+            else
+            {
+                int width = Image.Width;
+                int height = Image.Height;
+
+                width = (int)(width * ((decimal)Percent / 100));
+                height = (int)(height * ((decimal)Percent / 100));
+
+                SetPixelWidth(width, Image.HorizontalResolution);
+                SetPixelHeight(height, Image.VerticalResolution);
+            }
+        }
+        internal Uri UriPic { get; set; }
+        internal PackageRelationship RelPic {get; set;}
+        internal PackageRelationship HypRel { get; set; }
+        internal PackagePart Part;
+
+        internal new string Id
+        {
+            get { return Name; }
+        }
+        ExcelDrawingFill _fill = null;
+        /// <summary>
+        /// Fill
+        /// </summary>
+        public ExcelDrawingFill Fill
+        {
+            get
+            {
+                if (_fill == null)
+                {
+                    _fill = new ExcelDrawingFill(NameSpaceManager, TopNode, "xdr:pic/xdr:spPr");
+                }
+                return _fill;
+            }
+        }
+        ExcelDrawingBorder _border = null;
+        /// <summary>
+        /// Border
+        /// </summary>
+        public ExcelDrawingBorder Border
+        {
+            get
+            {
+                if (_border == null)
+                {
+                    _border = new ExcelDrawingBorder(NameSpaceManager, TopNode, "xdr:pic/xdr:spPr/a:ln");
+                }
+                return _border;
+            }
+        }
+
+        private Uri _hyperlink = null;
+        /// <summary>
+        /// Hyperlink
+        /// </summary>
+        public Uri Hyperlink
+        {
+           get
+           {
+              return _hyperlink;
+           }
+        }
+        internal override void DeleteMe()
+        {
+            _drawings._package.RemoveImage(ImageHash);
+            base.DeleteMe();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelShape.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelShape.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelShape.cs	(revision 9616)
@@ -0,0 +1,552 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style.XmlAccess;
+using OfficeOpenXml.Drawing;
+using OfficeOpenXml.Style;
+/// <summary>
+/// Shape style
+/// </summary>
+public enum eShapeStyle
+{
+    AccentBorderCallout1,
+    AccentBorderCallout2,
+    AccentBorderCallout3,
+    AccentCallout1,
+    AccentCallout2,
+    AccentCallout3,
+    ActionButtonBackPrevious,
+    ActionButtonBeginning,
+    ActionButtonBlank,
+    ActionButtonDocument,
+    ActionButtonEnd,
+    ActionButtonForwardNext,
+    ActionButtonHelp,
+    ActionButtonHome,
+    ActionButtonInformation,
+    ActionButtonMovie,
+    ActionButtonReturn,
+    ActionButtonSound,
+    Arc,
+    BentArrow,
+    BentConnector2,
+    BentConnector3,
+    BentConnector4,
+    BentConnector5,
+    BentUpArrow,
+    Bevel,
+    BlockArc,
+    BorderCallout1,
+    BorderCallout2,
+    BorderCallout3,
+    BracePair,
+    BracketPair,
+    Callout1,
+    Callout2,
+    Callout3,
+    Can,
+    ChartPlus,
+    ChartStar,
+    ChartX,
+    Chevron,
+    Chord,
+    CircularArrow,
+    Cloud,
+    CloudCallout,
+    Corner,
+    CornerTabs,
+    Cube,
+    CurvedConnector2,
+    CurvedConnector3,
+    CurvedConnector4,
+    CurvedConnector5,
+    CurvedDownArrow,
+    CurvedLeftArrow,
+    CurvedRightArrow,
+    CurvedUpArrow,
+    Decagon,
+    DiagStripe,
+    Diamond,
+    Dodecagon,
+    Donut,
+    DoubleWave,
+    DownArrow,
+    DownArrowCallout,
+    Ellipse,
+    EllipseRibbon,
+    EllipseRibbon2,
+    FlowChartAlternateProcess,
+    FlowChartCollate,
+    FlowChartConnector,
+    FlowChartDecision,
+    FlowChartDelay,
+    FlowChartDisplay,
+    FlowChartDocument,
+    FlowChartExtract,
+    FlowChartInputOutput,
+    FlowChartInternalStorage,
+    FlowChartMagneticDisk,
+    FlowChartMagneticDrum,
+    FlowChartMagneticTape,
+    FlowChartManualInput,
+    FlowChartManualOperation,
+    FlowChartMerge,
+    FlowChartMultidocument,
+    FlowChartOfflineStorage,
+    FlowChartOffpageConnector,
+    FlowChartOnlineStorage,
+    FlowChartOr,
+    FlowChartPredefinedProcess,
+    FlowChartPreparation,
+    FlowChartProcess,
+    FlowChartPunchedCard,
+    FlowChartPunchedTape,
+    FlowChartSort,
+    FlowChartSummingJunction,
+    FlowChartTerminator,
+    FoldedCorner,
+    Frame,
+    Funnel,
+    Gear6,
+    Gear9,
+    HalfFrame,
+    Heart,
+    Heptagon,
+    Hexagon,
+    HomePlate,
+    HorizontalScroll,
+    IrregularSeal1,
+    IrregularSeal2,
+    LeftArrow,
+    LeftArrowCallout,
+    LeftBrace,
+    LeftBracket,
+    LeftCircularArrow,
+    LeftRightArrow,
+    LeftRightArrowCallout,
+    LeftRightCircularArrow,
+    LeftRightRibbon,
+    LeftRightUpArrow,
+    LeftUpArrow,
+    LightningBolt,
+    Line,
+    LineInv,
+    MathDivide,
+    MathEqual,
+    MathMinus,
+    MathMultiply,
+    MathNotEqual,
+    MathPlus,
+    Moon,
+    NonIsoscelesTrapezoid,
+    NoSmoking,
+    NotchedRightArrow,
+    Octagon,
+    Parallelogram,
+    Pentagon,
+    Pie,
+    PieWedge,
+    Plaque,
+    PlaqueTabs,
+    Plus,
+    QuadArrow,
+    QuadArrowCallout,
+    Rect,
+    Ribbon,
+    Ribbon2,
+    RightArrow,
+    RightArrowCallout,
+    RightBrace,
+    RightBracket,
+    Round1Rect,
+    Round2DiagRect,
+    Round2SameRect,
+    RoundRect,
+    RtTriangle,
+    SmileyFace,
+    Snip1Rect,
+    Snip2DiagRect,
+    Snip2SameRect,
+    SnipRoundRect,
+    SquareTabs,
+    Star10,
+    Star12,
+    Star16,
+    Star24,
+    Star32,
+    Star4,
+    Star5,
+    Star6,
+    Star7,
+    Star8,
+    StraightConnector1,
+    StripedRightArrow,
+    Sun,
+    SwooshArrow,
+    Teardrop,
+    Trapezoid,
+    Triangle,
+    UpArrow,
+    UpArrowCallout,
+    UpDownArrow,
+    UpDownArrowCallout,
+    UturnArrow,
+    Wave,
+    WedgeEllipseCallout,
+    WedgeRectCallout,
+    WedgeRoundRectCallout,
+    VerticalScroll
+}
+/// <summary>
+/// Text alignment
+/// </summary>
+public enum eTextAlignment
+{
+    Left,
+    Center,
+    Right,
+    Distributed,
+    Justified,
+    JustifiedLow,
+    ThaiDistributed
+}
+/// <summary>
+/// Fillstyle.
+/// </summary>
+public enum eFillStyle
+{
+    NoFill,
+    SolidFill,
+    GradientFill,
+    PatternFill,
+    BlipFill,
+    GroupFill
+}
+namespace OfficeOpenXml.Drawing
+{
+    /// <summary>
+    /// An Excel shape.
+    /// </summary>
+    public sealed class ExcelShape : ExcelDrawing
+    {
+        internal ExcelShape(ExcelDrawings drawings, XmlNode node) :
+            base(drawings, node, "xdr:sp/xdr:nvSpPr/xdr:cNvPr/@name")
+        {
+            init();
+        }
+        internal ExcelShape(ExcelDrawings drawings, XmlNode node, eShapeStyle style) :
+            base(drawings, node, "xdr:sp/xdr:nvSpPr/xdr:cNvPr/@name")
+        {
+            init();
+            XmlElement shapeNode = node.OwnerDocument.CreateElement("xdr", "sp", ExcelPackage.schemaSheetDrawings);
+            shapeNode.SetAttribute("macro", "");
+            shapeNode.SetAttribute("textlink", "");
+            node.AppendChild(shapeNode);
+
+            shapeNode.InnerXml = ShapeStartXml();
+            node.AppendChild(shapeNode.OwnerDocument.CreateElement("xdr", "clientData", ExcelPackage.schemaSheetDrawings));
+        }
+        private void init()
+        {
+            SchemaNodeOrder = new string[] { "prstGeom", "ln", "pPr", "defRPr", "solidFill", "uFill", "latin", "cs", "r", "rPr", "t" };
+        }
+        #region "public methods"
+        const string ShapeStylePath = "xdr:sp/xdr:spPr/a:prstGeom/@prst";
+        /// <summary>
+        /// Shape style
+        /// </summary>
+        public eShapeStyle Style
+        {
+            get
+            {
+                string v = GetXmlNodeString(ShapeStylePath);
+                try
+                {
+                    return (eShapeStyle)Enum.Parse(typeof(eShapeStyle), v, true);
+                }
+                catch
+                {
+                    throw (new Exception(string.Format("Invalid shapetype {0}", v)));
+                }
+            }
+            set
+            {
+                string v = value.ToString();
+                v = v.Substring(0, 1).ToLower() + v.Substring(1, v.Length - 1);
+                SetXmlNodeString(ShapeStylePath, v);
+            }
+        }
+        ExcelDrawingFill _fill = null;
+        /// <summary>
+        /// Fill
+        /// </summary>
+        public ExcelDrawingFill Fill
+        {
+            get
+            {
+                if (_fill == null)
+                {
+                    _fill = new ExcelDrawingFill(NameSpaceManager, TopNode, "xdr:sp/xdr:spPr");
+                }
+                return _fill;
+            }
+        }
+        ExcelDrawingBorder _border = null;
+        /// <summary>
+        /// Border
+        /// </summary>
+        public ExcelDrawingBorder Border        
+        {
+            get
+            {
+                if (_border == null)
+                {
+                    _border = new ExcelDrawingBorder(NameSpaceManager, TopNode, "xdr:sp/xdr:spPr/a:ln");
+                }
+                return _border;
+            }
+        }
+        string[] paragraphNodeOrder = new string[] { "pPr", "defRPr", "solidFill", "uFill", "latin", "cs", "r", "rPr", "t" };
+        const string PARAGRAPH_PATH = "xdr:sp/xdr:txBody/a:p";
+        ExcelTextFont _font=null;
+        public ExcelTextFont Font
+        {
+            get
+            {
+                if (_font == null)
+                {
+                    XmlNode node = TopNode.SelectSingleNode(PARAGRAPH_PATH, NameSpaceManager);
+                    if(node==null)
+                    {
+                        Text="";    //Creates the node p element
+                        node = TopNode.SelectSingleNode(PARAGRAPH_PATH, NameSpaceManager);
+                    }
+                    _font = new ExcelTextFont(NameSpaceManager, TopNode, "xdr:sp/xdr:txBody/a:p/a:pPr/a:defRPr", paragraphNodeOrder);
+                }
+                return _font;
+            }
+        }
+        const string TextPath = "xdr:sp/xdr:txBody/a:p/a:r/a:t";
+        /// <summary>
+        /// Text inside the shape
+        /// </summary>
+        public string Text
+        {
+            get
+            {
+                return GetXmlNodeString(TextPath);
+            }
+            set
+            {
+                SetXmlNodeString(TextPath, value);
+            }
+
+        }
+        string lockTextPath = "xdr:sp/@fLocksText";
+        /// <summary>
+        /// Lock drawing
+        /// </summary>
+        public bool LockText
+        {
+            get
+            {
+                return GetXmlNodeBool(lockTextPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(lockTextPath, value);
+            }
+        }
+        ExcelParagraphCollection _richText = null;
+        /// <summary>
+        /// Richtext collection. Used to format specific parts of the text
+        /// </summary>
+        public ExcelParagraphCollection RichText
+        {
+            get
+            {
+                if (_richText == null)
+                {
+                    //XmlNode node=TopNode.SelectSingleNode(PARAGRAPH_PATH, NameSpaceManager);
+                    //if (node == null)
+                    //{
+                    //    CreateNode(PARAGRAPH_PATH);
+                    //}
+                        _richText = new ExcelParagraphCollection(NameSpaceManager, TopNode, PARAGRAPH_PATH, paragraphNodeOrder);
+                }
+                return _richText;
+            }
+        }
+        const string TextAnchoringPath = "xdr:sp/xdr:txBody/a:bodyPr/@anchor";
+        /// <summary>
+        /// Text Anchoring
+        /// </summary>
+        public eTextAnchoringType TextAnchoring
+        {
+            get
+            {
+                return GetTextAchoringEnum(GetXmlNodeString(TextAnchoringPath));
+            }
+            set
+            {
+                SetXmlNodeString(TextAnchoringPath, GetTextAchoringText(value));
+            }
+        }
+        const string TextAnchoringCtlPath = "xdr:sp/xdr:txBody/a:bodyPr/@anchorCtr";
+        /// <summary>
+        /// Specifies the centering of the text box.
+        /// </summary>
+        public bool TextAnchoringControl
+        {
+            get
+            {
+                return GetXmlNodeBool(TextAnchoringCtlPath);
+            }
+            set
+            {
+                if (value)
+                {
+                    SetXmlNodeString(TextAnchoringCtlPath, "1");
+                }
+                else
+                {
+                    SetXmlNodeString(TextAnchoringCtlPath, "0");
+                }
+            }
+        }
+        const string TEXT_ALIGN_PATH = "xdr:sp/xdr:txBody/a:p/a:pPr/@algn";
+        /// <summary>
+        /// How the text is aligned
+        /// </summary>
+        public eTextAlignment TextAlignment
+        {
+            get
+            {
+               switch(GetXmlNodeString(TEXT_ALIGN_PATH))
+               {
+                   case "ctr":
+                       return eTextAlignment.Center;
+                   case "r":
+                       return eTextAlignment.Right;
+                   case "dist":
+                       return eTextAlignment.Distributed;
+                   case "just":
+                       return eTextAlignment.Justified;
+                   case "justLow":
+                       return eTextAlignment.JustifiedLow;
+                   case "thaiDist":
+                       return eTextAlignment.ThaiDistributed;
+                   default: 
+                       return eTextAlignment.Left;
+               }
+            }
+            set
+            {
+                switch (value)
+                {
+                    case eTextAlignment.Right:
+                        SetXmlNodeString(TEXT_ALIGN_PATH, "r");
+                        break;
+                    case eTextAlignment.Center:
+                        SetXmlNodeString(TEXT_ALIGN_PATH, "ctr");
+                        break;
+                    case eTextAlignment.Distributed:
+                        SetXmlNodeString(TEXT_ALIGN_PATH, "dist");
+                        break;
+                    case eTextAlignment.Justified:
+                        SetXmlNodeString(TEXT_ALIGN_PATH, "just");
+                        break;
+                    case eTextAlignment.JustifiedLow:
+                        SetXmlNodeString(TEXT_ALIGN_PATH, "justLow");
+                        break;
+                    case eTextAlignment.ThaiDistributed:
+                        SetXmlNodeString(TEXT_ALIGN_PATH, "thaiDist");
+                        break;
+                    default:
+                        DeleteNode(TEXT_ALIGN_PATH);
+                        break;
+                }                
+            }
+        }
+        const string INDENT_ALIGN_PATH = "xdr:sp/xdr:txBody/a:p/a:pPr/@lvl";
+        /// <summary>
+        /// Indentation
+        /// </summary>
+        public int Indent
+        {
+            get
+            {
+                return GetXmlNodeInt(INDENT_ALIGN_PATH);
+            }
+            set
+            {
+                if (value < 0 || value > 8)
+                {
+                    throw(new ArgumentOutOfRangeException("Indent level must be between 0 and 8"));
+                }
+                SetXmlNodeString(INDENT_ALIGN_PATH, value.ToString());
+            }
+        }
+        const string TextVerticalPath = "xdr:sp/xdr:txBody/a:bodyPr/@vert";
+        /// <summary>
+        /// Vertical text
+        /// </summary>
+        public eTextVerticalType TextVertical
+        {
+            get
+            {
+                return GetTextVerticalEnum(GetXmlNodeString(TextVerticalPath));
+            }
+            set
+            {
+                SetXmlNodeString(TextVerticalPath, GetTextVerticalText(value));
+            }
+        }
+
+        #endregion
+        #region "Private Methods"
+        private string ShapeStartXml()
+        {
+            StringBuilder xml = new StringBuilder();
+            xml.AppendFormat("<xdr:nvSpPr><xdr:cNvPr id=\"{0}\" name=\"{1}\" /><xdr:cNvSpPr /></xdr:nvSpPr><xdr:spPr><a:prstGeom prst=\"rect\"><a:avLst /></a:prstGeom></xdr:spPr><xdr:style><a:lnRef idx=\"2\"><a:schemeClr val=\"accent1\"><a:shade val=\"50000\" /></a:schemeClr></a:lnRef><a:fillRef idx=\"1\"><a:schemeClr val=\"accent1\" /></a:fillRef><a:effectRef idx=\"0\"><a:schemeClr val=\"accent1\" /></a:effectRef><a:fontRef idx=\"minor\"><a:schemeClr val=\"lt1\" /></a:fontRef></xdr:style><xdr:txBody><a:bodyPr vertOverflow=\"clip\" rtlCol=\"0\" anchor=\"ctr\" /><a:lstStyle /><a:p></a:p></xdr:txBody>", _id, Name);
+            return xml.ToString();
+        }
+        #endregion
+        internal new string Id
+        {
+            get { return Name + Text; }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelView3D.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelView3D.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/ExcelView3D.cs	(revision 9616)
@@ -0,0 +1,151 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+
+namespace OfficeOpenXml.Drawing
+{
+    /// <summary>
+    /// 3D settings
+    /// </summary>
+    public sealed class ExcelView3D : XmlHelper
+    {
+       internal ExcelView3D(XmlNamespaceManager ns, XmlNode node)
+           : base(ns,node)
+       {
+           SchemaNodeOrder = new string[] { "rotX", "hPercent", "rotY", "depthPercent","rAngAx", "perspective"};
+       }
+       const string perspectivePath = "c:perspective/@val";
+       /// <summary>
+       /// Degree of perspective 
+       /// </summary>
+       public decimal Perspective
+       {
+           get
+           {
+               return GetXmlNodeInt(perspectivePath);
+           }
+           set
+           {
+               SetXmlNodeString(perspectivePath, value.ToString(CultureInfo.InvariantCulture));
+           }
+       }
+       const string rotXPath = "c:rotX/@val";
+       /// <summary>
+       /// Rotation X-axis
+       /// </summary>
+       public decimal RotX
+       {
+           get
+           {
+               return GetXmlNodeDecimal(rotXPath);
+           }
+           set
+           {
+               CreateNode(rotXPath);
+               SetXmlNodeString(rotXPath, value.ToString(CultureInfo.InvariantCulture));
+           }
+       }
+       const string rotYPath = "c:rotY/@val";
+       /// <summary>
+       /// Rotation Y-axis
+       /// </summary>
+       public decimal RotY
+       {
+           get
+           {
+               return GetXmlNodeDecimal(rotYPath);
+           }
+           set
+           {
+               CreateNode(rotYPath);
+               SetXmlNodeString(rotYPath, value.ToString(CultureInfo.InvariantCulture));
+           }
+       }
+       const string rAngAxPath = "c:rAngAx/@val";
+       /// <summary>
+       /// Right Angle Axes
+       /// </summary>
+       public bool RightAngleAxes
+       {
+           get
+           {
+               return GetXmlNodeBool(rAngAxPath);
+           }
+           set
+           {
+               SetXmlNodeBool(rAngAxPath, value);
+           }
+       }
+       const string depthPercentPath = "c:depthPercent/@val";
+       /// <summary>
+       /// Depth % of base
+       /// </summary>
+       public int DepthPercent
+       {
+           get
+           {
+               return GetXmlNodeInt(depthPercentPath);
+           }
+           set
+           {
+               if (value < 0 || value > 2000)
+               {
+                   throw(new ArgumentOutOfRangeException("Value must be between 0 and 2000"));
+               }
+               SetXmlNodeString(depthPercentPath, value.ToString());
+           }
+       }
+       const string heightPercentPath = "c:hPercent/@val";
+       /// <summary>
+       /// Height % of base
+       /// </summary>
+       public int HeightPercent
+       {
+           get
+           {
+               return GetXmlNodeInt(heightPercentPath);
+           }
+           set
+           {
+               if (value < 5 || value > 500)
+               {
+                   throw (new ArgumentOutOfRangeException("Value must be between 5 and 500"));
+               }
+               SetXmlNodeString(heightPercentPath, value.ToString());
+           }
+       }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingBase.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingBase.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingBase.cs	(revision 9616)
@@ -0,0 +1,152 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2010-06-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+using System.Drawing;
+
+namespace OfficeOpenXml.Drawing.Vml
+{
+    /// <summary>
+    /// Horizontal Alingment
+    /// </summary>
+    public enum eTextAlignHorizontalVml
+    {
+        Left,
+        Center,
+        Right
+    }
+    /// <summary>
+    /// Vertical Alingment
+    /// </summary>
+    public enum eTextAlignVerticalVml
+    {
+        Top,
+        Center,
+        Bottom
+    }
+    /// <summary>
+    /// Linestyle
+    /// </summary>
+    public enum eLineStyleVml
+    {
+        Solid,
+        Round,
+        Square,
+        Dash,
+        DashDot,
+        LongDash,
+        LongDashDot,
+        LongDashDotDot
+    }
+    /// <summary>
+    /// Drawing object used for comments
+    /// </summary>
+    public class ExcelVmlDrawingBase : XmlHelper
+    {
+        internal ExcelVmlDrawingBase(XmlNode topNode, XmlNamespaceManager ns) :
+            base(ns, topNode)
+        {
+            SchemaNodeOrder = new string[] { "fill", "stroke", "shadow", "path", "textbox", "ClientData", "MoveWithCells", "SizeWithCells", "Anchor", "Locked", "AutoFill", "LockText", "TextHAlign", "TextVAlign", "Row", "Column", "Visible" };
+        }   
+        public string Id 
+        {
+            get
+            {
+                return GetXmlNodeString("@id");
+            }
+            set
+            {
+                SetXmlNodeString("@id",value);
+            }
+        }
+        #region "Style Handling methods"
+        protected bool GetStyle(string style, string key, out string value)
+        {
+            string[]styles = style.Split(';');
+            foreach(string s in styles)
+            {
+                if (s.IndexOf(':') > 0)
+                {
+                    string[] split = s.Split(':');
+                    if (split[0] == key)
+                    {
+                        value=split[1];
+                        return true;
+                    }
+                }
+                else if (s == key)
+                {
+                    value="";
+                    return true;
+                }
+            }
+            value="";
+            return false;
+        }
+        protected string SetStyle(string style, string key, string value)
+        {
+            string[] styles = style.Split(';');
+            string newStyle="";
+            bool changed = false;
+            foreach (string s in styles)
+            {
+                string[] split = s.Split(':');
+                if (split[0].Trim() == key)
+                {
+                    if (value.Trim() != "") //If blank remove the item
+                    {
+                        newStyle += key + ':' + value;
+                    }
+                    changed = true;
+                }
+                else
+                {
+                    newStyle += s;
+                }
+                newStyle += ';';
+            }
+            if (!changed)
+            {
+                newStyle += key + ':' + value;
+            }
+            else
+            {
+                newStyle = style.Substring(0, style.Length - 1);
+            }
+            return newStyle;
+        }
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingBaseCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingBaseCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingBaseCollection.cs	(revision 9616)
@@ -0,0 +1,70 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2010-06-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Collections;
+using System.IO.Packaging;
+
+namespace OfficeOpenXml.Drawing.Vml
+{
+    public class ExcelVmlDrawingBaseCollection
+    {        
+        internal ExcelVmlDrawingBaseCollection(ExcelPackage pck, ExcelWorksheet ws, Uri uri)
+        {
+            VmlDrawingXml = new XmlDocument();
+            VmlDrawingXml.PreserveWhitespace = false;
+            
+            NameTable nt=new NameTable();
+            NameSpaceManager = new XmlNamespaceManager(nt);
+            NameSpaceManager.AddNamespace("v", ExcelPackage.schemaMicrosoftVml);
+            NameSpaceManager.AddNamespace("o", ExcelPackage.schemaMicrosoftOffice);
+            NameSpaceManager.AddNamespace("x", ExcelPackage.schemaMicrosoftExcel);
+            Uri = uri;
+            if (uri == null)
+            {
+                Part = null;
+            }
+            else
+            {
+                Part=pck.Package.GetPart(uri);
+                XmlHelper.LoadXmlSafe(VmlDrawingXml, Part.GetStream()); 
+            }
+        }
+        internal XmlDocument VmlDrawingXml { get; set; }
+        internal Uri Uri { get; set; }
+        internal string RelId { get; set; }
+        internal PackagePart Part { get; set; }
+        internal XmlNamespaceManager NameSpaceManager { get; set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingComment.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingComment.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingComment.cs	(revision 9616)
@@ -0,0 +1,459 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2010-06-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+using System.Drawing;
+
+namespace OfficeOpenXml.Drawing.Vml
+{
+    /// <summary>
+    /// Drawing object used for comments
+    /// </summary>
+    public class ExcelVmlDrawingComment : ExcelVmlDrawingBase, IRangeID
+    {
+        internal ExcelVmlDrawingComment(XmlNode topNode, ExcelRangeBase range, XmlNamespaceManager ns) :
+            base(topNode, ns)
+        {
+            Range = range;
+            SchemaNodeOrder = new string[] { "fill", "stroke", "shadow", "path", "textbox", "ClientData", "MoveWithCells", "SizeWithCells", "Anchor", "Locked", "AutoFill", "LockText", "TextHAlign", "TextVAlign", "Row", "Column", "Visible" };
+        }   
+        internal ExcelRangeBase Range { get; set; }
+        //public string Id 
+        //{
+        //    get
+        //    {
+        //        return GetXmlNodeString("@id");
+        //    }
+        //    set
+        //    {
+        //        SetXmlNodeString("@id",value);
+        //    }
+        //}
+        const string VERTICAL_ALIGNMENT_PATH="x:ClientData/x:TextVAlign";
+        /// <summary>
+        /// Vertical alignment for text
+        /// </summary>
+        public eTextAlignVerticalVml VerticalAlignment
+        {
+            get
+            {
+                switch (GetXmlNodeString(VERTICAL_ALIGNMENT_PATH))
+                {
+                    case "Center":
+                        return eTextAlignVerticalVml.Center;
+                    case "Bottom":
+                        return eTextAlignVerticalVml.Bottom;
+                    default:
+                        return eTextAlignVerticalVml.Top;
+                }
+            }
+            set
+            {
+                switch (value)
+                {
+                    case eTextAlignVerticalVml.Center:
+                        SetXmlNodeString(VERTICAL_ALIGNMENT_PATH, "Center");
+                        break;
+                    case eTextAlignVerticalVml.Bottom:
+                        SetXmlNodeString(VERTICAL_ALIGNMENT_PATH, "Bottom");
+                        break;
+                    default:
+                        DeleteNode(VERTICAL_ALIGNMENT_PATH);
+                        break;
+                }
+            }
+        }
+        const string HORIZONTAL_ALIGNMENT_PATH="x:ClientData/x:TextHAlign";
+        /// <summary>
+        /// Horizontal alignment for text
+        /// </summary>
+        public eTextAlignHorizontalVml HorizontalAlignment
+        {
+            get
+            {
+                switch (GetXmlNodeString(HORIZONTAL_ALIGNMENT_PATH))
+                {
+                    case "Center":
+                        return eTextAlignHorizontalVml.Center;
+                    case "Right":
+                        return eTextAlignHorizontalVml.Right;
+                    default:
+                        return eTextAlignHorizontalVml.Left;
+                }
+            }
+            set
+            {
+                switch (value)
+                {
+                    case eTextAlignHorizontalVml.Center:
+                        SetXmlNodeString(HORIZONTAL_ALIGNMENT_PATH, "Center");
+                        break;
+                    case eTextAlignHorizontalVml.Right:
+                        SetXmlNodeString(HORIZONTAL_ALIGNMENT_PATH, "Right");
+                        break;
+                    default:
+                        DeleteNode(HORIZONTAL_ALIGNMENT_PATH);
+                        break;
+                }
+            }
+        }
+        const string VISIBLE_PATH = "x:ClientData/x:Visible";
+        /// <summary>
+        /// If the drawing object is visible.
+        /// </summary>
+        public bool Visible 
+        { 
+            get
+            {
+                return (TopNode.SelectSingleNode(VISIBLE_PATH, NameSpaceManager)!=null);
+            }
+            set
+            {
+                if (value)
+                {
+                    CreateNode(VISIBLE_PATH);
+                    Style = SetStyle(Style,"visibility", "visible");
+                }
+                else
+                {
+                    DeleteNode(VISIBLE_PATH);
+                    Style = SetStyle(Style,"visibility", "hidden");
+                }                
+            }
+        }
+        const string BACKGROUNDCOLOR_PATH = "@fillcolor";
+        const string BACKGROUNDCOLOR2_PATH = "v:fill/@color2";
+        /// <summary>
+        /// Background color
+        /// </summary>
+        public Color BackgroundColor
+        {
+            get
+            {
+                string col = GetXmlNodeString(BACKGROUNDCOLOR_PATH);
+                if (col == "")
+                {
+                    return Color.FromArgb(0xff, 0xff, 0xe1);
+                }
+                else
+                {
+                    if(col.StartsWith("#")) col=col.Substring(1,col.Length-1);
+                    int res;
+                    if (int.TryParse(col,System.Globalization.NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out res))
+                    {
+                        return Color.FromArgb(res);
+                    }
+                    else
+                    {
+                        return Color.Empty;
+                    }
+                }
+            }
+            set
+            {
+                string color = "#" + value.ToArgb().ToString("X").Substring(2, 6);
+                SetXmlNodeString(BACKGROUNDCOLOR_PATH, color);
+                //SetXmlNode(BACKGROUNDCOLOR2_PATH, color);
+            }
+        }
+        const string LINESTYLE_PATH="v:stroke/@dashstyle";
+        const string ENDCAP_PATH = "v:stroke/@endcap";
+        /// <summary>
+        /// Linestyle for border
+        /// </summary>
+        public eLineStyleVml LineStyle 
+        { 
+            get
+            {
+                string v=GetXmlNodeString(LINESTYLE_PATH);
+                if (v == "")
+                {
+                    return eLineStyleVml.Solid;
+                }
+                else if (v == "1 1")
+                {
+                    v = GetXmlNodeString(ENDCAP_PATH);
+                    return (eLineStyleVml)Enum.Parse(typeof(eLineStyleVml), v, true);
+                }
+                else
+                {
+                    return (eLineStyleVml)Enum.Parse(typeof(eLineStyleVml), v, true);
+                }
+            }
+            set
+            {
+                if (value == eLineStyleVml.Round || value == eLineStyleVml.Square)
+                {
+                    SetXmlNodeString(LINESTYLE_PATH, "1 1");
+                    if (value == eLineStyleVml.Round)
+                    {
+                        SetXmlNodeString(ENDCAP_PATH, "round");
+                    }
+                    else
+                    {
+                        DeleteNode(ENDCAP_PATH);
+                    }
+                }
+                else
+                {
+                    string v = value.ToString();
+                    v = v.Substring(0, 1).ToLower() + v.Substring(1, v.Length - 1);
+                    SetXmlNodeString(LINESTYLE_PATH, v);
+                    DeleteNode(ENDCAP_PATH);
+                }
+            }
+        }
+        const string LINECOLOR_PATH="@strokecolor";
+        /// <summary>
+        /// Line color 
+        /// </summary>
+        public Color LineColor
+        {
+            get
+            {
+                string col = GetXmlNodeString(LINECOLOR_PATH);
+                if (col == "")
+                {
+                    return Color.Black;
+                }
+                else
+                {
+                    if (col.StartsWith("#")) col = col.Substring(1, col.Length - 1);
+                    int res;
+                    if (int.TryParse(col, System.Globalization.NumberStyles.AllowHexSpecifier, CultureInfo.InvariantCulture, out res))
+                    {
+                        return Color.FromArgb(res);
+                    }
+                    else
+                    {
+                        return Color.Empty;
+                    }
+                }                
+            }
+            set
+            {
+                string color = "#" + value.ToArgb().ToString("X").Substring(2, 6);
+                SetXmlNodeString(LINECOLOR_PATH, color);
+            }
+        }
+        const string LINEWIDTH_PATH="@strokeweight";
+        /// <summary>
+        /// Width of the border
+        /// </summary>
+        public Single LineWidth 
+        {
+            get
+            {
+                string wt=GetXmlNodeString(LINEWIDTH_PATH);
+                if (wt == "") return (Single).75;
+                if(wt.EndsWith("pt")) wt=wt.Substring(0,wt.Length-2);
+
+                Single ret;
+                if(Single.TryParse(wt,System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture, out ret))
+                {
+                    return ret;
+                }
+                else
+                {
+                    return 0;
+                }
+            }
+            set
+            {
+                SetXmlNodeString(LINEWIDTH_PATH, value.ToString(CultureInfo.InvariantCulture) + "pt");
+            }
+        }
+        ///// <summary>
+        ///// Width of the Comment 
+        ///// </summary>
+        //public Single Width
+        //{
+        //    get
+        //    {
+        //        string v;
+        //        GetStyle("width", out v);
+        //        if(v.EndsWith("pt"))
+        //        {
+        //            v = v.Substring(0, v.Length - 2);
+        //        }
+        //        short ret;
+        //        if (short.TryParse(v,System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture, out ret))
+        //        {
+        //            return ret;
+        //        }
+        //        else
+        //        {
+        //            return 0;
+        //        }
+        //    }
+        //    set
+        //    {
+        //        SetStyle("width", value.ToString("N2",CultureInfo.InvariantCulture) + "pt");
+        //    }
+        //}
+        ///// <summary>
+        ///// Height of the Comment 
+        ///// </summary>
+        //public Single Height
+        //{
+        //    get
+        //    {
+        //        string v;
+        //        GetStyle("height", out v);
+        //        if (v.EndsWith("pt"))
+        //        {
+        //            v = v.Substring(0, v.Length - 2);
+        //        }
+        //        short ret;
+        //        if (short.TryParse(v, System.Globalization.NumberStyles.Any, CultureInfo.InvariantCulture, out ret))
+        //        {
+        //            return ret;
+        //        }
+        //        else
+        //        {
+        //            return 0;
+        //        }
+        //    }
+        //    set
+        //    {
+        //        SetStyle("height", value.ToString("N2", CultureInfo.InvariantCulture) + "pt");
+        //    }
+        //}
+        const string TEXTBOX_STYLE_PATH = "v:textbox/@style";
+        /// <summary>
+        /// Autofits the drawingobject 
+        /// </summary>
+        public bool AutoFit
+        {
+            get
+            {
+                string value;
+                GetStyle(GetXmlNodeString(TEXTBOX_STYLE_PATH), "mso-fit-shape-to-text", out value);
+                return value=="t";
+            }
+            set
+            {                
+                SetXmlNodeString(TEXTBOX_STYLE_PATH, SetStyle(GetXmlNodeString(TEXTBOX_STYLE_PATH),"mso-fit-shape-to-text", value?"t":"")); 
+            }
+        }        
+        const string LOCKED_PATH = "x:ClientData/x:Locked";
+        /// <summary>
+        /// If the object is locked when the sheet is protected
+        /// </summary>
+        public bool Locked 
+        {
+            get
+            {
+                return GetXmlNodeBool(LOCKED_PATH, false);
+            }
+            set
+            {
+                SetXmlNodeBool(LOCKED_PATH, value, false);                
+            }
+        }
+        const string LOCK_TEXT_PATH = "x:ClientData/x:LockText";        
+        /// <summary>
+        /// Specifies that the object's text is locked
+        /// </summary>
+        public bool LockText
+        {
+            get
+            {
+                return GetXmlNodeBool(LOCK_TEXT_PATH, false);
+            }
+            set
+            {
+                SetXmlNodeBool(LOCK_TEXT_PATH, value, false);
+            }
+        }
+        ExcelVmlDrawingPosition _from = null;
+        /// <summary>
+        /// From position. For comments only when Visible=true.
+        /// </summary>
+        public ExcelVmlDrawingPosition From
+        {
+            get
+            {
+                if (_from == null)
+                {
+                    _from = new ExcelVmlDrawingPosition(NameSpaceManager, TopNode.SelectSingleNode("x:ClientData", NameSpaceManager), 0);
+                }
+                return _from;
+            }
+        }
+        ExcelVmlDrawingPosition _to = null;
+        /// <summary>
+        /// To position. For comments only when Visible=true.
+        /// </summary>
+        public ExcelVmlDrawingPosition To
+        {
+            get
+            {
+                if (_to == null)
+                {
+                    _to = new ExcelVmlDrawingPosition(NameSpaceManager, TopNode.SelectSingleNode("x:ClientData", NameSpaceManager), 4);
+                }
+                return _to;
+            }
+        }
+        const string STYLE_PATH = "@style";
+        internal string Style
+        {
+            get
+            {
+                return GetXmlNodeString(STYLE_PATH);
+            }
+            set
+            {
+                SetXmlNodeString(STYLE_PATH, value);
+            }
+        }
+        #region IRangeID Members
+
+        ulong IRangeID.RangeID
+        {
+            get
+            {
+                return ExcelCellBase.GetCellID(Range.Worksheet.SheetID, Range.Start.Row, Range.Start.Column);
+            }
+            set
+            {
+                
+            }
+        }
+
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingCommentCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingCommentCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingCommentCollection.cs	(revision 9616)
@@ -0,0 +1,207 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2010-06-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Collections;
+using System.IO.Packaging;
+
+namespace OfficeOpenXml.Drawing.Vml
+{
+    internal class ExcelVmlDrawingCommentCollection : ExcelVmlDrawingBaseCollection, IEnumerable
+    {
+        internal RangeCollection _drawings;
+        internal ExcelVmlDrawingCommentCollection(ExcelPackage pck, ExcelWorksheet ws, Uri uri) :
+            base(pck, ws,uri)
+        {
+            if (uri == null)
+            {
+                VmlDrawingXml.LoadXml(CreateVmlDrawings());
+                _drawings = new RangeCollection(new List<IRangeID>());
+            }
+            else
+            {
+                AddDrawingsFromXml(ws);
+            }
+        }
+        protected void AddDrawingsFromXml(ExcelWorksheet ws)
+        {
+            var nodes = VmlDrawingXml.SelectNodes("//v:shape", NameSpaceManager);
+            var list = new List<IRangeID>();
+            foreach (XmlNode node in nodes)
+            {
+                var rowNode = node.SelectSingleNode("x:ClientData/x:Row", NameSpaceManager);
+                var colNode = node.SelectSingleNode("x:ClientData/x:Column", NameSpaceManager);
+                if (rowNode != null && colNode != null)
+                {
+                    var row = int.Parse(rowNode.InnerText) + 1;
+                    var col = int.Parse(colNode.InnerText) + 1;
+                    list.Add(new ExcelVmlDrawingComment(node, ws.Cells[row, col], NameSpaceManager));
+                }
+                else
+                {
+                    list.Add(new ExcelVmlDrawingComment(node, ws.Cells[1, 1], NameSpaceManager));
+                }
+            }
+            list.Sort(new Comparison<IRangeID>((r1, r2) => (r1.RangeID < r2.RangeID ? -1 : r1.RangeID > r2.RangeID ? 1 : 0)));  //Vml drawings are not sorted. Sort to avoid missmatches.
+            _drawings = new RangeCollection(list);
+        }
+        private string CreateVmlDrawings()
+        {
+            string vml=string.Format("<xml xmlns:v=\"{0}\" xmlns:o=\"{1}\" xmlns:x=\"{2}\">", 
+                ExcelPackage.schemaMicrosoftVml, 
+                ExcelPackage.schemaMicrosoftOffice, 
+                ExcelPackage.schemaMicrosoftExcel);
+            
+             vml+="<o:shapelayout v:ext=\"edit\">";
+             vml+="<o:idmap v:ext=\"edit\" data=\"1\"/>";
+             vml+="</o:shapelayout>";
+
+             vml+="<v:shapetype id=\"_x0000_t202\" coordsize=\"21600,21600\" o:spt=\"202\" path=\"m,l,21600r21600,l21600,xe\">";
+             vml+="<v:stroke joinstyle=\"miter\" />";
+             vml+="<v:path gradientshapeok=\"t\" o:connecttype=\"rect\" />";
+             vml+="</v:shapetype>";
+             vml+= "</xml>";
+
+            return vml;
+        }
+        internal ExcelVmlDrawingComment Add(ExcelRangeBase cell)
+        {
+            XmlNode node = AddDrawing(cell);
+            var draw = new ExcelVmlDrawingComment(node, cell, NameSpaceManager);            
+            _drawings.Add(draw);
+            return draw;
+        }
+        private XmlNode AddDrawing(ExcelRangeBase cell)
+        {
+            int row = cell.Start.Row, col = cell.Start.Column;
+            var node = VmlDrawingXml.CreateElement("v", "shape", ExcelPackage.schemaMicrosoftVml);
+
+            var id = ExcelCellBase.GetCellID(cell.Worksheet.SheetID, cell._fromRow, cell._fromCol);
+            var ix = _drawings.IndexOf(id);
+            if (ix < 0 && (~ix < _drawings.Count))
+            {
+                ix = ~ix;
+                var prevDraw = _drawings[ix] as ExcelVmlDrawingBase;
+                prevDraw.TopNode.ParentNode.InsertBefore(node, prevDraw.TopNode);
+            }
+            else
+            {
+                VmlDrawingXml.DocumentElement.AppendChild(node);
+            }
+
+            node.SetAttribute("id", GetNewId());
+            node.SetAttribute("type", "#_x0000_t202");
+            node.SetAttribute("style", "position:absolute;z-index:1; visibility:hidden");
+            //node.SetAttribute("style", "position:absolute; margin-left:59.25pt;margin-top:1.5pt;width:108pt;height:59.25pt;z-index:1; visibility:hidden"); 
+            node.SetAttribute("fillcolor", "#ffffe1");
+            node.SetAttribute("insetmode",ExcelPackage.schemaMicrosoftOffice,"auto");
+
+            string vml = "<v:fill color2=\"#ffffe1\" />";
+            vml += "<v:shadow on=\"t\" color=\"black\" obscured=\"t\" />";
+            vml += "<v:path o:connecttype=\"none\" />";
+            vml += "<v:textbox style=\"mso-direction-alt:auto\">";
+            vml += "<div style=\"text-align:left\" />";
+            vml += "</v:textbox>";
+            vml += "<x:ClientData ObjectType=\"Note\">";
+            vml += "<x:MoveWithCells />";
+            vml += "<x:SizeWithCells />";
+            vml += string.Format("<x:Anchor>{0}, 15, {1}, 2, {2}, 31, {3}, 1</x:Anchor>", col, row - 1, col + 2, row + 3);
+            vml += "<x:AutoFill>False</x:AutoFill>";
+            vml += string.Format("<x:Row>{0}</x:Row>", row - 1); ;
+            vml += string.Format("<x:Column>{0}</x:Column>", col - 1);
+            vml += "</x:ClientData>";
+
+            node.InnerXml = vml;
+            return node;
+        }
+        int _nextID = 0;
+        /// <summary>
+        /// returns the next drawing id.
+        /// </summary>
+        /// <returns></returns>
+        internal string GetNewId()
+        {
+            if (_nextID == 0)
+            {
+                foreach (ExcelVmlDrawingComment draw in this)
+                {
+                    if (draw.Id.Length > 3 && draw.Id.StartsWith("vml"))
+                    {
+                        int id;
+                        if (int.TryParse(draw.Id.Substring(3, draw.Id.Length - 3), out id))
+                        {
+                            if (id > _nextID)
+                            {
+                                _nextID = id;
+                            }
+                        }
+                    }
+                }
+            }
+            _nextID++;
+            return "vml" + _nextID.ToString();
+        }
+        internal ExcelVmlDrawingBase this[ulong rangeID]
+        {
+            get
+            {
+                return _drawings[rangeID] as ExcelVmlDrawingComment;
+            }
+        }
+        internal bool ContainsKey(ulong rangeID)
+        {
+            return _drawings.ContainsKey(rangeID);
+        }
+        internal int Count
+        {
+            get
+            {
+                return _drawings.Count;
+            }
+        }
+        #region IEnumerable Members
+
+        #endregion
+
+        public IEnumerator GetEnumerator()
+        {
+            return _drawings;
+        }
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return _drawings;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingPicture.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingPicture.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingPicture.cs	(revision 9616)
@@ -0,0 +1,357 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2010-06-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+using System.Drawing;
+using System.IO.Packaging;
+
+namespace OfficeOpenXml.Drawing.Vml
+{
+    /// <summary>
+    /// Drawing object used for header and footer pictures
+    /// </summary>
+    public class ExcelVmlDrawingPicture : ExcelVmlDrawingBase
+    {
+        ExcelWorksheet _worksheet;
+        internal ExcelVmlDrawingPicture(XmlNode topNode, XmlNamespaceManager ns, ExcelWorksheet ws) :
+            base(topNode, ns)
+        {
+            _worksheet = ws;
+        }
+        /// <summary>
+        /// Position ID
+        /// </summary>
+        public string Position
+        {
+            get
+            {
+                return GetXmlNodeString("@id");
+            }
+        }
+        /// <summary>
+        /// The width in points
+        /// </summary>
+        public double Width
+        {
+            get
+            {
+                return GetStyleProp("width");
+            }
+            set
+            {
+                SetStyleProp("width",value.ToString(CultureInfo.InvariantCulture) + "pt");
+            }
+        }
+        /// <summary>
+        /// The height in points
+        /// </summary>
+        public double Height
+        {
+            get
+            {
+                return GetStyleProp("height");
+            }
+            set
+            {
+                SetStyleProp("height", value.ToString(CultureInfo.InvariantCulture) + "pt");
+            }
+        }
+        /// <summary>
+        /// Margin Left in points
+        /// </summary>
+        public double Left
+        {
+            get
+            {
+                return GetStyleProp("left");
+            }
+            set
+            {
+                SetStyleProp("left", value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        /// <summary>
+        /// Margin top in points
+        /// </summary>
+        public double Top
+        {
+            get
+            {
+                return GetStyleProp("top");
+            }
+            set
+            {
+                SetStyleProp("top", value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        /// <summary>
+        /// The Title of the image
+        /// </summary>
+        public string Title
+        {
+            get
+            {
+                return GetXmlNodeString("v:imagedata/@o:title");
+            }
+            set
+            {
+                SetXmlNodeString("v:imagedata/@o:title",value);
+            }
+        }
+        /// <summary>
+        /// The image
+        /// </summary>
+        public Image Image
+        {
+            get
+            {
+                var pck = _worksheet._package.Package;
+                if (pck.PartExists(ImageUri))
+                {
+                    var part = pck.GetPart(ImageUri);
+                    return Image.FromStream(part.GetStream());
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+        internal Uri ImageUri
+        {
+            get;
+            set;
+        }
+        internal string RelId
+        {
+            get
+            {
+                return GetXmlNodeString("v:imagedata/@o:relid");
+            }
+            set
+            {
+                SetXmlNodeString("v:imagedata/@o:relid",value);
+            }
+        }        
+        /// <summary>
+        /// Determines whether an image will be displayed in black and white
+        /// </summary>
+        public bool BiLevel
+        {
+            get
+            {
+                return GetXmlNodeString("v:imagedata/@bilevel")=="t";
+            }
+            set
+            {
+                if (value)
+                {
+                    SetXmlNodeString("v:imagedata/@bilevel", "t");
+                }
+                else
+                {
+                    DeleteNode("v:imagedata/@bilevel");
+                }
+            }
+        }
+        /// <summary>
+        /// Determines whether a picture will be displayed in grayscale mode
+        /// </summary>
+        public bool GrayScale
+        {
+            get
+            {
+                return GetXmlNodeString("v:imagedata/@grayscale")=="t";
+            }
+            set
+            {
+                if (value)
+                {
+                    SetXmlNodeString("v:imagedata/@grayscale", "t");
+                }
+                else
+                {
+                    DeleteNode("v:imagedata/@grayscale");
+                }
+            }
+        }
+        /// <summary>
+        /// Defines the intensity of all colors in an image
+        /// Default value is 1
+        /// </summary>
+        public double Gain
+        {
+            get
+            {
+                string v = GetXmlNodeString("v:imagedata/@gain");
+                return GetFracDT(v,1);
+            }
+            set
+            {
+                if (value < 0)
+                {
+                    throw (new ArgumentOutOfRangeException("Value must be positive"));
+                }
+                if (value == 1)
+                {
+                    DeleteNode("v:imagedata/@gamma");
+                }
+                else
+                {
+                    SetXmlNodeString("v:imagedata/@gain", value.ToString("#.0#", CultureInfo.InvariantCulture));
+                }
+            }
+        }
+        /// <summary>
+        /// Defines the amount of contrast for an image
+        /// Default value is 0;
+        /// </summary>
+        public double Gamma
+        {
+            get
+            {
+                string v = GetXmlNodeString("v:imagedata/@gamma");
+                return GetFracDT(v,0);
+            }
+            set
+            {
+                if (value == 0) //Default
+                {
+                    DeleteNode("v:imagedata/@gamma");
+                }
+                else
+                {
+                    SetXmlNodeString("v:imagedata/@gamma", value.ToString("#.0#", CultureInfo.InvariantCulture));
+                }
+            }
+        }
+        /// <summary>
+        /// Defines the intensity of black in an image
+        /// Default value is 0
+        /// </summary>
+        public double BlackLevel
+        {
+            get
+            {
+                string v = GetXmlNodeString("v:imagedata/@blacklevel");
+                return GetFracDT(v, 0);
+            }
+            set
+            {
+                if (value == 0)
+                {
+                    DeleteNode("v:imagedata/@blacklevel");
+                }
+                else
+                {
+                    SetXmlNodeString("v:imagedata/@blacklevel", value.ToString("#.0#", CultureInfo.InvariantCulture));
+                }
+            }
+        }
+
+        #region Private Methods
+        private double GetFracDT(string v, double def)
+        {
+            double d;
+            if (v.EndsWith("f"))
+            {
+                v = v.Substring(0, v.Length - 1);
+                if (double.TryParse(v, out d))
+                {
+                    d /= 65535;
+                }
+                else
+                {
+                    d = def;
+                }
+            }
+            else
+            {
+                if (!double.TryParse(v, out d))
+                {
+                    d = def;
+                }
+            }
+            return d;
+        }
+        private void SetStyleProp(string propertyName, string value)
+        {
+            string style = GetXmlNodeString("@style");
+            string newStyle = "";
+            bool found = false;
+            foreach (string prop in style.Split(';'))
+            {
+                string[] split = prop.Split(':');
+                if (split[0] == propertyName)
+                {
+                    newStyle += propertyName + ":" + value + ";";
+                    found = true;
+                }
+                else
+                {
+                    newStyle += prop + ";";
+                }
+            }
+            if (!found)
+            {
+                newStyle += propertyName + ":" + value + ";";
+            }
+            SetXmlNodeString("@style", newStyle.Substring(0, newStyle.Length - 1));
+        }
+        private double GetStyleProp(string propertyName)
+        {
+            string style = GetXmlNodeString("@style");
+            foreach (string prop in style.Split(';'))
+            {
+                string[] split = prop.Split(':');
+                if (split[0] == propertyName && split.Length > 1)
+                {
+                    string value = split[1].EndsWith("pt") ? split[1].Substring(0, split[1].Length - 2) : split[1];
+                    double ret;
+                    if (double.TryParse(value, out ret))
+                    {
+                        return ret;
+                    }
+                    else
+                    {
+                        return 0;
+                    }
+                }
+            }
+            return 0;
+        }
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingPictureCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingPictureCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingPictureCollection.cs	(revision 9616)
@@ -0,0 +1,172 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2010-06-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Collections;
+using System.IO.Packaging;
+using System.Globalization;
+
+namespace OfficeOpenXml.Drawing.Vml
+{
+    public class ExcelVmlDrawingPictureCollection : ExcelVmlDrawingBaseCollection, IEnumerable
+    {
+        internal List<ExcelVmlDrawingPicture> _images;
+        ExcelPackage _pck;
+        ExcelWorksheet _ws;
+        internal ExcelVmlDrawingPictureCollection(ExcelPackage pck, ExcelWorksheet ws, Uri uri) :
+            base(pck, ws, uri)
+        {            
+            _pck = pck;
+            _ws = ws;
+            if (uri == null)
+            {
+                VmlDrawingXml.LoadXml(CreateVmlDrawings());
+                _images = new List<ExcelVmlDrawingPicture>();
+            }
+            else
+            {
+                AddDrawingsFromXml();
+            }
+        }
+
+        private void AddDrawingsFromXml()
+        {
+            var nodes = VmlDrawingXml.SelectNodes("//v:shape", NameSpaceManager);
+            _images = new List<ExcelVmlDrawingPicture>();
+            foreach (XmlNode node in nodes)
+            {
+                var img = new ExcelVmlDrawingPicture(node, NameSpaceManager, _ws);
+                var rel = Part.GetRelationship(img.RelId);
+                img.ImageUri = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+                _images.Add(img);
+            }
+        }
+
+        private string CreateVmlDrawings()
+        {
+            string vml=string.Format("<xml xmlns:v=\"{0}\" xmlns:o=\"{1}\" xmlns:x=\"{2}\">", 
+                ExcelPackage.schemaMicrosoftVml, 
+                ExcelPackage.schemaMicrosoftOffice, 
+                ExcelPackage.schemaMicrosoftExcel);
+            
+             vml+="<o:shapelayout v:ext=\"edit\">";
+             vml+="<o:idmap v:ext=\"edit\" data=\"1\"/>";
+             vml+="</o:shapelayout>";
+
+             vml+="<v:shapetype id=\"_x0000_t202\" coordsize=\"21600,21600\" o:spt=\"202\" path=\"m,l,21600r21600,l21600,xe\">";
+             vml+="<v:stroke joinstyle=\"miter\" />";
+             vml+="<v:path gradientshapeok=\"t\" o:connecttype=\"rect\" />";
+             vml+="</v:shapetype>";
+             vml+= "</xml>";
+
+            return vml;
+        }
+        internal ExcelVmlDrawingPicture Add(string id, Uri uri, string name, double width, double height)
+        {
+            XmlNode node = AddImage(id, uri, name, width, height);
+            var draw = new ExcelVmlDrawingPicture(node, NameSpaceManager, _ws);
+            draw.ImageUri = uri;
+            _images.Add(draw);
+            return draw;
+        }
+        private XmlNode AddImage(string id, Uri targeUri, string Name, double width, double height)
+        {
+            var node = VmlDrawingXml.CreateElement("v", "shape", ExcelPackage.schemaMicrosoftVml);
+            VmlDrawingXml.DocumentElement.AppendChild(node);
+            node.SetAttribute("id", id);
+            node.SetAttribute("o:type", "#_x0000_t75");
+            node.SetAttribute("style", string.Format("position:absolute;margin-left:0;margin-top:0;width:{0}pt;height:{1}pt;z-index:1", width.ToString(CultureInfo.InvariantCulture), height.ToString(CultureInfo.InvariantCulture)));
+            //node.SetAttribute("fillcolor", "#ffffe1");
+            //node.SetAttribute("insetmode", ExcelPackage.schemaMicrosoftOffice, "auto");
+
+            node.InnerXml = string.Format("<v:imagedata o:relid=\"\" o:title=\"{0}\"/><o:lock v:ext=\"edit\" rotation=\"t\"/>",  Name);
+            return node;
+        }
+        /// <summary>
+        /// Indexer
+        /// </summary>
+        /// <param name="Index">Index</param>
+        /// <returns>The VML Drawing Picture object</returns>
+        public ExcelVmlDrawingPicture this[int Index]
+        {
+            get
+            {
+                return _images[Index] as ExcelVmlDrawingPicture;
+            }
+        }
+        public int Count
+        {
+            get
+            {
+                return _images.Count;
+            }
+        }
+
+        int _nextID = 0;
+        /// <summary>
+        /// returns the next drawing id.
+        /// </summary>
+        /// <returns></returns>
+        internal string GetNewId()
+        {
+            if (_nextID == 0)
+            {
+                foreach (ExcelVmlDrawingComment draw in this)
+                {
+                    if (draw.Id.Length > 3 && draw.Id.StartsWith("vml"))
+                    {
+                        int id;
+                        if (int.TryParse(draw.Id.Substring(3, draw.Id.Length - 3), out id))
+                        {
+                            if (id > _nextID)
+                            {
+                                _nextID = id;
+                            }
+                        }
+                    }
+                }
+            }
+            _nextID++;
+            return "vml" + _nextID.ToString();
+        }
+        #region IEnumerable Members
+
+        IEnumerator IEnumerable.GetEnumerator() 
+        {
+            return _images.GetEnumerator();
+        }
+
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingPosition.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingPosition.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Drawing/Vml/ExcelVmlDrawingPosition.cs	(revision 9616)
@@ -0,0 +1,135 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Initial Release		        2010-06-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+namespace OfficeOpenXml.Drawing.Vml
+{
+    /// <summary>
+    /// The position of a VML drawing. Used for comments
+    /// </summary>
+    public class ExcelVmlDrawingPosition : XmlHelper
+    {
+        int _startPos;
+        internal ExcelVmlDrawingPosition(XmlNamespaceManager ns, XmlNode topNode, int startPos) : 
+            base(ns, topNode)
+        {
+            _startPos = startPos;
+        }
+        /// <summary>
+        /// Row. Zero based
+        /// </summary>
+        public int Row
+        {
+            get
+            {
+                return GetNumber(2);
+            }
+            set
+            {
+                SetNumber(2, value);
+            } 
+        }
+        /// <summary>
+        /// Row offset in pixels. Zero based
+        /// </summary>
+        public int RowOffset
+        {
+            get
+            {
+                return GetNumber(3);
+            }
+            set
+            {
+                SetNumber(3, value);
+            }
+        }
+        /// <summary>
+        /// Column. Zero based
+        /// </summary>
+        public int Column
+        {
+            get
+            {
+                return GetNumber(0);
+            }
+            set
+            {
+                SetNumber(0, value);
+            }
+        }
+        /// <summary>
+        /// Column offset. Zero based
+        /// </summary>
+        public int ColumnOffset
+        {
+            get
+            {
+                return GetNumber(1);
+            }
+            set
+            {
+                SetNumber(1, value);
+            }
+        }
+        private void SetNumber(int pos, int value)
+        {
+            string anchor = GetXmlNodeString("x:Anchor");
+            string[] numbers = anchor.Split(',');
+            if (numbers.Length == 8)
+            {
+                numbers[_startPos + pos] = value.ToString();
+            }
+            else
+            {
+                throw (new Exception("Anchor element is invalid in vmlDrawing"));
+            }
+            SetXmlNodeString("x:Anchor", string.Join(",",numbers));
+        }
+
+        private int GetNumber(int pos)
+        {
+            string anchor = GetXmlNodeString("x:Anchor");
+            string[] numbers = anchor.Split(',');
+            if (numbers.Length == 8)
+            {
+                int ret;
+                if (int.TryParse(numbers[_startPos + pos], out ret))
+                {
+                    return ret;
+                }
+            }
+            throw(new Exception("Anchor element is invalid in vmlDrawing"));
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/EPPlus-3.1.3.csproj
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/EPPlus-3.1.3.csproj	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/EPPlus-3.1.3.csproj	(revision 9616)
@@ -0,0 +1,468 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{7B288026-5502-4A39-BF41-77E086F3E4A3}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>OfficeOpenXml</RootNamespace>
+    <AssemblyName>EPPlus-3.1.3</AssemblyName>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>OpenOfficeXml.snk</AssemblyOriginatorKeyFile>
+    <SccProjectName>
+    </SccProjectName>
+    <SccLocalPath>
+    </SccLocalPath>
+    <SccAuxPath>
+    </SccAuxPath>
+    <SccProvider>
+    </SccProvider>
+    <FileUpgradeFlags>
+    </FileUpgradeFlags>
+    <UpgradeBackupLocation>
+    </UpgradeBackupLocation>
+    <OldToolsVersion>3.5</OldToolsVersion>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>
+    </DocumentationFile>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <DocumentationFile>
+    </DocumentationFile>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+    <PlatformTarget>AnyCPU</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <DocumentationFile>
+    </DocumentationFile>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <HintPath>C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll</HintPath>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Security" />
+    <Reference Include="System.Web" />
+    <Reference Include="System.Xml" />
+    <Reference Include="WindowsBase" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingAverageGroup.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingBeginsWith.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingBetween.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingColorScaleGroup.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingContainsBlanks.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingContainsErrors.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingContainsText.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingDataBarGroup.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingDuplicateValues.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingEndsWith.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingEqual.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingExpression.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingGreaterThan.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingGreaterThanOrEqual.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingThreeIconSet.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingFourIconSet.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingFiveIconSet.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingIconSetGroup.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingThreeColorScale.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingLessThan.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingLessThanOrEqual.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingNotBetween.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingNotContainsBlanks.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingNotContainsErrors.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingNotContainsText.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingNotEqual.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingStdDevGroup.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingTimePeriodGroup.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingTopBottomGroup.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingTwoColorScale.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingUniqueValues.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingWithFormula.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingWithFormula2.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingWithRank.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingWithReverse.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingWithShowValue.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingWithStdDev.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingWithText.cs" />
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingIconDataBarValue.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingDataBar.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingFiveIconSet.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingFourIconSet.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingAboveStdDev.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingAboveOrEqualAverage.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingAverageGroup.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingAboveAverage.cs" />
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingCollection.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingOperatorType.cs" />
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingRuleFactory.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingConstants.cs" />
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingTimePeriodType.cs" />
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingColorScaleValue.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingEnums.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingValueObjectType.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingBeginsWith.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingBelowAverage.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingBelowOrEqualAverage.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingBelowStdDev.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingBetween.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingBottom.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingBottomPercent.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingContainsBlanks.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingContainsErrors.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingContainsText.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingDuplicateValues.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingEndsWith.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingEqual.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingExpression.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingGreaterThan.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingGreaterThanOrEqual.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingLast7Days.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingLastMonth.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingLastWeek.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingLessThan.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingLessThanOrEqual.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingNextMonth.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingNextWeek.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingNotBetween.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingNotContainsBlanks.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingNotContainsErrors.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingNotContainsText.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingNotEqual.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingRule.cs" />
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingRuleType.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingThisMonth.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingThisWeek.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingThreeColorScale.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingThreeIconSet.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingTimePeriodGroup.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingToday.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingTomorrow.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingTop.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingTopPercent.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingTwoColorScale.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IExcelConditionalFormattingRule.cs" />
+    <Compile Include="ConditionalFormatting\ExcelConditionalFormattingHelper.cs" />
+    <Compile Include="ConditionalFormatting\Contracts\IRangeConditionalFormatting.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\RangeConditionalFormatting.cs">
+      <SubType>Code</SubType>
+    </Compile>
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingUniqueValues.cs" />
+    <Compile Include="ConditionalFormatting\Rules\ExcelConditionalFormattingYesterday.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidation.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidationCustom.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidationDateTime.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidationDecimal.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidationInt.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidationList.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidationTime.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidationWithFormula.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidationWithFormula2.cs" />
+    <Compile Include="DataValidation\Contracts\IExcelDataValidationWithOperator.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationCustom.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationDateTime.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationFactory.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationTime.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationWithFormula.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationWithFormula2.cs" />
+    <Compile Include="DataValidation\ExcelTime.cs" />
+    <Compile Include="DataValidation\Formulas\Contracts\IExcelDataValidationFormula.cs" />
+    <Compile Include="DataValidation\Formulas\Contracts\IExcelDataValidationFormulaDateTime.cs" />
+    <Compile Include="DataValidation\Formulas\Contracts\IExcelDataValidationFormulaTime.cs" />
+    <Compile Include="DataValidation\Formulas\ExcelDataValidationFormula.cs" />
+    <Compile Include="DataValidation\Formulas\Contracts\IExcelDataValidationFormulaList.cs" />
+    <Compile Include="DataValidation\Formulas\ExcelDataValidationFormulaCustom.cs" />
+    <Compile Include="DataValidation\Formulas\ExcelDataValidationFormulaDateTime.cs" />
+    <Compile Include="DataValidation\Formulas\ExcelDataValidationFormulaList.cs" />
+    <Compile Include="DataValidation\Formulas\Contracts\IExcelDataValidationFormulaWithValue.cs" />
+    <Compile Include="DataValidation\Formulas\Contracts\IExcelDataValidationFormulaDecimal.cs" />
+    <Compile Include="DataValidation\Formulas\Contracts\IExcelDataValidationFormulaInt.cs" />
+    <Compile Include="DataValidation\Formulas\ExcelDataValidationFormulaTime.cs" />
+    <Compile Include="DataValidation\Formulas\ExcelDataValidationFormulaValue.cs" />
+    <Compile Include="DataValidation\Formulas\ExcelDataValidationFormulaDecimal.cs" />
+    <Compile Include="DataValidation\Formulas\ExcelDataValidationFormulaInt.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationOperator.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationWarningStyle.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationDecimal.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationList.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationInt.cs" />
+    <Compile Include="DataValidation\IRangeDataValidation.cs" />
+    <Compile Include="DataValidation\RangeDataValidation.cs" />
+    <Compile Include="Drawing\Chart\ExcelLineChartSerie.cs" />
+    <Compile Include="Drawing\Chart\ExcelChart.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartCollection.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartTrendline.cs" />
+    <Compile Include="Drawing\ExcelDrawingBase.cs" />
+    <Compile Include="Drawing\ExcelPicture.cs" />
+    <Compile Include="Drawing\Vml\ExcelVmlDrawingPictureCollection.cs" />
+    <Compile Include="Drawing\Vml\ExcelVmlDrawingCommentCollection.cs" />
+    <Compile Include="Drawing\Vml\ExcelVmlDrawingPicture.cs" />
+    <Compile Include="Drawing\Vml\ExcelVmlDrawingBase.cs" />
+    <Compile Include="ExcelBackgroundImage.cs" />
+    <Compile Include="ExcelCell.cs" />
+    <Compile Include="DataValidation\ExcelDataValidation.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationCollection.cs" />
+    <Compile Include="DataValidation\ExcelDataValidationType.cs" />
+    <Compile Include="ExcelEncryption.cs" />
+    <Compile Include="ExcelProtectedRange.cs" />
+    <Compile Include="ExcelProtectedRangeCollection.cs" />
+    <Compile Include="ExcelStyleCollection.cs" />
+    <Compile Include="ExcelColumn.cs" />
+    <Compile Include="Drawing\ExcelDrawings.cs" />
+    <Compile Include="ExcelHeaderFooter.cs" />
+    <Compile Include="ExcelPackage.cs" />
+    <Compile Include="ExcelRange.cs" />
+    <Compile Include="ExcelRow.cs" />
+    <Compile Include="Drawing\ExcelShape.cs" />
+    <Compile Include="ExcelStyles.cs" />
+    <Compile Include="ExcelProtection.cs" />
+    <Compile Include="ExcelTextFormat.cs" />
+    <Compile Include="VBA\ExcelVbaModule.cs" />
+    <Compile Include="VBA\ExcelVbaModuleAttribute.cs" />
+    <Compile Include="VBA\ExcelVbaModuleCollection.cs" />
+    <Compile Include="VBA\ExcelVbaProject.cs" />
+    <Compile Include="ExcelWorkbookView.cs" />
+    <Compile Include="ExcelWorksheetView.cs" />
+    <Compile Include="Utils\EncryptedPackageHandler.cs" />
+    <Compile Include="Style\Dxf\DxfStyleBase.cs" />
+    <Compile Include="Style\Dxf\ExcelDxfBorder.cs" />
+    <Compile Include="Style\Dxf\ExcelDxfBorderItem.cs" />
+    <Compile Include="Style\Dxf\ExcelDxfColor.cs" />
+    <Compile Include="Style\Dxf\ExcelDxfFill.cs" />
+    <Compile Include="Style\Dxf\ExcelDxfFontBase.cs" />
+    <Compile Include="Style\Dxf\ExcelDxfNumberFormat.cs" />
+    <Compile Include="Style\Dxf\ExcelDxfStyle.cs" />
+    <Compile Include="Style\ExcelGradientFill.cs" />
+    <Compile Include="Style\XmlAccess\ExcelGradientFillXml.cs" />
+    <Compile Include="Table\PivotTable\ExcelPivotTableFieldGroup.cs" />
+    <Compile Include="Table\PivotTable\ExcelPivotTableFieldItem.cs" />
+    <Compile Include="Table\PivotTable\ExcelPivotTablePageFieldSettings.cs" />
+    <Compile Include="Table\PivotTable\ExcelPivotTableDataField.cs" />
+    <Compile Include="Table\PivotTable\ExcelPivotTableFieldCollection.cs" />
+    <Compile Include="Style\IStyle.cs" />
+    <Compile Include="OfficeProperties.cs" />
+    <Compile Include="ExcelWorkbook.cs" />
+    <Compile Include="ExcelWorksheet.cs" />
+    <Compile Include="ExcelWorksheets.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="Style\XmlAccess\ExcelBorderXml.cs" />
+    <Compile Include="Style\XmlAccess\ExcelBorderItemXml.cs" />
+    <Compile Include="Style\XmlAccess\ExcelXfsXml.cs" />
+    <Compile Include="Style\XmlAccess\ExcelNamedStyleXml.cs" />
+    <Compile Include="Style\XmlAccess\ExcelColorXml.cs" />
+    <Compile Include="Style\XmlAccess\ExcelFillXml.cs" />
+    <Compile Include="Style\XmlAccess\ExcelFontXml.cs" />
+    <Compile Include="Style\XmlAccess\ExcelNumberFormatXml.cs" />
+    <Compile Include="Style\StyleChangeEventArgs.cs" />
+    <Compile Include="Table\PivotTable\ExcelPivotCacheDefinition.cs" />
+    <Compile Include="Table\PivotTable\ExcelPivotTableField.cs" />
+    <Compile Include="Table\PivotTable\ExcelPivotTableCollection.cs" />
+    <Compile Include="Table\PivotTable\ExcelPivotTable.cs" />
+    <Compile Include="Table\ExcelTableColumnCollection.cs" />
+    <Compile Include="Table\ExcelTable.cs" />
+    <Compile Include="Table\ExcelTableCollection.cs" />
+    <Compile Include="Table\ExcelTableColumn.cs" />
+    <Compile Include="Utils\AddressUtility.cs" />
+    <Compile Include="Utils\Argument.cs" />
+    <Compile Include="Utils\ArgumentExtensions.cs" />
+    <Compile Include="Utils\CompoundDocument.cs" />
+    <Compile Include="Utils\IArgument.cs" />
+    <Compile Include="Utils\Require.cs" />
+    <Compile Include="Utils\SqRefUtility.cs" />
+    <Compile Include="VBA\ExcelVbaProtection.cs" />
+    <Compile Include="VBA\ExcelVbaReference.cs" />
+    <Compile Include="VBA\ExcelVbaSignature.cs" />
+    <Compile Include="XmlHelper.cs" />
+    <Compile Include="XmlHelperFactory.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Drawing\Chart\ExcelLineChart.cs" />
+    <Compile Include="Drawing\Vml\ExcelVmlDrawingComment.cs" />
+    <Compile Include="Drawing\Vml\ExcelVmlDrawingPosition.cs" />
+    <Compile Include="Drawing\Vml\ExcelVmlDrawingBaseCollection.cs" />
+    <Compile Include="ExcelAddress.cs" />
+    <Compile Include="ExcelCellAddress.cs" />
+    <Compile Include="ExcelComment.cs" />
+    <Compile Include="ExcelCommentCollection.cs" />
+    <Compile Include="ExcelSheetProtection.cs" />
+    <Compile Include="RangeCollection.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartLegend.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartPlotArea.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartSerieDataLabel.cs" />
+    <Compile Include="Drawing\Chart\ExcelScatterChartSerie.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartTitle.cs" />
+    <Compile Include="Drawing\ExcelDrawingBorder.cs" />
+    <Compile Include="Drawing\Chart\ExcelOfPieChart.cs" />
+    <Compile Include="Drawing\ExcelDrawingFill.cs" />
+    <Compile Include="Drawing\Chart\ExcelPieChartSerie.cs" />
+    <Compile Include="Drawing\ExcelView3D.cs" />
+    <Compile Include="Drawing\Chart\ExcelBarChart.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartAxis.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartDataLabel.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartSerie.cs" />
+    <Compile Include="Drawing\Chart\ExcelChartSeries.cs" />
+    <Compile Include="Drawing\Chart\ExcelDoughnutChart.cs" />
+    <Compile Include="Drawing\Chart\ExcelPieChart.cs" />
+    <Compile Include="Drawing\Chart\ExcelScatterChart.cs" />
+    <Compile Include="ExcelCellBase.cs" />
+    <Compile Include="ExcelHyperLink.cs" />
+    <Compile Include="ExcelNamedRange.cs" />
+    <Compile Include="ExcelNamedRangeCollection.cs" />
+    <Compile Include="ExcelPrinterSettings.cs" />
+    <Compile Include="ExcelRangeBase.cs" />
+    <Compile Include="IRangeID.cs" />
+    <Compile Include="Style\ExcelParagraph.cs" />
+    <Compile Include="Style\ExcelParagraphCollection.cs" />
+    <Compile Include="Style\ExcelBorder.cs" />
+    <Compile Include="Style\ExcelBorderItem.cs" />
+    <Compile Include="Style\ExcelColor.cs" />
+    <Compile Include="Style\ExcelFill.cs" />
+    <Compile Include="Style\ExcelRichText.cs" />
+    <Compile Include="Style\ExcelRichTextCollection.cs" />
+    <Compile Include="Utils\IExcelCell.cs" />
+    <Compile Include="Style\ExcelStyle.cs" />
+    <Compile Include="Style\ExcelFont.cs" />
+    <Compile Include="Style\XmlAccess\StyleXmlHelper.cs" />
+    <Compile Include="Style\ExcelNumberFormat.cs" />
+    <Compile Include="Style\StyleBase.cs" />
+    <Compile Include="Style\ExcelTextFont.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="OpenOfficeXml.snk" />
+  </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
+      <Visible>False</Visible>
+      <ProductName>Windows Installer 3.1</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="ConditionalFormatting\CF Implementation.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PostBuildEvent>
+    </PostBuildEvent>
+    <PreBuildEvent>
+    </PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelAddress.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelAddress.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelAddress.cs	(revision 9616)
@@ -0,0 +1,616 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		18-MAR-2010
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// A range address
+    /// </summary>
+    /// <remarks>Examples of addresses are "A1" "B1:C2" "A:A" "1:1" "A1:E2,G3:G5" </remarks>
+    public class ExcelAddressBase : ExcelCellBase
+    {
+        internal protected int _fromRow=-1, _toRow, _fromCol, _toCol;
+        internal protected string _wb;
+        internal protected string _ws;
+        internal protected string _address;
+        internal protected event EventHandler AddressChange;
+
+        internal enum eAddressCollition
+        {
+            No,
+            Partly,
+            Inside,
+            Equal
+        }
+        #region "Constructors"
+        internal ExcelAddressBase()
+        {
+        }
+        /// <summary>
+        /// Creates an Address object
+        /// </summary>
+        /// <param name="fromRow">start row</param>
+        /// <param name="fromCol">start column</param>
+        /// <param name="toRow">End row</param>
+        /// <param name="toColumn">End column</param>
+        public ExcelAddressBase(int fromRow, int fromCol, int toRow, int toColumn)
+        {
+            _fromRow = fromRow;
+            _toRow = toRow;
+            _fromCol = fromCol;
+            _toCol = toColumn;
+            Validate();
+
+            _address = GetAddress(_fromRow, _fromCol, _toRow, _toCol);
+        }
+        /// <summary>
+        /// Creates an Address object
+        /// </summary>
+        /// <remarks>Examples of addresses are "A1" "B1:C2" "A:A" "1:1" "A1:E2,G3:G5" </remarks>
+        /// <param name="address">The Excel Address</param>
+        public ExcelAddressBase(string address)
+        {
+            SetAddress(address);
+        }
+
+        /// <summary>
+        /// Address is an defined name
+        /// </summary>
+        /// <param name="address">the name</param>
+        /// <param name="isName">Should always be true</param>
+        internal ExcelAddressBase(string address, bool isName)
+        {
+            if (isName)
+            {
+                _address = address;
+                _fromRow = -1;
+                _fromCol = -1;
+                _toRow = -1;
+                _toCol = -1;
+                _start = null;
+                _end = null;
+            }
+            else
+            {
+                SetAddress(address);
+            }
+        }
+
+        protected internal void SetAddress(string address)
+        {
+            if(address.StartsWith("'"))
+            {
+                int pos = address.IndexOf("'", 1);
+                SetWbWs(address.Substring(1,pos-1).Replace("''","'"));
+                _address = address.Substring(pos + 2);
+            }
+            else if (address.StartsWith("[")) //Remove any external reference
+            {
+                SetWbWs(address);
+            }
+            else
+            {
+                _address = address;
+            }
+            if(_address.IndexOfAny(new char[] {',','!'}) > -1)
+            {
+                //Advanced address. Including Sheet or multi
+                ExtractAddress(_address);
+            }
+            else
+            {
+                //Simple address
+                GetRowColFromAddress(_address, out _fromRow, out _fromCol, out _toRow, out  _toCol);
+                _addresses = null;
+                _start = null;
+                _end = null;
+                _firstAddress = _address;
+            }
+            _address = address;
+            Validate();
+        }
+        internal void ChangeAddress()
+        {
+            if (AddressChange != null)
+            {
+                AddressChange(this, new EventArgs());
+            }
+        }
+        private void SetWbWs(string address)
+        {
+            int pos;
+            if (address[0] == '[')
+            {
+                pos = address.LastIndexOf("]");
+                _wb = address.Substring(1, pos - 1);                
+                _ws = address.Substring(pos + 1);
+            }
+            else
+            {
+                _wb = "";
+                _ws = address;
+            }
+            pos = _ws.IndexOf("!");
+            if (pos > -1)
+            {
+                _address = _ws.Substring(pos + 1);
+                _ws = _ws.Substring(0, pos);
+            }
+        }
+        ExcelCellAddress _start = null;
+        #endregion
+        /// <summary>
+        /// Gets the row and column of the top left cell.
+        /// </summary>
+        /// <value>The start row column.</value>
+        public ExcelCellAddress Start
+        {
+            get
+            {
+                if (_start == null)
+                {
+                    _start = new ExcelCellAddress(_fromRow, _fromCol);
+                }
+                return _start;
+            }
+        }
+        ExcelCellAddress _end = null;
+        /// <summary>
+        /// Gets the row and column of the bottom right cell.
+        /// </summary>
+        /// <value>The end row column.</value>
+        public ExcelCellAddress End
+        {
+            get
+            {
+                if (_end == null)
+                {
+                    _end = new ExcelCellAddress(_toRow, _toCol);
+                }
+                return _end;
+            }
+        }
+        /// <summary>
+        /// The address for the range
+        /// </summary>
+        public virtual string Address
+        {
+            get
+            {
+                return _address;
+            }
+        }        
+        /// <summary>
+        /// If the address is a defined name
+        /// </summary>
+        public bool IsName
+        {
+            get
+            {
+                return _fromRow < 0;
+            }
+        }
+        public override string ToString()
+        {
+            return base.ToString();
+        }
+        string _firstAddress;
+        /// <summary>
+        /// returns the first address if the address is a multi address.
+        /// A1:A2,B1:B2 returns A1:A2
+        /// </summary>
+        internal string FirstAddress
+        {
+            get
+            {
+                if (string.IsNullOrEmpty(_firstAddress))
+                {
+                    return _address;
+                }
+                else
+                {
+                    return _firstAddress;
+                }
+            }
+        }
+        internal string AddressSpaceSeparated
+        {
+            get
+            {
+                return _address.Replace(',', ' '); //Conditional formatting and a few other places use space as separator for mulit addresses.
+            }
+        }
+        /// <summary>
+        /// Validate the address
+        /// </summary>
+        protected void Validate()
+        {
+            if (_fromRow > _toRow || _fromCol > _toCol)
+            {
+                throw new ArgumentOutOfRangeException("Start cell Address must be less or equal to End cell address");
+            }
+        }
+        internal string WorkSheet
+        {
+            get
+            {
+                return _ws;
+            }
+        }
+        List<ExcelAddress> _addresses = null;
+        internal List<ExcelAddress> Addresses
+        {
+            get
+            {
+                return _addresses;
+            }
+        }
+
+        private void ExtractAddress(string fullAddress)
+        {
+            string first="", second="";
+            bool isText=false, hasSheet=false;
+            if (fullAddress == "#REF!")
+            {
+                SetAddress(ref fullAddress, ref second, ref hasSheet );
+                return;
+            }
+            foreach (char c in fullAddress)
+            {
+                if(c=='\'')
+                {
+                    isText=!isText;
+                }
+                else
+                {
+                    if(c=='!' && !isText && !first.EndsWith("#REF") && !second.EndsWith("#REF"))
+                    {
+                        hasSheet=true;
+                    }
+                    else if (c == ',' && !isText)
+                    {
+                        SetAddress(ref first, ref second, ref hasSheet);
+                    }
+                    else
+                    {
+                        if (hasSheet)
+                        {
+                            second += c;
+                        }
+                        else
+                        {
+                            first += c;
+                        }
+                    }
+                }
+            }
+            SetAddress(ref first, ref second, ref hasSheet);
+        }
+        #region Address manipulation methods
+        internal eAddressCollition Collide(ExcelAddressBase address)
+        {
+            if (address.WorkSheet != WorkSheet)
+            {
+                return eAddressCollition.No;
+            }
+
+            if (address._fromRow > _toRow || address._fromCol > _toCol
+                ||
+                _fromRow > address._toRow || _fromCol > address._toCol)
+            {
+                return eAddressCollition.No;
+            }
+            else if (address._fromRow == _fromRow && address._fromCol == _fromCol &&
+                    address._toRow == _toRow && address._toCol == _toCol)
+            {
+                return eAddressCollition.Equal;
+            }
+            else if (address._fromRow >= _fromRow && address._toRow <= _toRow &&
+                     address._fromCol >= _fromCol && address._toCol <= _toCol)
+            {
+                return eAddressCollition.Inside;
+            }
+            else
+                return eAddressCollition.Partly;
+        }        
+        internal ExcelAddressBase AddRow(int row, int rows)
+        {
+            if (row > _toRow)
+            {
+                return this;
+            }
+            else if (row <= _fromRow)
+            {
+                return new ExcelAddressBase(_fromRow + rows, _fromCol, _toRow + rows, _toCol);
+            }
+            else
+            {
+                return new ExcelAddressBase(_fromRow, _fromCol, _toRow + rows, _toCol);
+            }
+        }
+        internal ExcelAddressBase DeleteRow(int row, int rows)
+        {
+            if (row > _toRow) //After
+            {
+                return this;
+            }            
+            else if (row+rows <= _fromRow) //Before
+            {
+                return new ExcelAddressBase(_fromRow - rows, _fromCol, _toRow - rows, _toCol);
+            }
+            else if (row <= _fromRow && row + rows > _toRow) //Inside
+            {
+                return null;
+            }
+            else  //Partly
+            {
+                if (row <= _fromRow)
+                {
+                    return new ExcelAddressBase(row, _fromCol, _toRow - rows, _toCol);
+                }
+                else
+                {
+                    return new ExcelAddressBase(_fromRow, _fromCol, _toRow - rows < row ? row - 1 : _toRow - rows, _toCol);
+                }
+            }
+        }
+        internal ExcelAddressBase AddColumn(int col, int cols)
+        {
+            if (col > _toCol)
+            {
+                return this;
+            }
+            else if (col <= _fromCol)
+            {
+                return new ExcelAddressBase(_fromRow, _fromCol + cols, _toRow, _toCol + cols);
+            }
+            else
+            {
+                return new ExcelAddressBase(_fromRow, _fromCol, _toRow, _toCol + cols);
+            }
+        }
+        internal ExcelAddressBase DeleteColumn(int col, int cols)
+        {
+            if (col > _toCol) //After
+            {
+                return this;
+            }
+            else if (col + cols <= _fromRow) //Before
+            {
+                return new ExcelAddressBase(_fromRow, _fromCol - cols, _toRow, _toCol - cols);
+            }
+            else if (col <= _fromCol && col + cols > _toCol) //Inside
+            {
+                return null;
+            }
+            else  //Partly
+            {
+                if (col <= _fromCol)
+                {
+                    return new ExcelAddressBase(_fromRow, col, _toRow, _toCol - cols);
+                }
+                else
+                {
+                    return new ExcelAddressBase(_fromRow, _fromCol, _toRow, _toCol - cols < col ? col - 1 : _toCol - cols);
+                }
+            }
+        }
+        #endregion
+        private void SetAddress(ref string first, ref string second, ref bool hasSheet)
+        {
+            string ws, address;
+            if (hasSheet)
+            {
+                ws = first;
+                address = second;
+                first = "";
+                second = "";
+            }
+            else
+            {
+                address = first;
+                ws = "";
+                first = "";
+            }
+            hasSheet = false;
+            if (string.IsNullOrEmpty(_firstAddress))
+            {
+                if(string.IsNullOrEmpty(_ws) || !string.IsNullOrEmpty(ws))_ws = ws;
+                _firstAddress = address;
+                GetRowColFromAddress(address, out _fromRow, out _fromCol, out _toRow, out  _toCol);
+            }
+            else
+            {
+                if (_addresses == null) _addresses = new List<ExcelAddress>();
+                _addresses.Add(new ExcelAddress(_ws, address));
+            }
+        }
+        internal enum AddressType
+        {
+            Invalid,
+            InternalAddress,
+            ExternalAddress,
+            InternalName,
+            ExternalName
+        }
+
+        internal static AddressType IsValid(string Address)
+        {
+            string ws="";
+            if (Address.StartsWith("'"))
+            {
+                int ix = Address.IndexOf('\'', 1);
+                if (ix > -1)
+                {
+                    ws = Address.Substring(1, ix-1);
+                    Address = Address.Substring(ix + 2);
+                }
+            }
+            if (Address.IndexOfAny(new char[] { '(', ')', '+', '-', '*', '/', '.', '=','^','&','%','\"' })>-1)
+            {
+                return AddressType.Invalid;
+            }
+            if (Address.IndexOf('!') > 0)
+            {
+                string[] split = Address.Split('!');
+                if (split.Length == 2)
+                {
+                    ws = split[0];
+                    Address = split[1];
+                }
+                else if (split.Length == 3 && split[1] == "#REF" && split[2] == "")
+                {
+                    ws = split[0];
+                    Address = "#REF!";
+                    if (ws.StartsWith("[") && ws.IndexOf("]") > 1)
+                    {
+                        return AddressType.ExternalAddress;
+                    }
+                    else
+                    {
+                        return AddressType.InternalAddress;
+                    }
+                }
+                else
+                {
+                    return AddressType.Invalid;
+                }
+            }
+            int _fromRow, _fromCol, _toRow, _toCol;
+            if (ExcelAddressBase.GetRowColFromAddress(Address, out _fromRow, out _fromCol, out _toRow, out _toCol))
+            {
+                if (_fromRow > 0 && _fromCol > 0 && _toRow <= ExcelPackage.MaxRows && _toCol <= ExcelPackage.MaxColumns)
+                {
+                    if (ws.StartsWith("[") && ws.IndexOf("]") > 1)
+                    {
+                        return AddressType.ExternalAddress;
+                    }
+                    else
+                    {
+                        return AddressType.InternalAddress;
+                    }
+                }
+                else
+                {
+                    return AddressType.Invalid;
+                }
+            }
+            else
+            {
+                if(IsValidName(Address))
+                {
+                    if (ws.StartsWith("[") && ws.IndexOf("]") > 1)
+                    {
+                        return AddressType.ExternalName;
+                    }
+                    else
+                    {
+                        return AddressType.InternalName;
+                    }
+                }
+                else
+                {
+                    return AddressType.Invalid;
+                }
+            }
+
+        }
+
+        private static bool IsValidName(string address)
+        {
+            if (Regex.IsMatch(address, "[^0-9./*-+,½!\"@#£%&/{}()\\[\\]=?`^~':;<>|][^/*-+,½!\"@#£%&/{}()\\[\\]=?`^~':;<>|]*"))
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+    }
+    /// <summary>
+    /// Range address with the address property readonly
+    /// </summary>
+    public class ExcelAddress : ExcelAddressBase
+    {
+        internal ExcelAddress()
+            : base()
+        {
+
+        }
+
+        public ExcelAddress(int fromRow, int fromCol, int toRow, int toColumn)
+            : base(fromRow, fromCol, toRow, toColumn)
+        {
+            _ws = "";
+        }
+        public ExcelAddress(string address)
+            : base(address)
+        {
+        }
+        
+        internal ExcelAddress(string ws, string address)
+            : base(address)
+        {
+            if (string.IsNullOrEmpty(_ws)) _ws = ws;
+        }
+        internal ExcelAddress(string ws, string address, bool isName)
+            : base(address, isName)
+        {
+            if (string.IsNullOrEmpty(_ws)) _ws = ws;
+        }
+        /// <summary>
+        /// The address for the range
+        /// </summary>
+        /// <remarks>Examples of addresses are "A1" "B1:C2" "A:A" "1:1" "A1:E2,G3:G5" </remarks>
+        public new string Address
+        {
+            get
+            {
+                if (string.IsNullOrEmpty(_address) && _fromRow>0)
+                {
+                    _address = GetAddress(_fromRow, _fromCol, _toRow, _toCol);
+                }
+                return _address;
+            }
+            set
+            {                
+                SetAddress(value);
+                base.ChangeAddress();
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelBackgroundImage.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelBackgroundImage.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelBackgroundImage.cs	(revision 9616)
@@ -0,0 +1,162 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		10-SEP-2009
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Drawing;
+using System.IO.Packaging;
+using System.IO;
+using OfficeOpenXml.Drawing;
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// An image that fills the background of the worksheet.
+    /// </summary>
+    public class ExcelBackgroundImage : XmlHelper
+    {
+        ExcelWorksheet _workSheet;
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="nsm"></param>
+        /// <param name="topNode">The topnode of the worksheet</param>
+        /// <param name="workSheet">Worksheet reference</param>
+        internal  ExcelBackgroundImage(XmlNamespaceManager nsm, XmlNode topNode, ExcelWorksheet workSheet) :
+            base(nsm, topNode)
+        {
+            _workSheet = workSheet;
+        }
+        
+        const string BACKGROUNDPIC_PATH = "d:picture/@r:id";
+        /// <summary>
+        /// The background image of the worksheet. 
+        /// The image will be saved internally as a jpg.
+        /// </summary>
+        public Image Image
+        {
+            get
+            {
+                string relID = GetXmlNodeString(BACKGROUNDPIC_PATH);
+                if (!string.IsNullOrEmpty(relID))
+                {
+                    var rel = _workSheet.Part.GetRelationship(relID);
+                    var imagePart = _workSheet.Part.Package.GetPart(PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri));
+                    return Image.FromStream(imagePart.GetStream());
+                }
+                return null;
+            }
+            set
+            {
+                DeletePrevImage();
+                if (value == null)
+                {
+                    DeleteAllNode(BACKGROUNDPIC_PATH);
+                }
+                else
+                {
+                    ImageConverter ic = new ImageConverter();
+                    byte[] img = (byte[])ic.ConvertTo(value, typeof(byte[]));
+                    var ii = _workSheet.Workbook._package.AddImage(img);
+                    var rel = _workSheet.Part.CreateRelationship(ii.Uri, TargetMode.Internal, ExcelPackage.schemaRelationships + "/image");
+                    SetXmlNodeString(BACKGROUNDPIC_PATH, rel.Id);
+                }
+            }
+        }
+        /// <summary>
+        /// Set the picture from an image file. 
+        /// The image file will be saved as a blob, so make sure Excel supports the image format.
+        /// </summary>
+        /// <param name="PictureFile">The image file.</param>
+        public void SetFromFile(FileInfo PictureFile)
+        {
+            DeletePrevImage();
+
+            Image img;
+            try
+            {
+                img = Image.FromFile(PictureFile.FullName);
+            }
+            catch (Exception ex)
+            {
+                throw (new InvalidDataException("File is not a supported image-file or is corrupt", ex));
+            }
+
+            ImageConverter ic = new ImageConverter();
+            string contentType = ExcelPicture.GetContentType(PictureFile.Extension);
+            var imageURI = XmlHelper.GetNewUri(_workSheet._package.Package, "/xl/media/" + PictureFile.Name.Substring(0, PictureFile.Name.Length - PictureFile.Extension.Length) + "{0}" + PictureFile.Extension);
+
+            byte[] fileBytes = (byte[])ic.ConvertTo(img, typeof(byte[]));
+            var ii = _workSheet.Workbook._package.AddImage(fileBytes, imageURI, contentType);
+
+
+            if (_workSheet.Part.Package.PartExists(imageURI) && ii.RefCount==1) //The file exists with another content, overwrite it.
+            {
+                //Remove the part if it exists
+                _workSheet.Part.Package.DeletePart(imageURI);
+            }
+
+            var imagePart = _workSheet.Part.Package.CreatePart(imageURI, contentType, CompressionOption.NotCompressed);
+            //Save the picture to package.
+
+            var strm = imagePart.GetStream(FileMode.Create, FileAccess.Write);
+            strm.Write(fileBytes, 0, fileBytes.Length);
+
+            var rel = _workSheet.Part.CreateRelationship(imageURI, TargetMode.Internal, ExcelPackage.schemaRelationships + "/image");
+            SetXmlNodeString(BACKGROUNDPIC_PATH, rel.Id);
+        }
+        private void DeletePrevImage()
+        {
+            var relID = GetXmlNodeString(BACKGROUNDPIC_PATH);
+            if (relID != "")
+            {
+                var ic = new ImageConverter();
+                byte[] img = (byte[])ic.ConvertTo(Image, typeof(byte[]));
+                var ii = _workSheet.Workbook._package.GetImageInfo(img);
+
+                //Delete the relation
+                _workSheet.Part.DeleteRelationship(relID);
+                
+                //Delete the image if there are no other references.
+                if (ii != null && ii.RefCount == 1)
+                {
+                    if (_workSheet.Part.Package.PartExists(ii.Uri))
+                    {
+                        _workSheet.Part.Package.DeletePart(ii.Uri);
+                    }
+                }
+                
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCell.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCell.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCell.cs	(revision 9616)
@@ -0,0 +1,458 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		10-SEP-2009
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Globalization;
+using OfficeOpenXml.Style;
+using System.Text.RegularExpressions;
+namespace OfficeOpenXml
+{
+    internal class ExcelCell : ExcelCellBase, IExcelCell, IRangeID
+    {
+        [Flags]
+        private enum flags
+        {
+            isMerged=1,
+            isRichText=2,
+
+        }
+		#region Cell Private Properties
+		private ExcelWorksheet _worksheet;
+        private int _row;
+        private int _col;
+		internal string _formula="";
+        internal string _formulaR1C1 = "";
+        private Uri _hyperlink = null;
+        string _dataType = "";
+        #endregion
+		#region ExcelCell Constructor
+		/// <summary>
+		/// A cell in the worksheet. 
+		/// </summary>
+		/// <param name="worksheet">A reference to the worksheet</param>
+		/// <param name="row">The row number</param>
+		/// <param name="col">The column number</param>
+		internal ExcelCell(ExcelWorksheet worksheet, int row, int col)
+		{
+			if (row < 1 || col < 1)
+                throw new ArgumentException("Negative row and column numbers are not allowed");
+            if (row > ExcelPackage.MaxRows || col > ExcelPackage.MaxColumns)
+                throw new ArgumentException("Row or column numbers are out of range");
+            if (worksheet == null)
+				throw new ArgumentException("Worksheet must be set to a valid reference");
+
+			_row = row;
+			_col = col;
+            _worksheet = worksheet;
+            if (col < worksheet._minCol) worksheet._minCol = col;
+            if (col > worksheet._maxCol) worksheet._maxCol = col;
+            _sharedFormulaID = int.MinValue;
+            IsRichText = false;
+		}
+        internal ExcelCell(ExcelWorksheet worksheet, string cellAddress)
+        {
+            _worksheet = worksheet;
+            GetRowColFromAddress(cellAddress, out _row, out _col);
+            if (_col < worksheet._minCol) worksheet._minCol = _col;
+            if (_col > worksheet._maxCol) worksheet._maxCol = _col;
+            _sharedFormulaID = int.MinValue;
+            IsRichText = false;
+        }
+		#endregion 
+        internal ulong CellID
+        {
+            get
+            {
+                return GetCellID(_worksheet.SheetID, Row, Column);
+            }
+        }
+        #region ExcelCell Public Properties
+
+		/// <summary>
+		/// Row number
+		/// </summary>
+        internal int Row { get { return _row; } set { _row = value; } }
+		/// <summary>
+		/// Column number
+		/// </summary>
+        internal int Column { get { return _col; } set { _col = value; } }
+		/// <summary>
+		/// The address
+		/// </summary>
+        internal string CellAddress { get { return GetAddress(_row, _col); } }
+		/// <summary>
+		/// Returns true if the cell's contents are numeric.
+		/// </summary>
+        public bool IsNumeric { get { return (Value is decimal || Value.GetType().IsPrimitive ); } }
+		#region ExcelCell Value
+        internal object _value = null;
+        /// <summary>
+		/// Gets/sets the value of the cell.
+		/// </summary>
+        public object Value
+		{
+			get
+			{
+                return _value;
+			}
+			set
+			{
+                SetValueRichText(value);
+                if (IsRichText) IsRichText = false;
+			}
+		}
+        internal void SetValueRichText(object value)
+        {
+            _value = value;
+            if (value is string) DataType = "s"; else DataType = "";
+            Formula = "";
+        }
+        /// <summary>
+        /// If cell has inline formatting. 
+        /// </summary>
+        public bool IsRichText { get; set; }
+        /// <summary>
+        /// If the cell is merged with other cells
+        /// </summary>
+        public bool Merge { get; internal set; }
+        /// <summary>
+        /// Merge Id
+        /// </summary>
+        internal int MergeId { get; set; }
+		#endregion  
+
+        #region ExcelCell DataType
+        /// <summary>
+        /// Datatype
+        /// TODO: remove
+        /// </summary>       
+        internal string DataType
+        {
+            get
+            {
+                return (_dataType);
+            }
+            set
+            {
+                _dataType = value;
+            }
+        }
+        #endregion
+
+		#region ExcelCell Style
+        string _styleName=null;
+        /// <summary>
+		/// Optional named style for the cell
+		/// </summary>
+		public string StyleName
+		{
+			get 
+            {
+                if (_styleName == null)
+                {
+                    foreach (var ns in _worksheet.Workbook.Styles.NamedStyles)
+                    {
+                        if (ns.StyleXfId == StyleID)
+                        {
+                            _styleName = ns.Name;
+                            break;
+                        }
+                    }
+                    if (_styleName == null)
+                    {
+                        _styleName = "Normal";
+                    }
+                }
+                return _styleName;
+            }
+			set 
+            {
+                _styleID = _worksheet.Workbook.Styles.GetStyleIdFromName(value);
+                _styleName = value;
+            }
+		}
+
+		int _styleID=0;
+        /// <summary>
+		/// The style ID for the cell. Reference to the style collection
+		/// </summary>
+		public int StyleID
+		{
+			get
+			{
+				if(_styleID>0)
+                    return _styleID;
+                else if (_worksheet._rows != null && _worksheet._rows.ContainsKey(ExcelRow.GetRowID(_worksheet.SheetID, Row)) && _worksheet.Row(Row).StyleID>0)
+                {
+                    return _worksheet.Row(Row).StyleID;
+                }
+                else
+                {
+                    ExcelColumn col = GetColumn(Column);
+                    if(col==null)
+                    {
+                        return 0;
+                    }
+                    else
+                    {
+                        return col.StyleID;
+                    }
+                }
+			}
+			set 
+            {
+                _styleID = value;
+            }
+		}
+
+        private ExcelColumn GetColumn(int col)
+        {
+            foreach (ExcelColumn column in _worksheet._columns)
+            {
+                if (col >= column.ColumnMin && col <= column.ColumnMax)
+                {
+                    return column;
+                }
+            }
+            return null;
+        }
+        internal int GetCellStyleID()
+        {
+            return _styleID;
+        }
+        public ExcelStyle Style
+        {
+            get
+            {
+                return _worksheet.Workbook.Styles.GetStyleObject(StyleID, _worksheet.PositionID, CellAddress);
+            }
+        }
+        internal void SetNewStyleName(string Name, int Id)
+        {
+            _styleID = Id;
+            _styleName = Name;
+
+        }
+		#endregion
+
+		#region ExcelCell Hyperlink
+		/// <summary>
+		/// The cells cell's Hyperlink
+		/// </summary>
+		public Uri Hyperlink
+		{
+			get
+			{				
+                return (_hyperlink);
+			}
+			set
+			{
+				_hyperlink = value;
+                if ((Value == null || Value.ToString() == ""))
+                {
+                    if (value is ExcelHyperLink)
+                    {
+                        Value = (value as ExcelHyperLink).Display;
+                    }
+                    else
+                    {
+                        Value = _hyperlink.AbsoluteUri;
+                    }
+                }
+			}
+		}
+        internal string HyperLinkRId
+        {
+            get;
+            set;
+        }
+		#endregion
+
+		#region ExcelCell Formula
+		/// <summary>
+		/// The cell's formula.
+		/// </summary>
+		public string Formula
+		{
+			get
+			{
+                if (SharedFormulaID < 0)
+                {
+                    if (_formula == "")
+                    {
+                        return (TranslateFromR1C1(_formulaR1C1, Row, Column));
+                    }
+                    else
+                    {
+                        return (_formula);
+                    }
+                }
+                else
+                {
+                    if (_worksheet._sharedFormulas.ContainsKey(SharedFormulaID))
+                    {
+                        var f = _worksheet._sharedFormulas[SharedFormulaID];
+                        if (f.StartRow == Row && f.StartCol == Column)
+                        {
+                            return f.Formula;
+                        }
+                        else
+                        {
+                            return TranslateFromR1C1(TranslateToR1C1(f.Formula, f.StartRow, f.StartCol), Row, Column); 
+                        }
+                        
+                    }
+                    else
+                    {
+                        throw(new Exception("Shared formula reference (SI) is invalid"));
+                    }
+                }
+			}
+			set
+			{
+				_formula = value;
+                _formulaR1C1 = "";
+                _sharedFormulaID = int.MinValue;
+                if (_formula!="" && !_worksheet._formulaCells.ContainsKey(CellID))
+                {
+                    _worksheet._formulaCells.Add(this);
+                }
+			}
+        }
+        /// <summary>
+        /// The cell's formula using R1C1 style.
+        /// </summary>
+        public string FormulaR1C1
+        {
+            get
+            {
+                if (SharedFormulaID < 0)
+                {
+                    if (_formulaR1C1 == "")
+                    {
+                        return TranslateToR1C1(_formula, Row, Column);
+                    }
+                    else
+                    {
+                        return (_formulaR1C1);
+                    }
+                }
+                else
+                {
+                    if (_worksheet._sharedFormulas.ContainsKey(SharedFormulaID))
+                    {
+						var f = _worksheet._sharedFormulas[SharedFormulaID];
+                        return TranslateToR1C1(f.Formula, f.StartRow, f.StartCol);
+                    }
+                    else
+                    {
+                        throw (new Exception("Shared formula reference (SI) is invalid"));
+                    }
+                }
+            }
+            set
+            {
+                // Example cell content for formulas
+                // <f>RC1</f>
+                // <f>SUM(RC1:RC3)</f>
+                // <f>R[-1]C[-2]+R[-1]C[-1]</f>
+                _formulaR1C1 = value;
+                _formula = "";
+                SharedFormulaID = int.MinValue;
+                if (!_worksheet._formulaCells.ContainsKey(CellID))
+                {
+                    _worksheet._formulaCells.Add(this);
+                }
+            }
+        }
+        internal int _sharedFormulaID;
+        /// <summary>
+        /// Id for the shared formula
+        /// </summary>
+        internal int SharedFormulaID {
+            get
+            {
+                return _sharedFormulaID;
+            }
+            set
+            {
+                _sharedFormulaID = value;
+                if(_worksheet._formulaCells.ContainsKey(CellID)) _worksheet._formulaCells.Delete(CellID);
+            }
+        }
+        public bool IsArrayFormula { get; internal set; }
+		#endregion 		
+		/// <summary>
+		/// Returns the cell's value as a string.
+		/// </summary>
+		/// <returns>The cell's value</returns>
+		public override string ToString()	{	return Value.ToString();	}
+		#endregion 
+		#region ExcelCell Private Methods
+		#endregion 
+        #region IRangeID Members
+
+        ulong IRangeID.RangeID
+        {
+            get
+            {
+                return GetCellID(_worksheet.SheetID, Row, Column);
+            }
+            set
+            {
+                _col = ((int)(value >> 15) & 0x3FF);
+                _row = ((int)(value >> 29));
+            }
+        }
+
+        #endregion
+        internal ExcelCell Clone(ExcelWorksheet added)
+        {
+            return Clone(added, _row, _col);
+        }
+        internal ExcelCell Clone(ExcelWorksheet added, int row, int col)
+        {
+            ExcelCell newCell = new ExcelCell(added, row, col);
+            if(_hyperlink!=null) newCell.Hyperlink = Hyperlink;
+            newCell._formula = _formula;
+            newCell._formulaR1C1 = _formulaR1C1;
+            newCell.IsRichText = IsRichText;
+            newCell.Merge = Merge;
+            newCell._sharedFormulaID = _sharedFormulaID;
+            newCell._styleName = _styleName;
+            newCell._styleID = _styleID;
+            newCell._value = _value;
+            return newCell;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCellAddress.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCellAddress.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCellAddress.cs	(revision 9616)
@@ -0,0 +1,141 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ *  Starnuto Di Topo & Jan Källman  Initial Release		        2010-03-14
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// A single cell address 
+    /// </summary>
+    public class ExcelCellAddress
+    {
+        public ExcelCellAddress()
+            : this(1, 1)
+        {
+
+        }
+
+        private int _row;
+        private int _column;
+        private string _address;
+        /// <summary>
+        /// Initializes a new instance of the ExcelCellAddress class.
+        /// </summary>
+        /// <param name="row">The row.</param>
+        /// <param name="column">The column.</param>
+        public ExcelCellAddress(int row, int column)
+        {
+            this.Row = row;
+            this.Column = column;
+        }
+        /// <summary>
+        /// Initializes a new instance of the ExcelCellAddress class.
+        /// </summary>
+        ///<param name="address">The address</param>
+        public ExcelCellAddress(string address)
+        {
+            this.Address = address; 
+        }
+        /// <summary>
+        /// Row
+        /// </summary>
+        public int Row
+        {
+            get
+            {
+                return this._row;
+            }
+            private set
+            {
+                if (value <= 0)
+                {
+                    throw new ArgumentOutOfRangeException("value", "Row cannot be less than 1.");
+                }
+                this._row = value;
+                if(_column>0) 
+                    _address = ExcelCellBase.GetAddress(_row, _column);
+                else
+                    _address = "#REF!";
+            }
+        }
+        /// <summary>
+        /// Column
+        /// </summary>
+        public int Column
+        {
+            get
+            {
+                return this._column;
+            }
+            private set
+            {
+                if (value <= 0)
+                {
+                    throw new ArgumentOutOfRangeException("value", "Column cannot be less than 1.");
+                }
+                this._column = value;
+                if (_row > 0)
+                    _address = ExcelCellBase.GetAddress(_row, _column);
+                else
+                    _address = "#REF!";
+            }
+        }
+        /// <summary>
+        /// Celladdress
+        /// </summary>
+        public string Address
+        {
+            get
+            {
+                return _address;
+            }
+            internal set
+            {
+                _address = value;
+                ExcelCellBase.GetRowColFromAddress(_address, out _row, out _column);
+            }
+        }
+        /// <summary>
+        /// If the address is an invalid reference (#REF!)
+        /// </summary>
+        public bool IsRef
+        {
+            get
+            {
+                return _row <= 0;
+            }
+        }
+    }
+}
+
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCellBase.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCellBase.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCellBase.cs	(revision 9616)
@@ -0,0 +1,697 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style;
+using System.Text.RegularExpressions;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Base class containing cell address manipulating methods.
+    /// </summary>
+    public abstract class ExcelCellBase
+    {
+        #region "public functions"
+        /// <summary>
+        /// Get the sheet, row and column from the CellID
+        /// </summary>
+        /// <param name="cellID"></param>
+        /// <param name="sheet"></param>
+        /// <param name="row"></param>
+        /// <param name="col"></param>
+        static internal void SplitCellID(ulong cellID, out int sheet, out int row, out int col)
+        {
+            sheet = (int)(cellID % 0x8000);
+            col = ((int)(cellID >> 15) & 0x3FF);
+            row = ((int)(cellID >> 29));
+        }
+        /// <summary>
+        /// Get the cellID for the cell. 
+        /// </summary>
+        /// <param name="SheetID"></param>
+        /// <param name="row"></param>
+        /// <param name="col"></param>
+        /// <returns></returns>
+        internal static ulong GetCellID(int SheetID, int row, int col)
+        {
+            return ((ulong)SheetID) + (((ulong)col) << 15) + (((ulong)row) << 29);
+        }
+        #endregion
+        #region "Formula Functions"
+        private delegate string dlgTransl(string part, int row, int col, int rowIncr, int colIncr);
+        #region R1C1 Functions"
+        /// <summary>
+        /// Translates a R1C1 to an absolut address/Formula
+        /// </summary>
+        /// <param name="value">Address</param>
+        /// <param name="row">Current row</param>
+        /// <param name="col">Current column</param>
+        /// <returns>The RC address</returns>
+        public static string TranslateFromR1C1(string value, int row, int col)
+        {
+            return Translate(value, ToAbs, row, col, -1, -1);
+        }
+        /// <summary>
+        /// Translates a absolut address to R1C1 Format
+        /// </summary>
+        /// <param name="value">R1C1 Address</param>
+        /// <param name="row">Current row</param>
+        /// <param name="col">Current column</param>
+        /// <returns>The absolut address/Formula</returns>
+        public static string TranslateToR1C1(string value, int row, int col)
+        {
+            return Translate(value, ToR1C1, row, col, -1, -1);
+        }
+        /// <summary>
+        /// Translates betweein R1C1 or absolut addresses
+        /// </summary>
+        /// <param name="value">The addresss/function</param>
+        /// <param name="addressTranslator">The translating function</param>
+        /// <param name="row"></param>
+        /// <param name="col"></param>
+        /// <param name="rowIncr"></param>
+        /// <param name="colIncr"></param>
+        /// <returns></returns>
+        private static string Translate(string value, dlgTransl addressTranslator, int row, int col, int rowIncr, int colIncr)
+        {
+            if (value == "")
+                return "";
+            bool isText = false;
+            string ret = "";
+            string part = "";
+            char prevTQ = (char)0;
+            for (int pos = 0; pos < value.Length; pos++)
+            {
+                char c = value[pos];
+                if (c == '"' || c=='\'')
+                {
+                    if (isText == false && part != "" && prevTQ==c)
+                    {
+                        ret += addressTranslator(part, row, col, rowIncr, colIncr);
+                        part = "";
+                        prevTQ = (char)0;
+                    }
+                    prevTQ = c;
+                    isText = !isText;
+                    ret += c;
+                }
+                else if (isText)
+                {
+                    ret += c;
+                }
+                else
+                {
+                    if ((c == '-' || c == '+' || c == '*' || c == '/' ||
+                        c == '=' || c == '^' || c == ',' || c == ':' ||
+                        c == '<' || c == '>' || c == '(' || c == ')' || c == '!' ||
+                        c == ' ' || c == '&' || c == '%') &&
+                        (pos == 0 || value[pos - 1] != '[')) //Last part to allow for R1C1 style [-x]
+                    {
+                        ret += addressTranslator(part, row, col, rowIncr, colIncr) + c;
+                        part = "";
+                    }
+                    else
+                    {
+                        part += c;
+                    }
+                }
+            }
+            if (part != "")
+            {
+                ret += addressTranslator(part, row, col, rowIncr, colIncr);
+            }
+            return ret;
+        }
+        /// <summary>
+        /// Translate to R1C1
+        /// </summary>
+        /// <param name="part">the value to be translated</param>
+        /// <param name="row"></param>
+        /// <param name="col"></param>
+        /// <param name="rowIncr"></param>
+        /// <param name="colIncr"></param>
+        /// <returns></returns>
+        private static string ToR1C1(string part, int row, int col, int rowIncr, int colIncr)
+        {
+            int addrRow, addrCol;
+            string Ret = "R";
+            if (GetRowCol(part, out addrRow, out addrCol, false))
+            {
+                if (addrRow == 0 || addrCol == 0)
+                {
+                    return part;
+                }
+                if (part.IndexOf('$', 1) > 0)
+                {
+                    Ret += addrRow.ToString();
+                }
+                else if (addrRow - row != 0)
+                {
+                    Ret += string.Format("[{0}]", addrRow - row);
+                }
+
+                if (part.StartsWith("$"))
+                {
+                    return Ret + "C" + addrCol;
+                }
+                else if (addrCol - col != 0)
+                {
+                    return Ret + "C" + string.Format("[{0}]", addrCol - col);
+                }
+                else
+                {
+                    return Ret + "C";
+                }
+            }
+            else
+            {
+                return part;
+            }
+        }
+        /// <summary>
+        /// Translates to absolute address
+        /// </summary>
+        /// <param name="part"></param>
+        /// <param name="row"></param>
+        /// <param name="col"></param> 
+        /// <param name="rowIncr"></param>
+        /// <param name="colIncr"></param>
+        /// <returns></returns>
+        private static string ToAbs(string part, int row, int col, int rowIncr, int colIncr)
+        {
+            string check = part.ToUpper();
+
+            int rStart = check.IndexOf("R");
+            if (rStart != 0)
+                return part;
+            if (part.Length == 1) //R
+            {
+                return GetAddress(row, col);
+            }
+
+            int cStart = check.IndexOf("C");
+            bool absoluteRow, absoluteCol;
+            if (cStart == -1)
+            {
+                int RNum = GetRC(part, row, out absoluteRow);
+                if (RNum > int.MinValue)
+                {
+                    return GetAddress(RNum, absoluteRow, col, false);
+                }
+                else
+                {
+                    return part;
+                }
+            }
+            else
+            {
+                int RNum = GetRC(part.Substring(1, cStart - 1), row, out absoluteRow);
+                int CNum = GetRC(part.Substring(cStart + 1, part.Length - cStart - 1), col, out absoluteCol);
+                if (RNum > int.MinValue && CNum > int.MinValue)
+                {
+                    return GetAddress(RNum, absoluteRow, CNum, absoluteCol);
+                }
+                else
+                {
+                    return part;
+                }
+            }
+        }
+        /// <summary>
+        /// Adds or subtracts a row or column to an address
+        /// </summary>
+        /// <param name="Address"></param>
+        /// <param name="row"></param>
+        /// <param name="col"></param>
+        /// <param name="rowIncr"></param>
+        /// <param name="colIncr"></param>
+        /// <returns></returns>
+        private static string AddToRowColumnTranslator(string Address, int row, int col, int rowIncr, int colIncr)
+        {
+            int fromRow, fromCol;
+            if (Address == "#REF!")
+            {
+                return Address;
+            }
+            if (GetRowCol(Address, out fromRow, out fromCol, false))
+            {
+                if (fromRow == 0 || fromCol == 0)
+                {
+                    return Address;
+                }
+                if (rowIncr != 0 && row != 0 && fromRow >= row && Address.IndexOf('$', 1) == -1)
+                {
+                    if (fromRow < row - rowIncr)
+                    {
+                        return "#REF!";
+                    }
+
+                    fromRow = fromRow + rowIncr;
+                }
+
+                if (colIncr != 0 && col != 0 && fromCol >= col && Address.StartsWith("$") == false)
+                {
+                    if (fromCol < col - colIncr)
+                    {
+                        return "#REF!";
+                    }
+
+                    fromCol = fromCol + colIncr;
+                }
+
+                Address = GetAddress(fromRow, Address.IndexOf('$', 1) > -1, fromCol, Address.StartsWith("$"));
+            }
+            return Address;
+        }
+
+        /// <summary>
+        /// Returns with brackets if the value is negative
+        /// </summary>
+        /// <param name="v">The value</param>
+        /// <returns></returns>
+        private static string GetRCFmt(int v)
+        {
+            return (v < 0 ? string.Format("[{0}]", v) : v > 0 ? v.ToString() : "");
+        }
+        /// <summary>
+        /// Get the offset value for RC format
+        /// </summary>
+        /// <param name="value"></param>
+        /// <param name="OffsetValue"></param>
+        /// <param name="fixedAddr"></param>
+        /// <returns></returns>
+        private static int GetRC(string value, int OffsetValue, out bool fixedAddr)
+        {
+            if (value == "")
+            {
+                fixedAddr = false;
+                return OffsetValue;
+            }
+            int num;
+            if (value[0] == '[' && value[value.Length - 1] == ']') //Offset?                
+            {
+                fixedAddr = false;
+                if (int.TryParse(value.Substring(1, value.Length - 2), out num))
+                {
+                    return (OffsetValue + num);
+                }
+                else
+                {
+                    return int.MinValue;
+                }
+            }
+            else
+            {
+                fixedAddr = true;
+                if (int.TryParse(value, out num))
+                {
+                    return num;
+                }
+                else
+                {
+                    return int.MinValue;
+                }
+            }
+        }
+        #endregion
+        #region "Address Functions"
+        #region GetColumnLetter
+        /// <summary>
+        /// Returns the character representation of the numbered column
+        /// </summary>
+        /// <param name="iColumnNumber">The number of the column</param>
+        /// <returns>The letter representing the column</returns>
+        protected internal static string GetColumnLetter(int iColumnNumber)
+        {
+
+            if (iColumnNumber < 1)
+            {
+                //throw new Exception("Column number is out of range");
+                return "#REF!";
+            }
+
+            string sCol = "";
+            do
+            {
+                sCol = ((char)('A' + ((iColumnNumber - 1) % 26))) + sCol;
+                iColumnNumber = (iColumnNumber - ((iColumnNumber - 1) % 26)) / 26;
+            }
+            while (iColumnNumber > 0);
+            return sCol;
+        }
+        #endregion
+        /// <summary>
+        /// Get the row/columns for a Cell-address
+        /// </summary>
+        /// <param name="CellAddress">The address</param>
+        /// <param name="FromRow">Returns the to column</param>
+        /// <param name="FromColumn">Returns the from column</param>
+        /// <param name="ToRow">Returns the to row</param>
+        /// <param name="ToColumn">Returns the from row</param>
+        internal static bool GetRowColFromAddress(string CellAddress, out int FromRow, out int FromColumn, out int ToRow, out int ToColumn)
+        {
+            bool ret;
+            CellAddress = CellAddress.ToUpper();
+            //This one can be removed when the worksheet Select format is fixed
+            if (CellAddress.IndexOf(' ') > 0)
+            {
+                CellAddress = CellAddress.Substring(0, CellAddress.IndexOf(' '));
+            }
+
+            if (CellAddress.IndexOf(':') < 0)
+            {
+                ret=GetRowColFromAddress(CellAddress, out FromRow, out FromColumn);
+                ToColumn = FromColumn;
+                ToRow = FromRow;
+            }
+            else
+            {
+                string[] cells = CellAddress.Split(':');
+                ret=GetRowColFromAddress(cells[0], out FromRow, out FromColumn);
+                if (ret)
+                    ret = GetRowColFromAddress(cells[1], out ToRow, out ToColumn);
+                else
+                {
+                    GetRowColFromAddress(cells[1], out ToRow, out ToColumn);
+                }
+
+                if (FromColumn <= 0)
+                    FromColumn = 1;
+                if (FromRow <= 0)
+                    FromRow = 1;
+                if (ToColumn <= 0)
+                    ToColumn = ExcelPackage.MaxColumns;
+                if (ToRow <= 0)
+                    ToRow = ExcelPackage.MaxRows;
+            }
+            return ret;
+        }
+        /// <summary>
+        /// Get the row/column for n Cell-address
+        /// </summary>
+        /// <param name="CellAddress">The address</param>
+        /// <param name="Row">Returns Tthe row</param>
+        /// <param name="Column">Returns the column</param>
+        /// <returns>true if valid</returns>
+        internal static bool GetRowColFromAddress(string CellAddress, out int Row, out int Column)
+        {
+            return GetRowCol(CellAddress, out Row, out Column, true);
+        }
+        /// <summary>
+        /// Get the row/column for a Cell-address
+        /// </summary>
+        /// <param name="address">the address</param>
+        /// <param name="row">returns the row</param>
+        /// <param name="col">returns the column</param>
+        /// <param name="throwException">throw exception if invalid, otherwise returns false</param>
+        /// <returns></returns>
+        internal static bool GetRowCol(string address, out int row, out int col, bool throwException)
+        {
+            bool colPart = true;
+            string sRow = "", sCol = "";
+            col = 0;
+            if (address.IndexOf(':') > 0)  //If it is a mult-cell address use 
+            {
+                address = address.Substring(0, address.IndexOf(':'));
+            }
+            if (address.EndsWith("#REF!"))
+            {
+                row = 0;
+                col = 0;
+                return true;
+            }
+
+            int sheetMarkerIndex = address.IndexOf('!');
+            if (sheetMarkerIndex >= 0)
+            {
+                address = address.Substring(sheetMarkerIndex + 1);
+            }
+
+            for (int i = 0; i < address.Length; i++)
+            {
+                if ((address[i] >= 'A' && address[i] <= 'Z') && colPart && sCol.Length <= 3)
+                {
+                    sCol += address[i];
+                }
+                else if (address[i] >= '0' && address[i] <= '9')
+                {
+                    sRow += address[i];
+                    colPart = false;
+                }
+                else if (address[i] != '$') // $ is ignored here
+                {
+                    if (throwException)
+                    {
+                        throw (new Exception(string.Format("Invalid Address format {0}", address)));
+                    }
+                    else
+                    {
+                        row = 0;
+                        col = 0;
+                        return false;
+                    }
+                }
+            }
+
+            // Get the column number
+            if (sCol != "")
+            {
+                int len = sCol.Length - 1;
+                for (int i = len; i >= 0; i--)
+                {
+                    col += (((int)sCol[i]) - 64) * (int)(Math.Pow(26, len - i));
+                }
+            }
+            else
+            {
+                col = 0;
+                int.TryParse(sRow, out row);
+                return row>0;
+            }
+            // Get the row number
+            if (sRow == "") //Blank, fullRow
+            {
+                //if (throwException)
+                //{
+                //    throw (new Exception(string.Format("Invalid Address format {0}", address)));
+                //}
+                //else
+                //{                    
+                row = 0;
+                return col > 0;
+                //}
+            }
+            else
+            {
+                return int.TryParse(sRow, out row);
+            }
+        }
+        #region GetAddress
+        /// <summary>
+        /// Returns the AlphaNumeric representation that Excel expects for a Cell Address
+        /// </summary>
+        /// <param name="Row">The number of the row</param>
+        /// <param name="Column">The number of the column in the worksheet</param>
+        /// <returns>The cell address in the format A1</returns>
+        public static string GetAddress(int Row, int Column)
+        {
+            return GetAddress(Row, Column,false);
+        }
+        /// <summary>
+        /// Returns the AlphaNumeric representation that Excel expects for a Cell Address
+        /// </summary>
+        /// <param name="Row">The number of the row</param>
+        /// <param name="Column">The number of the column in the worksheet</param>
+        /// <param name="AbsoluteRow">Absolute row</param>
+        /// <param name="AbsoluteCol">Absolute column</param>
+        /// <returns>The cell address in the format A1</returns>
+        public static string GetAddress(int Row, bool AbsoluteRow, int Column, bool AbsoluteCol)
+        {
+            return ( AbsoluteCol ? "$" : "") + GetColumnLetter(Column) + ( AbsoluteRow ? "$" : "") + Row.ToString();
+        }
+        /// <summary>
+        /// Returns the AlphaNumeric representation that Excel expects for a Cell Address
+        /// </summary>
+        /// <param name="Row">The number of the row</param>
+        /// <param name="Column">The number of the column in the worksheet</param>
+        /// <param name="Absolute">Get an absolute address ($A$1)</param>
+        /// <returns>The cell address in the format A1</returns>
+        public static string GetAddress(int Row, int Column, bool Absolute)
+        {
+            if (Row == 0 || Column == 0)
+            {
+                return "#REF!";
+            }
+            if (Absolute)
+            {
+                return ("$" + GetColumnLetter(Column) + "$" + Row.ToString());
+            }
+            else
+            {
+                return (GetColumnLetter(Column) + Row.ToString());
+            }
+        }
+        /// <summary>
+        /// Returns the AlphaNumeric representation that Excel expects for a Cell Address
+        /// </summary>
+        /// <param name="FromRow">From row number</param>
+        /// <param name="FromColumn">From column number</param>
+        /// <param name="ToRow">To row number</param>
+        /// <param name="ToColumn">From column number</param>
+        /// <returns>The cell address in the format A1</returns>
+        public static string GetAddress(int FromRow, int FromColumn, int ToRow, int ToColumn)
+        {
+            return GetAddress(FromRow, FromColumn, ToRow, ToColumn, false);
+        }
+        /// <summary>
+        /// Returns the AlphaNumeric representation that Excel expects for a Cell Address
+        /// </summary>
+        /// <param name="FromRow">From row number</param>
+        /// <param name="FromColumn">From column number</param>
+        /// <param name="ToRow">To row number</param>
+        /// <param name="ToColumn">From column number</param>
+        /// <param name="Absolute">if true address is absolute (like $A$1)</param>
+        /// <returns>The cell address in the format A1</returns>
+        public static string GetAddress(int FromRow, int FromColumn, int ToRow, int ToColumn, bool Absolute)
+        {
+            if (FromRow == ToRow && FromColumn == ToColumn)
+            {
+                return GetAddress(FromRow, FromColumn, Absolute);
+            }
+            else
+            {
+                if (FromRow == 1 && ToRow == ExcelPackage.MaxRows)
+                {
+                    var absChar = Absolute ? "$" : "";
+                    return absChar + GetColumnLetter(FromColumn) + ":" + absChar + GetColumnLetter(ToColumn);
+                }
+                else if(FromColumn==1 && ToColumn==ExcelPackage.MaxColumns)
+                {
+                    var absChar = Absolute ? "$" : "";
+                    return absChar + FromRow.ToString() + ":" + absChar + ToRow.ToString();
+                }
+                else
+                {
+                    return GetAddress(FromRow, FromColumn, Absolute) + ":" + GetAddress(ToRow, ToColumn, Absolute);
+                }
+            }
+        }
+        /// <summary>
+        /// Get the full address including the worksheet name
+        /// </summary>
+        /// <param name="worksheetName">The name of the worksheet</param>
+        /// <param name="address">The address</param>
+        /// <returns>The full address</returns>
+        public static string GetFullAddress(string worksheetName, string address)
+        {
+            return GetFullAddress(worksheetName, address, true);
+        }
+        internal static string GetFullAddress(string worksheetName, string address, bool fullRowCol)
+        {
+               if (address.IndexOf("!") == -1 || address=="#REF!")
+               {
+                   if (fullRowCol)
+                   {
+                       string[] cells = address.Split(':');
+                       if (cells.Length > 0)
+                       {
+                           address = string.Format("'{0}'!{1}", worksheetName, cells[0]);
+                           if (cells.Length > 1)
+                           {
+                               address += string.Format(":{0}", cells[1]);
+                           }
+                       }
+                   }
+                   else
+                   {
+                       var a = new ExcelAddressBase(address);
+                       if ((a._fromRow == 1 && a._toRow == ExcelPackage.MaxRows) || (a._fromCol == 1 && a._toCol == ExcelPackage.MaxColumns))
+                       {
+                           address = string.Format("'{0}'!{1}{2}:{3}{4}", worksheetName, ExcelAddress.GetColumnLetter(a._fromCol), a._fromRow, ExcelAddress.GetColumnLetter(a._toCol), a._toRow);
+                       }
+                       else
+                       {
+                           address=GetFullAddress(worksheetName, address, true);
+                       }
+                   }
+               }
+               return address;
+        }
+        #endregion
+        #region IsValidCellAddress
+        /// <summary>
+        /// Checks that a cell address (e.g. A5) is valid.
+        /// </summary>
+        /// <param name="cellAddress">The alphanumeric cell address</param>
+        /// <returns>True if the cell address is valid</returns>
+        public static bool IsValidCellAddress(string cellAddress)
+        {
+            bool result = false;
+            try
+            {
+                int row, col;
+                if (GetRowColFromAddress(cellAddress, out row, out col))
+                {
+                    if (row > 0 && col > 0 && row <= ExcelPackage.MaxRows && col <= ExcelPackage.MaxColumns)
+                        result = true;
+                    else
+                        result = false;
+                }
+            }
+            catch { }
+            return result;
+        }
+        #endregion
+        #region UpdateFormulaReferences
+        /// <summary>
+        /// Updates the Excel formula so that all the cellAddresses are incremented by the row and column increments
+        /// if they fall after the afterRow and afterColumn.
+        /// Supports inserting rows and columns into existing templates.
+        /// </summary>
+        /// <param name="Formula">The Excel formula</param>
+        /// <param name="rowIncrement">The amount to increment the cell reference by</param>
+        /// <param name="colIncrement">The amount to increment the cell reference by</param>
+        /// <param name="afterRow">Only change rows after this row</param>
+        /// <param name="afterColumn">Only change columns after this column</param>
+        /// <returns></returns>
+        internal static string UpdateFormulaReferences(string Formula, int rowIncrement, int colIncrement, int afterRow, int afterColumn)
+        {
+            return Translate(Formula, AddToRowColumnTranslator, afterRow, afterColumn, rowIncrement, colIncrement);
+        }
+
+        #endregion
+        #endregion
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelColumn.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelColumn.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelColumn.cs	(revision 9616)
@@ -0,0 +1,343 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Xml;
+using OfficeOpenXml.Style;
+namespace OfficeOpenXml
+{
+	/// <summary>
+	/// Represents one or more columns within the worksheet
+	/// </summary>
+	public class ExcelColumn : IRangeID
+	{
+		private ExcelWorksheet _worksheet;
+		private XmlElement _colElement = null;
+
+		#region ExcelColumn Constructor
+		/// <summary>
+		/// Creates a new instance of the ExcelColumn class.  
+		/// For internal use only!
+		/// </summary>
+		/// <param name="Worksheet"></param>
+		/// <param name="col"></param>
+		protected internal ExcelColumn(ExcelWorksheet Worksheet, int col)
+        {
+            _worksheet = Worksheet;
+            _columnMin = col;
+            _columnMax = col;
+            _width = _worksheet.DefaultColWidth;
+        }
+		#endregion
+        int _columnMin;		
+		/// <summary>
+		/// Sets the first column the definition refers to.
+		/// </summary>
+		public int ColumnMin 
+		{
+            get { return _columnMin; }
+			//set { _columnMin=value; } 
+		}
+
+        internal int _columnMax;
+        /// <summary>
+		/// Sets the last column the definition refers to.
+		/// </summary>
+        public int ColumnMax 
+		{ 
+            get { return _columnMax; }
+			set 
+            {
+                if (value < _columnMin && value > ExcelPackage.MaxColumns)
+                {
+                    throw new Exception("ColumnMax out of range");
+                }
+
+                foreach (ExcelColumn c in _worksheet._columns)
+                {
+                    if (c.ColumnMin > _columnMin && c.ColumnMax <= value && c.ColumnMin!=_columnMin)
+                    {
+                        throw new Exception(string.Format("ColumnMax can not spann over existing column {0}.",c.ColumnMin));
+                    }
+                }
+                _columnMax = value; 
+            } 
+		}
+        /// <summary>
+        /// Internal range id for the column
+        /// </summary>
+        internal ulong ColumnID
+        {
+            get
+            {
+                return ExcelColumn.GetColumnID(_worksheet.SheetID, ColumnMin);
+            }
+        }
+		#region ExcelColumn Hidden
+		/// <summary>
+		/// Allows the column to be hidden in the worksheet
+		/// </summary>
+        internal bool _hidden=false;
+        public bool Hidden
+		{
+			get
+			{
+                return _hidden;
+			}
+			set
+			{
+                if (_worksheet._package.DoAdjustDrawings)
+                {
+                    var pos = _worksheet.Drawings.GetDrawingWidths();
+                    _hidden = value;
+                    _worksheet.Drawings.AdjustWidth(pos);
+                }
+                else
+                {
+                    _hidden = value;
+                }
+			}
+		}
+		#endregion
+
+		#region ExcelColumn Width
+        internal double VisualWidth
+        {
+            get
+            {
+                if (_hidden || (Collapsed && OutlineLevel>0))
+                {
+                    return 0;
+                }
+                else
+                {
+                    return _width;
+                }
+            }
+        }
+        internal double _width;
+        /// <summary>
+        /// Sets the width of the column in the worksheet
+        /// </summary>
+        public double Width
+		{
+			get
+			{
+                return _width;
+			}
+			set	
+            {
+                if (_worksheet._package.DoAdjustDrawings)
+                {
+                    var pos = _worksheet.Drawings.GetDrawingWidths();
+                    _width = value;
+                    _worksheet.Drawings.AdjustWidth(pos);
+                }
+                else
+                {
+                    _width = value;
+                }
+
+                if (_hidden && value!=0)
+                {
+                    _hidden = false;
+                }
+            }
+		}
+        /// <summary>
+        /// If set to true a column automaticlly resize(grow wider) when a user inputs numbers in a cell. 
+        /// </summary>
+        public bool BestFit
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// If the column is collapsed in outline mode
+        /// </summary>
+        public bool Collapsed { get; set; }
+        /// <summary>
+        /// Outline level. Zero if no outline
+        /// </summary>
+        public int OutlineLevel { get; set; }
+        /// <summary>
+        /// Phonetic
+        /// </summary>
+        public bool Phonetic { get; set; }
+        #endregion
+
+		#region ExcelColumn Style
+        /// <summary>
+        /// The Style applied to the whole column. Only effects cells with no individual style set. 
+        /// Use Range object if you want to set specific styles.
+        /// </summary>
+        public ExcelStyle Style
+        {
+            get
+            {
+                string letter = ExcelCell.GetColumnLetter(ColumnMin);
+                string endLetter = ExcelCell.GetColumnLetter(ColumnMax);
+                return _worksheet.Workbook.Styles.GetStyleObject(_styleID, _worksheet.PositionID, letter + ":" + endLetter);
+            }
+        }
+        internal string _styleName="";
+        /// <summary>
+		/// Sets the style for the entire column using a style name.
+		/// </summary>
+		public string StyleName
+		{
+            get
+            {
+                return _styleName;
+            }
+            set
+            {
+                _styleID = _worksheet.Workbook.Styles.GetStyleIdFromName(value);
+                _styleName = value;
+            }
+		}
+        internal int _styleID = 0;
+        /// <summary>
+		/// Sets the style for the entire column using the style ID.  
+		/// </summary>
+        public int StyleID
+		{
+            get
+            {
+                return _styleID;
+            }
+            set
+            {
+                _styleID = value;
+            }
+		}
+        /// <summary>
+        /// Adds a manual page break after the column.
+        /// </summary>
+        public bool PageBreak
+        {
+            get;
+            set;
+        }
+        #endregion
+
+		/// <summary>
+		/// Returns the range of columns covered by the column definition.
+		/// </summary>
+		/// <returns>A string describing the range of columns covered by the column definition.</returns>
+		public override string ToString()
+		{
+			return string.Format("Column Range: {0} to {1}", _colElement.GetAttribute("min"), _colElement.GetAttribute("min"));
+		}
+        /// <summary>
+        /// Set the column width from the content of the range. The minimum width is the value of the ExcelWorksheet.defaultColumnWidth property.
+        /// Note: Cells containing formulas are ignored since EPPlus don't have a calculation engine.
+        ///       Wrapped and merged cells are also ignored.
+        /// </summary>
+        public void AutoFit()
+        {
+            _worksheet.Cells[1, _columnMin, ExcelPackage.MaxRows, _columnMax].AutoFitColumns();
+        }
+
+        /// <summary>
+        /// Set the column width from the content.
+        /// Note: Cells containing formulas are ignored since EPPlus don't have a calculation engine.
+        ///       Wrapped and merged cells are also ignored.
+        /// </summary>
+        /// <param name="MinimumWidth">Minimum column width</param>
+        public void AutoFit(double MinimumWidth)
+        {
+            _worksheet.Cells[1, _columnMin, ExcelPackage.MaxRows, _columnMax].AutoFitColumns(MinimumWidth);
+        }
+
+        /// <summary>
+        /// Set the column width from the content.
+        /// Note: Cells containing formulas are ignored since EPPlus don't have a calculation engine.
+        ///       Wrapped and merged cells are also ignored.
+        /// </summary>
+        /// <param name="MinimumWidth">Minimum column width</param>
+        /// <param name="MaximumWidth">Maximum column width</param>
+        public void AutoFit(double MinimumWidth, double MaximumWidth)
+        {
+            _worksheet.Cells[1, _columnMin, ExcelPackage.MaxRows, _columnMax].AutoFitColumns(MinimumWidth, MaximumWidth);
+        }
+
+        /// <summary>
+        /// Get the internal RangeID
+        /// </summary>
+        /// <param name="sheetID">Sheet no</param>
+        /// <param name="column">Column</param>
+        /// <returns></returns>
+        internal static ulong GetColumnID(int sheetID, int column)
+        {
+            return ((ulong)sheetID) + (((ulong)column) << 15);
+        }
+
+        #region IRangeID Members
+
+        ulong IRangeID.RangeID
+        {
+            get
+            {
+                return ColumnID;
+            }
+            set
+            {
+                int prevColMin = _columnMin;
+                _columnMin = ((int)(value >> 15) & 0x3FF);
+                _columnMax += prevColMin - ColumnMin;
+                //Todo:More Validation
+                if (_columnMax > ExcelPackage.MaxColumns) _columnMax = ExcelPackage.MaxColumns;
+            }
+        }
+
+        #endregion
+
+        /// <summary>
+        /// Copies the current column to a new worksheet
+        /// </summary>
+        /// <param name="added">The worksheet where the copy will be created</param>
+        internal void Clone(ExcelWorksheet added)
+        {
+            ExcelColumn newCol = added.Column(ColumnMin);
+            newCol.ColumnMax = ColumnMax;
+            newCol.BestFit = BestFit;
+            newCol.Collapsed = Collapsed;
+            newCol.Hidden = Hidden;
+            newCol.OutlineLevel = OutlineLevel;
+            newCol.PageBreak = PageBreak;
+            newCol.Phonetic = Phonetic;
+            newCol.StyleName = StyleName;
+            newCol.StyleID = StyleID;
+            newCol.Width = Width;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelComment.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelComment.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelComment.cs	(revision 9616)
@@ -0,0 +1,143 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Initial Release		     
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style;
+using System.Xml;
+using OfficeOpenXml.Drawing;
+using OfficeOpenXml.Drawing.Vml;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// An Excel Cell Comment
+    /// </summary>
+    public class ExcelComment : ExcelVmlDrawingComment
+    {
+        internal XmlHelper _commentHelper;
+        internal ExcelComment(XmlNamespaceManager ns, XmlNode commentTopNode, ExcelRangeBase cell)
+            : base(null, cell, cell.Worksheet.VmlDrawingsComments.NameSpaceManager)
+        {
+            //_commentHelper = new XmlHelper(ns, commentTopNode);
+            _commentHelper = XmlHelperFactory.Create(ns, commentTopNode);
+            var textElem=commentTopNode.SelectSingleNode("d:text", ns);
+            if (textElem == null)
+            {
+                textElem = commentTopNode.OwnerDocument.CreateElement("text", ExcelPackage.schemaMain);
+                commentTopNode.AppendChild(textElem);
+            }
+            if (!cell.Worksheet._vmlDrawings.ContainsKey(ExcelAddress.GetCellID(cell.Worksheet.SheetID, cell.Start.Row, cell.Start.Column)))
+            {
+                cell.Worksheet._vmlDrawings.Add(cell);
+            }
+
+            TopNode = cell.Worksheet.VmlDrawingsComments[ExcelCellBase.GetCellID(cell.Worksheet.SheetID, cell.Start.Row, cell.Start.Column)].TopNode;
+            RichText = new ExcelRichTextCollection(ns,textElem);
+        }
+        const string AUTHORS_PATH = "d:comments/d:authors";
+        const string AUTHOR_PATH = "d:comments/d:authors/d:author";
+        /// <summary>
+        /// Author
+        /// </summary>
+        public string Author
+        {
+            get
+            {
+                int authorRef = _commentHelper.GetXmlNodeInt("@authorId");
+                return _commentHelper.TopNode.OwnerDocument.SelectSingleNode(string.Format("{0}[{1}]", AUTHOR_PATH, authorRef+1), _commentHelper.NameSpaceManager).InnerText;
+            }
+            set
+            {
+                int authorRef = GetAuthor(value);
+                _commentHelper.SetXmlNodeString("@authorId", authorRef.ToString());
+            }
+        }
+        private int GetAuthor(string value)
+        {
+            int authorRef = 0;
+            bool found = false;
+            foreach (XmlElement node in _commentHelper.TopNode.OwnerDocument.SelectNodes(AUTHOR_PATH, _commentHelper.NameSpaceManager))
+            {
+                if (node.InnerText == value)
+                {
+                    found = true;
+                    break;
+                }
+                authorRef++;
+            }
+            if (!found)
+            {
+                var elem = _commentHelper.TopNode.OwnerDocument.CreateElement("d", "author", ExcelPackage.schemaMain);
+                _commentHelper.TopNode.OwnerDocument.SelectSingleNode(AUTHORS_PATH, _commentHelper.NameSpaceManager).AppendChild(elem);
+                elem.InnerText = value;
+            }
+            return authorRef;
+        }
+        /// <summary>
+        /// The comment text 
+        /// </summary>
+        public string Text
+        {
+            get
+            {
+                return RichText.Text;
+            }
+            set
+            {
+                RichText.Text = value;
+            }
+        }
+        /// <summary>
+        /// Sets the font of the first richtext item.
+        /// </summary>
+        public ExcelRichText Font
+        {
+            get
+            {
+                if (RichText.Count > 0)
+                {
+                    return RichText[0];
+                }
+                return null;
+            }
+        }
+        /// <summary>
+        /// Richtext collection
+        /// </summary>
+        public ExcelRichTextCollection RichText 
+        { 
+           get; 
+           set; 
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCommentCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCommentCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelCommentCollection.cs	(revision 9616)
@@ -0,0 +1,222 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using System.Collections;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Collection of Excelcomment objects
+    /// </summary>  
+    public class ExcelCommentCollection : IEnumerable
+    {
+        internal RangeCollection _comments;
+        internal ExcelCommentCollection(ExcelPackage pck, ExcelWorksheet ws, XmlNamespaceManager ns)
+        {
+            CommentXml = new XmlDocument();
+            CommentXml.PreserveWhitespace = false;
+            NameSpaceManager=ns;
+            Worksheet=ws;
+            CreateXml(pck);
+            AddCommentsFromXml();
+        }
+        private void CreateXml(ExcelPackage pck)
+        {
+            var commentParts = Worksheet.Part.GetRelationshipsByType(ExcelPackage.schemaComment);
+            bool isLoaded=false;
+            CommentXml=new XmlDocument();
+            foreach(var commentPart in commentParts)
+            {
+                Uri = PackUriHelper.ResolvePartUri(commentPart.SourceUri, commentPart.TargetUri);
+                Part = pck.Package.GetPart(Uri);
+                XmlHelper.LoadXmlSafe(CommentXml, Part.GetStream()); 
+                RelId = commentPart.Id;
+                isLoaded=true;
+            }
+            //Create a new document
+            if(!isLoaded)
+            {
+                CommentXml.LoadXml("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><comments xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\"><authors /><commentList /></comments>");
+                Uri = null;
+            }
+        }
+        private void AddCommentsFromXml()
+        {
+            var lst = new List<IRangeID>();
+            foreach (XmlElement node in CommentXml.SelectNodes("//d:commentList/d:comment", NameSpaceManager))
+            {
+                var comment = new ExcelComment(NameSpaceManager, node, new ExcelRangeBase(Worksheet, node.GetAttribute("ref")));
+                lst.Add(comment);
+            }
+            _comments = new RangeCollection(lst);
+        }
+        /// <summary>
+        /// Access to the comment xml document
+        /// </summary>
+        public XmlDocument CommentXml { get; set; }
+        internal Uri Uri { get; set; }
+        internal string RelId { get; set; }
+        internal XmlNamespaceManager NameSpaceManager { get; set; }
+        internal PackagePart Part
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// A reference to the worksheet object
+        /// </summary>
+        public ExcelWorksheet Worksheet
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// Number of comments in the collection
+        /// </summary>
+        public int Count
+        {
+            get
+            {
+                return _comments.Count;
+            }
+        }
+        /// <summary>
+        /// Indexer for the comments collection
+        /// </summary>
+        /// <param name="Index">The index</param>
+        /// <returns>The comment</returns>
+        public ExcelComment this[int Index]
+        {
+            get
+            {
+                if (Index < 0 || Index >= _comments.Count)
+                {
+                    throw(new ArgumentOutOfRangeException("Comment index out of range"));
+                }
+                return _comments[Index] as ExcelComment;
+            }
+        }
+        /// <summary>
+        /// Indexer for the comments collection
+        /// </summary>
+        /// <param name="cell">The cell</param>
+        /// <returns>The comment</returns>
+        public ExcelComment this[ExcelCellAddress cell]
+        {
+            get
+            {
+                ulong cellID=ExcelCellBase.GetCellID(Worksheet.SheetID, cell.Row, cell.Column);
+                if (_comments.IndexOf(cellID) >= 0)
+                {
+                    return _comments[cellID] as ExcelComment;
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+        /// <summary>
+        /// Adds a comment to the top left cell of the range
+        /// </summary>
+        /// <param name="cell">The cell</param>
+        /// <param name="Text">The comment text</param>
+        /// <param name="author">Author</param>
+        /// <returns>The comment</returns>
+        public ExcelComment Add(ExcelRangeBase cell, string Text, string author)
+        {            
+            var elem = CommentXml.CreateElement("comment", ExcelPackage.schemaMain);
+            int ix=_comments.IndexOf(ExcelAddress.GetCellID(Worksheet.SheetID, cell._fromRow, cell._fromCol));
+            //Make sure the nodes come on order.
+            if (ix < 0 && (~ix < _comments.Count))
+            {
+                ix = ~ix;
+                var preComment = _comments[ix] as ExcelComment;
+                preComment._commentHelper.TopNode.ParentNode.InsertBefore(elem, preComment._commentHelper.TopNode);
+            }
+            else
+            {
+                CommentXml.SelectSingleNode("d:comments/d:commentList", NameSpaceManager).AppendChild(elem);
+            }
+            elem.SetAttribute("ref", cell.Start.Address);
+            ExcelComment comment = new ExcelComment(NameSpaceManager, elem , cell);
+            comment.RichText.Add(Text);
+            if(author!="") 
+            {
+                comment.Author=author;
+            }
+            _comments.Add(comment);
+            return comment;
+        }
+        /// <summary>
+        /// Removes the comment
+        /// </summary>
+        /// <param name="comment">The comment to remove</param>
+        public void Remove(ExcelComment comment)
+        {
+            ulong id = ExcelAddress.GetCellID(Worksheet.SheetID, comment.Range._fromRow, comment.Range._fromCol);
+            int ix=_comments.IndexOf(id);
+            if (ix >= 0 && comment == _comments[ix])
+            {
+                comment.TopNode.ParentNode.RemoveChild(comment.TopNode); //Remove VML
+                comment._commentHelper.TopNode.ParentNode.RemoveChild(comment._commentHelper.TopNode); //Remove Comment
+
+                Worksheet.VmlDrawingsComments._drawings.Delete(id);
+                _comments.Delete(id);
+            }
+            else
+            {
+                throw (new ArgumentException("Comment does not exist in the worksheet"));
+            }
+        }
+        /// <summary>
+        /// Removes the comment at the specified position
+        /// </summary>
+        /// <param name="Index">The index</param>
+        public void RemoveAt(int Index)
+        {
+            Remove(this[Index]);
+        }
+        #region IEnumerable Members
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return _comments;
+        }
+        #endregion
+
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelEncryption.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelEncryption.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelEncryption.cs	(revision 9616)
@@ -0,0 +1,130 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ ***************************************************************************************
+ * This class is created with the help of the MS-OFFCRYPTO PDF documentation... http://msdn.microsoft.com/en-us/library/cc313071(office.12).aspx
+ * Decrypytion library for Office Open XML files(Lyquidity) and Sminks very nice example 
+ * on "Reading compound documents in c#" on Stackoverflow. Many thanks!
+ ***************************************************************************************
+ *  
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		10-AUG-2010
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Encryption Algorithm
+    /// </summary>
+    public enum EncryptionAlgorithm
+    {
+        /// <summary>
+        /// 128-bit AES. Default
+        /// </summary>
+        AES128,
+        /// <summary>
+        /// 192-bit AES.
+        /// </summary>
+        AES192,
+        /// <summary>
+        /// 256-bit AES. 
+        /// </summary>
+        AES256
+    }
+    /// <summary>
+    /// How and if the workbook is encrypted
+    ///<seealso cref="ExcelProtection"/> 
+    ///<seealso cref="ExcelSheetProtection"/> 
+    /// </summary>
+    public class ExcelEncryption
+    {
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        internal ExcelEncryption()
+        {
+            Algorithm = EncryptionAlgorithm.AES128;
+        }
+        /// <summary>
+        /// Constructor
+        /// </summary>
+        /// <param name="encryptionAlgorithm">Algorithm used to encrypt the package. Default is AES128</param>
+        internal ExcelEncryption(EncryptionAlgorithm encryptionAlgorithm)
+        {
+            Algorithm = encryptionAlgorithm;
+        }        
+        bool _isEncrypted = false;
+        /// <summary>
+        /// Is the package encrypted
+        /// </summary>
+        public bool IsEncrypted 
+        {
+            get
+            {
+                return _isEncrypted;
+            }
+            set
+            {
+                _isEncrypted = value;
+                if (_isEncrypted)
+                {
+                    if (_password == null) _password = "";
+                }
+                else
+                {
+                    _password = null;
+                }
+            }
+        }
+        string _password=null;
+        /// <summary>
+        /// The password used to encrypt the workbook.
+        /// </summary>
+        public string Password 
+        {
+            get
+            {
+                return _password;
+            }
+            set
+            {
+                _password = value;
+                _isEncrypted = (value != null);
+            }
+        }
+        /// <summary>
+        /// Algorithm used for encrypting the package. Default is AES 128-bit
+        /// </summary>
+        public EncryptionAlgorithm Algorithm { get; set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelHeaderFooter.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelHeaderFooter.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelHeaderFooter.cs	(revision 9616)
@@ -0,0 +1,547 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman                      Total rewrite               2010-03-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ * *******************************************************************************/
+using System;
+using System.Xml;
+using System.Text.RegularExpressions;
+using System.Drawing;
+using System.Collections.Generic;
+using OfficeOpenXml.Drawing.Vml;
+using System.IO;
+using OfficeOpenXml.Drawing;
+using System.IO.Packaging;
+namespace OfficeOpenXml
+{    
+    /// <summary>
+    /// How a picture will be aligned in the header/footer
+    /// </summary>
+    public enum PictureAlignment
+    {
+        /// <summary>
+        /// The picture will be added to the left aligned text
+        /// </summary>
+        Left,
+        /// <summary>
+        /// The picture will be added to the centered text
+        /// </summary>
+        Centered,
+        /// <summary>
+        /// The picture will be added to the right aligned text
+        /// </summary>
+        Right
+    }
+    #region class ExcelHeaderFooterText
+	/// <summary>
+    /// Print header and footer 
+    /// </summary>
+	public class ExcelHeaderFooterText
+	{
+        ExcelWorksheet _ws;
+        string _hf;
+        internal ExcelHeaderFooterText(XmlNode TextNode, ExcelWorksheet ws, string hf)
+        {
+            _ws = ws;
+            _hf = hf;
+            if (TextNode == null || string.IsNullOrEmpty(TextNode.InnerText)) return;
+            string text = TextNode.InnerText;
+            string code = text.Substring(0, 2);  
+            int startPos=2;
+            for (int pos=startPos;pos<text.Length-2;pos++)
+            {
+                string newCode = text.Substring(pos, 2);
+                if (newCode == "&C" || newCode == "&R")
+                {
+                    SetText(code, text.Substring(startPos, pos-startPos));
+                    startPos = pos+2;
+                    pos = startPos;
+                    code = newCode;
+                }
+            }
+            SetText(code, text.Substring(startPos, text.Length - startPos));
+        }
+        private void SetText(string code, string text)
+        {
+            switch (code)
+            {
+                case "&L":
+                    LeftAlignedText=text;
+                    break;
+                case "&C":
+                    CenteredText=text;
+                    break;
+                default:
+                    RightAlignedText=text;
+                    break;
+            }
+        }
+		/// <summary>
+		/// Get/set the text to appear on the left hand side of the header (or footer) on the worksheet.
+		/// </summary>
+		public string LeftAlignedText = null;
+		/// <summary>
+        /// Get/set the text to appear in the center of the header (or footer) on the worksheet.
+		/// </summary>
+		public string CenteredText = null;
+		/// <summary>
+        /// Get/set the text to appear on the right hand side of the header (or footer) on the worksheet.
+		/// </summary>
+		public string RightAlignedText = null;
+        /// <summary>
+        /// Inserts a picture at the end of the text in the header or footer
+        /// </summary>
+        /// <param name="Picture">The image object containing the Picture</param>
+        /// <param name="Alignment">Alignment. The image object will be inserted at the end of the Text.</param>
+        public ExcelVmlDrawingPicture InsertPicture(Image Picture, PictureAlignment Alignment)
+        {
+            string id = ValidateImage(Alignment);
+            
+            //Add the image
+            ImageConverter ic = new ImageConverter();
+            byte[] img = (byte[])ic.ConvertTo(Picture, typeof(byte[]));
+            var ii = _ws.Workbook._package.AddImage(img);
+
+            return AddImage(Picture, id, ii);
+        }
+        /// <summary>
+        /// Inserts a picture at the end of the text in the header or footer
+        /// </summary>
+        /// <param name="PictureFile">The image object containing the Picture</param>
+        /// <param name="Alignment">Alignment. The image object will be inserted at the end of the Text.</param>
+        public ExcelVmlDrawingPicture InsertPicture(FileInfo PictureFile, PictureAlignment Alignment)
+        {
+            string id = ValidateImage(Alignment);
+
+            Image Picture;
+            try
+            {
+                if (!PictureFile.Exists)
+                {
+                    throw (new FileNotFoundException(string.Format("{0} is missing", PictureFile.FullName)));
+                }
+                Picture = Image.FromFile(PictureFile.FullName);
+            }
+            catch (Exception ex)
+            {
+                throw (new InvalidDataException("File is not a supported image-file or is corrupt", ex));
+            }
+
+            ImageConverter ic = new ImageConverter();
+            string contentType = ExcelPicture.GetContentType(PictureFile.Extension);
+            var uriPic = XmlHelper.GetNewUri(_ws._package.Package, "/xl/media/"+PictureFile.Name.Substring(0, PictureFile.Name.Length-PictureFile.Extension.Length) + "{0}" + PictureFile.Extension);
+            byte[] imgBytes = (byte[])ic.ConvertTo(Picture, typeof(byte[]));
+            var ii = _ws.Workbook._package.AddImage(imgBytes, uriPic, contentType);
+
+            return AddImage(Picture, id, ii);
+        }
+
+        private ExcelVmlDrawingPicture AddImage(Image Picture, string id, ExcelPackage.ImageInfo ii)
+        {
+            double width = Picture.Width * 72 / Picture.HorizontalResolution,      //Pixel --> Points
+                   height = Picture.Height * 72 / Picture.VerticalResolution;      //Pixel --> Points
+            //Add VML-drawing            
+            return _ws.HeaderFooter.Pictures.Add(id, ii.Uri, "", width, height);
+        }
+        private string ValidateImage(PictureAlignment Alignment)
+        {
+            string id = string.Concat(Alignment.ToString()[0], _hf);
+            foreach (ExcelVmlDrawingPicture image in _ws.HeaderFooter.Pictures)
+            {
+                if (image.Id == id)
+                {
+                    throw (new InvalidOperationException("A picture already exists in this section"));
+                }
+            }
+            //Add the image placeholder to the end of the text
+            switch (Alignment)
+            {
+                case PictureAlignment.Left:
+                    LeftAlignedText += ExcelHeaderFooter.Image;
+                    break;
+                case PictureAlignment.Centered:
+                    CenteredText += ExcelHeaderFooter.Image;
+                    break;
+                default:
+                    RightAlignedText += ExcelHeaderFooter.Image;
+                    break;
+            }
+            return id;
+        }
+	}
+	#endregion
+
+	#region ExcelHeaderFooter
+	/// <summary>
+	/// Represents the Header and Footer on an Excel Worksheet
+	/// </summary>
+	public sealed class ExcelHeaderFooter : XmlHelper
+	{
+		#region Static Properties
+		/// <summary>
+        /// The code for "current page #"
+		/// </summary>
+		public const string PageNumber = @"&P";
+		/// <summary>
+        /// The code for "total pages"
+		/// </summary>
+		public const string NumberOfPages = @"&N";
+        /// <summary>
+        /// The code for "text font color"
+        /// RGB Color is specified as RRGGBB
+        /// Theme Color is specified as TTSNN where TT is the theme color Id, S is either "+" or "-" of the tint/shade value, NN is the tint/shade value.
+        /// </summary>
+        public const string FontColor = @"&K";
+		/// <summary>
+        /// The code for "sheet tab name"
+		/// </summary>
+		public const string SheetName = @"&A";
+		/// <summary>
+        /// The code for "this workbook's file path"
+		/// </summary>
+		public const string FilePath = @"&Z";
+		/// <summary>
+        /// The code for "this workbook's file name"
+		/// </summary>
+		public const string FileName = @"&F";
+		/// <summary>
+        /// The code for "date"
+		/// </summary>
+		public const string CurrentDate = @"&D";
+		/// <summary>
+        /// The code for "time"
+		/// </summary>
+		public const string CurrentTime = @"&T";
+        /// <summary>
+        /// The code for "picture as background"
+        /// </summary>
+        public const string Image = @"&G";
+        /// <summary>
+        /// The code for "outline style"
+        /// </summary>
+        public const string OutlineStyle = @"&O";
+        /// <summary>
+        /// The code for "shadow style"
+        /// </summary>
+        public const string ShadowStyle = @"&H";
+		#endregion
+
+		#region ExcelHeaderFooter Private Properties
+		internal ExcelHeaderFooterText _oddHeader;
+        internal ExcelHeaderFooterText _oddFooter;
+		internal ExcelHeaderFooterText _evenHeader;
+        internal ExcelHeaderFooterText _evenFooter;
+        internal ExcelHeaderFooterText _firstHeader;
+        internal ExcelHeaderFooterText _firstFooter;
+        private ExcelWorksheet _ws;
+        #endregion
+
+		#region ExcelHeaderFooter Constructor
+		/// <summary>
+		/// ExcelHeaderFooter Constructor
+		/// </summary>
+		/// <param name="nameSpaceManager"></param>
+        /// <param name="topNode"></param>
+        /// <param name="ws">The worksheet</param>
+		internal ExcelHeaderFooter(XmlNamespaceManager nameSpaceManager, XmlNode topNode, ExcelWorksheet ws) :
+            base(nameSpaceManager, topNode)
+		{
+            _ws = ws;
+            SchemaNodeOrder = new string[] { "headerFooter", "oddHeader", "oddFooter", "evenHeader", "evenFooter", "firstHeader", "firstFooter" };
+		}
+		#endregion
+
+		#region alignWithMargins
+        const string alignWithMarginsPath="@alignWithMargins";
+        /// <summary>
+		/// Gets/sets the alignWithMargins attribute
+		/// </summary>
+		public bool AlignWithMargins
+		{
+			get
+			{
+                return GetXmlNodeBool(alignWithMarginsPath);
+			}
+			set
+			{
+                SetXmlNodeString(alignWithMarginsPath, value ? "1" : "0");
+			}
+		}
+		#endregion
+
+        #region differentOddEven
+        const string differentOddEvenPath = "@differentOddEven";
+        /// <summary>
+		/// Gets/sets the flag that tells Excel to display different headers and footers on odd and even pages.
+		/// </summary>
+		public bool differentOddEven
+		{
+			get
+			{
+                return GetXmlNodeBool(differentOddEvenPath);
+			}
+			set
+			{
+                SetXmlNodeString(differentOddEvenPath, value ? "1" : "0");
+			}
+		}
+		#endregion
+
+		#region differentFirst
+        const string differentFirstPath = "@differentFirst";
+
+		/// <summary>
+		/// Gets/sets the flag that tells Excel to display different headers and footers on the first page of the worksheet.
+		/// </summary>
+		public bool differentFirst
+		{
+			get
+			{
+                return GetXmlNodeBool(differentFirstPath);
+			}
+			set
+			{
+                SetXmlNodeString(differentFirstPath, value ? "1" : "0");
+			}
+		}
+		#endregion
+
+		#region ExcelHeaderFooter Public Properties
+		/// <summary>
+		/// Provides access to the header on odd numbered pages of the document.
+		/// If you want the same header on both odd and even pages, then only set values in this ExcelHeaderFooterText class.
+		/// </summary>
+		public ExcelHeaderFooterText OddHeader 
+        { 
+            get 
+            {
+                if (_oddHeader == null)
+                {
+                    _oddHeader = new ExcelHeaderFooterText(TopNode.SelectSingleNode("d:oddHeader", NameSpaceManager), _ws, "H");
+                }
+                return _oddHeader; } 
+        }
+		/// <summary>
+		/// Provides access to the footer on odd numbered pages of the document.
+		/// If you want the same footer on both odd and even pages, then only set values in this ExcelHeaderFooterText class.
+		/// </summary>
+		public ExcelHeaderFooterText OddFooter 
+        { 
+            get 
+            {
+                if (_oddFooter == null)
+                {
+                    _oddFooter = new ExcelHeaderFooterText(TopNode.SelectSingleNode("d:oddFooter", NameSpaceManager), _ws, "F"); ;
+                }
+                return _oddFooter; 
+            } 
+        }
+		// evenHeader and evenFooter set differentOddEven = true
+		/// <summary>
+		/// Provides access to the header on even numbered pages of the document.
+		/// </summary>
+		public ExcelHeaderFooterText EvenHeader 
+        { 
+            get 
+            {
+                if (_evenHeader == null)
+                {
+                    _evenHeader = new ExcelHeaderFooterText(TopNode.SelectSingleNode("d:evenHeader", NameSpaceManager), _ws, "HEVEN");
+                    differentOddEven = true;
+                }
+                return _evenHeader; 
+            } 
+        }
+		/// <summary>
+		/// Provides access to the footer on even numbered pages of the document.
+		/// </summary>
+		public ExcelHeaderFooterText EvenFooter
+        { 
+            get 
+            {
+                if (_evenFooter == null)
+                {
+                    _evenFooter = new ExcelHeaderFooterText(TopNode.SelectSingleNode("d:evenFooter", NameSpaceManager), _ws, "FEVEN");
+                    differentOddEven = true;
+                }
+                return _evenFooter ; 
+            } 
+        }
+		/// <summary>
+		/// Provides access to the header on the first page of the document.
+		/// </summary>
+		public ExcelHeaderFooterText FirstHeader
+        { 
+            get 
+            {
+                if (_firstHeader == null)
+                {
+                    _firstHeader = new ExcelHeaderFooterText(TopNode.SelectSingleNode("d:firstHeader", NameSpaceManager), _ws, "HFIRST"); 
+                     differentFirst = true;
+                }
+                return _firstHeader; 
+            } 
+        }
+		/// <summary>
+		/// Provides access to the footer on the first page of the document.
+		/// </summary>
+		public ExcelHeaderFooterText FirstFooter
+        { 
+            get 
+            {
+                if (_firstFooter == null)
+                {
+                    _firstFooter = new ExcelHeaderFooterText(TopNode.SelectSingleNode("d:firstFooter", NameSpaceManager), _ws, "FFIRST"); 
+                    differentFirst = true;
+                }
+                return _firstFooter; 
+            } 
+        }
+        private ExcelVmlDrawingPictureCollection _vmlDrawingsHF = null;
+        /// <summary>
+        /// Vml drawings. Underlaying object for Header footer images
+        /// </summary>
+        public ExcelVmlDrawingPictureCollection Pictures
+        {
+            get
+            {
+                if (_vmlDrawingsHF == null)
+                {
+                    var vmlNode = _ws.WorksheetXml.SelectSingleNode("d:worksheet/d:legacyDrawingHF/@r:id", NameSpaceManager);
+                    if (vmlNode == null)
+                    {
+                        _vmlDrawingsHF = new ExcelVmlDrawingPictureCollection(_ws._package, _ws, null);
+                    }
+                    else
+                    {
+                        if (_ws.Part.RelationshipExists(vmlNode.Value))
+                        {
+                            var rel = _ws.Part.GetRelationship(vmlNode.Value);
+                            var vmlUri = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+
+                            _vmlDrawingsHF = new ExcelVmlDrawingPictureCollection(_ws._package, _ws, vmlUri);
+                            _vmlDrawingsHF.RelId = rel.Id;
+                        }
+                    }
+                }
+                return _vmlDrawingsHF;
+            }
+        }
+		#endregion
+		#region Save  //  ExcelHeaderFooter
+		/// <summary>
+		/// Saves the header and footer information to the worksheet XML
+		/// </summary>
+		internal void Save()
+		{
+			if (_oddHeader != null)
+			{
+                SetXmlNodeString("d:oddHeader", GetText(OddHeader));
+			}
+			if (_oddFooter != null)
+			{
+                SetXmlNodeString("d:oddFooter", GetText(OddFooter));
+			}
+
+			// only set evenHeader and evenFooter 
+			if (differentOddEven)
+			{
+				if (_evenHeader != null)
+				{
+                    SetXmlNodeString("d:evenHeader", GetText(EvenHeader));
+				}
+				if (_evenFooter != null)
+				{
+                    SetXmlNodeString("d:evenFooter", GetText(EvenFooter));
+				}
+			}
+
+			// only set firstHeader and firstFooter
+			if (differentFirst)
+			{
+				if (_firstHeader != null)
+				{
+                    SetXmlNodeString("d:firstHeader", GetText(FirstHeader));
+				}
+				if (_firstFooter != null)
+				{
+                    SetXmlNodeString("d:firstFooter", GetText(FirstFooter));
+				}
+			}
+		}
+        internal void SaveHeaderFooterImages()
+        {
+            if (_vmlDrawingsHF != null)
+            {
+                if (_vmlDrawingsHF.Count == 0)
+                {
+                    if (_vmlDrawingsHF.Uri != null)
+                    {
+                        _ws.Part.DeleteRelationship(_vmlDrawingsHF.RelId);
+                        _ws._package.Package.DeletePart(_vmlDrawingsHF.Uri);
+                    }
+                }
+                else
+                {
+                    if (_vmlDrawingsHF.Uri == null)
+                    {
+                        _vmlDrawingsHF.Uri = XmlHelper.GetNewUri(_ws._package.Package, @"/xl/drawings/vmlDrawing{0}.vml");
+                    }
+                    if (_vmlDrawingsHF.Part == null)
+                    {
+                        _vmlDrawingsHF.Part = _ws._package.Package.CreatePart(_vmlDrawingsHF.Uri, "application/vnd.openxmlformats-officedocument.vmlDrawing", _ws._package.Compression);
+                        var rel = _ws.Part.CreateRelationship(PackUriHelper.GetRelativeUri(_ws.WorksheetUri, _vmlDrawingsHF.Uri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/vmlDrawing");
+                        _ws.SetHFLegacyDrawingRel(rel.Id);
+                        _vmlDrawingsHF.RelId = rel.Id;
+                        foreach (ExcelVmlDrawingPicture draw in _vmlDrawingsHF)
+                        {
+                            rel = _vmlDrawingsHF.Part.CreateRelationship(PackUriHelper.GetRelativeUri(_vmlDrawingsHF.Uri, draw.ImageUri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/image");
+                            draw.RelId = rel.Id;
+                        }
+                    }
+                    _vmlDrawingsHF.VmlDrawingXml.Save(_vmlDrawingsHF.Part.GetStream());
+                }
+            }
+        }
+		private string GetText(ExcelHeaderFooterText headerFooter)
+		{
+			string ret = "";
+			if (headerFooter.LeftAlignedText != null)
+				ret += "&L" + headerFooter.LeftAlignedText;
+			if (headerFooter.CenteredText != null)
+				ret += "&C" + headerFooter.CenteredText;
+			if (headerFooter.RightAlignedText != null)
+				ret += "&R" + headerFooter.RightAlignedText;
+			return ret;
+		}
+		#endregion
+	}
+	#endregion
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelHyperLink.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelHyperLink.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelHyperLink.cs	(revision 9616)
@@ -0,0 +1,162 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added this class		        2010-01-24
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// HyperlinkClass
+    /// </summary>
+    public class ExcelHyperLink : Uri
+    {
+        /// <summary>
+        /// A new hyperlink with the specified URI
+        /// </summary>
+        /// <param name="uriString">The URI</param>
+        public ExcelHyperLink(string uriString) :
+            base(uriString)
+        {
+            OriginalUri = (Uri)this;
+        }
+        /// <summary>
+        /// A new hyperlink with the specified URI. This syntax is obsolete
+        /// </summary>
+        /// <param name="uriString">The URI</param>
+        /// <param name="dontEscape"></param>
+        [Obsolete("base constructor 'System.Uri.Uri(string, bool)' is obsolete: 'The constructor has been deprecated. Please use new ExcelHyperLink(string). The dontEscape parameter is deprecated and is always false.")]
+        public ExcelHyperLink(string uriString, bool dontEscape) :
+            base(uriString, dontEscape)
+        {
+            OriginalUri = (Uri)this;
+        }
+        /// <summary>
+        /// A new hyperlink with the specified URI and kind
+        /// </summary>
+        /// <param name="uriString">The URI</param>
+        /// <param name="uriKind">Kind (absolute/relative or indeterminate)</param>
+        public ExcelHyperLink(string uriString, UriKind uriKind) :
+            base(uriString, uriKind)
+        {
+            OriginalUri = (Uri)this;
+        }
+        /// <summary>
+        /// Sheet internal reference
+        /// </summary>
+        /// <param name="referenceAddress">Address</param>
+        /// <param name="display">Displayed text</param>
+        public ExcelHyperLink(string referenceAddress, string display) :
+            base("xl://internal")   //URI is not used on internal links so put a dummy uri here.
+        {
+            _referenceAddress = referenceAddress;
+            _display = display;
+        }
+        string _referenceAddress = null;
+        /// <summary>
+        /// The Excel address for internal links.
+        /// </summary>
+        public string ReferenceAddress
+        {
+            get
+            {
+                return _referenceAddress;
+            }
+            set
+            {
+                _referenceAddress = value;
+            }
+        }
+        string _display = "";
+        /// <summary>
+        /// Displayed text
+        /// </summary>
+        public string Display
+        {
+            get
+            {
+                return _display;
+            }
+            set
+            {
+                _display = value;
+            }
+        }
+        /// <summary>
+        /// Tooltip
+        /// </summary>
+        public string ToolTip
+        {
+            get;
+            set;
+        }
+        int _colSpann = 0;
+        /// <summary>
+        /// If the hyperlink spans multiple columns
+        /// </summary>
+        public int ColSpann
+        {
+            get
+            {
+                return _colSpann;
+            }
+            set
+            {
+                _colSpann = value;
+            }
+        }
+        int _rowSpann = 0;
+        /// <summary>
+        /// If the hyperlink spans multiple rows
+        /// </summary>
+        public int RowSpann
+        {
+            get
+            {
+                return _rowSpann;
+            }
+            set
+            {
+                _rowSpann = value;
+            }
+        }
+        /// <summary>
+        /// Used to handle non absolute URI's. 
+        /// Is used if IsAblsoluteUri is true. The base URI will have a dummy value of xl://nonAbsolute.
+        /// </summary>
+        public Uri OriginalUri
+        {
+            get;
+            internal set;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelNamedRange.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelNamedRange.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelNamedRange.cs	(revision 9616)
@@ -0,0 +1,113 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added this class		        2010-01-28
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// A named range. 
+    /// </summary>
+    public sealed class ExcelNamedRange : ExcelRangeBase 
+    {
+        ExcelWorksheet _sheet;
+        /// <summary>
+        /// A named range
+        /// </summary>
+        /// <param name="name">The name</param>
+        /// <param name="nameSheet">The sheet containing the name. null if its a global name</param>
+        /// <param name="sheet">Sheet where the address points</param>
+        /// <param name="address">The address</param>
+        public ExcelNamedRange(string name, ExcelWorksheet nameSheet , ExcelWorksheet sheet, string address) :
+            base(sheet, address)
+        {
+            Name = name;
+            _sheet = nameSheet;
+
+        }
+        internal ExcelNamedRange(string name,ExcelWorkbook wb, ExcelWorksheet nameSheet) :
+            base(wb, nameSheet, name, true)
+        {
+            Name = name;
+            _sheet = nameSheet;
+        }
+
+        /// <summary>
+        /// Name of the range
+        /// </summary>
+        public string Name
+        {
+            get;
+            internal set;
+        }
+        /// <summary>
+        /// Is the named range local for the sheet 
+        /// </summary>
+        public int LocalSheetId
+        {
+            get
+            {
+                if (_sheet == null)
+                {
+                    return -1;
+                }
+                else
+                {
+                    return _sheet.PositionID-1;
+                }
+            }
+        }        
+        /// <summary>
+        /// Is the name hidden
+        /// </summary>
+        public bool IsNameHidden
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// A comment for the Name
+        /// </summary>
+        public string NameComment
+        {
+            get;
+            set;
+        }
+        internal object NameValue { get; set; }
+        internal string NameFormula { get; set; }
+        public override string ToString()
+        {
+            return Name;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelNamedRangeCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelNamedRangeCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelNamedRangeCollection.cs	(revision 9616)
@@ -0,0 +1,186 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added this class		        2010-01-28
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Collections;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Collection for named ranges
+    /// </summary>
+    public class ExcelNamedRangeCollection : IEnumerable<ExcelNamedRange>
+    {
+        internal ExcelWorksheet _ws;
+        internal ExcelWorkbook _wb;
+        internal ExcelNamedRangeCollection(ExcelWorkbook wb)
+        {
+            _wb = wb;
+            _ws = null;
+        }
+        internal ExcelNamedRangeCollection(ExcelWorkbook wb, ExcelWorksheet ws)
+        {
+            _wb = wb;
+            _ws = ws;
+        }
+        Dictionary<string, ExcelNamedRange> _dic = new Dictionary<string, ExcelNamedRange>();
+        /// <summary>
+        /// Add a new named range
+        /// </summary>
+        /// <param name="Name">The name</param>
+        /// <param name="Range">The range</param>
+        /// <returns></returns>
+        public ExcelNamedRange Add(string Name, ExcelRangeBase Range)
+        {
+            ExcelNamedRange item;
+            if (Range.IsName)
+            {
+
+                item = new ExcelNamedRange(Name, _wb,_ws);
+            }
+            else
+            {
+                item = new ExcelNamedRange(Name, _ws, Range.Worksheet, Range.Address);
+            }
+            
+            _dic.Add(Name.ToLower(), item);
+            return item;
+        }
+        /// <summary>
+        /// Add a defined name referencing value
+        /// </summary>
+        /// <param name="Name"></param>
+        /// <param name="value"></param>
+        /// <returns></returns>
+        public ExcelNamedRange AddValue(string Name, object value)
+        {
+            var item = new ExcelNamedRange(Name,_wb, _ws);
+            item.NameValue = value;
+            _dic.Add(Name.ToLower(), item);
+            return item;
+        }
+        /// <summary>
+        /// Add a defined name referencing a formula -- the method name contains a typo.
+        /// This method is obsolete and will be removed in the future.
+        /// Use <see cref="AddFormula"/>
+        /// </summary>
+        /// <param name="Name"></param>
+        /// <param name="Formula"></param>
+        /// <returns></returns>
+        [Obsolete("Call AddFormula() instead.  See Issue Tracker Id #14687")]
+        public ExcelNamedRange AddFormla(string Name, string Formula)
+        {
+            return  this.AddFormula(Name, Formula);
+        }
+
+        /// <summary>
+        /// Add a defined name referencing a formula
+        /// </summary>
+        /// <param name="Name"></param>
+        /// <param name="Formula"></param>
+        /// <returns></returns>
+        public ExcelNamedRange AddFormula(string Name, string Formula)
+        {
+            var item = new ExcelNamedRange(Name, _wb, _ws);
+            item.NameFormula = Formula;
+            _dic.Add(Name.ToLower(), item);
+            return item;
+        }
+        /// <summary>
+        /// Remove a defined name from the collection
+        /// </summary>
+        /// <param name="Name">The name</param>
+        public void Remove(string Name)
+        {
+            _dic.Remove(Name.ToLower());
+        }
+        /// <summary>
+        /// Checks collection for the presence of a key
+        /// </summary>
+        /// <param name="key">key to search for</param>
+        /// <returns>true if the key is in the collection</returns>
+        public bool ContainsKey(string key)
+        {
+            return _dic.ContainsKey(key.ToLower());
+        }
+        /// <summary>
+        /// The current number of items in the collection
+        /// </summary>
+        public int Count
+        {
+            get
+            {
+                return _dic.Count;
+            }
+        }
+        /// <summary>
+        /// Name indexer
+        /// </summary>
+        /// <param name="Name">The name (key) for a Named range</param>
+        /// <returns>a reference to the range</returns>
+        /// <remarks>
+        /// Throws a KeyNotFoundException if the key is not in the collection.
+        /// </remarks>
+        public ExcelNamedRange this[string Name]
+        {
+            get
+            {
+                return _dic[Name.ToLower()];
+            }
+        }
+
+        #region "IEnumerable"
+        #region IEnumerable<ExcelNamedRange> Members
+        /// <summary>
+        /// Implement interface method IEnumerator&lt;ExcelNamedRange&gt; GetEnumerator()
+        /// </summary>
+        /// <returns></returns>
+        public IEnumerator<ExcelNamedRange> GetEnumerator()
+        {
+            return _dic.Values.GetEnumerator();
+        }
+        #endregion
+        #region IEnumerable Members
+        /// <summary>
+        /// Implement interface method IEnumeratable GetEnumerator()
+        /// </summary>
+        /// <returns></returns>
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return _dic.Values.GetEnumerator();
+        }
+
+        #endregion
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelPackage.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelPackage.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelPackage.cs	(revision 9616)
@@ -0,0 +1,1059 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Starnuto Di Topo & Jan Källman   Added stream constructors 
+ *                                  and Load method Save as 
+ *                                  stream                      2010-03-14
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Xml;
+using System.IO;
+using System.IO.Packaging;
+using System.Collections.Generic;
+using System.Security.Cryptography;
+using OfficeOpenXml.Drawing;
+using OfficeOpenXml.Utils;
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Represents an Excel 2007/2010 XLSX file package.  
+    /// This is the top-level object to access all parts of the document.
+    /// <code>
+	///     FileInfo newFile = new FileInfo(outputDir.FullName + @"\sample1.xlsx");
+	/// 	if (newFile.Exists)
+	/// 	{
+	/// 		newFile.Delete();  // ensures we create a new workbook
+	/// 		newFile = new FileInfo(outputDir.FullName + @"\sample1.xlsx");
+	/// 	}
+	/// 	using (ExcelPackage package = new ExcelPackage(newFile))
+    ///     {
+    ///         // add a new worksheet to the empty workbook
+    ///         ExcelWorksheet worksheet = package.Workbook.Worksheets.Add("Inventory");
+    ///         //Add the headers
+    ///         worksheet.Cells[1, 1].Value = "ID";
+    ///         worksheet.Cells[1, 2].Value = "Product";
+    ///         worksheet.Cells[1, 3].Value = "Quantity";
+    ///         worksheet.Cells[1, 4].Value = "Price";
+    ///         worksheet.Cells[1, 5].Value = "Value";
+    ///
+    ///         //Add some items...
+    ///         worksheet.Cells["A2"].Value = "12001";
+    ///         worksheet.Cells["B2"].Value = "Nails";
+    ///         worksheet.Cells["C2"].Value = 37;
+    ///         worksheet.Cells["D2"].Value = 3.99;
+    ///
+    ///         worksheet.Cells["A3"].Value = "12002";
+    ///         worksheet.Cells["B3"].Value = "Hammer";
+    ///         worksheet.Cells["C3"].Value = 5;
+    ///         worksheet.Cells["D3"].Value = 12.10;
+    ///
+    ///         worksheet.Cells["A4"].Value = "12003";
+    ///         worksheet.Cells["B4"].Value = "Saw";
+    ///         worksheet.Cells["C4"].Value = 12;
+    ///         worksheet.Cells["D4"].Value = 15.37;
+    ///
+    ///         //Add a formula for the value-column
+    ///         worksheet.Cells["E2:E4"].Formula = "C2*D2";
+    ///
+    ///            //Ok now format the values;
+    ///         using (var range = worksheet.Cells[1, 1, 1, 5]) 
+    ///          {
+    ///             range.Style.Font.Bold = true;
+    ///             range.Style.Fill.PatternType = ExcelFillStyle.Solid;
+    ///             range.Style.Fill.BackgroundColor.SetColor(Color.DarkBlue);
+    ///             range.Style.Font.Color.SetColor(Color.White);
+    ///         }
+    ///
+    ///         worksheet.Cells["A5:E5"].Style.Border.Top.Style = ExcelBorderStyle.Thin;
+    ///         worksheet.Cells["A5:E5"].Style.Font.Bold = true;
+    ///
+    ///         worksheet.Cells[5, 3, 5, 5].Formula = string.Format("SUBTOTAL(9,{0})", new ExcelAddress(2,3,4,3).Address);
+    ///         worksheet.Cells["C2:C5"].Style.Numberformat.Format = "#,##0";
+    ///         worksheet.Cells["D2:E5"].Style.Numberformat.Format = "#,##0.00";
+    ///
+    ///         //Create an autofilter for the range
+    ///         worksheet.Cells["A1:E4"].AutoFilter = true;
+    ///
+    ///         worksheet.Cells["A1:E5"].AutoFitColumns(0);
+    ///
+    ///         // lets set the header text 
+    ///         worksheet.HeaderFooter.oddHeader.CenteredText = "&amp;24&amp;U&amp;\"Arial,Regular Bold\" Inventory";
+    ///         // add the page number to the footer plus the total number of pages
+    ///         worksheet.HeaderFooter.oddFooter.RightAlignedText =
+    ///         string.Format("Page {0} of {1}", ExcelHeaderFooter.PageNumber, ExcelHeaderFooter.NumberOfPages);
+    ///         // add the sheet name to the footer
+    ///         worksheet.HeaderFooter.oddFooter.CenteredText = ExcelHeaderFooter.SheetName;
+    ///         // add the file path to the footer
+    ///         worksheet.HeaderFooter.oddFooter.LeftAlignedText = ExcelHeaderFooter.FilePath + ExcelHeaderFooter.FileName;
+    ///
+    ///         worksheet.PrinterSettings.RepeatRows = worksheet.Cells["1:2"];
+    ///         worksheet.PrinterSettings.RepeatColumns = worksheet.Cells["A:G"];
+    ///
+    ///          // Change the sheet view to show it in page layout mode
+    ///           worksheet.View.PageLayoutView = true;
+    ///
+    ///         // set some document properties
+    ///         package.Workbook.Properties.Title = "Invertory";
+    ///         package.Workbook.Properties.Author = "Jan Källman";
+    ///         package.Workbook.Properties.Comments = "This sample demonstrates how to create an Excel 2007 workbook using EPPlus";
+    ///
+    ///         // set some extended property values
+    ///         package.Workbook.Properties.Company = "AdventureWorks Inc.";
+    ///
+    ///         // set some custom property values
+    ///         package.Workbook.Properties.SetCustomPropertyValue("Checked by", "Jan Källman");
+    ///         package.Workbook.Properties.SetCustomPropertyValue("AssemblyName", "EPPlus");
+    ///
+    ///         // save our new workbook and we are done!
+    ///         package.Save();
+    ///
+    ///       }
+    ///
+    ///       return newFile.FullName;
+    /// </code>
+    /// More samples can be found at  <a href="http://epplus.codeplex.com/">http://epplus.codeplex.com/</a>
+    /// </summary>
+	public sealed class ExcelPackage : IDisposable
+	{
+        internal const bool preserveWhitespace=false;
+        Stream _stream = null;
+        internal class ImageInfo
+        {
+            internal string Hash { get; set; }
+            internal Uri Uri{get;set;}
+            internal int RefCount { get; set; }
+            internal PackagePart Part { get; set; }
+        }
+        internal Dictionary<string, ImageInfo> _images = new Dictionary<string, ImageInfo>();
+		#region Properties
+		/// <summary>
+		/// Main Xml schema name
+		/// </summary>
+		internal const string schemaMain = @"http://schemas.openxmlformats.org/spreadsheetml/2006/main";
+		/// <summary>
+		/// Relationship schema name
+		/// </summary>
+		internal const string schemaRelationships = @"http://schemas.openxmlformats.org/officeDocument/2006/relationships";
+                                                                              
+        internal const string schemaDrawings = @"http://schemas.openxmlformats.org/drawingml/2006/main";
+        internal const string schemaSheetDrawings = @"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing";
+        
+        internal const string schemaMicrosoftVml = @"urn:schemas-microsoft-com:vml";
+        internal const string schemaMicrosoftOffice = "urn:schemas-microsoft-com:office:office";
+        internal const string schemaMicrosoftExcel = "urn:schemas-microsoft-com:office:excel";
+
+        internal const string schemaChart = @"http://schemas.openxmlformats.org/drawingml/2006/chart";                                                        
+        internal const string schemaHyperlink = @"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
+        internal const string schemaComment = @"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments";
+        internal const string schemaImage = @"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
+        //Office properties
+        internal const string schemaCore = @"http://schemas.openxmlformats.org/package/2006/metadata/core-properties";
+        internal const string schemaExtended = @"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties";
+        internal const string schemaCustom = @"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties";
+        internal const string schemaDc = @"http://purl.org/dc/elements/1.1/";
+        internal const string schemaDcTerms = @"http://purl.org/dc/terms/";
+        internal const string schemaDcmiType = @"http://purl.org/dc/dcmitype/";
+        internal const string schemaXsi = @"http://www.w3.org/2001/XMLSchema-instance";
+        internal const string schemaVt = @"http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes";
+
+        //Pivottables
+        internal const string schemaPivotTable = @"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml";
+        internal const string schemaPivotCacheDefinition = @"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml";
+        internal const string schemaPivotCacheRecords = @"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml";
+
+        //VBA
+        internal const string schemaVBA = @"application/vnd.ms-office.vbaProject";
+        internal const string schemaVBASignature = @"application/vnd.ms-office.vbaProjectSignature";
+
+        internal const string contentTypeWorkbookDefault = @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml";
+        internal const string contentTypeWorkbookMacroEnabled = "application/vnd.ms-excel.sheet.macroEnabled.main+xml";
+        //Package reference
+        private Package _package;
+		private ExcelWorkbook _workbook;
+        /// <summary>
+        /// Maximum number of columns in a worksheet (16384). 
+        /// </summary>
+        public const int MaxColumns = 16384;
+        /// <summary>
+        /// Maximum number of rows in a worksheet (1048576). 
+        /// </summary>
+        public const int MaxRows = 1048576;
+		#endregion
+
+		#region ExcelPackage Constructors
+        /// <summary>
+        /// Create a new instance of the ExcelPackage. Output is accessed through the Stream property.
+        /// </summary>
+        public ExcelPackage()
+        {
+            Init();
+            ConstructNewFile(new MemoryStream(), null);
+        }
+        /// <summary>
+		/// Create a new instance of the ExcelPackage class based on a existing file or creates a new file. 
+		/// </summary>
+		/// <param name="newFile">If newFile exists, it is opened.  Otherwise it is created from scratch.</param>
+        public ExcelPackage(FileInfo newFile)
+		{
+            Init();
+            File = newFile;
+            ConstructNewFile(new MemoryStream(), null);
+        }
+        /// <summary>
+        /// Create a new instance of the ExcelPackage class based on a existing file or creates a new file. 
+        /// </summary>
+        /// <param name="newFile">If newFile exists, it is opened.  Otherwise it is created from scratch.</param>
+        /// <param name="password">Password for an encrypted package</param>
+        public ExcelPackage(FileInfo newFile, string password)
+        {
+            Init();
+            File = newFile;
+            ConstructNewFile(new MemoryStream(), password);
+        }
+		/// <summary>
+		/// Create a new instance of the ExcelPackage class based on a existing template.
+		/// If newFile exists, it will be overwritten when the Save method is called
+		/// </summary>
+		/// <param name="newFile">The name of the Excel file to be created</param>
+		/// <param name="template">The name of the Excel template to use as the basis of the new Excel file</param>
+		public ExcelPackage(FileInfo newFile, FileInfo template)
+		{
+            Init();
+            File = newFile;
+            CreateFromTemplate(template, null);
+		}
+        /// <summary>
+        /// Create a new instance of the ExcelPackage class based on a existing template.
+        /// If newFile exists, it will be overwritten when the Save method is called
+        /// </summary>
+        /// <param name="newFile">The name of the Excel file to be created</param>
+        /// <param name="template">The name of the Excel template to use as the basis of the new Excel file</param>
+        /// <param name="password">Password to decrypted the template</param>
+        public ExcelPackage(FileInfo newFile, FileInfo template, string password)
+        {
+            Init();
+            File = newFile;
+            CreateFromTemplate(template, password);
+        }
+        /// <summary>
+        /// Create a new instance of the ExcelPackage class based on a existing template.
+        /// </summary>
+        /// <param name="template">The name of the Excel template to use as the basis of the new Excel file</param>
+        /// <param name="useStream">if true use a stream. If false create a file in the temp dir with a random name</param>
+        public ExcelPackage(FileInfo template, bool useStream)
+        {
+            Init();
+            CreateFromTemplate(template, null);
+            if (useStream == false)
+            {
+                File = new FileInfo(Path.GetTempPath() + Guid.NewGuid().ToString() + ".xlsx");
+            }
+        }
+        /// <summary>
+        /// Create a new instance of the ExcelPackage class based on a existing template.
+        /// </summary>
+        /// <param name="template">The name of the Excel template to use as the basis of the new Excel file</param>
+        /// <param name="useStream">if true use a stream. If false create a file in the temp dir with a random name</param>
+        /// <param name="password">Password to decrypted the template</param>
+        public ExcelPackage(FileInfo template, bool useStream, string password)
+        {
+            Init();
+            CreateFromTemplate(template, password);
+            if (useStream == false)
+            {
+                File = new FileInfo(Path.GetTempPath() + Guid.NewGuid().ToString() + ".xlsx");
+            }
+        }
+        /// <summary>
+        /// Create a new instance of the ExcelPackage class based on a stream
+        /// </summary>
+        /// <param name="newStream">The stream object can be empty or contain a package. The stream must be Read/Write</param>
+        public ExcelPackage(Stream newStream) 
+        {
+            Init();
+            if (newStream.Length == 0)
+            {
+                ConstructNewFile(newStream, null);
+            }
+            else
+            {
+                Load(newStream);
+            }
+        }
+        /// <summary>
+        /// Create a new instance of the ExcelPackage class based on a stream
+        /// </summary>
+        /// <param name="newStream">The stream object can be empty or contain a package. The stream must be Read/Write</param>
+        /// <param name="Password">The password to decrypt the document</param>
+        public ExcelPackage(Stream newStream, string Password)
+        {
+            if (!(newStream.CanRead && newStream.CanWrite))
+            {
+                throw new Exception("The stream must be read/write");
+            }
+
+            Init();
+            if (newStream.Length > 0)
+            {
+                Load(newStream,Password);
+            }
+            else
+            {
+                _stream = newStream;
+                _package = Package.Open(_stream, FileMode.Create, FileAccess.ReadWrite);
+                CreateBlankWb();
+            }
+        }
+        /// <summary>
+        /// Create a new instance of the ExcelPackage class based on a stream
+        /// </summary>
+        /// <param name="newStream">The output stream. Must be an empty read/write stream.</param>
+        /// <param name="templateStream">This stream is copied to the output stream at load</param>
+        public ExcelPackage(Stream newStream, Stream templateStream)
+        {
+            if (newStream.Length > 0)
+            {
+                throw(new Exception("The output stream must be empty. Length > 0"));
+            }
+            else if (!(newStream.CanRead && newStream.CanWrite))
+            {
+                throw new Exception("The stream must be read/write");
+            }
+            Init();
+            Load(templateStream, newStream, null);
+        }
+        /// <summary>
+        /// Create a new instance of the ExcelPackage class based on a stream
+        /// </summary>
+        /// <param name="newStream">The output stream. Must be an empty read/write stream.</param>
+        /// <param name="templateStream">This stream is copied to the output stream at load</param>
+        /// <param name="Password">Password to decrypted the template</param>
+        public ExcelPackage(Stream newStream, Stream templateStream, string Password)
+        {
+            if (newStream.Length > 0)
+            {
+                throw (new Exception("The output stream must be empty. Length > 0"));
+            }
+            else if (!(newStream.CanRead && newStream.CanWrite))
+            {
+                throw new Exception("The stream must be read/write");
+            }
+            Init();
+            Load(templateStream, newStream, Password);
+        }
+        #endregion
+        internal ImageInfo AddImage(byte[] image)
+        {
+            return AddImage(image, null, "");
+        }
+        internal ImageInfo AddImage(byte[] image, Uri uri, string contentType)
+        {
+            var hashProvider = new SHA1CryptoServiceProvider();
+            var hash = BitConverter.ToString(hashProvider.ComputeHash(image)).Replace("-","");
+            lock (_images)
+            {
+                if (_images.ContainsKey(hash))
+                {
+                    _images[hash].RefCount++;
+                }
+                else
+                {
+                    PackagePart imagePart;
+                    if (uri == null)
+                    {
+                        uri = GetNewUri(Package, "/xl/media/image{0}.jpg");
+                        imagePart = Package.CreatePart(uri, "image/jpeg", CompressionOption.NotCompressed);
+                    }
+                    else
+                    {
+                        imagePart = Package.CreatePart(uri, contentType, CompressionOption.NotCompressed);
+                    }
+                    var stream = imagePart.GetStream(FileMode.Create, FileAccess.Write);
+                    stream.Write(image, 0, image.GetLength(0));
+
+                    _images.Add(hash, new ImageInfo() { Uri = uri, RefCount = 1, Hash = hash, Part = imagePart });
+                }
+            }
+            return _images[hash];
+        }
+        internal ImageInfo LoadImage(byte[] image, Uri uri, PackagePart imagePart)
+        {
+            var hashProvider = new SHA1CryptoServiceProvider();
+            var hash = BitConverter.ToString(hashProvider.ComputeHash(image)).Replace("-", "");
+            if (_images.ContainsKey(hash))
+            {
+                _images[hash].RefCount++;
+            }
+            else
+            {
+                _images.Add(hash, new ImageInfo() { Uri = uri, RefCount = 1, Hash = hash, Part = imagePart });
+            }
+            return _images[hash];
+        }
+        internal void RemoveImage(string hash)
+        {
+            lock (_images)
+            {
+                if (_images.ContainsKey(hash))
+                {
+                    var ii = _images[hash];
+                    ii.RefCount--;
+                    if (ii.RefCount == 0)
+                    {
+                        Package.DeletePart(ii.Uri);
+                        _images.Remove(hash);
+                    }
+                }
+            }
+        }
+        internal ImageInfo GetImageInfo(byte[] image)
+        {
+            var hashProvider = new SHA1CryptoServiceProvider();
+            var hash = BitConverter.ToString(hashProvider.ComputeHash(image)).Replace("-","");
+
+            if (_images.ContainsKey(hash))
+            {
+                return _images[hash];
+            }
+            else
+            {
+                return null;
+            }
+        }
+        private Uri GetNewUri(Package package, string sUri)
+        {
+            int id = 1;
+            Uri uri;
+            do
+            {
+                uri = new Uri(string.Format(sUri, id++), UriKind.Relative);
+            }
+            while (package.PartExists(uri));
+            return uri;
+        }
+        /// <summary>
+        /// Init values here
+        /// </summary>
+        private void Init()
+        {
+            Compression = CompressionOption.Normal;
+            DoAdjustDrawings = true;
+        }
+        /// <summary>
+        /// Create a new file from a template
+        /// </summary>
+        /// <param name="template">An existing xlsx file to use as a template</param>
+        /// <param name="password">The password to decrypt the package.</param>
+        /// <returns></returns>
+        private void CreateFromTemplate(FileInfo template, string password)
+        {
+            if (template != null) template.Refresh();
+            if (template.Exists)
+            {
+                _stream = new MemoryStream();
+                if (password != null)
+                {
+                    Encryption.IsEncrypted = true;
+                    Encryption.Password = password;
+                    var encrHandler = new EncryptedPackageHandler();
+                    _stream = encrHandler.DecryptPackage(template, Encryption);
+                    encrHandler = null;
+                    //throw (new NotImplementedException("No support for Encrypted packages in this version"));
+                }
+                else
+                {
+                    byte[] b = System.IO.File.ReadAllBytes(template.FullName);
+                    _stream.Write(b, 0, b.Length);
+                }
+                try
+                {
+                    _package = Package.Open(_stream, FileMode.Open, FileAccess.ReadWrite);
+                }
+                catch (Exception ex)
+                {
+                    if (password == null && EncryptedPackageHandler.IsStorageFile(template.FullName)==0)
+                    {
+                        throw new Exception("Can not open the package. Package is an OLE compound document. If this is an encrypted package, please supply the password", ex);
+                    }
+                    else
+                    {
+                        throw (ex);
+                    }
+                }
+            }
+            else
+                throw new Exception("Passed invalid TemplatePath to Excel Template");
+            //return newFile;
+        }
+        private void ConstructNewFile(Stream stream, string password)
+        {
+            _stream = stream;
+            if (File != null) File.Refresh();
+            if (File != null && File.Exists)
+            {
+                if (password != null)
+                {
+                    var encrHandler = new EncryptedPackageHandler();
+                    Encryption.IsEncrypted = true;
+                    Encryption.Password = password;
+                    _stream = encrHandler.DecryptPackage(File, Encryption);
+                    encrHandler = null;
+                }
+                else
+                {
+                    ReadFile();
+                }
+                try
+                {
+                    _package = Package.Open(_stream, FileMode.Open, FileAccess.ReadWrite);
+                }
+                catch (Exception ex)
+               {
+                   if (password == null && EncryptedPackageHandler.IsStorageFile(File.FullName) == 0)
+                   {
+                       throw new Exception("Can not open the package. Package is an OLE compound document. If this is an encrypted package, please supply the password", ex);
+                   }
+                   else
+                   {
+                       throw (ex);
+                   }
+                }
+            }
+            else
+            {
+                _package = Package.Open(_stream, FileMode.Create, FileAccess.ReadWrite);
+                CreateBlankWb();
+            }
+        }
+
+        private void ReadFile()
+        {
+            byte[] b = System.IO.File.ReadAllBytes(File.FullName);
+            _stream.Write(b, 0, b.Length);
+        }
+        private void CreateBlankWb()
+        {
+            XmlDocument workbook = Workbook.WorkbookXml; // this will create the workbook xml in the package
+            // create the relationship to the main part
+            _package.CreateRelationship(PackUriHelper.GetRelativeUri(new Uri("/xl", UriKind.Relative), Workbook.WorkbookUri), TargetMode.Internal, schemaRelationships + "/officeDocument");
+        }
+
+		/// <summary>
+		/// Returns a reference to the package
+		/// </summary>
+		public Package Package { get { return (_package); } }
+        ExcelEncryption _encryption=null;
+        /// <summary>
+        /// Information how and if the package is encrypted
+        /// </summary>
+        public ExcelEncryption Encryption
+        {
+            get
+            {
+                if (_encryption == null)
+                {
+                    _encryption = new ExcelEncryption();
+                }
+                return _encryption;
+            }
+        }
+		/// <summary>
+		/// Returns a reference to the workbook component within the package.
+		/// All worksheets and cells can be accessed through the workbook.
+		/// </summary>
+		public ExcelWorkbook Workbook
+		{
+			get
+			{
+                if (_workbook == null)
+                {
+                    var nsm = CreateDefaultNSM();
+
+                    _workbook = new ExcelWorkbook(this, nsm);
+
+                    _workbook.GetExternalReferences();
+                    _workbook.GetDefinedNames();
+
+                }
+                return (_workbook);
+			}
+		}
+        /// <summary>
+        /// Automaticlly adjust drawing size when column width/row height are adjusted, depending on the drawings editBy property.
+        /// Default True
+        /// </summary>
+        public bool DoAdjustDrawings
+        {
+            get;
+            set;
+        }
+        private XmlNamespaceManager CreateDefaultNSM()
+        {
+            //  Create a NamespaceManager to handle the default namespace, 
+            //  and create a prefix for the default namespace:
+            NameTable nt = new NameTable();
+            var ns = new XmlNamespaceManager(nt);
+            ns.AddNamespace(string.Empty, ExcelPackage.schemaMain);
+            ns.AddNamespace("d", ExcelPackage.schemaMain);
+            ns.AddNamespace("r", ExcelPackage.schemaRelationships);
+            ns.AddNamespace("c", ExcelPackage.schemaChart);
+            ns.AddNamespace("vt", schemaVt);
+            // extended properties (app.xml)
+            ns.AddNamespace("xp", schemaExtended);
+            // custom properties
+            ns.AddNamespace("ctp", schemaCustom);
+            // core properties
+            ns.AddNamespace("cp", schemaCore);
+            // core property namespaces 
+            ns.AddNamespace("dc", schemaDc);
+            ns.AddNamespace("dcterms", schemaDcTerms);
+            ns.AddNamespace("dcmitype", schemaDcmiType);
+            ns.AddNamespace("xsi", schemaXsi);
+            return ns;
+        }
+		
+		#region SavePart
+		/// <summary>
+		/// Saves the XmlDocument into the package at the specified Uri.
+		/// </summary>
+		/// <param name="uri">The Uri of the component</param>
+		/// <param name="xmlDoc">The XmlDocument to save</param>
+		internal void SavePart(Uri uri, XmlDocument xmlDoc)
+		{
+            PackagePart part = _package.GetPart(uri);
+			xmlDoc.Save(part.GetStream(FileMode.Create, FileAccess.Write));
+		}
+        /// <summary>
+		/// Saves the XmlDocument into the package at the specified Uri.
+		/// </summary>
+		/// <param name="uri">The Uri of the component</param>
+		/// <param name="xmlDoc">The XmlDocument to save</param>
+        internal void SaveWorkbook(Uri uri, XmlDocument xmlDoc)
+		{
+            PackagePart part = _package.GetPart(uri);
+            if(Workbook.VbaProject==null)
+            {
+                if (part.ContentType != contentTypeWorkbookDefault)
+                {
+                    part = _package.CreatePart(uri, contentTypeWorkbookDefault, Compression);
+                }
+            }
+            else
+            {
+                if (part.ContentType != contentTypeWorkbookMacroEnabled)
+                {
+                    var rels = part.GetRelationships();
+                    _package.DeletePart(uri);
+                    part = Package.CreatePart(uri, contentTypeWorkbookMacroEnabled);
+                    foreach (var rel in rels)
+                    {
+                        Package.DeleteRelationship(rel.Id);
+                        part.CreateRelationship(rel.TargetUri, rel.TargetMode, rel.RelationshipType);
+                    }
+                }
+            }
+			xmlDoc.Save(part.GetStream(FileMode.Create, FileAccess.Write));
+		}
+
+        #endregion
+
+		#region Dispose
+		/// <summary>
+		/// Closes the package.
+		/// </summary>
+		public void Dispose()
+		{
+            if (_package != null)
+            {
+                _package.Close();
+            }
+		}
+		#endregion
+
+		#region Save  // ExcelPackage save
+        /// <summary>
+        /// Saves all the components back into the package.
+        /// This method recursively calls the Save method on all sub-components.
+        /// We close the package after the save is done.
+        /// </summary>
+        public void Save()
+        {
+            try
+            {
+                Workbook.Save();
+                if (File == null)
+                {
+                    _package.Close();
+                }
+                else
+                {
+                    if (System.IO.File.Exists(File.FullName))
+                    {
+                        try
+                        {
+                            System.IO.File.Delete(File.FullName);
+                        }
+                        catch (Exception ex)
+                        {
+                            throw (new Exception(string.Format("Error overwriting file {0}", File.FullName), ex));
+                        }
+                    }
+                    if (Stream is MemoryStream)
+                    {
+                        _package.Close();
+                        var fi = new FileStream(File.FullName, FileMode.Create);
+                        //EncryptPackage
+                        if (Encryption.IsEncrypted)
+                        {
+                            byte[] file = ((MemoryStream)Stream).ToArray();
+                            EncryptedPackageHandler eph = new EncryptedPackageHandler();
+                            var ms = eph.EncryptPackage(file, Encryption);
+
+                            fi.Write(ms.GetBuffer(), 0, (int)ms.Length);
+                            ms.Close();
+                        }
+                        else
+                        {
+                            fi.Write(((MemoryStream)Stream).GetBuffer(), 0, (int)Stream.Length);
+                            Stream.Close();
+                        }
+                        fi.Close();
+                    }
+                    else
+                    {
+                        System.IO.File.WriteAllBytes(File.FullName, GetAsByteArray(false));
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                if (File == null)
+                {
+                    throw (ex);
+                }
+                else
+                {
+                    throw (new InvalidOperationException(string.Format("Error saving file {0}", File.FullName), ex));
+                }
+            }
+        }
+        /// <summary>
+        /// Saves all the components back into the package.
+        /// This method recursively calls the Save method on all sub-components.
+        /// The package is closed after it has been saved
+        /// </summary>
+        /// <param name="password">The password to encrypt the workbook with. 
+        /// This parameter overrides the Workbook.Encryption.Password.</param>
+        public void Save(string password)
+		{
+            Encryption.Password = password;
+            Save();
+        }
+        /// <summary>
+        /// Saves the workbook to a new file
+        /// The package is closed after it has been saved
+        /// </summary>
+        public void SaveAs(FileInfo file)
+        {
+            File = file;
+            Save();
+        }
+        /// <summary>
+        /// Saves the workbook to a new file
+        /// The package is closed after it has been saved
+        /// </summary>
+        /// <param name="file">The file</param>
+        /// <param name="password">The password to encrypt the workbook with. 
+        /// This parameter overrides the Encryption.Password.</param>
+        public void SaveAs(FileInfo file, string password)
+        {
+            File = file;
+            Encryption.Password = password;
+            Save();
+        }
+        /// <summary>
+        /// Copies the Package to the Outstream
+        /// The package is closed after it has been saved
+        /// </summary>
+        /// <param name="OutputStream">The stream to copy the package to</param>
+        public void SaveAs(Stream OutputStream)
+        {
+            File = null;
+            Save();
+
+            if (Encryption.IsEncrypted)
+            {
+                //Encrypt Workbook
+                Byte[] file = new byte[Stream.Length];
+                long pos = Stream.Position;
+                Stream.Seek(0, SeekOrigin.Begin);
+                Stream.Read(file, 0, (int)Stream.Length);
+
+                EncryptedPackageHandler eph = new EncryptedPackageHandler();
+                var ms = eph.EncryptPackage(file, Encryption);
+                CopyStream(ms, ref OutputStream);
+            }
+            else
+            {
+                CopyStream(_stream, ref OutputStream);
+            }
+        }
+        /// <summary>
+        /// Copies the Package to the Outstream
+        /// The package is closed after it has been saved
+        /// </summary>
+        /// <param name="OutputStream">The stream to copy the package to</param>
+        /// <param name="password">The password to encrypt the workbook with. 
+        /// This parameter overrides the Encryption.Password.</param>
+        public void SaveAs(Stream OutputStream, string password)
+        {
+            Encryption.Password = password;
+            SaveAs(OutputStream);
+        }
+        FileInfo _file = null;
+
+        /// <summary>
+        /// The output file. Null if no file is used
+        /// </summary>
+        public FileInfo File
+        {
+            get
+            {
+                return _file;
+            }
+            set
+            {
+                _file = value;
+            }
+        }
+        /// <summary>
+        /// The output stream. This stream is the not the encrypted package.
+        /// To get the encrypted package use the SaveAs(stream) method.
+        /// </summary>
+        public Stream Stream
+        {
+            get
+            {
+                return _stream;
+            }
+        }
+		#endregion
+        /// <summary>
+        /// Compression option for the package
+        /// </summary>
+        public CompressionOption Compression { get; set; }
+		#region GetXmlFromUri
+		/// <summary>
+		/// Get the XmlDocument from an URI
+		/// </summary>
+		/// <param name="uri">The Uri to the part</param>
+		/// <returns>The XmlDocument</returns>
+		internal XmlDocument GetXmlFromUri(Uri uri)
+		{
+			XmlDocument xml = new XmlDocument();
+			PackagePart part = _package.GetPart(uri);
+            XmlHelper.LoadXmlSafe(xml, part.GetStream()); 
+			return (xml);
+		}
+		#endregion
+
+        /// <summary>
+        /// Saves and returns the Excel files as a bytearray.
+        /// Note that the package is closed upon save
+        /// </summary>
+        /// <example>      
+        /// Example how to return a document from a Webserver...
+        /// <code> 
+        ///  ExcelPackage package=new ExcelPackage();
+        ///  /**** ... Create the document ****/
+        ///  Byte[] bin = package.GetAsByteArray();
+        ///  Response.ContentType = "Application/vnd.ms-Excel";
+        ///  Response.AddHeader("content-disposition", "attachment;  filename=TheFile.xlsx");
+		///  Response.BinaryWrite(bin);
+        /// </code>
+        /// </example>
+        /// <returns></returns>
+        public byte[] GetAsByteArray()
+        {
+           return GetAsByteArray(true);
+        }
+        /// <summary>
+        /// Saves and returns the Excel files as a bytearray
+        /// Note that the package is closed upon save
+        /// </summary>
+        /// <example>      
+        /// Example how to return a document from a Webserver...
+        /// <code> 
+        ///  ExcelPackage package=new ExcelPackage();
+        ///  /**** ... Create the document ****/
+        ///  Byte[] bin = package.GetAsByteArray();
+        ///  Response.ContentType = "Application/vnd.ms-Excel";
+        ///  Response.AddHeader("content-disposition", "attachment;  filename=TheFile.xlsx");
+        ///  Response.BinaryWrite(bin);
+        /// </code>
+        /// </example>
+        /// <param name="password">The password to encrypt the workbook with. 
+        /// This parameter overrides the Encryption.Password.</param>
+        /// <returns></returns>
+        public byte[] GetAsByteArray(string password)
+        {
+            if (password != null)
+            {
+                Encryption.Password = password;
+            }
+            return GetAsByteArray(true);
+        }
+        internal byte[] GetAsByteArray(bool save)
+        {
+            if(save) Workbook.Save();
+            _package.Close();
+
+            Byte[] byRet = new byte[Stream.Length];
+            long pos = Stream.Position;            
+            Stream.Seek(0, SeekOrigin.Begin);
+            Stream.Read(byRet, 0, (int)Stream.Length);
+
+            //Encrypt Workbook?
+            if (Encryption.IsEncrypted)
+            {
+                EncryptedPackageHandler eph=new EncryptedPackageHandler();
+                var ms = eph.EncryptPackage(byRet, Encryption);
+                byRet = ms.ToArray();
+            }
+
+            Stream.Seek(pos, SeekOrigin.Begin);
+            Stream.Close();
+            return byRet;
+        }
+        /// <summary>
+        /// Loads the specified package data from a stream.
+        /// </summary>
+        /// <param name="input">The input.</param>
+        public void Load(Stream input)
+        {
+            Load(input, new MemoryStream(), null);
+        }
+        /// <summary>
+        /// Loads the specified package data from a stream.
+        /// </summary>
+        /// <param name="input">The input.</param>
+        /// <param name="Password">The password to decrypt the document</param>
+        public void Load(Stream input, string Password)
+        {
+            Load(input, new MemoryStream(), Password);
+        }
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="input"></param>
+        /// <param name="output"></param>
+        /// <param name="Password"></param>
+        private void Load(Stream input, Stream output, string Password)
+        {
+            //Release some resources:
+            if (this._package != null)
+            {
+                this._package.Close();
+                this._package = null;
+            }
+            if (this._stream != null)
+            {
+                this._stream.Close();
+                this._stream.Dispose();
+                this._stream = null;
+            }
+
+            if (Password != null)
+            {
+                Stream encrStream = new MemoryStream();
+                CopyStream(input, ref encrStream);
+                EncryptedPackageHandler eph=new EncryptedPackageHandler();
+                Encryption.Password = Password;
+                this._stream = eph.DecryptPackage((MemoryStream)encrStream, Encryption);
+            }
+            else
+            {
+                this._stream = output;
+                CopyStream(input, ref this._stream);
+            }
+
+            try
+            {
+                this._package = Package.Open(this._stream, FileMode.Open, FileAccess.ReadWrite);
+            }
+            catch (Exception ex)
+            {
+                EncryptedPackageHandler eph = new EncryptedPackageHandler();
+                if (Password == null && EncryptedPackageHandler.IsStorageILockBytes(eph.GetLockbyte((MemoryStream)_stream)) == 0)
+                {
+                    throw new Exception("Can not open the package. Package is an OLE compound document. If this is an encrypted package, please supply the password", ex);
+                }
+                else
+                {
+                    throw (ex);
+                }
+            }
+            
+            //Clear the workbook so that it gets reinitialized next time
+            this._workbook = null;
+        }
+        /// <summary>
+        /// Copies the input stream to the output stream.
+        /// </summary>
+        /// <param name="inputStream">The input stream.</param>
+        /// <param name="outputStream">The output stream.</param>
+        private static void CopyStream(Stream inputStream, ref Stream outputStream)
+        {
+            if (!inputStream.CanRead)
+            {
+                throw (new Exception("Can not read from inputstream"));
+            }
+            if (!outputStream.CanWrite)
+            {
+                throw (new Exception("Can not write to outputstream"));
+            }
+            if (inputStream.CanSeek)
+            {
+                inputStream.Seek(0, SeekOrigin.Begin);
+            }
+
+            int bufferLength = 8096;
+            Byte[] buffer = new Byte[bufferLength];
+            int bytesRead = inputStream.Read(buffer, 0, bufferLength);
+            // write the required bytes
+            while (bytesRead > 0)
+            {
+                outputStream.Write(buffer, 0, bytesRead);
+                bytesRead = inputStream.Read(buffer, 0, bufferLength);
+            }
+            outputStream.Flush();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelPrinterSettings.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelPrinterSettings.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelPrinterSettings.cs	(revision 9616)
@@ -0,0 +1,839 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		                License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+
+namespace OfficeOpenXml
+{
+    #region "Enums"
+    /// <summary>
+    /// Printer orientation
+    /// </summary>
+    public enum eOrientation
+    {
+        /// <summary>
+        /// Portrait orientation
+        /// </summary>
+        Portrait,
+        /// <summary>
+        /// Landscape orientation
+        /// </summary>
+        Landscape
+    }
+    /// <summary>
+    /// Papersize
+    /// </summary>
+    public enum ePaperSize
+    {
+        /// <summary>
+        /// Letter paper (8.5 in. by 11 in.)
+        /// </summary>
+        Letter= 1,      
+        /// <summary>
+        /// Letter small paper (8.5 in. by 11 in.)
+        /// </summary>
+        LetterSmall=2,  
+        /// <summary>
+        /// // Tabloid paper (11 in. by 17 in.)
+        /// </summary>
+        Tabloid=3,      
+        /// <summary>
+        /// Ledger paper (17 in. by 11 in.)
+        /// </summary>
+        Ledger=4,       
+        /// <summary>
+        /// Legal paper (8.5 in. by 14 in.)
+        /// </summary>
+        Legal=5,         
+        /// <summary>
+        /// Statement paper (5.5 in. by 8.5 in.)
+        /// </summary>
+        Statement=6,    
+        /// <summary>
+        /// Executive paper (7.25 in. by 10.5 in.)
+        /// </summary>
+        Executive=7,     
+        /// <summary>
+        /// A3 paper (297 mm by 420 mm)
+        /// </summary>
+        A3=8,           
+        /// <summary>
+        /// A4 paper (210 mm by 297 mm)
+        /// </summary>
+        A4=9,            
+        /// <summary>
+        /// A4 small paper (210 mm by 297 mm)
+        /// </summary>
+        A4Small=10,      
+        /// <summary>
+        /// A5 paper (148 mm by 210 mm)
+        /// </summary>
+        A5=11,           
+        /// <summary>
+        /// B4 paper (250 mm by 353 mm)
+        /// </summary>
+        B4=12,            
+        /// <summary>
+        /// B5 paper (176 mm by 250 mm)
+        /// </summary>
+        B5=13,            
+        /// <summary>
+        /// Folio paper (8.5 in. by 13 in.)
+        /// </summary>
+        Folio=14,         
+        /// <summary>
+        /// Quarto paper (215 mm by 275 mm)
+        /// </summary>
+        Quarto=15,        
+        /// <summary>
+        /// Standard paper (10 in. by 14 in.)
+        /// </summary>
+        Standard10_14=16, 
+        /// <summary>
+        /// Standard paper (11 in. by 17 in.)
+        /// </summary>
+        Standard11_17=17,  
+        /// <summary>
+        /// Note paper (8.5 in. by 11 in.)
+        /// </summary>
+        Note=18,           
+        /// <summary>
+        /// #9 envelope (3.875 in. by 8.875 in.)
+        /// </summary>
+        Envelope9=19,      
+        /// <summary>
+        /// #10 envelope (4.125 in. by 9.5 in.)
+        /// </summary>
+        Envelope10=20,     
+        /// <summary>
+        /// #11 envelope (4.5 in. by 10.375 in.)
+        /// </summary>
+        Envelope11=21,     
+        /// <summary>
+        /// #12 envelope (4.75 in. by 11 in.)
+        /// </summary>
+        Envelope12=22,     
+        /// <summary>
+        /// #14 envelope (5 in. by 11.5 in.)
+        /// </summary>
+        Envelope14=23,     
+        /// <summary>
+        /// C paper (17 in. by 22 in.)
+        /// </summary>
+        C=24,              
+        /// <summary>
+        /// D paper (22 in. by 34 in.)
+        /// </summary>
+        D=25,               
+        /// <summary>
+        /// E paper (34 in. by 44 in.)
+        /// </summary>
+        E=26,               
+        /// <summary>
+        /// DL envelope (110 mm by 220 mm)
+        /// </summary>
+        DLEnvelope = 27,
+        /// <summary>
+        /// C5 envelope (162 mm by 229 mm)
+        /// </summary>
+        C5Envelope = 28,
+        /// <summary>
+        /// C3 envelope (324 mm by 458 mm)
+        /// </summary>
+        C3Envelope = 29, 
+        /// <summary>
+        /// C4 envelope (229 mm by 324 mm)
+        /// </summary>
+        C4Envelope = 30, 
+        /// <summary>
+        /// C6 envelope (114 mm by 162 mm)
+        /// </summary>
+        C6Envelope = 31, 
+        /// <summary>
+        /// C65 envelope (114 mm by 229 mm)
+        /// </summary>
+        C65Envelope = 32, 
+        /// <summary>
+        /// B4 envelope (250 mm by 353 mm)
+        /// </summary>
+        B4Envelope= 33, 
+        /// <summary>
+        /// B5 envelope (176 mm by 250 mm)
+        /// </summary>
+        B5Envelope= 34, 
+        /// <summary>
+        /// B6 envelope (176 mm by 125 mm)
+        /// </summary>
+        B6Envelope = 35, 
+        /// <summary>
+        /// Italy envelope (110 mm by 230 mm)
+        /// </summary>
+        ItalyEnvelope = 36, 
+        /// <summary>
+        /// Monarch envelope (3.875 in. by 7.5 in.).
+        /// </summary>
+        MonarchEnvelope = 37, 
+        /// <summary>
+        /// 6 3/4 envelope (3.625 in. by 6.5 in.)
+        /// </summary>
+        Six3_4Envelope = 38,
+        /// <summary>
+        /// US standard fanfold (14.875 in. by 11 in.)
+        /// </summary>
+        USStandard=39, 
+        /// <summary>
+        /// German standard fanfold (8.5 in. by 12 in.)
+        /// </summary>
+        GermanStandard=40, 
+        /// <summary>
+        /// German legal fanfold (8.5 in. by 13 in.)
+        /// </summary>
+        GermanLegal=41, 
+        /// <summary>
+        /// ISO B4 (250 mm by 353 mm)
+        /// </summary>
+        ISOB4=42,
+        /// <summary>
+        ///  Japanese double postcard (200 mm by 148 mm)
+        /// </summary>
+        JapaneseDoublePostcard=43,
+        /// <summary>
+        /// Standard paper (9 in. by 11 in.)
+        /// </summary>
+        Standard9=44, 
+        /// <summary>
+        /// Standard paper (10 in. by 11 in.)
+        /// </summary>
+        Standard10=45, 
+        /// <summary>
+        /// Standard paper (15 in. by 11 in.)
+        /// </summary>
+        Standard15=46, 
+        /// <summary>
+        /// Invite envelope (220 mm by 220 mm)
+        /// </summary>
+        InviteEnvelope = 47, 
+        /// <summary>
+        /// Letter extra paper (9.275 in. by 12 in.)
+        /// </summary>
+        LetterExtra=50,
+        /// <summary>
+        /// Legal extra paper (9.275 in. by 15 in.)
+        /// </summary>
+        LegalExtra=51, 
+        /// <summary>
+        /// Tabloid extra paper (11.69 in. by 18 in.)
+        /// </summary>
+        TabloidExtra=52,
+        /// <summary>
+        /// A4 extra paper (236 mm by 322 mm)
+        /// </summary>
+        A4Extra=53, 
+        /// <summary>
+        /// Letter transverse paper (8.275 in. by 11 in.)
+        /// </summary>
+        LetterTransverse=54, 
+        /// <summary>
+        /// A4 transverse paper (210 mm by 297 mm)
+        /// </summary>
+        A4Transverse=55, 
+        /// <summary>
+        /// Letter extra transverse paper (9.275 in. by 12 in.)
+        /// </summary>
+        LetterExtraTransverse=56, 
+        /// <summary>
+        /// SuperA/SuperA/A4 paper (227 mm by 356 mm)
+        /// </summary>
+        SuperA=57, 
+        /// <summary>
+        /// SuperB/SuperB/A3 paper (305 mm by 487 mm)
+        /// </summary>
+        SuperB=58, 
+        /// <summary>
+        /// Letter plus paper (8.5 in. by 12.69 in.)
+        /// </summary>
+        LetterPlus=59, 
+        /// <summary>
+        /// A4 plus paper (210 mm by 330 mm)
+        /// </summary>
+        A4Plus=60, 
+        /// <summary>
+        /// A5 transverse paper (148 mm by 210 mm)
+        /// </summary>
+        A5Transverse=61, 
+        /// <summary>
+        /// JIS B5 transverse paper (182 mm by 257 mm)
+        /// </summary>
+        JISB5Transverse=62, 
+        /// <summary>
+        /// A3 extra paper (322 mm by 445 mm)
+        /// </summary>
+        A3Extra=63, 
+        /// <summary>
+        /// A5 extra paper (174 mm by 235 mm)
+        /// </summary>
+        A5Extra=64, 
+        /// <summary>
+        /// ISO B5 extra paper (201 mm by 276 mm)
+        /// </summary>
+        ISOB5=65, 
+        /// <summary>
+        /// A2 paper (420 mm by 594 mm)
+        /// </summary>
+        A2=66, 
+        /// <summary>
+        /// A3 transverse paper (297 mm by 420 mm)
+        /// </summary>
+        A3Transverse=67, 
+        /// <summary>
+        /// A3 extra transverse paper (322 mm by 445 mm*/
+        /// </summary>
+        A3ExtraTransverse = 68
+    }
+    /// <summary>
+    /// Specifies printed page order
+    /// </summary>
+    public enum ePageOrder
+    {
+
+        /// <summary>
+        /// Order pages vertically first, then move horizontally.
+        /// </summary>
+        DownThenOver,
+        /// <summary>
+        /// Order pages horizontally first, then move vertically
+        /// </summary>
+        OverThenDown
+    }
+    #endregion
+    /// <summary>
+    /// Printer settings
+    /// </summary>
+    public sealed class ExcelPrinterSettings : XmlHelper
+    {
+        ExcelWorksheet _ws;
+        bool _marginsCreated = false;
+
+        internal ExcelPrinterSettings(XmlNamespaceManager ns, XmlNode topNode,ExcelWorksheet ws) :
+            base(ns, topNode)
+        {
+            _ws = ws;
+            SchemaNodeOrder = ws.SchemaNodeOrder;
+        }
+        const string _leftMarginPath = "d:pageMargins/@left";
+        /// <summary>
+        /// Left margin in inches
+        /// </summary>
+        public decimal LeftMargin 
+        {
+            get
+            {
+                return GetXmlNodeDecimal(_leftMarginPath);
+            }
+            set
+            {
+               CreateMargins();
+               SetXmlNodeString(_leftMarginPath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string _rightMarginPath = "d:pageMargins/@right";
+        /// <summary>
+        /// Right margin in inches
+        /// </summary>
+        public decimal RightMargin 
+        {
+            get
+            {
+                return GetXmlNodeDecimal(_rightMarginPath);
+            }
+            set
+            {
+                CreateMargins();
+                SetXmlNodeString(_rightMarginPath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string _topMarginPath = "d:pageMargins/@top";
+        /// <summary>
+        /// Top margin in inches
+        /// </summary>
+        public decimal TopMargin 
+        {
+            get
+            {
+                return GetXmlNodeDecimal(_topMarginPath);
+            }
+            set
+            {
+                CreateMargins();
+                SetXmlNodeString(_topMarginPath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string _bottomMarginPath = "d:pageMargins/@bottom";
+        /// <summary>
+        /// Bottom margin in inches
+        /// </summary>
+        public decimal BottomMargin 
+        {
+            get
+            {
+                return GetXmlNodeDecimal(_bottomMarginPath);
+            }
+            set
+            {
+                CreateMargins();
+                SetXmlNodeString(_bottomMarginPath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string _headerMarginPath = "d:pageMargins/@header";
+        /// <summary>
+        /// Header margin in inches
+        /// </summary>
+        public decimal HeaderMargin 
+        {
+            get
+            {
+                return GetXmlNodeDecimal(_headerMarginPath);
+            }
+            set
+            {
+                CreateMargins();
+                SetXmlNodeString(_headerMarginPath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string _footerMarginPath = "d:pageMargins/@footer";
+        /// <summary>
+        /// Footer margin in inches
+        /// </summary>
+        public decimal FooterMargin 
+        {
+            get
+            {
+                return GetXmlNodeDecimal(_footerMarginPath);
+            }
+            set
+            {
+                CreateMargins();
+                SetXmlNodeString(_footerMarginPath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string _orientationPath = "d:pageSetup/@orientation";
+        /// <summary>
+        /// Orientation 
+        /// Portrait or Landscape
+        /// </summary>
+        public eOrientation Orientation
+        {
+            get
+            {
+                return (eOrientation)Enum.Parse(typeof(eOrientation), GetXmlNodeString(_orientationPath), true);
+            }
+            set
+            {
+                SetXmlNodeString(_orientationPath, value.ToString().ToLower());
+            }
+        }
+        const string _fitToWidthPath = "d:pageSetup/@fitToWidth";
+        /// <summary>
+        /// Fit to Width in pages. 
+        /// Set FitToPage to true when using this one. 
+        /// 0 is automatic
+        /// </summary>
+        public int FitToWidth
+        {
+            get
+            {
+                return GetXmlNodeInt(_fitToWidthPath);
+            }
+            set
+            {
+                SetXmlNodeString(_fitToWidthPath, value.ToString());
+            }
+        }
+        const string _fitToHeightPath = "d:pageSetup/@fitToHeight";
+        /// <summary>
+        /// Fit to height in pages. 
+        /// Set FitToPage to true when using this one. 
+        /// 0 is automatic
+        /// </summary>
+        public int FitToHeight
+        {
+            get
+            {
+                return GetXmlNodeInt(_fitToHeightPath);
+            }
+            set
+            {
+                SetXmlNodeString(_fitToHeightPath, value.ToString());
+            }
+        }
+        const string _scalePath = "d:pageSetup/@scale";
+        /// <summary>
+        /// Print scale
+        /// </summary>
+        public int Scale
+        {
+            get
+            {
+                return GetXmlNodeInt(_scalePath);
+            }
+            set
+            {
+                SetXmlNodeString(_scalePath, value.ToString());
+            }
+        }
+        const string _fitToPagePath = "d:sheetPr/d:pageSetUpPr/@fitToPage";
+        /// <summary>
+        /// Fit To Page.
+        /// </summary>
+        public bool FitToPage
+        {
+            get
+            {
+                return GetXmlNodeBool(_fitToPagePath);
+            }
+            set
+            {
+                SetXmlNodeString(_fitToPagePath, value ? "1" : "0");
+            }
+        }
+        const string _headersPath = "d:printOptions/@headings";
+        /// <summary>
+        /// Print headings (column letter and row numbers)
+        /// </summary>
+        public bool ShowHeaders
+        {
+            get
+            {
+                return GetXmlNodeBool(_headersPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_headersPath, value, false);
+            }
+        }
+        /// <summary>
+        /// Print titles
+        /// Rows to be repeated after each pagebreak.
+        /// The address must be a full row address (ex. 1:1)
+        /// </summary>
+        public ExcelAddress RepeatRows
+        {
+            get
+            {
+                if (_ws.Names.ContainsKey("_xlnm.Print_Titles"))
+                {
+                    ExcelRangeBase r = _ws.Names["_xlnm.Print_Titles"] as ExcelRangeBase;
+                    if (r.Start.Column == 1 && r.End.Column == ExcelPackage.MaxColumns)
+                    {
+                        return r;
+                    }
+                    else if (r.Address != null && r.Addresses[0].Start.Column == 1 && r.Addresses[0].End.Column == ExcelPackage.MaxColumns)
+                    {
+                        return r.Addresses[0];
+                    }
+                    else
+                    {
+                        return null;
+                    }
+                }
+                else
+                {
+                    return null;
+                }
+            }
+            set
+            {
+
+                //Must span entire columns
+                if (!(value.Start.Column == 1 && value.End.Column == ExcelPackage.MaxColumns))
+                {
+                    throw new InvalidOperationException("Address must spann full columns only (for ex. Address=\"A:A\" for the first column).");
+                }
+
+                var vertAddr = RepeatColumns;
+                string addr;
+                if (vertAddr == null)
+                {
+                    addr = value.Address;
+                }
+                else
+                {
+                    addr = vertAddr.Address + "," + value.Address;
+                }
+
+                if (_ws.Names.ContainsKey("_xlnm.Print_Titles"))
+                {
+                    _ws.Names["_xlnm.Print_Titles"].Address = addr;
+                }
+                else
+                {
+                    _ws.Names.Add("_xlnm.Print_Titles", new ExcelRangeBase(_ws, addr));
+                }
+            }
+        }
+        /// <summary>
+        /// Print titles
+        /// Columns to be repeated after each pagebreak.
+        /// The address must be a full column address (ex. A:A)
+        /// </summary>
+        public ExcelAddress RepeatColumns
+        {
+            get
+            {
+                if (_ws.Names.ContainsKey("_xlnm.Print_Titles"))
+                {
+                    ExcelRangeBase r = _ws.Names["_xlnm.Print_Titles"] as ExcelRangeBase;
+                    if (r.Start.Row == 1 && r.End.Row == ExcelPackage.MaxRows)
+                    {
+                        return r;
+                    }
+                    else
+                    {
+                        return null;
+                    }
+                }
+                else
+                {
+                    return null;
+                }
+            }
+            set
+            {
+                //Must span entire rows
+                if (!(value.Start.Row == 1 && value.End.Row== ExcelPackage.MaxRows))
+                {
+                    throw new InvalidOperationException("Address must spann rows only (for ex. Address=\"1:1\" for the first row).");
+                }
+
+                var horAddr = RepeatRows;
+                string addr;
+                if (horAddr == null)
+                {
+                    addr = value.Address;
+                }
+                else
+                {
+                    addr = value.Address + "," + horAddr.Address;
+                }
+
+                if (_ws.Names.ContainsKey("_xlnm.Print_Titles"))
+                {
+                    _ws.Names["_xlnm.Print_Titles"].Address = addr;
+                }
+                else
+                {
+                    _ws.Names.Add("_xlnm.Print_Titles", new ExcelRangeBase(_ws, addr));
+                }
+            }
+        }
+        /// <summary>
+        /// The printarea.
+        /// Null if no print area is set.
+        /// </summary>
+        public ExcelRangeBase PrintArea 
+        {
+            get
+            {
+                if (_ws.Names.ContainsKey("_xlnm.Print_Area"))
+                {
+                    return _ws.Names["_xlnm.Print_Area"];
+                }
+                else
+                {
+                    return null;
+                }
+            }
+            set
+            {
+                if (value == null)
+                {
+                    _ws.Names.Remove("_xlnm.Print_Area");
+                }
+                else if (_ws.Names.ContainsKey("_xlnm.Print_Area"))
+                {
+                    _ws.Names["_xlnm.Print_Area"].Address = value.Address;
+                }
+                else
+                {
+                    _ws.Names.Add("_xlnm.Print_Area", value);
+                }
+            }
+        }
+        const string _gridLinesPath = "d:printOptions/@gridLines";
+        /// <summary>
+        /// Print gridlines 
+        /// </summary>
+        public bool ShowGridLines
+        {
+            get
+            {
+                return GetXmlNodeBool(_gridLinesPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_gridLinesPath, value, false);
+            }
+        }
+        const string _horizontalCenteredPath = "d:printOptions/@horizontalCentered";
+        /// <summary>
+        /// Horizontal centered when printing 
+        /// </summary>w
+        public bool HorizontalCentered
+        {
+            get
+            {
+                return GetXmlNodeBool(_horizontalCenteredPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_horizontalCenteredPath, value, false);
+            }
+        }
+        const string _verticalCenteredPath = "d:printOptions/@verticalCentered";
+        /// <summary>
+        /// Vertical centered when printing 
+        /// </summary>
+        public bool VerticalCentered
+        {
+            get
+            {
+                return GetXmlNodeBool(_verticalCenteredPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_verticalCenteredPath, value, false);
+            }
+        }
+        const string _pageOrderPath = "d:pageSetup/@pageOrder";        
+        /// <summary>
+        /// Specifies printed page order
+        /// </summary>
+        public ePageOrder PageOrder
+        {
+            get
+            {
+                if (GetXmlNodeString(_pageOrderPath) == "overThenDown")
+                {
+                    return ePageOrder.OverThenDown;
+                }
+                else
+                {
+                    return ePageOrder.DownThenOver;
+                }
+            }
+            set
+            {
+                if (value == ePageOrder.OverThenDown)
+                {
+                    SetXmlNodeString(_pageOrderPath, "overThenDown");
+                }
+                else
+                {
+                    DeleteNode(_pageOrderPath);
+                }
+            }
+        }
+        const string _blackAndWhitePath = "d:pageSetup/@blackAndWhite";
+        /// <summary>
+        /// Print black and white
+        /// </summary>
+        public bool BlackAndWhite
+        {
+            get
+            {
+                return GetXmlNodeBool(_blackAndWhitePath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_blackAndWhitePath, value, false);
+            }
+        }
+        const string _draftPath = "d:pageSetup/@draft";
+        /// <summary>
+        /// Print a draft
+        /// </summary>
+        public bool Draft
+        {
+            get
+            {
+                return GetXmlNodeBool(_draftPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_draftPath, value, false);
+            }
+        }
+        const string _paperSizePath = "d:pageSetup/@paperSize";
+        /// <summary>
+        /// Paper size 
+        /// </summary>
+        public ePaperSize PaperSize 
+        {
+            get
+            {
+                string s = GetXmlNodeString(_paperSizePath);
+                if (s != "")
+                {
+                    return (ePaperSize)int.Parse(s);
+                }
+                else
+                {
+                    return ePaperSize.Letter;
+                    
+                }
+            }
+            set
+            {
+                SetXmlNodeString(_paperSizePath, ((int)value).ToString());
+            }
+        }
+        /// <summary>
+        /// All or none of the margin attributes must exist. Create all att ones.
+        /// </summary>
+        private void CreateMargins()
+        {
+            if (_marginsCreated==false && TopNode.SelectSingleNode(_leftMarginPath, NameSpaceManager) == null) 
+            {
+                _marginsCreated=true;
+                LeftMargin = 0.7087M;
+                RightMargin = 0.7087M;
+                TopMargin = 0.7480M;
+                BottomMargin = 0.7480M;
+                HeaderMargin = 0.315M;
+                FooterMargin = 0.315M;
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelProtectedRange.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelProtectedRange.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelProtectedRange.cs	(revision 9616)
@@ -0,0 +1,195 @@
+﻿using OfficeOpenXml.Utils;
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Security.Cryptography;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Algorithm for password hash
+    /// </summary>
+    internal enum eProtectedRangeAlgorithm
+    {
+        /// <summary>
+        /// Specifies that the MD2 algorithm, as defined by RFC 1319, shall be used.
+        /// </summary>
+        MD2,
+        /// <summary>
+        /// Specifies that the MD4 algorithm, as defined by RFC 1319, shall be used.
+        /// </summary>
+        MD4,
+        /// <summary>
+        /// Specifies that the MD5 algorithm, as defined by RFC 1319, shall be used.
+        /// </summary>
+        MD5,
+        /// <summary>
+        /// Specifies that the RIPEMD-128 algorithm, as defined by RFC 1319, shall be used.
+        /// </summary>
+        RIPEMD128,
+        /// <summary>
+        /// Specifies that the RIPEMD-160 algorithm, as defined by ISO/IEC10118-3:2004 shall be used.
+        /// </summary>
+        RIPEMD160, 
+        /// <summary>
+        /// Specifies that the SHA-1 algorithm, as defined by ISO/IEC 10118-3:2004 shall be used.
+        /// </summary>
+        SHA1,
+        /// <summary>
+        /// Specifies that the SHA-256 algorithm, as defined by ISO/IEC10118-3:2004 shall be used.
+        /// </summary>
+        SHA256, 
+        /// <summary>
+        /// Specifies that the SHA-384 algorithm, as defined by ISO/IEC 10118-3:2004 shall be used.
+        /// </summary>
+        SHA384,
+        /// <summary>
+        /// Specifies that the SHA-512 algorithm, as defined by ISO/IEC10118-3:2004 shall be used.
+        /// </summary>
+        SHA512, 
+        /// <summary>
+        /// Specifies that the WHIRLPOOL algorithm, as defined by ISO/IEC 10118-3:2004 shall be used.
+        /// </summary>
+        WHIRLPOOL
+    }
+    public class ExcelProtectedRange : XmlHelper
+    {
+        public string Name
+        {
+            get
+            {
+                return GetXmlNodeString("@name");
+            }
+            set
+            {
+                SetXmlNodeString("@name",value);
+            }
+        }
+        ExcelAddress _address=null;
+        public ExcelAddress Address 
+        { 
+            get
+            {
+                if(_address==null)
+                {
+                    _address=new ExcelAddress(GetXmlNodeString("@sqref"));
+                }
+                return _address;
+            }
+            set
+            {
+                SetXmlNodeString("@sqref", SqRefUtility.ToSqRefAddress(value.Address));
+                _address=value;
+            }
+        }
+
+        internal ExcelProtectedRange(string name, ExcelAddress address, XmlNamespaceManager ns, XmlNode topNode) :
+            base(ns,topNode)
+        {
+            Name = name;
+            Address = address;
+        }
+        /// <summary>
+        /// Sets the password for the range
+        /// </summary>
+        /// <param name="password"></param>
+        public void SetPassword(string password)
+        {
+            var byPwd = Encoding.Unicode.GetBytes(password);
+            var rnd = RandomNumberGenerator.Create();
+            var bySalt=new byte[16];
+            rnd.GetBytes(bySalt);
+            
+            //Default SHA512 and 10000 spins
+            Algorithm=eProtectedRangeAlgorithm.SHA512;
+            SpinCount = SpinCount < 100000 ? 100000 : SpinCount;
+            
+            //Combine salt and password and calculate the initial hash
+            var hp=new SHA512CryptoServiceProvider();
+            var buffer=new byte[byPwd.Length + bySalt.Length];
+            Array.Copy(bySalt, buffer, bySalt.Length);
+            Array.Copy(byPwd, 0, buffer, 16, byPwd.Length);
+            var hash = hp.ComputeHash(buffer);
+
+            //Now iterate the number of spinns.
+            for (var i = 0; i < SpinCount; i++)
+            {
+                buffer=new byte[hash.Length+4];
+                Array.Copy(hash, buffer, hash.Length);
+                Array.Copy(BitConverter.GetBytes(i), 0, buffer, hash.Length, 4);
+                hash = hp.ComputeHash(buffer);
+            }
+            Salt = Convert.ToBase64String(bySalt);
+            Hash = Convert.ToBase64String(hash);            
+        }
+        public string SecurityDescriptor
+        {
+            get
+            {
+                return GetXmlNodeString("@securityDescriptor");
+            }
+            set
+            {
+                SetXmlNodeString("@securityDescriptor",value);
+            }
+        }
+        internal int SpinCount
+        {
+            get
+            {
+                return GetXmlNodeInt("@spinCount");
+            }
+            set
+            {
+                SetXmlNodeString("@spinCount",value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        internal string Salt
+        {
+            get
+            {
+                return GetXmlNodeString("@saltValue");
+            }
+            set
+            {
+                SetXmlNodeString("@saltValue", value);
+            }
+        }
+        internal string Hash
+        {
+            get
+            {
+                return GetXmlNodeString("@hashValue");
+            }
+            set
+            {
+                SetXmlNodeString("@hashValue", value);
+            }
+        }
+        eProtectedRangeAlgorithm _algorithm = eProtectedRangeAlgorithm.SHA512;
+        internal eProtectedRangeAlgorithm Algorithm
+        {
+            get
+            {
+                var v=GetXmlNodeString("@algorithmName");
+                return (eProtectedRangeAlgorithm)Enum.Parse(typeof(eProtectedRangeAlgorithm), v.Replace("-", ""));
+            }
+            set
+            {
+                var v = value.ToString();
+                if(v.StartsWith("SHA"))
+                {
+                    v=v.Insert(3,"-");
+                }
+                else if(v.StartsWith("RIPEMD"))
+                {
+                    v=v.Insert(6,"-");
+                }
+                SetXmlNodeString("@algorithmName", v);
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelProtectedRangeCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelProtectedRangeCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelProtectedRangeCollection.cs	(revision 9616)
@@ -0,0 +1,94 @@
+﻿using OfficeOpenXml.Utils;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml
+{
+    public class ExcelProtectedRangeCollection : XmlHelper, IEnumerable<ExcelProtectedRange>
+    {
+        internal ExcelProtectedRangeCollection(XmlNamespaceManager nsm, XmlNode topNode, ExcelWorksheet ws)
+            : base(nsm, topNode)
+        {
+            foreach (XmlNode protectedRangeNode in topNode.SelectNodes("d:protectedRanges/d:protectedRange", nsm))
+            {
+                if (!(protectedRangeNode is XmlElement))
+                    continue;
+                _baseList.Add(new ExcelProtectedRange(protectedRangeNode.Attributes["name"].Value, new ExcelAddress(SqRefUtility.FromSqRefAddress(protectedRangeNode.Attributes["sqref"].Value)), nsm, topNode));
+            }
+        }
+
+        private List<ExcelProtectedRange> _baseList = new List<ExcelProtectedRange>();
+
+        public ExcelProtectedRange Add(string name, ExcelAddress address)
+        {
+            if (!ExistNode("d:protectedRanges"))
+                CreateNode("d:protectedRanges");
+            
+            var newNode = CreateNode("d:protectedRanges/d:protectedRange");
+            var item = new ExcelProtectedRange(name, address, base.NameSpaceManager, newNode);
+            _baseList.Add(item);
+            return item;
+        }
+
+        public void Clear()
+        {
+            DeleteNode("d:protectedRanges");
+            _baseList.Clear();
+        }
+
+        public bool Contains(ExcelProtectedRange item)
+        {
+            return _baseList.Contains(item);
+        }
+
+        public void CopyTo(ExcelProtectedRange[] array, int arrayIndex)
+        {
+            _baseList.CopyTo(array, arrayIndex);
+        }
+
+        public int Count
+        {
+            get { return _baseList.Count; }
+        }
+
+        public bool Remove(ExcelProtectedRange item)
+        {
+            DeleteAllNode("d:protectedRanges/d:protectedRange[@name='" + item.Name + "' and @sqref='" + item.Address.Address + "']");
+            if (_baseList.Count == 0)
+                DeleteNode("d:protectedRanges");
+            return _baseList.Remove(item);
+        }
+
+        public int IndexOf(ExcelProtectedRange item)
+        {
+            return _baseList.IndexOf(item);
+        }
+
+        public void RemoveAt(int index)
+        {
+            _baseList.RemoveAt(index);
+        }
+
+        public ExcelProtectedRange this[int index]
+        {
+            get
+            {
+                return _baseList[index];
+            }
+        }
+
+        IEnumerator<ExcelProtectedRange> IEnumerable<ExcelProtectedRange>.GetEnumerator()
+        {
+            return _baseList.GetEnumerator();
+        }
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _baseList.GetEnumerator();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelProtection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelProtection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelProtection.cs	(revision 9616)
@@ -0,0 +1,114 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Added		10-AUG-2010
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Utils;
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Sets protection on the workbook level
+    ///<seealso cref="ExcelEncryption"/> 
+    ///<seealso cref="ExcelSheetProtection"/> 
+    /// </summary>
+    public class ExcelProtection : XmlHelper
+    {
+        internal ExcelProtection(XmlNamespaceManager ns, XmlNode topNode, ExcelWorkbook wb) :
+            base(ns, topNode)
+        {
+            SchemaNodeOrder = wb.SchemaNodeOrder;
+        }
+        const string workbookPasswordPath = "d:workbookProtection/@workbookPassword";
+        /// <summary>
+        /// Sets a password for the workbook. This does not encrypt the workbook. 
+        /// </summary>
+        /// <param name="Password">The password. </param>
+        public void SetPassword(string Password)
+        {
+            if(string.IsNullOrEmpty(Password))
+            {
+                DeleteNode(workbookPasswordPath);
+            }
+            else
+            {
+                SetXmlNodeString(workbookPasswordPath, ((int)EncryptedPackageHandler.CalculatePasswordHash(Password)).ToString("x"));
+            }
+        }
+        const string lockStructurePath = "d:workbookProtection/@lockStructure";
+        /// <summary>
+        /// Locks the structure,which prevents users from adding or deleting worksheets or from displaying hidden worksheets.
+        /// </summary>
+        public bool LockStructure
+        {
+            get
+            {
+                return GetXmlNodeBool(lockStructurePath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(lockStructurePath, value,  false);
+            }
+        }
+        const string lockWindowsPath = "d:workbookProtection/@lockWindows";
+        /// <summary>
+        /// Locks the position of the workbook window.
+        /// </summary>
+        public bool LockWindows
+        {
+            get
+            {
+                return GetXmlNodeBool(lockWindowsPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(lockWindowsPath, value, false);
+            }
+        }
+        const string lockRevisionPath = "d:workbookProtection/@lockRevision";
+
+        /// <summary>
+        /// Lock the workbook for revision
+        /// </summary>
+        public bool LockRevision
+        {
+            get
+            {
+                return GetXmlNodeBool(lockRevisionPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(lockRevisionPath, value, false);
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelRange.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelRange.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelRange.cs	(revision 9616)
@@ -0,0 +1,149 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		        2009-10-01
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style;
+using System.Data;
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// A range of cells. 
+    /// </summary>
+    public class ExcelRange : ExcelRangeBase
+    {
+        #region "Constructors"
+        internal ExcelRange(ExcelWorksheet sheet) : 
+            base(sheet)
+        {
+
+        }
+        internal ExcelRange(ExcelWorksheet sheet, string address)
+            : base(sheet, address)
+        {
+
+        }
+        internal ExcelRange(ExcelWorksheet sheet, int fromRow, int fromCol, int toRow, int toCol)
+            : base(sheet)
+        {
+            _fromRow = fromRow;
+            _fromCol = fromCol;
+            _toRow = toRow;
+            _toCol = toCol;
+        }
+        #endregion
+        #region "Indexers"
+        /// <summary>
+        /// Access the range using an address
+        /// </summary>
+        /// <param name="Address">The address</param>
+        /// <returns>A range object</returns>
+        public ExcelRange this[string Address]
+        {
+            get
+            {
+                if (_worksheet.Names.ContainsKey(Address))
+                {
+                    if (_worksheet.Names[Address].IsName)
+                    {
+                        return null;
+                    }
+                    else
+                    {
+                        base.Address = _worksheet.Names[Address].Address;
+                    }
+                }
+                else
+                {
+                    base.Address = Address;
+                }
+                return this;
+            }
+        }
+        /// <summary>
+        /// Access a single cell
+        /// </summary>
+        /// <param name="Row">The row</param>
+        /// <param name="Col">The column</param>
+        /// <returns>A range object</returns>
+        public ExcelRange this[int Row, int Col]
+        {
+            get
+            {
+                ValidateRowCol(Row, Col);
+
+                _fromCol = Col;
+                _fromRow = Row;
+                _toCol = Col;
+                _toRow = Row;
+                base.Address = GetAddress(_fromRow, _fromCol);
+                return this;
+            }
+        }
+        /// <summary>
+        /// Access a range of cells
+        /// </summary>
+        /// <param name="FromRow">Start row</param>
+        /// <param name="FromCol">Start column</param>
+        /// <param name="ToRow">End Row</param>
+        /// <param name="ToCol">End Column</param>
+        /// <returns></returns>
+        public ExcelRange this[int FromRow, int FromCol, int ToRow, int ToCol]
+        {
+            get
+            {
+                ValidateRowCol(FromRow, FromCol);
+                ValidateRowCol(ToRow, ToCol);
+
+                _fromCol = FromCol;
+                _fromRow = FromRow;
+                _toCol = ToCol;
+                _toRow = ToRow;
+                base.Address = GetAddress(_fromRow, _fromCol, _toRow, _toCol);
+                return this;
+            }
+        }
+        #endregion
+        private static void ValidateRowCol(int Row, int Col)
+        {
+            if (Row < 1 || Row > ExcelPackage.MaxRows)
+            {
+                throw (new ArgumentException("Row out of range"));
+            }
+            if (Col < 1 || Col > ExcelPackage.MaxColumns)
+            {
+                throw (new ArgumentException("Column out of range"));
+            }
+        }
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelRangeBase.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelRangeBase.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelRangeBase.cs	(revision 9616)
@@ -0,0 +1,2353 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		        2010-01-28
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ * Eyal Seagull		    Conditional Formatting      2012-04-03
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Data;
+using OfficeOpenXml.Style;
+using System.Xml;
+using System.Drawing;
+using System.Globalization;
+using System.Collections;
+using OfficeOpenXml.Table;
+using System.Text.RegularExpressions;
+using System.IO;
+using System.Linq;
+using OfficeOpenXml.DataValidation;
+using OfficeOpenXml.DataValidation.Contracts;
+using System.Reflection;
+using OfficeOpenXml.Style.XmlAccess;
+using System.Security;
+using OfficeOpenXml.ConditionalFormatting;
+using OfficeOpenXml.ConditionalFormatting.Contracts;
+
+namespace OfficeOpenXml
+{
+	/// <summary>
+	/// A range of cells 
+	/// </summary>
+	public class ExcelRangeBase : ExcelAddress, IExcelCell, IDisposable, IEnumerable<ExcelRangeBase>, IEnumerator<ExcelRangeBase>
+	{
+		/// <summary>
+		/// Reference to the worksheet
+		/// </summary>
+		protected ExcelWorksheet _worksheet;
+		private ExcelWorkbook _workbook = null;
+		private delegate void _changeProp(_setValue method, object value);
+		private delegate void _setValue(object value, int row, int col);
+		private _changeProp _changePropMethod;
+		private int _styleID;
+		#region Constructors
+		internal ExcelRangeBase(ExcelWorksheet xlWorksheet)
+		{
+			_worksheet = xlWorksheet;
+			_ws = _worksheet.Name;
+            this.AddressChange += new EventHandler(ExcelRangeBase_AddressChange);
+			SetDelegate();
+		}
+
+        void ExcelRangeBase_AddressChange(object sender, EventArgs e)
+        {
+            SetDelegate();
+        }
+		internal ExcelRangeBase(ExcelWorksheet xlWorksheet, string address) :
+			base(xlWorksheet == null ? "" : xlWorksheet.Name, address)
+		{
+			_worksheet = xlWorksheet;
+			if (string.IsNullOrEmpty(_ws)) _ws = _worksheet == null ? "" : _worksheet.Name;
+            this.AddressChange += new EventHandler(ExcelRangeBase_AddressChange);
+            SetDelegate();
+		}
+		internal ExcelRangeBase(ExcelWorkbook wb, ExcelWorksheet xlWorksheet, string address, bool isName) :
+			base(xlWorksheet == null ? "" : xlWorksheet.Name, address, isName)
+		{
+			_worksheet = xlWorksheet;
+			_workbook = wb;
+			if (string.IsNullOrEmpty(_ws)) _ws = (xlWorksheet == null ? null : xlWorksheet.Name);
+            this.AddressChange += new EventHandler(ExcelRangeBase_AddressChange);
+            SetDelegate();
+		}
+        ~ExcelRangeBase()
+        {
+            this.AddressChange -= new EventHandler(ExcelRangeBase_AddressChange);
+        }
+		#endregion
+		#region Set Value Delegates		
+        private void SetDelegate()
+		{
+			if (_fromRow == -1)
+			{
+				_changePropMethod = SetUnknown;
+			}
+			//Single cell
+			else if (_fromRow == _toRow && _fromCol == _toCol && Addresses == null)
+			{
+				_changePropMethod = SetSingle;
+			}
+			//Range (ex A1:A2)
+			else if (Addresses == null)
+			{
+				_changePropMethod = SetRange;
+			}
+			//Multi Range (ex A1:A2,C1:C2)
+			else
+			{
+				_changePropMethod = SetMultiRange;
+			}
+		}
+        /// <summary>
+		/// We dont know the address yet. Set the delegate first time a property is set.
+		/// </summary>
+		/// <param name="valueMethod"></param>
+		/// <param name="value"></param>
+		private void SetUnknown(_setValue valueMethod, object value)
+		{
+			//Address is not set use, selected range
+			if (_fromRow == -1)
+			{
+				SetToSelectedRange();
+			}
+			SetDelegate();
+			_changePropMethod(valueMethod, value);
+		}
+		/// <summary>
+		/// Set a single cell
+		/// </summary>
+		/// <param name="valueMethod"></param>
+		/// <param name="value"></param>
+		private void SetSingle(_setValue valueMethod, object value)
+		{
+			valueMethod(value, _fromRow, _fromCol);
+		}
+		/// <summary>
+		/// Set a range
+		/// </summary>
+		/// <param name="valueMethod"></param>
+		/// <param name="value"></param>
+		private void SetRange(_setValue valueMethod, object value)
+		{
+			SetValueAddress(this, valueMethod, value);
+		}
+		/// <summary>
+		/// Set a multirange (A1:A2,C1:C2)
+		/// </summary>
+		/// <param name="valueMethod"></param>
+		/// <param name="value"></param>
+		private void SetMultiRange(_setValue valueMethod, object value)
+		{
+			SetValueAddress(this, valueMethod, value);
+			foreach (var address in Addresses)
+			{
+				SetValueAddress(address, valueMethod, value);
+			}
+		}
+		/// <summary>
+		/// Set the property for an address
+		/// </summary>
+		/// <param name="address"></param>
+		/// <param name="valueMethod"></param>
+		/// <param name="value"></param>
+		private void SetValueAddress(ExcelAddress address, _setValue valueMethod, object value)
+		{
+			IsRangeValid("");
+			if (_fromRow == 1 && _fromCol == 1 && _toRow == ExcelPackage.MaxRows && _toCol == ExcelPackage.MaxColumns)  //Full sheet (ex ws.Cells.Value=0). Set value for A1 only to avoid hanging 
+			{
+				throw (new ArgumentException("Can't reference all cells. Please use the indexer to set the range"));
+			}
+			else
+			{
+				for (int col = address.Start.Column; col <= address.End.Column; col++)
+				{
+					for (int row = address.Start.Row; row <= address.End.Row; row++)
+					{
+						valueMethod(value, row, col);
+					}
+				}
+			}
+		}
+		#endregion
+		#region Set property methods
+		private void Set_StyleID(object value, int row, int col)
+		{
+			_worksheet.Cell(row, col).StyleID = (int)value;
+		}
+		private void Set_StyleName(object value, int row, int col)
+		{
+			_worksheet.Cell(row, col).SetNewStyleName(value.ToString(), _styleID);
+		}
+		private void Set_Value(object value, int row, int col)
+		{
+			ExcelCell c = _worksheet.Cell(row, col);
+			if (c._sharedFormulaID > 0) SplitFormulas();
+			_worksheet.Cell(row, col).Value = value;
+		}
+		private void Set_Formula(object value, int row, int col)
+		{
+			ExcelCell c = _worksheet.Cell(row, col);
+			if (c._sharedFormulaID > 0) SplitFormulas();
+
+			string formula = (value == null ? string.Empty : value.ToString());
+			if (formula == string.Empty)
+			{
+				c.Formula = string.Empty;
+			}
+			else
+			{
+				if (formula[0] == '=') value = formula.Substring(1, formula.Length - 1); // remove any starting equalsign.
+				c.Formula = formula;
+			}
+		}
+		/// <summary>
+		/// Handles shared formulas
+		/// </summary>
+		/// <param name="value">The  formula</param>
+		/// <param name="address">The address of the formula</param>
+		/// <param name="IsArray">If the forumla is an array formula.</param>
+		private void Set_SharedFormula(string value, ExcelAddress address, bool IsArray)
+		{
+			if (_fromRow == 1 && _fromCol == 1 && _toRow == ExcelPackage.MaxRows && _toCol == ExcelPackage.MaxColumns)  //Full sheet (ex ws.Cells.Value=0). Set value for A1 only to avoid hanging 
+			{
+				throw (new InvalidOperationException("Can't set a formula for the entire worksheet"));
+			}
+			else if (address.Start.Row == address.End.Row && address.Start.Column == address.End.Column && !IsArray)             //is it really a shared formula? Arrayformulas can be one cell only
+			{
+				//Nope, single cell. Set the formula
+				Set_Formula(value, address.Start.Row, address.Start.Column);
+				return;
+			}
+			//RemoveFormuls(address);
+			CheckAndSplitSharedFormula();
+			ExcelWorksheet.Formulas f = new ExcelWorksheet.Formulas();
+			f.Formula = value;
+			f.Index = _worksheet.GetMaxShareFunctionIndex(IsArray);
+			f.Address = address.FirstAddress;
+			f.StartCol = address.Start.Column;
+			f.StartRow = address.Start.Row;
+			f.IsArray = IsArray;
+
+			_worksheet._sharedFormulas.Add(f.Index, f);
+			_worksheet.Cell(address.Start.Row, address.Start.Column).SharedFormulaID = f.Index;
+			_worksheet.Cell(address.Start.Row, address.Start.Column).Formula = value;
+
+			for (int col = address.Start.Column; col <= address.End.Column; col++)
+			{
+				for (int row = address.Start.Row; row <= address.End.Row; row++)
+				{
+					_worksheet.Cell(row, col).SharedFormulaID = f.Index;
+				}
+			}
+		}
+		private void Set_HyperLink(object value, int row, int col)
+		{
+			_worksheet.Cell(row, col).Hyperlink = value as Uri;
+		}
+		private void Set_IsRichText(object value, int row, int col)
+		{
+			_worksheet.Cell(row, col).IsRichText = (bool)value;
+		}
+		private void Exists_Comment(object value, int row, int col)
+		{
+			ulong cellID = GetCellID(_worksheet.SheetID, row, col);
+			if (_worksheet.Comments._comments.ContainsKey(cellID))
+			{
+				throw (new InvalidOperationException(string.Format("Cell {0} already contain a comment.", new ExcelCellAddress(row, col).Address)));
+			}
+
+		}
+		private void Set_Comment(object value, int row, int col)
+		{
+			string[] v = (string[])value;
+			Worksheet.Comments.Add(new ExcelRangeBase(_worksheet, GetAddress(_fromRow, _fromCol)), v[0], v[1]);
+			//   _worksheet.Cell(row, col).Comment = comment;
+		}
+		#endregion
+		private void SetToSelectedRange()
+		{
+			if (_worksheet.View.SelectedRange == "")
+			{
+				Address = "A1";
+			}
+			else
+			{
+				Address = _worksheet.View.SelectedRange;
+			}
+		}
+		private void IsRangeValid(string type)
+		{
+			if (_fromRow <= 0)
+			{
+				if (_address == "")
+				{
+					SetToSelectedRange();
+				}
+				else
+				{
+					if (type == "")
+					{
+						throw (new InvalidOperationException(string.Format("Range is not valid for this operation: {0}", _address)));
+					}
+					else
+					{
+						throw (new InvalidOperationException(string.Format("Range is not valid for {0} : {1}", type, _address)));
+					}
+				}
+			}
+		}
+		#region Public Properties
+		/// <summary>
+		/// The styleobject for the range.
+		/// </summary>
+		public ExcelStyle Style
+		{
+			get
+			{
+				IsRangeValid("styling");
+				return _worksheet.Workbook.Styles.GetStyleObject(_worksheet.Cell(_fromRow, _fromCol).StyleID, _worksheet.PositionID, Address);
+			}
+		}
+		/// <summary>
+		/// The named style
+		/// </summary>
+		public string StyleName
+		{
+			get
+			{
+				IsRangeValid("styling");
+				return _worksheet.Cell(_fromRow, _fromCol).StyleName;
+			}
+			set
+			{
+				_styleID = _worksheet.Workbook.Styles.GetStyleIdFromName(value);
+				if (_fromRow == 1 && _toRow == ExcelPackage.MaxRows)    //Full column
+				{
+					ExcelColumn column;
+					//Get the startcolumn
+					ulong colID = ExcelColumn.GetColumnID(_worksheet.SheetID, _fromCol);
+					if (!_worksheet._columns.ContainsKey(colID))
+					{
+						column = _worksheet.Column(_fromCol);
+					}
+					else
+					{
+						column = _worksheet._columns[colID] as ExcelColumn;
+					}
+
+					var index = _worksheet._columns.IndexOf(colID);
+					while (column.ColumnMin <= _toCol)
+					{
+						if (column.ColumnMax > _toCol)
+						{
+                            var newCol = _worksheet.CopyColumn(column, _toCol + 1, column.ColumnMax);
+							column.ColumnMax = _toCol;
+						}
+
+						column._styleName = value;
+						column._styleID = _styleID;
+
+						index++;
+						if (index >= _worksheet._columns.Count)
+						{
+							break;
+						}
+						else
+						{
+							column = (_worksheet._columns[index] as ExcelColumn);
+						}
+					}
+
+					if (column._columnMax < _toCol)
+					{
+						var newCol = _worksheet.Column(column._columnMax + 1) as ExcelColumn;
+						newCol._columnMax = _toCol;
+
+						newCol._styleID = _styleID;
+						newCol._styleName = value;
+					}
+                    if (_fromCol == 1 && _toCol == ExcelPackage.MaxColumns) //FullRow
+                    {
+                        foreach(ExcelRow row in _worksheet._rows)
+                        {
+                            row._styleName = value;
+                            row._styleId = _styleID;
+                        }
+                    }
+				}
+                else if (_fromCol == 1 && _toCol == ExcelPackage.MaxColumns) //FullRow
+                {
+                    for (int row = _fromRow; row <= _toRow; row++)
+                    {
+                        _worksheet.Row(row)._styleName = value;
+                        _worksheet.Row(row)._styleId = _styleID;
+                    }
+                }
+
+                if (!((_fromRow == 1 && _toRow == ExcelPackage.MaxRows) || (_fromCol == 1 && _toCol == ExcelPackage.MaxColumns))) //Cell specific
+                {
+                    for (int col = _fromCol; col <= _toCol; col++)
+                    {
+                        for (int row = _fromRow; row <= _toRow; row++)
+                        {
+                            _worksheet.Cell(row, col).StyleName = value;
+                        }
+                    }
+                }
+                else //Only set name on created cells. (uncreated cells is set on full row or full column).
+                {
+                    int tempIndex = _index;
+                    var e = this as IEnumerator;
+                    e.Reset();
+                    while (e.MoveNext())
+                    {
+                        ((ExcelCell)_worksheet._cells[_index]).SetNewStyleName(value, _styleID);
+                    }
+                    _index = tempIndex;
+                }
+                //_changePropMethod(Set_StyleName, value);
+			}
+		}
+		/// <summary>
+		/// The style ID. 
+		/// It is not recomended to use this one. Use Named styles as an alternative.
+		/// If you do, make sure that you use the Style.UpdateXml() method to update any new styles added to the workbook.
+		/// </summary>
+		public int StyleID
+		{
+			get
+			{
+				return _worksheet.Cell(_fromRow, _fromCol).StyleID;
+			}
+			set
+			{
+				_changePropMethod(Set_StyleID, value);
+			}
+		}
+		/// <summary>
+		/// Set the range to a specific value
+		/// </summary>
+		public object Value
+		{
+			get
+			{
+				if (IsName)
+				{
+					if (_worksheet == null)
+					{
+						return _workbook._names[_address].NameValue;
+					}
+					else
+					{
+						return _worksheet.Names[_address].NameValue; ;
+					}
+				}
+				else
+				{
+					if (_fromRow == _toRow && _fromCol == _toCol)
+					{
+						return _worksheet.GetValue(_fromRow, _fromCol);
+					}
+					else
+					{
+						return GetValueArray();
+					}
+				}
+			}
+			set
+			{
+				if (IsName)
+				{
+					if (_worksheet == null)
+					{
+						_workbook._names[_address].NameValue = value;
+					}
+					else
+					{
+						_worksheet.Names[_address].NameValue = value;
+					}
+				}
+				else
+				{
+					_changePropMethod(Set_Value, value);
+				}
+			}
+		}
+
+        private bool IsInfinityValue(object value)
+        {
+            double? valueAsDouble = value as double?;
+
+            if(valueAsDouble.HasValue && 
+                (double.IsNegativeInfinity(valueAsDouble.Value) || double.IsPositiveInfinity(valueAsDouble.Value)))
+            {
+                return true;
+            }
+
+            return false;
+        }
+
+		private object GetValueArray()
+		{
+			ExcelAddressBase addr;
+			if (_fromRow == 1 && _fromCol == 1 && _toRow == ExcelPackage.MaxRows && _toCol == ExcelPackage.MaxColumns)
+			{
+				addr = _worksheet.Dimension;
+				if (addr == null) return null;
+			}
+			else
+			{
+				addr = this;
+			}
+			object[,] v = new object[addr._toRow - addr._fromRow + 1, addr._toCol - addr._fromCol + 1];
+
+			for (int col = addr._fromCol; col <= addr._toCol; col++)
+			{
+				for (int row = addr._fromRow; row <= addr._toRow; row++)
+				{
+					if (_worksheet._cells.ContainsKey(GetCellID(_worksheet.SheetID, row, col)))
+					{
+						if (IsRichText)
+						{
+							v[row - addr._fromRow, col - addr._fromCol] = GetRichText(row, col).Text;
+						}
+						else
+						{
+							v[row - addr._fromRow, col - addr._fromCol] = _worksheet.Cell(row, col).Value;
+						}
+					}
+				}
+			}
+			return v;
+		}
+		private ExcelAddressBase GetAddressDim(ExcelRangeBase addr)
+		{
+			int fromRow, fromCol, toRow, toCol;
+			var d = _worksheet.Dimension;
+			fromRow = addr._fromRow < d._fromRow ? d._fromRow : addr._fromRow;
+			fromCol = addr._fromCol < d._fromCol ? d._fromCol : addr._fromCol;
+
+			toRow = addr._toRow > d._toRow ? d._toRow : addr._toRow;
+			toCol = addr._toCol > d._toCol ? d._toCol : addr._toCol;
+
+			if (addr._fromCol == fromRow && addr._fromCol == addr._fromCol && addr._toRow == toRow && addr._toCol == _toCol)
+			{
+				return addr;
+			}
+			else
+			{
+				if (_fromRow > _toRow || _fromCol > _toCol)
+				{
+					return null;
+				}
+				else
+				{
+					return new ExcelAddressBase(fromRow, fromCol, toRow, toCol);
+				}
+			}
+		}
+
+		private object GetSingleValue()
+		{
+			if (IsRichText)
+			{
+				return RichText.Text;
+			}
+			else
+			{
+				return _worksheet.Cell(_fromRow, _fromCol).Value;
+			}
+		}
+		/// <summary>
+		/// Returns the formatted value.
+		/// </summary>
+		public string Text
+		{
+			get
+			{
+				return GetFormatedText(false);
+			}
+		}
+		/// <summary>
+		/// Set the column width from the content of the range. The minimum width is the value of the ExcelWorksheet.defaultColumnWidth property.
+		/// Note: Cells containing formulas are ignored since EPPlus don't have a calculation engine.
+		/// Wrapped and merged cells are also ignored.
+		/// </summary>
+		public void AutoFitColumns()
+		{
+			AutoFitColumns(_worksheet.DefaultColWidth);
+		}
+
+		/// <summary>
+		/// Set the column width from the content of the range.
+		/// Note: Cells containing formulas are ignored since EPPlus don't have a calculation engine.
+		///       Wrapped and merged cells are also ignored.
+		/// </summary>
+        /// <remarks>This method will not work if you run in an environment that does not support GDI</remarks>
+		/// <param name="MinimumWidth">Minimum column width</param>
+		public void AutoFitColumns(double MinimumWidth)
+		{
+		    AutoFitColumns(MinimumWidth, double.MaxValue);
+		}
+
+	    /// <summary>
+	    /// Set the column width from the content of the range.
+	    /// Note: Cells containing formulas are ignored since EPPlus don't have a calculation engine.
+	    ///       Wrapped and merged cells are also ignored.
+	    /// </summary>
+	    /// <param name="MinimumWidth">Minimum column width</param>
+	    /// <param name="MaximumWidth">Maximum column width</param>
+	    public void AutoFitColumns(double MinimumWidth, double MaximumWidth)
+		{
+			if (_fromCol < 1 || _fromRow < 1)
+			{
+				SetToSelectedRange();
+			}
+			Dictionary<int, Font> fontCache = new Dictionary<int, Font>();
+			Font f;
+
+			bool doAdjust = _worksheet._package.DoAdjustDrawings;
+			_worksheet._package.DoAdjustDrawings = false;
+			var drawWidths = _worksheet.Drawings.GetDrawingWidths();
+
+			int fromCol = _fromCol > _worksheet.Dimension._fromCol ? _fromCol : _worksheet.Dimension._fromCol;
+			int toCol = _toCol < _worksheet.Dimension._toCol ? _toCol : _worksheet.Dimension._toCol;
+			if (Addresses == null)
+			{
+				for (int col = fromCol; col <= toCol; col++)
+				{
+					_worksheet.Column(col).Width = MinimumWidth;
+				}
+			}
+			else
+			{
+				foreach (var addr in Addresses)
+				{
+					fromCol = addr._fromCol > _worksheet.Dimension._fromCol ? addr._fromCol : _worksheet.Dimension._fromCol;
+					toCol = addr._toCol < _worksheet.Dimension._toCol ? addr._toCol : _worksheet.Dimension._toCol;
+					for (int col = fromCol; col <= toCol; col++)
+					{
+						_worksheet.Column(col).Width = MinimumWidth;
+					}
+				}
+			}
+
+			//Get any autofilter to widen these columns
+			List<ExcelAddressBase> afAddr = new List<ExcelAddressBase>();
+			if (_worksheet.AutoFilterAddress != null)
+			{
+				afAddr.Add(new ExcelAddressBase(_worksheet.AutoFilterAddress._fromRow,
+																				_worksheet.AutoFilterAddress._fromCol,
+																				_worksheet.AutoFilterAddress._fromRow,
+																				_worksheet.AutoFilterAddress._toCol));
+				afAddr[afAddr.Count - 1]._ws = WorkSheet;
+			}
+			foreach (var tbl in _worksheet.Tables)
+			{
+				if (tbl.AutoFilterAddress != null)
+				{
+					afAddr.Add(new ExcelAddressBase(tbl.AutoFilterAddress._fromRow,
+																			tbl.AutoFilterAddress._fromCol,
+																			tbl.AutoFilterAddress._fromRow,
+																			tbl.AutoFilterAddress._toCol));
+					afAddr[afAddr.Count - 1]._ws = WorkSheet;
+				}
+			}
+
+			var styles = _worksheet.Workbook.Styles;
+			var nf = styles.Fonts[styles.CellXfs[0].FontId];
+			FontStyle fs = FontStyle.Regular;
+			if (nf.Bold) fs |= FontStyle.Bold;
+			if (nf.UnderLine) fs |= FontStyle.Underline;
+			if (nf.Italic) fs |= FontStyle.Italic;
+			if (nf.Strike) fs |= FontStyle.Strikeout;
+			var nfont = new Font(nf.Name, nf.Size, fs);
+            
+			using (Bitmap b = new Bitmap(1, 1))
+			{
+				using (Graphics g = Graphics.FromImage(b))
+				{
+					float normalSize = (float)Math.Truncate(g.MeasureString("00", nfont).Width - g.MeasureString("0", nfont).Width);
+					g.PageUnit = GraphicsUnit.Pixel;
+					foreach (var cell in this)
+					{
+						if (cell.Merge == true || cell.Style.WrapText) continue;
+						var fntID = styles.CellXfs[cell.StyleID].FontId;
+						if (fontCache.ContainsKey(fntID))
+						{
+							f = fontCache[fntID];
+						}
+						else
+						{
+							var fnt = styles.Fonts[fntID];
+							fs = FontStyle.Regular;
+							if (fnt.Bold) fs |= FontStyle.Bold;
+							if (fnt.UnderLine) fs |= FontStyle.Underline;
+							if (fnt.Italic) fs |= FontStyle.Italic;
+							if (fnt.Strike) fs |= FontStyle.Strikeout;
+							f = new Font(fnt.Name, fnt.Size, fs);
+							fontCache.Add(fntID, f);
+						}
+
+						//Truncate(({pixels}-5)/{Maximum Digit Width} * 100+0.5)/100
+
+                        var size = g.MeasureString(cell.TextForWidth, f);
+                        double width;
+                        double r = styles.CellXfs[cell.StyleID].TextRotation;
+                        if (r <= 0 )
+                        {
+                            width = (size.Width + 5) / normalSize;
+                        }
+                        else
+                        {
+                            r = (r <= 90 ? r : r - 90);
+                            width = (((size.Width - size.Height) * Math.Abs(System.Math.Cos(System.Math.PI * r / 180.0)) + size.Height) + 5) / normalSize;
+                        }
+
+						foreach (var a in afAddr)
+						{
+							if (a.Collide(cell) != eAddressCollition.No)
+							{
+								width += 2.25;
+								break;
+							}
+						}
+
+						if (width > _worksheet.Column(cell._fromCol).Width)
+						{
+							_worksheet.Column(cell._fromCol).Width = width > MaximumWidth ? MaximumWidth : width;
+						}
+					}
+				}
+			}
+			_worksheet.Drawings.AdjustWidth(drawWidths);
+			_worksheet._package.DoAdjustDrawings = doAdjust;
+		}
+
+		internal string TextForWidth
+		{
+			get
+			{
+				return GetFormatedText(true);
+			}
+		}
+		private string GetFormatedText(bool forWidthCalc)
+		{
+			object v = Value;
+			if (v == null) return "";
+			var styles = Worksheet.Workbook.Styles;
+			var nfID = styles.CellXfs[StyleID].NumberFormatId;
+			ExcelNumberFormatXml.ExcelFormatTranslator nf = null;
+			for (int i = 0; i < styles.NumberFormats.Count; i++)
+			{
+				if (nfID == styles.NumberFormats[i].NumFmtId)
+				{
+					nf = styles.NumberFormats[i].FormatTranslator;
+					break;
+				}
+			}
+
+			string format, textFormat;
+			if (forWidthCalc)
+			{
+				format = nf.NetFormatForWidth;
+				textFormat = nf.NetTextFormatForWidth;
+			}
+			else
+			{
+				format = nf.NetFormat;
+				textFormat = nf.NetTextFormat;
+			}
+
+			if (v is decimal || v.GetType().IsPrimitive)
+			{
+				double d;
+				try
+				{
+					d = Convert.ToDouble(v);
+				}
+				catch
+				{
+					return "";
+				}
+
+				if (nf.DataType == ExcelNumberFormatXml.eFormatType.Number)
+				{
+					if (string.IsNullOrEmpty(nf.FractionFormat))
+					{
+						return d.ToString(format, nf.Culture);
+					}
+					else
+					{
+						return nf.FormatFraction(d);
+					}
+				}
+				else if (nf.DataType == ExcelNumberFormatXml.eFormatType.DateTime)
+				{
+					var date = DateTime.FromOADate(d);
+					return date.ToString(format, nf.Culture);
+				}
+			}
+			else if (v is DateTime)
+			{
+				if (nf.DataType == ExcelNumberFormatXml.eFormatType.DateTime)
+				{
+					return ((DateTime)v).ToString(format, nf.Culture);
+				}
+				else
+				{
+					double d = ((DateTime)v).ToOADate();
+					if (string.IsNullOrEmpty(nf.FractionFormat))
+					{
+						return d.ToString(format, nf.Culture);
+					}
+					else
+					{
+						return nf.FormatFraction(d);
+					}
+				}
+			}
+			else if (v is TimeSpan)
+			{
+				if (nf.DataType == ExcelNumberFormatXml.eFormatType.DateTime)
+				{
+					return new DateTime(((TimeSpan)v).Ticks).ToString(format, nf.Culture);
+				}
+				else
+				{
+					double d = (new DateTime(((TimeSpan)v).Ticks)).ToOADate();
+					if (string.IsNullOrEmpty(nf.FractionFormat))
+					{
+						return d.ToString(format, nf.Culture);
+					}
+					else
+					{
+						return nf.FormatFraction(d);
+					}
+				}
+			}
+			else
+			{
+				if (textFormat == "")
+				{
+					return v.ToString();
+				}
+				else
+				{
+					return string.Format(textFormat, v);
+				}
+			}
+			return v.ToString();
+		}
+		/// <summary>
+		/// Gets or sets a formula for a range.
+		/// </summary>
+		public string Formula
+		{
+			get
+			{
+				if (IsName)
+				{
+					if (_worksheet == null)
+					{
+						return _workbook._names[_address].NameFormula;
+					}
+					else
+					{
+						return _worksheet.Names[_address].NameFormula;
+					}
+				}
+				else
+				{
+					return _worksheet.Cell(_fromRow, _fromCol).Formula;
+				}
+			}
+			set
+			{
+				if (IsName)
+				{
+					if (_worksheet == null)
+					{
+						_workbook._names[_address].NameFormula = value;
+					}
+					else
+					{
+						_worksheet.Names[_address].NameFormula = value;
+					}
+				}
+				else
+				{
+					if (_fromRow == _toRow && _fromCol == _toCol)
+					{
+						Set_Formula(value, _fromRow, _fromCol);
+					}
+					else
+					{
+						Set_SharedFormula(value, this, false);
+						if (Addresses != null)
+						{
+							foreach (var address in Addresses)
+							{
+								Set_SharedFormula(value, address, false);
+							}
+						}
+					}
+				}
+			}
+		}
+		/// <summary>
+		/// Gets or Set a formula in R1C1 format.
+		/// </summary>
+		public string FormulaR1C1
+		{
+			get
+			{
+				IsRangeValid("FormulaR1C1");
+				return _worksheet.Cell(_fromRow, _fromCol).FormulaR1C1;
+			}
+			set
+			{
+				IsRangeValid("FormulaR1C1");
+				if (value.Length > 0 && value[0] == '=') value = value.Substring(1, value.Length - 1); // remove any starting equalsign.
+
+				if (Addresses == null)
+				{
+					Set_SharedFormula(ExcelCell.TranslateFromR1C1(value, _fromRow, _fromCol), this, false);
+				}
+				else
+				{
+					Set_SharedFormula(ExcelCell.TranslateFromR1C1(value, _fromRow, _fromCol), new ExcelAddress(FirstAddress), false);
+					foreach (var address in Addresses)
+					{
+						Set_SharedFormula(ExcelCell.TranslateFromR1C1(value, address.Start.Row, address.Start.Column), address, false);
+					}
+				}
+			}
+		}
+		/// <summary>
+		/// Set the hyperlink property for a range of cells
+		/// </summary>
+		public Uri Hyperlink
+		{
+			get
+			{
+				IsRangeValid("formulaR1C1");
+				return _worksheet.Cell(_fromRow, _fromCol).Hyperlink;
+			}
+			set
+			{
+				_changePropMethod(Set_HyperLink, value);
+			}
+		}
+		/// <summary>
+		/// If the cells in the range are merged.
+		/// </summary>
+		public bool Merge
+		{
+			get
+			{
+				IsRangeValid("merging");
+				for (int col = _fromCol; col <= _toCol; col++)
+				{
+					for (int row = _fromRow; row <= _toRow; row++)
+					{
+						if (!_worksheet.Cell(row, col).Merge)
+						{
+							return false;
+						}
+					}
+				}
+				return true;
+			}
+			set
+			{
+				IsRangeValid("merging");
+				SetMerge(value, FirstAddress);
+				if (Addresses != null)
+				{
+					foreach (var address in Addresses)
+					{
+						SetMerge(value, address._address);
+					}
+				}
+			}
+		}
+
+		private void SetMerge(bool value, string address)
+		{
+			if (!value)
+			{
+				if (_worksheet.MergedCells.List.Contains(address))
+				{
+					SetCellMerge(false, address);
+					_worksheet.MergedCells.List.Remove(address);
+				}
+				else if (!CheckMergeDiff(false, address))
+				{
+					throw (new Exception("Range is not fully merged.Specify the exact range"));
+				}
+			}
+			else
+			{
+				if (CheckMergeDiff(false, address))
+				{
+					SetCellMerge(true, address);
+					_worksheet.MergedCells.List.Add(address);
+				}
+				else
+				{
+					if (!_worksheet.MergedCells.List.Contains(address))
+					{
+						throw (new Exception("Cells are already merged"));
+					}
+				}
+			}
+		}
+		/// <summary>
+		/// Set an autofilter for the range
+		/// </summary>
+		public bool AutoFilter
+		{
+			get
+			{
+				IsRangeValid("autofilter");
+				ExcelAddressBase address = _worksheet.AutoFilterAddress;
+				if (address == null) return false;
+				if (_fromRow >= address.Start.Row
+						&&
+						_toRow <= address.End.Row
+						&&
+						_fromCol >= address.Start.Column
+						&&
+						_toCol <= address.End.Column)
+				{
+					return true;
+				}
+				return false;
+			}
+			set
+			{
+				IsRangeValid("autofilter");
+				_worksheet.AutoFilterAddress = this;
+				if (_worksheet.Names.ContainsKey("_xlnm._FilterDatabase"))
+				{
+					_worksheet.Names.Remove("_xlnm._FilterDatabase");
+				}
+				var result = _worksheet.Names.Add("_xlnm._FilterDatabase", this);
+				result.IsNameHidden = true;
+			}
+		}
+		/// <summary>
+		/// If the value is in richtext format.
+		/// </summary>
+		public bool IsRichText
+		{
+			get
+			{
+				IsRangeValid("richtext");
+				return _worksheet.Cell(_fromRow, _fromCol).IsRichText;
+			}
+			set
+			{
+				_changePropMethod(Set_IsRichText, value);
+			}
+		}
+		/// <summary>
+		/// Is the range a part of an Arrayformula
+		/// </summary>
+		public bool IsArrayFormula
+		{
+			get
+			{
+				IsRangeValid("arrayformulas");
+				return _worksheet.Cell(_fromRow, _fromCol).IsArrayFormula;
+			}
+		}
+		ExcelRichTextCollection _rtc = null;
+		/// <summary>
+		/// Cell value is richtext formated. 
+		/// </summary>
+		public ExcelRichTextCollection RichText
+		{
+			get
+			{
+				IsRangeValid("richtext");
+				if (_rtc == null)
+				{
+					_rtc = GetRichText(_fromRow, _fromCol);
+				}
+				return _rtc;
+			}
+		}
+
+		private ExcelRichTextCollection GetRichText(int row, int col)
+		{
+			XmlDocument xml = new XmlDocument();
+			var cell = _worksheet.Cell(row, col);
+			if (cell.Value != null)
+			{
+				if (cell.IsRichText)
+				{
+                    XmlHelper.LoadXmlSafe(xml, "<d:si xmlns:d=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" >" + cell.Value.ToString() + "</d:si>", Encoding.UTF8);
+				}
+				else
+				{
+					xml.LoadXml("<d:si xmlns:d=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" ><d:r><d:t>" + SecurityElement.Escape(cell.Value.ToString()) + "</d:t></d:r></d:si>");
+				}
+			}
+			else
+			{
+				xml.LoadXml("<d:si xmlns:d=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" />");
+			}
+			var rtc = new ExcelRichTextCollection(_worksheet.NameSpaceManager, xml.SelectSingleNode("d:si", _worksheet.NameSpaceManager), this);
+			if (rtc.Count == 1 && cell.IsRichText == false)
+			{
+				IsRichText = true;
+				var fnt = cell.Style.Font;
+				rtc[0].PreserveSpace = true;
+				rtc[0].Bold = fnt.Bold;
+				rtc[0].FontName = fnt.Name;
+				rtc[0].Italic = fnt.Italic;
+				rtc[0].Size = fnt.Size;
+				rtc[0].UnderLine = fnt.UnderLine;
+
+				int hex;
+				if (fnt.Color.Rgb != "" && int.TryParse(fnt.Color.Rgb, NumberStyles.HexNumber, null, out hex))
+				{
+					rtc[0].Color = Color.FromArgb(hex);
+				}
+
+			}
+			return rtc;
+		}
+		/// <summary>
+		/// returns the comment object of the first cell in the range
+		/// </summary>
+		public ExcelComment Comment
+		{
+			get
+			{
+				IsRangeValid("comments");
+				ulong cellID = GetCellID(_worksheet.SheetID, _fromRow, _fromCol);
+				if (_worksheet.Comments._comments.ContainsKey(cellID))
+				{
+					return _worksheet._comments._comments[cellID] as ExcelComment;
+				}
+				return null;
+			}
+		}
+		/// <summary>
+		/// WorkSheet object 
+		/// </summary>
+		public ExcelWorksheet Worksheet
+		{
+			get
+			{
+				return _worksheet;
+			}
+		}
+		/// <summary>
+		/// Address including sheetname
+		/// </summary>
+		public string FullAddress
+		{
+			get
+			{
+				string fullAddress = GetFullAddress(_worksheet.Name, _address);
+				if (Addresses != null)
+				{
+					foreach (var a in Addresses)
+					{
+						fullAddress += "," + GetFullAddress(_worksheet.Name, a.Address); ;
+					}
+				}
+				return fullAddress;
+			}
+		}
+		/// <summary>
+		/// Address including sheetname
+		/// </summary>
+		public string FullAddressAbsolute
+		{
+			get
+			{
+				string wbwsRef = string.IsNullOrEmpty(base._wb) ? base._ws : "[" + base._wb.Replace("'", "''") + "]" + _ws;
+				string fullAddress = GetFullAddress(wbwsRef, GetAddress(_fromRow, _fromCol, _toRow, _toCol, true));
+				if (Addresses != null)
+				{
+					foreach (var a in Addresses)
+					{
+						fullAddress += "," + GetFullAddress(wbwsRef, GetAddress(a.Start.Row, a.Start.Column, a.End.Row, a.End.Column, true)); ;
+					}
+				}
+				return fullAddress;
+			}
+		}
+        /// <summary>
+        /// Address including sheetname
+        /// </summary>
+        internal string FullAddressAbsoluteNoFullRowCol
+        {
+            get
+            {
+                string wbwsRef = string.IsNullOrEmpty(base._wb) ? base._ws : "[" + base._wb.Replace("'", "''") + "]" + _ws;
+                string fullAddress = GetFullAddress(wbwsRef, GetAddress(_fromRow, _fromCol, _toRow, _toCol, true), false);
+                if (Addresses != null)
+                {
+                    foreach (var a in Addresses)
+                    {
+                        fullAddress += "," + GetFullAddress(wbwsRef, GetAddress(a.Start.Row, a.Start.Column, a.End.Row, a.End.Column, true),false); ;
+                    }
+                }
+                return fullAddress;
+            }
+        }
+		#endregion
+		#region Private Methods
+		/// <summary>
+		/// Check if the range is partly merged
+		/// </summary>
+		/// <param name="startValue">the starting value</param>
+		/// <param name="address">the address</param>
+		/// <returns></returns>
+		private bool CheckMergeDiff(bool startValue, string address)
+		{
+			ExcelAddress a = new ExcelAddress(address);
+			for (int col = a._fromCol; col <= a._toCol; col++)
+			{
+				for (int row = a._fromRow; row <= a._toRow; row++)
+				{
+					if (_worksheet.Cell(row, col).Merge != startValue)
+					{
+						return false;
+					}
+				}
+			}
+			return true;
+		}
+		/// <summary>
+		/// Set the merge flag for the range
+		/// </summary>
+		/// <param name="value"></param>
+		/// <param name="address"></param>
+		internal void SetCellMerge(bool value, string address)
+		{
+			ExcelAddress a = new ExcelAddress(address);
+			for (int col = a._fromCol; col <= a._toCol; col++)
+			{
+				for (int row = a._fromRow; row <= a._toRow; row++)
+				{
+					_worksheet.Cell(row, col).Merge = value;
+				}
+			}
+		}
+		/// <summary>
+		/// Set the value without altering the richtext property
+		/// </summary>
+		/// <param name="value">the value</param>
+		internal void SetValueRichText(object value)
+		{
+			if (_fromRow == 1 && _fromCol == 1 && _toRow == ExcelPackage.MaxRows && _toCol == ExcelPackage.MaxColumns)  //Full sheet (ex ws.Cells.Value=0). Set value for A1 only to avoid hanging 
+			{
+				_worksheet.Cell(1, 1).SetValueRichText(value);
+			}
+			else
+			{
+				for (int col = _fromCol; col <= _toCol; col++)
+				{
+					for (int row = _fromRow; row <= _toRow; row++)
+					{
+						_worksheet.Cell(row, col).SetValueRichText(value);
+					}
+				}
+			}
+		}
+		/// <summary>
+		/// Removes a shared formula
+		/// </summary>
+		private void RemoveFormuls(ExcelAddress address)
+		{
+			List<int> removed = new List<int>();
+			int fFromRow, fFromCol, fToRow, fToCol;
+			foreach (int index in _worksheet._sharedFormulas.Keys)
+			{
+				ExcelWorksheet.Formulas f = _worksheet._sharedFormulas[index];
+				ExcelCell.GetRowColFromAddress(f.Address, out fFromRow, out fFromCol, out fToRow, out fToCol);
+				if (((fFromCol >= address.Start.Column && fFromCol <= address.End.Column) ||
+					 (fToCol >= address.Start.Column && fToCol <= address.End.Column)) &&
+					 ((fFromRow >= address.Start.Row && fFromRow <= address.End.Row) ||
+					 (fToRow >= address.Start.Row && fToRow <= address.End.Row)))
+				{
+					for (int col = fFromCol; col <= fToCol; col++)
+					{
+						for (int row = fFromRow; row <= fToRow; row++)
+						{
+							_worksheet.Cell(row, col).SharedFormulaID = int.MinValue;
+						}
+					}
+					removed.Add(index);
+				}
+			}
+			foreach (int index in removed)
+			{
+				_worksheet._sharedFormulas.Remove(index);
+			}
+		}
+		internal void SetSharedFormulaID(int id)
+		{
+			for (int col = _fromCol; col <= _toCol; col++)
+			{
+				for (int row = _fromRow; row <= _toRow; row++)
+				{
+					_worksheet.Cell(row, col).SharedFormulaID = id;
+				}
+			}
+		}
+		private void CheckAndSplitSharedFormula()
+		{
+			for (int col = _fromCol; col <= _toCol; col++)
+			{
+				for (int row = _fromRow; row <= _toRow; row++)
+				{
+					if (_worksheet.Cell(row, col).SharedFormulaID >= 0)
+					{
+						SplitFormulas();
+						return;
+					}
+				}
+			}
+		}
+
+		private void SplitFormulas()
+		{
+			List<int> formulas = new List<int>();
+			for (int col = _fromCol; col <= _toCol; col++)
+			{
+				for (int row = _fromRow; row <= _toRow; row++)
+				{
+					int id = _worksheet.Cell(row, col).SharedFormulaID;
+					if (id >= 0 && !formulas.Contains(id))
+					{
+						if (_worksheet._sharedFormulas[id].IsArray &&
+								Collide(_worksheet.Cells[_worksheet._sharedFormulas[id].Address]) == eAddressCollition.Partly) // If the formula is an array formula and its on inside the overwriting range throw an exception
+						{
+							throw (new Exception("Can not overwrite a part of an array-formula"));
+						}
+						formulas.Add(_worksheet.Cell(row, col).SharedFormulaID);
+					}
+				}
+			}
+
+			foreach (int ix in formulas)
+			{
+				SplitFormula(ix);
+			}
+		}
+
+		private void SplitFormula(int ix)
+		{
+			var f = _worksheet._sharedFormulas[ix];
+			var fRange = _worksheet.Cells[f.Address];
+			var collide = Collide(fRange);
+
+			//The formula is inside the currenct range, remove it
+			if (collide == eAddressCollition.Inside)
+			{
+				_worksheet._sharedFormulas.Remove(ix);
+				fRange.SetSharedFormulaID(int.MinValue);
+			}
+			else if (collide == eAddressCollition.Partly)
+			{
+				//The formula partly collides with the current range
+				bool fIsSet = false;
+				string formulaR1C1 = fRange.FormulaR1C1;
+				//Top Range
+				if (fRange._fromRow < _fromRow)
+				{
+					f.Address = ExcelCell.GetAddress(fRange._fromRow, fRange._fromCol, _fromRow - 1, fRange._toCol);
+					fIsSet = true;
+				}
+				//Left Range
+				if (fRange._fromCol < _fromCol)
+				{
+					if (fIsSet)
+					{
+						f = new ExcelWorksheet.Formulas();
+						f.Index = _worksheet.GetMaxShareFunctionIndex(false);
+						f.StartCol = fRange._fromCol;
+						f.IsArray = false;
+						_worksheet._sharedFormulas.Add(f.Index, f);
+					}
+					else
+					{
+						fIsSet = true;
+					}
+					if (fRange._fromRow < _fromRow)
+						f.StartRow = _fromRow;
+					else
+					{
+						f.StartRow = fRange._fromRow;
+					}
+					if (fRange._toRow < _toRow)
+					{
+						f.Address = ExcelCell.GetAddress(f.StartRow, f.StartCol,
+								fRange._toRow, _fromCol - 1);
+					}
+					else
+					{
+						f.Address = ExcelCell.GetAddress(f.StartRow, f.StartCol,
+							 _toRow, _fromCol - 1);
+					}
+					f.Formula = TranslateFromR1C1(formulaR1C1, f.StartRow, f.StartCol);
+					_worksheet.Cells[f.Address].SetSharedFormulaID(f.Index);
+				}
+				//Right Range
+				if (fRange._toCol > _toCol)
+				{
+					if (fIsSet)
+					{
+						f = new ExcelWorksheet.Formulas();
+						f.Index = _worksheet.GetMaxShareFunctionIndex(false);
+						f.IsArray = false;
+						_worksheet._sharedFormulas.Add(f.Index, f);
+					}
+					else
+					{
+						fIsSet = true;
+					}
+					f.StartCol = _toCol + 1;
+					if (_fromRow < fRange._fromRow)
+						f.StartRow = fRange._fromRow;
+					else
+					{
+						f.StartRow = _fromRow;
+					}
+
+					if (fRange._toRow < _toRow)
+					{
+						f.Address = ExcelCell.GetAddress(f.StartRow, f.StartCol,
+								fRange._toRow, fRange._toCol);
+					}
+					else
+					{
+						f.Address = ExcelCell.GetAddress(f.StartRow, f.StartCol,
+								_toRow, fRange._toCol);
+					}
+					f.Formula = TranslateFromR1C1(formulaR1C1, f.StartRow, f.StartCol);
+					_worksheet.Cells[f.Address].SetSharedFormulaID(f.Index);
+				}
+				//Bottom Range
+				if (fRange._toRow > _toRow)
+				{
+					if (fIsSet)
+					{
+						f = new ExcelWorksheet.Formulas();
+						f.Index = _worksheet.GetMaxShareFunctionIndex(false);
+						f.IsArray = false;
+						_worksheet._sharedFormulas.Add(f.Index, f);
+					}
+
+					f.StartCol = fRange._fromCol;
+					f.StartRow = _toRow + 1;
+
+					f.Formula = TranslateFromR1C1(formulaR1C1, f.StartRow, f.StartCol);
+
+					f.Address = ExcelCell.GetAddress(f.StartRow, f.StartCol,
+							fRange._toRow, fRange._toCol);
+					_worksheet.Cells[f.Address].SetSharedFormulaID(f.Index);
+
+				}
+			}
+		}
+		private object ConvertData(ExcelTextFormat Format, string v, int col, bool isText)
+		{
+			if (isText && (Format.DataTypes == null || Format.DataTypes.Length < col)) return v;
+
+			double d;
+			DateTime dt;
+			if (Format.DataTypes == null || Format.DataTypes.Length < col || Format.DataTypes[col] == eDataTypes.Unknown)
+			{
+				string v2 = v.EndsWith("%") ? v.Substring(0, v.Length - 1) : v;
+				if (double.TryParse(v2, NumberStyles.Any, Format.Culture, out d))
+				{
+					if (v2 == v)
+					{
+						return d;
+					}
+					else
+					{
+						return d / 100;
+					}
+				}
+				if (DateTime.TryParse(v, Format.Culture, DateTimeStyles.None, out dt))
+				{
+					return dt;
+				}
+				else
+				{
+					return v;
+				}
+			}
+			else
+			{
+				switch (Format.DataTypes[col])
+				{
+					case eDataTypes.Number:
+						if (double.TryParse(v, NumberStyles.Any, Format.Culture, out d))
+						{
+							return d;
+						}
+						else
+						{
+							return v;
+						}
+					case eDataTypes.DateTime:
+						if (DateTime.TryParse(v, Format.Culture, DateTimeStyles.None, out dt))
+						{
+							return dt;
+						}
+						else
+						{
+							return v;
+						}
+					case eDataTypes.Percent:
+						string v2 = v.EndsWith("%") ? v.Substring(0, v.Length - 1) : v;
+						if (double.TryParse(v2, NumberStyles.Any, Format.Culture, out d))
+						{
+							return d / 100;
+						}
+						else
+						{
+							return v;
+						}
+
+					default:
+						return v;
+
+				}
+			}
+		}
+		#endregion
+		#region Public Methods
+		#region ConditionalFormatting
+		/// <summary>
+		/// Conditional Formatting for this range.
+		/// </summary>
+		public IRangeConditionalFormatting ConditionalFormatting
+		{
+			get
+			{
+				return new RangeConditionalFormatting(_worksheet, new ExcelAddress(Address));
+			}
+		}
+		#endregion
+		#region DataValidation
+		/// <summary>
+		/// Data validation for this range.
+		/// </summary>
+		public IRangeDataValidation DataValidation
+		{
+			get
+			{
+                return new RangeDataValidation(_worksheet, Address);
+			}
+		}
+		#endregion
+		#region LoadFromDataTable
+		/// <summary>
+		/// Load the data from the datatable starting from the top left cell of the range
+		/// </summary>
+		/// <param name="Table">The datatable to load</param>
+		/// <param name="PrintHeaders">Print the column caption property (if set) or the columnname property if not, on first row</param>
+		/// <param name="TableStyle">The table style to apply to the data</param>
+		/// <returns>The filled range</returns>
+		public ExcelRangeBase LoadFromDataTable(DataTable Table, bool PrintHeaders, TableStyles TableStyle)
+		{
+			var r = LoadFromDataTable(Table, PrintHeaders);
+
+			int rows = Table.Rows.Count + (PrintHeaders ? 1 : 0) - 1;
+            if (rows >= 0 && Table.Columns.Count>0)
+			{
+                var tbl = _worksheet.Tables.Add(new ExcelAddressBase(_fromRow, _fromCol, _fromRow + (rows==0 ? 1 : rows), _fromCol + Table.Columns.Count-1), Table.TableName);
+				tbl.ShowHeader = PrintHeaders;
+				tbl.TableStyle = TableStyle;
+			}
+		    return r;
+		}
+		/// <summary>
+		/// Load the data from the datatable starting from the top left cell of the range
+		/// </summary>
+		/// <param name="Table">The datatable to load</param>
+		/// <param name="PrintHeaders">Print the caption property (if set) or the columnname property if not, on first row</param>
+		/// <returns>The filled range</returns>
+		public ExcelRangeBase LoadFromDataTable(DataTable Table, bool PrintHeaders)
+		{
+			if (Table == null)
+			{
+				throw (new ArgumentNullException("Table can't be null"));
+			}
+
+			int col = _fromCol, row = _fromRow;
+			if (PrintHeaders)
+			{
+				foreach (DataColumn dc in Table.Columns)
+				{
+                    // If no caption is set, the ColumnName property is called implicitly.
+					_worksheet.Cell(row, col++).Value = dc.Caption;
+				}
+				row++;
+				col = _fromCol;
+			}
+			foreach (DataRow dr in Table.Rows)
+			{
+				foreach (object value in dr.ItemArray)
+				{
+					_worksheet.Cell(row, col++).Value = value;
+				}
+				row++;
+				col = _fromCol;
+			}
+            return _worksheet.Cells[_fromRow, _fromCol, row - 1, _fromCol + Table.Columns.Count - 1];
+		}
+		#endregion
+		#region LoadFromArrays
+		/// <summary>
+		/// Loads data from the collection of arrays of objects into the range, starting from
+		/// the top-left cell.
+		/// </summary>
+		/// <param name="Data">The data.</param>
+		public ExcelRangeBase LoadFromArrays(IEnumerable<object[]> Data)
+		{
+			//thanx to Abdullin for the code contribution
+			if (Data == null) throw new ArgumentNullException("data");
+
+			int column = _fromCol, row = _fromRow;
+
+			foreach (var rowData in Data)
+			{
+				column = _fromCol;
+				foreach (var cellData in rowData)
+				{
+					_worksheet.Cell(row, column).Value = cellData;
+					column += 1;
+				}
+				row += 1;
+			}
+			return _worksheet.Cells[_fromRow, _fromCol, row - 1, column - 1];
+		}
+		#endregion
+		#region LoadFromCollection
+		/// <summary>
+		/// Load a collection into a the worksheet starting from the top left row of the range.
+		/// </summary>
+		/// <typeparam name="T">The datatype in the collection</typeparam>
+		/// <param name="Collection">The collection to load</param>
+		/// <returns>The filled range</returns>
+		public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection)
+		{
+			return LoadFromCollection<T>(Collection, false, TableStyles.None, BindingFlags.Public | BindingFlags.Instance, null);
+		}
+		/// <summary>
+		/// Load a collection of T into the worksheet starting from the top left row of the range.
+		/// Default option will load all public instance properties of T
+		/// </summary>
+		/// <typeparam name="T">The datatype in the collection</typeparam>
+		/// <param name="Collection">The collection to load</param>
+		/// <param name="PrintHeaders">Print the property names on the first row</param>
+		/// <returns>The filled range</returns>
+		public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection, bool PrintHeaders)
+		{
+			return LoadFromCollection<T>(Collection, PrintHeaders, TableStyles.None, BindingFlags.Public | BindingFlags.Instance, null);
+		}
+		/// <summary>
+		/// Load a collection of T into the worksheet starting from the top left row of the range.
+		/// Default option will load all public instance properties of T
+		/// </summary>
+		/// <typeparam name="T">The datatype in the collection</typeparam>
+		/// <param name="Collection">The collection to load</param>
+		/// <param name="PrintHeaders">Print the property names on the first row</param>
+		/// <param name="TableStyle">Will create a table with this style. If set to TableStyles.None no table will be created</param>
+		/// <returns>The filled range</returns>
+		public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection, bool PrintHeaders, TableStyles TableStyle)
+		{
+			return LoadFromCollection<T>(Collection, PrintHeaders, TableStyle, BindingFlags.Public | BindingFlags.Instance, null);
+		}
+		/// <summary>
+		/// Load a collection into the worksheet starting from the top left row of the range.
+		/// </summary>
+		/// <typeparam name="T">The datatype in the collection</typeparam>
+		/// <param name="Collection">The collection to load</param>
+		/// <param name="PrintHeaders">Print the property names on the first row. Any underscore in the property name will be converted to a space.</param>
+		/// <param name="TableStyle">Will create a table with this style. If set to TableStyles.None no table will be created</param>
+		/// <param name="memberFlags">Property flags to use</param>
+		/// <param name="Members">The properties to output. Must be of type T</param>
+		/// <returns>The filled range</returns>
+		public ExcelRangeBase LoadFromCollection<T>(IEnumerable<T> Collection, bool PrintHeaders, TableStyles TableStyle, BindingFlags memberFlags, MemberInfo[] Members)
+		{
+			var type = typeof(T);
+			if (Members == null)
+			{
+				Members = type.GetProperties(memberFlags);
+			}
+			else
+			{
+				foreach (var t in Members)
+				{
+					if (t.DeclaringType != type)
+					{
+						throw (new Exception("Supplied properties in parameter Properties must be of the same type as T"));
+					}
+				}
+			}
+
+			int col = _fromCol, row = _fromRow;
+			if (Members.Length > 0 && PrintHeaders)
+			{
+				foreach (var t in Members)
+				{
+					_worksheet.Cell(row, col++).Value = t.Name.Replace('_', ' ');
+				}
+				row++;
+			}
+
+			if (Members.Length == 0)
+			{
+				foreach (var item in Collection)
+				{
+					_worksheet.Cells[row++, col].Value = item;
+				}
+			}
+			else
+			{
+				foreach (var item in Collection)
+				{
+					col = _fromCol;
+                    if (item is string || item is decimal || item is DateTime || item.GetType().IsPrimitive)
+                    {
+                        _worksheet.Cells[row, col++].Value = item;
+                    }
+                    else
+                    {
+                        foreach (var t in Members)
+                        {
+                            if (t is PropertyInfo)
+                            {
+                                _worksheet.Cells[row, col++].Value = ((PropertyInfo)t).GetValue(item, null);
+                            }
+                            else if (t is FieldInfo)
+                            {
+                                _worksheet.Cells[row, col++].Value = ((FieldInfo)t).GetValue(item);
+                            }
+                            else if (t is MethodInfo)
+                            {
+                                _worksheet.Cells[row, col++].Value = ((MethodInfo)t).Invoke(item, null);
+                            }
+                        }
+                    }
+					row++;
+				}
+			}
+
+            var r = _worksheet.Cells[_fromRow, _fromCol, row - 1, Members.Length==0 ? col : col - 1];
+
+			if (TableStyle != TableStyles.None)
+			{
+				var tbl = _worksheet.Tables.Add(r, "");
+				tbl.ShowHeader = PrintHeaders;
+				tbl.TableStyle = TableStyle;
+			}
+			return r;
+		}
+		#endregion
+		#region LoadFromText
+		/// <summary>
+		/// Loads a CSV text into a range starting from the top left cell.
+		/// Default settings is Comma separation
+		/// </summary>
+		/// <param name="Text">The Text</param>
+		/// <returns>The range containing the data</returns>
+		public ExcelRangeBase LoadFromText(string Text)
+		{
+			return LoadFromText(Text, new ExcelTextFormat());
+		}
+		/// <summary>
+		/// Loads a CSV text into a range starting from the top left cell.
+		/// </summary>
+		/// <param name="Text">The Text</param>
+		/// <param name="Format">Information how to load the text</param>
+		/// <returns>The range containing the data</returns>
+		public ExcelRangeBase LoadFromText(string Text, ExcelTextFormat Format)
+		{
+            if (string.IsNullOrEmpty(Text))
+            {
+                var r = _worksheet.Cells[_fromRow, _fromCol];
+                r.Value = "";
+                return r;
+            }
+            
+            if (Format == null) Format = new ExcelTextFormat();
+
+            string[] lines = Regex.Split(Text, Format.EOL);
+			int row = _fromRow;
+			int col = _fromCol;
+			int maxCol = col;
+			int lineNo = 1;
+			foreach (string line in lines)
+			{
+				if (lineNo > Format.SkipLinesBeginning && lineNo <= lines.Length - Format.SkipLinesEnd)
+				{
+					col = _fromCol;
+					string v = "";
+					bool isText = false, isQualifier = false;
+					int QCount = 0;
+					foreach (char c in line)
+					{
+						if (Format.TextQualifier != 0 && c == Format.TextQualifier)
+						{
+							if (!isText && v != "")
+							{
+								throw (new Exception(string.Format("Invalid Text Qualifier in line : {0}", line)));
+							}
+							isQualifier = !isQualifier;
+							QCount += 1;
+							isText = true;
+						}
+						else
+						{
+                            if (QCount > 1 && !string.IsNullOrEmpty(v))
+							{
+								v += new string(Format.TextQualifier, QCount / 2);
+							}
+                            else if(QCount>2 && string.IsNullOrEmpty(v))
+                            {
+                                v += new string(Format.TextQualifier, (QCount-1) / 2);
+                            }
+
+							if (isQualifier)
+							{
+								v += c;
+							}
+							else
+							{
+								if (c == Format.Delimiter)
+								{
+									_worksheet.Cell(row, col).Value = ConvertData(Format, v, col - _fromCol, isText);
+									v = "";
+									isText = false;
+									col++;
+								}
+								else
+								{
+									if (QCount % 2 == 1)
+									{
+										throw (new Exception(string.Format("Text delimiter is not closed in line : {0}", line)));
+									}
+									v += c;
+								}
+							}
+							QCount = 0;
+						}
+					}
+					if (QCount > 1)
+					{
+						v += new string(Format.TextQualifier, QCount / 2);
+					}
+
+					_worksheet.Cell(row, col).Value = ConvertData(Format, v, col - _fromCol, isText);
+					if (col > maxCol) maxCol = col;
+					row++;
+				}
+				lineNo++;
+			}
+			return _worksheet.Cells[_fromRow, _fromCol, row - 1, maxCol];
+		}
+		/// <summary>
+		/// Loads a CSV text into a range starting from the top left cell.
+		/// </summary>
+		/// <param name="Text">The Text</param>
+		/// <param name="Format">Information how to load the text</param>
+		/// <param name="TableStyle">Create a table with this style</param>
+		/// <param name="FirstRowIsHeader">Use the first row as header</param>
+		/// <returns></returns>
+		public ExcelRangeBase LoadFromText(string Text, ExcelTextFormat Format, TableStyles TableStyle, bool FirstRowIsHeader)
+		{
+			var r = LoadFromText(Text, Format);
+
+			var tbl = _worksheet.Tables.Add(r, "");
+			tbl.ShowHeader = FirstRowIsHeader;
+			tbl.TableStyle = TableStyle;
+
+			return r;
+		}
+		/// <summary>
+		/// Loads a CSV file into a range starting from the top left cell.
+		/// </summary>
+		/// <param name="TextFile">The Textfile</param>
+		/// <returns></returns>
+		public ExcelRangeBase LoadFromText(FileInfo TextFile)
+		{
+			return LoadFromText(File.ReadAllText(TextFile.FullName, Encoding.ASCII));
+		}
+		/// <summary>
+		/// Loads a CSV file into a range starting from the top left cell.
+		/// </summary>
+		/// <param name="TextFile">The Textfile</param>
+		/// <param name="Format">Information how to load the text</param>
+		/// <returns></returns>
+		public ExcelRangeBase LoadFromText(FileInfo TextFile, ExcelTextFormat Format)
+		{
+			return LoadFromText(File.ReadAllText(TextFile.FullName, Format.Encoding), Format);
+		}
+		/// <summary>
+		/// Loads a CSV file into a range starting from the top left cell.
+		/// </summary>
+		/// <param name="TextFile">The Textfile</param>
+		/// <param name="Format">Information how to load the text</param>
+		/// <param name="TableStyle">Create a table with this style</param>
+		/// <param name="FirstRowIsHeader">Use the first row as header</param>
+		/// <returns></returns>
+		public ExcelRangeBase LoadFromText(FileInfo TextFile, ExcelTextFormat Format, TableStyles TableStyle, bool FirstRowIsHeader)
+		{
+			return LoadFromText(File.ReadAllText(TextFile.FullName, Format.Encoding), Format, TableStyle, FirstRowIsHeader);
+		}
+		#endregion
+		#region GetValue
+		/// <summary>
+		/// Get the strongly typed value of the cell.
+		/// </summary>
+		/// <typeparam name="T">The type</typeparam>
+		/// <returns>The value. If the value can't be converted to the specified type, the default value will be returned</returns>
+		public T GetValue<T>()
+		{
+			return _worksheet.GetTypedValue<T>(Value);
+		}
+		#endregion
+		/// <summary>
+		/// Get a range with an offset from the top left cell.
+		/// The new range has the same dimensions as the current range
+		/// </summary>
+		/// <param name="RowOffset">Row Offset</param>
+		/// <param name="ColumnOffset">Column Offset</param>
+		/// <returns></returns>
+		public ExcelRangeBase Offset(int RowOffset, int ColumnOffset)
+		{
+			if (_fromRow + RowOffset < 1 || _fromCol + ColumnOffset < 1 || _fromRow + RowOffset > ExcelPackage.MaxRows || _fromCol + ColumnOffset > ExcelPackage.MaxColumns)
+			{
+				throw (new ArgumentOutOfRangeException("Offset value out of range"));
+			}
+			string address = GetAddress(_fromRow + RowOffset, _fromCol + ColumnOffset, _toRow + RowOffset, _toCol + ColumnOffset);
+			return new ExcelRangeBase(_worksheet, address);
+		}
+		/// <summary>
+		/// Get a range with an offset from the top left cell.
+		/// </summary>
+		/// <param name="RowOffset">Row Offset</param>
+		/// <param name="ColumnOffset">Column Offset</param>
+		/// <param name="NumberOfRows">Number of rows. Minimum 1</param>
+		/// <param name="NumberOfColumns">Number of colums. Minimum 1</param>
+		/// <returns></returns>
+		public ExcelRangeBase Offset(int RowOffset, int ColumnOffset, int NumberOfRows, int NumberOfColumns)
+		{
+			if (NumberOfRows < 1 || NumberOfColumns < 1)
+			{
+				throw (new Exception("Number of rows/columns must be greater than 0"));
+			}
+			NumberOfRows--;
+			NumberOfColumns--;
+			if (_fromRow + RowOffset < 1 || _fromCol + ColumnOffset < 1 || _fromRow + RowOffset > ExcelPackage.MaxRows || _fromCol + ColumnOffset > ExcelPackage.MaxColumns ||
+				 _fromRow + RowOffset + NumberOfRows < 1 || _fromCol + ColumnOffset + NumberOfColumns < 1 || _fromRow + RowOffset + NumberOfRows > ExcelPackage.MaxRows || _fromCol + ColumnOffset + NumberOfColumns > ExcelPackage.MaxColumns)
+			{
+				throw (new ArgumentOutOfRangeException("Offset value out of range"));
+			}
+			string address = GetAddress(_fromRow + RowOffset, _fromCol + ColumnOffset, _fromRow + RowOffset + NumberOfRows, _fromCol + ColumnOffset + NumberOfColumns);
+			return new ExcelRangeBase(_worksheet, address);
+		}
+		/// <summary>
+		/// Adds a new comment for the range.
+		/// If this range contains more than one cell, the top left comment is returned by the method.
+		/// </summary>
+		/// <param name="Text"></param>
+		/// <param name="Author"></param>
+		/// <returns>A reference comment of the top left cell</returns>
+		public ExcelComment AddComment(string Text, string Author)
+		{
+			//Check if any comments exists in the range and throw an exception
+			_changePropMethod(Exists_Comment, null);
+			//Create the comments
+			_changePropMethod(Set_Comment, new string[] { Text, Author });
+
+
+			return _worksheet.Comments[new ExcelCellAddress(_fromRow, _fromCol)];
+		}
+
+		/// <summary>
+		/// Copies the range of cells to an other range
+		/// </summary>
+		/// <param name="Destination">The start cell where the range will be copied.</param>
+		public void Copy(ExcelRangeBase Destination)
+		{
+            bool sameWorkbook = Destination._worksheet.Workbook == _worksheet.Workbook;
+            ExcelStyles sourceStyles = _worksheet.Workbook.Styles,
+                                    styles = Destination._worksheet.Workbook.Styles;
+            Dictionary<int, int> styleCashe = new Dictionary<int, int>();
+
+            //Delete all existing cells;            
+            List<ExcelCell> newCells = new List<ExcelCell>();
+            Dictionary<ulong, ExcelCell> mergedCells = new Dictionary<ulong, ExcelCell>();
+            foreach (var cell in this)
+            {
+                //Clone the cell
+                var copiedCell = (_worksheet._cells[GetCellID(_worksheet.SheetID, cell._fromRow, cell._fromCol)] as ExcelCell);
+
+                var newCell = copiedCell.Clone(Destination._worksheet,
+                        Destination._fromRow + (copiedCell.Row - _fromRow),
+                        Destination._fromCol + (copiedCell.Column - _fromCol));
+
+                newCell.MergeId = _worksheet.GetMergeCellId(copiedCell.Row, copiedCell.Column);
+
+                //If the formula is shared, remove the shared ID and set the formula for the cell.
+                if (newCell._sharedFormulaID >= 0)
+                {
+                    newCell._sharedFormulaID = int.MinValue;
+                    newCell.Formula = cell.Formula;
+                }
+
+                if (!string.IsNullOrEmpty(newCell.Formula))
+                {
+                    newCell.Formula = ExcelCell.UpdateFormulaReferences(newCell.Formula, newCell.Row - copiedCell.Row, (newCell.Column - copiedCell.Column), 1, 1);
+                }
+
+                //If its not the same workbook we must copy the styles to the new workbook.
+                if (!sameWorkbook)
+                {
+                    if (styleCashe.ContainsKey(cell.StyleID))
+                    {
+                        newCell.StyleID = styleCashe[cell.StyleID];
+                    }
+                    else
+                    {
+                        newCell.StyleID = styles.CloneStyle(sourceStyles, cell.StyleID);
+                        styleCashe.Add(cell.StyleID, newCell.StyleID);
+                    }
+                }
+                newCells.Add(newCell);
+                if (newCell.Merge) mergedCells.Add(newCell.CellID, newCell);
+            }
+
+            //Now clear the destination.
+            Destination.Offset(0, 0, (_toRow - _fromRow) + 1, (_toCol - _fromCol) + 1).Clear();
+
+            //And last add the new cells to the worksheet
+            foreach (var cell in newCells)
+            {
+                Destination.Worksheet._cells.Add(cell);
+            }
+            //Add merged cells
+            if (mergedCells.Count > 0)
+            {
+                List<ExcelAddressBase> mergedAddresses = new List<ExcelAddressBase>();
+                foreach (var cell in mergedCells.Values)
+                {
+                    if (!IsAdded(cell, mergedAddresses))
+                    {
+                        int startRow = cell.Row, startCol = cell.Column, endRow = cell.Row, endCol = cell.Column + 1;
+                        while (mergedCells.ContainsKey(ExcelCell.GetCellID(Destination.Worksheet.SheetID, endRow, endCol)))
+                        {
+                            ExcelCell next = mergedCells[ExcelCell.GetCellID(Destination.Worksheet.SheetID, endRow, endCol)];
+                            if (cell.MergeId != next.MergeId)
+                            {
+                                break;
+                            }
+                            endCol++;
+                        }
+
+                        while (IsMerged(mergedCells, Destination.Worksheet, endRow, startCol, endCol - 1, cell))
+                        {
+                            endRow++;
+                        }
+
+                        mergedAddresses.Add(new ExcelAddressBase(startRow, startCol, endRow - 1, endCol - 1));
+                    }
+                }
+                Destination.Worksheet.MergedCells.List.AddRange((from r in mergedAddresses select r.Address));
+            }
+		}
+
+		private bool IsAdded(ExcelCell cell, List<ExcelAddressBase> mergedAddresses)
+		{
+            foreach (var address in mergedAddresses)
+            {
+                if (address.Collide(new ExcelAddressBase(cell.CellAddress)) == eAddressCollition.Inside)
+                {
+                    return true;
+                }
+            }
+            return false;
+		}
+
+		private bool IsMerged(Dictionary<ulong, ExcelCell> mergedCells, ExcelWorksheet worksheet, int row, int startCol, int endCol, ExcelCell cell)
+		{
+            for (int col = startCol; col <= endCol; col++)
+            {
+                if (!mergedCells.ContainsKey(ExcelCell.GetCellID(worksheet.SheetID, row, col)))
+                {
+                    return false;
+                }
+                else
+                {
+                    ExcelCell next = mergedCells[ExcelCell.GetCellID(worksheet.SheetID, row, col)];
+                    if (cell.MergeId != next.MergeId)
+                    {
+                        return false;
+                    }
+                }
+            }
+            return true;
+		}
+
+		/// <summary>
+		/// Clear all cells
+		/// </summary>
+		public void Clear()
+		{
+			Delete(this);
+		}
+		/// <summary>
+		/// Creates an array-formula.
+		/// </summary>
+		/// <param name="ArrayFormula">The formula</param>
+		public void CreateArrayFormula(string ArrayFormula)
+		{
+			if (Addresses != null)
+			{
+				throw (new Exception("An Arrayformula can not have more than one address"));
+			}
+			Set_SharedFormula(ArrayFormula, this, true);
+		}
+		private void Delete(ExcelAddressBase Range)
+		{
+            DeleteCheckMergedCells(Range);
+			//First find the start cell
+            ulong startID = GetCellID(_worksheet.SheetID, Range._fromRow, Range._fromCol);
+			int index = _worksheet._cells.IndexOf(startID);
+			if (index < 0)
+			{
+				index = ~index;
+			}
+			ExcelCell cell;
+			//int row=cell.Row, col=cell.Column;
+			//Remove all cells in the range
+			while (index < _worksheet._cells.Count)
+			{
+				cell = _worksheet._cells[index] as ExcelCell;
+				if (cell.Row > Range._toRow || cell.Row == Range._toRow && cell.Column > Range._toCol)
+				{
+					break;
+				}
+				else
+				{
+					if (cell.Column >= Range._fromCol && cell.Column <= Range._toCol)
+					{
+						_worksheet._cells.Delete(cell.CellID);
+					}
+					else
+					{
+						index++;
+					}
+				}
+			}
+
+			//Delete multi addresses as well
+			if (Addresses != null)
+			{
+				foreach (var sub in Addresses)
+				{
+					Delete(sub);
+				}
+            }
+        }
+
+        private void DeleteCheckMergedCells(ExcelAddressBase Range)
+        {
+            var removeItems = new List<string>();
+            foreach (var addr in Worksheet.MergedCells)
+            {
+                var addrCol = Range.Collide(new ExcelAddress(Range.WorkSheet, addr));
+                if (addrCol != eAddressCollition.No)
+                {
+                    if (addrCol == eAddressCollition.Inside)
+                    {
+                        removeItems.Add(addr);
+                    }
+                    else
+                    {
+                        throw (new InvalidOperationException("Can't remove/overwrite cells that are merged"));
+                    }
+                }
+            }
+            foreach (var item in removeItems)
+            {
+                Worksheet.MergedCells.Remove(item);
+			}
+		}
+		#endregion
+		#region IDisposable Members
+
+		public void Dispose()
+		{
+			//_worksheet = null;
+		}
+
+		#endregion
+		#region "Enumerator"
+		int _index;
+		ulong _toCellId;
+		int _enumAddressIx;
+		public IEnumerator<ExcelRangeBase> GetEnumerator()
+		{
+			Reset();
+			return this;
+		}
+
+		IEnumerator IEnumerable.GetEnumerator()
+		{
+			Reset();
+			return this;
+		}
+
+		/// <summary>
+		/// The current range when enumerating
+		/// </summary>
+		public ExcelRangeBase Current
+		{
+			get
+			{
+				return new ExcelRangeBase(_worksheet, (_worksheet._cells[_index] as ExcelCell).CellAddress);
+			}
+		}
+
+		/// <summary>
+		/// The current range when enumerating
+		/// </summary>
+		object IEnumerator.Current
+		{
+			get
+			{
+				return ((object)(new ExcelRangeBase(_worksheet, (_worksheet._cells[_index] as ExcelCell).CellAddress)));
+			}
+		}
+
+		public bool MoveNext()
+		{
+			_index++;
+			if (_enumAddressIx == -1)
+			{
+				GetNextIndexEnum(_fromRow, _fromCol, _toRow, _toCol);
+
+				if (_index >= _worksheet._cells.Count || _worksheet._cells[_index].RangeID > _toCellId)
+				{
+					if (Addresses == null)
+					{
+						return false;
+					}
+					else
+					{
+						_enumAddressIx++;
+						GetStartIndexEnum(Addresses[0].Start.Row, Addresses[0].Start.Column, Addresses[0].End.Row, Addresses[0].End.Column);
+						return MoveNext();
+					}
+				}
+
+			}
+			else
+			{
+				GetNextIndexEnum(Addresses[_enumAddressIx].Start.Row, Addresses[_enumAddressIx].Start.Column, Addresses[_enumAddressIx].End.Row, Addresses[_enumAddressIx].End.Column);
+				if (_index >= _worksheet._cells.Count || _worksheet._cells[_index].RangeID > _toCellId)
+				{
+					if (++_enumAddressIx < Addresses.Count)
+					{
+						GetStartIndexEnum(Addresses[_enumAddressIx].Start.Row, Addresses[_enumAddressIx].Start.Column, Addresses[_enumAddressIx].End.Row, Addresses[_enumAddressIx].End.Column);
+						MoveNext();
+					}
+					else
+					{
+						return false;
+					}
+				}
+			}
+			return true;
+		}
+
+		public void Reset()
+		{
+			_enumAddressIx = -1;
+			GetStartIndexEnum(_fromRow, _fromCol, _toRow, _toCol);
+		}
+
+		private void GetNextIndexEnum(int fromRow, int fromCol, int toRow, int toCol)
+		{
+			if (_index >= _worksheet._cells.Count) return;
+			ExcelCell cell = _worksheet._cells[_index] as ExcelCell;
+			while (cell.Column > toCol || cell.Column < fromCol)
+			{
+				if (cell.Column < fromCol)
+				{
+					_index = _worksheet._cells.IndexOf(ExcelAddress.GetCellID(_worksheet.SheetID, cell.Row, fromCol));
+				}
+				else
+				{
+					_index = _worksheet._cells.IndexOf(ExcelAddress.GetCellID(_worksheet.SheetID, cell.Row + 1, fromCol));
+				}
+
+				if (_index < 0)
+				{
+					_index = ~_index;
+				}
+				if (_index >= _worksheet._cells.Count || _worksheet._cells[_index].RangeID > _toCellId)
+				{
+					break;
+				}
+				cell = _worksheet._cells[_index] as ExcelCell;
+			}
+		}
+
+		private void GetStartIndexEnum(int fromRow, int fromCol, int toRow, int toCol)
+		{
+			_index = _worksheet._cells.IndexOf(ExcelCellBase.GetCellID(_worksheet.SheetID, fromRow, fromCol));
+			_toCellId = ExcelCellBase.GetCellID(_worksheet.SheetID, toRow, toCol);
+			if (_index < 0)
+			{
+				_index = ~_index;
+			}
+			_index--;
+		}
+    #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelRow.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelRow.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelRow.cs	(revision 9616)
@@ -0,0 +1,267 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		        2009-10-01
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+
+using System;
+using System.Xml;
+using OfficeOpenXml.Style;
+namespace OfficeOpenXml
+{
+	/// <summary>
+	/// Represents an individual row in the spreadsheet.
+	/// </summary>
+	public class ExcelRow : IRangeID
+	{
+		private ExcelWorksheet _worksheet;
+		private XmlElement _rowElement = null;
+        /// <summary>
+        /// Internal RowID.
+        /// </summary>
+        public ulong RowID 
+        {
+            get
+            {
+                return GetRowID(_worksheet.SheetID, Row);
+            }
+        }
+		#region ExcelRow Constructor
+		/// <summary>
+		/// Creates a new instance of the ExcelRow class. 
+		/// For internal use only!
+		/// </summary>
+		/// <param name="Worksheet">The parent worksheet</param>
+		/// <param name="row">The row number</param>
+		internal ExcelRow(ExcelWorksheet Worksheet, int row)
+		{
+			_worksheet = Worksheet;
+            Row = row;
+		}
+		#endregion
+
+		/// <summary>
+		/// Provides access to the node representing the row.
+		/// </summary>
+		internal XmlNode Node { get { return (_rowElement); } }
+
+		#region ExcelRow Hidden
+        bool _hidden = false;
+        /// <summary>
+		/// Allows the row to be hidden in the worksheet
+		/// </summary>
+		public bool Hidden
+        {
+            get
+            {
+                return _hidden;
+            }
+            set
+            {
+                if (_worksheet._package.DoAdjustDrawings)
+                {
+                    var pos = _worksheet.Drawings.GetDrawingHeight();
+                    _hidden = value;
+                    _worksheet.Drawings.AdjustHeight(pos);
+                }
+                else
+                {
+                    _hidden = value;
+                }
+            }
+        }        
+		#endregion
+
+		#region ExcelRow Height
+        double _height=-1;  //Set to default height
+        /// <summary>
+		/// Sets the height of the row
+		/// </summary>
+		public double Height
+        {
+			get
+			{
+                if (_height == -1)
+                {
+                    return _worksheet.DefaultRowHeight;
+                }
+                else
+                {
+                    return _height;
+                }
+                //}
+			}
+			set	
+            {
+                if (_worksheet._package.DoAdjustDrawings)
+                {
+                    var pos = _worksheet.Drawings.GetDrawingWidths();
+                    _height = value;
+                    _worksheet.Drawings.AdjustHeight(pos);
+                }
+                else
+                {
+                    _height = value;
+                }
+
+                if (Hidden && value != 0)
+                {
+                    Hidden = false;
+                }
+                CustomHeight = (value != _worksheet.DefaultRowHeight);
+            }
+        }
+        /// <summary>
+        /// Set to true if You don't want the row to Autosize
+        /// </summary>
+        public bool CustomHeight { get; set; }
+		#endregion
+
+        internal string _styleName = "";
+        /// <summary>
+        /// Sets the style for the entire column using a style name.
+        /// </summary>
+        public string StyleName
+        {
+            get
+            {
+                return _styleName;
+            }
+            set
+            {
+                _styleId = _worksheet.Workbook.Styles.GetStyleIdFromName(value);
+                _styleName = value;
+            }
+        }        
+        internal int _styleId = 0;
+		/// <summary>
+		/// Sets the style for the entire row using the style ID.  
+		/// </summary>
+        public int StyleID
+		{
+			get
+			{
+				return _styleId; 
+			}
+			set	
+			{
+                _styleId = value;
+			}
+		}
+
+        /// <summary>
+        /// Rownumber
+        /// </summary>
+        public int Row
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// If outline level is set this tells that the row is collapsed
+        /// </summary>
+        public bool Collapsed
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// Outline level.
+        /// </summary>
+        public int OutlineLevel
+        {
+            get;
+            set;
+        }        
+        /// <summary>
+        /// Show phonetic Information
+        /// </summary>
+        public bool Phonetic 
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The Style applied to the whole row. Only effekt cells with no individual style set. 
+        /// Use ExcelRange object if you want to set specific styles.
+        /// </summary>
+        public ExcelStyle Style
+        {
+            get
+            {
+                return _worksheet.Workbook.Styles.GetStyleObject(StyleID,_worksheet.PositionID ,Row.ToString()+":"+Row.ToString());                
+            }
+        }
+        /// <summary>
+        /// Adds a manual page break after the row.
+        /// </summary>
+        public bool PageBreak
+        {
+            get;
+            set;
+        }
+        internal static ulong GetRowID(int sheetID, int row)
+        {
+            return ((ulong)sheetID) + (((ulong)row) << 29);
+
+        }
+
+        #region IRangeID Members
+
+        ulong IRangeID.RangeID
+        {
+            get
+            {
+                return RowID; 
+            }
+            set
+            {
+                Row = ((int)(value >> 29));
+            }
+        }
+
+        #endregion
+        /// <summary>
+        /// Copies the current row to a new worksheet
+        /// </summary>
+        /// <param name="added">The worksheet where the copy will be created</param>
+        internal void Clone(ExcelWorksheet added)
+        {
+            ExcelRow newRow = added.Row(Row);
+            newRow.Collapsed = Collapsed;
+            newRow.Height = Height;
+            newRow.Hidden = Hidden;
+            newRow.OutlineLevel = OutlineLevel;
+            newRow.PageBreak = PageBreak;
+            newRow.Phonetic = Phonetic;
+            newRow.StyleName = StyleName;
+            newRow.StyleID = StyleID;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelSheetProtection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelSheetProtection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelSheetProtection.cs	(revision 9616)
@@ -0,0 +1,332 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		        2010-03-14
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Security.Cryptography;
+using OfficeOpenXml.Utils;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Sheet protection
+    ///<seealso cref="ExcelEncryption"/> 
+    ///<seealso cref="ExcelProtection"/> 
+    /// </summary>
+    public sealed class ExcelSheetProtection : XmlHelper
+    {
+        internal ExcelSheetProtection (XmlNamespaceManager nsm, XmlNode topNode,ExcelWorksheet ws) :
+            base(nsm, topNode)
+        {
+            SchemaNodeOrder = ws.SchemaNodeOrder;
+        }        
+        private const string _isProtectedPath="d:sheetProtection/@sheet";
+        /// <summary>
+        /// If the worksheet is protected.
+        /// </summary>
+        public bool IsProtected
+        {
+            get
+            {
+                return GetXmlNodeBool(_isProtectedPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_isProtectedPath, value, false);
+                if (value)
+                {
+                    AllowEditObject = true;
+                    AllowEditScenarios = true;
+                }
+                else
+                {
+                    DeleteAllNode(_isProtectedPath); //delete the whole sheetprotection node
+                }
+            }
+        }
+        private const string _allowSelectLockedCellsPath = "d:sheetProtection/@selectLockedCells";
+        /// <summary>
+        /// Allow users to select locked cells
+        /// </summary>
+        public bool AllowSelectLockedCells
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowSelectLockedCellsPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowSelectLockedCellsPath, !value, false);
+            }
+        }
+        private const string _allowSelectUnlockedCellsPath = "d:sheetProtection/@selectUnlockedCells";
+        /// <summary>
+        /// Allow users to select unlocked cells
+        /// </summary>
+        public bool AllowSelectUnlockedCells
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowSelectUnlockedCellsPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowSelectUnlockedCellsPath, !value, false);
+            }
+        }        
+        private const string _allowObjectPath="d:sheetProtection/@objects";
+        /// <summary>
+        /// Allow users to edit objects
+        /// </summary>
+        public bool AllowEditObject
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowObjectPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowObjectPath, !value, false);
+            }
+        }
+        private const string _allowScenariosPath="d:sheetProtection/@scenarios";
+        /// <summary>
+        /// Allow users to edit senarios
+        /// </summary>
+        public bool AllowEditScenarios
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowScenariosPath, false);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowScenariosPath, !value, false);
+            }
+        }
+        private const string _allowFormatCellsPath="d:sheetProtection/@formatCells";
+        /// <summary>
+        /// Allow users to format cells
+        /// </summary>
+        public bool AllowFormatCells 
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowFormatCellsPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowFormatCellsPath, !value, true );
+            }
+        }
+        private const string _allowFormatColumnsPath = "d:sheetProtection/@formatColumns";
+        /// <summary>
+        /// Allow users to Format columns
+        /// </summary>
+        public bool AllowFormatColumns
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowFormatColumnsPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowFormatColumnsPath, !value, true);
+            }
+        }
+        private const string _allowFormatRowsPath = "d:sheetProtection/@formatRows";
+        /// <summary>
+        /// Allow users to Format rows
+        /// </summary>
+        public bool AllowFormatRows
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowFormatRowsPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowFormatRowsPath, !value, true);
+            }
+        }
+
+        private const string _allowInsertColumnsPath = "d:sheetProtection/@insertColumns";
+        /// <summary>
+        /// Allow users to insert columns
+        /// </summary>
+        public bool AllowInsertColumns
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowInsertColumnsPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowInsertColumnsPath, !value, true);
+            }
+        }
+
+        private const string _allowInsertRowsPath = "d:sheetProtection/@insertRows";
+        /// <summary>
+        /// Allow users to Format rows
+        /// </summary>
+        public bool AllowInsertRows
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowInsertRowsPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowInsertRowsPath, !value, true);
+            }
+        }
+        private const string _allowInsertHyperlinksPath = "d:sheetProtection/@insertHyperlinks";
+        /// <summary>
+        /// Allow users to insert hyperlinks
+        /// </summary>
+        public bool AllowInsertHyperlinks
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowInsertHyperlinksPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowInsertHyperlinksPath, !value, true);
+            }
+        }
+        private const string _allowDeleteColumns = "d:sheetProtection/@deleteColumns";
+        /// <summary>
+        /// Allow users to delete columns
+        /// </summary>
+        public bool AllowDeleteColumns
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowDeleteColumns, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowDeleteColumns, !value, true);
+            }
+        }
+        private const string _allowDeleteRowsPath = "d:sheetProtection/@deleteRows";
+        /// <summary>
+        /// Allow users to delete rows
+        /// </summary>
+        public bool AllowDeleteRows
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowDeleteRowsPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowDeleteRowsPath, !value, true);
+            }
+        }
+
+        private const string _allowSortPath = "d:sheetProtection/@sort";
+        /// <summary>
+        /// Allow users to sort a range
+        /// </summary>
+        public bool AllowSort
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowSortPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowSortPath, !value, true);
+            }
+        }
+
+        private const string _allowAutoFilterPath = "d:sheetProtection/@autoFilter";
+        /// <summary>
+        /// Allow users to use autofilters
+        /// </summary>
+        public bool AllowAutoFilter
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowAutoFilterPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowAutoFilterPath, !value, true);
+            }
+        }
+        private const string _allowPivotTablesPath = "d:sheetProtection/@pivotTables";
+        /// <summary>
+        /// Allow users to use pivottables
+        /// </summary>
+        public bool AllowPivotTables
+        {
+            get
+            {
+                return !GetXmlNodeBool(_allowPivotTablesPath, true);
+            }
+            set
+            {
+                SetXmlNodeBool(_allowPivotTablesPath, !value, true);
+            }
+        }
+
+        private const string _passwordPath = "d:sheetProtection/@password";
+        /// <summary>
+        /// Sets a password for the sheet.
+        /// </summary>
+        /// <param name="Password"></param>
+        public void SetPassword(string Password)
+        {
+            if (IsProtected == false) IsProtected = true;
+
+            Password = Password.Trim();
+            if (Password == "")
+            {
+                var node = TopNode.SelectSingleNode(_passwordPath, NameSpaceManager);
+                if (node != null)
+                {
+                    (node as XmlAttribute).OwnerElement.Attributes.Remove(node as XmlAttribute);
+                }
+                return;
+            }
+
+            int hash = EncryptedPackageHandler.CalculatePasswordHash(Password);
+            SetXmlNodeString(_passwordPath, ((int)hash).ToString("x"));
+        }
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelStyleCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelStyleCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelStyleCollection.cs	(revision 9616)
@@ -0,0 +1,142 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		        2009-10-01
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Base collection class for styles.
+    /// </summary>
+    /// <typeparam name="T">The style type</typeparam>
+    public class ExcelStyleCollection<T> : IEnumerable<T>
+    {
+        public ExcelStyleCollection()
+        {
+            _setNextIdManual = false;
+        }
+        bool _setNextIdManual;
+        public ExcelStyleCollection(bool SetNextIdManual)
+        {
+            _setNextIdManual = SetNextIdManual;
+        }
+        public XmlNode TopNode { get; set; }
+        internal List<T> _list = new List<T>();
+        Dictionary<string, int> _dic = new Dictionary<string, int>();
+        internal int NextId=0;
+        #region IEnumerable<T> Members
+
+        public IEnumerator<T> GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        #endregion
+        #region IEnumerable Members
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+        #endregion
+        public T this[int PositionID]
+        {
+            get
+            {
+                return _list[PositionID];
+            }
+        }
+        public int Count
+        {
+            get
+            {
+                return _list.Count;
+            }
+        }
+        //internal int Add(T item)
+        //{
+        //    _list.Add(item);
+        //    if (_setNextIdManual) NextId++;
+        //    return _list.Count-1;
+        //}
+        internal int Add(string key, T item)
+        {
+            _list.Add(item);
+            if (!_dic.ContainsKey(key.ToLower())) _dic.Add(key.ToLower(), _list.Count - 1);
+            if (_setNextIdManual) NextId++;
+            return _list.Count-1;
+        }
+        /// <summary>
+        /// Finds the key 
+        /// </summary>
+        /// <param name="key">the key to be found</param>
+        /// <param name="obj">The found object.</param>
+        /// <returns>True if found</returns>
+        internal bool FindByID(string key, ref T obj)
+        {
+            if (_dic.ContainsKey(key.ToLower()))
+            {
+                obj = _list[_dic[key.ToLower()]];
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+        /// <summary>
+        /// Find Index
+        /// </summary>
+        /// <param name="key"></param>
+        /// <returns></returns>
+        internal int FindIndexByID(string key)
+        {
+            if (_dic.ContainsKey(key.ToLower()))
+            {
+                return _dic[key.ToLower()];
+            }
+            else
+            {
+                return int.MinValue;
+            }
+        }
+        internal bool ExistsKey(string key)
+        {
+            return _dic.ContainsKey(key.ToLower());
+        }
+        internal void Sort(Comparison<T> c)
+        {
+            _list.Sort(c);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelStyles.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelStyles.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelStyles.cs	(revision 9616)
@@ -0,0 +1,875 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		        2009-10-01
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using draw=System.Drawing;
+using OfficeOpenXml.Style;
+using OfficeOpenXml.Style.XmlAccess;
+using OfficeOpenXml.Style.Dxf;
+using OfficeOpenXml.ConditionalFormatting;
+namespace OfficeOpenXml
+{
+	/// <summary>
+	/// Containts all shared cell styles for a workbook
+	/// </summary>
+    public sealed class ExcelStyles : XmlHelper
+    {
+        const string NumberFormatsPath = "d:styleSheet/d:numFmts";
+        const string FontsPath = "d:styleSheet/d:fonts";
+        const string FillsPath = "d:styleSheet/d:fills";
+        const string BordersPath = "d:styleSheet/d:borders";
+        const string CellStyleXfsPath = "d:styleSheet/d:cellStyleXfs";
+        const string CellXfsPath = "d:styleSheet/d:cellXfs";
+        const string CellStylesPath = "d:styleSheet/d:cellStyles";
+        const string dxfsPath = "d:styleSheet/d:dxfs";
+
+        //internal Dictionary<int, ExcelXfs> Styles = new Dictionary<int, ExcelXfs>();
+        XmlDocument _styleXml;
+        ExcelWorkbook _wb;
+        XmlNamespaceManager _nameSpaceManager;
+        internal int _nextDfxNumFmtID = 164;
+        internal ExcelStyles(XmlNamespaceManager NameSpaceManager, XmlDocument xml, ExcelWorkbook wb) :
+            base(NameSpaceManager, xml)
+        {       
+            _styleXml=xml;
+            _wb = wb;
+            _nameSpaceManager = NameSpaceManager;
+            SchemaNodeOrder = new string[] { "numFmts", "fonts", "fills", "borders", "cellStyleXfs", "cellXfs", "cellStyles", "dxfs" };
+            LoadFromDocument();
+        }
+        /// <summary>
+        /// Loads the style XML to memory
+        /// </summary>
+        private void LoadFromDocument()
+        {
+            //NumberFormats
+            ExcelNumberFormatXml.AddBuildIn(NameSpaceManager, NumberFormats);
+            XmlNode numNode = _styleXml.SelectSingleNode(NumberFormatsPath, _nameSpaceManager);
+            if (numNode != null)
+            {
+                foreach (XmlNode n in numNode)
+                {
+                    ExcelNumberFormatXml nf = new ExcelNumberFormatXml(_nameSpaceManager, n);
+                    NumberFormats.Add(nf.Id, nf);
+                    if (nf.NumFmtId >= NumberFormats.NextId) NumberFormats.NextId=nf.NumFmtId+1;
+                }
+            }
+
+            //Fonts
+            XmlNode fontNode = _styleXml.SelectSingleNode(FontsPath, _nameSpaceManager);
+            foreach (XmlNode n in fontNode)
+            {
+                ExcelFontXml f = new ExcelFontXml(_nameSpaceManager, n);
+                Fonts.Add(f.Id, f);
+            }
+
+            //Fills
+            XmlNode fillNode = _styleXml.SelectSingleNode(FillsPath, _nameSpaceManager);
+            foreach (XmlNode n in fillNode)
+            {
+                ExcelFillXml f;
+                if (n.FirstChild != null && n.FirstChild.LocalName == "gradientFill")
+                {
+                    f = new ExcelGradientFillXml(_nameSpaceManager, n);
+                }
+                else
+                {
+                    f = new ExcelFillXml(_nameSpaceManager, n);
+                }
+                Fills.Add(f.Id, f);
+            }
+
+            //Borders
+            XmlNode borderNode = _styleXml.SelectSingleNode(BordersPath, _nameSpaceManager);
+            foreach (XmlNode n in borderNode)
+            {
+                ExcelBorderXml b = new ExcelBorderXml(_nameSpaceManager, n);
+                Borders.Add(b.Id, b);
+            }
+
+            //cellStyleXfs
+            XmlNode styleXfsNode = _styleXml.SelectSingleNode(CellStyleXfsPath, _nameSpaceManager);
+            if (styleXfsNode != null)
+            {
+                foreach (XmlNode n in styleXfsNode)
+                {
+                    ExcelXfs item = new ExcelXfs(_nameSpaceManager, n, this);
+                    CellStyleXfs.Add(item.Id, item);
+                }
+            }
+
+            XmlNode styleNode = _styleXml.SelectSingleNode(CellXfsPath, _nameSpaceManager);
+            for (int i = 0; i < styleNode.ChildNodes.Count; i++)
+            {
+                XmlNode n = styleNode.ChildNodes[i];
+                ExcelXfs item = new ExcelXfs(_nameSpaceManager, n, this);
+                CellXfs.Add(item.Id, item);
+            }
+
+            //cellStyle
+            XmlNode namedStyleNode = _styleXml.SelectSingleNode(CellStylesPath, _nameSpaceManager);
+            if (namedStyleNode != null)
+            {
+                foreach (XmlNode n in namedStyleNode)
+                {
+                    ExcelNamedStyleXml item = new ExcelNamedStyleXml(_nameSpaceManager, n, this);
+                    NamedStyles.Add(item.Name, item);
+                }
+            }
+
+            //dxfsPath
+            XmlNode dxfsNode = _styleXml.SelectSingleNode(dxfsPath, _nameSpaceManager);
+            if (dxfsNode != null)
+            {
+                foreach (XmlNode x in dxfsNode)
+                {
+                    ExcelDxfStyleConditionalFormatting item = new ExcelDxfStyleConditionalFormatting(_nameSpaceManager, x, this);
+                    Dxfs.Add(item.Id, item);
+                }
+            }
+        }
+        internal ExcelStyle GetStyleObject(int Id,int PositionID, string Address)
+        {
+            if (Id < 0) Id = 0;
+            return new ExcelStyle(this, PropertyChange, PositionID, Address, Id);
+        }
+        /// <summary>
+        /// Handels changes of properties on the style objects
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <returns></returns>
+        internal int PropertyChange(StyleBase sender, Style.StyleChangeEventArgs e)
+        {
+            var address = new ExcelAddressBase(e.Address);
+            var ws = _wb.Worksheets[e.PositionID];
+            Dictionary<int, int> styleCashe = new Dictionary<int, int>();
+            //Set single address
+            SetStyleAddress(sender, e, address, ws, ref styleCashe);
+            if (address.Addresses != null)
+            {
+                //Handle multiaddresses
+                foreach (var innerAddress in address.Addresses)
+                {
+                    SetStyleAddress(sender, e, innerAddress, ws, ref styleCashe);
+                }
+            }
+            return 0;
+        }
+
+        private void SetStyleAddress(StyleBase sender, Style.StyleChangeEventArgs e, ExcelAddressBase address, ExcelWorksheet ws, ref Dictionary<int, int> styleCashe)
+        {
+            if (address.Start.Column == 0 || address.Start.Row == 0)
+            {
+                throw (new Exception("error address"));
+            }
+            //Columns
+            else if (address.Start.Row == 1 && address.End.Row == ExcelPackage.MaxRows)
+            {
+                ExcelColumn column;
+                //Get the startcolumn
+                ulong colID = ExcelColumn.GetColumnID(ws.SheetID, address.Start.Column);
+                if (!ws._columns.ContainsKey(colID))
+                {
+                    column=ws.Column(address.Start.Column);
+                }
+                else
+                {
+                    column = ws._columns[colID] as ExcelColumn;
+                }
+
+                var index = ws._columns.IndexOf(colID);
+                while(column.ColumnMin <= address.End.Column)
+                {
+                    if (column.ColumnMax > address.End.Column)
+                    {
+                        var newCol = ws.CopyColumn(column, address.End.Column + 1, column.ColumnMax);
+                        column.ColumnMax = address.End.Column;
+                    }
+
+                    if (styleCashe.ContainsKey(column.StyleID))
+                    {
+                        column.StyleID = styleCashe[column.StyleID];
+                    }
+                    else
+                    {
+                        ExcelXfs st = CellXfs[column.StyleID];
+                        int newId = st.GetNewID(CellXfs, sender, e.StyleClass, e.StyleProperty, e.Value);
+                        styleCashe.Add(column.StyleID, newId);
+                        column.StyleID = newId;
+                    }
+
+                    index++;
+                    if (index >= ws._columns.Count)
+                    {
+                        break;
+                    }
+                    else
+                    {
+                        column = (ws._columns[index] as ExcelColumn);
+                    }
+                }
+
+                if (column._columnMax < address.End.Column)
+                {
+                    var newCol = ws.Column(column._columnMax + 1) as ExcelColumn;
+                    newCol._columnMax = address.End.Column;
+
+                    if (styleCashe.ContainsKey(newCol.StyleID))
+                    {
+                        newCol.StyleID = styleCashe[newCol.StyleID];
+                    }
+                    else
+                    {
+                        ExcelXfs st = CellXfs[column.StyleID];
+                        int newId = st.GetNewID(CellXfs, sender, e.StyleClass, e.StyleProperty, e.Value);
+                        styleCashe.Add(newCol.StyleID, newId);
+                        newCol.StyleID = newId;
+                    }
+                    
+                    //column._columnMax = address.End.Column;
+                }
+
+                //Set for individual cells in the spann. We loop all cells here since the cells are sorted with columns first.
+                foreach (ExcelCell cell in ws._cells)
+                {
+                    if (cell.Column >= address.Start.Column &&
+                       cell.Column <= address.End.Column)
+                    {
+                        if (styleCashe.ContainsKey(cell.StyleID))
+                        {
+                            cell.StyleID = styleCashe[cell.StyleID];
+                        }
+                        else
+                        {
+                            ExcelXfs st = CellXfs[cell.StyleID];
+                            int newId = st.GetNewID(CellXfs, sender, e.StyleClass, e.StyleProperty, e.Value);
+                            styleCashe.Add(cell.StyleID, newId);
+                            cell.StyleID = newId;
+                        }
+                    }
+
+                }
+            }
+            //Rows
+            else if(address.Start.Column==1 && address.End.Column==ExcelPackage.MaxColumns)
+            {
+                for (int rowNum = address.Start.Row; rowNum <= address.End.Row; rowNum++)
+                {
+                    ExcelRow row = ws.Row(rowNum);
+                    if (row.StyleID == 0 && ws._columns.Count > 0)
+                    {
+                        //TODO: We should loop all columns here and change each cell. But for now we take style of column A.
+                        foreach (ExcelColumn column in ws._columns)
+                        {
+                            row.StyleID = column.StyleID;
+                            break;  //Get the first one and break. 
+                        }
+
+                    }
+                    if (styleCashe.ContainsKey(row.StyleID))
+                    {
+                        row.StyleID = styleCashe[row.StyleID];
+                    }
+                    else
+                    {
+                        ExcelXfs st = CellXfs[row.StyleID];
+                        int newId = st.GetNewID(CellXfs, sender, e.StyleClass, e.StyleProperty, e.Value);
+                        styleCashe.Add(row.StyleID, newId);
+                        row.StyleID = newId;
+                    }
+                }
+
+                //Get Start Cell
+                ulong rowID = ExcelRow.GetRowID(ws.SheetID, address.Start.Row);
+                int index = ws._cells.IndexOf(rowID);
+
+                index = ~index;
+                while (index < ws._cells.Count)
+                {                        
+                    var cell = ws._cells[index] as ExcelCell;
+                    if(cell.Row > address.End.Row)
+                    {
+                        break;
+                    }
+                    if (styleCashe.ContainsKey(cell.StyleID))
+                    {
+                        cell.StyleID = styleCashe[cell.StyleID];
+                    }
+                    else
+                    {
+                        ExcelXfs st = CellXfs[cell.StyleID];
+                        int newId = st.GetNewID(CellXfs, sender, e.StyleClass, e.StyleProperty, e.Value);
+                        styleCashe.Add(cell.StyleID, newId);
+                        cell.StyleID = newId;
+                    }
+                    index++;
+                }
+            }
+            else             //Cellrange
+            {
+                for (int col = address.Start.Column; col <= address.End.Column; col++)
+                {
+                    for (int row = address.Start.Row; row <= address.End.Row; row++)
+                    {
+                        ExcelCell cell = ws.Cell(row, col);
+                        if (styleCashe.ContainsKey(cell.StyleID))
+                        {
+                            cell.StyleID = styleCashe[cell.StyleID];
+                        }
+                        else
+                        {
+                            ExcelXfs st = CellXfs[cell.StyleID];
+                            int newId = st.GetNewID(CellXfs, sender, e.StyleClass, e.StyleProperty, e.Value);
+                            styleCashe.Add(cell.StyleID, newId);
+                            cell.StyleID = newId;
+                        }
+                    }
+                }            
+            }
+        }
+        /// <summary>
+        /// Handles property changes on Named styles.
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <returns></returns>
+        internal int NamedStylePropertyChange(StyleBase sender, Style.StyleChangeEventArgs e)
+        {
+
+            int index = NamedStyles.FindIndexByID(e.Address);
+            if (index >= 0)
+            {
+                int newId = CellStyleXfs[NamedStyles[index].StyleXfId].GetNewID(CellStyleXfs, sender, e.StyleClass, e.StyleProperty, e.Value);
+                int prevIx=NamedStyles[index].StyleXfId;
+                NamedStyles[index].StyleXfId = newId;
+                NamedStyles[index].Style.Index = newId;
+
+                NamedStyles[index].XfId = int.MinValue;
+                foreach (var style in CellXfs)
+                {
+                    if (style.XfId == prevIx)
+                    {
+                        style.XfId = newId;
+                    }
+                }
+            }
+            return 0;
+        }
+        public ExcelStyleCollection<ExcelNumberFormatXml> NumberFormats = new ExcelStyleCollection<ExcelNumberFormatXml>();
+        public ExcelStyleCollection<ExcelFontXml> Fonts = new ExcelStyleCollection<ExcelFontXml>();
+        public ExcelStyleCollection<ExcelFillXml> Fills = new ExcelStyleCollection<ExcelFillXml>();
+        public ExcelStyleCollection<ExcelBorderXml> Borders = new ExcelStyleCollection<ExcelBorderXml>();
+        public ExcelStyleCollection<ExcelXfs> CellStyleXfs = new ExcelStyleCollection<ExcelXfs>();
+        public ExcelStyleCollection<ExcelXfs> CellXfs = new ExcelStyleCollection<ExcelXfs>();
+        public ExcelStyleCollection<ExcelNamedStyleXml> NamedStyles = new ExcelStyleCollection<ExcelNamedStyleXml>();
+        public ExcelStyleCollection<ExcelDxfStyleConditionalFormatting> Dxfs = new ExcelStyleCollection<ExcelDxfStyleConditionalFormatting>();
+        
+        internal string Id
+        {
+            get { return ""; }
+        }
+
+        public ExcelNamedStyleXml CreateNamedStyle(string name)
+        {
+            return CreateNamedStyle(name, null);
+        }
+        public ExcelNamedStyleXml CreateNamedStyle(string name, ExcelStyle Template)
+        {
+            if (_wb.Styles.NamedStyles.ExistsKey(name))
+            {
+                throw new Exception(string.Format("Key {0} already exists in collection", name));
+            }
+
+            ExcelNamedStyleXml style;
+            style = new ExcelNamedStyleXml(NameSpaceManager, this);
+            int xfIdCopy, positionID;
+            ExcelStyles styles;
+            if (Template == null)
+            {
+//                style.Style = new ExcelStyle(this, NamedStylePropertyChange, -1, name, 0);
+                xfIdCopy = 0;
+                positionID = -1;
+                styles = this;
+            }
+            else
+            {
+                if (Template.PositionID < 0 && Template.Styles==this)
+                {
+                    xfIdCopy = Template.Index;
+                    positionID=Template.PositionID;
+                    styles = this;
+                    //style.Style = new ExcelStyle(this, NamedStylePropertyChange, Template.PositionID, name, Template.Index);
+                    //style.StyleXfId = Template.Index;
+                }
+                else
+                {
+                    xfIdCopy = Template.XfId;
+                    positionID = -1;
+                    styles = Template.Styles;
+                }
+            }
+            //Clone namedstyle
+            int styleXfId = CloneStyle(styles, xfIdCopy, true);
+            //Close cells style
+            CellStyleXfs[styleXfId].XfId = CellStyleXfs.Count-1;
+            int xfid = CloneStyle(styles, xfIdCopy, false, true); //Always add a new style (We create a new named style here)
+            CellXfs[xfid].XfId = styleXfId;
+            style.Style = new ExcelStyle(this, NamedStylePropertyChange, positionID, name, styleXfId);
+            style.StyleXfId = styleXfId;
+            
+            style.Name = name;
+            int ix =_wb.Styles.NamedStyles.Add(style.Name, style);
+            style.Style.SetIndex(ix);
+            //style.Style.XfId = ix;
+            return style;
+        }
+        public void UpdateXml()
+        {
+            RemoveUnusedStyles();
+
+            //NumberFormat
+            XmlNode nfNode=_styleXml.SelectSingleNode(NumberFormatsPath, _nameSpaceManager);
+            if (nfNode == null)
+            {
+                CreateNode(NumberFormatsPath, true);
+                nfNode = _styleXml.SelectSingleNode(NumberFormatsPath, _nameSpaceManager);
+            }
+            else
+            {
+                nfNode.RemoveAll();                
+            }
+
+            int count = 0;
+            int normalIx = NamedStyles.FindIndexByID("Normal");
+            if (NamedStyles.Count > 0 && normalIx>=0 && NamedStyles[normalIx].Style.Numberformat.NumFmtID >= 164)
+            {
+                ExcelNumberFormatXml nf = NumberFormats[NumberFormats.FindIndexByID(NamedStyles[normalIx].Style.Numberformat.Id)];
+                nfNode.AppendChild(nf.CreateXmlNode(_styleXml.CreateElement("numFmt", ExcelPackage.schemaMain)));
+                nf.newID = count++;
+            }
+            foreach (ExcelNumberFormatXml nf in NumberFormats)
+            {
+                if(!nf.BuildIn /*&& nf.newID<0*/) //Buildin formats are not updated.
+                {
+                    nfNode.AppendChild(nf.CreateXmlNode(_styleXml.CreateElement("numFmt", ExcelPackage.schemaMain)));
+                    nf.newID = count;
+                    count++;
+                }
+            }
+            (nfNode as XmlElement).SetAttribute("count", count.ToString());
+
+            //Font
+            count=0;
+            XmlNode fntNode = _styleXml.SelectSingleNode(FontsPath, _nameSpaceManager);
+            fntNode.RemoveAll();
+
+            //Normal should be first in the collection
+            if (NamedStyles.Count > 0 && normalIx >= 0 && NamedStyles[normalIx].Style.Font.Index > 0)
+            {
+                ExcelFontXml fnt = Fonts[NamedStyles[normalIx].Style.Font.Index];
+                fntNode.AppendChild(fnt.CreateXmlNode(_styleXml.CreateElement("font", ExcelPackage.schemaMain)));
+                fnt.newID = count++;
+            }
+
+            foreach (ExcelFontXml fnt in Fonts)
+            {
+                if (fnt.useCnt > 0/* && fnt.newID<0*/)
+                {
+                    fntNode.AppendChild(fnt.CreateXmlNode(_styleXml.CreateElement("font", ExcelPackage.schemaMain)));
+                    fnt.newID = count;
+                    count++;
+                }
+            }
+            (fntNode as XmlElement).SetAttribute("count", count.ToString());
+
+
+            //Fills
+            count = 0;
+            XmlNode fillsNode = _styleXml.SelectSingleNode(FillsPath, _nameSpaceManager);
+            fillsNode.RemoveAll();
+            Fills[0].useCnt = 1;    //Must exist (none);  
+            Fills[1].useCnt = 1;    //Must exist (gray125);
+            foreach (ExcelFillXml fill in Fills)
+            {
+                if (fill.useCnt > 0)
+                {
+                    fillsNode.AppendChild(fill.CreateXmlNode(_styleXml.CreateElement("fill", ExcelPackage.schemaMain)));
+                    fill.newID = count;
+                    count++;
+                }
+            }
+
+            (fillsNode as XmlElement).SetAttribute("count", count.ToString());
+
+            //Borders
+            count = 0;
+            XmlNode bordersNode = _styleXml.SelectSingleNode(BordersPath, _nameSpaceManager);
+            bordersNode.RemoveAll();
+            Borders[0].useCnt = 1;    //Must exist blank;
+            foreach (ExcelBorderXml border in Borders)
+            {
+                if (border.useCnt > 0)
+                {
+                    bordersNode.AppendChild(border.CreateXmlNode(_styleXml.CreateElement("border", ExcelPackage.schemaMain)));
+                    border.newID = count;
+                    count++;
+                }
+            }
+            (bordersNode as XmlElement).SetAttribute("count", count.ToString());
+
+            XmlNode styleXfsNode = _styleXml.SelectSingleNode(CellStyleXfsPath, _nameSpaceManager);
+            if (styleXfsNode == null && NamedStyles.Count > 0)
+            {
+                CreateNode(CellStyleXfsPath);
+                styleXfsNode = _styleXml.SelectSingleNode(CellStyleXfsPath, _nameSpaceManager);
+            }
+            if (NamedStyles.Count > 0)
+            {
+                styleXfsNode.RemoveAll();
+            }
+            //NamedStyles
+            count = normalIx > -1 ? 1 : 0;  //If we have a normal style, we make sure it's added first.
+
+            XmlNode cellStyleNode = _styleXml.SelectSingleNode(CellStylesPath, _nameSpaceManager);
+            if(cellStyleNode!=null)
+            {
+                cellStyleNode.RemoveAll();
+            }
+            XmlNode cellXfsNode = _styleXml.SelectSingleNode(CellXfsPath, _nameSpaceManager);
+            cellXfsNode.RemoveAll();
+
+            if (NamedStyles.Count > 0 && normalIx >= 0)
+            {
+                NamedStyles[normalIx].newID = 0;
+                AddNamedStyle(0, styleXfsNode, cellXfsNode, NamedStyles[normalIx]);
+            }
+            foreach (ExcelNamedStyleXml style in NamedStyles)
+            {
+                if (style.Name.ToLower() != "normal")
+                {
+                    style.newID = count;
+                    AddNamedStyle(count++, styleXfsNode, cellXfsNode, style);
+                }
+                else
+                {
+                    style.newID = 0;
+                }
+                cellStyleNode.AppendChild(style.CreateXmlNode(_styleXml.CreateElement("cellStyle", ExcelPackage.schemaMain)));
+            }
+            if (cellStyleNode!=null) (cellStyleNode as XmlElement).SetAttribute("count", count.ToString());
+            if (styleXfsNode != null) (styleXfsNode as XmlElement).SetAttribute("count", count.ToString());
+
+            //CellStyle
+            int xfix = 0;
+            foreach (ExcelXfs xf in CellXfs)
+            {
+                if (xf.useCnt > 0 && !(normalIx == xfix))
+                {
+                    cellXfsNode.AppendChild(xf.CreateXmlNode(_styleXml.CreateElement("xf", ExcelPackage.schemaMain)));
+                    xf.newID = count;
+                    count++;
+                }
+                xfix++;
+            }
+            (cellXfsNode as XmlElement).SetAttribute("count", count.ToString());
+
+            //Set dxf styling for conditional Formatting
+            XmlNode dxfsNode = _styleXml.SelectSingleNode(dxfsPath, _nameSpaceManager);
+            foreach (var ws in _wb.Worksheets)
+            {
+                foreach (var cf in ws.ConditionalFormatting)
+                {
+                    if (cf.Style.HasValue)
+                    {
+                        int ix = Dxfs.FindIndexByID(cf.Style.Id);
+                        if (ix < 0)
+                        {
+                            ((ExcelConditionalFormattingRule)cf).DxfId = Dxfs.Count;
+                            Dxfs.Add(cf.Style.Id, cf.Style);
+                            var elem = ((XmlDocument)TopNode).CreateElement("d", "dxf", ExcelPackage.schemaMain);
+                            cf.Style.CreateNodes(new XmlHelperInstance(NameSpaceManager, elem), "");
+                            dxfsNode.AppendChild(elem);
+                        }
+                        else
+                        {
+                            ((ExcelConditionalFormattingRule)cf).DxfId = ix;
+                        }
+                    }
+                }
+            }
+        }
+
+        private void AddNamedStyle(int id, XmlNode styleXfsNode,XmlNode cellXfsNode, ExcelNamedStyleXml style)
+        {
+            var styleXfs = CellStyleXfs[style.StyleXfId];
+            styleXfsNode.AppendChild(styleXfs.CreateXmlNode(_styleXml.CreateElement("xf", ExcelPackage.schemaMain), true));
+            styleXfs.newID = id;
+            styleXfs.XfId = style.StyleXfId;
+
+            var ix = CellXfs.FindIndexByID(styleXfs.Id);
+            if (ix < 0)
+            {
+                cellXfsNode.AppendChild(styleXfs.CreateXmlNode(_styleXml.CreateElement("xf", ExcelPackage.schemaMain)));
+            }
+            else
+            {
+                if (id < 0) CellXfs[ix].XfId = id;
+                cellXfsNode.AppendChild(CellXfs[ix].CreateXmlNode(_styleXml.CreateElement("xf", ExcelPackage.schemaMain)));
+                CellXfs[ix].useCnt = 0;
+                CellXfs[ix].newID = id;
+
+            }
+
+            if (style.XfId >= 0)
+                style.XfId = CellXfs[style.XfId].newID;
+            else
+                style.XfId = 0;
+        }
+
+        private void RemoveUnusedStyles()
+        {
+            CellXfs[0].useCnt = 1; //First item is allways used.
+            foreach (ExcelWorksheet sheet in _wb.Worksheets)
+            {
+                foreach (ExcelCell cell in sheet._cells) //sheet._cells.Values
+                {
+                    CellXfs[cell.GetCellStyleID()].useCnt++;
+                }
+                foreach(ExcelRow row in sheet._rows)
+                {
+                    CellXfs[row.StyleID].useCnt++;
+                }
+                foreach (ExcelColumn col in sheet._columns)
+                {
+                    if(col.StyleID>=0) CellXfs[col.StyleID].useCnt++;
+                }
+            }
+            foreach (ExcelNamedStyleXml ns in NamedStyles)
+            {
+                CellStyleXfs[ns.StyleXfId].useCnt++;
+            }
+
+            foreach (ExcelXfs xf in CellXfs)
+            {
+                if (xf.useCnt > 0)
+                {
+                    if (xf.FontId >= 0) Fonts[xf.FontId].useCnt++;
+                    if (xf.FillId >= 0) Fills[xf.FillId].useCnt++;
+                    if (xf.BorderId >= 0) Borders[xf.BorderId].useCnt++;
+                }
+            }
+            foreach (ExcelXfs xf in CellStyleXfs)
+            {
+                if (xf.useCnt > 0)
+                {
+                    if (xf.FontId >= 0) Fonts[xf.FontId].useCnt++;
+                    if (xf.FillId >= 0) Fills[xf.FillId].useCnt++;
+                    if (xf.BorderId >= 0) Borders[xf.BorderId].useCnt++;                    
+                }
+            }
+        }
+        internal int GetStyleIdFromName(string Name)
+        {
+            int i = NamedStyles.FindIndexByID(Name);
+            if (i >= 0)
+            {
+                int id = NamedStyles[i].XfId;
+                if (id < 0)
+                {
+                    int styleXfId=NamedStyles[i].StyleXfId;
+                    ExcelXfs newStyle = CellStyleXfs[styleXfId].Copy();
+                    newStyle.XfId = styleXfId;
+                    id = CellXfs.FindIndexByID(newStyle.Id);
+                    if (id < 0)
+                    {
+                        id = CellXfs.Add(newStyle.Id, newStyle);
+                    }
+                    NamedStyles[i].XfId=id;
+                }
+                return id;
+            }
+            else
+            {
+                return 0;
+                //throw(new Exception("Named style does not exist"));        	         
+            }
+        }
+   #region XmlHelpFunctions
+        private int GetXmlNodeInt(XmlNode node)
+        {
+            int i;
+            if (int.TryParse(GetXmlNode(node), out i))
+            {
+                return i;
+            }
+            else
+            {
+                return 0;
+            }
+        }
+        private string GetXmlNode(XmlNode node)
+        {
+            if (node == null)
+            {
+                return "";
+            }
+            if (node.Value != null)
+            {
+                return node.Value;
+            }
+            else
+            {
+                return "";
+            }
+        }
+
+#endregion
+        internal int CloneStyle(ExcelStyles style, int styleID)
+        {
+            return CloneStyle(style, styleID, false, false);
+        }
+        internal int CloneStyle(ExcelStyles style, int styleID, bool isNamedStyle)
+        {
+            return CloneStyle(style, styleID, isNamedStyle, false);
+        }
+        internal int CloneStyle(ExcelStyles style, int styleID, bool isNamedStyle, bool allwaysAdd)
+        {
+            ExcelXfs xfs;
+            if (isNamedStyle)
+            {
+                xfs = style.CellStyleXfs[styleID];
+            }
+            else
+            {
+                xfs = style.CellXfs[styleID];
+            }
+            ExcelXfs newXfs=xfs.Copy(this);
+            //Numberformat
+            if (xfs.NumberFormatId > 0)
+            {
+                string format="";
+                foreach (var fmt in style.NumberFormats)
+                {
+                    if (fmt.NumFmtId == xfs.NumberFormatId)
+                    {
+                        format=fmt.Format;
+                        break;
+                    }
+                }
+                int ix=NumberFormats.FindIndexByID(format);
+                if (ix<0)
+                {
+                    ExcelNumberFormatXml item = new ExcelNumberFormatXml(NameSpaceManager) { Format = format, NumFmtId = NumberFormats.NextId++ };
+                    NumberFormats.Add(format, item);
+                    ix=item.NumFmtId;
+                }
+                newXfs.NumberFormatId= ix;
+            }
+
+            //Font
+            if (xfs.FontId > -1)
+            {
+                int ix=Fonts.FindIndexByID(xfs.Font.Id);
+                if (ix<0)
+                {
+                    ExcelFontXml item = style.Fonts[xfs.FontId].Copy();
+                    ix=Fonts.Add(xfs.Font.Id, item);
+                }
+                newXfs.FontId=ix;
+            }
+
+            //Border
+            if (xfs.BorderId > -1)
+            {
+                int ix = Borders.FindIndexByID(xfs.Border.Id);
+                if (ix < 0)
+                {
+                    ExcelBorderXml item = style.Borders[xfs.BorderId].Copy();
+                    ix = Borders.Add(xfs.Border.Id, item);
+                }
+                newXfs.BorderId = ix;
+            }
+
+            //Fill
+            if (xfs.FillId > -1)
+            {
+                int ix = Fills.FindIndexByID(xfs.Fill.Id);
+                if (ix < 0)
+                {
+                    var item = style.Fills[xfs.FillId].Copy();
+                    ix = Fills.Add(xfs.Fill.Id, item);
+                }
+                newXfs.FillId = ix;
+            }
+
+            //Named style reference
+            if (xfs.XfId > 0)
+            {
+                var id = style.CellStyleXfs[xfs.XfId].Id;
+                var newId = CellStyleXfs.FindIndexByID(id);
+                //if (newId < 0)
+                //{
+                    
+                //    newXfs.XfId = CloneStyle(style, xfs.XfId, true);
+                //}
+                //else
+                //{
+                    newXfs.XfId = newId;
+                //}
+            }
+
+            int index;
+            if (isNamedStyle)
+            {
+                index = CellStyleXfs.Add(newXfs.Id, newXfs);
+            }
+            else
+            {
+                if (allwaysAdd)
+                {
+                    index = CellXfs.Add(newXfs.Id, newXfs);
+                }
+                else
+                {
+                    index = CellXfs.FindIndexByID(newXfs.Id);
+                    if (index < 0)
+                    {
+                        index = CellXfs.Add(newXfs.Id, newXfs);
+                    }
+                }
+            }
+            return index;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelTextFormat.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelTextFormat.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelTextFormat.cs	(revision 9616)
@@ -0,0 +1,131 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		        2011-01-01
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Globalization;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Discribes a column when reading a text using the ExcelRangeBase.LoadFromText method
+    /// </summary>
+    public enum eDataTypes
+    {
+        /// <summary>
+        /// Let the the import decide.
+        /// </summary>
+        Unknown,
+        /// <summary>
+        /// Always a string.
+        /// </summary>
+        String,
+        /// <summary>
+        /// Try to convert it to a number. If it fails then add it as a string.
+        /// </summary>
+        Number,
+        /// <summary>
+        /// Try to convert it to a date. If it fails then add it as a string.
+        /// </summary>
+        DateTime,
+        /// <summary>
+        /// Try to convert it to a number and divide with 100. 
+        /// Removes any tailing percent sign (%). If it fails then add it as a string.
+        /// </summary>
+        Percent
+    }
+    /// <summary>
+    /// Describes how to split a CSV text. Used by the ExcelRange.LoadFromText method
+    /// </summary>
+    public class ExcelTextFormat
+    {
+        /// <summary>
+        /// Describes how to split a CSV text
+        /// 
+        /// Default values
+        /// <list>
+        /// <listheader><term>Property</term><description>Value</description></listheader>
+        /// <item><term>Delimiter</term><description>,</description></item>
+        /// <item><term>TextQualifier</term><description>None (\0)</description></item>
+        /// <item><term>EOL</term><description>CRLF</description></item>
+        /// <item><term>Culture</term><description>CultureInfo.InvariantCulture</description></item>
+        /// <item><term>DataTypes</term><description>End of line default CRLF</description></item>
+        /// <item><term>SkipLinesBeginning</term><description>0</description></item>
+        /// <item><term>SkipLinesEnd</term><description>0</description></item>
+        /// <item><term>Encoding</term><description>Encoding.ASCII</description></item>
+        /// </list>
+        /// </summary>
+        public ExcelTextFormat()
+        {
+            Delimiter = ',';
+            TextQualifier = '\0';
+            EOL = "\r\n";
+            Culture = CultureInfo.InvariantCulture;
+            DataTypes=null;
+            SkipLinesBeginning = 0;
+            SkipLinesEnd = 0;
+            Encoding=Encoding.ASCII;
+        }
+        /// <summary>
+        /// Delimiter character
+        /// </summary>
+        public char Delimiter { get; set; }
+        /// <summary>
+        /// Text qualifier character 
+        /// </summary>
+        public char TextQualifier {get; set; }
+        /// <summary>
+        /// End of line characters. Default CRLF
+        /// </summary>
+        public string EOL { get; set; }
+        /// <summary>
+        /// Datatypes list for each column (if column is not present Unknown is assumed)
+        /// </summary>
+        public eDataTypes[] DataTypes { get; set; }
+        /// <summary>
+        /// Culture used when parsing. Default CultureInfo.InvariantCulture
+        /// </summary>
+        public CultureInfo Culture {get; set; }
+        /// <summary>
+        /// Number of lines skiped in the begining of the file. Default 0.
+        /// </summary>
+        public int SkipLinesBeginning { get; set; }
+        /// <summary>
+        /// Number of lines skiped at the end of the file. Default 0.
+        /// </summary>
+        public int SkipLinesEnd { get; set; }
+        /// <summary>
+        /// Only used when reading files from disk using a FileInfo object. Default AscII
+        /// </summary>
+        public Encoding Encoding { get; set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorkbook.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorkbook.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorkbook.cs	(revision 9616)
@@ -0,0 +1,1011 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		       2011-01-01
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Xml;
+using System.IO;
+using System.IO.Packaging;
+using System.Collections.Generic;
+using System.Text;
+using System.Security;
+using System.Globalization;
+using System.Text.RegularExpressions;
+using OfficeOpenXml.VBA;
+using System.Drawing;
+namespace OfficeOpenXml
+{
+	#region Public Enum ExcelCalcMode
+	/// <summary>
+	/// How the application should calculate formulas in the workbook
+	/// </summary>
+	public enum ExcelCalcMode
+	{
+		/// <summary>
+		/// Indicates that calculations in the workbook are performed automatically when cell values change. 
+		/// The application recalculates those cells that are dependent on other cells that contain changed values. 
+		/// This mode of calculation helps to avoid unnecessary calculations.
+		/// </summary>
+		Automatic,
+		/// <summary>
+		/// Indicates tables be excluded during automatic calculation
+		/// </summary>
+		AutomaticNoTable,
+		/// <summary>
+		/// Indicates that calculations in the workbook be triggered manually by the user. 
+		/// </summary>
+		Manual
+	}
+	#endregion
+
+	/// <summary>
+	/// Represents the Excel workbook and provides access to all the 
+	/// document properties and worksheets within the workbook.
+	/// </summary>
+	public sealed class ExcelWorkbook : XmlHelper
+	{
+		internal class SharedStringItem
+		{
+			internal int pos;
+			internal string Text;
+			internal bool isRichText = false;
+		}
+		#region Private Properties
+		internal ExcelPackage _package;
+		private ExcelWorksheets _worksheets;
+		private OfficeProperties _properties;
+
+		private ExcelStyles _styles;
+		#endregion
+
+		#region ExcelWorkbook Constructor
+		/// <summary>
+		/// Creates a new instance of the ExcelWorkbook class.
+		/// </summary>
+		/// <param name="package">The parent package</param>
+		/// <param name="namespaceManager">NamespaceManager</param>
+		internal ExcelWorkbook(ExcelPackage package, XmlNamespaceManager namespaceManager) :
+			base(namespaceManager)
+		{
+			_package = package;
+			WorkbookUri = new Uri("/xl/workbook.xml", UriKind.Relative);
+			SharedStringsUri = new Uri("/xl/sharedStrings.xml", UriKind.Relative);
+			StylesUri = new Uri("/xl/styles.xml", UriKind.Relative);
+
+			_names = new ExcelNamedRangeCollection(this);
+			_namespaceManager = namespaceManager;
+			TopNode = WorkbookXml.DocumentElement;
+			SchemaNodeOrder = new string[] { "fileVersion", "fileSharing", "workbookPr", "workbookProtection", "bookViews", "sheets", "functionGroups", "functionPrototypes", "externalReferences", "definedNames", "calcPr", "oleSize", "customWorkbookViews", "pivotCaches", "smartTagPr", "smartTagTypes", "webPublishing", "fileRecoveryPr", };
+			GetSharedStrings();
+		}
+		#endregion
+
+		internal Dictionary<string, SharedStringItem> _sharedStrings = new Dictionary<string, SharedStringItem>(); //Used when reading cells.
+		internal List<SharedStringItem> _sharedStringsList = new List<SharedStringItem>(); //Used when reading cells.
+		internal ExcelNamedRangeCollection _names;
+		internal int _nextDrawingID = 0;
+		internal int _nextTableID = 1;
+		internal int _nextPivotTableID = 1;
+		internal XmlNamespaceManager _namespaceManager;
+		/// <summary>
+		/// Read shared strings to list
+		/// </summary>
+		private void GetSharedStrings()
+		{
+			if (_package.Package.PartExists(SharedStringsUri))
+			{
+				var xml = _package.GetXmlFromUri(SharedStringsUri);
+				XmlNodeList nl = xml.SelectNodes("//d:sst/d:si", NameSpaceManager);
+				_sharedStringsList = new List<SharedStringItem>();
+				if (nl != null)
+				{
+					foreach (XmlNode node in nl)
+					{
+						XmlNode n = node.SelectSingleNode("d:t", NameSpaceManager);
+						if (n != null)
+						{
+							_sharedStringsList.Add(new SharedStringItem() { Text = ExcelDecodeString(n.InnerText) });
+						}
+						else
+						{
+							_sharedStringsList.Add(new SharedStringItem() { Text = node.InnerXml, isRichText = true });
+						}
+					}
+				}
+			}
+		}
+		internal void GetDefinedNames()
+		{
+			XmlNodeList nl = WorkbookXml.SelectNodes("//d:definedNames/d:definedName", NameSpaceManager);
+			if (nl != null)
+			{
+				foreach (XmlElement elem in nl)
+				{ 
+					string fullAddress = elem.InnerText;
+
+					int localSheetID;
+					ExcelWorksheet nameWorksheet;
+					if(!int.TryParse(elem.GetAttribute("localSheetId"), out localSheetID))
+					{
+						localSheetID = -1;
+						nameWorksheet=null;
+					}
+					else
+					{
+						nameWorksheet=Worksheets[localSheetID + 1];
+					}
+					var addressType = ExcelAddressBase.IsValid(fullAddress);
+					ExcelRangeBase range;
+					ExcelNamedRange namedRange;
+
+					if (fullAddress.IndexOf("[") > -1)
+					{
+						int start = fullAddress.IndexOf("[");
+						int end = fullAddress.IndexOf("]", start);
+						if (start >= 0 && end >= 0)
+						{
+
+							string externalIndex = fullAddress.Substring(start + 1, end - start - 1);
+							int index;
+							if (int.TryParse(externalIndex, out index))
+							{
+								if (index > 0 && index <= _externalReferences.Count)
+								{
+									fullAddress = fullAddress.Substring(0, start) + "[" + _externalReferences[index - 1] + "]" + fullAddress.Substring(end + 1);
+								}
+							}
+						}
+					}
+
+					if (addressType == ExcelAddressBase.AddressType.Invalid || addressType == ExcelAddressBase.AddressType.InternalName || addressType == ExcelAddressBase.AddressType.ExternalName)    //A value or a formula
+					{
+						double value;
+						range = new ExcelRangeBase(this, nameWorksheet, elem.GetAttribute("name"), true);
+						if (nameWorksheet == null)
+						{
+							namedRange = _names.Add(elem.GetAttribute("name"), range);
+						}
+						else
+						{
+							namedRange = nameWorksheet.Names.Add(elem.GetAttribute("name"), range);
+						}
+						
+						if (fullAddress.StartsWith("\"")) //String value
+						{
+							namedRange.NameValue = fullAddress.Substring(1,fullAddress.Length-2);
+						}
+						else if (double.TryParse(fullAddress, NumberStyles.Any, CultureInfo.InvariantCulture, out value))
+						{
+							namedRange.NameValue = value;
+						}
+						else
+						{
+							namedRange.NameFormula = fullAddress;
+						}
+					}
+					else
+					{
+						ExcelAddress addr = new ExcelAddress(fullAddress);
+						if (localSheetID > -1)
+						{
+							if (string.IsNullOrEmpty(addr._ws))
+							{
+								namedRange = Worksheets[localSheetID + 1].Names.Add(elem.GetAttribute("name"), new ExcelRangeBase(this, Worksheets[localSheetID + 1], fullAddress, false));
+							}
+							else
+							{
+								namedRange = Worksheets[localSheetID + 1].Names.Add(elem.GetAttribute("name"), new ExcelRangeBase(this, Worksheets[addr._ws], fullAddress, false));
+							}
+						}
+						else
+						{
+							var ws = Worksheets[addr._ws];
+							namedRange = _names.Add(elem.GetAttribute("name"), new ExcelRangeBase(this, ws, fullAddress, false));
+						}
+					}
+					if (elem.GetAttribute("hidden") == "1" && namedRange != null) namedRange.IsNameHidden = true;
+					if(!string.IsNullOrEmpty(elem.GetAttribute("comment"))) namedRange.NameComment=elem.GetAttribute("comment");
+				}
+			}
+		}
+		#region Worksheets
+		/// <summary>
+		/// Provides access to all the worksheets in the workbook.
+		/// </summary>
+		public ExcelWorksheets Worksheets
+		{
+			get
+			{
+				if (_worksheets == null)
+				{
+					var sheetsNode = _workbookXml.DocumentElement.SelectSingleNode("d:sheets", _namespaceManager);
+					if (sheetsNode == null)
+					{
+						sheetsNode = CreateNode("d:sheets");
+					}
+					
+					_worksheets = new ExcelWorksheets(_package, _namespaceManager, sheetsNode);
+				}
+				return (_worksheets);
+			}
+		}
+		#endregion
+
+		/// <summary>
+		/// Provides access to named ranges
+		/// </summary>
+		public ExcelNamedRangeCollection Names
+		{
+			get
+			{
+				return _names;
+			}
+		}
+		#region Workbook Properties
+		decimal _standardFontWidth = decimal.MinValue;
+        string fontID = "";
+		/// <summary>
+		/// Max font width for the workbook
+        /// <remarks>This method uses GDI. If you use Asure or another environment that does not support GDI, you have to set this value manually if you don't use the standard Calibri font</remarks>
+		/// </summary>
+		public decimal MaxFontWidth 
+		{
+			get
+			{
+                if (_standardFontWidth == decimal.MinValue || fontID != Styles.Fonts[0].Id)
+				{
+					var font = Styles.Fonts[0];
+                    try
+                    {
+                        Font f = new Font(font.Name, font.Size);
+                        fontID = font.Id;
+                        using (Bitmap b = new Bitmap(1, 1))
+                        {
+                            using (Graphics g = Graphics.FromImage(b))
+                            {
+                                _standardFontWidth = (decimal)Math.Truncate(g.MeasureString("00", f).Width - g.MeasureString("0", f).Width);
+                            }
+                        }
+                        if (_standardFontWidth <= 0) //No GDI?
+                        {
+                            _standardFontWidth = (int)(font.Size * (2D / 3D)); //Aprox. for Calibri.
+                        }
+                    }
+                    catch   //Error, set default value
+                    {
+                        _standardFontWidth = (int)(font.Size * (2D / 3D)); //Aprox for Calibri.
+                    }
+				}
+				return _standardFontWidth;
+			}
+            set
+            {
+                _standardFontWidth = value;
+            }
+		}
+		ExcelProtection _protection = null;
+		/// <summary>
+		/// Access properties to protect or unprotect a workbook
+		/// </summary>
+		public ExcelProtection Protection
+		{
+			get
+			{
+				if (_protection == null)
+				{
+					_protection = new ExcelProtection(NameSpaceManager, TopNode, this);
+					_protection.SchemaNodeOrder = SchemaNodeOrder;
+				}
+				return _protection;
+			}
+		}
+		ExcelWorkbookView _view = null;
+		/// <summary>
+		/// Access to workbook view properties
+		/// </summary>
+		public ExcelWorkbookView View
+		{
+			get
+			{
+				if (_view == null)
+				{
+					_view = new ExcelWorkbookView(NameSpaceManager, TopNode, this);
+				}
+				return _view;
+			}
+		}
+        ExcelVbaProject _vba = null;
+        /// <summary>
+        /// A reference to the VBA project.
+        /// Null if no project exists.
+        /// User Workbook.CreateVBAProject to create a new VBA-Project
+        /// </summary>
+        public ExcelVbaProject VbaProject
+        {
+            get
+            {
+                if (_vba == null)
+                {
+                    if(_package.Package.PartExists(new Uri(ExcelVbaProject.PartUri, UriKind.Relative)))
+                    {
+                        _vba = new ExcelVbaProject(this);
+                    }
+                }
+                return _vba;
+            }
+        }
+        /// <summary>
+        /// Create an empty VBA project.
+        /// </summary>
+        public void CreateVBAProject()
+        {
+            if (_vba != null || _package.Package.PartExists(new Uri(ExcelVbaProject.PartUri, UriKind.Relative)))
+            {
+                throw (new InvalidOperationException("VBA project already exists."));
+            }
+                        
+            _vba = new ExcelVbaProject(this);
+            _vba.Create();
+        }
+		/// <summary>
+		/// URI to the workbook inside the package
+		/// </summary>
+		internal Uri WorkbookUri { get; private set; }
+		/// <summary>
+        /// URI to the styles inside the package
+		/// </summary>
+		internal Uri StylesUri { get; private set; }
+		/// <summary>
+        /// URI to the shared strings inside the package
+		/// </summary>
+		internal Uri SharedStringsUri { get; private set; }
+		/// <summary>
+		/// Returns a reference to the workbook's part within the package
+		/// </summary>
+		internal PackagePart Part { get { return (_package.Package.GetPart(WorkbookUri)); } }
+		
+		#region WorkbookXml
+		private XmlDocument _workbookXml;
+		/// <summary>
+		/// Provides access to the XML data representing the workbook in the package.
+		/// </summary>
+		public XmlDocument WorkbookXml
+		{
+			get
+			{
+				if (_workbookXml == null)
+				{
+					CreateWorkbookXml(_namespaceManager);
+				}
+				return (_workbookXml);
+			}
+		}
+        const string codeModuleNamePath = "d:workbookPr/@codeName";
+        internal string CodeModuleName
+        {
+            get
+            {
+                return GetXmlNodeString(codeModuleNamePath);
+            }
+            set
+            {
+                SetXmlNodeString(codeModuleNamePath,value);
+            }
+        }
+        internal void CodeNameChange(string value)
+        {
+            CodeModuleName = value;
+        }
+        public VBA.ExcelVBAModule CodeModule
+        {
+            get
+            {
+                if (VbaProject != null)
+                {
+                    return VbaProject.Modules[CodeModuleName];
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+		/// <summary>
+		/// Create or read the XML for the workbook.
+		/// </summary>
+		private void CreateWorkbookXml(XmlNamespaceManager namespaceManager)
+		{
+			if (_package.Package.PartExists(WorkbookUri))
+				_workbookXml = _package.GetXmlFromUri(WorkbookUri);
+			else
+			{
+				// create a new workbook part and add to the package
+				PackagePart partWorkbook = _package.Package.CreatePart(WorkbookUri, @"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml", _package.Compression);
+
+				// create the workbook
+				_workbookXml = new XmlDocument(namespaceManager.NameTable);                
+				
+				_workbookXml.PreserveWhitespace = ExcelPackage.preserveWhitespace;
+				// create the workbook element
+				XmlElement wbElem = _workbookXml.CreateElement("workbook", ExcelPackage.schemaMain);
+
+				// Add the relationships namespace
+				wbElem.SetAttribute("xmlns:r", ExcelPackage.schemaRelationships);
+
+				_workbookXml.AppendChild(wbElem);
+
+				// create the bookViews and workbooks element
+				XmlElement bookViews = _workbookXml.CreateElement("bookViews", ExcelPackage.schemaMain);
+				wbElem.AppendChild(bookViews);
+				XmlElement workbookView = _workbookXml.CreateElement("workbookView", ExcelPackage.schemaMain);
+				bookViews.AppendChild(workbookView);
+
+				// save it to the package
+				StreamWriter stream = new StreamWriter(partWorkbook.GetStream(FileMode.Create, FileAccess.Write));
+				_workbookXml.Save(stream);
+				stream.Close();
+				_package.Package.Flush();
+			}
+		}
+		#endregion
+		#region StylesXml
+		private XmlDocument _stylesXml;
+		/// <summary>
+		/// Provides access to the XML data representing the styles in the package. 
+		/// </summary>
+		public XmlDocument StylesXml
+		{
+			get
+			{
+				if (_stylesXml == null)
+				{
+					if (_package.Package.PartExists(StylesUri))
+						_stylesXml = _package.GetXmlFromUri(StylesUri);
+					else
+					{
+						// create a new styles part and add to the package
+						PackagePart part = _package.Package.CreatePart(StylesUri, @"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml", _package.Compression);
+						// create the style sheet
+
+						StringBuilder xml = new StringBuilder("<styleSheet xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\">");
+						xml.Append("<numFmts />");
+						xml.Append("<fonts count=\"1\"><font><sz val=\"11\" /><name val=\"Calibri\" /></font></fonts>");
+						xml.Append("<fills><fill><patternFill patternType=\"none\" /></fill><fill><patternFill patternType=\"gray125\" /></fill></fills>");
+						xml.Append("<borders><border><left /><right /><top /><bottom /><diagonal /></border></borders>");
+						xml.Append("<cellStyleXfs count=\"1\"><xf numFmtId=\"0\" fontId=\"0\" /></cellStyleXfs>");
+						xml.Append("<cellXfs count=\"1\"><xf numFmtId=\"0\" fontId=\"0\" xfId=\"0\" /></cellXfs>");
+						xml.Append("<cellStyles><cellStyle name=\"Normal\" xfId=\"0\" builtinId=\"0\" /></cellStyles>");
+                        xml.Append("<dxfs count=\"0\" />");
+                        xml.Append("</styleSheet>");
+						
+						_stylesXml = new XmlDocument();
+						_stylesXml.LoadXml(xml.ToString());
+						
+						//Save it to the package
+						StreamWriter stream = new StreamWriter(part.GetStream(FileMode.Create, FileAccess.Write));
+
+						_stylesXml.Save(stream);
+						stream.Close();
+						_package.Package.Flush();
+
+						// create the relationship between the workbook and the new shared strings part
+						_package.Workbook.Part.CreateRelationship(PackUriHelper.GetRelativeUri(WorkbookUri, StylesUri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/styles");
+						_package.Package.Flush();
+					}
+				}
+				return (_stylesXml);
+			}
+			set
+			{
+				_stylesXml = value;
+			}
+		}
+		/// <summary>
+		/// Package styles collection. Used internally to access style data.
+		/// </summary>
+		public ExcelStyles Styles
+		{
+			get
+			{
+				if (_styles == null)
+				{
+					_styles = new ExcelStyles(NameSpaceManager, StylesXml, this);
+				}
+				return _styles;
+			}
+		}
+		#endregion
+
+		#region Office Document Properties
+		/// <summary>
+		/// The office document properties
+		/// </summary>
+		public OfficeProperties Properties
+		{
+			get 
+			{
+				if (_properties == null)
+				{
+					//  Create a NamespaceManager to handle the default namespace, 
+					//  and create a prefix for the default namespace:                   
+					_properties = new OfficeProperties(_package, NameSpaceManager);
+				}
+				return _properties;
+			}
+		}
+		#endregion
+
+		#region CalcMode
+		private string CALC_MODE_PATH = "d:calcPr/@calcMode";
+		/// <summary>
+		/// Calculation mode for the workbook.
+		/// </summary>
+		public ExcelCalcMode CalcMode
+		{
+			get
+			{
+				string calcMode = GetXmlNodeString(CALC_MODE_PATH);
+				switch (calcMode)
+				{
+					case "autoNoTable":
+						return ExcelCalcMode.AutomaticNoTable;
+					case "manual":
+						return ExcelCalcMode.Manual;
+					default:
+						return ExcelCalcMode.Automatic;
+
+				}
+			}
+			set
+			{
+				switch (value)
+				{
+					case ExcelCalcMode.AutomaticNoTable:
+						SetXmlNodeString(CALC_MODE_PATH, "autoNoTable") ;
+						break;
+					case ExcelCalcMode.Manual:
+						SetXmlNodeString(CALC_MODE_PATH, "manual");
+						break;
+					default:
+						SetXmlNodeString(CALC_MODE_PATH, "auto");
+						break;
+
+				}
+			}
+			#endregion
+		}
+		#endregion
+		#region Workbook Private Methods
+			
+		#region Save // Workbook Save
+		/// <summary>
+		/// Saves the workbook and all its components to the package.
+		/// For internal use only!
+		/// </summary>
+		internal void Save()  // Workbook Save
+		{
+			if (Worksheets.Count == 0)
+				throw new InvalidOperationException("The workbook must contain at least one worksheet");
+
+			DeleteCalcChain();
+
+            if (VbaProject == null)
+            {
+                if (Part.ContentType != ExcelPackage.contentTypeWorkbookDefault)
+                {
+                    ChangeContentTypeWorkbook(ExcelPackage.contentTypeWorkbookDefault);
+                }
+            }
+            else
+            {
+                if (Part.ContentType != ExcelPackage.contentTypeWorkbookMacroEnabled)
+                {
+                    ChangeContentTypeWorkbook(ExcelPackage.contentTypeWorkbookMacroEnabled);
+                }
+            }
+			
+			UpdateDefinedNamesXml();
+
+			// save the workbook
+			if (_workbookXml != null)
+			{
+				_package.SavePart(WorkbookUri, _workbookXml);
+			}
+
+			// save the properties of the workbook
+			if (_properties != null)
+			{
+				_properties.Save();
+			}
+
+			// save the style sheet
+			Styles.UpdateXml();
+			_package.SavePart(StylesUri, _stylesXml);
+
+			// save all the open worksheets
+			var isProtected = Protection.LockWindows || Protection.LockStructure;
+			foreach (ExcelWorksheet worksheet in Worksheets)
+			{
+				if (isProtected && Protection.LockWindows)
+				{
+					worksheet.View.WindowProtection = true;
+				}
+				worksheet.Save();
+			}
+			
+			UpdateSharedStringsXml();
+			
+			// Data validation
+			ValidateDataValidations();
+
+            //VBA
+            if (VbaProject!=null)
+            {
+                VbaProject.Save();
+            }
+
+		}
+        /// <summary>
+        /// Recreate the workbook part with a new contenttype
+        /// </summary>
+        /// <param name="contentType">The new contenttype</param>
+        private void ChangeContentTypeWorkbook(string contentType)
+        {            
+            var p=_package.Package;
+            var part = Part;
+            var rels = part.GetRelationships();
+
+            p.DeletePart(WorkbookUri);
+            part = p.CreatePart(WorkbookUri, contentType);
+            
+            foreach (var rel in rels)
+            {
+                p.DeleteRelationship(rel.Id);
+                var newRel=part.CreateRelationship(rel.TargetUri, rel.TargetMode, rel.RelationshipType);
+                if (rel.RelationshipType.EndsWith("worksheet"))
+                {
+                    var sheetNode = (XmlElement)WorkbookXml.SelectSingleNode(string.Format("d:workbook/d:sheets/d:sheet[@r:id='{0}']", rel.Id), NameSpaceManager);
+                    sheetNode.SetAttribute("id", ExcelPackage.schemaRelationships, newRel.Id);
+                }
+                else if (rel.RelationshipType.EndsWith("pivotCacheDefinition"))
+                {
+                    var sheetNode = (XmlElement)WorkbookXml.SelectSingleNode(string.Format("d:workbook/d:pivotCaches/d:pivotCache[@r:id='{0}']", rel.Id), NameSpaceManager);
+                    sheetNode.SetAttribute("id", ExcelPackage.schemaRelationships, newRel.Id);
+                }
+            }
+        }
+
+		private void DeleteCalcChain()
+		{
+			//Remove the calc chain if it exists.
+			Uri uriCalcChain = new Uri("/xl/calcChain.xml", UriKind.Relative);
+			if (_package.Package.PartExists(uriCalcChain))
+			{
+				Uri calcChain = new Uri("calcChain.xml", UriKind.Relative);
+				foreach (PackageRelationship relationship in _package.Workbook.Part.GetRelationships())
+				{
+					if (relationship.TargetUri == calcChain)
+					{
+						_package.Workbook.Part.DeleteRelationship(relationship.Id);
+						break;
+					}
+				}
+				// delete the calcChain part
+				_package.Package.DeletePart(uriCalcChain);
+			}
+		}
+
+		private void ValidateDataValidations()
+		{
+			foreach (var sheet in _package.Workbook.Worksheets)
+			{
+				sheet.DataValidations.ValidateAll();
+			}
+		}
+
+		private void UpdateSharedStringsXml()
+		{
+			PackagePart stringPart;
+			if (_package.Package.PartExists(SharedStringsUri))
+			{
+				stringPart=_package.Package.GetPart(SharedStringsUri);
+			}
+			else
+			{
+				stringPart = _package.Package.CreatePart(SharedStringsUri, @"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml", _package.Compression);
+				Part.CreateRelationship(PackUriHelper.GetRelativeUri(WorkbookUri, SharedStringsUri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/sharedStrings");
+			}
+
+			StreamWriter sw = new StreamWriter(stringPart.GetStream(FileMode.Create, FileAccess.Write));
+			sw.Write("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><sst xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" count=\"{0}\" uniqueCount=\"{0}\">", _sharedStrings.Count);
+			foreach (string t in _sharedStrings.Keys)
+			{
+
+				SharedStringItem ssi = _sharedStrings[t];
+				if (ssi.isRichText)
+				{
+					sw.Write("<si>");
+					ExcelEncodeString(sw, t);
+					sw.Write("</si>");
+				}
+				else
+				{
+					if (t.Length>0 && (t[0] == ' ' || t[t.Length-1] == ' ' || t.Contains("  ") || t.Contains("\t")))
+					{
+						sw.Write("<si><t xml:space=\"preserve\">");
+					}
+					else
+					{
+						sw.Write("<si><t>");
+					}
+					ExcelEncodeString(sw, SecurityElement.Escape(t));
+					sw.Write("</t></si>");
+				}
+			}
+			sw.Write("</sst>");
+			sw.Flush();
+		}
+
+		/// <summary>
+		/// Return true if preserve space attribute is set.
+		/// </summary>
+		/// <param name="sw"></param>
+		/// <param name="t"></param>
+		/// <returns></returns>
+		private void ExcelEncodeString(StreamWriter sw, string t)
+		{
+			if(Regex.IsMatch(t, "(_x[0-9A-F]{4,4}_)"))
+			{
+				var match = Regex.Match(t, "(_x[0-9A-F]{4,4}_)");
+				int indexAdd = 0;
+				while (match.Success)
+				{
+					t=t.Insert(match.Index + indexAdd, "_x005F");
+					indexAdd += 6;
+					match = match.NextMatch();
+				}
+			}
+			for (int i=0;i<t.Length;i++)
+			{
+				if (t[i] <= 0x1f && t[i] != '\t' && t[i] != '\n' && t[i] != '\r') //Not Tab, CR or LF
+				{
+					sw.Write("_x00{0}_", (t[i] < 0xa ? "0" : "") + ((int)t[i]).ToString("X"));                    
+				}
+				else
+				{
+					sw.Write(t[i]);
+				}
+			}
+
+		}
+		private string ExcelDecodeString(string t)
+		{
+			var match = Regex.Match(t, "(_x005F|_x[0-9A-F]{4,4}_)");
+			if(!match.Success) return t;
+
+			bool useNextValue = false;
+			StringBuilder ret=new StringBuilder();
+			int prevIndex=0;
+			while(match.Success)
+			{
+				if (prevIndex < match.Index) ret.Append(t.Substring(prevIndex, match.Index - prevIndex));
+				if (!useNextValue && match.Value == "_x005F")
+				{
+					useNextValue = true;
+				}
+				else
+				{
+					if (useNextValue)
+					{
+						ret.Append(match.Value);
+						useNextValue=false;
+					}
+					else
+					{
+						ret.Append((char)int.Parse(match.Value.Substring(2,4),NumberStyles.AllowHexSpecifier));
+					}
+				}
+				prevIndex=match.Index+match.Length;
+				match = match.NextMatch();
+			}
+			ret.Append(t.Substring(prevIndex, t.Length - prevIndex));
+			return ret.ToString();
+		}
+		private void UpdateDefinedNamesXml()
+		{
+			try
+			{
+				XmlNode top = WorkbookXml.SelectSingleNode("//d:definedNames", NameSpaceManager);
+				if (!ExistsNames())
+				{
+					if (top != null) TopNode.RemoveChild(top);
+					return;
+				}
+				else
+				{
+					if (top == null)
+					{
+						CreateNode("d:definedNames");
+						top = WorkbookXml.SelectSingleNode("//d:definedNames", NameSpaceManager);
+					}
+					else
+					{
+						top.RemoveAll();
+					}
+					foreach (ExcelNamedRange name in _names)
+					{
+
+						XmlElement elem = WorkbookXml.CreateElement("definedName", ExcelPackage.schemaMain);
+						top.AppendChild(elem);
+						elem.SetAttribute("name", name.Name);
+						if (name.IsNameHidden) elem.SetAttribute("hidden", "1");
+						if (!string.IsNullOrEmpty(name.NameComment)) elem.SetAttribute("comment", name.NameComment);
+						SetNameElement(name, elem);
+					}
+				}
+				foreach (ExcelWorksheet ws in _worksheets)
+				{
+					foreach (ExcelNamedRange name in ws.Names)
+					{
+
+						XmlElement elem = WorkbookXml.CreateElement("definedName", ExcelPackage.schemaMain);
+						top.AppendChild(elem);
+						elem.SetAttribute("name", name.Name);
+						elem.SetAttribute("localSheetId", name.LocalSheetId.ToString());
+						if (name.IsNameHidden) elem.SetAttribute("hidden", "1");
+						if (!string.IsNullOrEmpty(name.NameComment)) elem.SetAttribute("comment", name.NameComment);
+						SetNameElement(name, elem);
+					}
+				}
+			}
+			catch (Exception ex)
+			{
+				throw new Exception("Internal error updating named ranges ",ex);
+			}
+		}
+
+		private void SetNameElement(ExcelNamedRange name, XmlElement elem)
+		{
+			if (name.IsName)
+			{
+				if (string.IsNullOrEmpty(name.NameFormula))
+				{
+					if ((name.NameValue.GetType().IsPrimitive || name.NameValue is double || name.NameValue is decimal))
+					{
+						elem.InnerText = Convert.ToDouble(name.NameValue, CultureInfo.InvariantCulture).ToString("g15", CultureInfo.InvariantCulture); 
+					}
+					else if (name.NameValue is DateTime)
+					{
+						elem.InnerText = ((DateTime)name.NameValue).ToOADate().ToString(CultureInfo.InvariantCulture);
+					}
+					else
+					{
+						elem.InnerText = "\"" + name.NameValue.ToString() + "\"";
+					}                                
+				}
+				else
+				{
+					elem.InnerText = name.NameFormula;
+				}
+			}
+			else
+			{
+                elem.InnerText = name.FullAddressAbsolute;
+			}
+		}
+		/// <summary>
+		/// Is their any names in the workbook or in the sheets.
+		/// </summary>
+		/// <returns>?</returns>
+		private bool ExistsNames()
+		{
+			if (_names.Count == 0)
+			{
+				foreach (ExcelWorksheet ws in Worksheets)
+				{
+					if(ws.Names.Count>0)
+					{
+						return true;
+					}
+				}
+			}
+			else
+			{
+				return true;
+			}
+			return false;
+		}        
+		#endregion
+
+		#endregion
+		internal bool ExistsTableName(string Name)
+		{
+			foreach (var ws in Worksheets)
+			{
+				if(ws.Tables._tableNames.ContainsKey(Name))
+				{
+					return true;
+				}
+			}
+			return false;
+		}
+		internal bool ExistsPivotTableName(string Name)
+		{
+			foreach (var ws in Worksheets)
+			{
+				if (ws.PivotTables._pivotTableNames.ContainsKey(Name))
+				{
+					return true;
+				}
+			}
+			return false;
+		}
+		internal void AddPivotTable(string cacheID, Uri defUri)
+		{
+			CreateNode("d:pivotCaches");
+
+			XmlElement item = WorkbookXml.CreateElement("pivotCache", ExcelPackage.schemaMain);
+			item.SetAttribute("cacheId", cacheID);
+			var rel = Part.CreateRelationship(PackUriHelper.ResolvePartUri(WorkbookUri, defUri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/pivotCacheDefinition");
+			item.SetAttribute("id", ExcelPackage.schemaRelationships, rel.Id);
+
+			var pivotCaches = WorkbookXml.SelectSingleNode("//d:pivotCaches", NameSpaceManager);
+			pivotCaches.AppendChild(item);
+		}
+		internal List<string> _externalReferences = new List<string>();
+		internal void GetExternalReferences()
+		{
+			XmlNodeList nl = WorkbookXml.SelectNodes("//d:externalReferences/d:externalReference", NameSpaceManager);
+			if (nl != null)
+			{
+				foreach (XmlElement elem in nl)
+				{
+					string rID = elem.GetAttribute("r:id");
+					PackageRelationship rel = Part.GetRelationship(rID);
+					var part = _package.Package.GetPart(PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri));
+					XmlDocument xmlExtRef = new XmlDocument();
+                    LoadXmlSafe(xmlExtRef, part.GetStream()); 
+
+					XmlElement book=xmlExtRef.SelectSingleNode("//d:externalBook", NameSpaceManager) as XmlElement;
+					if(book!=null)
+					{
+						string rId_ExtRef = book.GetAttribute("r:id");
+						var rel_extRef = part.GetRelationship(rId_ExtRef);
+						if (rel_extRef != null)
+						{
+							_externalReferences.Add(rel_extRef.TargetUri.OriginalString);
+						}
+
+					}
+				}
+			}
+		}
+    } // end Workbook
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorkbookView.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorkbookView.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorkbookView.cs	(revision 9616)
@@ -0,0 +1,193 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		       2011-11-02
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Access to workbook view properties
+    /// </summary>
+    public class ExcelWorkbookView : XmlHelper
+    {
+        #region ExcelWorksheetView Constructor
+        /// <summary>
+        /// Creates a new ExcelWorkbookView which provides access to all the 
+        /// view states of the worksheet.
+        /// </summary>
+        /// <param name="ns"></param>
+        /// <param name="node"></param>
+        /// <param name="wb"></param>
+        internal ExcelWorkbookView(XmlNamespaceManager ns, XmlNode node, ExcelWorkbook wb) :
+            base(ns, node)
+		{
+            SchemaNodeOrder = wb.SchemaNodeOrder;
+		}
+		#endregion
+        const string LEFT_PATH="d:bookViews/d:workbookView/@xWindow";
+        /// <summary>
+        /// Position of the upper left corner of the workbook window. In twips.
+        /// </summary>
+        public int Left
+        { 
+            get
+            {
+                return GetXmlNodeInt(LEFT_PATH);
+            }
+            internal set
+            {
+                SetXmlNodeString(LEFT_PATH,value.ToString());
+            }
+        }
+        const string TOP_PATH="d:bookViews/d:workbookView/@yWindow";
+        /// <summary>
+        /// Position of the upper left corner of the workbook window. In twips.
+        /// </summary>
+        public int Top
+        { 
+            get
+            {
+                return GetXmlNodeInt(TOP_PATH);
+            }
+            internal set
+            {
+                SetXmlNodeString(TOP_PATH, value.ToString());
+            }
+        }
+        const string WIDTH_PATH="d:bookViews/d:workbookView/@windowWidth";
+        /// <summary>
+        /// Width of the workbook window. In twips.
+        /// </summary>
+        public int Width
+        { 
+            get
+            {
+                return GetXmlNodeInt(WIDTH_PATH);
+            }
+            internal set
+            {
+                SetXmlNodeString(WIDTH_PATH, value.ToString());
+            }
+        }
+        const string HEIGHT_PATH="d:bookViews/d:workbookView/@windowHeight";
+        /// <summary>
+        /// Height of the workbook window. In twips.
+        /// </summary>
+        public int Height
+        { 
+            get
+            {
+                return GetXmlNodeInt(HEIGHT_PATH);
+            }
+            internal set
+            {
+                SetXmlNodeString(HEIGHT_PATH, value.ToString());
+            }
+        }
+        const string MINIMIZED_PATH="d:bookViews/d:workbookView/@minimized";
+        /// <summary>
+        /// If true the the workbook window is minimized.
+        /// </summary>
+        public bool Minimized
+        {
+            get
+            {
+                return GetXmlNodeBool(MINIMIZED_PATH);
+            }
+            set
+            {
+                SetXmlNodeString(MINIMIZED_PATH, value.ToString());
+            }
+        }
+        const string SHOWVERTICALSCROLL_PATH = "d:bookViews/d:workbookView/@showVerticalScroll";
+        /// <summary>
+        /// Show the vertical scrollbar
+        /// </summary>
+        public bool ShowVerticalScrollBar
+        {
+            get
+            {
+                return GetXmlNodeBool(SHOWVERTICALSCROLL_PATH,true);
+            }
+            set
+            {
+                SetXmlNodeBool(SHOWVERTICALSCROLL_PATH, value, true);
+            }
+        }
+        const string SHOWHORIZONTALSCR_PATH = "d:bookViews/d:workbookView/@showHorizontalScroll";
+        /// <summary>
+        /// Show the horizontal scrollbar
+        /// </summary>
+        public bool ShowHorizontalScrollBar
+        {
+            get
+            {
+                return GetXmlNodeBool(SHOWHORIZONTALSCR_PATH, true);
+            }
+            set
+            {
+                SetXmlNodeBool(SHOWHORIZONTALSCR_PATH, value, true);
+            }
+        }
+        const string SHOWSHEETTABS_PATH = "d:bookViews/d:workbookView/@showSheetTabs";
+        /// <summary>
+        /// Show the sheet tabs
+        /// </summary>
+        public bool ShowSheetTabs
+        {
+            get
+            {
+                return GetXmlNodeBool(SHOWSHEETTABS_PATH, true);
+            }
+            set
+            {
+                SetXmlNodeBool(SHOWSHEETTABS_PATH, value, true);
+            }
+        }
+        /// <summary>
+        /// Set the window position in twips
+        /// </summary>
+        /// <param name="left"></param>
+        /// <param name="top"></param>
+        /// <param name="width"></param>
+        /// <param name="height"></param>
+        public void SetWindowSize(int left, int top, int width, int height)
+        {
+            Left = left;
+            Top = top;
+            Width = width;
+            Height = height;
+        }
+    }
+}
+    
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorksheet.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorksheet.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorksheet.cs	(revision 9616)
@@ -0,0 +1,2847 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		        2011-11-02
+ * Jan Källman          Total rewrite               2010-03-01
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Xml;
+using System.Collections.Generic;
+using System.IO;
+using System.IO.Packaging;
+using System.Configuration;
+using OfficeOpenXml.Drawing;
+using System.Diagnostics;
+using OfficeOpenXml.Style;
+using System.Globalization;
+using System.Text;
+using System.Security;
+using OfficeOpenXml.Drawing.Chart;
+using OfficeOpenXml.Style.XmlAccess;
+using System.Text.RegularExpressions;
+using OfficeOpenXml.Drawing.Vml;
+using OfficeOpenXml.Table;
+using OfficeOpenXml.DataValidation;
+using OfficeOpenXml.Table.PivotTable;
+using System.ComponentModel;
+using System.Drawing;
+using OfficeOpenXml.ConditionalFormatting;
+using System.Web;
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Worksheet hidden enumeration
+    /// </summary>
+    public enum eWorkSheetHidden
+    {
+        /// <summary>
+        /// The worksheet is visible
+        /// </summary>
+        Visible,
+        /// <summary>
+        /// The worksheet is hidden but can be shown by the user via the user interface
+        /// </summary>
+        Hidden,
+        /// <summary>
+        /// The worksheet is hidden and cannot be shown by the user via the user interface
+        /// </summary>
+        VeryHidden
+    }
+    /// <summary>
+	/// Represents an Excel worksheet and provides access to its properties and methods
+	/// </summary>
+    public sealed class ExcelWorksheet : XmlHelper
+	{
+        internal class Formulas
+        {
+            internal int Index { get; set; }
+            internal string Address { get; set; }
+            internal bool IsArray { get; set; }
+            public string Formula { get; set; }
+            public int StartRow { get; set; }
+            public int StartCol { get; set; }
+        }
+        /// <summary>
+        /// Collection containing merged cell addresses
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        public class MergeCellsCollection<T> : IEnumerable<T>
+        {
+            private List<T> _list = new List<T>();
+            internal MergeCellsCollection()
+            {
+
+            }
+            internal List<T> List { get {return _list;} }
+            public T this[int Index]
+            {
+                get
+                {
+                    return _list[Index];
+                }
+            }
+            public int Count
+            {
+                get
+                {
+                    return _list.Count;
+                }
+            }
+            internal void Remove(T Item)
+            {
+                _list.Remove(Item);
+            }
+            #region IEnumerable<T> Members
+
+            public IEnumerator<T> GetEnumerator()
+            {
+                return _list.GetEnumerator();
+            }
+
+            #endregion
+
+            #region IEnumerable Members
+
+            System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+            {
+                return _list.GetEnumerator();
+            }
+
+            #endregion
+        }
+        internal RangeCollection _cells;
+        internal RangeCollection _columns;
+        internal RangeCollection _rows;
+
+        internal Dictionary<int, Formulas> _sharedFormulas = new Dictionary<int, Formulas>();
+        internal Dictionary<int, Formulas> _arrayFormulas = new Dictionary<int, Formulas>();
+        internal RangeCollection _formulaCells;
+        internal int _minCol = ExcelPackage.MaxColumns;
+        internal int _maxCol = 0;
+        internal List<ulong> _hyperLinkCells;   //Used when saving the sheet
+        #region Worksheet Private Properties
+        internal ExcelPackage _package;
+		private Uri _worksheetUri;
+		private string _name;
+		private int _sheetID;
+        private int _positionID;
+		private string _relationshipID;
+		private XmlDocument _worksheetXml;
+        internal ExcelWorksheetView _sheetView;
+		internal ExcelHeaderFooter _headerFooter;
+        #endregion
+        #region ExcelWorksheet Constructor
+        /// <summary>
+        /// A worksheet
+        /// </summary>
+        /// <param name="ns">Namespacemanager</param>
+        /// <param name="excelPackage">Package</param>
+        /// <param name="relID">Relationship ID</param>
+        /// <param name="uriWorksheet">URI</param>
+        /// <param name="sheetName">Name of the sheet</param>
+        /// <param name="sheetID">Sheet id</param>
+        /// <param name="positionID">Position</param>
+        /// <param name="hide">hide</param>
+        public ExcelWorksheet(XmlNamespaceManager ns, ExcelPackage excelPackage, string relID, 
+                              Uri uriWorksheet, string sheetName, int sheetID, int positionID,
+                              eWorkSheetHidden hide) :
+            base(ns, null)
+        {
+            SchemaNodeOrder = new string[] { "sheetPr", "tabColor", "outlinePr", "pageSetUpPr", "dimension", "sheetViews", "sheetFormatPr", "cols", "sheetData", "sheetProtection", "protectedRanges","scenarios", "autoFilter", "sortState", "dataConsolidate", "customSheetViews", "customSheetViews", "mergeCells", "phoneticPr", "conditionalFormatting", "dataValidations", "hyperlinks", "printOptions", "pageMargins", "pageSetup", "headerFooter", "linePrint", "rowBreaks", "colBreaks", "customProperties", "cellWatches", "ignoredErrors", "smartTags", "drawing", "legacyDrawing", "legacyDrawingHF", "picture", "oleObjects", "activeXControls", "webPublishItems", "tableParts" , "extLst" };
+            _package = excelPackage;   
+            _relationshipID = relID;
+            _worksheetUri = uriWorksheet;
+            _name = sheetName;
+            _sheetID = sheetID;
+            _positionID = positionID;
+            Hidden = hide;
+            _names = new ExcelNamedRangeCollection(Workbook,this);
+            CreateXml();
+            TopNode = _worksheetXml.DocumentElement;
+        }
+
+        #endregion
+        /// <summary>
+        /// The Uri to the worksheet within the package
+        /// </summary>
+        internal Uri WorksheetUri { get { return (_worksheetUri); } }
+        /// <summary>
+        /// The PackagePart for the worksheet within the package
+        /// </summary>
+        internal PackagePart Part { get { return (_package.Package.GetPart(WorksheetUri)); } }
+        /// <summary>
+        /// The ID for the worksheet's relationship with the workbook in the package
+        /// </summary>
+        internal string RelationshipID { get { return (_relationshipID); } }
+        /// <summary>
+        /// The unique identifier for the worksheet.
+        /// </summary>
+        internal int SheetID { get { return (_sheetID); } }
+        /// <summary>
+        /// The position of the worksheet.
+        /// </summary>
+        internal int PositionID { get { return (_positionID); } set { _positionID = value; } }
+		#region Worksheet Public Properties
+    	/// <summary>
+        /// The index in the worksheets collection
+        /// </summary>
+        public int Index { get { return (_positionID); } }
+        /// <summary>
+        /// Address for autofilter
+        /// <seealso cref="ExcelRangeBase.AutoFilter" />        
+        /// </summary>
+        public ExcelAddressBase AutoFilterAddress
+        {
+            get
+            {
+                string address = GetXmlNodeString("d:autoFilter/@ref");
+                if (address == "")
+                {
+                    return null;
+                }
+                else
+                {
+                    return new ExcelAddressBase(address);
+                }
+            }
+            internal set
+            {
+                SetXmlNodeString("d:autoFilter/@ref", value.Address);
+            }
+        }
+
+		/// <summary>
+		/// Returns a ExcelWorksheetView object that allows you to set the view state properties of the worksheet
+		/// </summary>
+		public ExcelWorksheetView View
+		{
+			get
+			{
+				if (_sheetView == null)
+				{
+                    XmlNode node = TopNode.SelectSingleNode("d:sheetViews/d:sheetView", NameSpaceManager);
+                    if (node == null)
+                    {
+                        CreateNode("d:sheetViews/d:sheetView"); //this one shouls always exist. but check anyway
+                        node = TopNode.SelectSingleNode("d:sheetViews/d:sheetView", NameSpaceManager);
+                    }
+                    _sheetView = new ExcelWorksheetView(NameSpaceManager, node, this);
+				}
+				return (_sheetView);
+			}
+		}
+
+		/// <summary>
+		/// The worksheet's display name as it appears on the tab
+		/// </summary>
+		public string Name
+		{
+			get { return (_name); }
+			set
+			{
+                if (value == _name) return;
+                Name=_package.Workbook.Worksheets.ValidateFixSheetName(Name);
+                _package.Workbook.SetXmlNodeString(string.Format("d:sheets/d:sheet[@sheetId={0}]/@name", _sheetID), value);
+				_name = value;
+            }
+		}
+        internal ExcelNamedRangeCollection _names;
+        /// <summary>
+        /// Provides access to named ranges
+        /// </summary>
+        public ExcelNamedRangeCollection Names 
+        {
+            get
+            {
+                return _names;
+            }
+        }
+		/// <summary>
+		/// Indicates if the worksheet is hidden in the workbook
+		/// </summary>
+		public eWorkSheetHidden Hidden
+		{
+			get 
+            {
+                string state=_package.Workbook.GetXmlNodeString(string.Format("d:sheets/d:sheet[@sheetId={0}]/@state", _sheetID));
+                if (state == "hidden")
+                {
+                    return eWorkSheetHidden.Hidden;
+                }
+                else if (state == "veryHidden")
+                {
+                    return eWorkSheetHidden.VeryHidden;
+                }
+                return eWorkSheetHidden.Visible;
+            }
+			set
+			{
+                    if (value == eWorkSheetHidden.Visible)
+                    {
+                        _package.Workbook.DeleteNode(string.Format("d:sheets/d:sheet[@sheetId={0}]/@state", _sheetID));
+                    }
+                    else
+                    {
+                        string v;
+                        v=value.ToString();                        
+                        v=v.Substring(0,1).ToLower()+v.Substring(1);
+                        _package.Workbook.SetXmlNodeString(string.Format("d:sheets/d:sheet[@sheetId={0}]/@state", _sheetID),v );
+                    }
+		    }
+		}
+        double _defaultRowHeight = double.NaN;
+        /// <summary>
+		/// Get/set the default height of all rows in the worksheet
+		/// </summary>
+        public double DefaultRowHeight
+		{
+			get 
+			{
+				if(double.IsNaN(_defaultRowHeight))
+                {
+                    _defaultRowHeight = GetXmlNodeDouble("d:sheetFormatPr/@defaultRowHeight");
+                    if(double.IsNaN(_defaultRowHeight))
+                    {
+                        _defaultRowHeight = 15; // Excel default height
+                    }
+                }
+				return _defaultRowHeight;
+			}
+			set
+			{
+                _defaultRowHeight = value;
+                SetXmlNodeString("d:sheetFormatPr/@defaultRowHeight", value.ToString(CultureInfo.InvariantCulture));
+                SetXmlNodeBool("d:sheetFormatPr/@customHeight", value != 15);
+
+                if (double.IsNaN(GetXmlNodeDouble("d:sheetFormatPr/@defaultColWidth")))
+                {
+                    DefaultColWidth = 9.140625;
+                }
+			}
+		}
+        /// <summary>
+        /// Get/set the default width of all rows in the worksheet
+        /// </summary>
+        public double DefaultColWidth
+        {
+            get
+            {
+                double ret = GetXmlNodeDouble("d:sheetFormatPr/@defaultColWidth");
+                if (double.IsNaN(ret))
+                {
+                    ret = 9.140625; // Excel's default width
+                }
+                return ret;
+            }
+            set
+            {
+                SetXmlNodeString("d:sheetFormatPr/@defaultColWidth", value.ToString(CultureInfo.InvariantCulture));
+
+                if (double.IsNaN(GetXmlNodeDouble("d:sheetFormatPr/@defaultRowHeight")))
+                {
+                    DefaultRowHeight = 15;
+                }
+            }
+        }
+        /** <outlinePr applyStyles="1" summaryBelow="0" summaryRight="0" /> **/
+        const string outLineSummaryBelowPath = "d:sheetPr/d:outlinePr/@summaryBelow";
+        /// <summary>
+        /// Summary rows below details 
+        /// </summary>
+        public bool OutLineSummaryBelow
+        { 
+            get
+            {
+                return GetXmlNodeBool(outLineSummaryBelowPath);
+            }
+            set
+            {
+                SetXmlNodeString(outLineSummaryBelowPath, value ? "1" : "0");
+            }
+        }
+        const string outLineSummaryRightPath = "d:sheetPr/d:outlinePr/@summaryRight";
+        /// <summary>
+        /// Summary rows to right of details
+        /// </summary>
+        public bool OutLineSummaryRight
+        {
+            get
+            {
+                return GetXmlNodeBool(outLineSummaryRightPath);
+            }
+            set
+            {
+                SetXmlNodeString(outLineSummaryRightPath, value ? "1" : "0");
+            }
+        }
+        const string outLineApplyStylePath = "d:sheetPr/d:outlinePr/@applyStyles";
+        /// <summary>
+        /// Automatic styles
+        /// </summary>
+        public bool OutLineApplyStyle
+        {
+            get
+            {
+                return GetXmlNodeBool(outLineApplyStylePath);
+            }
+            set
+            {
+                SetXmlNodeString(outLineApplyStylePath, value ? "1" : "0");
+            }
+        }
+        const string tabColorPath = "d:sheetPr/d:tabColor/@rgb";
+        /// <summary>
+        /// Color of the sheet tab
+        /// </summary>
+        public Color TabColor
+        {
+            get
+            {
+                string col = GetXmlNodeString(tabColorPath);
+                if (col == "")
+                {
+                    return Color.Empty;
+                }
+                else
+                {
+                    return Color.FromArgb(int.Parse(col, System.Globalization.NumberStyles.AllowHexSpecifier));
+                }
+            }
+            set
+            {
+                SetXmlNodeString(tabColorPath, value.ToArgb().ToString("X"));
+            }
+        }
+        const string codeModuleNamePath = "d:sheetPr/@codeName";
+        internal string CodeModuleName
+        {
+            get
+            {
+                return GetXmlNodeString(codeModuleNamePath);
+            }
+            set
+            {
+                SetXmlNodeString(codeModuleNamePath, value);
+            }
+        }
+        internal void CodeNameChange(string value)
+        {
+            CodeModuleName = value;
+        }
+        public VBA.ExcelVBAModule CodeModule
+        {
+            get
+            {
+                if (_package.Workbook.VbaProject != null)
+                {
+                    return _package.Workbook.VbaProject.Modules[CodeModuleName];
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+        #region WorksheetXml
+		/// <summary>
+		/// The XML document holding the worksheet data.
+        /// All column, row, cell, pagebreak, merged cell and hyperlink-data are loaded into memory and removed from the document when loading the document.        
+		/// </summary>
+		public XmlDocument WorksheetXml
+		{
+			get
+			{
+				return (_worksheetXml);
+			}
+		}
+        internal ExcelVmlDrawingCommentCollection _vmlDrawings = null;
+        /// <summary>
+        /// Vml drawings. underlaying object for comments
+        /// </summary>
+        internal ExcelVmlDrawingCommentCollection VmlDrawingsComments
+        {
+            get
+            {
+                if (_vmlDrawings == null)
+                {
+                    CreateVmlCollection();
+                }
+                return _vmlDrawings;
+            }
+        }
+        internal ExcelCommentCollection _comments = null;
+        /// <summary>
+        /// Collection of comments
+        /// </summary>
+        public ExcelCommentCollection Comments
+        {
+            get
+            {
+                if (_comments == null)
+                {
+                    CreateVmlCollection();
+                    _comments = new ExcelCommentCollection(_package, this, NameSpaceManager);
+                }
+                return _comments;
+            }
+        }
+        private void CreateVmlCollection()
+        {
+            var vmlNode = _worksheetXml.DocumentElement.SelectSingleNode("d:legacyDrawing/@r:id", NameSpaceManager);
+            if (vmlNode == null)
+            {
+                _vmlDrawings = new ExcelVmlDrawingCommentCollection(_package, this, null);
+            }
+            else
+            {
+                if (Part.RelationshipExists(vmlNode.Value))
+                {
+                    var rel = Part.GetRelationship(vmlNode.Value);
+                    var vmlUri = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+
+                    _vmlDrawings = new ExcelVmlDrawingCommentCollection(_package, this, vmlUri);
+                    _vmlDrawings.RelId = rel.Id;
+                }
+            }
+        }
+
+        private void CreateXml()
+        {
+            _worksheetXml = new XmlDocument();
+            _worksheetXml.PreserveWhitespace = ExcelPackage.preserveWhitespace;
+            PackagePart packPart = _package.Package.GetPart(WorksheetUri);
+            string xml = "";
+
+            // First Columns, rows, cells, mergecells, hyperlinks and pagebreakes are loaded from a xmlstream to optimize speed...
+            bool doAdjust = _package.DoAdjustDrawings;
+            _package.DoAdjustDrawings = false;
+            Stream stream = packPart.GetStream();
+
+            XmlTextReader xr = new XmlTextReader(stream);
+            xr.ProhibitDtd = true;
+            
+            LoadColumns(xr);    //columnXml
+            long start = stream.Position;
+            LoadCells(xr);
+            long end = stream.Position;
+            LoadMergeCells(xr);
+            LoadHyperLinks(xr);
+            LoadRowPageBreakes(xr);
+            LoadColPageBreakes(xr);
+            //...then the rest of the Xml is extracted and loaded into the WorksheetXml document.
+            stream.Seek(0, SeekOrigin.Begin);
+            Encoding encoding;
+            xml = GetWorkSheetXml(stream, start, end, out encoding);
+
+            //first char is invalid sometimes?? 
+            if (xml[0] != '<')
+                LoadXmlSafe(_worksheetXml, xml.Substring(1, xml.Length - 1), encoding);
+            else
+                LoadXmlSafe(_worksheetXml, xml, encoding);
+
+            _package.DoAdjustDrawings = doAdjust;
+            ClearNodes();
+        }
+        private void LoadRowPageBreakes(XmlTextReader xr)
+        {
+            if(!ReadUntil(xr, "rowBreaks","colBreaks")) return;
+            while (xr.Read())
+            {
+                if (xr.LocalName == "brk")
+                {
+                    int id;
+                    if (int.TryParse(xr.GetAttribute("id"), out id))
+                    {
+                        Row(id).PageBreak = true;
+                    }
+                }
+                else
+                {
+                    break;
+                }
+            }
+        }
+        private void LoadColPageBreakes(XmlTextReader xr)
+        {
+            if (!ReadUntil(xr, "colBreaks")) return;
+            while (xr.Read())
+            {
+                if (xr.LocalName == "brk")
+                {
+                    int id;
+                    if (int.TryParse(xr.GetAttribute("id"), out id))
+                    {
+                        Column(id).PageBreak = true;
+                    }
+                }
+                else
+                {
+                    break;
+                }
+            }
+        }
+
+        private void ClearNodes()
+        {
+            if (_worksheetXml.SelectSingleNode("//d:cols", NameSpaceManager)!=null)
+            {
+                _worksheetXml.SelectSingleNode("//d:cols", NameSpaceManager).RemoveAll();
+            }
+            if (_worksheetXml.SelectSingleNode("//d:mergeCells", NameSpaceManager) != null)
+            {
+                _worksheetXml.SelectSingleNode("//d:mergeCells", NameSpaceManager).RemoveAll();
+            }
+            if (_worksheetXml.SelectSingleNode("//d:hyperlinks", NameSpaceManager) != null)
+            {
+                _worksheetXml.SelectSingleNode("//d:hyperlinks", NameSpaceManager).RemoveAll();
+            }
+            if (_worksheetXml.SelectSingleNode("//d:rowBreaks", NameSpaceManager) != null)
+            {
+                _worksheetXml.SelectSingleNode("//d:rowBreaks", NameSpaceManager).RemoveAll();
+            }
+            if (_worksheetXml.SelectSingleNode("//d:colBreaks", NameSpaceManager) != null)
+            {
+                _worksheetXml.SelectSingleNode("//d:colBreaks", NameSpaceManager).RemoveAll();
+            }
+        }
+        const int BLOCKSIZE=8192;
+        private string GetWorkSheetXml(Stream stream, long start, long end, out Encoding encoding)
+        {
+            StreamReader sr = new StreamReader(stream);
+            int length = 0;
+            char[] block;
+            int pos;
+            StringBuilder sb = new StringBuilder();
+            Match startmMatch, endMatch;
+            do
+            {
+                int size = stream.Length < BLOCKSIZE ? (int)stream.Length : BLOCKSIZE;
+                block = new char[size];
+                pos = sr.ReadBlock(block, 0, size);                  
+                sb.Append(block,0,pos);
+                length += size;
+            }
+            while (length < start + 20 && length < end);
+            startmMatch = Regex.Match(sb.ToString(), string.Format("(<[^>]*{0}[^>]*>)", "sheetData"));
+            if (!startmMatch.Success) //Not found
+            {
+                encoding = sr.CurrentEncoding;
+                return sb.ToString();
+            }
+            else
+            {
+                string s = sb.ToString();
+                string xml = s.Substring(0, startmMatch.Index); 
+                if(startmMatch.Value.EndsWith("/>"))
+                {
+                    xml += s.Substring(startmMatch.Index, s.Length - startmMatch.Index);
+                }
+                else
+                {
+                    if (sr.Peek() != -1)
+                    {
+                        if (end - BLOCKSIZE > 0)
+                        {
+                            long endSeekStart = end - BLOCKSIZE - 4096 < 0 ? 0 : (end - BLOCKSIZE - 4096);
+                            stream.Seek(endSeekStart, SeekOrigin.Begin);
+                            int size = (int)(stream.Length-endSeekStart);
+                            block = new char[size];
+                            sr = new StreamReader(stream);
+                            pos = sr.ReadBlock(block, 0, size);
+                            sb = new StringBuilder();
+                            sb.Append(block, 0, pos);
+                            s = sb.ToString();
+                        }
+                    }
+                    endMatch = Regex.Match(s, string.Format("(</[^>]*{0}[^>]*>)", "sheetData"));
+                    xml += "<sheetData/>" + s.Substring(endMatch.Index + endMatch.Length, s.Length - (endMatch.Index + endMatch.Length));
+                }
+                if (sr.Peek() > -1)
+                {
+                    xml += sr.ReadToEnd();
+                }
+                
+                encoding = sr.CurrentEncoding;
+                return xml;
+            }
+        }
+        private void GetBlockPos(string xml, string tag, ref int start, ref int end)
+        {
+            Match startmMatch, endMatch;
+            startmMatch = Regex.Match(xml.Substring(start), string.Format("(<[^>]*{0}[^>]*>)", tag)); //"<[a-zA-Z:]*" + tag + "[?]*>");
+
+            if (!startmMatch.Success) //Not found
+            {
+                start = -1;
+                end = -1;
+                return;
+            }
+            var startPos=startmMatch.Index+start;
+            if(startmMatch.Value.Substring(startmMatch.Value.Length-2,1)=="/")
+            {
+                end = startPos + startmMatch.Length;
+            }
+            else
+            {
+                endMatch = Regex.Match(xml.Substring(start), string.Format("(</[^>]*{0}[^>]*>)", tag));
+                if (endMatch.Success)
+                {
+                    end = endMatch.Index + endMatch.Length + start;
+                }
+            }
+            start = startPos;
+        }
+        private bool ReadUntil(XmlTextReader xr,params string[] tagName)
+        {
+            if (xr.EOF) return false;
+            while (!Array.Exists(tagName, tag => xr.LocalName.EndsWith(tag)))
+            {
+                xr.Read();
+                if (xr.EOF) return false;
+            }
+            return (xr.LocalName.EndsWith(tagName[0]));
+        }
+        private void LoadColumns (XmlTextReader xr)//(string xml)
+        {
+            var colList = new List<IRangeID>();
+            if (ReadUntil(xr, "cols", "sheetData"))
+            {
+            //if (xml != "")
+            //{
+                //var xr=new XmlTextReader(new StringReader(xml));
+                while(xr.Read())
+                {
+                    if(xr.LocalName!="col") break;
+                    int min = int.Parse(xr.GetAttribute("min"));
+
+                    int style;
+                    if (xr.GetAttribute("style") == null || !int.TryParse(xr.GetAttribute("style"), out style))
+                    {
+                        style = 0;
+                    }
+                    ExcelColumn col = new ExcelColumn(this, min);
+                   
+                    col._columnMax = int.Parse(xr.GetAttribute("max")); 
+                    col.StyleID = style;
+                    col.Width = xr.GetAttribute("width") == null ? 0 : double.Parse(xr.GetAttribute("width"), CultureInfo.InvariantCulture); 
+                    col.BestFit = xr.GetAttribute("bestFit") != null && xr.GetAttribute("bestFit") == "1" ? true : false;
+                    col.Collapsed = xr.GetAttribute("collapsed") != null && xr.GetAttribute("collapsed") == "1" ? true : false;
+                    col.Phonetic = xr.GetAttribute("phonetic") != null && xr.GetAttribute("phonetic") == "1" ? true : false;
+                    col.OutlineLevel = xr.GetAttribute("outlineLevel") == null ? 0 : int.Parse(xr.GetAttribute("outlineLevel"), CultureInfo.InvariantCulture);
+                    col.Hidden = xr.GetAttribute("hidden") != null && xr.GetAttribute("hidden") == "1" ? true : false;
+                    colList.Add(col);
+                }
+            }
+            _columns = new RangeCollection(colList);
+        }
+        /// <summary>
+        /// Read until the node is found. If not found the xmlreader is reseted.
+        /// </summary>
+        /// <param name="xr">The reader</param>
+        /// <param name="nodeText">Text to search for</param>
+        /// <param name="altNode">Alternative text to search for</param>
+        /// <returns></returns>
+        private static bool ReadXmlReaderUntil(XmlTextReader xr, string nodeText, string altNode)
+        {
+            do
+            {
+                if (xr.LocalName == nodeText || xr.LocalName == altNode) return true;
+            }
+            while(xr.Read());
+            xr.Close();
+            return false;
+        }
+        /// <summary>
+        /// Load Hyperlinks
+        /// </summary>
+        /// <param name="xr">The reader</param>
+        private void LoadHyperLinks(XmlTextReader xr)
+        {
+            if(!ReadUntil(xr, "hyperlinks", "rowBreaks", "colBreaks")) return;
+            while (xr.Read())
+            {
+                if (xr.LocalName == "hyperlink")
+                {
+                    int fromRow, fromCol, toRow, toCol;
+                    ExcelCell.GetRowColFromAddress(xr.GetAttribute("ref"), out fromRow, out fromCol, out toRow, out toCol);
+                    ulong id = ExcelCell.GetCellID(_sheetID, fromRow, fromCol);
+                    ExcelCell cell = _cells[id] as ExcelCell;
+                    if (xr.GetAttribute("id", ExcelPackage.schemaRelationships) != null)
+                    {
+                        cell.HyperLinkRId = xr.GetAttribute("id", ExcelPackage.schemaRelationships);
+                        var uri = Part.GetRelationship(cell.HyperLinkRId).TargetUri;
+                        try
+                        {
+                            if (uri.IsAbsoluteUri)
+                            {
+                                cell.Hyperlink = new ExcelHyperLink(HttpUtility.UrlDecode(uri.OriginalString));
+                            }
+                            else
+                            {
+                                cell.Hyperlink = new ExcelHyperLink(HttpUtility.UrlDecode(uri.OriginalString), UriKind.Relative);
+                            }
+                        }
+                        catch
+                        {
+                            //We should never end up here, but to aviod unhandled exceptions we just set the uri here. JK
+                            cell.Hyperlink = uri;
+                        }
+                        Part.DeleteRelationship(cell.HyperLinkRId); //Delete the relationship, it is recreated when we save the package.
+                    }
+                    else if (xr.GetAttribute("location") != null)
+                    {
+                        ExcelHyperLink hl = new ExcelHyperLink(xr.GetAttribute("location"), xr.GetAttribute("display"));
+                        hl.RowSpann = toRow - fromRow;
+                        hl.ColSpann = toCol - fromCol;
+                        cell.Hyperlink = hl;
+                    }
+                    string tt = xr.GetAttribute("tooltip");
+                    if (!string.IsNullOrEmpty(tt))
+                    {
+                        ((ExcelHyperLink)cell.Hyperlink).ToolTip = tt;
+                    }
+                }
+                else
+                {
+                    break;
+                }
+            }
+        }
+        /// <summary>
+        /// Load cells
+        /// </summary>
+        /// <param name="xr">The reader</param>
+        private void LoadCells(XmlTextReader xr)
+        {
+            var cellList=new List<IRangeID>();
+            var rowList = new List<IRangeID>();
+            var formulaList = new List<IRangeID>();
+            ReadUntil(xr, "sheetData", "mergeCells", "hyperlinks", "rowBreaks", "colBreaks");
+            ExcelCell cell = null;
+            xr.Read();
+            
+            while (!xr.EOF)
+            {
+                while (xr.NodeType == XmlNodeType.EndElement)
+                {
+                    xr.Read();
+                }                
+                if (xr.LocalName == "row")
+                {
+                    int row = Convert.ToInt32(xr.GetAttribute("r"));
+
+                    if (xr.AttributeCount > 2 || (xr.AttributeCount == 2 && xr.GetAttribute("spans") != null))
+                    {
+                        rowList.Add(AddRow(xr, row));
+                    }
+                    xr.Read();
+                }
+                else if (xr.LocalName == "c")
+                {
+                    if (cell != null) cellList.Add(cell);
+                    cell = new ExcelCell(this, xr.GetAttribute("r"));
+                    if (xr.GetAttribute("t") != null) cell.DataType = xr.GetAttribute("t");
+                    cell.StyleID = xr.GetAttribute("s") == null ? 0 : int.Parse(xr.GetAttribute("s"));
+                    xr.Read();
+                }
+                else if (xr.LocalName == "v")
+                {
+                    cell._value = GetValueFromXml(cell, xr);
+                    xr.Read();
+                }
+                else if (xr.LocalName == "f")
+                {
+                    string t = xr.GetAttribute("t");
+                    if (t == null)
+                    {
+                        cell._formula = xr.ReadElementContentAsString();
+                        formulaList.Add(cell);
+                    }
+                    else if (t == "shared")
+                    {
+
+                        string si = xr.GetAttribute("si");
+                        if (si != null)
+                        {
+                            cell._sharedFormulaID = int.Parse(si);
+                            string address = xr.GetAttribute("ref");
+                            string formula = xr.ReadElementContentAsString();
+                            if (formula != "")
+                            {
+                                _sharedFormulas.Add(cell.SharedFormulaID, new Formulas() { Index = cell.SharedFormulaID, Formula = formula, Address = address, StartRow = cell.Row, StartCol = cell.Column });
+                            }
+                        }
+                        else
+                        {
+                            xr.Read();  //Something is wrong in the sheet, read next
+                        }
+                    }
+                    else if (t == "array") //TODO: Array functions are not support yet. Read the formula for the start cell only.
+                    {
+                        string address = xr.GetAttribute("ref");
+                        cell._formula = xr.ReadElementContentAsString();
+                        cell._sharedFormulaID = GetMaxShareFunctionIndex(true); //We use the shared formula id here, just so we can use the same dictionary for both Array and Shared forulas.
+                        _sharedFormulas.Add(cell._sharedFormulaID, new Formulas() { Index = cell._sharedFormulaID, Formula = cell._formula, Address = address, StartRow = cell.Row, StartCol = cell.Column, IsArray = true });
+                    }
+                    else // ??? some other type
+                    {
+                        xr.Read();  //Something is wrong in the sheet, read next
+                    }
+
+                }
+                else if (xr.LocalName == "is")   //Inline string
+                {
+                    xr.Read();
+                    if (xr.LocalName == "t")
+                    {
+                        cell._value = xr.ReadInnerXml();
+                    }
+                    else
+                    {
+                        cell._value = xr.ReadOuterXml();
+                        cell.IsRichText = true;
+                    }
+                }
+                else
+                {
+                    break;
+                }
+            }
+            if (cell != null) cellList.Add(cell);
+
+            _cells = new RangeCollection(cellList);
+            _rows = new RangeCollection(rowList);
+            _formulaCells = new RangeCollection(formulaList);
+        }
+        /// <summary>
+        /// Load merged cells
+        /// </summary>
+        /// <param name="xr"></param>
+        private void LoadMergeCells(XmlTextReader xr)
+        {
+            if(ReadUntil(xr, "mergeCells", "hyperlinks", "rowBreaks", "colBreaks") && !xr.EOF)
+            {
+                while (xr.Read())
+                {
+                    if (xr.LocalName != "mergeCell") break;
+
+                    string address = xr.GetAttribute("ref");
+                    int fromRow, fromCol, toRow, toCol;
+                    ExcelCellBase.GetRowColFromAddress(address, out fromRow, out fromCol, out toRow, out toCol);
+                    for (int row = fromRow; row <= toRow; row++)
+                    {
+                        for (int col = fromCol; col <= toCol; col++)
+                        {
+                            Cell(row, col).Merge = true;
+                        }
+                    }
+
+                    _mergedCells.List.Add(address);
+                }
+            }
+        }
+        /// <summary>
+        /// Update merged cells
+        /// </summary>
+        /// <param name="sw">The writer</param>
+        private void UpdateMergedCells(StreamWriter sw)
+        {
+            sw.Write("<mergeCells>");
+            foreach (string address in _mergedCells)
+            {
+                sw.Write("<mergeCell ref=\"{0}\" />", address);
+            }
+            sw.Write("</mergeCells>");
+        }
+        /// <summary>
+        /// Reads a row from the XML reader
+        /// </summary>
+        /// <param name="xr">The reader</param>
+        /// <param name="row">The row number</param>
+        /// <returns></returns>
+        private ExcelRow AddRow(XmlTextReader xr, int row)
+        {
+            ExcelRow r = new ExcelRow(this, row);
+
+            r.Collapsed = xr.GetAttribute("collapsed") != null && xr.GetAttribute("collapsed")== "1" ? true : false;
+            if (xr.GetAttribute("ht") != null) r.Height = double.Parse(xr.GetAttribute("ht"), CultureInfo.InvariantCulture);
+            r.Hidden = xr.GetAttribute("hidden") != null && xr.GetAttribute("hidden") == "1" ? true : false; ;
+            r.OutlineLevel = xr.GetAttribute("outlineLevel") == null ? 0 : int.Parse(xr.GetAttribute("outlineLevel"), CultureInfo.InvariantCulture); ;
+            r.Phonetic = xr.GetAttribute("ph") != null && xr.GetAttribute("ph") == "1" ? true : false; ;
+            r.StyleID = xr.GetAttribute("s") == null ? 0 : int.Parse(xr.GetAttribute("s"), CultureInfo.InvariantCulture);
+            r.CustomHeight = xr.GetAttribute("customHeight") == null ? false : xr.GetAttribute("customHeight")=="1";
+            return r;
+        }
+
+        private object GetValueFromXml(ExcelCell cell, XmlTextReader xr)
+        {
+            object value;
+            //XmlNode vnode = colNode.SelectSingleNode("d:v", NameSpaceManager);
+            //if (vnode == null) return null;
+
+            if (cell.DataType == "s")
+            {
+                int ix = xr.ReadElementContentAsInt();
+                value = _package.Workbook._sharedStringsList[ix].Text;
+                cell.IsRichText = _package.Workbook._sharedStringsList[ix].isRichText;
+            }
+            else if (cell.DataType == "str")
+            {
+                value = xr.ReadElementContentAsString();
+            }
+            else if (cell.DataType == "b")
+            {
+                value = (xr.ReadElementContentAsString()!="0");
+            }
+            else
+            {
+                int n = cell.Style.Numberformat.NumFmtID;
+                string v = xr.ReadElementContentAsString();
+
+                if ((n >= 14 && n <= 22) || (n >= 45 && n <= 47))
+                {
+                    double res;
+                    if (double.TryParse(v, NumberStyles.Any, CultureInfo.InvariantCulture, out res))
+                    {
+                        value = DateTime.FromOADate(res);
+                    }
+                    else
+                    {
+                        value = "";
+                    }
+                }
+                else
+                {
+                    double d;
+                    if (double.TryParse(v, NumberStyles.Any, CultureInfo.InvariantCulture, out d))
+                    {
+                        value = d;
+                    }
+                    else
+                    {
+                        value = double.NaN;
+                    }
+                }
+            }
+            return value;
+        }
+        //private string GetSharedString(int stringID)
+        //{
+        //    string retValue = null;
+        //    XmlNodeList stringNodes = xlPackage.Workbook.SharedStringsXml.SelectNodes(string.Format("//d:si", stringID), NameSpaceManager);
+        //    XmlNode stringNode = stringNodes[stringID];
+        //    if (stringNode != null)
+        //        retValue = stringNode.InnerText;
+        //    return (retValue);
+        //}
+        #endregion
+		#region HeaderFooter
+		/// <summary>
+		/// A reference to the header and footer class which allows you to 
+		/// set the header and footer for all odd, even and first pages of the worksheet
+        /// </summary>
+        /// <remarks>
+        /// To format the text you can use the following format
+        /// <list type="table">
+        /// <listheader><term>Prefix</term><description>Description</description></listheader>
+        /// <item><term>&amp;U</term><description>Underlined</description></item>
+        /// <item><term>&amp;E</term><description>Double Underline</description></item>
+        /// <item><term>&amp;K:xxxxxx</term><description>Color. ex &amp;K:FF0000 for red</description></item>
+        /// <item><term>&amp;"Font,Regular Bold Italic"</term><description>Changes the font. Regular or Bold or Italic or Bold Italic can be used. ex &amp;"Arial,Bold Italic"</description></item>
+        /// <item><term>&amp;nn</term><description>Change font size. nn is an integer. ex &amp;24</description></item>
+        /// <item><term>&amp;G</term><description>Placeholder for images. Images can not be added by the library, but its possible to use in a template.</description></item>
+        /// </list>
+        /// </remarks>
+        public ExcelHeaderFooter HeaderFooter
+		{
+			get
+			{
+				if (_headerFooter == null)
+				{
+                    XmlNode headerFooterNode = TopNode.SelectSingleNode("d:headerFooter", NameSpaceManager);
+                    if (headerFooterNode == null)
+                        headerFooterNode= CreateNode("d:headerFooter");
+                    _headerFooter = new ExcelHeaderFooter(NameSpaceManager, headerFooterNode, this);
+				}                
+				return (_headerFooter);
+			}
+		}
+		#endregion
+
+        #region "PrinterSettings"
+        /// <summary>
+        /// Printer settings
+        /// </summary>
+        public ExcelPrinterSettings PrinterSettings
+        {
+            get
+            {
+                var ps = new ExcelPrinterSettings(NameSpaceManager, TopNode, this);
+                ps.SchemaNodeOrder = SchemaNodeOrder;
+                return ps;
+            }
+        }
+        #endregion
+
+		#endregion // END Worksheet Public Properties
+
+		#region Worksheet Public Methods
+        
+        /// <summary>
+		/// Provides access to an individual cell within the worksheet.
+		/// </summary>
+		/// <param name="row">The row number in the worksheet</param>
+		/// <param name="col">The column number in the worksheet</param>
+		/// <returns></returns>		
+        internal ExcelCell Cell(int row, int col)
+        {
+            ulong cellID=ExcelCell.GetCellID(SheetID, row, col);
+            if (!_cells.ContainsKey(cellID))
+            {
+                _cells.Add(new ExcelCell(this, row, col));
+            }
+            return _cells[cellID] as ExcelCell;
+        }
+        /// <summary>
+        /// Provides access to a range of cells
+        /// </summary>  
+        public ExcelRange Cells
+        {
+            get
+            {
+                return new ExcelRange(this, 1, 1, ExcelPackage.MaxRows, ExcelPackage.MaxColumns);
+            }
+        }
+        /// <summary>
+        /// Provides access to the selected range of cells
+        /// </summary>  
+        public ExcelRange SelectedRange
+        {
+            get
+            {
+                return new ExcelRange(this, View.SelectedRange);
+            }
+        }
+        MergeCellsCollection<string> _mergedCells = new MergeCellsCollection<string>();
+        /// <summary>
+        /// Addresses to merged ranges
+        /// </summary>
+        public MergeCellsCollection<string> MergedCells
+        {
+            get
+            {
+                return _mergedCells;
+            }
+        }
+        /// <summary>
+		/// Provides access to an individual row within the worksheet so you can set its properties.
+		/// </summary>
+		/// <param name="row">The row number in the worksheet</param>
+		/// <returns></returns>
+		public ExcelRow Row(int row)
+		{
+            ExcelRow r;
+            ulong id = ExcelRow.GetRowID(_sheetID, row);
+            if (_rows.ContainsKey(id))
+            {
+                r = _rows[id] as ExcelRow;
+            }
+            else
+            {
+                r = new ExcelRow(this, row);
+                _rows.Add(r);
+            }
+            return r;
+		}
+		/// <summary>
+		/// Provides access to an individual column within the worksheet so you can set its properties.
+		/// </summary>
+		/// <param name="col">The column number in the worksheet</param>
+		/// <returns></returns>
+		public ExcelColumn Column(int col)
+		{
+            ExcelColumn column;
+            ulong id=ExcelColumn.GetColumnID(_sheetID, col);
+            if (_columns.ContainsKey(id))
+            {
+                column = _columns[id] as ExcelColumn;
+                if (column.ColumnMin != column.ColumnMax)
+                {
+                    int maxCol = column.ColumnMax;
+                    column.ColumnMax=col;
+                    ExcelColumn copy = CopyColumn(column, col + 1, maxCol);
+                }
+            }
+            else
+            {
+                foreach (ExcelColumn checkColumn in _columns)
+                {
+                    if (col > checkColumn.ColumnMin && col <= checkColumn.ColumnMax)
+                    {
+                        int maxCol = checkColumn.ColumnMax;
+                        checkColumn.ColumnMax = col - 1;
+                        if (maxCol > col)
+                        {
+                            ExcelColumn newC = CopyColumn(checkColumn, col + 1, maxCol);
+                        }
+                        return CopyColumn(checkColumn, col,col);                        
+                    }
+                }
+                column = new ExcelColumn(this, col);
+                _columns.Add(column);
+             }
+            return column;
+		}
+        /// <summary>
+        /// Returns the name of the worksheet
+        /// </summary>
+        /// <returns>The name of the worksheet</returns>
+        public override string ToString()
+        {
+            return Name;
+        }
+        internal ExcelColumn CopyColumn(ExcelColumn c, int col, int maxCol)
+        {
+            ExcelColumn newC = new ExcelColumn(this, col);
+            newC.ColumnMax = maxCol;
+            if (c.StyleName != "")
+                newC.StyleName = c.StyleName;
+            else
+                newC.StyleID = c.StyleID;
+
+            newC._width = c._width;
+            newC._hidden = c.Hidden;
+            newC.OutlineLevel = c.OutlineLevel;
+            newC.Phonetic = c.Phonetic;
+            newC.BestFit = c.BestFit;
+            _columns.Add(newC);
+            return newC;
+       }
+        /// <summary>
+        /// Selects a range in the worksheet. The active cell is the topmost cell.
+        /// Make the current worksheet active.
+        /// </summary>
+        /// <param name="Address">An address range</param>
+        public void Select(string Address)
+        {
+            Select(Address, true);
+        }
+        /// <summary>
+        /// Selects a range in the worksheet. The actice cell is the topmost cell.
+        /// </summary>
+        /// <param name="Address">A range of cells</param>
+        /// <param name="SelectSheet">Make the sheet active</param>
+        public void Select(string Address, bool SelectSheet)
+        {
+            int fromCol, fromRow, toCol, toRow;
+            //Get rows and columns and validate as well
+            ExcelCell.GetRowColFromAddress(Address, out fromRow, out fromCol, out toRow, out toCol);
+
+            if (SelectSheet)
+            {
+                View.TabSelected = true;
+            }
+            View.SelectedRange = Address;
+            View.ActiveCell = ExcelCell.GetAddress(fromRow, fromCol);            
+        }
+        /// <summary>
+        /// Selects a range in the worksheet. The active cell is the topmost cell of the first address.
+        /// Make the current worksheet active.
+        /// </summary>
+        /// <param name="Address">An address range</param>
+        public void Select(ExcelAddress Address)
+        {
+            Select(Address, true);
+        }
+        /// <summary>
+        /// Selects a range in the worksheet. The active cell is the topmost cell of the first address.
+        /// </summary>
+        /// <param name="Address">A range of cells</param>
+        /// <param name="SelectSheet">Make the sheet active</param>
+        public void Select(ExcelAddress Address, bool SelectSheet)
+        {
+
+            if (SelectSheet)
+            {
+                View.TabSelected = true;
+            }
+            string selAddress = ExcelCellBase.GetAddress(Address.Start.Row, Address.Start.Column) + ":" + ExcelCellBase.GetAddress(Address.End.Row, Address.End.Column);
+            if (Address.Addresses != null)
+            {
+                foreach (var a in Address.Addresses)
+                {
+                    selAddress += " " + ExcelCellBase.GetAddress(a.Start.Row, a.Start.Column) + ":" + ExcelCellBase.GetAddress(a.End.Row, a.End.Column);
+                }
+            }
+            View.SelectedRange = selAddress;
+            View.ActiveCell = ExcelCell.GetAddress(Address.Start.Row, Address.Start.Column);
+        }
+
+		#region InsertRow
+        /// <summary>
+        /// Inserts a new row into the spreadsheet.  Existing rows below the position are 
+        /// shifted down.  All formula are updated to take account of the new row.
+        /// </summary>
+        /// <param name="rowFrom">The position of the new row</param>
+        /// <param name="rows">Number of rows to insert</param>
+        public void InsertRow(int rowFrom, int rows)
+        {
+            InsertRow(rowFrom, rows, 0);
+        }
+        /// <summary>
+		/// Inserts a new row into the spreadsheet.  Existing rows below the position are 
+		/// shifted down.  All formula are updated to take account of the new row.
+		/// </summary>
+        /// <param name="rowFrom">The position of the new row</param>
+        /// <param name="rows">Number of rows to insert.</param>
+        /// <param name="copyStylesFromRow">Copy Styles from this row. Applied to all inserted rows</param>
+		public void InsertRow(int rowFrom, int rows, int copyStylesFromRow)
+		{
+            //Insert the new row into the collection
+            ulong copyRowID=ExcelRow.GetRowID(SheetID, copyStylesFromRow);
+            List<ExcelCell> copyStylesCells=new List<ExcelCell>();
+            if (copyStylesFromRow > 0)
+            {
+                int startIndex = _cells.IndexOf(copyRowID);
+                startIndex = ~startIndex;
+                while(startIndex < _cells.Count && (_cells[startIndex] as ExcelCell).Row==copyStylesFromRow)
+                {
+                    copyStylesCells.Add(_cells[startIndex++] as ExcelCell);
+                }
+            }
+            ulong rowID=ExcelRow.GetRowID(SheetID, rowFrom);
+
+            _cells.InsertRows(rowID, rows);
+            _rows.InsertRows(rowID, rows);
+            _formulaCells.InsertRowsUpdateIndex(rowID, rows);
+            if (_comments != null) _comments._comments.InsertRowsUpdateIndex(rowID, rows);
+            if (_vmlDrawings != null) _vmlDrawings._drawings.InsertRowsUpdateIndex(rowID, rows);
+
+            foreach (ExcelCell cell in _formulaCells)
+            {
+                if (cell.SharedFormulaID < 0)
+                {
+                    cell.Formula = ExcelCell.UpdateFormulaReferences(cell.Formula, rows, 0, rowFrom, 0);
+                }
+                else
+                {
+                    throw new Exception("Shared formula error");
+                }
+            }
+
+            FixSharedFormulasRows(rowFrom, rows);
+            
+            FixMergedCells(rowFrom, rows,false);
+
+            //Copy the styles
+            foreach (ExcelCell cell in copyStylesCells)
+            {
+                Cells[rowFrom, cell.Column, rowFrom + rows - 1, cell.Column].StyleID = cell.StyleID;
+            }
+        }
+        /// <summary>
+        /// Adds a value to the row of merged cells to fix for inserts or deletes
+        /// </summary>
+        /// <param name="position"></param>
+        /// <param name="rows"></param>
+        /// <param name="delete"></param>
+        private void FixMergedCells(int position, int rows, bool delete)
+        {
+            List<int> removeIndex = new List<int>();
+            for (int i = 0; i < _mergedCells.Count; i++)
+            {
+                ExcelAddressBase addr = new ExcelAddressBase(_mergedCells[i]), newAddr ;
+                if (delete)
+                {
+                    newAddr=addr.DeleteRow(position, rows);
+                    if (newAddr == null)
+                    {
+                        removeIndex.Add(i);
+                        continue;
+                    }
+                }
+                else
+                {
+                    newAddr = addr.AddRow(position, rows);
+                }
+                
+                //The address has changed.
+                if (newAddr._address != addr._address)
+                {
+                    //Set merged prop for cells
+                    for (int row = newAddr._fromRow; row <= newAddr._toRow; row++)
+                    {
+                        for (int col = newAddr._fromCol; col <= newAddr._toCol; col++)
+                        {
+                            Cell(row, col).Merge = true;
+                        }
+                    }
+                }
+
+                _mergedCells.List[i] = newAddr._address;
+            }
+            for (int i = removeIndex.Count - 1; i >= 0; i--)
+            {
+                _mergedCells.List.RemoveAt(removeIndex[i]);
+            }
+        }
+        private void FixSharedFormulasRows(int position, int rows)
+        {
+            List<Formulas> added = new List<Formulas>();
+            List<Formulas> deleted = new List<Formulas>();
+
+            foreach (int id in _sharedFormulas.Keys)
+            {
+                var f = _sharedFormulas[id];
+                int fromCol, fromRow, toCol, toRow;
+
+                ExcelCell.GetRowColFromAddress(f.Address, out fromRow, out fromCol, out toRow, out toCol);
+                if (position >= fromRow && position+(Math.Abs(rows)) <= toRow) //Insert/delete is whithin the share formula address
+                {
+                    if (rows > 0) //Insert
+                    {
+                        f.Address = ExcelCell.GetAddress(fromRow, fromCol) + ":" + ExcelCell.GetAddress(position - 1, toCol);
+                        if (toRow != fromRow)
+                        {
+                            Formulas newF = new Formulas();
+                            newF.StartCol = f.StartCol;
+                            newF.StartRow = position + rows;
+                            newF.Address = ExcelCell.GetAddress(position + rows, fromCol) + ":" + ExcelCell.GetAddress(toRow + rows, toCol);
+                            newF.Formula = ExcelCell.TranslateFromR1C1(ExcelCell.TranslateToR1C1(f.Formula, f.StartRow, f.StartCol), position, f.StartCol);
+                            added.Add(newF);
+                        }
+                    }
+                    else
+                    {
+                        if (fromRow - rows < toRow)
+                        {
+                            f.Address = ExcelCell.GetAddress(fromRow, fromCol, toRow+rows, toCol);
+                        }
+                        else
+                        {
+                            f.Address = ExcelCell.GetAddress(fromRow, fromCol) + ":" + ExcelCell.GetAddress(toRow + rows, toCol);
+                        }
+                    }
+                }
+                else if (position <= toRow)
+                {
+                    if (rows > 0) //Insert before shift down
+                    {
+                        f.StartRow += rows;
+                        //f.Formula = ExcelCell.UpdateFormulaReferences(f.Formula, rows, 0, position, 0); //Recalc the cells positions
+                        f.Address = ExcelCell.GetAddress(fromRow + rows, fromCol) + ":" + ExcelCell.GetAddress(toRow + rows, toCol);
+                    }
+                    else
+                    {
+                        //Cells[f.Address].SetSharedFormulaID(int.MinValue);
+                        if (position <= fromRow && position + Math.Abs(rows) > toRow)  //Delete the formula 
+                        {
+                            deleted.Add(f);
+                        }
+                        else
+                        {
+                            toRow = toRow + rows < position - 1 ? position - 1 : toRow + rows;
+                            if (position <= fromRow)
+                            {
+                                fromRow = fromRow + rows < position ? position : fromRow + rows;
+                            }
+
+                            f.Address = ExcelCell.GetAddress(fromRow, fromCol, toRow, toCol);
+                            Cells[f.Address].SetSharedFormulaID(f.Index);
+                            //f.StartRow = fromRow;
+
+                            //f.Formula = ExcelCell.UpdateFormulaReferences(f.Formula, rows, 0, position, 0);
+                       
+                        }
+                    }
+                }
+            }
+
+            AddFormulas(added, position, rows);
+
+            //Remove formulas
+            foreach (Formulas f in deleted)
+            {
+                _sharedFormulas.Remove(f.Index);
+            }
+
+            //Fix Formulas
+            added = new List<Formulas>();
+            foreach (int id in _sharedFormulas.Keys)
+            {
+                var f = _sharedFormulas[id];
+                UpdateSharedFormulaRow(ref f, position, rows, ref added);
+            }
+            AddFormulas(added, position, rows);
+        }
+
+        private void AddFormulas(List<Formulas> added, int position, int rows)
+        {
+            //Add new formulas
+            foreach (Formulas f in added)
+            {
+                f.Index = GetMaxShareFunctionIndex(false);
+                _sharedFormulas.Add(f.Index, f);
+                Cells[f.Address].SetSharedFormulaID(f.Index);
+            }
+        }
+
+        private void UpdateSharedFormulaRow(ref Formulas formula, int startRow, int rows, ref List<Formulas> newFormulas)
+        {
+            int fromRow,fromCol, toRow, toCol;
+            int newFormulasCount = newFormulas.Count;
+            ExcelCellBase.GetRowColFromAddress(formula.Address, out fromRow, out fromCol, out toRow, out toCol);
+            //int refSplits = Regex.Split(formula.Formula, "#REF!").GetUpperBound(0);
+            string formualR1C1;
+            if (rows > 0 || fromRow <= startRow)
+            {
+                formualR1C1 = ExcelRangeBase.TranslateToR1C1(formula.Formula, formula.StartRow, formula.StartCol);
+                formula.Formula = ExcelRangeBase.TranslateFromR1C1(formualR1C1, fromRow, formula.StartCol);
+            }
+            else
+            {
+                formualR1C1 = ExcelRangeBase.TranslateToR1C1(formula.Formula, formula.StartRow-rows, formula.StartCol);
+                formula.Formula = ExcelRangeBase.TranslateFromR1C1(formualR1C1, formula.StartRow, formula.StartCol);
+            }
+            //bool isRef = false;
+            //Formulas restFormula=formula;
+            string prevFormualR1C1 = formualR1C1;
+            for (int row = fromRow; row <= toRow; row++)
+            {
+                for (int col = fromCol; col <= toCol; col++)
+                {
+                    string newFormula;
+                    string currentFormulaR1C1;
+                    if (rows > 0 || row < startRow)
+                    {
+                        newFormula = ExcelCellBase.UpdateFormulaReferences(ExcelCell.TranslateFromR1C1(formualR1C1, row, col), rows, 0, startRow, 0);
+                        currentFormulaR1C1 = ExcelRangeBase.TranslateToR1C1(newFormula, row, col);
+                    }
+                    else
+                    {
+                        newFormula = ExcelCellBase.UpdateFormulaReferences(ExcelCell.TranslateFromR1C1(formualR1C1, row-rows, col), rows, 0, startRow, 0);
+                        currentFormulaR1C1 = ExcelRangeBase.TranslateToR1C1(newFormula, row, col);
+                    }
+                    if (currentFormulaR1C1 != prevFormualR1C1) //newFormula.Contains("#REF!"))
+                    {
+                        //if (refSplits == 0 || Regex.Split(newFormula, "#REF!").GetUpperBound(0) != refSplits)
+                        //{
+                        //isRef = true;
+                        if (row == fromRow && col == fromCol)
+                        {
+                            formula.Formula = newFormula;
+                        }
+                        else
+                        {
+                            if (newFormulas.Count == newFormulasCount)
+                            {
+                                formula.Address = ExcelCellBase.GetAddress(formula.StartRow, formula.StartCol, row - 1, col);
+                            }
+                            else
+                            {
+                                newFormulas[newFormulas.Count - 1].Address = ExcelCellBase.GetAddress(newFormulas[newFormulas.Count - 1].StartRow, newFormulas[newFormulas.Count - 1].StartCol, row - 1, col);
+                            }
+                            var refFormula = new Formulas();
+                            refFormula.Formula = newFormula;
+                            refFormula.StartRow = row;
+                            refFormula.StartCol = col;
+                            newFormulas.Add(refFormula);
+
+                            //restFormula = null;
+                            prevFormualR1C1 = currentFormulaR1C1;
+                        }
+                    }
+                    //    }
+                    //    else
+                    //    {
+                    //        isRef = false;
+                    //    }
+                    //}
+                    //else
+                    //{
+                    //    isRef = false;
+                    //}
+                    //if (restFormula==null)
+                    //{
+                        //if (newFormulas.Count == newFormulasCount)
+                        //{
+                        //    formula.Address = ExcelCellBase.GetAddress(formula.StartRow, formula.StartCol, row - 1, col);
+                        //}
+                        //else
+                        //{
+//                            newFormulas[newFormulas.Count - 1].Address = ExcelCellBase.GetAddress(newFormulas[newFormulas.Count - 1].StartRow, newFormulas[0].StartCol, row - 1, col);
+                        //}
+
+                        //restFormula = new Formulas();
+                        //restFormula.Formula = newFormula;
+                        //restFormula.StartRow = row;
+                        //restFormula.StartCol = col;
+                        //newFormulas.Add(restFormula);
+                    //}
+                }
+            }
+            if (rows < 0 && formula.StartRow > startRow)
+            {
+                if (formula.StartRow + rows < startRow)
+                {
+                    formula.StartRow = startRow;
+                }
+                else
+                {
+                    formula.StartRow += rows;
+                }
+            }
+            if (newFormulas.Count > newFormulasCount)
+            {
+                newFormulas[newFormulas.Count - 1].Address = ExcelCellBase.GetAddress(newFormulas[newFormulas.Count - 1].StartRow, newFormulas[newFormulas.Count - 1].StartCol, toRow, toCol);
+            }
+        }
+        #endregion
+
+        #region DeleteRow
+        /// <summary>
+        /// Deletes the specified row from the worksheet.
+        /// </summary>
+        /// <param name="rowFrom">The number of the start row to be deleted</param>
+        /// <param name="rows">Number of rows to delete</param>
+        public void DeleteRow(int rowFrom, int rows)
+        {
+            ulong rowID = ExcelRow.GetRowID(SheetID, rowFrom);
+
+            _cells.DeleteRows(rowID, rows, true);
+            _rows.DeleteRows(rowID, rows, true);
+            _formulaCells.DeleteRows(rowID, rows, false);
+            if (_comments != null) _comments._comments.DeleteRows(rowID, rows, false);
+            if (_vmlDrawings != null) _vmlDrawings._drawings.DeleteRows(rowID, rows, false);
+
+            foreach (ExcelCell cell in _formulaCells)
+            {
+                cell._formula = ExcelCell.UpdateFormulaReferences(cell.Formula, -rows, 0, rowFrom, 0);
+                cell._formulaR1C1 = "";
+            }
+            FixSharedFormulasRows(rowFrom, -rows);
+            FixMergedCells(rowFrom, rows,true);
+        }
+        /// <summary>
+        /// Deletes the specified row from the worksheet.
+        /// </summary>
+        /// <param name="rowFrom">The number of the start row to be deleted</param>
+        /// <param name="rows">Number of rows to delete</param>
+        /// <param name="shiftOtherRowsUp">Not used. Rows are always shifted</param>
+        public void DeleteRow(int rowFrom, int rows, bool shiftOtherRowsUp)
+		{
+            if (shiftOtherRowsUp)
+            {
+                DeleteRow(rowFrom, rows);
+            }
+            else
+            {
+                ulong rowID = ExcelRow.GetRowID(SheetID, rowFrom);
+                _cells.DeleteRows(rowID, rows, true);
+                _rows.DeleteRows(rowID, rows, true);
+                _formulaCells.DeleteRows(rowID, rows, false);
+                if (_comments != null) _comments._comments.DeleteRows(rowID, rows, false);
+                if (_vmlDrawings != null) _vmlDrawings._drawings.DeleteRows(rowID, rows, false);
+            }
+        }
+		#endregion
+
+        /// <summary>
+        /// Get the cell value from thw worksheet
+        /// </summary>
+        /// <param name="Row">The row number</param>
+        /// <param name="Column">The row number</param>
+        /// <returns>The value</returns>
+        public object GetValue(int Row, int Column)
+        {
+            ulong cellID = ExcelCell.GetCellID(SheetID, Row, Column);
+
+            if (_cells.ContainsKey(cellID))
+            {
+                var cell = ((ExcelCell)_cells[cellID]);
+                if (cell.IsRichText)
+                {
+                    return (object)Cells[Row, Column].RichText.Text;
+                }
+                else
+                {
+                    return cell.Value;
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Get a strongly typed cell value from the worksheet
+        /// </summary>
+        /// <typeparam name="T">The type</typeparam>
+        /// <param name="Row">The row number</param>
+        /// <param name="Column">The row number</param>
+        /// <returns>The value. If the value can't be converted to the specified type, the default value will be returned</returns>
+        public T GetValue<T>(int Row, int Column)
+        {
+             ulong cellID=ExcelCell.GetCellID(SheetID, Row, Column);
+                        
+            if (!_cells.ContainsKey(cellID))
+            {
+                return default(T);
+            }
+
+            var cell=((ExcelCell)_cells[cellID]);
+            if (cell.IsRichText)
+            {
+                return (T)(object)Cells[Row, Column].RichText.Text;
+            }
+            else
+            {
+                return GetTypedValue<T>(cell.Value);
+            }
+        }
+        //Thanks to Michael Tran for parts of this method
+        internal T GetTypedValue<T>(object v)
+        {
+            if (v == null)
+            {
+                return default(T);
+            }
+            Type fromType = v.GetType();
+            Type toType = typeof(T);
+            if (fromType == toType)
+            {
+                return (T)v;
+            }
+            var cnv = TypeDescriptor.GetConverter(fromType);
+            if (toType == typeof(DateTime))    //Handle dates
+            {
+                if (fromType == typeof(TimeSpan))
+                {
+                    return ((T)(object)(new DateTime(((TimeSpan)v).Ticks)));
+                }
+                else if (fromType == typeof(string))
+                {
+                    DateTime dt;
+                    if (DateTime.TryParse(v.ToString(), out dt))
+                    {
+                        return (T)(object)(dt);
+                    }
+                    else
+                    {
+                        return default(T);
+                    }
+
+                }
+                else
+                {
+                    if (cnv.CanConvertTo(typeof(double)))
+                    {
+                        return (T)(object)(DateTime.FromOADate((double)cnv.ConvertTo(v, typeof(double))));
+                    }
+                    else
+                    {
+                        return default(T);
+                    }
+                }
+            }
+            else if (toType == typeof(TimeSpan))    //Handle timespan
+            {
+                if (fromType == typeof(DateTime))
+                {
+                    return ((T)(object)(new TimeSpan(((DateTime)v).Ticks)));
+                }
+                else if (fromType == typeof(string))
+                {
+                    TimeSpan ts;
+                    if (TimeSpan.TryParse(v.ToString(), out ts))
+                    {
+                        return (T)(object)(ts); 
+                    }
+                    else
+                    {
+                        return default(T);
+                    }
+                }
+                else
+                {
+                    if (cnv.CanConvertTo(typeof(double)))
+                    {
+
+                        return (T)(object)(new TimeSpan(DateTime.FromOADate((double)cnv.ConvertTo(v, typeof(double))).Ticks));
+                    }
+                    else
+                    {
+                        try
+                        {
+                            // Issue 14682 -- "GetValue<decimal>() won't convert strings"
+                            // As suggested, after all special cases, all .NET to do it's 
+                            // preferred conversion rather than simply returning the default
+                            return (T)Convert.ChangeType(v, typeof(T));
+                        }
+                        catch (Exception)
+                        {
+                            // This was the previous behaviour -- no conversion is available.
+                            return default(T);
+                        }
+                    }
+                }
+            }
+            else
+            {
+                if (cnv.CanConvertTo(toType))
+                {
+                    return (T)cnv.ConvertTo(v, typeof(T));
+                }
+                else
+                {
+                    if (toType.IsGenericType && toType.GetGenericTypeDefinition().Equals(typeof(Nullable<>)))
+                    {
+                        toType = Nullable.GetUnderlyingType(toType);
+                        if (cnv.CanConvertTo(toType))
+                        {
+                            return (T)cnv.ConvertTo(v, typeof(T));
+                        }
+                    }
+
+                    if(fromType==typeof(double) && toType==typeof(decimal))
+                    {
+                        return (T)(object)Convert.ToDecimal(v);
+                    }
+                    else if (fromType == typeof(decimal) && toType == typeof(double))
+                    {
+                        return (T)(object)Convert.ToDouble(v);
+                    }
+                    else
+                    {
+                        return default(T);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// Set the value of a cell
+        /// </summary>
+        /// <param name="Row">The row number</param>
+        /// <param name="Column">The column number</param>
+        /// <param name="Value">The value</param>
+        public void SetValue(int Row, int Column, object Value)
+        {
+            Cell(Row, Column).Value = Value;
+        }
+        /// <summary>
+        /// Set the value of a cell
+        /// </summary>
+        /// <param name="Address">The Excel address</param>
+        /// <param name="Value">The value</param>
+        public void SetValue(string Address, object Value)
+        {
+            int row, col;
+            ExcelAddressBase.GetRowCol(Address, out row, out col, true);
+            if (row < 1 || col < 1 || row > ExcelPackage.MaxRows && col > ExcelPackage.MaxColumns)
+            {
+                throw new ArgumentOutOfRangeException("Address is invalid or out of range");
+            }
+            Cell(row, col).Value = Value;
+        }
+
+        #region MergeCellId
+
+        /// <summary>
+        /// Get MergeCell Index No
+        /// </summary>
+        /// <param name="row"></param>
+        /// <param name="column"></param>
+        /// <returns></returns>
+        public int GetMergeCellId(int row, int column)
+        {
+            for (int i = 0; i < _mergedCells.Count; i++)
+            {
+                ExcelRange range = Cells[_mergedCells[i]];
+
+                if (range.Start.Row <= row && row <= range.End.Row)
+                {
+                    if (range.Start.Column <= column && column <= range.End.Column)
+                    {
+                        return i + 1;
+                    }
+                }
+            }
+            return 0;
+        }
+
+        #endregion
+		#endregion // END Worksheet Public Methods
+
+		#region Worksheet Private Methods
+
+		#region Worksheet Save
+		/// <summary>
+		/// Saves the worksheet to the package.
+		/// </summary>
+		internal void Save()  // Worksheet Save
+		{
+            DeletePrinterSettings();
+
+			if (_worksheetXml != null)
+			{
+                if (TopNode.Name == "chartsheet")
+                {
+                    return;
+                }
+				// save the header & footer (if defined)
+				if (_headerFooter != null)
+					HeaderFooter.Save();
+
+                if (_cells.Count > 0)
+                {
+                    this.SetXmlNodeString("d:dimension/@ref", Dimension.Address);
+                }
+
+                if (_drawings != null && _drawings.Count == 0)
+                {
+                    //Remove node if no drawings exists.
+                    DeleteNode("d:drawing");
+                }
+
+                SaveComments();
+                HeaderFooter.SaveHeaderFooterImages();
+                SaveTables();
+                SavePivotTables();
+                SaveXml();
+			}
+            
+            if (Drawings.UriDrawing!=null)
+            {
+                if (Drawings.Count == 0)
+                {                    
+                    Part.DeleteRelationship(Drawings._drawingRelation.Id);
+                    _package.Package.DeletePart(Drawings.UriDrawing);                    
+                }
+                else
+                {
+                    PackagePart partPack = Drawings.Part;
+                    Drawings.DrawingXml.Save(partPack.GetStream(FileMode.Create, FileAccess.Write));
+                    foreach (ExcelDrawing d in Drawings)
+                    {
+                        if (d is ExcelChart)
+                        {
+                            ExcelChart c = (ExcelChart)d;
+                            c.ChartXml.Save(c.Part.GetStream(FileMode.Create, FileAccess.Write));
+                        }
+                    }
+                }
+            }
+		}
+
+        /// <summary>
+        /// Delete the printersettings relationship and part.
+        /// </summary>
+        private void DeletePrinterSettings()
+        {
+            //Delete the relationship from the pageSetup tag
+            XmlAttribute attr = (XmlAttribute)WorksheetXml.SelectSingleNode("//d:pageSetup/@r:id", NameSpaceManager);
+            if (attr != null)
+            {
+                string relID = attr.Value;
+                //First delete the attribute from the XML
+                attr.OwnerElement.Attributes.Remove(attr);
+                if(Part.RelationshipExists(relID))
+                {
+                    PackageRelationship rel = Part.GetRelationship(relID);
+                    Uri printerSettingsUri = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+                    Part.DeleteRelationship(rel.Id);
+
+                    //Delete the part from the package
+                    if(_package.Package.PartExists(printerSettingsUri))
+                    {
+                        _package.Package.DeletePart(printerSettingsUri);
+                    }
+                }
+            }
+        }
+        private void SaveComments()
+        {
+            if (_comments != null)
+            {
+                if (_comments.Count == 0)
+                {
+                    if (_comments.Uri != null)
+                    {
+                        Part.DeleteRelationship(_comments.RelId);
+                        _package.Package.DeletePart(_comments.Uri);                        
+                    }
+                    RemoveLegacyDrawingRel(VmlDrawingsComments.RelId);
+                }
+                else
+                {
+                    if (_comments.Uri == null)
+                    {
+                        _comments.Uri=new Uri(string.Format(@"/xl/comments{0}.xml", SheetID), UriKind.Relative);                        
+                    }
+                    if(_comments.Part==null)
+                    {
+                        _comments.Part = _package.Package.CreatePart(_comments.Uri, "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml", _package.Compression);
+                        var rel = Part.CreateRelationship(PackUriHelper.GetRelativeUri(WorksheetUri, _comments.Uri), TargetMode.Internal, ExcelPackage.schemaRelationships+"/comments");
+                    }
+                    _comments.CommentXml.Save(_comments.Part.GetStream());
+                }
+            }
+
+            if (_vmlDrawings != null)
+            {
+                if (_vmlDrawings.Count == 0)
+                {
+                    if (_vmlDrawings.Uri != null)
+                    {
+                        Part.DeleteRelationship(_vmlDrawings.RelId);
+                        _package.Package.DeletePart(_vmlDrawings.Uri);
+                    }
+                }
+                else
+                {
+                    if (_vmlDrawings.Uri == null)
+                    {
+                        _vmlDrawings.Uri = XmlHelper.GetNewUri(_package.Package, @"/xl/drawings/vmlDrawing{0}.vml");
+                    }
+                    if (_vmlDrawings.Part == null)
+                    {
+                        _vmlDrawings.Part = _package.Package.CreatePart(_vmlDrawings.Uri, "application/vnd.openxmlformats-officedocument.vmlDrawing", _package.Compression);
+                        var rel = Part.CreateRelationship(PackUriHelper.GetRelativeUri(WorksheetUri, _vmlDrawings.Uri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/vmlDrawing");
+                        SetXmlNodeString("d:legacyDrawing/@r:id", rel.Id);
+                        _vmlDrawings.RelId = rel.Id;
+                    }
+                    _vmlDrawings.VmlDrawingXml.Save(_vmlDrawings.Part.GetStream());
+                }
+            }
+        }
+        /// <summary>
+        /// Save all table data
+        /// </summary>
+        private void SaveTables()
+        {
+            foreach (var tbl in Tables)
+            {
+                if (tbl.ShowHeader || tbl.ShowTotal)
+                {
+                    int colNum = tbl.Address._fromCol;
+                    foreach (var col in tbl.Columns)
+                    {
+                        if (tbl.ShowHeader)
+                        {
+                            Cell(tbl.Address._fromRow, colNum).Value = col.Name;
+                        }
+                        if (tbl.ShowTotal)
+                        {
+                            if (col.TotalsRowFunction == RowFunctions.Custom)
+                            {
+                                Cell(tbl.Address._toRow, colNum).Formula = col.TotalsRowFormula;
+                            }
+                            else if (col.TotalsRowFunction != RowFunctions.None)
+                            {
+                                switch (col.TotalsRowFunction)
+                                {
+                                    case RowFunctions.Average:
+                                        Cell(tbl.Address._toRow, colNum).Formula = GetTotalFunction(col, "101");
+                                        break;
+                                    case RowFunctions.Count:
+                                        Cell(tbl.Address._toRow, colNum).Formula = GetTotalFunction(col, "102");
+                                        break;
+                                    case RowFunctions.CountNums:
+                                        Cell(tbl.Address._toRow, colNum).Formula = GetTotalFunction(col, "103");
+                                        break;
+                                    case RowFunctions.Max:
+                                        Cell(tbl.Address._toRow, colNum).Formula = GetTotalFunction(col, "104");
+                                        break;
+                                    case RowFunctions.Min:
+                                        Cell(tbl.Address._toRow, colNum).Formula = GetTotalFunction(col, "105");
+                                        break;
+                                    case RowFunctions.StdDev:
+                                        Cell(tbl.Address._toRow, colNum).Formula = GetTotalFunction(col, "107");
+                                        break;
+                                    case RowFunctions.Var:
+                                        Cell(tbl.Address._toRow, colNum).Formula = GetTotalFunction(col, "110");
+                                        break;
+                                    case RowFunctions.Sum:
+                                        Cell(tbl.Address._toRow, colNum).Formula = GetTotalFunction(col, "109");
+                                        break;
+                                    default:
+                                        throw (new Exception("Unknown RowFunction enum"));
+                                }
+                            }
+                            else
+                            {
+                                Cell(tbl.Address._toRow, colNum).Value = col.TotalsRowLabel;
+                            }
+                        }
+                        if (!string.IsNullOrEmpty(col.CalculatedColumnFormula))
+                        {
+                            int fromRow = tbl.ShowHeader ? tbl.Address._fromRow + 1 : tbl.Address._fromRow;
+                            int toRow = tbl.ShowTotal ? tbl.Address._toRow - 1 : tbl.Address._toRow;
+                            for (int row = fromRow; row <= toRow; row++)
+                            {
+                                Cell(row, colNum).Formula = col.CalculatedColumnFormula;
+                            }                            
+                        }
+                        colNum++;
+                    }
+                }                
+                if (tbl.Part == null)
+                {
+                    tbl.TableUri = GetNewUri(_package.Package, @"/xl/tables/table{0}.xml", tbl.Id);
+                    tbl.Part = _package.Package.CreatePart(tbl.TableUri, "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml", Workbook._package.Compression);
+                    var stream = tbl.Part.GetStream(FileMode.Create);
+                    tbl.TableXml.Save(stream);
+                    var rel = Part.CreateRelationship(PackUriHelper.GetRelativeUri(WorksheetUri, tbl.TableUri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/table");
+                    tbl.RelationshipID = rel.Id;
+
+                    CreateNode("d:tableParts");
+                    XmlNode tbls = TopNode.SelectSingleNode("d:tableParts",NameSpaceManager);
+
+                    var tblNode = tbls.OwnerDocument.CreateElement("tablePart",ExcelPackage.schemaMain);
+                    tbls.AppendChild(tblNode);
+                    tblNode.SetAttribute("id",ExcelPackage.schemaRelationships, rel.Id);
+                }
+                else
+                {
+                    var stream = tbl.Part.GetStream(FileMode.Create);
+                    tbl.TableXml.Save(stream);
+                }
+            }
+        }
+        private void SavePivotTables()
+        {
+            foreach (var pt in PivotTables)
+            {
+                if (pt.DataFields.Count > 1)
+                {
+                    XmlElement parentNode;
+                    if(pt.DataOnRows==true)
+                    {
+                        parentNode =  pt.PivotTableXml.SelectSingleNode("//d:rowFields", pt.NameSpaceManager) as XmlElement;
+                        if (parentNode == null)
+                        {
+                            pt.CreateNode("d:rowFields");
+                            parentNode = pt.PivotTableXml.SelectSingleNode("//d:rowFields", pt.NameSpaceManager) as XmlElement;
+                        }
+                    }
+                    else
+                    {
+                        parentNode =  pt.PivotTableXml.SelectSingleNode("//d:colFields", pt.NameSpaceManager) as XmlElement;
+                        if (parentNode == null)
+                        {
+                            pt.CreateNode("d:colFields");
+                            parentNode = pt.PivotTableXml.SelectSingleNode("//d:colFields", pt.NameSpaceManager) as XmlElement;
+                        }
+                    }
+
+                    if (parentNode.SelectSingleNode("d:field[@ x= \"-2\"]", pt.NameSpaceManager) == null)
+                    {
+                        XmlElement fieldNode = pt.PivotTableXml.CreateElement("field", ExcelPackage.schemaMain);
+                        fieldNode.SetAttribute("x", "-2");
+                        parentNode.AppendChild(fieldNode);
+                    }
+                }
+                pt.PivotTableXml.Save(pt.Part.GetStream(FileMode.Create));
+                pt.CacheDefinition.CacheDefinitionXml.Save(pt.CacheDefinition.Part.GetStream(FileMode.Create));
+            }
+        }
+        private static string GetTotalFunction(ExcelTableColumn col,string FunctionNum)
+        {
+            return string.Format("SUBTOTAL({0},[{1}])", FunctionNum, col.Name);
+        }
+        private void SaveXml()
+        {
+            //Create the nodes if they do not exist.
+            CreateNode("d:cols");
+            CreateNode("d:sheetData");
+            CreateNode("d:mergeCells");
+            CreateNode("d:hyperlinks");
+            CreateNode("d:rowBreaks");
+            CreateNode("d:colBreaks");
+
+            string xml = _worksheetXml.OuterXml;
+            StreamWriter sw=new StreamWriter(Part.GetStream(FileMode.Create, FileAccess.Write));
+            int colStart = 0, colEnd = 0;
+            GetBlockPos(xml, "cols", ref colStart, ref colEnd);
+
+            sw.Write(xml.Substring(0, colStart));
+            var colBreaks = new List<int>();
+            if (_columns.Count > 0)
+            {
+                UpdateColumnData(sw);
+            }
+
+            int cellStart = colEnd, cellEnd = colEnd;
+            GetBlockPos(xml, "sheetData", ref cellStart, ref cellEnd);
+
+            sw.Write(xml.Substring(colEnd, cellStart - colEnd));
+            var rowBreaks = new List<int>();
+            UpdateRowCellData(sw);
+
+            int mergeStart = cellEnd, mergeEnd = cellEnd;
+
+            GetBlockPos(xml, "mergeCells", ref mergeStart, ref mergeEnd);
+            sw.Write(xml.Substring(cellEnd, mergeStart - cellEnd));
+
+            if (_mergedCells.Count > 0)
+            {
+                UpdateMergedCells(sw);
+            }
+
+            int hyperStart = mergeEnd, hyperEnd = mergeEnd;
+            GetBlockPos(xml, "hyperlinks", ref hyperStart, ref hyperEnd);
+            sw.Write(xml.Substring(mergeEnd, hyperStart - mergeEnd));
+            if (_hyperLinkCells.Count > 0)
+            {
+                UpdateHyperLinks(sw);
+            }
+
+            int rowBreakStart = hyperEnd, rowBreakEnd = hyperEnd;
+            GetBlockPos(xml, "rowBreaks", ref rowBreakStart, ref rowBreakEnd);
+            sw.Write(xml.Substring(hyperEnd, rowBreakStart - hyperEnd));
+            //if (rowBreaks.Count > 0)
+            //{
+            UpdateRowBreaks(sw);
+            //}
+
+            int colBreakStart = rowBreakEnd, colBreakEnd = rowBreakEnd;
+            GetBlockPos(xml, "colBreaks", ref colBreakStart, ref colBreakEnd);
+            sw.Write(xml.Substring(rowBreakEnd, colBreakStart - rowBreakEnd));
+            //if (colBreaks.Count > 0)
+            //{
+            UpdateColBreaks(sw);
+            //}
+
+            sw.Write(xml.Substring(colBreakEnd, xml.Length - colBreakEnd));
+            sw.Flush();
+            sw.Close();
+        }
+        private void UpdateColBreaks(StreamWriter sw)
+        {
+            StringBuilder breaks = new StringBuilder();
+            int count = 0;
+            foreach (ExcelColumn col in _columns)
+            {
+                if (col.PageBreak)
+                {
+                    breaks.AppendFormat("<brk id=\"{0}\" max=\"16383\" man=\"1\" />", col.ColumnMin);
+                    count++;
+                }
+            }
+            if (count > 0)
+            {
+                sw.Write(string.Format("<colBreaks count=\"{0}\" manualBreakCount=\"{0}\">{1}</colBreaks>", count, breaks.ToString()));
+            }
+        }
+
+        private void UpdateRowBreaks(StreamWriter sw)
+        {
+            StringBuilder breaks=new StringBuilder();
+            int count = 0;
+            foreach(ExcelRow row in _rows)            
+            {
+                if (row.PageBreak)
+                {
+                    breaks.AppendFormat("<brk id=\"{0}\" max=\"1048575\" man=\"1\" />", row.Row);
+                    count++;
+                }
+            }
+            if (count>0)
+            {
+                sw.Write(string.Format("<rowBreaks count=\"{0}\" manualBreakCount=\"{0}\">{1}</rowBreaks>", count, breaks.ToString()));                
+            }
+        }
+        /// <summary>
+        /// Inserts the cols collection into the XML document
+        /// </summary>
+        private void UpdateColumnData(StreamWriter sw)
+        {
+            //ExcelColumn prevCol = null;   //commented out 11/1-12 JK 
+            //foreach (ExcelColumn col in _columns)
+            //{                
+            //    if (prevCol != null)
+            //    {
+            //        if(prevCol.ColumnMax != col.ColumnMin-1)
+            //        {
+            //            prevCol._columnMax=col.ColumnMin-1;
+            //        }
+            //    }
+            //    prevCol = col;
+            //}
+            sw.Write("<cols>");
+            foreach (ExcelColumn col in _columns)
+            {
+                ExcelStyleCollection<ExcelXfs> cellXfs = _package.Workbook.Styles.CellXfs;
+
+                sw.Write("<col min=\"{0}\" max=\"{1}\"", col.ColumnMin, col.ColumnMax);
+                if (col.Hidden == true)
+                {
+                    //sbXml.Append(" width=\"0\" hidden=\"1\" customWidth=\"1\"");
+                    sw.Write(" hidden=\"1\"");
+                }
+                else if (col.BestFit)
+                {
+                    sw.Write(" bestFit=\"1\"");
+                }
+                sw.Write(string.Format(CultureInfo.InvariantCulture, " width=\"{0}\" customWidth=\"1\"", col.Width));
+                if (col.OutlineLevel > 0)
+                {                    
+                    sw.Write(" outlineLevel=\"{0}\" ", col.OutlineLevel);
+                    if (col.Collapsed)
+                    {
+                        if (col.Hidden)
+                        {
+                            sw.Write(" collapsed=\"1\"");
+                        }
+                        else
+                        {
+                            sw.Write(" collapsed=\"1\" hidden=\"1\""); //Always hidden
+                        }
+                    }
+                }
+                if (col.Phonetic)
+                {
+                    sw.Write(" phonetic=\"1\"");
+                }
+                long styleID = col.StyleID >= 0 ? cellXfs[col.StyleID].newID : col.StyleID;
+                if (styleID > 0)
+                {
+                    sw.Write(" style=\"{0}\"", styleID);
+                }
+                sw.Write(" />");
+
+                //if (col.PageBreak)
+                //{
+                //    colBreaks.Add(col.ColumnMin);
+                //}
+            }
+            sw.Write("</cols>");
+        }
+        /// <summary>
+        /// Insert row and cells into the XML document
+        /// </summary>
+        private void UpdateRowCellData(StreamWriter sw)
+        {
+            ExcelStyleCollection<ExcelXfs> cellXfs = _package.Workbook.Styles.CellXfs;
+            
+            _hyperLinkCells = new List<ulong>();
+            int row = -1;
+
+            foreach (ExcelRow r in _rows)
+            {
+                int nextCell = ~_cells.IndexOf(r.RowID);
+                if (nextCell >= 0 && (nextCell >= _cells.Count || ((ExcelCell)_cells[nextCell]).Row != r.Row))
+                {
+                    _cells.Add(r);
+                }
+            }
+
+            StringBuilder sbXml = new StringBuilder();
+            var ss = _package.Workbook._sharedStrings;
+            sw.Write("<sheetData>");
+            foreach (IRangeID r in _cells)
+            {
+                if (r is ExcelCell)
+                {
+                    ExcelCell cell = (ExcelCell)r;
+                    long styleID = cell.StyleID >= 0 ? cellXfs[cell.StyleID].newID : cell.StyleID;
+
+                    //Add the row element if it's a new row
+                    if (row != cell.Row)
+                    {
+                        WriteRow(sw, cellXfs, row, cell.Row);
+                        row = cell.Row;
+                    }
+                    if (cell.SharedFormulaID >= 0)
+                    {
+                        var f = _sharedFormulas[cell.SharedFormulaID];
+                        if (f.Address.IndexOf(':') > 0)
+                        {
+                            if (f.StartCol == cell.Column && f.StartRow == cell.Row)
+                            {
+                                if (f.IsArray)
+                                {
+                                    sw.Write("<c r=\"{0}\" s=\"{1}\"><f ref=\"{2}\" t=\"array\">{3}</f></c>", cell.CellAddress, styleID < 0 ? 0 : styleID, f.Address, SecurityElement.Escape(f.Formula));
+                                }
+                                else
+                                {
+                                    sw.Write("<c r=\"{0}\" s=\"{1}\"><f ref=\"{2}\" t=\"shared\"  si=\"{3}\">{4}</f></c>", cell.CellAddress, styleID < 0 ? 0 : styleID, f.Address, cell.SharedFormulaID, SecurityElement.Escape(f.Formula));
+                                }
+
+                            }
+                            else if (f.IsArray)
+                            {
+                                sw.Write("<c r=\"{0}\" s=\"{1}\" />", cell.CellAddress, styleID < 0 ? 0 : styleID);
+                            }
+                            else
+                            {
+                                sw.Write("<c r=\"{0}\" s=\"{1}\"><f t=\"shared\" si=\"{2}\" /></c>", cell.CellAddress, styleID < 0 ? 0 : styleID, cell.SharedFormulaID);
+                            }
+                        }
+                        else
+                        {
+                            // We can also have a single cell array formula
+                            if(f.IsArray)
+                            {
+                                sw.Write("<c r=\"{0}\" s=\"{1}\"><f ref=\"{2}\" t=\"array\">{3}</f></c>", cell.CellAddress, styleID < 0 ? 0 : styleID, string.Format("{0}:{1}", f.Address, f.Address), SecurityElement.Escape(f.Formula));
+                            }
+                            else
+                            {
+                                sw.Write("<c r=\"{0}\" s=\"{1}\">", f.Address, styleID < 0 ? 0 : styleID);
+                                sw.Write("<f>{0}</f></c>", SecurityElement.Escape(f.Formula));
+                            }
+                        }
+                    }
+                    else if (cell.Formula != "")
+                    {
+                        sw.Write("<c r=\"{0}\" s=\"{1}\">", cell.CellAddress, styleID < 0 ? 0 : styleID);
+                        sw.Write("<f>{0}</f></c>", SecurityElement.Escape(cell.Formula));
+                    }
+                    else
+                    {
+                        if (cell._value == null)
+                        {
+                            sw.Write("<c r=\"{0}\" s=\"{1}\" />", cell.CellAddress, styleID < 0 ? 0 : styleID);
+                        }
+                        else
+                        {
+                            if ((cell._value.GetType().IsPrimitive || cell._value is double || cell._value is decimal || cell._value is DateTime || cell._value is TimeSpan) && cell.DataType != "s")
+                            {
+                                string s;
+                                try
+                                {
+                                    if (cell._value is DateTime)
+                                    {
+                                        s = ((DateTime)cell.Value).ToOADate().ToString(CultureInfo.InvariantCulture);
+                                    }
+                                    else if (cell._value is TimeSpan)
+                                    {
+                                        s = new DateTime(((TimeSpan)cell.Value).Ticks).ToOADate().ToString(CultureInfo.InvariantCulture); ;
+                                    }
+                                    else
+                                    {
+                                        if (cell._value is double && double.IsNaN((double)cell._value))
+                                        {
+                                            s = "0";
+                                        }
+                                        else if (cell._value is double && double.IsInfinity((double)cell._value))
+                                        {
+                                            s="#NUM!";
+                                        }
+                                        else
+                                        {
+                                            s = Convert.ToDouble(cell._value, CultureInfo.InvariantCulture).ToString("g15", CultureInfo.InvariantCulture);
+                                        }
+                                    }
+                                }
+
+                                catch
+                                {
+                                    s = "0";
+                                }
+                                if (cell._value is bool)
+                                {
+                                    sw.Write("<c r=\"{0}\" s=\"{1}\" t=\"b\">", cell.CellAddress, styleID < 0 ? 0 : styleID);
+                                }
+                                else if (cell._value is double && double.IsInfinity((double)cell._value))
+                                {
+                                    sw.Write("<c r=\"{0}\" s=\"{1}\" t=\"e\">", cell.CellAddress, styleID < 0 ? 0 : styleID);
+                                }
+                                else
+                                {
+                                    sw.Write("<c r=\"{0}\" s=\"{1}\">", cell.CellAddress, styleID < 0 ? 0 : styleID);
+                                }
+                                sw.Write("<v>{0}</v></c>", s);
+                            }
+                            else
+                            {
+                                int ix;
+                                if (!ss.ContainsKey(cell._value.ToString()))
+                                {
+                                    ix = ss.Count;
+                                    ss.Add(cell._value.ToString(), new ExcelWorkbook.SharedStringItem() { isRichText = cell.IsRichText, pos = ix });
+                                }
+                                else
+                                {
+                                    ix = ss[cell.Value.ToString()].pos;
+                                }
+                                sw.Write("<c r=\"{0}\" s=\"{1}\" t=\"s\">", cell.CellAddress, styleID < 0 ? 0 : styleID);
+                                sw.Write("<v>{0}</v></c>", ix);
+                            }
+                        }
+                    }
+                    //Update hyperlinks.
+                    if (cell.Hyperlink != null)
+                    {
+                        _hyperLinkCells.Add(cell.CellID);
+                    }
+                }
+                else  //ExcelRow
+                {
+                    int newRow=((ExcelRow)r).Row;
+                    WriteRow(sw, cellXfs, row, newRow);
+                    row = newRow;
+                }
+            }
+
+            if (row != -1) sw.Write("</row>");
+            sw.Write("</sheetData>");
+
+            
+        }
+
+        private void WriteRow(StreamWriter sw, ExcelStyleCollection<ExcelXfs> cellXfs, int prevRow, int row)
+        {
+            if (prevRow != -1) sw.Write("</row>");
+            ulong rowID = ExcelRow.GetRowID(SheetID, row);
+            sw.Write("<row r=\"{0}\" ", row);
+            if (_rows.ContainsKey(rowID))
+            {
+                ExcelRow currRow = _rows[rowID] as ExcelRow;
+                if (currRow.Hidden == true)
+                {
+                    sw.Write("ht=\"0\" hidden=\"1\" ");
+                }
+                else if (currRow.Height != DefaultRowHeight)
+                {
+                    sw.Write(string.Format(CultureInfo.InvariantCulture, "ht=\"{0}\" ", currRow.Height));
+                    if (currRow.CustomHeight)
+                    {
+                        sw.Write("customHeight=\"1\" ");
+                    }
+                }
+
+                if (currRow.StyleID > 0)
+                {
+                    sw.Write("s=\"{0}\" customFormat=\"1\" ", cellXfs[currRow.StyleID].newID);
+                }
+                if (currRow.OutlineLevel > 0)
+                {
+                    sw.Write("outlineLevel =\"{0}\" ", currRow.OutlineLevel);
+                    if (currRow.Collapsed)
+                    {
+                        if (currRow.Hidden)
+                        {
+                            sw.Write(" collapsed=\"1\"");
+                        }
+                        else
+                        {
+                            sw.Write(" collapsed=\"1\" hidden=\"1\""); //Always hidden
+                        }
+                    }
+                }
+                if (currRow.Phonetic)
+                {
+                    sw.Write("ph=\"1\" ");
+                }
+            }
+            sw.Write(">");
+        }
+
+        /// <summary>
+        /// Update xml with hyperlinks 
+        /// </summary>
+        /// <param name="sw">The stream</param>
+        private void UpdateHyperLinks(StreamWriter sw)
+        {
+                sw.Write("<hyperlinks>");
+                Dictionary<string, string> hyps = new Dictionary<string, string>();
+                foreach (ulong cellId in _hyperLinkCells)
+                {
+                    ExcelCell cell = _cells[cellId] as ExcelCell;
+                    if (cell.Hyperlink is ExcelHyperLink && !string.IsNullOrEmpty((cell.Hyperlink as ExcelHyperLink).ReferenceAddress))
+                    {
+                        ExcelHyperLink hl = cell.Hyperlink as ExcelHyperLink;
+                        sw.Write("<hyperlink ref=\"{0}\" location=\"{1}\" {2}{3}/>", 
+                                Cells[cell.Row, cell.Column, cell.Row+hl.RowSpann, cell.Column+hl.ColSpann].Address, 
+                                ExcelCell.GetFullAddress(Name, hl.ReferenceAddress),
+                                    string.IsNullOrEmpty(hl.Display) ? "" : "display=\"" + SecurityElement.Escape(hl.Display) + "\" ",
+                                    string.IsNullOrEmpty(hl.ToolTip) ? "" : "tooltip=\"" + SecurityElement.Escape(hl.ToolTip) + "\" ");
+                    }
+                    else
+                    {
+                        string id;
+                        Uri hyp;
+                        if (cell.Hyperlink is ExcelHyperLink)
+                        {
+                            hyp = ((ExcelHyperLink)cell.Hyperlink).OriginalUri;
+                        }
+                        else
+                        {
+                            hyp = cell.Hyperlink;
+                        }
+                        if (hyps.ContainsKey(hyp.OriginalString))
+                        {
+                            id = hyps[hyp.OriginalString];
+                        }
+                        else
+                        {
+                            PackageRelationship relationship = Part.CreateRelationship(hyp, TargetMode.External, ExcelPackage.schemaHyperlink);
+                            if (cell.Hyperlink is ExcelHyperLink)
+                            {
+                                ExcelHyperLink hl = cell.Hyperlink as ExcelHyperLink;
+                                sw.Write("<hyperlink ref=\"{0}\" {2}{3}r:id=\"{1}\" />", cell.CellAddress, relationship.Id,                                
+                                    string.IsNullOrEmpty(hl.Display) ? "" : "display=\"" + SecurityElement.Escape(hl.Display) + "\" ",
+                                    string.IsNullOrEmpty(hl.ToolTip) ? "" : "tooltip=\"" + SecurityElement.Escape(hl.ToolTip) + "\" ");
+                            }
+                            else
+                            {
+                                sw.Write("<hyperlink ref=\"{0}\" r:id=\"{1}\" />",cell.CellAddress, relationship.Id);
+                            }
+                            id = relationship.Id;
+                        }
+                        cell.HyperLinkRId = id;
+                    }
+                }
+                sw.Write("</hyperlinks>");
+        }
+        /// <summary>
+        /// Create the hyperlinks node in the XML
+        /// </summary>
+        /// <returns></returns>
+        private XmlNode CreateHyperLinkCollection()
+        {
+            XmlElement hl=_worksheetXml.CreateElement("hyperlinks",ExcelPackage.schemaMain);
+            XmlNode prevNode = _worksheetXml.SelectSingleNode("//d:conditionalFormatting", NameSpaceManager);
+            if (prevNode == null)
+            {
+                prevNode = _worksheetXml.SelectSingleNode("//d:mergeCells", NameSpaceManager);
+                if (prevNode == null)
+                {
+                    prevNode = _worksheetXml.SelectSingleNode("//d:sheetData", NameSpaceManager);
+                }
+            }
+            return _worksheetXml.DocumentElement.InsertAfter(hl, prevNode);
+        }
+        /// <summary>
+        /// Dimension address for the worksheet. 
+        /// Top left cell to Bottom right.
+        /// If the worksheet has no cells, null is returned
+        /// </summary>
+        public ExcelAddressBase Dimension
+        {
+            get
+            {
+                if (_cells.Count > 0)
+                {
+                    ExcelAddressBase addr = new ExcelAddressBase((_cells[0] as ExcelCell).Row, _minCol, (_cells[_cells.Count - 1] as ExcelCell).Row, _maxCol);
+                    addr._ws = Name;
+                    return addr;
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+        ExcelSheetProtection _protection=null;
+        /// <summary>
+        /// Access to sheet protection properties
+        /// </summary>
+        public ExcelSheetProtection Protection
+        {
+            get
+            {
+                if (_protection == null)
+                {
+                    _protection = new ExcelSheetProtection(NameSpaceManager, TopNode, this);
+                }
+                return _protection;
+            }
+        }
+
+        private ExcelProtectedRangeCollection _protectedRanges;
+        public ExcelProtectedRangeCollection ProtectedRanges
+        {
+            get
+            {
+                if (_protectedRanges == null)
+                    _protectedRanges = new ExcelProtectedRangeCollection(NameSpaceManager, TopNode, this);
+                return _protectedRanges;
+            }
+        }
+
+        #region Drawing
+        ExcelDrawings _drawings = null;
+        /// <summary>
+        /// Collection of drawing-objects like shapes, images and charts
+        /// </summary>
+        public ExcelDrawings Drawings
+        {
+            get
+            {
+                if (_drawings == null)
+                {
+                    _drawings = new ExcelDrawings(_package, this);
+                }
+                return _drawings;
+            }
+        }
+        #endregion
+        ExcelTableCollection _tables = null;
+        /// <summary>
+        /// Tables defined in the worksheet.
+        /// </summary>
+        public ExcelTableCollection Tables
+        {
+            get
+            {
+                if (_tables == null)
+                {
+                    _tables = new ExcelTableCollection(this);
+                }
+                return _tables;
+            }
+        }
+        ExcelPivotTableCollection _pivotTables = null;
+        /// <summary>
+        /// Pivottables defined in the worksheet.
+        /// </summary>
+        public ExcelPivotTableCollection PivotTables
+        {
+            get
+            {
+                if (_pivotTables == null)
+                {
+                    _pivotTables = new ExcelPivotTableCollection(this);
+                }
+                return _pivotTables;
+            }
+        }
+        private ExcelConditionalFormattingCollection _conditionalFormatting = null;
+        /// <summary>
+        /// ConditionalFormatting defined in the worksheet. Use the Add methods to create ConditionalFormatting and add them to the worksheet. Then
+        /// set the properties on the instance returned.
+        /// </summary>
+        /// <seealso cref="ExcelConditionalFormattingCollection"/>
+        public ExcelConditionalFormattingCollection ConditionalFormatting
+        {
+            get
+            {
+                if (_conditionalFormatting == null)
+                {
+                    _conditionalFormatting = new ExcelConditionalFormattingCollection(this);
+                }
+                return _conditionalFormatting;
+            }
+        }
+        private ExcelDataValidationCollection _dataValidation = null;
+        /// <summary>
+        /// DataValidation defined in the worksheet. Use the Add methods to create DataValidations and add them to the worksheet. Then
+        /// set the properties on the instance returned.
+        /// </summary>
+        /// <seealso cref="ExcelDataValidationCollection"/>
+        public ExcelDataValidationCollection DataValidations
+        {
+            get
+            {
+                if (_dataValidation == null)
+                {
+                    _dataValidation = new ExcelDataValidationCollection(this);
+                }
+                return _dataValidation;
+            }
+        }
+        ExcelBackgroundImage _backgroundImage = null;
+        /// <summary>
+        /// An image displayed as the background of the worksheet.
+        /// </summary>
+        public ExcelBackgroundImage BackgroundImage
+        {
+            get
+            {
+                if (_backgroundImage == null)
+                {
+                    _backgroundImage = new ExcelBackgroundImage(NameSpaceManager, TopNode, this);
+                }
+                return _backgroundImage;
+            }
+        }
+        /// <summary>
+		/// Returns the style ID given a style name.  
+		/// The style ID will be created if not found, but only if the style name exists!
+		/// </summary>
+		/// <param name="StyleName"></param>
+		/// <returns></returns>
+		internal int GetStyleID(string StyleName)
+		{
+			ExcelNamedStyleXml namedStyle=null;
+            Workbook.Styles.NamedStyles.FindByID(StyleName, ref namedStyle);
+            if (namedStyle.XfId == int.MinValue)
+            {
+                namedStyle.XfId=Workbook.Styles.CellXfs.FindIndexByID(namedStyle.Style.Id);
+            }
+            return namedStyle.XfId;
+		}
+        /// <summary>
+        /// The workbook object
+        /// </summary>
+        public ExcelWorkbook Workbook
+        {
+            get
+            {
+                return _package.Workbook;
+            }
+        }
+		#endregion
+        #endregion  // END Worksheet Private Methods
+
+        /// <summary>
+        /// Get the next ID from a shared formula or an Array formula
+        /// Sharedforumlas will have an id from 0-x. Array formula ids start from 0x4000001-. 
+        /// </summary>
+        /// <param name="isArray">If the formula is an array formula</param>
+        /// <returns></returns>
+        internal int GetMaxShareFunctionIndex(bool isArray)
+        {
+            int i=_sharedFormulas.Count + 1;
+            if (isArray)
+                i |= 0x40000000;
+
+            while(_sharedFormulas.ContainsKey(i))
+            {
+                i++;
+            }
+            return i;
+        }
+        internal void SetHFLegacyDrawingRel(string relID)
+        {
+            SetXmlNodeString("d:legacyDrawingHF/@r:id", relID);
+        }
+        internal void RemoveLegacyDrawingRel(string relID)
+        {
+            var n = WorksheetXml.DocumentElement.SelectSingleNode(string.Format("d:legacyDrawing[@r:id=\"{0}\"]", relID), NameSpaceManager);
+            if (n != null)
+            {
+                n.ParentNode.RemoveChild(n);
+            }
+        }
+    }  // END class Worksheet
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorksheetView.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorksheetView.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorksheetView.cs	(revision 9616)
@@ -0,0 +1,467 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		       2009-10-01
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Xml;
+
+namespace OfficeOpenXml
+{
+	/// <summary>
+	/// Represents the different view states of the worksheet
+	/// </summary>
+	public class ExcelWorksheetView : XmlHelper
+	{
+        /// <summary>
+        /// The worksheet panes after a freeze or split.
+        /// </summary>
+        public class ExcelWorksheetPanes : XmlHelper
+        {
+            XmlElement _selectionNode = null;
+            internal ExcelWorksheetPanes(XmlNamespaceManager ns, XmlNode topNode) :
+                base(ns, topNode)
+            {
+                if(topNode.Name=="selection")
+                {
+                    _selectionNode=topNode as XmlElement;
+                }
+            }
+
+            const string _activeCellPath = "@activeCell";
+            /// <summary>
+            /// Set the active cell. Must be set within the SelectedRange.
+            /// </summary>
+            public string ActiveCell
+            {
+                get
+                {
+                    string address = GetXmlNodeString(_activeCellPath);
+                    if (address == "")
+                    {
+                        return "A1";
+                    }
+                    return address;
+                }
+                set
+                {
+                    int fromCol, fromRow, toCol, toRow;
+                    if(_selectionNode==null) CreateSelectionElement();
+                    ExcelCellBase.GetRowColFromAddress(value, out fromRow, out fromCol, out toRow, out toCol);
+                    SetXmlNodeString(_activeCellPath, value);
+                    if (((XmlElement)TopNode).GetAttribute("sqref") == "")
+                    {
+
+                        SelectedRange = ExcelCellBase.GetAddress(fromRow, fromCol);
+                    }
+                    else
+                    {
+                        //TODO:Add fix for out of range here
+                    }
+                }
+            }
+
+            private void CreateSelectionElement()
+            {
+ 	            _selectionNode=TopNode.OwnerDocument.CreateElement("selection", ExcelPackage.schemaMain);
+                TopNode.AppendChild(_selectionNode);
+                TopNode=_selectionNode;             
+            }
+            const string _selectionRangePath = "@sqref";
+            /// <summary>
+            /// Selected Cells.Used in combination with ActiveCell
+            /// </summary>        
+            public string SelectedRange
+            {
+                get
+                {
+                    string address = GetXmlNodeString(_selectionRangePath);
+                    if (address == "")
+                    {
+                        return "A1";
+                    }
+                    return address;
+                }
+                set
+                {
+                    int fromCol, fromRow, toCol, toRow;
+                    if(_selectionNode==null) CreateSelectionElement();
+                    ExcelCellBase.GetRowColFromAddress(value, out fromRow, out fromCol, out toRow, out toCol);
+                    SetXmlNodeString(_selectionRangePath, value);
+                    if (((XmlElement)TopNode).GetAttribute("activeCell") == "")
+                    {
+
+                        ActiveCell = ExcelCellBase.GetAddress(fromRow, fromCol);
+                    }
+                    else
+                    {
+                        //TODO:Add fix for out of range here
+                    }
+                }
+            }
+        }
+		private ExcelWorksheet _worksheet;
+
+		#region ExcelWorksheetView Constructor
+		/// <summary>
+		/// Creates a new ExcelWorksheetView which provides access to all the view states of the worksheet.
+		/// </summary>
+        /// <param name="ns"></param>
+        /// <param name="node"></param>
+        /// <param name="xlWorksheet"></param>
+		internal ExcelWorksheetView(XmlNamespaceManager ns, XmlNode node,  ExcelWorksheet xlWorksheet) :
+            base(ns, node)
+		{
+            _worksheet = xlWorksheet;
+            SchemaNodeOrder = new string[] { "sheetViews", "sheetView", "pane", "selection" };
+            Panes = LoadPanes(); 
+		}
+
+		#endregion
+        private ExcelWorksheetPanes[] LoadPanes()
+        {
+            XmlNodeList nodes = TopNode.SelectNodes("//d:selection", NameSpaceManager);
+            if(nodes.Count==0)
+            {
+                return new ExcelWorksheetPanes[] { new ExcelWorksheetPanes(NameSpaceManager, TopNode) };
+            }
+            else
+            {
+                ExcelWorksheetPanes[] panes = new ExcelWorksheetPanes[nodes.Count];
+                int i=0;
+                foreach(XmlElement elem in nodes)
+                {
+                    panes[i++] = new ExcelWorksheetPanes(NameSpaceManager, elem);
+                }
+                return panes;
+            }
+        }
+		#region SheetViewElement
+		/// <summary>
+		/// Returns a reference to the sheetView element
+		/// </summary>
+		protected internal XmlElement SheetViewElement
+		{
+			get 
+			{
+				return (XmlElement)TopNode;
+			}
+		}
+		#endregion
+		#region TabSelected
+        private XmlElement _selectionNode = null;
+        private XmlElement SelectionNode
+        {
+            get
+            {
+                _selectionNode = SheetViewElement.SelectSingleNode("//d:selection", _worksheet.NameSpaceManager) as XmlElement;
+                if (_selectionNode == null)
+                {
+                    _selectionNode = _worksheet.WorksheetXml.CreateElement("selection", ExcelPackage.schemaMain);
+                    SheetViewElement.AppendChild(_selectionNode);
+                }
+                return _selectionNode;
+            }
+        }
+        #endregion
+        #region Public Methods & Properties
+        /// <summary>
+        /// The active cell.
+        /// </summary>
+        public string ActiveCell
+        {
+            get
+            {
+                return Panes[Panes.GetUpperBound(0)].ActiveCell;
+            }
+            set 
+            {
+                Panes[Panes.GetUpperBound(0)].ActiveCell = value;
+            }
+        }
+        /// <summary>
+        /// Selected Cells in the worksheet.Used in combination with ActiveCell
+        /// </summary>
+        public string SelectedRange
+        {
+            get
+            {
+                return Panes[Panes.GetUpperBound(0)].SelectedRange;
+            }
+            set
+            {
+                Panes[Panes.GetUpperBound(0)].SelectedRange = value;
+            }
+        }
+        /// <summary>
+        /// Indicates if the worksheet is selected within the workbook
+        /// </summary>
+        public bool TabSelected
+        {
+            get
+            {
+                return GetXmlNodeBool("@tabSelected");
+            }
+            set
+            {
+                if (value)
+                {
+                    //    // ensure no other worksheet has its tabSelected attribute set to 1
+                    foreach (ExcelWorksheet sheet in _worksheet._package.Workbook.Worksheets)
+                        sheet.View.TabSelected = false;
+
+                    SheetViewElement.SetAttribute("tabSelected", "1");
+                    XmlElement bookView = _worksheet.Workbook.WorkbookXml.SelectSingleNode("//d:workbookView", _worksheet.NameSpaceManager) as XmlElement;
+                    if (bookView != null)
+                    {
+                        bookView.SetAttribute("activeTab", (_worksheet.PositionID - 1).ToString());
+                    }
+                }
+                else
+                    SetXmlNodeString("@tabSelected", "0");
+
+            }
+        }
+
+		/// <summary>
+		/// Sets the view mode of the worksheet to pagelayout
+		/// </summary>
+		public bool PageLayoutView
+		{
+			get
+			{
+                return GetXmlNodeString("@view") == "pageLayout";
+			}
+			set
+			{
+                if (value)
+                    SetXmlNodeString("@view", "pageLayout");
+                else
+                    SheetViewElement.RemoveAttribute("view");
+			}
+		}
+        /// <summary>
+        /// Sets the view mode of the worksheet to pagebreak
+        /// </summary>
+        public bool PageBreakView
+        {
+            get
+            {
+                return GetXmlNodeString("@view") == "pageBreakPreview";
+            }
+            set
+            {
+                if (value)
+                    SetXmlNodeString("@view", "pageBreakPreview");
+                else
+                    SheetViewElement.RemoveAttribute("view");
+            }
+        }
+        /// <summary>
+        /// Show gridlines in the worksheet
+        /// </summary>
+        public bool ShowGridLines 
+        {
+            get
+            {
+                return GetXmlNodeBool("@showGridLines");
+            }
+            set
+            {
+                SetXmlNodeString("@showGridLines", value ? "1" : "0");
+            }
+        }
+        /// <summary>
+        /// Show the Column/Row headers (containg column letters and row numbers)
+        /// </summary>
+        public bool ShowHeaders
+        {
+            get
+            {
+                return GetXmlNodeBool("@showRowColHeaders");
+            }
+            set
+            {
+                SetXmlNodeString("@showRowColHeaders", value ? "1" : "0");
+            }
+        }
+        /// <summary>
+        /// Window zoom magnification for current view representing percent values.
+        /// </summary>
+        public int ZoomScale
+        {
+            get
+            {
+                return GetXmlNodeInt("@zoomScale");
+            }
+            set
+            {
+                if (value < 10 || value > 400)
+                {
+                    throw new ArgumentOutOfRangeException("Zoome scale out of range (10-400)");
+                }
+                SetXmlNodeString("@zoomScale", value.ToString());
+            }
+        }
+        /// <summary>
+        /// Flag indicating whether the sheet is in 'right to left' display mode. When in this mode,Column A is on the far right, Column B ;is one column left of Column A, and so on. Also,information in cells is displayed in the Right to Left format.
+        /// </summary>
+        public bool RightToLeft
+        {
+            get
+            {
+                return GetXmlNodeBool("@rightToLeft");
+            }
+            set
+            {
+                SetXmlNodeString("@rightToLeft", value == true ? "1" : "0");
+            }
+        }
+        internal bool WindowProtection 
+        {
+            get
+            {
+                return GetXmlNodeBool("@windowProtection",false);
+            }
+            set
+            {
+                SetXmlNodeBool("@windowProtection",value,false);
+            }
+        }
+        /// <summary>
+        /// Reference to the panes
+        /// </summary>
+        public ExcelWorksheetPanes[] Panes
+        {
+            get;
+            internal set;
+        }
+        string _paneNodePath = "d:pane";
+        string _selectionNodePath = "d:selection";
+        /// <summary>
+        /// Freeze the columns/rows to left and above the cell
+        /// </summary>
+        /// <param name="Row"></param>
+        /// <param name="Column"></param>
+        public void FreezePanes(int Row, int Column)
+        {
+            //TODO:fix this method to handle splits as well.
+            if (Row == 1 && Column == 1) UnFreezePanes();
+            string sqRef = SelectedRange, activeCell = ActiveCell;
+            
+            XmlElement paneNode = TopNode.SelectSingleNode(_paneNodePath, NameSpaceManager) as XmlElement;
+            if (paneNode == null)
+            {
+                CreateNode(_paneNodePath);
+                paneNode = TopNode.SelectSingleNode(_paneNodePath, NameSpaceManager) as XmlElement;
+            }
+            paneNode.RemoveAll();   //Clear all attributes
+            if (Column > 1) paneNode.SetAttribute("xSplit", (Column - 1).ToString());
+            if (Row > 1) paneNode.SetAttribute("ySplit", (Row - 1).ToString());
+            paneNode.SetAttribute("topLeftCell", ExcelCellBase.GetAddress(Row, Column));
+            paneNode.SetAttribute("state", "frozen");
+
+            RemoveSelection();
+
+            if (Row > 1 && Column==1)
+            {
+                paneNode.SetAttribute("activePane", "bottomLeft");
+                XmlElement sel=TopNode.OwnerDocument.CreateElement("selection", ExcelPackage.schemaMain);
+                sel.SetAttribute("pane", "bottomLeft");
+                if (activeCell != "") sel.SetAttribute("activeCell", activeCell);
+                if (sqRef != "") sel.SetAttribute("sqref", sqRef);
+                sel.SetAttribute("sqref", sqRef);
+                TopNode.InsertAfter(sel, paneNode);
+            }
+            else if (Column > 1 && Row == 1)
+            {
+                paneNode.SetAttribute("activePane", "topRight");
+                XmlElement sel = TopNode.OwnerDocument.CreateElement("selection", ExcelPackage.schemaMain);
+                sel.SetAttribute("pane", "topRight");
+                if (activeCell != "") sel.SetAttribute("activeCell", activeCell);
+                if (sqRef != "") sel.SetAttribute("sqref", sqRef);
+                TopNode.InsertAfter(sel, paneNode);
+            }
+            else
+            {
+                paneNode.SetAttribute("activePane", "bottomRight");
+                XmlElement sel1 = TopNode.OwnerDocument.CreateElement("selection", ExcelPackage.schemaMain);
+                sel1.SetAttribute("pane", "topRight");
+                string cell = ExcelCellBase.GetAddress(1, Column);
+                sel1.SetAttribute("activeCell", cell);
+                sel1.SetAttribute("sqref", cell);
+                paneNode.ParentNode.InsertAfter(sel1, paneNode);
+
+                XmlElement sel2 = TopNode.OwnerDocument.CreateElement("selection", ExcelPackage.schemaMain);
+                cell = ExcelCellBase.GetAddress(Row, 1);
+                sel2.SetAttribute("pane", "bottomLeft");
+                sel2.SetAttribute("activeCell", cell);
+                sel2.SetAttribute("sqref", cell);
+                sel1.ParentNode.InsertAfter(sel2, sel1);
+
+                XmlElement sel3 = TopNode.OwnerDocument.CreateElement("selection", ExcelPackage.schemaMain);
+                sel3.SetAttribute("pane", "bottomRight");
+                if(activeCell!="") sel3.SetAttribute("activeCell", activeCell);                
+                if(sqRef!="") sel3.SetAttribute("sqref", sqRef);
+                sel2.ParentNode.InsertAfter(sel3, sel2);
+
+            }
+            Panes=LoadPanes();
+        }
+        private void RemoveSelection()
+        {
+            //Find selection nodes and remove them            
+            XmlNodeList selections = TopNode.SelectNodes(_selectionNodePath, NameSpaceManager);
+            foreach (XmlNode sel in selections)
+            {
+                sel.ParentNode.RemoveChild(sel);
+            }
+        }
+        /// <summary>
+        /// Unlock all rows and columns to scroll freely
+        /// /// </summary>
+        public void UnFreezePanes()
+        {
+            string sqRef = SelectedRange, activeCell = ActiveCell;
+
+            XmlElement paneNode = TopNode.SelectSingleNode(_paneNodePath, NameSpaceManager) as XmlElement;
+            if (paneNode != null)
+            {
+                paneNode.ParentNode.RemoveChild(paneNode);
+            }
+            RemoveSelection();
+
+            Panes=LoadPanes();
+
+            SelectedRange = sqRef;
+            ActiveCell = activeCell;
+        }
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorksheets.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorksheets.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/ExcelWorksheets.cs	(revision 9616)
@@ -0,0 +1,1062 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		       2009-10-01
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO;
+using System.IO.Packaging;
+using OfficeOpenXml.Style;
+using OfficeOpenXml.Drawing;
+using OfficeOpenXml.Drawing.Chart;
+using OfficeOpenXml.Style.XmlAccess;
+using OfficeOpenXml.Drawing.Vml;
+using OfficeOpenXml.VBA;
+namespace OfficeOpenXml
+{
+	/// <summary>
+	/// The collection of worksheets for the workbook
+	/// </summary>
+	public class ExcelWorksheets : XmlHelper, IEnumerable<ExcelWorksheet>
+	{
+		#region Private Properties
+        private ExcelPackage _pck;
+        private Dictionary<int, ExcelWorksheet> _worksheets;
+		private XmlNamespaceManager _namespaceManager;
+		#endregion
+		#region ExcelWorksheets Constructor
+		internal ExcelWorksheets(ExcelPackage pck, XmlNamespaceManager nsm, XmlNode topNode) :
+            base(nsm, topNode)
+		{
+			_pck = pck;
+            _namespaceManager = nsm;
+			_worksheets = new Dictionary<int, ExcelWorksheet>();
+			int positionID = 1;
+
+            foreach (XmlNode sheetNode in topNode.ChildNodes)
+			{
+				string name = sheetNode.Attributes["name"].Value;
+				//Get the relationship id
+				string relId = sheetNode.Attributes["r:id"].Value;
+				int sheetID = Convert.ToInt32(sheetNode.Attributes["sheetId"].Value);
+                
+                //Hidden property
+                eWorkSheetHidden hidden = eWorkSheetHidden.Visible;
+				XmlNode attr = sheetNode.Attributes["state"];
+				if (attr != null)
+					hidden = TranslateHidden(attr.Value);
+
+				PackageRelationship sheetRelation = pck.Workbook.Part.GetRelationship(relId);
+				Uri uriWorksheet = PackUriHelper.ResolvePartUri(pck.Workbook.WorkbookUri, sheetRelation.TargetUri);
+				
+				//add the worksheet
+                _worksheets.Add(positionID, new ExcelWorksheet(_namespaceManager, _pck, relId, uriWorksheet, name, sheetID, positionID, hidden));
+				positionID++;
+			}
+		}
+
+        private eWorkSheetHidden TranslateHidden(string value)
+        {
+            switch (value)
+            {
+                case "hidden":
+                    return eWorkSheetHidden.Hidden;
+                case "veryHidden":
+                    return eWorkSheetHidden.VeryHidden;
+                default:
+                    return eWorkSheetHidden.Visible;
+            }
+        }
+		#endregion
+
+		#region ExcelWorksheets Public Properties
+		/// <summary>
+		/// Returns the number of worksheets in the workbook
+		/// </summary>
+		public int Count
+		{
+			get { return (_worksheets.Count); }
+		}
+		#endregion
+        private const string ERR_DUP_WORKSHEET = "A worksheet with this name already exists in the workbook";
+        internal const string WORKSHEET_CONTENTTYPE = @"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml";
+		#region ExcelWorksheets Public Methods
+		/// <summary>
+        /// Foreach support
+		/// </summary>
+		/// <returns>An enumerator</returns>
+		public IEnumerator<ExcelWorksheet> GetEnumerator()
+		{
+			return (_worksheets.Values.GetEnumerator());
+        }
+        #region IEnumerable Members
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return (_worksheets.Values.GetEnumerator());
+        }
+
+        #endregion
+
+
+		#region Add Worksheet
+		/// <summary>
+		/// Adds a new blank worksheet.
+		/// </summary>
+		/// <param name="Name">The name of the workbook</param>
+		public ExcelWorksheet Add(string Name)
+		{
+            int sheetID;
+            Uri uriWorksheet;
+            if (GetByName(Name) != null)
+            {
+                throw (new InvalidOperationException(ERR_DUP_WORKSHEET));
+            }
+            GetSheetURI(ref Name, out sheetID, out uriWorksheet);
+            PackagePart worksheetPart = _pck.Package.CreatePart(uriWorksheet, WORKSHEET_CONTENTTYPE, _pck.Compression);
+
+			//Create the new, empty worksheet and save it to the package
+			StreamWriter streamWorksheet = new StreamWriter(worksheetPart.GetStream(FileMode.Create, FileAccess.Write));
+			XmlDocument worksheetXml = CreateNewWorksheet();
+			worksheetXml.Save(streamWorksheet);
+			streamWorksheet.Close();
+			_pck.Package.Flush();
+
+            string rel = CreateWorkbookRel(Name, sheetID, uriWorksheet);
+
+            int positionID = _worksheets.Count + 1;
+            ExcelWorksheet worksheet = new ExcelWorksheet(_namespaceManager, _pck, rel, uriWorksheet, Name, sheetID, positionID, eWorkSheetHidden.Visible);
+
+			_worksheets.Add(positionID, worksheet);
+            if (_pck.Workbook.VbaProject != null)
+            {
+                _pck.Workbook.VbaProject.Modules.Add(new VBA.ExcelVBAModule(worksheet.CodeNameChange) { Name = Name, Code = "", Attributes = _pck.Workbook.VbaProject.GetDocumentAttributes(Name, "0{00020820-0000-0000-C000-000000000046}"), Type = eModuleType.Document, HelpContext = 0 });
+                worksheet.CodeModuleName = Name;
+
+            }
+			return worksheet;
+		}
+        /// <summary>
+        /// Adds a copy of a worksheet
+        /// </summary>
+        /// <param name="Name">The name of the workbook</param>
+        /// <param name="Copy">The worksheet to be copied</param>
+        public ExcelWorksheet Add(string Name, ExcelWorksheet Copy)
+        {
+            int sheetID;
+            Uri uriWorksheet;
+
+            if (GetByName(Name) != null)
+            {
+                throw (new InvalidOperationException(ERR_DUP_WORKSHEET));
+            }
+
+            GetSheetURI(ref Name, out sheetID, out uriWorksheet);
+
+            //Create a copy of the worksheet XML
+            PackagePart worksheetPart = _pck.Package.CreatePart(uriWorksheet, WORKSHEET_CONTENTTYPE, _pck.Compression);
+            StreamWriter streamWorksheet = new StreamWriter(worksheetPart.GetStream(FileMode.Create, FileAccess.Write));
+            XmlDocument worksheetXml = new XmlDocument();
+            worksheetXml.LoadXml(Copy.WorksheetXml.OuterXml);
+            worksheetXml.Save(streamWorksheet);
+            streamWorksheet.Close();
+            _pck.Package.Flush();
+
+
+            //Create a relation to the workbook
+            string relID = CreateWorkbookRel(Name, sheetID, uriWorksheet);
+            ExcelWorksheet added = new ExcelWorksheet(_namespaceManager, _pck, relID, uriWorksheet, Name, sheetID, _worksheets.Count + 1, eWorkSheetHidden.Visible);
+
+            //Copy comments
+            if (Copy.Comments.Count > 0)
+            {
+                CopyComment(Copy, added);
+            }
+            else if (Copy.VmlDrawingsComments.Count > 0)    //Vml drawings are copied as part of the comments. 
+            {
+                CopyVmlDrawing(Copy, added);
+            }
+
+            //Copy HeaderFooter
+            CopyHeaderFooterPictures(Copy, added);
+
+            //Copy all relationships 
+            //CopyRelationShips(Copy, added);
+            if (Copy.Drawings.Count > 0)
+            {
+                CopyDrawing(Copy, added);
+            }
+			if (Copy.Tables.Count > 0)
+            {
+                CopyTable(Copy, added);
+            }
+            if (Copy.PivotTables.Count > 0)
+            {
+                CopyPivotTable(Copy, added);
+            }
+            if (Copy.Names.Count > 0)
+            {
+                CopySheetNames(Copy, added);
+            }
+
+            //Copy all cells
+            CloneCells(Copy, added);
+
+            _worksheets.Add(_worksheets.Count + 1, added);
+
+            //Remove any relation to printersettings.
+            XmlNode pageSetup = added.WorksheetXml.SelectSingleNode("//d:pageSetup", _namespaceManager);
+            if (pageSetup != null)
+            {
+                XmlAttribute attr = (XmlAttribute)pageSetup.Attributes.GetNamedItem("id", ExcelPackage.schemaRelationships);
+                if (attr != null)
+                {
+                    relID = attr.Value;
+                    // first delete the attribute from the XML
+                    pageSetup.Attributes.Remove(attr);
+                }
+            }
+
+            return added;
+        }
+
+        private void CopySheetNames(ExcelWorksheet Copy, ExcelWorksheet added)
+        {
+            foreach (var name in Copy.Names)
+            {
+                ExcelNamedRange newName;
+                if (!name.IsName)
+                {
+                    if (name.WorkSheet == Copy.Name)
+                    {
+                        newName = added.Names.Add(name.Name, added.Cells[name.FirstAddress]);
+                    }
+                    else
+                    {
+                        newName = added.Names.Add(name.Name, added.Workbook.Worksheets[name.WorkSheet].Cells[name.FirstAddress]);
+                    }
+                }
+                else if (!string.IsNullOrEmpty(name.NameFormula))
+                {
+                    newName=added.Names.AddFormula(name.Name, name.Formula);
+                }
+                else
+                {
+                    newName=added.Names.AddValue(name.Name, name.Value);
+                }
+               newName.NameComment = name.NameComment;
+            }
+        }
+
+        private void CopyTable(ExcelWorksheet Copy, ExcelWorksheet added)
+        {
+            string prevName = "";
+            //First copy the table XML
+            foreach (var tbl in Copy.Tables)
+            {
+                string xml=tbl.TableXml.OuterXml;
+                int Id = _pck.Workbook._nextTableID++;
+                string name;
+                if (prevName == "")
+                {
+                    name = Copy.Tables.GetNewTableName();
+                }
+                else
+                {
+                    int ix = int.Parse(prevName.Substring(5)) + 1;
+                    name = string.Format("Table{0}", ix);
+                    while (_pck.Workbook.ExistsPivotTableName(name))
+                    {
+                        name = string.Format("Table{0}", ++ix);
+                    }
+                }
+                prevName = name;
+                XmlDocument xmlDoc = new XmlDocument();
+                xmlDoc.LoadXml(xml);
+                xmlDoc.SelectSingleNode("//d:table/@id", tbl.NameSpaceManager).Value = Id.ToString();
+                xmlDoc.SelectSingleNode("//d:table/@name", tbl.NameSpaceManager).Value = name;
+                xmlDoc.SelectSingleNode("//d:table/@displayName", tbl.NameSpaceManager).Value = name;
+                xml = xmlDoc.OuterXml;
+
+                var uriTbl = new Uri(string.Format("/xl/tables/table{0}.xml", Id), UriKind.Relative);
+                var part = _pck.Package.CreatePart(uriTbl, "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml", _pck.Compression);
+                StreamWriter streamTbl = new StreamWriter(part.GetStream(FileMode.Create, FileAccess.Write));
+                streamTbl.Write(xml);
+                streamTbl.Close();
+
+                //create the relationship and add the ID to the worksheet xml.
+                var rel = added.Part.CreateRelationship(PackUriHelper.GetRelativeUri(added.WorksheetUri,uriTbl), TargetMode.Internal, ExcelPackage.schemaRelationships + "/table");
+
+                if (tbl.RelationshipID == null)
+                {
+                    var topNode = added.WorksheetXml.SelectSingleNode("//d:tableParts", tbl.NameSpaceManager);
+                    if (topNode == null)
+                    {
+                        added.CreateNode("d:tableParts");
+                        topNode = added.WorksheetXml.SelectSingleNode("//d:tableParts", tbl.NameSpaceManager);
+                    }
+                    XmlElement elem = added.WorksheetXml.CreateElement("tablePart", ExcelPackage.schemaMain);
+                    topNode.AppendChild(elem);
+                    elem.SetAttribute("id",ExcelPackage.schemaRelationships, rel.Id);
+                }
+                else
+                {
+                    XmlAttribute relAtt;
+                    relAtt = added.WorksheetXml.SelectSingleNode(string.Format("//d:tableParts/d:tablePart/@r:id[.='{0}']", tbl.RelationshipID), tbl.NameSpaceManager) as XmlAttribute;
+                    relAtt.Value = rel.Id;
+                }
+            }
+        }
+        private void CopyPivotTable(ExcelWorksheet Copy, ExcelWorksheet added)
+        {
+            string prevName = "";
+            foreach (var tbl in Copy.PivotTables)
+            {
+                string xml = tbl.PivotTableXml.OuterXml;
+                int Id = _pck.Workbook._nextPivotTableID++;
+
+                string name;
+                if (prevName == "")
+                {
+                    name = Copy.PivotTables.GetNewTableName();
+                }
+                else
+                {
+                    int ix=int.Parse(prevName.Substring(10))+1;
+                    name = string.Format("PivotTable{0}", ix);
+                    while (_pck.Workbook.ExistsPivotTableName(name))
+                    {
+                        name = string.Format("PivotTable{0}", ++ix);
+                    }
+                }
+                prevName=name;
+                XmlDocument xmlDoc = new XmlDocument();
+                Copy.Save();    //Save the worksheet first
+                xmlDoc.LoadXml(xml);
+                //xmlDoc.SelectSingleNode("//d:table/@id", tbl.NameSpaceManager).Value = Id.ToString();
+                xmlDoc.SelectSingleNode("//d:pivotTableDefinition/@name", tbl.NameSpaceManager).Value = name;
+                xml = xmlDoc.OuterXml;
+
+                var uriTbl = new Uri(string.Format("/xl/pivotTables/pivotTable{0}.xml", Id), UriKind.Relative);
+                var part = _pck.Package.CreatePart(uriTbl, ExcelPackage.schemaPivotTable , _pck.Compression);
+                StreamWriter streamTbl = new StreamWriter(part.GetStream(FileMode.Create, FileAccess.Write));
+                streamTbl.Write(xml);
+                streamTbl.Close();
+
+                //create the relationship and add the ID to the worksheet xml.
+                added.Part.CreateRelationship(PackUriHelper.ResolvePartUri(added.WorksheetUri, uriTbl), TargetMode.Internal, ExcelPackage.schemaRelationships + "/pivotTable");
+                part.CreateRelationship(PackUriHelper.ResolvePartUri(tbl.Relationship.SourceUri, tbl.CacheDefinition.Relationship.TargetUri), tbl.CacheDefinition.Relationship.TargetMode, tbl.CacheDefinition.Relationship.RelationshipType);
+            }
+        }
+        private void CopyHeaderFooterPictures(ExcelWorksheet Copy, ExcelWorksheet added)
+        {
+            if (Copy._headerFooter == null) return;
+            //Copy the texts
+            CopyText(Copy.HeaderFooter._oddHeader, added.HeaderFooter.OddHeader);
+            CopyText(Copy.HeaderFooter._oddFooter, added.HeaderFooter.OddFooter);
+            CopyText(Copy.HeaderFooter._evenHeader, added.HeaderFooter.EvenHeader);
+            CopyText(Copy.HeaderFooter._evenFooter, added.HeaderFooter.EvenFooter);
+            CopyText(Copy.HeaderFooter._firstHeader, added.HeaderFooter.FirstHeader);
+            CopyText(Copy.HeaderFooter._firstFooter, added.HeaderFooter.FirstFooter);
+            
+            //Copy any images;
+            if (Copy.HeaderFooter.Pictures.Count > 0)
+            {
+                Uri source = Copy.HeaderFooter.Pictures.Uri;
+                Uri dest = XmlHelper.GetNewUri(_pck.Package, @"/xl/drawings/vmlDrawing{0}.vml");
+                
+                var part = _pck.Package.CreatePart(dest, "application/vnd.openxmlformats-officedocument.vmlDrawing", _pck.Compression);
+                foreach (ExcelVmlDrawingPicture pic in Copy.HeaderFooter.Pictures)
+                {
+                    var item = added.HeaderFooter.Pictures.Add(pic.Id, pic.ImageUri, pic.Title, pic.Width, pic.Height);
+                    foreach (XmlAttribute att in pic.TopNode.Attributes)
+                    {
+                        (item.TopNode as XmlElement).SetAttribute(att.Name, att.Value);
+                    }
+                    item.TopNode.InnerXml = pic.TopNode.InnerXml;
+                }
+            }
+        }
+
+        private void CopyText(ExcelHeaderFooterText from, ExcelHeaderFooterText to)
+        {
+            if (from == null) return;
+            to.LeftAlignedText=from.LeftAlignedText;
+            to.CenteredText = from.CenteredText;
+            to.RightAlignedText = from.RightAlignedText;
+        }
+        private void CloneCells(ExcelWorksheet Copy, ExcelWorksheet added)
+        {
+            bool sameWorkbook=(Copy.Workbook == _pck.Workbook);
+
+            bool doAdjust = _pck.DoAdjustDrawings;
+            _pck.DoAdjustDrawings = false;
+            added.MergedCells.List.AddRange(Copy.MergedCells.List);
+            //Formulas
+            foreach (IRangeID f in Copy._formulaCells)
+            {
+                added._formulaCells.Add(f);
+            }
+            //Shared Formulas
+            foreach (int key in Copy._sharedFormulas.Keys)
+            {
+                added._sharedFormulas.Add(key, Copy._sharedFormulas[key]);
+            }
+            
+            Dictionary<int, int> styleCashe = new Dictionary<int, int>();
+            //Cells
+            foreach (ExcelCell cell in Copy._cells)
+            {                
+                if (sameWorkbook)   //Same workbook == same styles
+                {
+                    added._cells.Add(cell.Clone(added));
+                }
+                else
+                {
+                    ExcelCell addedCell=cell.Clone(added);
+                    if (styleCashe.ContainsKey(cell.StyleID))
+                    {
+                        addedCell.StyleID = styleCashe[cell.StyleID];
+                    }
+                    else
+                    {
+                        addedCell.StyleID = added.Workbook.Styles.CloneStyle(Copy.Workbook.Styles,  cell.StyleID);
+                        if (cell.StyleName != "") //Named styles
+                        {
+                            if (!Copy.Workbook.Styles.NamedStyles.ExistsKey(cell.StyleName))
+                            {
+                               var ns=Copy.Workbook.Styles.CreateNamedStyle(cell.StyleName);
+                               ns.StyleXfId  = addedCell.StyleID;
+                            }
+                            
+                        }
+                        styleCashe.Add(cell.StyleID, addedCell.StyleID);
+                    }
+                    added._cells.Add(addedCell);
+                }
+            }
+            //Rows
+            foreach (ExcelRow row in Copy._rows)
+            {
+                row.Clone(added);
+                if (!sameWorkbook)   //Same workbook == same styles
+                {
+                    ExcelRow addedRow = added.Row(row.Row) as ExcelRow;
+                    if (styleCashe.ContainsKey(row.StyleID))
+                    {
+                        addedRow.StyleID = styleCashe[row.StyleID];
+                    }
+                    else
+                    {
+                        addedRow.StyleID = added.Workbook.Styles.CloneStyle(Copy.Workbook.Styles, addedRow.StyleID);
+                        if (row.StyleName != "") //Named styles
+                        {
+                            if (!Copy.Workbook.Styles.NamedStyles.ExistsKey(row.StyleName))
+                            {
+                                var ns = Copy.Workbook.Styles.CreateNamedStyle(row.StyleName);
+                                ns.StyleXfId = addedRow.StyleID;
+                            }
+
+                        }
+                        styleCashe.Add(row.StyleID, addedRow.StyleID);
+                    }
+                }                
+            }
+            //Columns
+            foreach (ExcelColumn col in Copy._columns)
+            {
+                col.Clone(added);
+                if (!sameWorkbook)   //Same workbook == same styles
+                {
+                    ExcelColumn addedCol = added.Column(col.ColumnMin) as ExcelColumn;
+                    if (styleCashe.ContainsKey(col.StyleID))
+                    {
+                        addedCol.StyleID = styleCashe[col.StyleID];
+                    }
+                    else
+                    {
+                        addedCol.StyleID = added.Workbook.Styles.CloneStyle(Copy.Workbook.Styles, addedCol.StyleID);
+                        if (col.StyleName != "") //Named styles
+                        {
+                            if (!Copy.Workbook.Styles.NamedStyles.ExistsKey(col.StyleName))
+                            {
+                                var ns = Copy.Workbook.Styles.CreateNamedStyle(col.StyleName);
+                                ns.StyleXfId = addedCol.StyleID;
+                            }
+
+                        }
+                        styleCashe.Add(col.StyleID, addedCol.StyleID);
+                    }
+                }
+            }
+            added._package.DoAdjustDrawings = doAdjust;
+        }
+        private void CopyComment(ExcelWorksheet Copy, ExcelWorksheet workSheet)
+        {
+            //First copy the drawing XML
+            string xml = Copy.Comments.CommentXml.InnerXml;
+            var uriComment = new Uri(string.Format("/xl/comments{0}.xml", workSheet.SheetID), UriKind.Relative);
+            if (_pck.Package.PartExists(uriComment))
+            {
+                uriComment = XmlHelper.GetNewUri(_pck.Package, "/xl/drawings/vmldrawing{0}.vml");
+            }
+
+            var part = _pck.Package.CreatePart(uriComment, "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml", _pck.Compression);
+
+            StreamWriter streamDrawing = new StreamWriter(part.GetStream(FileMode.Create, FileAccess.Write));
+            streamDrawing.Write(xml);
+            streamDrawing.Close();
+
+            //Add the relationship ID to the worksheet xml.
+            PackageRelationship commentRelation = workSheet.Part.CreateRelationship(PackUriHelper.GetRelativeUri(workSheet.WorksheetUri,uriComment), TargetMode.Internal, ExcelPackage.schemaRelationships + "/comments");
+
+            xml = Copy.VmlDrawingsComments.VmlDrawingXml.InnerXml;
+
+            var uriVml = new Uri(string.Format("/xl/drawings/vmldrawing{0}.vml", workSheet.SheetID), UriKind.Relative);
+            if (_pck.Package.PartExists(uriVml))
+            {
+                uriVml = XmlHelper.GetNewUri(_pck.Package, "/xl/drawings/vmldrawing{0}.vml");
+            }
+
+            var vmlPart = _pck.Package.CreatePart(uriVml, "application/vnd.openxmlformats-officedocument.vmlDrawing", _pck.Compression);
+            StreamWriter streamVml = new StreamWriter(vmlPart.GetStream(FileMode.Create, FileAccess.Write));
+            streamVml.Write(xml);
+            streamVml.Close();
+
+            PackageRelationship newVmlRel = workSheet.Part.CreateRelationship(PackUriHelper.GetRelativeUri(workSheet.WorksheetUri,uriVml), TargetMode.Internal, ExcelPackage.schemaRelationships + "/vmlDrawing");
+
+            //Add the relationship ID to the worksheet xml.
+            XmlElement e = workSheet.WorksheetXml.SelectSingleNode("//d:legacyDrawing", _namespaceManager) as XmlElement;
+            if (e == null)
+            {
+                workSheet.CreateNode("d:legacyDrawing");
+                e = workSheet.WorksheetXml.SelectSingleNode("//d:legacyDrawing", _namespaceManager) as XmlElement;
+            }
+
+            e.SetAttribute("id", ExcelPackage.schemaRelationships, newVmlRel.Id);
+        }
+        private void CopyDrawing(ExcelWorksheet Copy, ExcelWorksheet workSheet/*, PackageRelationship r*/)
+        {
+            
+            //Check if the worksheet has drawings
+            //if(_xlPackage.Package.PartExists(r.TargetUri))
+            //{
+                //First copy the drawing XML                
+                string xml = Copy.Drawings.DrawingXml.OuterXml;            
+                var uriDraw=new Uri(string.Format("/xl/drawings/drawing{0}.xml", workSheet.SheetID),  UriKind.Relative);
+                var part= _pck.Package.CreatePart(uriDraw,"application/vnd.openxmlformats-officedocument.drawing+xml", _pck.Compression);
+                StreamWriter streamDrawing = new StreamWriter(part.GetStream(FileMode.Create, FileAccess.Write));
+                streamDrawing.Write(xml);
+                streamDrawing.Close();
+
+                XmlDocument drawXml = new XmlDocument();
+                drawXml.LoadXml(xml);
+                //Add the relationship ID to the worksheet xml.
+                PackageRelationship drawRelation = workSheet.Part.CreateRelationship(PackUriHelper.GetRelativeUri(workSheet.WorksheetUri,uriDraw), TargetMode.Internal, ExcelPackage.schemaRelationships + "/drawing");
+                XmlElement e = workSheet.WorksheetXml.SelectSingleNode("//d:drawing", _namespaceManager) as XmlElement;
+                e.SetAttribute("id",ExcelPackage.schemaRelationships, drawRelation.Id);
+
+                foreach (ExcelDrawing draw in Copy.Drawings)
+                {
+                    if (draw is ExcelChart)
+                    {
+                        ExcelChart chart = draw as ExcelChart;
+                        xml = chart.ChartXml.InnerXml;
+
+                        var UriChart = XmlHelper.GetNewUri(_pck.Package, "/xl/charts/chart{0}.xml");
+                        var chartPart = _pck.Package.CreatePart(UriChart, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml", _pck.Compression);
+                        StreamWriter streamChart = new StreamWriter(chartPart.GetStream(FileMode.Create, FileAccess.Write));
+                        streamChart.Write(xml);
+                        streamChart.Close();
+                        //Now create the new relationship to the copied chart xml
+                        var prevRelID=draw.TopNode.SelectSingleNode("xdr:graphicFrame/a:graphic/a:graphicData/c:chart/@r:id", Copy.Drawings.NameSpaceManager).Value;
+                        var rel = part.CreateRelationship(PackUriHelper.GetRelativeUri(uriDraw,UriChart), TargetMode.Internal, ExcelPackage.schemaRelationships + "/chart");
+                        XmlAttribute relAtt = drawXml.SelectSingleNode(string.Format("//c:chart/@r:id[.='{0}']", prevRelID), Copy.Drawings.NameSpaceManager) as XmlAttribute;
+                        relAtt.Value=rel.Id;
+                    }
+                    else if (draw is ExcelPicture)
+                    {
+                        ExcelPicture pic = draw as ExcelPicture;
+                        var uri = pic.UriPic;
+                        if(!workSheet.Workbook._package.Package.PartExists(uri))
+                        {
+                            var picPart = workSheet.Workbook._package.Package.CreatePart(uri, pic.ContentType, CompressionOption.NotCompressed);
+                            pic.Image.Save(picPart.GetStream(FileMode.Create, FileAccess.Write), pic.ImageFormat);
+                        }
+
+                        var prevRelID = draw.TopNode.SelectSingleNode("xdr:pic/xdr:blipFill/a:blip/@r:embed", Copy.Drawings.NameSpaceManager).Value;
+                        var rel = part.CreateRelationship(PackUriHelper.GetRelativeUri(workSheet.WorksheetUri, uri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/image");
+                        XmlAttribute relAtt = drawXml.SelectSingleNode(string.Format("//xdr:pic/xdr:blipFill/a:blip/@r:embed[.='{0}']", prevRelID), Copy.Drawings.NameSpaceManager) as XmlAttribute;
+                        relAtt.Value = rel.Id;
+                    }
+                }
+                //rewrite the drawing xml with the new relID's
+                streamDrawing = new StreamWriter(part.GetStream(FileMode.Create, FileAccess.Write));
+                streamDrawing.Write(drawXml.OuterXml);
+                streamDrawing.Close();
+            //}
+        }
+
+		private void CopyVmlDrawing(ExcelWorksheet origSheet, ExcelWorksheet newSheet)
+		{
+			var xml = origSheet.VmlDrawingsComments.VmlDrawingXml.OuterXml;
+			var vmlUri = new Uri(string.Format("/xl/drawings/vmlDrawing{0}.vml", newSheet.SheetID), UriKind.Relative);
+			var part = _pck.Package.CreatePart(vmlUri, "application/vnd.openxmlformats-officedocument.vmlDrawing", _pck.Compression);
+			using (var streamDrawing = new StreamWriter(part.GetStream(FileMode.Create, FileAccess.Write)))
+			{
+				streamDrawing.Write(xml);
+			}
+
+			//Add the relationship ID to the worksheet xml.
+			PackageRelationship vmlRelation = newSheet.Part.CreateRelationship(PackUriHelper.GetRelativeUri(newSheet.WorksheetUri,vmlUri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/vmlDrawing");
+			var e = newSheet.WorksheetXml.SelectSingleNode("//d:legacyDrawing", _namespaceManager) as XmlElement;
+			if (e == null)
+			{
+				e = newSheet.WorksheetXml.CreateNode(XmlNodeType.Entity, "//d:legacyDrawing", _namespaceManager.LookupNamespace("d")) as XmlElement;
+			}
+			if (e != null)
+			{
+				e.SetAttribute("id", ExcelPackage.schemaRelationships, vmlRelation.Id);
+			}
+		}
+
+		string CreateWorkbookRel(string Name, int sheetID, Uri uriWorksheet)
+        {
+            //Create the relationship between the workbook and the new worksheet
+            PackageRelationship rel = _pck.Workbook.Part.CreateRelationship(PackUriHelper.GetRelativeUri(_pck.Workbook.WorkbookUri, uriWorksheet), TargetMode.Internal, ExcelPackage.schemaRelationships + "/worksheet");
+            _pck.Package.Flush();
+
+            //Create the new sheet node
+            XmlElement worksheetNode = _pck.Workbook.WorkbookXml.CreateElement("sheet", ExcelPackage.schemaMain);
+            worksheetNode.SetAttribute("name", Name);
+            worksheetNode.SetAttribute("sheetId", sheetID.ToString());
+            worksheetNode.SetAttribute("id", ExcelPackage.schemaRelationships, rel.Id);
+
+            TopNode.AppendChild(worksheetNode);
+            return rel.Id;
+        }
+        private void GetSheetURI(ref string Name, out int sheetID, out Uri uriWorksheet)
+        {
+            Name = ValidateFixSheetName(Name);
+
+            //First find maximum existing sheetID
+            sheetID = 0;
+            foreach(var ws in this)
+            {                
+                if (ws.SheetID > sheetID)
+                {
+                    sheetID = ws.SheetID;
+                }
+            }
+            // we now have the max existing values, so add one
+            sheetID++;
+
+            // add the new worksheet to the package
+            uriWorksheet = new Uri("/xl/worksheets/sheet" + sheetID.ToString() + ".xml", UriKind.Relative);
+        }
+
+        internal string ValidateFixSheetName(string Name)
+        {
+            //remove invalid characters
+            if (ValidateName(Name))
+            {
+                if (Name.IndexOf(':') > -1) Name = Name.Replace(":", " ");
+                if (Name.IndexOf('/') > -1) Name = Name.Replace("/", " ");
+                if (Name.IndexOf('\\') > -1) Name = Name.Replace("\\", " ");
+                if (Name.IndexOf('?') > -1) Name = Name.Replace("?", " ");
+                if (Name.IndexOf('[') > -1) Name = Name.Replace("[", " ");
+                if (Name.IndexOf(']') > -1) Name = Name.Replace("]", " ");
+            }
+
+            if (Name.Trim() == "")
+            {
+                throw new ArgumentException("The worksheet can not have an empty name");
+            }
+            if (Name.Length > 31) Name = Name.Substring(0, 31);   //A sheet can have max 31 char's
+            return Name;
+        }
+        /// <summary>
+        /// Validate the sheetname
+        /// </summary>
+        /// <param name="Name">The Name</param>
+        /// <returns>True if valid</returns>
+        private bool ValidateName(string Name)
+        {
+            return System.Text.RegularExpressions.Regex.IsMatch(Name, @":|\?|/|\\|\[|\]");
+        }
+
+		/// <summary>
+		/// Creates the XML document representing a new empty worksheet
+		/// </summary>
+		/// <returns></returns>
+		internal XmlDocument CreateNewWorksheet()
+		{
+			XmlDocument xmlDoc = new XmlDocument();
+            XmlElement elemWs = xmlDoc.CreateElement("worksheet", ExcelPackage.schemaMain);
+            elemWs.SetAttribute("xmlns:r", ExcelPackage.schemaRelationships);
+            xmlDoc.AppendChild(elemWs);
+
+            XmlElement elemSheetViews = xmlDoc.CreateElement("sheetViews", ExcelPackage.schemaMain);
+            elemWs.AppendChild(elemSheetViews);
+
+            XmlElement elemSheetView = xmlDoc.CreateElement("sheetView", ExcelPackage.schemaMain);
+            elemSheetView.SetAttribute("workbookViewId", "0");
+            elemSheetViews.AppendChild(elemSheetView);
+
+            XmlElement elemSheetFormatPr = xmlDoc.CreateElement("sheetFormatPr", ExcelPackage.schemaMain);
+            elemSheetFormatPr.SetAttribute("defaultRowHeight", "15");
+            elemWs.AppendChild(elemSheetFormatPr);
+
+            XmlElement elemSheetData = xmlDoc.CreateElement("sheetData", ExcelPackage.schemaMain);
+            elemWs.AppendChild(elemSheetData);
+            return xmlDoc;
+		}
+		#endregion
+
+		#region Delete Worksheet
+		/// <summary>
+		/// Deletes a worksheet from the collection
+		/// </summary>
+		/// <param name="Index">The position of the worksheet in the workbook</param>
+		public void Delete(int Index)
+		{
+			ExcelWorksheet worksheet = _worksheets[Index];
+            if (worksheet.Drawings.Count > 0)
+            {
+                worksheet.Drawings.Clear();
+            }
+            //Delete the worksheet part and relation from the package 
+			_pck.Package.DeletePart(worksheet.WorksheetUri);
+			_pck.Workbook.Part.DeleteRelationship(worksheet.RelationshipID);
+
+            //Delete worksheet from the workbook XML
+			XmlNode sheetsNode = _pck.Workbook.WorkbookXml.SelectSingleNode("//d:workbook/d:sheets", _namespaceManager);
+			if (sheetsNode != null)
+			{
+				XmlNode sheetNode = sheetsNode.SelectSingleNode(string.Format("./d:sheet[@sheetId={0}]", worksheet.SheetID), _namespaceManager);
+				if (sheetNode != null)
+				{
+					sheetsNode.RemoveChild(sheetNode);
+				}
+			}
+			_worksheets.Remove(Index);
+            if (_pck.Workbook.VbaProject != null)
+            {
+                _pck.Workbook.VbaProject.Modules.Remove(worksheet.CodeModule);
+            }
+			ReindexWorksheetDictionary();
+		}
+
+		/// <summary>
+		/// Deletes a worksheet from the collection
+		/// </summary>
+		/// <param name="name">The name of the worksheet in the workbook</param>
+		public void Delete(string name)
+		{
+			var sheet = this[name];
+			if (sheet == null)
+			{
+				throw new ArgumentException(string.Format("Could not find worksheet to delete '{0}'", name));
+			}
+			Delete(sheet.PositionID);
+		}
+		/// <summary>
+        /// Delete a worksheet from the collection
+        /// </summary>
+        /// <param name="Worksheet">The worksheet to delete</param>
+        public void Delete(ExcelWorksheet Worksheet)
+		{
+            if (Worksheet.PositionID <= _worksheets.Count && Worksheet == _worksheets[Worksheet.PositionID])
+            {
+                Delete(Worksheet.PositionID);
+            }
+            else
+            {
+                throw (new ArgumentException("Worksheet is not in the collection."));
+            }
+        }
+        #endregion
+
+		private void ReindexWorksheetDictionary()
+		{
+			var index = 1;
+			var worksheets = new Dictionary<int, ExcelWorksheet>();
+			foreach (var entry in _worksheets)
+			{
+				entry.Value.PositionID = index;
+				worksheets.Add(index++, entry.Value);
+			}
+			_worksheets = worksheets;
+		}
+
+		/// <summary>
+		/// Returns the worksheet at the specified position.  
+		/// </summary>
+		/// <param name="PositionID">The position of the worksheet. 1-base</param>
+		/// <returns></returns>
+		public ExcelWorksheet this[int PositionID]
+		{
+			get
+			{
+                return (_worksheets[PositionID]);
+			}
+		}
+
+		/// <summary>
+		/// Returns the worksheet matching the specified name
+		/// </summary>
+		/// <param name="Name">The name of the worksheet</param>
+		/// <returns></returns>
+		public ExcelWorksheet this[string Name]
+		{
+			get
+			{
+                return GetByName(Name);
+			}
+		}
+		/// <summary>
+		/// Copies the named worksheet and creates a new worksheet in the same workbook
+		/// </summary>
+		/// <param name="Name">The name of the existing worksheet</param>
+		/// <param name="NewName">The name of the new worksheet to create</param>
+		/// <returns>The new copy added to the end of the worksheets collection</returns>
+		public ExcelWorksheet Copy(string Name, string NewName)
+		{
+            ExcelWorksheet Copy = this[Name];
+            if (Copy == null)
+                throw new ArgumentException(string.Format("Copy worksheet error: Could not find worksheet to copy '{0}'", Name));
+
+            ExcelWorksheet added = Add(NewName, Copy);
+            return added;
+        }
+		#endregion
+
+        internal ExcelWorksheet GetBySheetID(int localSheetID)
+        {
+            foreach (ExcelWorksheet ws in this)
+            {
+                if (ws.SheetID == localSheetID)
+                {
+                    return ws;
+                }
+            }
+            return null;
+        }
+        private ExcelWorksheet GetByName(string Name)
+        {
+            if (string.IsNullOrEmpty(Name)) return null;
+            ExcelWorksheet xlWorksheet = null;
+            foreach (ExcelWorksheet worksheet in _worksheets.Values)
+            {
+                if (worksheet.Name.ToLower() == Name.ToLower())
+                    xlWorksheet = worksheet;
+            }
+            return (xlWorksheet);
+        }
+		#region MoveBefore and MoveAfter Methods
+		/// <summary>
+		/// Moves the source worksheet to the position before the target worksheet
+		/// </summary>
+		/// <param name="sourceName">The name of the source worksheet</param>
+		/// <param name="targetName">The name of the target worksheet</param>
+		public void MoveBefore(string sourceName, string targetName)
+		{
+			Move(sourceName, targetName, false);
+		}
+
+		/// <summary>
+		/// Moves the source worksheet to the position before the target worksheet
+		/// </summary>
+		/// <param name="sourcePositionId">The id of the source worksheet</param>
+		/// <param name="targetPositionId">The id of the target worksheet</param>
+		public void MoveBefore(int sourcePositionId, int targetPositionId)
+		{
+			Move(sourcePositionId, targetPositionId, false);
+		}
+
+		/// <summary>
+		/// Moves the source worksheet to the position after the target worksheet
+		/// </summary>
+		/// <param name="sourceName">The name of the source worksheet</param>
+		/// <param name="targetName">The name of the target worksheet</param>
+		public void MoveAfter(string sourceName, string targetName)
+		{
+			Move(sourceName, targetName, true);
+		}
+
+		/// <summary>
+		/// Moves the source worksheet to the position after the target worksheet
+		/// </summary>
+		/// <param name="sourcePositionId">The id of the source worksheet</param>
+		/// <param name="targetPositionId">The id of the target worksheet</param>
+		public void MoveAfter(int sourcePositionId, int targetPositionId)
+		{
+			Move(sourcePositionId, targetPositionId, true);
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="sourceName"></param>
+		public void MoveToStart(string sourceName)
+		{
+			var sourceSheet = this[sourceName];
+			if (sourceSheet == null)
+			{
+				throw new Exception(string.Format("Move worksheet error: Could not find worksheet to move '{0}'", sourceName));
+			}
+			Move(sourceSheet.PositionID, 1, false);
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="sourcePositionId"></param>
+		public void MoveToStart(int sourcePositionId)
+		{
+			Move(sourcePositionId, 1, false);
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="sourceName"></param>
+		public void MoveToEnd(string sourceName)
+		{
+			var sourceSheet = this[sourceName];
+			if (sourceSheet == null)
+			{
+				throw new Exception(string.Format("Move worksheet error: Could not find worksheet to move '{0}'", sourceName));
+			}
+			Move(sourceSheet.PositionID, _worksheets.Count, true);
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="sourcePositionId"></param>
+		public void MoveToEnd(int sourcePositionId)
+		{
+			Move(sourcePositionId, _worksheets.Count, true);
+		}
+
+		private void Move(string sourceName, string targetName, bool placeAfter)
+		{
+			var sourceSheet = this[sourceName];
+			if (sourceSheet == null)
+			{
+				throw new Exception(string.Format("Move worksheet error: Could not find worksheet to move '{0}'", sourceName));
+			}
+			var targetSheet = this[targetName];
+			if (targetSheet == null)
+			{
+				throw new Exception(string.Format("Move worksheet error: Could not find worksheet to move '{0}'", targetName));
+			}
+			Move(sourceSheet.PositionID, targetSheet.PositionID, placeAfter);
+		}
+
+		private void Move(int sourcePositionId, int targetPositionId, bool placeAfter)
+		{
+			var sourceSheet = this[sourcePositionId];
+			if (sourceSheet == null)
+			{
+				throw new Exception(string.Format("Move worksheet error: Could not find worksheet at position '{0}'", sourcePositionId));
+			}
+			var targetSheet = this[targetPositionId];
+			if (targetSheet == null)
+			{
+				throw new Exception(string.Format("Move worksheet error: Could not find worksheet at position '{0}'", targetPositionId));
+			}
+			if (_worksheets.Count < 2)
+			{
+				return;		//--- no reason to attempt to re-arrange a single item with itself
+			}
+
+			var index = 1;
+			var newOrder = new Dictionary<int, ExcelWorksheet>();
+			foreach (var entry in _worksheets)
+			{
+				if (entry.Key == targetPositionId)
+				{
+					if (!placeAfter)
+					{
+						sourceSheet.PositionID = index;
+						newOrder.Add(index++, sourceSheet);
+					}
+
+					entry.Value.PositionID = index;
+					newOrder.Add(index++, entry.Value);
+
+					if (placeAfter)
+					{
+						sourceSheet.PositionID = index;
+						newOrder.Add(index++, sourceSheet);
+					}
+				}
+				else if (entry.Key == sourcePositionId)
+				{
+					//--- do nothing
+				}
+				else
+				{
+					entry.Value.PositionID = index;
+					newOrder.Add(index++, entry.Value);
+				}
+			}
+			_worksheets = newOrder;
+
+			MoveSheetXmlNode(sourceSheet, targetSheet, placeAfter);
+		}
+
+		private void MoveSheetXmlNode(ExcelWorksheet sourceSheet, ExcelWorksheet targetSheet, bool placeAfter)
+		{
+			var sourceNode = TopNode.SelectSingleNode(string.Format("d:sheet[@sheetId = '{0}']", sourceSheet.SheetID), _namespaceManager);
+            var targetNode = TopNode.SelectSingleNode(string.Format("d:sheet[@sheetId = '{0}']", targetSheet.SheetID), _namespaceManager);
+			if (sourceNode == null || targetNode == null)
+			{
+				throw new Exception("Source SheetId and Target SheetId must be valid");
+			}
+			if (placeAfter)
+			{
+                TopNode.InsertAfter(sourceNode, targetNode);
+			}
+			else
+			{
+                TopNode.InsertBefore(sourceNode, targetNode);
+			}
+		}
+
+		#endregion
+	} // end class Worksheets
+}
+
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/IRangeID.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/IRangeID.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/IRangeID.cs	(revision 9616)
@@ -0,0 +1,54 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman          Added       		        2010-02-04
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Id from a cell, column or row.
+    /// </summary>
+    interface IRangeID
+    {
+        /// <summary>
+        /// This is the id for a cell, row or column.
+        /// The id is a composit of the SheetID, the row number and the column number.
+        /// Bit 1-14 SheetID, Bit 15-28 Column number (0 if entire column), Bit 29- Row number (0 if entire row).
+        /// </summary>
+        ulong RangeID
+        {
+            get;
+            set;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/OfficeProperties.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/OfficeProperties.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/OfficeProperties.cs	(revision 9616)
@@ -0,0 +1,505 @@
+/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman                      Total rewrite               2010-03-01
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Xml;
+using System.IO;
+using System.IO.Packaging;
+using System.Globalization;
+
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// Provides access to the properties bag of the package
+    /// </summary>
+    public sealed class OfficeProperties : XmlHelper
+    {
+        #region Private Properties
+        private XmlDocument _xmlPropertiesCore;
+        private XmlDocument _xmlPropertiesExtended;
+        private XmlDocument _xmlPropertiesCustom;
+
+        private Uri _uriPropertiesCore = new Uri("/docProps/core.xml", UriKind.Relative);
+        private Uri _uriPropertiesExtended = new Uri("/docProps/app.xml", UriKind.Relative);
+        private Uri _uriPropertiesCustom = new Uri("/docProps/custom.xml", UriKind.Relative);
+
+        XmlHelper _coreHelper;
+        XmlHelper _extendedHelper;
+        XmlHelper _customHelper;
+        private ExcelPackage _package;
+        #endregion
+
+        #region ExcelProperties Constructor
+        /// <summary>
+        /// Provides access to all the office document properties.
+        /// </summary>
+        /// <param name="package"></param>
+        /// <param name="ns"></param>
+        internal OfficeProperties(ExcelPackage package, XmlNamespaceManager ns) :
+            base(ns)
+        {
+            _package = package;
+
+            _coreHelper = XmlHelperFactory.Create(ns, CorePropertiesXml.SelectSingleNode("cp:coreProperties", NameSpaceManager));
+            _extendedHelper = XmlHelperFactory.Create(ns, ExtendedPropertiesXml);
+            _customHelper = XmlHelperFactory.Create(ns, CustomPropertiesXml);
+
+        }
+        #endregion
+        #region CorePropertiesXml
+        /// <summary>
+        /// Provides access to the XML document that holds all the code 
+        /// document properties.
+        /// </summary>
+        public XmlDocument CorePropertiesXml
+        {
+            get
+            {
+                if (_xmlPropertiesCore == null)
+                {
+                    string xml = string.Format("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><cp:coreProperties xmlns:cp=\"{0}\" xmlns:dc=\"{1}\" xmlns:dcterms=\"{2}\" xmlns:dcmitype=\"{3}\" xmlns:xsi=\"{4}\"></cp:coreProperties>",
+                        ExcelPackage.schemaCore,
+                        ExcelPackage.schemaDc,
+                        ExcelPackage.schemaDcTerms,
+                        ExcelPackage.schemaDcmiType,
+                        ExcelPackage.schemaXsi);
+
+                    _xmlPropertiesCore = GetXmlDocument(xml, _uriPropertiesCore, @"application/vnd.openxmlformats-package.core-properties+xml", @"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties");
+                }
+                return (_xmlPropertiesCore);
+            }
+        }
+
+        private XmlDocument GetXmlDocument(string startXml, Uri uri, string contentType, string relationship)
+        {
+            XmlDocument xmlDoc;
+            if (_package.Package.PartExists(uri))
+                xmlDoc = _package.GetXmlFromUri(uri);
+            else
+            {
+                xmlDoc = new XmlDocument();
+                xmlDoc.LoadXml(startXml);
+
+                // Create a the part and add to the package
+                PackagePart part = _package.Package.CreatePart(uri, contentType);
+
+                // Save it to the package
+                StreamWriter stream = new StreamWriter(part.GetStream(FileMode.Create, FileAccess.Write));
+                xmlDoc.Save(stream);
+                stream.Close();
+                _package.Package.Flush();
+
+                // create the relationship between the workbook and the new shared strings part
+                _package.Package.CreateRelationship(PackUriHelper.GetRelativeUri(new Uri("/xl", UriKind.Relative), uri), TargetMode.Internal, relationship);
+                _package.Package.Flush();
+            }
+            return xmlDoc;
+        }
+        #endregion
+        #region Core Properties
+        const string TitlePath = "dc:title";
+        /// <summary>
+        /// Gets/sets the title property of the document (core property)
+        /// </summary>
+        public string Title
+        {
+            get { return _coreHelper.GetXmlNodeString(TitlePath); }
+            set { _coreHelper.SetXmlNodeString(TitlePath, value); }
+        }
+
+        const string SubjectPath = "dc:subject";
+        /// <summary>
+        /// Gets/sets the subject property of the document (core property)
+        /// </summary>
+        public string Subject
+        {
+            get { return _coreHelper.GetXmlNodeString(SubjectPath); }
+            set { _coreHelper.SetXmlNodeString(SubjectPath, value); }
+        }
+
+        const string AuthorPath = "dc:creator";
+        /// <summary>
+        /// Gets/sets the author property of the document (core property)
+        /// </summary>
+        public string Author
+        {
+            get { return _coreHelper.GetXmlNodeString(AuthorPath); }
+            set { _coreHelper.SetXmlNodeString(AuthorPath, value); }
+        }
+
+        const string CommentsPath = "dc:description";
+        /// <summary>
+        /// Gets/sets the comments property of the document (core property)
+        /// </summary>
+        public string Comments
+        {
+            get { return _coreHelper.GetXmlNodeString(CommentsPath); }
+            set { _coreHelper.SetXmlNodeString(CommentsPath, value); }
+        }
+
+        const string KeywordsPath = "cp:keywords";
+        /// <summary>
+        /// Gets/sets the keywords property of the document (core property)
+        /// </summary>
+        public string Keywords
+        {
+            get { return _coreHelper.GetXmlNodeString(KeywordsPath); }
+            set { _coreHelper.SetXmlNodeString(KeywordsPath, value); }
+        }
+
+        const string LastModifiedByPath = "cp:lastModifiedBy";
+        /// <summary>
+        /// Gets/sets the lastModifiedBy property of the document (core property)
+        /// </summary>
+        public string LastModifiedBy
+        {
+            get { return _coreHelper.GetXmlNodeString(LastModifiedByPath); }
+            set { _coreHelper.SetXmlNodeString(LastModifiedByPath, value); }
+        }
+
+        const string LastPrintedPath = "cp:lastPrinted";
+        /// <summary>
+        /// Gets/sets the lastPrinted property of the document (core property)
+        /// </summary>
+        public string LastPrinted
+        {
+            get { return _coreHelper.GetXmlNodeString(LastPrintedPath); }
+            set { _coreHelper.SetXmlNodeString(LastPrintedPath, value); }
+        }
+
+        const string CategoryPath = "cp:category";
+        /// <summary>
+        /// Gets/sets the category property of the document (core property)
+        /// </summary>
+        public string Category
+        {
+            get { return _coreHelper.GetXmlNodeString(CategoryPath); }
+            set { _coreHelper.SetXmlNodeString(CategoryPath, value); }
+        }
+
+        const string ContentStatusPath = "cp:contentStatus";
+        /// <summary>
+        /// Gets/sets the status property of the document (core property)
+        /// </summary>
+        public string Status
+        {
+            get { return _coreHelper.GetXmlNodeString(ContentStatusPath); }
+            set { _coreHelper.SetXmlNodeString(ContentStatusPath, value); }
+        }
+        #endregion
+
+        #region Extended Properties
+        #region ExtendedPropertiesXml
+        /// <summary>
+        /// Provides access to the XML document that holds the extended properties of the document (app.xml)
+        /// </summary>
+        public XmlDocument ExtendedPropertiesXml
+        {
+            get
+            {
+                if (_xmlPropertiesExtended == null)
+                {
+                    _xmlPropertiesExtended = GetXmlDocument(string.Format("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><Properties xmlns:vt=\"{0}\" xmlns=\"{1}\"></Properties>",
+                            ExcelPackage.schemaVt,
+                            ExcelPackage.schemaExtended),
+                        _uriPropertiesExtended,
+                        @"application/vnd.openxmlformats-officedocument.extended-properties+xml",
+                        @"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties");
+                }
+                return (_xmlPropertiesExtended);
+            }
+        }
+        #endregion
+
+        const string ApplicationPath = "xp:Properties/xp:Application";
+        /// <summary>
+        /// Gets the Application property of the document (extended property)
+        /// </summary>
+        public string Application
+        {
+            get { return _extendedHelper.GetXmlNodeString(ApplicationPath); }
+        }
+
+        const string HyperlinkBasePath = "xp:Properties/xp:HyperlinkBase";
+        /// <summary>
+        /// Gets/sets the HyperlinkBase property of the document (extended property)
+        /// </summary>
+        public Uri HyperlinkBase
+        {
+            get { return new Uri(_extendedHelper.GetXmlNodeString(HyperlinkBasePath), UriKind.Absolute); }
+            set { _extendedHelper.SetXmlNodeString(HyperlinkBasePath, value.AbsoluteUri); }
+        }
+
+        const string AppVersionPath = "xp:Properties/xp:AppVersion";
+        /// <summary>
+        /// Gets the AppVersion property of the document (extended property)
+        /// </summary>
+        public string AppVersion
+        {
+            get { return _extendedHelper.GetXmlNodeString(AppVersionPath); }
+        }
+        const string CompanyPath = "xp:Properties/xp:Company";
+
+        /// <summary>
+        /// Gets/sets the Company property of the document (extended property)
+        /// </summary>
+        public string Company
+        {
+            get { return _extendedHelper.GetXmlNodeString(CompanyPath); }
+            set { _extendedHelper.SetXmlNodeString(CompanyPath, value); }
+        }
+
+        const string ManagerPath = "xp:Properties/xp:Manager";
+        /// <summary>
+        /// Gets/sets the Manager property of the document (extended property)
+        /// </summary>
+        public string Manager
+        {
+            get { return _extendedHelper.GetXmlNodeString(ManagerPath); }
+            set { _extendedHelper.SetXmlNodeString(ManagerPath, value); }
+        }
+
+        #region Get and Set Extended Properties
+        private string GetExtendedPropertyValue(string propertyName)
+        {
+            string retValue = null;
+            string searchString = string.Format("xp:Properties/xp:{0}", propertyName);
+            XmlNode node = ExtendedPropertiesXml.SelectSingleNode(searchString, NameSpaceManager);
+            if (node != null)
+            {
+                retValue = node.InnerText;
+            }
+            return retValue;
+        }
+        #endregion
+        #endregion
+
+        #region Custom Properties
+
+        #region CustomPropertiesXml
+        /// <summary>
+        /// Provides access to the XML document which holds the document's custom properties
+        /// </summary>
+        public XmlDocument CustomPropertiesXml
+        {
+            get
+            {
+                if (_xmlPropertiesCustom == null)
+                {
+                    _xmlPropertiesCustom = GetXmlDocument(string.Format("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><Properties xmlns:vt=\"{0}\" xmlns=\"{1}\"></Properties>",
+                            ExcelPackage.schemaVt,
+                            ExcelPackage.schemaCustom),
+                         _uriPropertiesCustom, 
+                         @"application/vnd.openxmlformats-officedocument.custom-properties+xml",
+                         @"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties");
+                }
+                return (_xmlPropertiesCustom);
+            }
+        }
+        #endregion
+
+        #region Get and Set Custom Properties
+        /// <summary>
+        /// Gets the value of a custom property
+        /// </summary>
+        /// <param name="propertyName">The name of the property</param>
+        /// <returns>The current value of the property</returns>
+        public object GetCustomPropertyValue(string propertyName)
+        {
+            string searchString = string.Format("ctp:Properties/ctp:property[@name='{0}']", propertyName);
+            XmlElement node = CustomPropertiesXml.SelectSingleNode(searchString, NameSpaceManager) as XmlElement;
+            if (node != null)
+            {
+                string value = node.LastChild.InnerText;
+                switch (node.LastChild.LocalName)
+                {
+                    case "filetime":
+                        DateTime dt;
+                        if (DateTime.TryParse(value, out dt))
+                        {
+                            return dt;
+                        }
+                        else
+                        {
+                            return null;
+                        }
+                    case "i4":
+                        int i;
+                        if (int.TryParse(value, out i))
+                        {
+                            return i;
+                        }
+                        else
+                        {
+                            return null;
+                        }
+                    case "r8":
+                        double d;
+                        if (double.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, out d))
+                        {
+                            return d;
+                        }
+                        else
+                        {
+                            return null;
+                        }
+                    case "bool":
+                        if (value == "true")
+                        {
+                            return true;
+                        }
+                        else if (value == "false")
+                        {
+                            return false;
+                        }
+                        else
+                        {
+                            return null;
+                        }
+                    default:
+                        return value;
+                }
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// Allows you to set the value of a current custom property or create your own custom property.  
+        /// </summary>
+        /// <param name="propertyName">The name of the property</param>
+        /// <param name="value">The value of the property</param>
+        public void SetCustomPropertyValue(string propertyName, object value)
+        {
+            XmlNode allProps = CustomPropertiesXml.SelectSingleNode(@"ctp:Properties", NameSpaceManager);
+
+            var prop = string.Format("ctp:Properties/ctp:property[@name='{0}']", propertyName);
+            XmlElement node = CustomPropertiesXml.SelectSingleNode(prop, NameSpaceManager) as XmlElement;
+            if (node == null)
+            {
+                int pid;
+                var MaxNode = CustomPropertiesXml.SelectSingleNode("ctp:Properties/ctp:property[not(@pid <= preceding-sibling::ctp:property/@pid) and not(@pid <= following-sibling::ctp:property/@pid)]", NameSpaceManager);
+                if (MaxNode == null)
+                {
+                    pid = 2;
+                }
+                else
+                {
+                    if (!int.TryParse(MaxNode.Attributes["pid"].Value, out pid))
+                    {
+                        pid = 2;
+                    }
+                    pid++;
+                }
+                node = CustomPropertiesXml.CreateElement("property", ExcelPackage.schemaCustom);
+                node.SetAttribute("fmtid", "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}");
+                node.SetAttribute("pid", pid.ToString());  // custom property pid
+                node.SetAttribute("name", propertyName);
+
+                allProps.AppendChild(node);
+            }
+            else
+            {
+                while (node.ChildNodes.Count > 0) node.RemoveChild(node.ChildNodes[0]);
+            }
+            XmlElement valueElem;
+            if (value is bool)
+            {
+                valueElem = CustomPropertiesXml.CreateElement("vt", "bool", ExcelPackage.schemaVt);
+                valueElem.InnerText = value.ToString().ToLower();
+            }
+            else if (value is DateTime)
+            {
+                valueElem = CustomPropertiesXml.CreateElement("vt", "filetime", ExcelPackage.schemaVt);
+                valueElem.InnerText = ((DateTime)value).AddHours(-1).ToString("yyyy-MM-ddTHH:mm:ssZ");
+            }
+            else if (value is short || value is int)
+            {
+                valueElem = CustomPropertiesXml.CreateElement("vt", "i4", ExcelPackage.schemaVt);
+                valueElem.InnerText = value.ToString();
+            }
+            else if (value is double || value is decimal || value is float || value is long)
+            {
+                valueElem = CustomPropertiesXml.CreateElement("vt", "r8", ExcelPackage.schemaVt);
+                if (value is double)
+                {
+                    valueElem.InnerText = ((double)value).ToString(CultureInfo.InvariantCulture);
+                }
+                else if (value is float)
+                {
+                    valueElem.InnerText = ((float)value).ToString(CultureInfo.InvariantCulture);
+                }
+                else if (value is decimal)
+                {
+                    valueElem.InnerText = ((decimal)value).ToString(CultureInfo.InvariantCulture);
+                }
+                else
+                {
+                    valueElem.InnerText = value.ToString();
+                }
+            }
+            else
+            {
+                valueElem = CustomPropertiesXml.CreateElement("vt", "lpwstr", ExcelPackage.schemaVt);
+                valueElem.InnerText = value.ToString();
+            }
+            node.AppendChild(valueElem);
+        }
+        #endregion
+        #endregion
+
+        #region Save
+        /// <summary>
+        /// Saves the document properties back to the package.
+        /// </summary>
+        internal void Save()
+        {
+            if (_xmlPropertiesCore != null)
+            {
+                _package.SavePart(_uriPropertiesCore, _xmlPropertiesCore);
+            }
+            if (_xmlPropertiesExtended != null)
+            {
+                _package.SavePart(_uriPropertiesExtended, _xmlPropertiesExtended);
+            }
+            if (_xmlPropertiesCustom != null)
+            {
+                _package.SavePart(_uriPropertiesCustom, _xmlPropertiesCustom);
+            }
+
+        }
+        #endregion
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Properties/AssemblyInfo.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Properties/AssemblyInfo.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Properties/AssemblyInfo.cs	(revision 9616)
@@ -0,0 +1,65 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		10-SEP-2009
+ * Jan Källman		License changed GPL-->LGPL 2011-12-27
+ *******************************************************************************/
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Security;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("EPPlus")]
+[assembly: AssemblyDescription("Allows Excel files(xlsx;xlsm) to be created on the server. See epplus.codeplex.com")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("EPPlus")]
+[assembly: AssemblyCopyright("Copyright 2009- ©Jan Källman. Parts of the Interface comes from ExcelPackage-project")]
+[assembly: AssemblyTrademark("The GNU Lesser General Public License (LGPL)")]
+[assembly: AssemblyCulture("")]
+[assembly: ComVisible(false)]
+[assembly: InternalsVisibleTo("EPPlusTest, PublicKey=00240000048000009400000006020000002400005253413100040000010001001dd11308ec93a6ebcec727e183a8972dc6f95c23ecc34aa04f40cbfc9c17b08b4a0ea5c00dcd203bace44d15a30ce8796e38176ae88e960ceff9cc439ab938738ba0e603e3d155fc298799b391c004fc0eb4393dd254ce25db341eb43303e4c488c9500e126f1288594f0710ec7d642e9c72e76dd860649f1c48249c00e31fba")]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("9dd43b8d-c4fe-4a8b-ad6e-47ef83bbbb01")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("3.1.3.0")]
+[assembly: AssemblyFileVersion("3.1.3.0")]
+[assembly: AllowPartiallyTrustedCallers]
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/RangeCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/RangeCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/RangeCollection.cs	(revision 9616)
@@ -0,0 +1,318 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		    Added       		        2010-02-04
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Collections;
+using OfficeOpenXml.Drawing.Vml;
+namespace OfficeOpenXml
+{
+    /// <summary>
+    /// This is the store for all Rows, Columns and Cells.
+    /// It is a Dictionary implementation that allows you to change the Key (the RowID, ColumnID or CellID )
+    /// </summary>
+    internal class RangeCollection : IEnumerator<IRangeID>, IEnumerable
+    {
+        private class IndexItem
+        {
+            internal IndexItem(ulong cellId)
+            {
+                RangeID = cellId;
+            }
+            internal IndexItem(ulong cellId, int listPointer)
+	        {
+                RangeID = cellId;
+                ListPointer=listPointer;
+	        }
+            internal ulong RangeID;
+            internal int ListPointer;
+        }
+        /// <summary>
+        /// Compares an IndexItem
+        /// </summary>
+        internal class Compare : IComparer<IndexItem>
+        {
+            #region IComparer<IndexItem> Members
+            int IComparer<IndexItem>.Compare(IndexItem x, IndexItem y)
+            {
+                return x.RangeID < y.RangeID ? -1 : x.RangeID > y.RangeID ? 1 : 0;
+            }
+
+            #endregion
+        }
+        IndexItem[] _cellIndex;
+        List<IRangeID> _cells;
+        Compare _comparer;
+        /// <summary>
+        /// Creates a new collection
+        /// </summary>
+        /// <param name="cells">The Cells. This list must be sorted</param>
+        internal RangeCollection(List<IRangeID> cells)
+        {   
+            _cells = cells;
+            _comparer = new Compare();
+            InitSize(_cells);
+            for (int i = 0; i < _cells.Count; i++)
+            {
+                _cellIndex[i] = new IndexItem(cells[i].RangeID, i);
+            }
+        }
+        ~RangeCollection()
+        {
+            _cellIndex = null;
+            _cells = null;
+        }
+        /// <summary>
+        /// Return the item with the RangeID
+        /// </summary>
+        /// <param name="RangeID"></param>
+        /// <returns></returns>
+        internal IRangeID this[ulong RangeID]
+        {
+            get
+            {
+                return _cells[_cellIndex[IndexOf(RangeID)].ListPointer];
+            }
+        }
+        /// <summary>
+        /// Return specified index from the sorted list
+        /// </summary>
+        /// <param name="Index"></param>
+        /// <returns></returns>
+        internal IRangeID this[int Index]
+        {
+            get
+            {
+                return _cells[_cellIndex[Index].ListPointer];
+            }
+        }
+        internal int Count
+        {
+            get
+            {
+                return _cells.Count;
+            }
+        }
+        internal void Add(IRangeID cell)
+        {
+            var ix = IndexOf(cell.RangeID);
+            if (ix >= 0)
+            {
+                throw (new Exception("Item already exists"));
+            }
+            Insert(~ix, cell);
+        }
+        internal void Delete(ulong key)
+        {
+            var ix = IndexOf(key);
+            if (ix < 0)
+            {
+                throw (new Exception("Key does not exists"));
+            }
+            int listPointer = _cellIndex[ix].ListPointer;
+            Array.Copy(_cellIndex, ix + 1, _cellIndex, ix, _cells.Count - ix - 1);
+            _cells.RemoveAt(listPointer);
+
+            //Item is removed subtract one from all items with greater ListPointer
+            for (int i = 0; i < _cells.Count; i++)
+            {
+                if (_cellIndex[i].ListPointer >= listPointer)
+                {
+                    _cellIndex[i].ListPointer--;
+                }
+
+            }
+        }
+        internal int IndexOf(ulong key)
+        {
+            return Array.BinarySearch<IndexItem>(_cellIndex, 0, _cells.Count, new IndexItem(key), _comparer);
+        }
+        internal bool ContainsKey(ulong key)
+        {
+            return IndexOf(key) < 0 ? false : true;
+        }
+        int _size { get; set; }
+        #region "RangeID manipulation methods"
+        /// <summary>
+        /// Insert a number of rows in the collecion but dont update the cell only the index
+        /// </summary>
+        /// <param name="rowID"></param>
+        /// <param name="rows"></param>
+        /// <returns>Index of first rangeItem</returns>
+        internal int InsertRowsUpdateIndex(ulong rowID, int rows)
+        {
+            int index = IndexOf(rowID);
+            if (index < 0) index = ~index; //No match found invert to get start cell
+            ulong rowAdd = (((ulong)rows) << 29);
+            for (int i = index; i < _cells.Count; i++)
+            {
+                _cellIndex[i].RangeID += rowAdd;
+            }
+            return index;
+        }
+        /// <summary>
+        /// Insert a number of rows in the collecion
+        /// </summary>
+        /// <param name="rowID"></param>
+        /// <param name="rows"></param>
+        /// <returns>Index of first rangeItem</returns>
+        internal int InsertRows(ulong rowID, int rows)
+        {
+            int index = IndexOf(rowID);
+            if (index < 0) index = ~index; //No match found invert to get start cell
+            ulong rowAdd=(((ulong)rows) << 29);
+            for (int i = index; i < _cells.Count; i++)
+            {
+                _cellIndex[i].RangeID += rowAdd;
+                _cells[_cellIndex[i].ListPointer].RangeID += rowAdd;
+            }
+            return index;
+        }
+        /// <summary>
+        /// Delete rows from the collecion
+        /// </summary>
+        /// <param name="rowID"></param>
+        /// <param name="rows"></param>
+        /// <param name="updateCells">Update range id's on cells</param>
+        internal int DeleteRows(ulong rowID, int rows, bool updateCells)
+        {
+            ulong rowAdd = (((ulong)rows) << 29);
+            var index = IndexOf(rowID);
+            if (index < 0) index = ~index; //No match found invert to get start cell
+
+            if (index >= _cells.Count || _cellIndex[index] == null) return -1;   //No row above this row
+            while (index < _cells.Count && _cellIndex[index].RangeID < rowID + rowAdd)
+            {
+                Delete(_cellIndex[index].RangeID);
+            }
+
+            int updIndex = IndexOf(rowID + rowAdd);
+            if (updIndex < 0) updIndex = ~updIndex; //No match found invert to get start cell
+
+            for (int i = updIndex; i < _cells.Count; i++)
+            {
+                _cellIndex[i].RangeID -= rowAdd;                        //Change the index
+                if (updateCells) _cells[_cellIndex[i].ListPointer].RangeID -= rowAdd;    //Change the cell/row or column object
+            }
+            return index;
+        }
+        internal void InsertColumn(ulong ColumnID, int columns)
+        {
+            throw (new Exception("Working on it..."));
+        }
+        internal void DeleteColumn(ulong ColumnID,int columns)
+        {
+            throw (new Exception("Working on it..."));
+        }
+        #endregion
+        #region "Private Methods"
+        /// <summary>
+        /// Init the size starting from 128 items. Double the size until the list fits.
+        /// </summary>
+        /// <param name="_cells"></param>
+        private void InitSize(List<IRangeID> _cells)
+        {
+            _size = 128;
+            while (_cells.Count > _size) _size <<= 1;
+            _cellIndex = new IndexItem[_size];
+        }
+        /// <summary>
+        /// Check the size and double the size if out of bound
+        /// </summary>
+        private void CheckSize()
+        {
+            if (_cells.Count >= _size)
+            {
+                _size <<= 1;
+                Array.Resize(ref _cellIndex, _size);
+            }
+        }
+        private void Insert(int ix, IRangeID cell)
+        {
+            CheckSize();
+            Array.Copy(_cellIndex, ix, _cellIndex, ix + 1, _cells.Count - ix);
+            _cellIndex[ix] = new IndexItem(cell.RangeID, _cells.Count);
+            _cells.Add(cell);
+        }
+        #endregion
+
+        #region IEnumerator<IRangeID> Members
+
+        IRangeID IEnumerator<IRangeID>.Current
+        {
+            get { throw new NotImplementedException(); }
+        }
+
+        #endregion
+
+        #region IDisposable for the enumerator Members
+
+        void IDisposable.Dispose()
+        {
+            _ix = -1;
+        }
+
+        #endregion
+
+        #region IEnumerator Members
+        int _ix = -1;
+        object IEnumerator.Current
+        {
+            get 
+            {
+                return _cells[_cellIndex[_ix].ListPointer];
+            }
+        }
+
+        bool IEnumerator.MoveNext()
+        {
+           _ix++;
+           return _ix < _cells.Count;
+        }
+
+        void IEnumerator.Reset()
+        {
+            _ix = -1;
+        }
+
+        #endregion
+
+        #region IEnumerable Members
+
+        IEnumerator IEnumerable.GetEnumerator()
+        {
+            return this;
+        }
+
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/DxfStyleBase.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/DxfStyleBase.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/DxfStyleBase.cs	(revision 9616)
@@ -0,0 +1,97 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Style.Dxf
+{
+    public abstract class DxfStyleBase<T>
+    {
+        protected ExcelStyles _styles;
+        internal DxfStyleBase(ExcelStyles styles)
+        {
+            _styles = styles;
+            AllowChange = false; //Don't touch this value in the styles.xml (by default). When Dxfs is fully implemented this can be removed.
+        }
+        protected internal abstract string Id { get; }
+        protected internal abstract bool HasValue{get;}
+        protected internal abstract void CreateNodes(XmlHelper helper, string path);
+        protected internal abstract T Clone();
+        protected void SetValueColor(XmlHelper helper,string path, ExcelDxfColor color)
+        {
+            if (color != null && color.HasValue)
+            {
+                if (color.Color != null)
+                {
+                    SetValue(helper, path + "/@rgb", color.Color.Value.ToArgb().ToString("x"));
+                }
+                else if (color.Auto != null)
+                {
+                    SetValueBool(helper, path + "/@auto", color.Auto);
+                }
+                else if (color.Theme != null)
+                {
+                    SetValue(helper, path + "/@theme", color.Theme);
+                }
+                else if (color.Index != null)
+                {
+                    SetValue(helper, path + "/@indexed", color.Index);
+                }
+                if (color.Tint != null)
+                {
+                    SetValue(helper, path + "/@tint", color.Tint);
+                }
+            }
+        }
+        /// <summary>
+        /// Same as SetValue but will set first char to lower case.
+        /// </summary>
+        /// <param name="helper"></param>
+        /// <param name="path"></param>
+        /// <param name="v"></param>
+        protected void SetValueEnum(XmlHelper helper, string path, Enum v)
+        {
+            if (v == null)
+            {
+                helper.DeleteNode(path);
+            }
+            else
+            {
+                var s = v.ToString();
+                s = s.Substring(0, 1).ToLower() + s.Substring(1);
+                helper.SetXmlNodeString(path, s);
+            }
+        }
+        protected void SetValue(XmlHelper helper, string path, object v)
+        {
+            if (v == null)
+            {
+                helper.DeleteNode(path);
+            }
+            else
+            {
+                helper.SetXmlNodeString(path, v.ToString());
+            }
+        }
+        protected void SetValueBool(XmlHelper helper, string path, bool? v)
+        {
+            if (v == null)
+            {
+                helper.DeleteNode(path);
+            }
+            else
+            {
+                helper.SetXmlNodeBool(path, (bool)v);
+            }
+        }
+        protected internal string GetAsString(object v)
+        {
+            return (v ?? "").ToString();
+        }
+        /// <summary>
+        /// Is this value allowed to be changed?
+        /// </summary>
+        protected internal bool AllowChange { get; set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfBorder.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfBorder.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfBorder.cs	(revision 9616)
@@ -0,0 +1,106 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Style.Dxf
+{
+    public class ExcelDxfBorderBase : DxfStyleBase<ExcelDxfBorderBase>
+    {
+        internal ExcelDxfBorderBase(ExcelStyles styles)
+            : base(styles)
+        {
+            Left=new ExcelDxfBorderItem(_styles);
+            Right = new ExcelDxfBorderItem(_styles);
+            Top = new ExcelDxfBorderItem(_styles);
+            Bottom = new ExcelDxfBorderItem(_styles);
+        }
+        /// <summary>
+        /// Left border style
+        /// </summary>
+        public ExcelDxfBorderItem Left
+        {
+            get;
+            internal set;
+        }
+        /// <summary>
+        /// Right border style
+        /// </summary>
+        public ExcelDxfBorderItem Right
+        {
+            get;
+            internal set;
+        }
+        /// <summary>
+        /// Top border style
+        /// </summary>
+        public ExcelDxfBorderItem Top
+        {
+            get;
+            internal set;
+        }
+        /// <summary>
+        /// Bottom border style
+        /// </summary>
+        public ExcelDxfBorderItem Bottom
+        {
+            get;
+            internal set;
+        }
+        ///// <summary>
+        ///// Diagonal border style
+        ///// </summary>
+        //public ExcelDxfBorderItem Diagonal
+        //{
+        //    get;
+        //    private set;
+        //}
+        ///// <summary>
+        ///// A diagonal from the bottom left to top right of the cell
+        ///// </summary>
+        //public bool DiagonalUp
+        //{
+        //    get;
+        //    set;
+        //}
+        ///// <summary>
+        ///// A diagonal from the top left to bottom right of the cell
+        ///// </summary>
+        //public bool DiagonalDown
+        //{
+        //    get;
+        //    set;
+        //}
+
+        protected internal override string Id
+        {
+            get
+            {
+                return Top.Id + Bottom.Id + Left.Id + Right.Id/* + Diagonal.Id + GetAsString(DiagonalUp) + GetAsString(DiagonalDown)*/;
+            }
+        }
+
+        protected internal override void CreateNodes(XmlHelper helper, string path)
+        {
+            Left.CreateNodes(helper, path + "/d:left");
+            Right.CreateNodes(helper, path + "/d:right");
+            Top.CreateNodes(helper, path + "/d:top");
+            Bottom.CreateNodes(helper, path + "/d:bottom");
+        }
+        protected internal override bool HasValue
+        {
+            get 
+            {
+                return Left.HasValue ||
+                    Right.HasValue ||
+                    Top.HasValue ||
+                    Bottom.HasValue;
+            }
+        }
+        protected internal override ExcelDxfBorderBase Clone()
+        {
+            return new ExcelDxfBorderBase(_styles) { Bottom = Bottom.Clone(), Top=Top.Clone(), Left=Left.Clone(), Right=Right.Clone() };
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfBorderItem.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfBorderItem.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfBorderItem.cs	(revision 9616)
@@ -0,0 +1,44 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Style.Dxf
+{
+    public class ExcelDxfBorderItem : DxfStyleBase<ExcelDxfBorderItem>
+    {
+        internal ExcelDxfBorderItem(ExcelStyles styles) :
+            base(styles)
+        {
+            Color=new ExcelDxfColor(styles);
+        }
+        public ExcelBorderStyle? Style { get; set;}
+        public ExcelDxfColor Color { get; internal set; }
+
+        protected internal override string Id
+        {
+            get
+            {
+                return GetAsString(Style) + "|" + (Color == null ? "" : Color.Id);
+            }
+        }
+
+        protected internal override void CreateNodes(XmlHelper helper, string path)
+        {            
+            SetValueEnum(helper, path + "/@style", Style);
+            SetValueColor(helper, path + "/d:color", Color);
+        }
+        protected internal override bool HasValue
+        {
+            get 
+            {
+                return Style != null || Color.HasValue;
+            }
+        }
+        protected internal override ExcelDxfBorderItem Clone()
+        {
+            return new ExcelDxfBorderItem(_styles) { Style = Style, Color = Color };
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfColor.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfColor.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfColor.cs	(revision 9616)
@@ -0,0 +1,46 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+
+namespace OfficeOpenXml.Style.Dxf
+{
+    public class ExcelDxfColor : DxfStyleBase<ExcelDxfColor>
+
+    {
+        public ExcelDxfColor(ExcelStyles styles) : base(styles)
+        {
+
+        }
+        public int? Theme { get; set; }
+        public int? Index { get; set; }
+        public bool? Auto { get; set; }
+        public double? Tint { get; set; }
+        public Color? Color { get; set; }
+        protected internal override string Id
+        {
+            get { return GetAsString(Theme) + "|" + GetAsString(Index) + "|" + GetAsString(Auto) + "|" + GetAsString(Tint) + "|" + GetAsString(Color==null ? "" : ((Color)Color.Value).ToArgb().ToString("x")); }
+        }
+        protected internal override ExcelDxfColor Clone()
+        {
+            return new ExcelDxfColor(_styles) { Theme = Theme, Index = Index, Color = Color, Auto = Auto, Tint = Tint };
+        }
+        protected internal override bool HasValue
+        {
+            get
+            {
+                return Theme != null ||
+                       Index != null ||
+                       Auto != null ||
+                       Tint != null ||
+                       Color != null;
+            }
+        }
+        protected internal override void CreateNodes(XmlHelper helper, string path)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfFill.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfFill.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfFill.cs	(revision 9616)
@@ -0,0 +1,57 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+
+namespace OfficeOpenXml.Style.Dxf
+{
+    public class ExcelDxfFill : DxfStyleBase<ExcelDxfFill>
+    {
+        public ExcelDxfFill(ExcelStyles styles)
+            : base(styles)
+        {
+            PatternColor = new ExcelDxfColor(styles);
+            BackgroundColor = new ExcelDxfColor(styles);
+        }
+        public ExcelFillStyle? PatternType { get; set; }
+        /// <summary>
+        /// The color of the pattern
+        /// </summary>
+        public ExcelDxfColor PatternColor { get; internal set; }
+        /// <summary>
+        /// The background color
+        /// </summary>
+        public ExcelDxfColor BackgroundColor { get; internal set; }
+
+        protected internal override string Id
+        {
+            get
+            {
+                return GetAsString(PatternType) + "|" + (PatternColor == null ? "" : PatternColor.Id) + "|" + (BackgroundColor == null ? "" : BackgroundColor.Id);
+            }
+        }
+        protected internal override void CreateNodes(XmlHelper helper, string path)
+        {
+            helper.CreateNode(path);
+            SetValueEnum(helper, path + "/d:patternFill/@patternType", PatternType);
+            SetValueColor(helper, path + "/d:patternFill/d:fgColor", PatternColor);
+            SetValueColor(helper, path + "/d:patternFill/d:bgColor", BackgroundColor);
+        }
+
+        protected internal override bool HasValue
+        {
+            get 
+            {
+                return PatternType != null ||
+                    PatternColor.HasValue ||
+                    BackgroundColor.HasValue;
+            }
+        }
+        protected internal override ExcelDxfFill Clone()
+        {
+            return new ExcelDxfFill(_styles) {PatternType=PatternType, PatternColor=PatternColor.Clone(), BackgroundColor=BackgroundColor.Clone()};
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfFontBase.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfFontBase.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfFontBase.cs	(revision 9616)
@@ -0,0 +1,85 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing;
+using System.Xml;
+
+namespace OfficeOpenXml.Style.Dxf
+{
+    public class ExcelDxfFontBase : DxfStyleBase<ExcelDxfFontBase>
+    {
+        public ExcelDxfFontBase(ExcelStyles styles)
+            : base(styles)
+        {
+            Color = new ExcelDxfColor(styles);
+        }
+        /// <summary>
+        /// Font bold
+        /// </summary>
+        public bool? Bold
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// Font Italic
+        /// </summary>
+        public bool? Italic
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// Font-Strikeout
+        /// </summary>
+        public bool? Strike { get; set; }
+        //public float? Size { get; set; }
+        public ExcelDxfColor Color { get; set; }
+        //public string Name { get; set; }
+        //public int? Family { get; set; }
+        ///// <summary>
+        ///// Font-Vertical Align
+        ///// </summary>
+        //public ExcelVerticalAlignmentFont? VerticalAlign
+        //{
+        //    get;
+        //    set;
+        //}
+
+        public ExcelUnderLineType? Underline { get; set; }
+
+        protected internal override string Id
+        {
+            get
+            {
+                return GetAsString(Bold) + "|" + GetAsString(Italic) + "|" + GetAsString(Strike) + "|" + (Color ==null ? "" : Color.Id) + "|" /*+ GetAsString(VerticalAlign) + "|"*/ + GetAsString(Underline);
+            }
+        }
+
+        protected internal override void CreateNodes(XmlHelper helper, string path)
+        {
+            helper.CreateNode(path);
+            SetValueBool(helper, path + "/d:b/@val", Bold);
+            SetValueBool(helper, path + "/d:i/@val", Italic);
+            SetValueBool(helper, path + "/d:strike", Strike);
+            SetValue(helper, path + "/d:u/@val", Underline);
+            SetValueColor(helper, path + "/d:color", Color);
+        }
+        protected internal override bool HasValue
+        {
+            get
+            {
+                return Bold != null ||
+                       Italic != null ||
+                       Strike != null ||
+                       Underline != null ||
+                       Color.HasValue;
+            }
+        }
+        protected internal override ExcelDxfFontBase Clone()
+        {
+            return new ExcelDxfFontBase(_styles) { Bold = Bold, Color = Color.Clone(), Italic = Italic, Strike = Strike, Underline = Underline };
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfNumberFormat.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfNumberFormat.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfNumberFormat.cs	(revision 9616)
@@ -0,0 +1,105 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Style.Dxf
+{
+    public class ExcelDxfNumberFormat : DxfStyleBase<ExcelDxfNumberFormat>
+    {
+        public ExcelDxfNumberFormat(ExcelStyles styles) : base(styles)
+        {
+
+        }
+        int _numFmtID=int.MinValue;
+        /// <summary>
+        /// Id for number format
+        /// 
+        /// Build in ID's
+        /// 
+        /// 0   General 
+        /// 1   0 
+        /// 2   0.00 
+        /// 3   #,##0 
+        /// 4   #,##0.00 
+        /// 9   0% 
+        /// 10  0.00% 
+        /// 11  0.00E+00 
+        /// 12  # ?/? 
+        /// 13  # ??/?? 
+        /// 14  mm-dd-yy 
+        /// 15  d-mmm-yy 
+        /// 16  d-mmm 
+        /// 17  mmm-yy 
+        /// 18  h:mm AM/PM 
+        /// 19  h:mm:ss AM/PM 
+        /// 20  h:mm 
+        /// 21  h:mm:ss 
+        /// 22  m/d/yy h:mm 
+        /// 37  #,##0 ;(#,##0) 
+        /// 38  #,##0 ;[Red](#,##0) 
+        /// 39  #,##0.00;(#,##0.00) 
+        /// 40  #,##0.00;[Red](#,##0.00) 
+        /// 45  mm:ss 
+        /// 46  [h]:mm:ss 
+        /// 47  mmss.0 
+        /// 48  ##0.0E+0 
+        /// 49  @
+        /// </summary>            
+        public int NumFmtID 
+        { 
+            get
+            {
+                return _numFmtID;
+            }
+            internal set
+            {
+                _numFmtID = value;
+            }
+        }
+        string _format="";
+        public string Format
+        { 
+            get
+            {
+                return _format;
+            }
+            set
+            {
+                _format = value;
+                NumFmtID = ExcelNumberFormat.GetFromBuildIdFromFormat(value);
+            }
+        }
+
+        protected internal override string Id
+        {
+            get
+            {
+                return Format;
+            }
+        }
+
+        protected internal override void CreateNodes(XmlHelper helper, string path)
+        {
+            if (NumFmtID < 0 && !string.IsNullOrEmpty(Format))
+            {
+                NumFmtID = _styles._nextDfxNumFmtID++;
+            }
+            helper.CreateNode(path);
+            SetValue(helper, path + "/@numFmtId", NumFmtID);
+            SetValue(helper, path + "/@formatCode", Format);
+        }
+        protected internal override bool HasValue
+        {
+            get 
+            { 
+                return !string.IsNullOrEmpty(Format); 
+            }
+        }
+        protected internal override ExcelDxfNumberFormat Clone()
+        {
+            return new ExcelDxfNumberFormat(_styles) { NumFmtID = NumFmtID, Format = Format };
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfStyle.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfStyle.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/Dxf/ExcelDxfStyle.cs	(revision 9616)
@@ -0,0 +1,152 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Drawing;
+
+namespace OfficeOpenXml.Style.Dxf
+{
+    public class ExcelDxfStyleConditionalFormatting : DxfStyleBase<ExcelDxfStyleConditionalFormatting>
+    {
+        XmlHelperInstance _helper;
+        internal ExcelDxfStyleConditionalFormatting(XmlNamespaceManager nameSpaceManager, XmlNode topNode, ExcelStyles styles) : base(styles)
+        {
+            NumberFormat = new ExcelDxfNumberFormat(_styles);
+            Font = new ExcelDxfFontBase(_styles);
+            Border = new ExcelDxfBorderBase(_styles);
+            Fill = new ExcelDxfFill(_styles);
+            if (topNode != null)
+            {
+                _helper = new XmlHelperInstance(nameSpaceManager, topNode);
+                NumberFormat.NumFmtID = _helper.GetXmlNodeInt("d:numFmt/@numFmtId");
+                NumberFormat.Format = _helper.GetXmlNodeString("d:numFmt/@formatCode"); 
+                if (NumberFormat.NumFmtID < 164 && string.IsNullOrEmpty(NumberFormat.Format))
+                {
+                    NumberFormat.Format = ExcelNumberFormat.GetFromBuildInFromID(NumberFormat.NumFmtID);
+                }
+
+                Font.Bold = _helper.GetXmlNodeBoolNullable("d:font/d:b/@val");
+                Font.Italic = _helper.GetXmlNodeBoolNullable("d:font/d:i/@val");
+                Font.Strike = _helper.GetXmlNodeBoolNullable("d:font/d:strike");
+                Font.Underline = GetUnderLineEnum(_helper.GetXmlNodeString("d:font/d:u/@val"));
+                Font.Color = GetColor(_helper, "d:font/d:color");
+
+                Border.Left = GetBorderItem(_helper, "d:border/d:left");
+                Border.Right = GetBorderItem(_helper, "d:border/d:right");
+                Border.Bottom = GetBorderItem(_helper, "d:border/d:bottom");
+                Border.Top = GetBorderItem(_helper, "d:border/d:top");
+
+                Fill.PatternType = GetPatternTypeEnum(_helper.GetXmlNodeString("d:fill/d:patternFill/@patternType"));
+                Fill.BackgroundColor = GetColor(_helper, "d:fill/d:patternFill/d:bgColor/");
+                Fill.PatternColor = GetColor(_helper, "d:fill/d:patternFill/d:fgColor/");
+            }
+            else
+            {
+                _helper = new XmlHelperInstance(nameSpaceManager);
+            }
+            _helper.SchemaNodeOrder = new string[] { "font", "numFmt", "fill", "border" };
+        }
+        private ExcelDxfBorderItem GetBorderItem(XmlHelperInstance helper, string path)
+        {
+            ExcelDxfBorderItem bi = new ExcelDxfBorderItem(_styles);
+            bi.Style = GetBorderStyleEnum(helper.GetXmlNodeString(path+"/@style"));
+            bi.Color = GetColor(helper, path+"/d:color");
+            return bi;
+        }
+        private ExcelBorderStyle GetBorderStyleEnum(string style)
+        {
+            if (style == "") return ExcelBorderStyle.None;
+            string sInStyle = style.Substring(0, 1).ToUpper() + style.Substring(1, style.Length - 1);
+            try
+            {
+                return (ExcelBorderStyle)Enum.Parse(typeof(ExcelBorderStyle), sInStyle);
+            }
+            catch
+            {
+                return ExcelBorderStyle.None;
+            }
+
+        }
+        private ExcelFillStyle GetPatternTypeEnum(string patternType)
+        {
+            if (patternType == "") return ExcelFillStyle.None;
+            patternType = patternType.Substring(0, 1).ToUpper() + patternType.Substring(1, patternType.Length - 1);
+            try
+            {
+                return (ExcelFillStyle)Enum.Parse(typeof(ExcelFillStyle), patternType);
+            }
+            catch
+            {
+                return ExcelFillStyle.None;
+            }
+        }
+        private ExcelDxfColor GetColor(XmlHelperInstance helper, string path)
+        {            
+            ExcelDxfColor ret = new ExcelDxfColor(_styles);
+            ret.Theme = helper.GetXmlNodeIntNull(path + "/@theme");
+            ret.Index = helper.GetXmlNodeIntNull(path + "/@indexed");
+            string rgb=helper.GetXmlNodeString(path + "/@rgb");
+            if(rgb!="")
+            {
+                ret.Color = Color.FromArgb( int.Parse(rgb.Substring(0, 2), System.Globalization.NumberStyles.AllowHexSpecifier),
+                                            int.Parse(rgb.Substring(2, 2), System.Globalization.NumberStyles.AllowHexSpecifier),
+                                            int.Parse(rgb.Substring(4, 2), System.Globalization.NumberStyles.AllowHexSpecifier),
+                                            int.Parse(rgb.Substring(6, 2), System.Globalization.NumberStyles.AllowHexSpecifier));
+            }
+            ret.Auto = helper.GetXmlNodeBoolNullable(path + "/@auto");
+            ret.Tint = helper.GetXmlNodeDoubleNull(path + "/@tint");
+            return ret;
+        }
+        private ExcelUnderLineType? GetUnderLineEnum(string value)
+        {
+            switch(value.ToLower())
+            {
+                case "single":
+                    return ExcelUnderLineType.Single;
+                case "double":
+                    return ExcelUnderLineType.Double;
+                case "singleaccounting":
+                    return ExcelUnderLineType.SingleAccounting;
+                case "doubleaccounting":
+                    return ExcelUnderLineType.DoubleAccounting;
+                default:
+                    return null;
+            }
+        }
+        internal int DxfId { get; set; }
+        public ExcelDxfFontBase Font { get; set; }
+        public ExcelDxfNumberFormat NumberFormat { get; set; }
+        public ExcelDxfFill Fill { get; set; }
+        public ExcelDxfBorderBase Border { get; set; }
+        protected internal override string Id
+        {
+            get
+            {
+                return NumberFormat.Id + Font.Id + Border.Id + Fill.Id +
+                    (AllowChange ? "" : DxfId.ToString());//If allowchange is false we add the dxfID to ensure it's not used when conditional formatting is updated);
+            }
+        }
+        protected internal override ExcelDxfStyleConditionalFormatting Clone()
+        {
+ 	       var s=new ExcelDxfStyleConditionalFormatting(_helper.NameSpaceManager, null, _styles);
+           s.Font = Font.Clone();
+           s.NumberFormat = NumberFormat.Clone();
+           s.Fill = Fill.Clone();
+           s.Border = Border.Clone();
+           return s;
+        }
+
+        protected internal override void CreateNodes(XmlHelper helper, string path)
+        {
+            if(Font.HasValue) Font.CreateNodes(helper, "d:font");
+            if (NumberFormat.HasValue) NumberFormat.CreateNodes(helper, "d:numFmt");            
+            if (Fill.HasValue) Fill.CreateNodes(helper, "d:fill");
+            if (Border.HasValue) Border.CreateNodes(helper, "d:border");
+        }
+        protected internal override bool HasValue
+        {
+            get { return Font.HasValue || NumberFormat.HasValue || Fill.HasValue || Border.HasValue; }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelBorder.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelBorder.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelBorder.cs	(revision 9616)
@@ -0,0 +1,178 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style.XmlAccess;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// Cell Border style
+    /// </summary>
+    public sealed class Border : StyleBase
+    {
+        internal Border(ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int PositionID, string address, int index) :
+            base(styles, ChangedEvent, PositionID, address)
+	    {
+            Index = index;
+        }
+        /// <summary>
+        /// Left border style
+        /// </summary>
+        public ExcelBorderItem Left
+        {
+            get
+            {
+                return new ExcelBorderItem(_styles, _ChangedEvent, _positionID, _address, eStyleClass.BorderLeft, this);
+            }
+        }
+        /// <summary>
+        /// Right border style
+        /// </summary>
+        public ExcelBorderItem Right
+        {
+            get
+            {
+                return new ExcelBorderItem(_styles, _ChangedEvent, _positionID, _address, eStyleClass.BorderRight, this);
+            }
+        }
+        /// <summary>
+        /// Top border style
+        /// </summary>
+        public ExcelBorderItem Top
+        {
+            get
+            {
+                return new ExcelBorderItem(_styles, _ChangedEvent, _positionID, _address, eStyleClass.BorderTop, this);
+            }
+        }
+        /// <summary>
+        /// Bottom border style
+        /// </summary>
+        public ExcelBorderItem Bottom
+        {
+            get
+            {
+                return new ExcelBorderItem(_styles, _ChangedEvent, _positionID, _address, eStyleClass.BorderBottom, this);
+            }
+        }
+        /// <summary>
+        /// 0Diagonal border style
+        /// </summary>
+        public ExcelBorderItem Diagonal
+        {
+            get
+            {
+                return new ExcelBorderItem(_styles, _ChangedEvent, _positionID, _address, eStyleClass.BorderDiagonal, this);
+            }
+        }
+        /// <summary>
+        /// A diagonal from the bottom left to top right of the cell
+        /// </summary>
+        public bool DiagonalUp 
+        {
+            get
+            {
+                if (Index >=0)
+                {
+                    return _styles.Borders[Index].DiagonalUp;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Border, eStyleProperty.BorderDiagonalUp, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// A diagonal from the top left to bottom right of the cell
+        /// </summary>
+        public bool DiagonalDown 
+        {
+            get
+            {
+                if (Index >= 0)
+                {
+                    return _styles.Borders[Index].DiagonalDown;
+                }
+                else
+                {
+                    return false;
+                }
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Border, eStyleProperty.BorderDiagonalDown, value, _positionID, _address));
+            }
+        }
+        internal override string Id
+        {
+            get { return Top.Id + Bottom.Id +Left.Id + Right.Id + Diagonal.Id + DiagonalUp + DiagonalDown; }
+        }
+        /// <summary>
+        /// Set the border style around the range.
+        /// </summary>
+        /// <param name="Style">The border style</param>
+        public void BorderAround(ExcelBorderStyle Style)
+        {
+            var addr = new ExcelAddress(_address);
+            SetBorderAroundStyle(Style, addr);
+        }
+        /// <summary>
+        /// Set the border style around the range.
+        /// </summary>
+        /// <param name="Style">The border style</param>
+        /// <param name="Color">The color of the border</param>
+        public void BorderAround(ExcelBorderStyle Style, System.Drawing.Color Color)
+        {            
+            var addr=new ExcelAddress(_address);
+            SetBorderAroundStyle(Style, addr);
+
+            _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.BorderTop, eStyleProperty.Color, Color.ToArgb().ToString("X"), _positionID, new ExcelAddress(addr._fromRow, addr._fromCol, addr._fromRow, addr._toCol).Address));
+            _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.BorderBottom, eStyleProperty.Color, Color.ToArgb().ToString("X"), _positionID, new ExcelAddress(addr._toRow, addr._fromCol, addr._toRow, addr._toCol).Address));
+            _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.BorderLeft, eStyleProperty.Color, Color.ToArgb().ToString("X"), _positionID, new ExcelAddress(addr._fromRow, addr._fromCol, addr._toRow, addr._fromCol).Address));
+            _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.BorderRight, eStyleProperty.Color, Color.ToArgb().ToString("X"), _positionID, new ExcelAddress(addr._fromRow, addr._toCol, addr._toRow, addr._toCol).Address));
+        }
+
+        private void SetBorderAroundStyle(ExcelBorderStyle Style, ExcelAddress addr)
+        {
+            _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.BorderTop, eStyleProperty.Style, Style, _positionID, new ExcelAddress(addr._fromRow, addr._fromCol, addr._fromRow, addr._toCol).Address));
+            _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.BorderBottom, eStyleProperty.Style, Style, _positionID, new ExcelAddress(addr._toRow, addr._fromCol, addr._toRow, addr._toCol).Address));
+            _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.BorderLeft, eStyleProperty.Style, Style, _positionID, new ExcelAddress(addr._fromRow, addr._fromCol, addr._toRow, addr._fromCol).Address));
+            _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.BorderRight, eStyleProperty.Style, Style, _positionID, new ExcelAddress(addr._fromRow, addr._toCol, addr._toRow, addr._toCol).Address));
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelBorderItem.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelBorderItem.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelBorderItem.cs	(revision 9616)
@@ -0,0 +1,112 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style.XmlAccess;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// Cell border style
+    /// </summary>
+    public sealed class ExcelBorderItem : StyleBase
+    {
+        eStyleClass _cls;
+        StyleBase _parent;
+        internal ExcelBorderItem (ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int worksheetID, string address, eStyleClass cls, StyleBase parent) : 
+            base(styles, ChangedEvent, worksheetID, address)
+	    {
+            _cls=cls;
+            _parent = parent;
+	    }
+        /// <summary>
+        /// The line style of the border
+        /// </summary>
+        public ExcelBorderStyle Style
+        {
+            get
+            {
+                return GetSource().Style;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(_cls, eStyleProperty.Style, value, _positionID, _address));
+            }
+        }
+        ExcelColor _color=null;
+        /// <summary>
+        /// The color of the border
+        /// </summary>
+        public ExcelColor Color
+        {
+            get
+            {
+                if (_color == null)
+                {
+                    _color = new ExcelColor(_styles, _ChangedEvent, _positionID, _address, _cls, _parent);
+                }
+                return _color;
+            }
+        }
+
+        internal override string Id
+        {
+            get { return Style + Color.Id; }
+        }
+        internal override void SetIndex(int index)
+        {
+            _parent.Index = index;
+        }
+        private ExcelBorderItemXml GetSource()
+        {
+            int ix = _parent.Index < 0 ? 0 : _parent.Index;
+
+            switch(_cls)
+            {
+                case eStyleClass.BorderTop:
+                    return _styles.Borders[ix].Top;
+                case eStyleClass.BorderBottom:
+                    return _styles.Borders[ix].Bottom;
+                case eStyleClass.BorderLeft:
+                    return _styles.Borders[ix].Left;
+                case eStyleClass.BorderRight:
+                    return _styles.Borders[ix].Right;
+                case eStyleClass.BorderDiagonal:
+                    return _styles.Borders[ix].Diagonal;
+                default:
+                    throw new Exception("Invalid class for Borderitem");
+            }
+
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelColor.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelColor.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelColor.cs	(revision 9616)
@@ -0,0 +1,157 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style.XmlAccess;
+using System.Drawing;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// Color for cellstyling
+    /// </summary>
+    public sealed class ExcelColor :  StyleBase
+    {
+        eStyleClass _cls;
+        StyleBase _parent;
+        internal ExcelColor(ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int worksheetID, string address, eStyleClass cls, StyleBase parent) : 
+            base(styles, ChangedEvent, worksheetID, address)
+            
+        {
+            _parent = parent;
+            _cls = cls;
+        }
+        /// <summary>
+        /// The theme color
+        /// </summary>
+        public string Theme
+        {
+            get
+            {
+                return GetSource().Theme;
+            }
+        }
+        /// <summary>
+        /// The tint value
+        /// </summary>
+        public decimal Tint
+        {
+            get
+            {
+                return GetSource().Tint;
+            }
+            set
+            {
+                if (value > 1 || value < -1)
+                {
+                    throw (new ArgumentOutOfRangeException("Value must be between -1 and 1"));
+                }
+                _ChangedEvent(this, new StyleChangeEventArgs(_cls, eStyleProperty.Tint, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// The RGB value
+        /// </summary>
+        public string Rgb
+        {
+            get
+            {
+                return GetSource().Rgb;
+            }
+            internal set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(_cls, eStyleProperty.Color, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// The indexed color number.
+        /// </summary>
+        public int Indexed
+        {
+            get
+            {
+                return GetSource().Indexed;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(_cls, eStyleProperty.IndexedColor, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Set the color of the object
+        /// </summary>
+        /// <param name="color">The color</param>
+        public void SetColor(Color color)
+        {
+            Rgb = color.ToArgb().ToString("X");
+        }
+
+
+        internal override string Id
+        {
+            get 
+            {
+                return Theme + Tint + Rgb + Indexed;
+            }
+        }
+        private ExcelColorXml GetSource()
+        {
+            Index = _parent.Index < 0 ? 0 : _parent.Index;
+            switch(_cls)
+            {
+                case eStyleClass.FillBackgroundColor:
+                    return _styles.Fills[Index].BackgroundColor;
+                case eStyleClass.FillPatternColor:
+                    return _styles.Fills[Index].PatternColor;
+                case eStyleClass.Font:
+                    return _styles.Fonts[Index].Color;
+                case eStyleClass.BorderLeft:
+                    return _styles.Borders[Index].Left.Color;
+                case eStyleClass.BorderTop:
+                    return _styles.Borders[Index].Top.Color;
+                case eStyleClass.BorderRight:
+                    return _styles.Borders[Index].Right.Color;
+                case eStyleClass.BorderBottom:
+                    return _styles.Borders[Index].Bottom.Color;
+                case eStyleClass.BorderDiagonal:
+                    return _styles.Borders[Index].Diagonal.Color;
+                default:
+                    throw(new Exception("Invalid style-class for Color"));
+            }
+        }
+        internal override void SetIndex(int index)
+        {
+            _parent.Index = index;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelFill.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelFill.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelFill.cs	(revision 9616)
@@ -0,0 +1,138 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style.XmlAccess;
+using System.Globalization;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// The background fill of a cell
+    /// </summary>
+    public class ExcelFill : StyleBase
+    {
+        internal ExcelFill(ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int PositionID, string address, int index) :
+            base(styles, ChangedEvent, PositionID, address)
+
+        {
+            Index = index;
+        }
+        /// <summary>
+        /// The pattern for solid fills.
+        /// </summary>
+        public ExcelFillStyle PatternType
+        {
+            get
+            {
+                if (Index == int.MinValue)
+                {
+                    return ExcelFillStyle.None;
+                }
+                else
+                {
+                    return _styles.Fills[Index].PatternType;
+                }
+            }
+            set
+            {
+                if (_gradient != null) _gradient = null;
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Fill, eStyleProperty.PatternType, value, _positionID, _address));
+            }
+        }
+        ExcelColor _patternColor = null;
+        /// <summary>
+        /// The color of the pattern
+        /// </summary>
+        public ExcelColor PatternColor
+        {
+            get
+            {
+                if (_patternColor == null)
+                {
+                    _patternColor = new ExcelColor(_styles, _ChangedEvent, _positionID, _address, eStyleClass.FillPatternColor, this);
+                    if (_gradient != null) _gradient = null;
+                }
+                return _patternColor;
+            }
+        }
+        ExcelColor _backgroundColor = null;
+        /// <summary>
+        /// The background color
+        /// </summary>
+        public ExcelColor BackgroundColor
+        {
+            get
+            {
+                if (_backgroundColor == null)
+                {
+                    _backgroundColor = new ExcelColor(_styles, _ChangedEvent, _positionID, _address, eStyleClass.FillBackgroundColor, this);
+                    if (_gradient != null) _gradient = null;
+                }
+                return _backgroundColor;
+                
+            }
+        }
+        ExcelGradientFill _gradient=null;
+        /// <summary>
+        /// Access to properties for gradient fill.
+        /// </summary>
+        public ExcelGradientFill Gradient 
+        {
+            get
+            {
+                if (_gradient == null)
+                {                    
+                    _gradient = new ExcelGradientFill(_styles, _ChangedEvent, _positionID, _address, Index);
+                    _backgroundColor = null;
+                    _patternColor = null;
+                }
+                return _gradient;
+            }
+        }
+        internal override string Id
+        {
+            get
+            {
+                if (_gradient == null)
+                {
+                    return PatternType + PatternColor.Id + BackgroundColor.Id;
+                }
+                else
+                {
+                    return _gradient.Id;
+                }
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelFont.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelFont.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelFont.cs	(revision 9616)
@@ -0,0 +1,235 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Drawing;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// Cell style Font
+    /// </summary>
+    public sealed class ExcelFont : StyleBase
+    {
+        internal ExcelFont(ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int PositionID, string address, int index) :
+            base(styles, ChangedEvent, PositionID, address)
+
+        {
+            Index = index;
+        }
+        /// <summary>
+        /// The name of the font
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return _styles.Fonts[Index].Name;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.Name, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// The Size of the font
+        /// </summary>
+        public float Size
+        {
+            get
+            {
+                return _styles.Fonts[Index].Size;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.Size, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Font family
+        /// </summary>
+        public int Family
+        {
+            get
+            {
+                return _styles.Fonts[Index].Family;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.Family, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Cell color
+        /// </summary>
+        public ExcelColor Color
+        {
+            get
+            {
+                return new ExcelColor(_styles, _ChangedEvent, _positionID, _address, eStyleClass.Font, this);
+            }
+        }
+        /// <summary>
+        /// Scheme
+        /// </summary>
+        public string Scheme
+        {
+            get
+            {
+                return _styles.Fonts[Index].Scheme;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.Scheme, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Font-bold
+        /// </summary>
+        public bool Bold
+        {
+            get
+            {
+                return _styles.Fonts[Index].Bold;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.Bold, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Font-italic
+        /// </summary>
+        public bool Italic
+        {
+            get
+            {
+                return _styles.Fonts[Index].Italic;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.Italic, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Font-Strikeout
+        /// </summary>
+        public bool Strike
+        {
+            get
+            {
+                return _styles.Fonts[Index].Strike;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.Strike, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Font-Underline
+        /// </summary>
+        public bool UnderLine
+        {
+            get
+            {
+                return _styles.Fonts[Index].UnderLine;
+            }
+            set
+            {
+                if (value)
+                {
+                    UnderLineType = ExcelUnderLineType.Single;
+                }
+                else
+                {
+                    UnderLineType = ExcelUnderLineType.None;
+                }
+                //_ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.UnderlineType, value, _positionID, _address));
+            }
+        }
+        public ExcelUnderLineType UnderLineType
+        {
+            get
+            {
+                return _styles.Fonts[Index].UnderLineType;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.UnderlineType, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Font-Vertical Align
+        /// </summary>
+        public ExcelVerticalAlignmentFont VerticalAlign
+        {
+            get
+            {
+                if (_styles.Fonts[Index].VerticalAlign == "")
+                {
+                    return ExcelVerticalAlignmentFont.None;
+                }
+                else
+                {
+                    return (ExcelVerticalAlignmentFont)Enum.Parse(typeof(ExcelVerticalAlignmentFont), _styles.Fonts[Index].VerticalAlign, true);
+                }
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Font, eStyleProperty.VerticalAlign, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Set the font from a Font object
+        /// </summary>
+        /// <param name="Font"></param>
+        public void SetFromFont(Font Font)
+        {
+            Name = Font.Name;
+            //Family=fnt.FontFamily.;
+            Size = (int)Font.Size;
+            Strike = Font.Strikeout;
+            Bold = Font.Bold;
+            UnderLine = Font.Underline;
+            Italic = Font.Italic;
+        }
+
+        internal override string Id
+        {
+            get 
+            {
+                return Name + Size.ToString() + Family.ToString() + Scheme.ToString() + Bold.ToString()[0] + Italic.ToString()[0] + Strike.ToString()[0] + UnderLine.ToString()[0] + VerticalAlign;
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelGradientFill.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelGradientFill.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelGradientFill.cs	(revision 9616)
@@ -0,0 +1,188 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style.XmlAccess;
+using System.Globalization;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// The background fill of a cell
+    /// </summary>
+    public class ExcelGradientFill : StyleBase
+    {
+        internal ExcelGradientFill(ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int PositionID, string address, int index) :
+            base(styles, ChangedEvent, PositionID, address)
+
+        {
+            Index = index;
+        }
+        /// <summary>
+        /// Angle of the linear gradient
+        /// </summary>
+        public double Degree
+        {
+            get
+            {
+                return ((ExcelGradientFillXml)_styles.Fills[Index]).Degree;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientDegree, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Linear or Path gradient
+        /// </summary>
+        public ExcelFillGradientType Type
+        {
+            get
+            {
+                return ((ExcelGradientFillXml)_styles.Fills[Index]).Type;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientType, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Specifies in percentage format(from the top to the bottom) the position of the top edge of the inner rectangle (color 1). For top, 0 means the top edge of the inner rectangle is on the top edge of the cell, and 1 means it is on the bottom edge of the cell. (applies to From Corner and From Center gradients).
+        /// </summary>
+        public double Top
+        {
+            get
+            {
+                return ((ExcelGradientFillXml)_styles.Fills[Index]).Top;
+            }
+            set
+            {
+                if (value < 0 | value > 1)
+                {
+                    throw (new ArgumentOutOfRangeException("Value must be between 0 and 1"));
+                }
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientTop, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Specifies in percentage format (from the top to the bottom) the position of the bottom edge of the inner rectangle (color 1). For bottom, 0 means the bottom edge of the inner rectangle is on the top edge of the cell, and 1 means it is on the bottom edge of the cell.
+        /// </summary>
+        public double Bottom
+        {
+            get
+            {
+                return ((ExcelGradientFillXml)_styles.Fills[Index]).Bottom;
+            }
+            set
+            {
+                if (value < 0 | value > 1)
+                {
+                    throw (new ArgumentOutOfRangeException("Value must be between 0 and 1"));
+                }
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientBottom, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Specifies in percentage format (from the left to the right) the position of the left edge of the inner rectangle (color 1). For left, 0 means the left edge of the inner rectangle is on the left edge of the cell, and 1 means it is on the right edge of the cell. (applies to From Corner and From Center gradients).
+        /// </summary>
+        public double Left
+        {
+            get
+            {
+                return ((ExcelGradientFillXml)_styles.Fills[Index]).Left;
+            }
+            set
+            {
+                if (value < 0 | value > 1)
+                {
+                    throw (new ArgumentOutOfRangeException("Value must be between 0 and 1"));
+                }
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientLeft, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Specifies in percentage format (from the left to the right) the position of the right edge of the inner rectangle (color 1). For right, 0 means the right edge of the inner rectangle is on the left edge of the cell, and 1 means it is on the right edge of the cell. (applies to From Corner and From Center gradients).
+        /// </summary>
+        public double Right
+        {
+            get
+            {
+                return ((ExcelGradientFillXml)_styles.Fills[Index]).Right;
+            }
+            set
+            {
+                if (value < 0 | value > 1)
+                {
+                    throw (new ArgumentOutOfRangeException("Value must be between 0 and 1"));
+                }
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.GradientFill, eStyleProperty.GradientRight, value, _positionID, _address));
+            }
+        }
+        ExcelColor _gradientColor1 = null;
+        /// <summary>
+        /// Gradient Color 1
+        /// </summary>
+        public ExcelColor Color1
+        {
+            get
+            {
+                if (_gradientColor1 == null)
+                {
+                    _gradientColor1 = new ExcelColor(_styles, _ChangedEvent, _positionID, _address, eStyleClass.FillGradientColor1, this);
+                }
+                return _gradientColor1;
+
+            }
+        }
+        ExcelColor _gradientColor2 = null;
+        /// <summary>
+        /// Gradient Color 2
+        /// </summary>
+        public ExcelColor Color2
+        {
+            get
+            {
+                if (_gradientColor2 == null)
+                {
+                    _gradientColor2 = new ExcelColor(_styles, _ChangedEvent, _positionID, _address, eStyleClass.FillGradientColor2, this);
+                }
+                return _gradientColor2;
+
+            }
+        }
+        internal override string Id
+        {
+            get { return Degree.ToString() + Type + Color1.Id + Color2.Id + Top.ToString() + Bottom.ToString() + Left.ToString() + Right.ToString(); }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelNumberFormat.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelNumberFormat.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelNumberFormat.cs	(revision 9616)
@@ -0,0 +1,227 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Globalization;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// The numberformat of the cell
+    /// </summary>
+    public sealed class ExcelNumberFormat : StyleBase
+    {
+        internal ExcelNumberFormat(ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int PositionID, string Address, int index) :
+            base(styles, ChangedEvent, PositionID, Address)
+        {
+            Index = index;
+        }
+        /// <summary>
+        /// The numeric index fror the format
+        /// </summary>
+        public int NumFmtID 
+        {
+            get
+            {
+                return Index;
+            }
+            //set
+            //{
+            //    _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Numberformat, "NumFmtID", value, _workSheetID, _address));
+            //}
+        }
+        /// <summary>
+        /// The numberformat 
+        /// </summary>
+        public string Format
+        {
+            get
+            {
+                for(int i=0;i<_styles.NumberFormats.Count;i++)
+                {
+                    if(Index==_styles.NumberFormats[i].NumFmtId)
+                    {
+                        return _styles.NumberFormats[i].Format;
+                    }
+                }
+                return "general";
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Numberformat, eStyleProperty.Format, value, _positionID, _address));
+            }
+        }
+
+        internal override string Id
+        {
+            get 
+            {
+                return Format;
+            }
+        }
+        /// <summary>
+        /// If the numeric format is a build-in from.
+        /// </summary>
+        public bool BuildIn { get; private set; }
+
+        internal static string GetFromBuildInFromID(int _numFmtId)
+        {
+            switch (_numFmtId)
+            {
+                case 0:
+                    return "General";
+                case 1:
+                    return "0";
+                case 2:
+                    return "0.00";
+                case 3:
+                    return "#,##0";
+                case 4:
+                    return "#,##0.00";
+                case 9:
+                    return "0%";
+                case 10:
+                    return "0.00%";
+                case 11:
+                    return "0.00E+00";
+                case 12:
+                    return "# ?/?";
+                case 13:
+                    return "# ??/??";
+                case 14:
+                    return "mm-dd-yy";
+                case 15:
+                    return "d-mmm-yy";
+                case 16:
+                    return "d-mmm";
+                case 17:
+                    return "mmm-yy";
+                case 18:
+                    return "h:mm AM/PM";
+                case 19:
+                    return "h:mm:ss AM/PM";
+                case 20:
+                    return "h:mm";
+                case 21:
+                    return "h:mm:ss";
+                case 22:
+                    return "m/d/yy h:mm";
+                case 37:
+                    return "#,##0 ;(#,##0)";
+                case 38:
+                    return "#,##0 ;[Red](#,##0)";
+                case 39:
+                    return "#,##0.00;(#,##0.00)";
+                case 40:
+                    return "#,##0.00;[Red](#,#)";
+                case 45:
+                    return "mm:ss";
+                case 46:
+                    return "[h]:mm:ss";
+                case 47:
+                    return "mmss.0";
+                case 48:
+                    return "##0.0";
+                case 49:
+                    return "@";
+                default:
+                    return string.Empty;
+            }
+        }
+        internal static int GetFromBuildIdFromFormat(string format)
+        {
+            switch (format)
+            {
+                case "General":
+                    return 0;
+                case "0":
+                    return 1;
+                case "0.00":
+                    return 2;
+                case "#,##0":
+                    return 3;
+                case "#,##0.00":
+                    return 4;
+                case "0%":
+                    return 9;
+                case "0.00%":
+                    return 10;
+                case "0.00E+00":
+                    return 11;
+                case "# ?/?":
+                    return 12;
+                case "# ??/??":
+                    return 13;
+                case "mm-dd-yy":
+                    return 14;
+                case "d-mmm-yy":
+                    return 15;
+                case "d-mmm":
+                    return 16;
+                case "mmm-yy":
+                    return 17;
+                case "h:mm AM/PM":
+                    return 18;
+                case "h:mm:ss AM/PM":
+                    return 19;
+                case "h:mm":
+                    return 20;
+                case "h:mm:ss":
+                    return 21;
+                case "m/d/yy h:mm":
+                    return 22;
+                case "#,##0 ;(#,##0)":
+                    return 37;
+                case "#,##0 ;[Red](#,##0)":
+                    return 38;
+                case "#,##0.00;(#,##0.00)":
+                    return 39;
+                case "#,##0.00;[Red](#,#)":
+                    return 40;
+                case "mm:ss":
+                    return 45;
+                case "[h]:mm:ss":
+                    return 46;
+                case "mmss.0":
+                    return 47;
+                case "##0.0":
+                    return 48;
+                case "@":
+                    return 49;
+                default:
+                    return int.MinValue;
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelParagraph.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelParagraph.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelParagraph.cs	(revision 9616)
@@ -0,0 +1,67 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// Handels paragraph text
+    /// </summary>
+    public sealed class ExcelParagraph : ExcelTextFont
+    {
+        public ExcelParagraph(XmlNamespaceManager ns, XmlNode rootNode, string path, string[] schemaNodeOrder) : 
+            base(ns, rootNode, path + "a:rPr", schemaNodeOrder)
+        { 
+
+        }
+        const string TextPath = "../a:t";
+        /// <summary>
+        /// Text
+        /// </summary>
+        public string Text
+        {
+            get
+            {
+                return GetXmlNodeString(TextPath);
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(TextPath, value);
+            }
+
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelParagraphCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelParagraphCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelParagraphCollection.cs	(revision 9616)
@@ -0,0 +1,176 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Drawing;
+using System.Drawing;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// A collection of Paragraph objects
+    /// </summary>
+    public class ExcelParagraphCollection : XmlHelper, IEnumerable<ExcelParagraph>
+    {
+        List<ExcelParagraph> _list = new List<ExcelParagraph>();
+        string _path;
+        internal ExcelParagraphCollection(XmlNamespaceManager ns, XmlNode topNode, string path, string[] schemaNodeOrder) :
+            base(ns, topNode)
+        {
+            var nl = topNode.SelectNodes(path + "/a:r", NameSpaceManager);
+            SchemaNodeOrder = schemaNodeOrder;
+            if (nl != null)
+            {
+                foreach (XmlNode n in nl)
+                {
+                    _list.Add(new ExcelParagraph(ns, n, "",schemaNodeOrder));
+                }
+            }
+            _path = path;
+        }
+        public ExcelParagraph this[int Index]
+        {
+            get
+            {
+                return _list[Index];
+            }
+        }
+        public int Count
+        {
+            get
+            {
+                return _list.Count;
+            }
+        }
+        /// <summary>
+        /// Add a rich text string
+        /// </summary>
+        /// <param name="Text">The text to add</param>
+        /// <returns></returns>
+        public ExcelParagraph Add(string Text)
+        {
+            XmlDocument doc;
+            if (TopNode is XmlDocument)
+            {
+                doc = TopNode as XmlDocument;
+            }
+            else
+            {
+                doc = TopNode.OwnerDocument;
+            }
+            XmlNode parentNode=TopNode.SelectSingleNode(_path, NameSpaceManager);
+            if (parentNode == null)
+            {
+                CreateNode(_path);
+            }
+            
+            var node = doc.CreateElement("a", "r", ExcelPackage.schemaDrawings);
+            parentNode.AppendChild(node);
+            var childNode = doc.CreateElement("a", "rPr", ExcelPackage.schemaDrawings);
+            node.AppendChild(childNode);
+            var rt = new ExcelParagraph(NameSpaceManager, node, "", SchemaNodeOrder);
+            rt.ComplexFont = "Calibri";
+            rt.LatinFont = "Calibri"; 
+            rt.Size = 11;
+
+            rt.Text = Text;
+            _list.Add(rt);
+            return rt;
+        }
+        public void Clear()
+        {
+            _list.Clear();
+            TopNode.RemoveAll();
+        }
+        public void RemoveAt(int Index)
+        {
+            var node = _list[Index].TopNode;
+            while (node != null && node.Name != "a:r")
+            {
+                node = node.ParentNode;
+            }
+            node.ParentNode.RemoveChild(node);
+            _list.RemoveAt(Index);
+        }
+        public void Remove(ExcelRichText Item)
+        {
+            TopNode.RemoveChild(Item.TopNode);
+        }
+        public string Text
+        {
+            get
+            {
+                StringBuilder sb = new StringBuilder();
+                foreach (var item in _list)
+                {
+                    sb.Append(item.Text);
+                }
+                return sb.ToString();
+            }
+            set
+            {
+                if (Count == 0)
+                {
+                    Add(value);
+                }
+                else
+                {
+                    this[0].Text = value;
+                    int count = Count;
+                    for (int ix = Count-1; ix > 0; ix--)
+                    {
+                        RemoveAt(ix);
+                    }
+                }
+            }
+        }
+        #region IEnumerable<ExcelRichText> Members
+
+        IEnumerator<ExcelParagraph> IEnumerable<ExcelParagraph>.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        #endregion
+
+        #region IEnumerable Members
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelRichText.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelRichText.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelRichText.cs	(revision 9616)
@@ -0,0 +1,293 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Drawing;
+using System.Globalization;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// A richtext part
+    /// </summary>
+    public class ExcelRichText : XmlHelper
+    {
+        internal ExcelRichText(XmlNamespaceManager ns, XmlNode topNode) :
+            base(ns, topNode)
+        {
+            SchemaNodeOrder=new string[] {"rPr", "t", "b", "i","strike", "u", "vertAlign" , "sz", "color", "rFont", "family", "scheme", "charset"};
+            PreserveSpace = false;
+        }
+        internal delegate void CallbackDelegate();
+        CallbackDelegate _callback;
+        internal void SetCallback(CallbackDelegate callback)
+        {
+            _callback=callback;
+        }
+        const string TEXT_PATH="d:t";
+        /// <summary>
+        /// The text
+        /// </summary>
+        public string Text 
+        { 
+
+            get
+            {
+                return GetXmlNodeString(TEXT_PATH);
+            }
+            set
+            {
+                SetXmlNodeString(TEXT_PATH, value);
+                if (PreserveSpace)
+                {
+                    XmlElement elem = TopNode.SelectSingleNode(TEXT_PATH, NameSpaceManager) as XmlElement;
+                    elem.SetAttribute("xml:space", "preserve");
+                }
+                if (_callback != null) _callback();
+            }
+        }
+        bool _preserveSpace=false;
+        /// <summary>
+        /// Preserves whitespace. Default true
+        /// </summary>
+        public bool PreserveSpace
+        {
+            get
+            {
+                XmlElement elem = TopNode.SelectSingleNode(TEXT_PATH, NameSpaceManager) as XmlElement;
+                if (elem != null)
+                {
+                    return elem.GetAttribute("xml:space")=="preserve";
+                }
+                return _preserveSpace;
+            }
+            set
+            {
+                XmlElement elem = TopNode.SelectSingleNode(TEXT_PATH, NameSpaceManager) as XmlElement;
+                if (elem != null)
+                {
+                    if (value)
+                    {
+                        elem.SetAttribute("xml:space", "preserve");
+                    }
+                    else
+                    {
+                        elem.RemoveAttribute("xml:space");
+                    }
+                }
+                _preserveSpace = false;
+            }
+        }
+        const string BOLD_PATH = "d:rPr/d:b";
+        /// <summary>
+        /// Bold text
+        /// </summary>
+        public bool Bold
+        {
+            get
+            {
+                return ExistNode(BOLD_PATH);
+            }
+            set
+            {
+                if (value)
+                {
+                    CreateNode(BOLD_PATH);
+                }
+                else
+                {
+                    DeleteNode(BOLD_PATH);
+                }
+                if(_callback!=null) _callback();
+            }
+        }
+        const string ITALIC_PATH = "d:rPr/d:i";
+        /// <summary>
+        /// Italic text
+        /// </summary>
+        public bool Italic
+        {
+            get
+            {
+                //return GetXmlNodeBool(ITALIC_PATH, false);
+                return ExistNode(ITALIC_PATH);
+            }
+            set
+            {
+                if (value)
+                {
+                    CreateNode(ITALIC_PATH);
+                }
+                else
+                {
+                    DeleteNode(ITALIC_PATH);
+                }
+                if (_callback != null) _callback();
+            }
+        }
+        const string STRIKE_PATH = "d:rPr/d:strike";
+        /// <summary>
+        /// Strike-out text
+        /// </summary>
+        public bool Strike
+        {
+            get
+            {
+                return ExistNode(STRIKE_PATH);
+            }
+            set
+            {
+                if (value)
+                {
+                    CreateNode(STRIKE_PATH);
+                }
+                else
+                {
+                    DeleteNode(STRIKE_PATH);
+                }
+                if (_callback != null) _callback();
+            }
+        }
+        const string UNDERLINE_PATH = "d:rPr/d:u";
+        /// <summary>
+        /// Underlined text
+        /// </summary>
+        public bool UnderLine
+        {
+            get
+            {
+                return ExistNode(UNDERLINE_PATH);
+            }
+            set
+            {
+                if (value)
+                {
+                    CreateNode(UNDERLINE_PATH);
+                }
+                else
+                {
+                    DeleteNode(UNDERLINE_PATH);
+                }
+                if (_callback != null) _callback();
+            }
+        }
+
+        const string VERT_ALIGN_PATH = "d:rPr/d:vertAlign/@val";
+        /// <summary>
+        /// Vertical Alignment
+        /// </summary>
+        public ExcelVerticalAlignmentFont VerticalAlign
+        {
+            get
+            {
+                string v=GetXmlNodeString(VERT_ALIGN_PATH);
+                if(v=="")
+                {
+                    return ExcelVerticalAlignmentFont.None;
+                }
+                else
+                {
+                    try
+                    {
+                        return (ExcelVerticalAlignmentFont)Enum.Parse(typeof(ExcelVerticalAlignmentFont), v, true);
+                    }
+                    catch
+                    {
+                        return ExcelVerticalAlignmentFont.None;
+                    }
+                }
+            }
+            set
+            {
+                SetXmlNodeString(VERT_ALIGN_PATH,((ExcelVerticalAlignmentFont)value) == ExcelVerticalAlignmentFont.None ? "" : value.ToString().ToLower());
+            }
+        }
+        const string SIZE_PATH = "d:rPr/d:sz/@val";
+        /// <summary>
+        /// Font size
+        /// </summary>
+        public float Size
+        {
+            get
+            {
+                return Convert.ToSingle(GetXmlNodeDecimal(SIZE_PATH));
+            }
+            set
+            {
+                SetXmlNodeString(SIZE_PATH, value.ToString(CultureInfo.InvariantCulture));
+                if (_callback != null) _callback();
+            }
+        }
+        const string FONT_PATH = "d:rPr/d:rFont/@val";
+        /// <summary>
+        /// Name of the font
+        /// </summary>
+        public string FontName
+        {
+            get
+            {
+                return GetXmlNodeString(FONT_PATH);
+            }
+            set
+            {
+                SetXmlNodeString(FONT_PATH, value);
+                if (_callback != null) _callback();
+            }
+        }
+        const string COLOR_PATH = "d:rPr/d:color/@rgb";
+        /// <summary>
+        /// Text color
+        /// </summary>
+        public Color Color
+        {
+            get
+            {
+                string col = GetXmlNodeString(COLOR_PATH);
+                if (col == "")
+                {
+                    return Color.Empty;
+                }
+                else
+                {
+                    return Color.FromArgb(int.Parse(col, System.Globalization.NumberStyles.AllowHexSpecifier));
+                }
+            }
+            set
+            {
+                SetXmlNodeString(COLOR_PATH, value.ToArgb().ToString("X")/*.Substring(2, 6)*/);
+                if (_callback != null) _callback();
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelRichTextCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelRichTextCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelRichTextCollection.cs	(revision 9616)
@@ -0,0 +1,235 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Drawing;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// Collection of Richtext objects
+    /// </summary>
+    public class ExcelRichTextCollection : XmlHelper, IEnumerable<ExcelRichText>
+    {
+        List<ExcelRichText> _list = new List<ExcelRichText>();
+        ExcelRangeBase _cells=null;
+        internal ExcelRichTextCollection(XmlNamespaceManager ns, XmlNode topNode) :
+            base(ns, topNode)
+        {
+            var nl = topNode.SelectNodes("d:r", NameSpaceManager);
+            if (nl != null)
+            {
+                foreach (XmlNode n in nl)
+                {
+                    _list.Add(new ExcelRichText(ns, n));
+                }
+            }
+        }
+        internal ExcelRichTextCollection(XmlNamespaceManager ns, XmlNode topNode, ExcelRangeBase cells) :
+            this(ns, topNode)
+        {
+            _cells = cells;
+        }        
+        /// <summary>
+        /// Collection containing the richtext objects
+        /// </summary>
+        /// <param name="Index"></param>
+        /// <returns></returns>
+        public ExcelRichText this[int Index]
+        {
+            get
+            {
+                var item=_list[Index];
+                if(_cells!=null) item.SetCallback(UpdateCells);
+                return item;
+            }
+        }
+        /// <summary>
+        /// Items in the list
+        /// </summary>
+        public int Count
+        {
+            get
+            {
+                return _list.Count;
+            }
+        }
+        /// <summary>
+        /// Add a rich text string
+        /// </summary>
+        /// <param name="Text">The text to add</param>
+        /// <returns></returns>
+        public ExcelRichText Add(string Text)
+        {
+            XmlDocument doc;
+            if (TopNode is XmlDocument)
+            {
+                doc = TopNode as XmlDocument;
+            }
+            else
+            {
+                doc = TopNode.OwnerDocument;
+            }
+            var node = doc.CreateElement("d", "r", ExcelPackage.schemaMain);
+            TopNode.AppendChild(node);
+            var rt = new ExcelRichText(NameSpaceManager, node);
+            if (_list.Count > 0)
+            {
+                ExcelRichText prevItem = _list[_list.Count - 1];
+                rt.FontName = prevItem.FontName;
+                rt.Size = prevItem.Size;
+                if (prevItem.Color.IsEmpty)
+                {
+                    rt.Color = Color.Black;
+                }
+                else
+                {
+                    rt.Color = prevItem.Color;
+                }
+                rt.PreserveSpace = rt.PreserveSpace;
+                rt.Bold = prevItem.Bold;
+                rt.Italic = prevItem.Italic;                
+                rt.UnderLine = prevItem.UnderLine;
+            }
+            else if (_cells == null)
+            {
+                rt.FontName = "Calibri";
+                rt.Size = 11;
+            }
+            else
+            {
+                var style = _cells.Offset(0, 0).Style;
+                rt.FontName = style.Font.Name;
+                rt.Size = style.Font.Size;
+                rt.Bold = style.Font.Bold;
+                rt.Italic = style.Font.Italic;
+                _cells.IsRichText = true;
+            }
+            rt.Text = Text;
+            rt.PreserveSpace = true;
+            if(_cells!=null) 
+            {
+                rt.SetCallback(UpdateCells);
+                UpdateCells();
+            }
+            _list.Add(rt);
+            return rt;
+        }
+        internal void UpdateCells()
+        {
+            _cells.SetValueRichText(TopNode.InnerXml);
+        }
+        /// <summary>
+        /// Clear the collection
+        /// </summary>
+        public void Clear()
+        {
+            _list.Clear();
+            TopNode.RemoveAll();
+            if (_cells != null) _cells.IsRichText = false;
+        }
+        /// <summary>
+        /// Removes an item at the specific index
+        /// </summary>
+        /// <param name="Index"></param>
+        public void RemoveAt(int Index)
+        {
+            TopNode.RemoveChild(_list[Index].TopNode);
+            _list.RemoveAt(Index);
+            if (_cells != null && _list.Count==0) _cells.IsRichText = false;
+        }
+        /// <summary>
+        /// Removes an item
+        /// </summary>
+        /// <param name="Item"></param>
+        public void Remove(ExcelRichText Item)
+        {
+            TopNode.RemoveChild(Item.TopNode);
+            _list.Remove(Item);
+            if (_cells != null && _list.Count == 0) _cells.IsRichText = false;
+        }
+        //public void Insert(int index, string Text)
+        //{
+        //    _list.Insert(index, item);
+        //}
+        
+        /// <summary>
+        /// The text
+        /// </summary>
+        public string Text
+        {
+            get
+            {
+                StringBuilder sb=new StringBuilder();
+                foreach (var item in _list)
+                {
+                    sb.Append(item.Text);
+                }
+                return sb.ToString();
+            }
+            set
+            {
+                if (Count == 0)
+                {
+                    Add(value);
+                }
+                else
+                {
+                    this[0].Text = value;
+                    for (int ix = 1; ix < Count; ix++)
+                    {
+                        RemoveAt(ix);
+                    }
+                }
+            }
+        }
+        #region IEnumerable<ExcelRichText> Members
+
+        IEnumerator<ExcelRichText> IEnumerable<ExcelRichText>.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        #endregion
+
+        #region IEnumerable Members
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelStyle.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelStyle.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelStyle.cs	(revision 9616)
@@ -0,0 +1,252 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style.XmlAccess;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// Toplevel class for cell styling
+    /// </summary>
+    public sealed class ExcelStyle : StyleBase
+    {
+        internal ExcelStyle(ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int positionID, string Address, int xfsId) :
+            base(styles, ChangedEvent, positionID, Address)
+        {
+            Index = xfsId;
+            ExcelXfs xfs;
+            if (positionID > -1)
+            {
+                xfs = _styles.CellXfs[xfsId];
+            }
+            else
+            {
+                xfs = _styles.CellStyleXfs[xfsId];
+            }
+            Styles = styles;
+            PositionID = positionID;
+            Numberformat = new ExcelNumberFormat(styles, ChangedEvent, PositionID, Address, xfs.NumberFormatId);
+            Font = new ExcelFont(styles, ChangedEvent, PositionID, Address, xfs.FontId);
+            Fill = new ExcelFill(styles, ChangedEvent, PositionID, Address, xfs.FillId);
+            Border = new Border(styles, ChangedEvent, PositionID, Address, xfs.BorderId); 
+        }
+        /// <summary>
+        /// Numberformat
+        /// </summary>
+        public ExcelNumberFormat Numberformat { get; set; }
+        /// <summary>
+        /// Font styling
+        /// </summary>
+        public ExcelFont Font { get; set; }
+        /// <summary>
+        /// Fill Styling
+        /// </summary>
+        public ExcelFill Fill { get; set; }
+        /// <summary>
+        /// Border 
+        /// </summary>
+        public Border Border { get; set; }
+        /// <summary>
+        /// The horizontal alignment in the cell
+        /// </summary>
+        public ExcelHorizontalAlignment HorizontalAlignment
+        {
+            get
+            {
+                return _styles.CellXfs[Index].HorizontalAlignment;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.HorizontalAlign, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// The vertical alignment in the cell
+        /// </summary>
+        public ExcelVerticalAlignment VerticalAlignment
+        {
+            get
+            {
+                return _styles.CellXfs[Index].VerticalAlignment;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.VerticalAlign, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Wrap the text
+        /// </summary>
+        public bool WrapText
+        {
+            get
+            {
+                return _styles.CellXfs[Index].WrapText;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.WrapText, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Readingorder
+        /// </summary>
+        public ExcelReadingOrder ReadingOrder
+        {
+            get
+            {
+                return _styles.CellXfs[Index].ReadingOrder;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.ReadingOrder, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Shrink the text to fit
+        /// </summary>
+        public bool ShrinkToFit
+        {
+            get
+            {
+                return _styles.CellXfs[Index].ShrinkToFit;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.ShrinkToFit, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// The margin between the border and the text
+        /// </summary>
+        public int Indent
+        {
+            get
+            {
+                return _styles.CellXfs[Index].Indent;
+            }
+            set
+            {
+                if (value <0 || value > 250)
+                {
+                    throw(new ArgumentOutOfRangeException("Indent must be between 0 and 250"));
+                }
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.Indent, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// Text orientation in degrees. Values range from 0 to 180.
+        /// </summary>
+        public int TextRotation
+        {
+            get
+            {
+                return _styles.CellXfs[Index].TextRotation;
+            }
+            set
+            {
+                if (value < 0 || value > 180)
+                {
+                    throw new ArgumentOutOfRangeException("TextRotation out of range.");
+                }
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.TextRotation, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// If true the cell is locked for editing when the sheet is protected
+        /// <seealso cref="ExcelWorksheet.Protection"/>
+        /// </summary>
+        public bool Locked
+        {
+            get
+            {
+                return _styles.CellXfs[Index].Locked;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.Locked, value, _positionID, _address));
+            }
+        }
+        /// <summary>
+        /// If true the formula is hidden when the sheet is protected.
+        /// <seealso cref="ExcelWorksheet.Protection"/>
+        /// </summary>
+        public bool Hidden
+        {
+            get
+            {
+                return _styles.CellXfs[Index].Hidden;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.Hidden, value, _positionID, _address));
+            }
+        }
+
+
+        const string xfIdPath = "@xfId";
+        /// <summary>
+        /// The index in the style collection
+        /// </summary>
+        public int XfId 
+        {
+            get
+            {
+                return _styles.CellXfs[Index].XfId;
+            }
+            set
+            {
+                _ChangedEvent(this, new StyleChangeEventArgs(eStyleClass.Style, eStyleProperty.XfId, value, _positionID, _address));
+            }
+        }
+        internal int PositionID
+        {
+            get;
+            set;
+        }
+        internal ExcelStyles Styles
+        {
+            get;
+            set;
+        }
+        internal override string Id
+        {
+            get 
+            { 
+                return Numberformat.Id + "|" + Font.Id + "|" + Fill.Id + "|" + Border.Id + "|" + VerticalAlignment + "|" + HorizontalAlignment + "|" + WrapText.ToString() + "|" + ReadingOrder.ToString() + "|" + XfId.ToString(); 
+            }
+        }
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelTextFont.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelTextFont.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/ExcelTextFont.cs	(revision 9616)
@@ -0,0 +1,306 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Drawing;
+using System.Drawing;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// Linestyle
+    /// </summary>
+    public enum eUnderLineType
+    {
+        Dash,
+        DashHeavy,
+        DashLong, 
+        DashLongHeavy,
+        Double,
+        DotDash,
+        DotDashHeavy,
+        DotDotDash,
+        DotDotDashHeavy,
+        Dotted,
+        DottedHeavy,
+        Heavy,
+        None,
+        Single,
+        Wavy,
+        WavyDbl,
+        WavyHeavy,
+        Words
+    }
+    /// <summary>
+    /// Type of font strike
+    /// </summary>
+    public enum eStrikeType
+    {
+        Double,
+        No,
+        Single
+    }
+    /// <summary>
+    /// Used by Rich-text and Paragraphs.
+    /// </summary>
+    public class ExcelTextFont : XmlHelper
+    {
+        string _path;
+        XmlNode _rootNode;
+        internal ExcelTextFont(XmlNamespaceManager namespaceManager, XmlNode rootNode, string path, string[] schemaNodeOrder)
+            : base(namespaceManager, rootNode)
+        {
+            SchemaNodeOrder = schemaNodeOrder;
+            _rootNode = rootNode;
+            if (path != "")
+            {
+                XmlNode node = rootNode.SelectSingleNode(path, namespaceManager);
+                if (node != null)
+                {
+                    TopNode = node;
+                }
+            }
+            _path = path;
+        }
+        string _fontLatinPath = "a:latin/@typeface";
+        public string LatinFont
+        {
+            get
+            {
+                return GetXmlNodeString(_fontLatinPath);
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(_fontLatinPath, value);
+            }
+        }
+
+        protected internal void CreateTopNode()
+        {
+            if (_path!="" && TopNode == _rootNode)
+            {
+                CreateNode(_path);
+                TopNode = _rootNode.SelectSingleNode(_path, NameSpaceManager);
+            }
+        }
+        string _fontCsPath = "a:cs/@typeface";
+        public string ComplexFont
+        {
+            get
+            {
+                return GetXmlNodeString(_fontCsPath);
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(_fontCsPath, value);
+            }
+        }
+        string _boldPath = "@b";
+        public bool Bold
+        {
+            get
+            {
+                return GetXmlNodeBool(_boldPath);
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(_boldPath, value ? "1" : "0");
+            }
+        }
+        string _underLinePath = "@u";
+        public eUnderLineType UnderLine
+        {
+            get
+            {
+                return TranslateUnderline(GetXmlNodeString(_underLinePath));
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(_underLinePath, TranslateUnderlineText(value));
+            }
+        }
+        string _underLineColorPath = "a:uFill/a:solidFill/a:srgbClr/@val";
+        public Color UnderLineColor
+        {
+            get
+            {
+                string col = GetXmlNodeString(_underLineColorPath);
+                if (col == "")
+                {
+                    return Color.Empty;
+                }
+                else
+                {
+                    return Color.FromArgb(int.Parse(col, System.Globalization.NumberStyles.AllowHexSpecifier));
+                }
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(_underLineColorPath, value.ToArgb().ToString("X").Substring(2, 6));
+            }
+        }
+        string _italicPath = "@i";
+        public bool Italic
+        {
+            get
+            {
+                return GetXmlNodeBool(_italicPath);
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(_italicPath, value ? "1" : "0");
+            }
+        }
+        string _strikePath = "@strike";
+        public eStrikeType Strike
+        {
+            get
+            {
+                return TranslateStrike(GetXmlNodeString(_strikePath));
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(_strikePath, TranslateStrikeText(value));
+            }
+        }
+        string _sizePath = "@sz";
+        public float Size
+        {
+            get
+            {
+                return GetXmlNodeInt(_sizePath) / 100;
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(_sizePath, ((int)(value * 100)).ToString());
+            }
+        }
+        string _colorPath = "a:solidFill/a:srgbClr/@val";
+        public Color Color
+        {
+            get
+            {
+                string col = GetXmlNodeString(_colorPath);
+                if (col == "")
+                {
+                    return Color.Empty;
+                }
+                else
+                {
+                    return Color.FromArgb(int.Parse(col, System.Globalization.NumberStyles.AllowHexSpecifier));
+                }
+            }
+            set
+            {
+                CreateTopNode();
+                SetXmlNodeString(_colorPath, value.ToArgb().ToString("X").Substring(2, 6));
+            }
+        }
+        #region "Translate methods"
+        private eUnderLineType TranslateUnderline(string text)
+        {
+            switch (text)
+            {
+                case "sng":
+                    return eUnderLineType.Single;
+                case "dbl":
+                    return eUnderLineType.Double;
+                case "":
+                    return eUnderLineType.None;
+                default:
+                    return (eUnderLineType)Enum.Parse(typeof(eUnderLineType), text);
+            }
+        }
+        private string TranslateUnderlineText(eUnderLineType value)
+        {
+            switch (value)
+            {
+                case eUnderLineType.Single:
+                    return "sng";
+                case eUnderLineType.Double:
+                    return "dbl";
+                default:
+                    string ret = value.ToString();
+                    return ret.Substring(0, 1).ToLower() + ret.Substring(1, ret.Length - 1);
+            }
+        }
+        private eStrikeType TranslateStrike(string text)
+        {
+            switch (text)
+            {
+                case "dblStrike":
+                    return eStrikeType.Double;
+                case "sngStrike":
+                    return eStrikeType.Single;
+                default:
+                    return eStrikeType.No;
+            }
+        }
+        private string TranslateStrikeText(eStrikeType value)
+        {
+            switch (value)
+            {
+                case eStrikeType.Single:
+                    return "sngStrike";
+                case eStrikeType.Double:
+                    return "dblStrike";
+                default:
+                    return "noStrike";
+            }
+        }
+        #endregion
+        /// <summary>
+        /// Set the font style from a font object
+        /// </summary>
+        /// <param name="Font"></param>
+        public void SetFromFont(Font Font)
+        {
+            LatinFont = Font.Name;
+            ComplexFont = Font.Name;
+            Size = Font.Size;
+            if (Font.Bold) Bold = Font.Bold;
+            if (Font.Italic) Italic = Font.Italic;
+            if (Font.Underline) UnderLine = eUnderLineType.Single;
+            if (Font.Strikeout) Strike = eStrikeType.Single;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/IStyle.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/IStyle.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/IStyle.cs	(revision 9616)
@@ -0,0 +1,44 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using OfficeOpenXml.Style;
+namespace OfficeOpenXml.Style
+{
+    internal interface IStyle
+    {
+        void SetNewStyleID(string value);
+        ulong Id {get;}
+        ExcelStyle ExcelStyle{get;}
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/StyleBase.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/StyleBase.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/StyleBase.cs	(revision 9616)
@@ -0,0 +1,184 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OfficeOpenXml.Style
+{
+    /// <summary>
+    /// Border line style
+    /// </summary>
+    public enum ExcelBorderStyle
+    {
+        None,
+        Hair,
+        Dotted,
+        DashDot,
+        Thin,
+        DashDotDot,
+        Dashed,
+        MediumDashDotDot,
+        MediumDashed,
+        MediumDashDot,
+        Thick,
+        Medium,
+        Double
+    };
+    /// <summary>
+    /// Horizontal text alignment
+    /// </summary>
+    public enum ExcelHorizontalAlignment
+    {
+        General,
+        Left,
+        Center,
+        CenterContinuous,
+        Right,
+        Fill,
+        Distributed,
+        Justify
+    }
+    /// <summary>
+    /// Vertical text alignment
+    /// </summary>
+    public enum ExcelVerticalAlignment
+    {
+        Top,
+        Center,
+        Bottom,
+        Distributed,
+        Justify
+    }
+    /// <summary>
+    /// Font-Vertical Align
+    /// </summary>
+    public enum ExcelVerticalAlignmentFont
+    {
+        None,
+        Subscript,
+        Superscript
+    }
+    /// <summary>
+    /// Font-Underlinestyle for 
+    /// </summary>
+    public enum ExcelUnderLineType
+    {
+        None,
+        Single,
+        Double,
+        SingleAccounting,
+        DoubleAccounting
+    }
+    /// <summary>
+    /// Fill pattern
+    /// </summary>
+    public enum ExcelFillStyle
+    {
+        None,
+        Solid,
+        DarkGray,
+        MediumGray,
+        LightGray,
+        Gray125,
+        Gray0625,
+        DarkVertical,
+        DarkHorizontal,
+        DarkDown,
+        DarkUp,
+        DarkGrid,
+        DarkTrellis,
+        LightVertical,
+        LightHorizontal,
+        LightDown,
+        LightUp,
+        LightGrid,
+        LightTrellis
+    }
+    /// <summary>
+    /// Type of gradient fill
+    /// </summary>
+    public enum ExcelFillGradientType
+    {
+        /// <summary>
+        /// No gradient fill. 
+        /// </summary>
+        None,
+        /// <summary>
+        /// This gradient fill is of linear gradient type. Linear gradient type means that the transition from one color to the next is along a line (e.g., horizontal, vertical,diagonal, etc.)
+        /// </summary>
+        Linear,
+        /// <summary>
+        /// This gradient fill is of path gradient type. Path gradient type means the that the boundary of transition from one color to the next is a rectangle, defined by top,bottom, left, and right attributes on the gradientFill element.
+        /// </summary>
+        Path
+    }
+    /// <summary>
+    /// The reading order
+    /// </summary>
+    public enum ExcelReadingOrder
+    {
+        /// <summary>
+        /// Reading order is determined by scanning the text for the first non-whitespace character: if it is a strong right-to-left character, the reading order is right-to-left; otherwise, the reading order left-to-right.
+        /// </summary>
+        ContextDependent=0,
+        /// <summary>
+        /// Left to Right
+        /// </summary>
+        LeftToRight=1,
+        /// <summary>
+        /// Right to Left
+        /// </summary>
+        RightToLeft=2
+    }
+    public abstract class StyleBase
+    {
+        protected ExcelStyles _styles;
+        internal OfficeOpenXml.XmlHelper.ChangedEventHandler _ChangedEvent;
+        protected int _positionID;
+        protected string _address;
+        internal StyleBase(ExcelStyles styles, OfficeOpenXml.XmlHelper.ChangedEventHandler ChangedEvent, int PositionID, string Address)
+        {
+            _styles = styles;
+            _ChangedEvent = ChangedEvent;
+            _address = Address;
+            _positionID = PositionID;
+        }
+        internal int Index { get; set;}
+        internal abstract string Id {get;}
+
+        internal virtual void SetIndex(int index)
+        {
+            Index = index;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/StyleChangeEventArgs.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/StyleChangeEventArgs.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/StyleChangeEventArgs.cs	(revision 9616)
@@ -0,0 +1,113 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+namespace OfficeOpenXml.Style
+{
+    internal enum eStyleClass
+    {
+        Numberformat,
+        Font,    
+        Border,
+        BorderTop,
+        BorderLeft,
+        BorderBottom,
+        BorderRight,
+        BorderDiagonal,
+        Fill,
+        GradientFill,
+        FillBackgroundColor,
+        FillPatternColor,
+        FillGradientColor1,
+        FillGradientColor2,
+        NamedStyle,
+        Style
+    };
+    internal enum eStyleProperty
+    {
+        Format,
+        Name,
+        Size,
+        Bold,
+        Italic,
+        Strike,
+        Color,
+        Tint,
+        IndexedColor,
+        AutoColor,
+        GradientColor,
+        Family,
+        Scheme,
+        UnderlineType,
+        HorizontalAlign,
+        VerticalAlign,
+        Border,
+        NamedStyle,
+        Style,
+        PatternType,
+        ReadingOrder,
+        WrapText,
+        TextRotation,
+        Locked,
+        Hidden,
+        ShrinkToFit,
+        BorderDiagonalUp,
+        BorderDiagonalDown,
+        GradientDegree,
+        GradientType,
+        GradientTop,
+        GradientBottom,
+        GradientLeft,
+        GradientRight,
+        XfId,
+        Indent
+    }
+    internal class StyleChangeEventArgs : EventArgs
+    {
+        internal StyleChangeEventArgs(eStyleClass styleclass, eStyleProperty styleProperty, object value, int positionID, string address)
+        {
+            StyleClass = styleclass;
+            StyleProperty=styleProperty;
+            Value = value;
+            Address = address;
+            PositionID = positionID;
+        }
+        internal eStyleClass StyleClass;
+        internal eStyleProperty StyleProperty;
+        //internal string PropertyName;
+        internal object Value;
+        internal int PositionID { get; set; }
+        //internal string Address;
+        internal string Address;
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelBorderItemXml.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelBorderItemXml.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelBorderItemXml.cs	(revision 9616)
@@ -0,0 +1,156 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml access class for border items
+    /// </summary>
+    public sealed class ExcelBorderItemXml : StyleXmlHelper
+    {
+        internal ExcelBorderItemXml(XmlNamespaceManager nameSpaceManager) : base(nameSpaceManager)
+        {
+            _borderStyle=ExcelBorderStyle.None;
+            _color = new ExcelColorXml(NameSpaceManager);
+        }
+        internal ExcelBorderItemXml(XmlNamespaceManager nsm, XmlNode topNode) :
+            base(nsm, topNode)
+        {
+            if (topNode != null)
+            {
+                _borderStyle = GetBorderStyle(GetXmlNodeString("@style"));
+                _color = new ExcelColorXml(nsm, topNode.SelectSingleNode(_colorPath, nsm));
+                Exists = true;
+            }
+            else
+            {
+                Exists = false;
+            }
+        }
+
+        private ExcelBorderStyle GetBorderStyle(string style)
+        {
+            if(style=="") return ExcelBorderStyle.None;
+            string sInStyle = style.Substring(0, 1).ToUpper() + style.Substring(1, style.Length - 1);
+            try
+            {
+                return (ExcelBorderStyle)Enum.Parse(typeof(ExcelBorderStyle), sInStyle);
+            }
+            catch
+            {
+                return ExcelBorderStyle.None;
+            }
+
+        }
+        ExcelBorderStyle _borderStyle = ExcelBorderStyle.None;
+        /// <summary>
+        /// Cell Border style
+        /// </summary>
+        public ExcelBorderStyle Style
+        {
+            get
+            {
+                return _borderStyle;
+            }
+            set
+            {
+                _borderStyle = value;
+                Exists = true;
+            }
+        }
+        ExcelColorXml _color = null;
+        const string _colorPath = "d:color";
+        /// <summary>
+        /// Border style
+        /// </summary>
+        public ExcelColorXml Color
+        {
+            get
+            {
+                return _color;
+            }
+            internal set
+            {
+                _color = value;
+            }
+        }
+        internal override string Id
+        {
+            get 
+            {
+                if (Exists)
+                {
+                    return Style + Color.Id;
+                }
+                else
+                {
+                    return "None";
+                }
+            }
+        }
+
+        internal ExcelBorderItemXml Copy()
+        {
+            ExcelBorderItemXml borderItem = new ExcelBorderItemXml(NameSpaceManager);
+            borderItem.Style = _borderStyle;
+            borderItem.Color = _color.Copy();
+            return borderItem;
+        }
+
+        internal override XmlNode CreateXmlNode(XmlNode topNode)
+        {
+            TopNode = topNode;
+
+            if (Style != ExcelBorderStyle.None)
+            {
+                SetXmlNodeString("@style", SetBorderString(Style));
+                if (Color.Exists)
+                {
+                    CreateNode(_colorPath);
+                    topNode.AppendChild(Color.CreateXmlNode(TopNode.SelectSingleNode(_colorPath,NameSpaceManager)));
+                }
+            }
+            return TopNode;
+        }
+
+        private string SetBorderString(ExcelBorderStyle Style)
+        {
+            string newName=Enum.GetName(typeof(ExcelBorderStyle), Style);
+            return newName.Substring(0, 1).ToLower() + newName.Substring(1, newName.Length - 1);
+        }
+        public bool Exists { get; private set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelBorderXml.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelBorderXml.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelBorderXml.cs	(revision 9616)
@@ -0,0 +1,216 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml access class for border top level
+    /// </summary>
+    public sealed class ExcelBorderXml : StyleXmlHelper
+    {
+        internal ExcelBorderXml(XmlNamespaceManager nameSpaceManager)
+            : base(nameSpaceManager)
+        {
+
+        }
+        internal ExcelBorderXml(XmlNamespaceManager nsm, XmlNode topNode) :
+            base(nsm, topNode)
+        {
+            _left = new ExcelBorderItemXml(nsm, topNode.SelectSingleNode(leftPath, nsm));
+            _right = new ExcelBorderItemXml(nsm, topNode.SelectSingleNode(rightPath, nsm));
+            _top = new ExcelBorderItemXml(nsm, topNode.SelectSingleNode(topPath, nsm));
+            _bottom = new ExcelBorderItemXml(nsm, topNode.SelectSingleNode(bottomPath, nsm));
+            _diagonal = new ExcelBorderItemXml(nsm, topNode.SelectSingleNode(diagonalPath, nsm));
+        }
+        internal override string Id
+        {
+            get
+            {
+                return Left.Id + Right.Id + Top.Id + Bottom.Id + Diagonal.Id + DiagonalUp.ToString() + DiagonalDown.ToString();
+            }
+        }
+        const string leftPath = "d:left";
+        ExcelBorderItemXml _left = null;
+        /// <summary>
+        /// Left border style properties
+        /// </summary>
+        public ExcelBorderItemXml Left
+        {
+            get
+            {
+                return _left;
+            }
+            internal set
+            {
+                _left = value;
+            }
+        }
+        const string rightPath = "d:right";
+        ExcelBorderItemXml _right = null;
+        /// <summary>
+        /// Right border style properties
+        /// </summary>
+        public ExcelBorderItemXml Right
+        {
+            get
+            {
+                return _right;
+            }
+            internal set
+            {
+                _right = value;
+            }
+        }
+        const string topPath = "d:top";
+        ExcelBorderItemXml _top = null;
+        /// <summary>
+        /// Top border style properties
+        /// </summary>
+        public ExcelBorderItemXml Top
+        {
+            get
+            {
+                return _top;
+            }
+            internal set
+            {
+                _top = value;
+            }
+        }
+        const string bottomPath = "d:bottom";
+        ExcelBorderItemXml _bottom = null;
+        /// <summary>
+        /// Bottom border style properties
+        /// </summary>
+        public ExcelBorderItemXml Bottom
+        {
+            get
+            {
+                return _bottom;
+            }
+            internal set
+            {
+                _bottom = value;
+            }
+        }
+        const string diagonalPath = "d:diagonal";
+        ExcelBorderItemXml _diagonal = null;
+        /// <summary>
+        /// Diagonal border style properties
+        /// </summary>
+        public ExcelBorderItemXml Diagonal
+        {
+            get
+            {
+                return _diagonal;
+            }
+            internal set
+            {
+                _diagonal = value;
+            }
+        }
+        const string diagonalUpPath = "@diagonalUp";
+        bool _diagonalUp = false;
+        /// <summary>
+        /// Diagonal up border
+        /// </summary>
+        public bool DiagonalUp
+        {
+            get
+            {
+                return _diagonalUp;
+            }
+            internal set
+            {
+                _diagonalUp = value;
+            }
+        }
+        const string diagonalDownPath = "@diagonalDown";
+        bool _diagonalDown = false;
+        /// <summary>
+        /// Diagonal down border
+        /// </summary>
+        public bool DiagonalDown
+        {
+            get
+            {
+                return _diagonalDown;
+            }
+            internal set
+            {
+                _diagonalDown = value;
+            }
+        }
+
+        internal ExcelBorderXml Copy()
+        {
+            ExcelBorderXml newBorder = new ExcelBorderXml(NameSpaceManager);
+            newBorder.Bottom = _bottom.Copy();
+            newBorder.Diagonal = _diagonal.Copy();
+            newBorder.Left = _left.Copy();
+            newBorder.Right = _right.Copy();
+            newBorder.Top = _top.Copy();
+            newBorder.DiagonalUp = _diagonalUp;
+            newBorder.DiagonalDown = _diagonalDown;
+
+            return newBorder;
+
+        }
+
+        internal override XmlNode CreateXmlNode(XmlNode topNode)
+        {
+            TopNode = topNode;
+            CreateNode(leftPath);
+            topNode.AppendChild(_left.CreateXmlNode(TopNode.SelectSingleNode(leftPath, NameSpaceManager)));
+            CreateNode(rightPath);
+            topNode.AppendChild(_right.CreateXmlNode(TopNode.SelectSingleNode(rightPath, NameSpaceManager)));
+            CreateNode(topPath);
+            topNode.AppendChild(_top.CreateXmlNode(TopNode.SelectSingleNode(topPath, NameSpaceManager)));
+            CreateNode(bottomPath);
+            topNode.AppendChild(_bottom.CreateXmlNode(TopNode.SelectSingleNode(bottomPath, NameSpaceManager)));
+            CreateNode(diagonalPath);
+            topNode.AppendChild(_diagonal.CreateXmlNode(TopNode.SelectSingleNode(diagonalPath, NameSpaceManager)));
+            if (_diagonalUp)
+            {
+                SetXmlNodeString(diagonalUpPath, "1");
+            }
+            if (_diagonalDown)
+            {
+                SetXmlNodeString(diagonalDownPath, "1");
+            }
+            return topNode;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelColorXml.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelColorXml.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelColorXml.cs	(revision 9616)
@@ -0,0 +1,216 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml access class for color
+    /// </summary>
+    public sealed class ExcelColorXml : StyleXmlHelper
+    {
+        internal ExcelColorXml(XmlNamespaceManager nameSpaceManager)
+            : base(nameSpaceManager)
+        {
+            _auto = false;
+            _theme = "";
+            _tint = 0;
+            _rgb = "";
+            _indexed = int.MinValue;
+        }
+        internal ExcelColorXml(XmlNamespaceManager nsm, XmlNode topNode) :
+            base(nsm, topNode)
+        {
+            if(topNode==null)
+            {
+                _exists=false;
+            }
+            else
+            {
+                _exists = true;
+                _auto = GetXmlNodeBool("@auto");
+                _theme = GetXmlNodeString("@theme");
+                _tint = GetXmlNodeDecimal("@tint");
+                _rgb = GetXmlNodeString("@rgb");
+                _indexed = GetXmlNodeInt("@indexed");
+            }
+        }
+        
+        internal override string Id
+        {
+            get
+            {
+                return _auto.ToString() + "|" + _theme + "|" + _tint + "|" + _rgb + "|" + _indexed;
+            }
+        }
+        bool _auto;
+        public bool Auto
+        {
+            get
+            {
+                return _auto;
+            }
+            set
+            {
+                if (value)
+                {
+
+                }
+                _auto = value;
+                _exists = true;
+                Clear();
+            }
+        }
+        string _theme;
+        /// <summary>
+        /// Theme color value
+        /// </summary>
+        public string Theme
+        {
+            get
+            {
+                return _theme;
+            }
+        }
+        decimal _tint;
+        /// <summary>
+        /// Tint
+        /// </summary>
+        public decimal Tint
+        {
+            get
+            {
+                return _tint;
+            }
+            set
+            {
+                _tint = value;
+                _exists = true;
+            }
+        }
+        string _rgb;
+        /// <summary>
+        /// RGB value
+        /// </summary>
+        public string Rgb
+        {
+            get
+            {
+                return _rgb;
+            }
+            set
+            {
+                _rgb = value;
+                _exists=true;
+                _indexed = int.MinValue;
+                _auto = false;
+            }
+        }
+        int _indexed;
+        /// <summary>
+        /// Indexed color value
+        /// </summary>
+        public int Indexed
+        {
+            get
+            {
+              return _indexed;
+            }
+            set
+            {
+                if (value < 0 || value > 65)
+                {
+                    throw (new ArgumentOutOfRangeException("Index out of range"));
+                }
+                Clear();
+                _indexed = value;
+                _exists = true;
+            }
+        }
+        internal void Clear()
+        {
+            _theme = "";
+            _tint = decimal.MaxValue;
+            _indexed = int.MinValue;
+            _rgb = "";
+            _auto = false;
+        }
+        public void SetColor(System.Drawing.Color color)
+        {
+            Clear();
+            _rgb = color.ToArgb().ToString("X");
+        }
+
+        internal ExcelColorXml Copy()
+        {
+            return new ExcelColorXml(NameSpaceManager) {_indexed=Indexed, _tint=Tint, _rgb=Rgb, _theme=Theme, _auto=Auto, _exists=Exists };
+        }
+
+        internal override XmlNode CreateXmlNode(XmlNode topNode)
+        {
+            TopNode = topNode;
+            if(_rgb!="")
+            {
+                SetXmlNodeString("@rgb", _rgb);
+            }
+            else if (_indexed >= 0)
+            {
+                SetXmlNodeString("@indexed", _indexed.ToString());
+            }
+            else if (_auto)
+            {
+                SetXmlNodeBool("@auto", _auto);
+            }
+            else
+            {
+                SetXmlNodeString("@theme", _theme.ToString());
+            }
+            if (_tint != decimal.MaxValue)
+            {
+                SetXmlNodeString("@tint", _tint.ToString(CultureInfo.InvariantCulture));
+            }
+            return TopNode;
+        }
+
+        bool _exists;
+        internal bool Exists
+        {
+            get
+            {
+                return _exists;
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelFillXml.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelFillXml.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelFillXml.cs	(revision 9616)
@@ -0,0 +1,173 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml access class for fills
+    /// </summary>
+    public class ExcelFillXml : StyleXmlHelper 
+    {
+        internal ExcelFillXml(XmlNamespaceManager nameSpaceManager)
+            : base(nameSpaceManager)
+        {
+            _fillPatternType = ExcelFillStyle.None;
+            _backgroundColor = new ExcelColorXml(NameSpaceManager);
+            _patternColor = new ExcelColorXml(NameSpaceManager);
+        }
+        internal ExcelFillXml(XmlNamespaceManager nsm, XmlNode topNode):
+            base(nsm, topNode)
+        {
+            PatternType = GetPatternType(GetXmlNodeString(fillPatternTypePath));
+            _backgroundColor = new ExcelColorXml(nsm, topNode.SelectSingleNode(_backgroundColorPath, nsm));
+            _patternColor = new ExcelColorXml(nsm, topNode.SelectSingleNode(_patternColorPath, nsm));
+        }
+
+        private ExcelFillStyle GetPatternType(string patternType)
+        {
+            if (patternType == "") return ExcelFillStyle.None;
+            patternType = patternType.Substring(0, 1).ToUpper() + patternType.Substring(1, patternType.Length - 1);
+            try
+            {
+                return (ExcelFillStyle)Enum.Parse(typeof(ExcelFillStyle), patternType);
+            }
+            catch
+            {
+                return ExcelFillStyle.None;
+            }
+        }
+        internal override string Id
+        {
+            get
+            {
+                return PatternType + PatternColor.Id + BackgroundColor.Id;
+            }
+        }
+        #region Public Properties
+        const string fillPatternTypePath = "d:patternFill/@patternType";
+        protected ExcelFillStyle _fillPatternType;
+        /// <summary>
+        /// Cell fill pattern style
+        /// </summary>
+        public ExcelFillStyle PatternType
+        {
+            get
+            {
+                return _fillPatternType;
+            }
+            set
+            {
+                _fillPatternType=value;
+            }
+        }
+        protected ExcelColorXml _patternColor = null;
+        const string _patternColorPath = "d:patternFill/d:bgColor";
+        /// <summary>
+        /// Pattern color
+        /// </summary>
+        public ExcelColorXml PatternColor
+        {
+            get
+            {
+                return _patternColor;
+            }
+            internal set
+            {
+                _patternColor = value;
+            }
+        }
+        protected ExcelColorXml _backgroundColor = null;
+        const string _backgroundColorPath = "d:patternFill/d:fgColor";
+        /// <summary>
+        /// Cell background color 
+        /// </summary>
+        public ExcelColorXml BackgroundColor
+        {
+            get
+            {
+                return _backgroundColor;
+            }
+            internal set
+            {
+                _backgroundColor=value;
+            }
+        }
+        #endregion
+
+
+        //internal Fill Copy()
+        //{
+        //    Fill newFill = new Fill(NameSpaceManager, TopNode.Clone());
+        //    return newFill;
+        //}
+
+        internal virtual ExcelFillXml Copy()
+        {
+            ExcelFillXml newFill = new ExcelFillXml(NameSpaceManager);
+            newFill.PatternType = _fillPatternType;
+            newFill.BackgroundColor = _backgroundColor.Copy();
+            newFill.PatternColor = _patternColor.Copy();
+            return newFill;
+        }
+
+        internal override XmlNode CreateXmlNode(XmlNode topNode)
+        {
+            TopNode = topNode;
+            SetXmlNodeString(fillPatternTypePath, SetPatternString(_fillPatternType));
+            if (PatternType != ExcelFillStyle.None)
+            {
+                XmlNode pattern = topNode.SelectSingleNode(fillPatternTypePath, NameSpaceManager);
+                if (BackgroundColor.Exists)
+                {
+                    CreateNode(_backgroundColorPath);
+                    BackgroundColor.CreateXmlNode(topNode.SelectSingleNode(_backgroundColorPath, NameSpaceManager));
+                    if (PatternColor.Exists)
+                    {
+                        CreateNode(_patternColorPath);
+                        //topNode.AppendChild(PatternColor.CreateXmlNode(topNode.SelectSingleNode(_patternColorPath, NameSpaceManager)));
+                        PatternColor.CreateXmlNode(topNode.SelectSingleNode(_patternColorPath, NameSpaceManager));
+                    }
+                }
+            }
+            return topNode;
+        }
+
+        private string SetPatternString(ExcelFillStyle pattern)
+        {
+            string newName = Enum.GetName(typeof(ExcelFillStyle), pattern);
+            return newName.Substring(0, 1).ToLower() + newName.Substring(1, newName.Length - 1);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelFontXml.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelFontXml.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelFontXml.cs	(revision 9616)
@@ -0,0 +1,331 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml access class for fonts
+    /// </summary>
+    public sealed class ExcelFontXml : StyleXmlHelper
+    {
+        internal ExcelFontXml(XmlNamespaceManager nameSpaceManager)
+            : base(nameSpaceManager)
+        {
+            _name = "";
+            _size = 0;
+            _family = int.MinValue;
+            _scheme = "";
+            _color = _color = new ExcelColorXml(NameSpaceManager);
+            _bold = false;
+            _italic = false;
+            _strike = false;
+            _underlineType = ExcelUnderLineType.None ;
+            _verticalAlign = "";
+        }
+        internal ExcelFontXml(XmlNamespaceManager nsm, XmlNode topNode) :
+            base(nsm, topNode)
+        {
+            _name = GetXmlNodeString(namePath);
+            _size = (float)GetXmlNodeDecimal(sizePath);
+            _family = GetXmlNodeInt(familyPath);
+            _scheme = GetXmlNodeString(schemePath);
+            _color = new ExcelColorXml(nsm, topNode.SelectSingleNode(_colorPath, nsm));
+            _bold = (topNode.SelectSingleNode(boldPath, NameSpaceManager) != null);
+            _italic = (topNode.SelectSingleNode(italicPath, NameSpaceManager) != null);
+            _strike = (topNode.SelectSingleNode(strikePath, NameSpaceManager) != null);
+            _verticalAlign = GetXmlNodeString(verticalAlignPath);
+            if (topNode.SelectSingleNode(underLinedPath, NameSpaceManager) != null)
+            {
+                string ut = GetXmlNodeString(underLinedPath + "/@val");
+                if (ut == "")
+                {
+                    _underlineType = ExcelUnderLineType.Single;
+                }
+                else
+                {
+                    _underlineType = (ExcelUnderLineType)Enum.Parse(typeof(ExcelUnderLineType), ut, true);
+                }
+            }
+            else
+            {
+                _underlineType = ExcelUnderLineType.None;
+            }
+        }
+        internal override string Id
+        {
+            get
+            {
+                return Name + "|" + Size + "|" + Family + "|" + Color.Id + "|" + Scheme + "|" + Bold.ToString() + "|" + Italic.ToString() + "|" + Strike.ToString() + "|" + VerticalAlign + "|" + UnderLineType.ToString();
+            }
+        }
+        const string namePath = "d:name/@val";
+        string _name;
+        /// <summary>
+        /// The name of the font
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return _name;
+            }
+            set
+            {
+                Scheme = "";        //Reset schema to avoid corrupt file if unsupported font is selected.
+                _name = value;
+            }
+        }
+        const string sizePath = "d:sz/@val";
+        float _size;
+        /// <summary>
+        /// Font size
+        /// </summary>
+        public float Size
+        {
+            get
+            {
+                return _size;
+            }
+            set
+            {
+                _size = value;
+            }
+        }
+        const string familyPath = "d:family/@val";
+        int _family;
+        /// <summary>
+        /// Font family
+        /// </summary>
+        public int Family
+        {
+            get
+            {
+                return _family;
+            }
+            set
+            {
+                _family=value;
+            }
+        }
+        ExcelColorXml _color = null;
+        const string _colorPath = "d:color";
+        /// <summary>
+        /// Text color
+        /// </summary>
+        public ExcelColorXml Color
+        {
+            get
+            {
+                return _color;
+            }
+            internal set 
+            {
+                _color=value;
+            }
+        }
+        const string schemePath = "d:scheme/@val";
+        string _scheme="";
+        /// <summary>
+        /// Font Scheme
+        /// </summary>
+        public string Scheme
+        {
+            get
+            {
+                return _scheme;
+            }
+            private set
+            {
+                _scheme=value;
+            }
+        }
+        const string boldPath = "d:b";
+        bool _bold;
+        /// <summary>
+        /// If the font is bold
+        /// </summary>
+        public bool Bold
+        {
+            get
+            {
+                return _bold;
+            }
+            set
+            {
+                _bold=value;
+            }
+        }
+        const string italicPath = "d:i";
+        bool _italic;
+        /// <summary>
+        /// If the font is italic
+        /// </summary>
+        public bool Italic
+        {
+            get
+            {
+                return _italic;
+            }
+            set
+            {
+                _italic=value;
+            }
+        }
+        const string strikePath = "d:strike";
+        bool _strike;
+        /// <summary>
+        /// If the font is striked out
+        /// </summary>
+        public bool Strike
+        {
+            get
+            {
+                return _strike;
+            }
+            set
+            {
+                _strike=value;
+            }
+        }
+        const string underLinedPath = "d:u";
+        /// <summary>
+        /// If the font is underlined.
+        /// When set to true a the text is underlined with a single line
+        /// </summary>
+        public bool UnderLine
+        {
+            get
+            {
+                return UnderLineType!=ExcelUnderLineType.None;
+            }
+            set
+            {
+                _underlineType=value ? ExcelUnderLineType.Single : ExcelUnderLineType.None;
+            }
+        }
+        ExcelUnderLineType _underlineType;
+        /// <summary>
+        /// If the font is underlined
+        /// </summary>
+        public ExcelUnderLineType UnderLineType
+        {
+            get
+            {
+                return _underlineType;
+            }
+            set
+            {
+                _underlineType = value;
+            }
+        }
+        const string verticalAlignPath = "d:vertAlign/@val";
+        string _verticalAlign;
+        /// <summary>
+        /// Vertical aligned
+        /// </summary>
+        public string VerticalAlign
+        {
+            get
+            {
+                return _verticalAlign;
+            }
+            set
+            {
+                _verticalAlign=value;
+            }
+        }
+        public void SetFromFont(System.Drawing.Font Font)
+        {
+            Name=Font.Name;
+            //Family=fnt.FontFamily.;
+            Size=(int)Font.Size;
+            Strike=Font.Strikeout;
+            Bold = Font.Bold;
+            UnderLine=Font.Underline;
+            Italic=Font.Italic;
+        }
+        internal ExcelFontXml Copy()
+        {
+            ExcelFontXml newFont = new ExcelFontXml(NameSpaceManager);
+            newFont.Name = Name;
+            newFont.Size = Size;
+            newFont.Family = Family;
+            newFont.Scheme = Scheme;
+            newFont.Bold = Bold;
+            newFont.Italic = Italic;
+            newFont.UnderLineType = UnderLineType;
+            newFont.Strike = Strike;
+            newFont.VerticalAlign = VerticalAlign;
+            newFont.Color = Color.Copy();
+            return newFont;
+        }
+
+        internal override XmlNode CreateXmlNode(XmlNode topElement)
+        {
+            TopNode = topElement;
+
+            if (_bold) CreateNode(boldPath); else DeleteAllNode(boldPath);
+            if (_italic) CreateNode(italicPath); else DeleteAllNode(italicPath);
+            if (_strike) CreateNode(strikePath); else DeleteAllNode(strikePath);
+            
+            if (_underlineType == ExcelUnderLineType.None)
+            {
+                DeleteAllNode(underLinedPath);
+            }
+            else if(_underlineType==ExcelUnderLineType.Single)
+            {
+                CreateNode(underLinedPath);
+            }
+            else
+            {
+                var v=_underlineType.ToString();
+                SetXmlNodeString(underLinedPath + "/@val", v.Substring(0, 1).ToLower() + v.Substring(1));
+            }
+
+            if (_verticalAlign!="") SetXmlNodeString(verticalAlignPath, _verticalAlign.ToString());
+            SetXmlNodeString(sizePath, _size.ToString(System.Globalization.CultureInfo.InvariantCulture));
+            if (_color.Exists)
+            {
+                CreateNode(_colorPath);
+                TopNode.AppendChild(_color.CreateXmlNode(TopNode.SelectSingleNode(_colorPath, NameSpaceManager)));
+            }
+            SetXmlNodeString(namePath, _name);
+            if(_family>int.MinValue) SetXmlNodeString(familyPath, _family.ToString());
+            if (_scheme != "") SetXmlNodeString(schemePath, _scheme.ToString());
+
+            return TopNode;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelGradientFillXml.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelGradientFillXml.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelGradientFillXml.cs	(revision 9616)
@@ -0,0 +1,198 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml access class for gradient fillsde
+    /// </summary>
+    public sealed class ExcelGradientFillXml : ExcelFillXml
+    {
+        internal ExcelGradientFillXml(XmlNamespaceManager nameSpaceManager)
+            : base(nameSpaceManager)
+        {
+            GradientColor1 = new ExcelColorXml(nameSpaceManager);
+            GradientColor2 = new ExcelColorXml(nameSpaceManager);
+        }
+        internal ExcelGradientFillXml(XmlNamespaceManager nsm, XmlNode topNode) :
+            base(nsm, topNode)
+        {
+            Degree = GetXmlNodeDouble(_degreePath);
+            Type = GetXmlNodeString(_typePath)=="path" ? ExcelFillGradientType.Path : ExcelFillGradientType.Linear;
+            GradientColor1 = new ExcelColorXml(nsm, topNode.SelectSingleNode(_gradientColor1Path, nsm));
+            GradientColor2 = new ExcelColorXml(nsm, topNode.SelectSingleNode(_gradientColor2Path, nsm));
+            
+            Top = GetXmlNodeDouble(_topPath);
+            Bottom = GetXmlNodeDouble(_bottomPath);
+            Left = GetXmlNodeDouble(_leftPath);
+            Right = GetXmlNodeDouble(_rightPath);
+        }
+        const string _typePath = "d:gradientFill/@type";
+        /// <summary>
+        /// Type of gradient fill. 
+        /// </summary>
+        public ExcelFillGradientType Type
+        {
+            get;
+            internal set;
+        }
+        const string _degreePath = "d:gradientFill/@degree";
+        /// <summary>
+        /// Angle of the linear gradient
+        /// </summary>
+        public double Degree
+        {
+            get;
+            internal set;
+        }
+        const string _gradientColor1Path = "d:gradientFill/d:stop[@position=\"0\"]/d:color";
+        /// <summary>
+        /// Gradient color 1
+        /// </summary>
+        public ExcelColorXml GradientColor1 
+        {
+            get;
+            private set;
+        }
+        const string _gradientColor2Path = "d:gradientFill/d:stop[@position=\"1\"]/d:color";
+        /// <summary>
+        /// Gradient color 2
+        /// </summary>
+        public ExcelColorXml GradientColor2
+        {
+            get;
+            private set;
+        }
+        const string _bottomPath = "d:gradientFill/@bottom";
+        /// <summary>
+        /// Percentage format bottom
+        /// </summary>
+        public double Bottom
+        { 
+            get; 
+            internal set; 
+        }
+        const string _topPath = "d:gradientFill/@top";
+        /// <summary>
+        /// Percentage format top
+        /// </summary>
+        public double Top
+        {
+            get;
+            internal set;
+        }
+        const string _leftPath = "d:gradientFill/@left";
+        /// <summary>
+        /// Percentage format left
+        /// </summary>
+        public double Left
+        {
+            get;
+            internal set;
+        }
+        const string _rightPath = "d:gradientFill/@right";
+        /// <summary>
+        /// Percentage format right
+        /// </summary>
+        public double Right
+        {
+            get;
+            internal set;
+        }
+        internal override string Id
+        {
+            get
+            {
+                return base.Id + Degree.ToString() + GradientColor1.Id + GradientColor2.Id + Type + Left.ToString() + Right.ToString() + Bottom.ToString() + Top.ToString();
+            }
+        }
+
+        #region Public Properties
+        #endregion
+        internal override ExcelFillXml Copy()
+        {
+            ExcelGradientFillXml newFill = new ExcelGradientFillXml(NameSpaceManager);
+            newFill.PatternType = base._fillPatternType;
+            newFill.BackgroundColor = _backgroundColor.Copy();
+            newFill.PatternColor = _patternColor.Copy();
+
+            newFill.GradientColor1 = GradientColor1.Copy();
+            newFill.GradientColor2 = GradientColor2.Copy();
+            newFill.Type = Type;
+            newFill.Degree = Degree;
+            newFill.Top = Top;
+            newFill.Bottom = Bottom;
+            newFill.Left = Left;
+            newFill.Right = Right;
+            
+            return newFill;
+        }
+
+        internal override XmlNode CreateXmlNode(XmlNode topNode)
+        {
+            TopNode = topNode;
+            CreateNode("d:gradientFill");
+            if(Type==ExcelFillGradientType.Path) SetXmlNodeString(_typePath, "path");
+            if(!double.IsNaN(Degree)) SetXmlNodeString(_degreePath, Degree.ToString(CultureInfo.InvariantCulture));
+            if (GradientColor1!=null)
+            {
+                /*** Gradient color node 1***/
+                var node = TopNode.SelectSingleNode("d:gradientFill", NameSpaceManager);
+                var stopNode = node.OwnerDocument.CreateElement("stop", ExcelPackage.schemaMain);
+                stopNode.SetAttribute("position", "0");
+                node.AppendChild(stopNode);
+                var colorNode = node.OwnerDocument.CreateElement("color", ExcelPackage.schemaMain);
+                stopNode.AppendChild(colorNode);
+                GradientColor1.CreateXmlNode(colorNode);
+
+                /*** Gradient color node 2***/
+                stopNode = node.OwnerDocument.CreateElement("stop", ExcelPackage.schemaMain);
+                stopNode.SetAttribute("position", "1");
+                node.AppendChild(stopNode);
+                colorNode = node.OwnerDocument.CreateElement("color", ExcelPackage.schemaMain);
+                stopNode.AppendChild(colorNode);
+
+                GradientColor2.CreateXmlNode(colorNode);
+            }
+            if (!double.IsNaN(Top)) SetXmlNodeString(_topPath, Top.ToString("F5",CultureInfo.InvariantCulture));
+            if (!double.IsNaN(Bottom)) SetXmlNodeString(_bottomPath, Bottom.ToString("F5", CultureInfo.InvariantCulture));
+            if (!double.IsNaN(Left)) SetXmlNodeString(_leftPath, Left.ToString("F5", CultureInfo.InvariantCulture));
+            if (!double.IsNaN(Right)) SetXmlNodeString(_rightPath, Right.ToString("F5", CultureInfo.InvariantCulture));
+
+            return topNode;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelNamedStyleXml.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelNamedStyleXml.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelNamedStyleXml.cs	(revision 9616)
@@ -0,0 +1,145 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml access class for named styles
+    /// </summary>
+    public sealed class ExcelNamedStyleXml : StyleXmlHelper
+    {
+        ExcelStyles _styles;
+        internal ExcelNamedStyleXml(XmlNamespaceManager nameSpaceManager, ExcelStyles styles)
+            : base(nameSpaceManager)
+        {
+            _styles = styles;
+            BuildInId = int.MinValue;
+        }
+        internal ExcelNamedStyleXml(XmlNamespaceManager NameSpaceManager, XmlNode topNode, ExcelStyles styles) :
+            base(NameSpaceManager, topNode)
+        {
+            StyleXfId = GetXmlNodeInt(idPath);
+            Name = GetXmlNodeString(namePath);
+            BuildInId = GetXmlNodeInt(buildInIdPath);
+            CustomBuildin = GetXmlNodeBool(customBuiltinPath);
+
+            _styles = styles;
+            _style = new ExcelStyle(styles, styles.NamedStylePropertyChange, -1, Name, _styleXfId);
+        }
+        internal override string Id
+        {
+            get
+            {
+                return Name;
+            }
+        }
+        int _styleXfId=0;
+        const string idPath = "@xfId";
+        /// <summary>
+        /// Named style index
+        /// </summary>
+        public int StyleXfId
+        {
+            get
+            {
+                return _styleXfId;
+            }
+            set
+            {
+                _styleXfId = value;
+            }
+        }
+        int _xfId = int.MinValue;
+        /// <summary>
+        /// Style index
+        /// </summary>
+        internal int XfId
+        {
+            get
+            {
+                return _xfId;
+            }
+            set
+            {
+                _xfId = value;
+            }
+        }
+        const string buildInIdPath = "@builtinId";
+        public int BuildInId { get; set; }
+        const string customBuiltinPath = "@customBuiltin";
+        public bool CustomBuildin { get; set; }
+        const string namePath = "@name";
+        string _name;
+        /// <summary>
+        /// Name of the style
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return _name;
+            }
+            internal set
+            {
+                _name = value;
+            }
+        }
+        ExcelStyle _style = null;
+        /// <summary>
+        /// The style object
+        /// </summary>
+        public ExcelStyle Style
+        {
+            get
+            {
+                return _style;
+            }
+            internal set
+            {
+                _style = value;
+            }
+        }
+
+        internal override XmlNode CreateXmlNode(XmlNode topNode)
+        {
+            TopNode = topNode;
+            SetXmlNodeString(namePath, _name);
+            SetXmlNodeString("@xfId", _styles.CellStyleXfs[StyleXfId].newID.ToString());
+            if (BuildInId>=0) SetXmlNodeString("@builtinId", BuildInId.ToString());
+            if(CustomBuildin) SetXmlNodeBool(customBuiltinPath, true);
+            return TopNode;            
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelNumberFormatXml.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelNumberFormatXml.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelNumberFormatXml.cs	(revision 9616)
@@ -0,0 +1,635 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+using System.Text.RegularExpressions;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml access class for number formats
+    /// </summary>
+    public sealed class ExcelNumberFormatXml : StyleXmlHelper
+    {
+        internal ExcelNumberFormatXml(XmlNamespaceManager nameSpaceManager) : base(nameSpaceManager)
+        {
+            
+        }        
+        internal ExcelNumberFormatXml(XmlNamespaceManager nameSpaceManager, bool buildIn): base(nameSpaceManager)
+        {
+            BuildIn = buildIn;
+        }
+        internal ExcelNumberFormatXml(XmlNamespaceManager nsm, XmlNode topNode) :
+            base(nsm, topNode)
+        {
+            _numFmtId = GetXmlNodeInt("@numFmtId");
+            _format = GetXmlNodeString("@formatCode");
+        }
+        public bool BuildIn { get; private set; }
+        int _numFmtId;
+//        const string idPath = "@numFmtId";
+        /// <summary>
+        /// Id for number format
+        /// 
+        /// Build in ID's
+        /// 
+        /// 0   General 
+        /// 1   0 
+        /// 2   0.00 
+        /// 3   #,##0 
+        /// 4   #,##0.00 
+        /// 9   0% 
+        /// 10  0.00% 
+        /// 11  0.00E+00 
+        /// 12  # ?/? 
+        /// 13  # ??/?? 
+        /// 14  mm-dd-yy 
+        /// 15  d-mmm-yy 
+        /// 16  d-mmm 
+        /// 17  mmm-yy 
+        /// 18  h:mm AM/PM 
+        /// 19  h:mm:ss AM/PM 
+        /// 20  h:mm 
+        /// 21  h:mm:ss 
+        /// 22  m/d/yy h:mm 
+        /// 37  #,##0 ;(#,##0) 
+        /// 38  #,##0 ;[Red](#,##0) 
+        /// 39  #,##0.00;(#,##0.00) 
+        /// 40  #,##0.00;[Red](#,##0.00) 
+        /// 45  mm:ss 
+        /// 46  [h]:mm:ss 
+        /// 47  mmss.0 
+        /// 48  ##0.0E+0 
+        /// 49  @
+        /// </summary>            
+        public int NumFmtId
+        {
+            get
+            {
+                return _numFmtId;
+            }
+            set
+            {
+                _numFmtId = value;
+            }
+        }
+        internal override string Id
+        {
+            get
+            {
+                return _format;
+            }
+        }
+        const string fmtPath = "@formatCode";
+        string _format = string.Empty;
+        public string Format
+        {
+            get
+            {
+                return _format;
+            }
+            set
+            {
+                _numFmtId = ExcelNumberFormat.GetFromBuildIdFromFormat(value);
+                _format = value;
+            }
+        }
+        internal string GetNewID(int NumFmtId, string Format)
+        {
+            
+            if (NumFmtId < 0)
+            {
+                NumFmtId = ExcelNumberFormat.GetFromBuildIdFromFormat(Format);                
+            }
+            return NumFmtId.ToString();
+        }
+
+        internal static void AddBuildIn(XmlNamespaceManager NameSpaceManager, ExcelStyleCollection<ExcelNumberFormatXml> NumberFormats)
+        {
+            NumberFormats.Add("General",new ExcelNumberFormatXml(NameSpaceManager,true){NumFmtId=0,Format="General"});
+            NumberFormats.Add("0", new ExcelNumberFormatXml(NameSpaceManager,true) { NumFmtId = 1, Format = "0" });
+            NumberFormats.Add("0.00", new ExcelNumberFormatXml(NameSpaceManager,true) { NumFmtId = 2, Format = "0.00" });
+            NumberFormats.Add("#,##0", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 3, Format = "#,##0" });
+            NumberFormats.Add("#,##0.00", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 4, Format = "#,##0.00" });
+            NumberFormats.Add("0%", new ExcelNumberFormatXml(NameSpaceManager,true) { NumFmtId = 9, Format = "0%" });
+            NumberFormats.Add("0.00%", new ExcelNumberFormatXml(NameSpaceManager,true) { NumFmtId = 10, Format = "0.00%" });
+            NumberFormats.Add("0.00E+00", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 11, Format = "0.00E+00" });
+            NumberFormats.Add("# ?/?", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 12, Format = "# ?/?" });
+            NumberFormats.Add("# ??/??", new ExcelNumberFormatXml(NameSpaceManager,true) { NumFmtId = 13, Format = "# ??/??" });
+            NumberFormats.Add("mm-dd-yy", new ExcelNumberFormatXml(NameSpaceManager,true) { NumFmtId = 14, Format = "mm-dd-yy" });
+            NumberFormats.Add("d-mmm-yy", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 15, Format = "d-mmm-yy" });
+            NumberFormats.Add("d-mmm", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 16, Format = "d-mmm" });
+            NumberFormats.Add("mmm-yy", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 17, Format = "mmm-yy" });
+            NumberFormats.Add("h:mm AM/PM", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 18, Format = "h:mm AM/PM" });
+            NumberFormats.Add("h:mm:ss AM/PM", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 19, Format = "h:mm:ss AM/PM" });
+            NumberFormats.Add("h:mm", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 20, Format = "h:mm" });
+            NumberFormats.Add("h:mm:dd", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 21, Format = "h:mm:dd" });
+            NumberFormats.Add("m/d/yy h:mm", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 22, Format = "m/d/yy h:mm" });
+            NumberFormats.Add("#,##0 ;(#,##0)", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 37, Format = "#,##0 ;(#,##0)" });
+            NumberFormats.Add("#,##0 ;[Red](#,##0)", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 38, Format = "#,##0 ;[Red](#,##0)" });
+            NumberFormats.Add("#,##0.00;(#,##0.00)", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 39, Format = "#,##0.00;(#,##0.00)" });
+            NumberFormats.Add("#,##0.00;[Red](#,#)", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 40, Format = "#,##0.00;[Red](#,#)" });
+            NumberFormats.Add("mm:ss", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 45, Format = "mm:ss" });
+            NumberFormats.Add("[h]:mm:ss", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 46, Format = "[h]:mm:ss" });
+            NumberFormats.Add("mmss.0", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 47, Format = "mmss.0" });
+            NumberFormats.Add("##0.0", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 48, Format = "##0.0" });
+            NumberFormats.Add("@", new ExcelNumberFormatXml(NameSpaceManager, true) { NumFmtId = 49, Format = "@" });
+
+            NumberFormats.NextId = 164; //Start for custom formats.
+        }
+
+        internal override XmlNode CreateXmlNode(XmlNode topNode)
+        {
+            TopNode = topNode;
+            SetXmlNodeString("@numFmtId", NumFmtId.ToString());
+            SetXmlNodeString("@formatCode", Format);
+            return TopNode;
+        }
+
+        internal enum eFormatType
+        {
+            Unknown = 0,
+            Number = 1,
+            DateTime = 2,
+        }
+        ExcelFormatTranslator _translator = null;
+        internal ExcelFormatTranslator FormatTranslator
+        {
+            get
+            {
+                if (_translator == null)
+                {
+                    _translator = new ExcelFormatTranslator(Format, NumFmtId);
+                }
+                return _translator;
+            }
+        }
+        #region Excel --> .Net Format
+        internal class ExcelFormatTranslator
+        {
+            internal ExcelFormatTranslator(string format, int numFmtID)
+            {
+                if (numFmtID == 14)
+                {
+                    NetFormat = NetFormatForWidth = "d";
+                    NetTextFormat = NetTextFormatForWidth = "";
+                    DataType = eFormatType.DateTime;
+                }
+                else if (format.ToLower() == "general")
+                {
+                    NetFormat = NetFormatForWidth = "0.#####";
+                    NetTextFormat = NetTextFormatForWidth = "";
+                    DataType = eFormatType.Number;
+                }
+                else
+                {
+                    ToNetFormat(format, false);
+                    ToNetFormat(format, true);
+                }                
+            }
+            internal string NetTextFormat { get; private set; }
+            internal string NetFormat { get; private set; }
+            CultureInfo _ci = null;
+            internal CultureInfo Culture
+            {
+                get
+                {
+                    if (_ci == null)
+                    {
+                        return CultureInfo.CurrentCulture;
+                    }
+                    return _ci;
+                }
+                private set
+                {
+                    _ci = value;
+                }
+            }
+            internal eFormatType DataType { get; private set; }
+            internal string NetTextFormatForWidth { get; private set; }
+            internal string NetFormatForWidth { get; private set; }
+
+            //internal string FractionFormatInteger { get; private set; }
+            internal string FractionFormat { get; private set; }
+            //internal string FractionFormat2 { get; private set; }
+
+            private void ToNetFormat(string ExcelFormat, bool forColWidth)
+            {
+                DataType = eFormatType.Unknown;
+                int secCount = 0;
+                bool isText = false;
+                bool isBracket = false;
+                string bracketText = "";
+                bool prevBslsh = false;
+                bool useMinute = false;
+                bool prevUnderScore = false;
+                bool ignoreNext = false;
+                int fractionPos = -1;
+                string specialDateFormat = "";
+                bool containsAmPm = ExcelFormat.Contains("AM/PM");
+
+                StringBuilder sb = new StringBuilder();
+                Culture = null;
+                var format = "";
+                var text = "";
+                char clc;
+
+                if (containsAmPm)
+                {
+                    ExcelFormat = Regex.Replace(ExcelFormat, "AM/PM", "");
+                    DataType = eFormatType.DateTime;
+                }
+
+                for (int pos = 0; pos < ExcelFormat.Length; pos++)
+                {
+                    char c = ExcelFormat[pos];
+                    if (c == '"')
+                    {
+                        isText = !isText;
+                    }
+                    else
+                    {
+                        if (ignoreNext)
+                        {
+                            ignoreNext = false;
+                            continue;
+                        }
+                        else if (isText && !isBracket)
+                        {
+                            sb.Append(c);
+                        }
+                        else if (isBracket)
+                        {
+                            if (c == ']')
+                            {
+                                isBracket = false;
+                                if (bracketText[0] == '$')  //Local Info
+                                {
+                                    string[] li = Regex.Split(bracketText, "-");
+                                    if (li[0].Length > 1)
+                                    {
+                                        sb.Append("\"" + li[0].Substring(1, li[0].Length - 1) + "\"");     //Currency symbol
+                                    }
+                                    if (li.Length > 1)
+                                    {
+                                        if (li[1].ToLower() == "f800")
+                                        {
+                                            specialDateFormat = "D";
+                                        }
+                                        else if (li[1].ToLower() == "f400")
+                                        {
+                                            specialDateFormat = "T";
+                                        }
+                                        else
+                                        {
+                                            var num = int.Parse(li[1], NumberStyles.HexNumber);
+                                            try
+                                            {
+                                                Culture = CultureInfo.GetCultureInfo(num & 0xFFFF);
+                                            }
+                                            catch
+                                            {
+                                                Culture = null;
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                            else
+                            {
+                                bracketText += c;
+                            }
+                        }
+                        else if (prevUnderScore)
+                        {
+                            if (forColWidth)
+                            {
+                                sb.AppendFormat("\"{0}\"", c);
+                            }
+                            prevUnderScore = false;
+                        }
+                        else
+                        {
+                            if (c == ';') //We use first part (for positive only at this stage)
+                            {
+                                secCount++;
+                                if (DataType == eFormatType.DateTime || secCount == 3)
+                                {
+                                    format = sb.ToString();
+                                    sb = new StringBuilder();
+                                }
+                                else
+                                {
+                                    sb.Append(c);
+                                }
+                            }
+                            else
+                            {
+                                clc = c.ToString().ToLower()[0];  //Lowercase character
+                                //Set the datetype
+                                if (DataType == eFormatType.Unknown)
+                                {
+                                    if (c == '0' || c == '#' || c == '.')
+                                    {
+                                        DataType = eFormatType.Number;
+                                    }
+                                    else if (clc == 'y' || clc == 'm' || clc == 'd' || clc == 'h' || clc == 'm' || clc == 's')
+                                    {
+                                        DataType = eFormatType.DateTime;
+                                    }
+                                }
+
+                                if (prevBslsh)
+                                {
+                                    sb.Append(c);
+                                    prevBslsh = false;
+                                }
+                                else if (c == '[')
+                                {
+                                    bracketText = "";
+                                    isBracket = true;
+                                }
+                                else if (c == '\\')
+                                {
+                                    prevBslsh = true;
+                                }
+                                else if (c == '0' ||
+                                    c == '#' ||
+                                    c == '.' ||
+                                    c == ',' ||
+                                    c == '%' ||
+                                    clc == 'd' ||
+                                    clc == 's')
+                                {
+                                    sb.Append(c);
+                                }
+                                else if (clc == 'h')
+                                {
+                                    if (containsAmPm)
+                                    {
+                                        sb.Append('h'); ;
+                                    }
+                                    else
+                                    {
+                                        sb.Append('H');
+                                    }
+                                    useMinute = true;
+                                }
+                                else if (clc == 'm')
+                                {
+                                    if (useMinute)
+                                    {
+                                        sb.Append('m');
+                                    }
+                                    else
+                                    {
+                                        sb.Append('M');
+                                    }
+                                }
+                                else if (c == '_') //Skip next but use for alignment
+                                {
+                                    prevUnderScore = true;
+                                }
+                                else if (c == '?')
+                                {
+                                    sb.Append(' ');
+                                }
+                                else if (c == '/')
+                                {
+                                    if (DataType == eFormatType.Number)
+                                    {
+                                        fractionPos = sb.Length;
+                                        int startPos = pos - 1;
+                                        while (startPos >= 0 &&
+                                                (ExcelFormat[startPos] == '?' ||
+                                                ExcelFormat[startPos] == '#' ||
+                                                ExcelFormat[startPos] == '0'))
+                                        {
+                                            startPos--;
+                                        }
+
+                                        if (startPos > 0)  //RemovePart
+                                            sb.Remove(sb.Length-(pos-startPos-1),(pos-startPos-1)) ;
+
+                                        int endPos = pos + 1;
+                                        while (endPos < ExcelFormat.Length &&
+                                                (ExcelFormat[endPos] == '?' ||
+                                                ExcelFormat[endPos] == '#' ||
+                                                (ExcelFormat[endPos] >= '0' && ExcelFormat[endPos]<= '9')))
+                                        {
+                                            endPos++;
+                                        }
+                                        pos = endPos;
+                                        if (FractionFormat != "")
+                                        {
+                                            FractionFormat = ExcelFormat.Substring(startPos+1, endPos - startPos-1);
+                                        }
+                                        sb.Append('?'); //Will be replaced later on by the fraction
+                                    }
+                                    else
+                                    {
+                                        sb.Append('/');
+                                    }
+                                }
+                                else if (c == '*')
+                                {
+                                    //repeat char--> ignore
+                                    ignoreNext = true;
+                                }
+                                else if (c == '@')
+                                {
+                                    sb.Append("{0}");
+                                }
+                                else
+                                {
+                                    sb.Append(c);
+                                }
+                            }
+                        }
+                    }
+                }
+
+                // AM/PM format
+                if (containsAmPm)
+                {
+                    format += "tt";
+                }
+
+
+                if (format == "")
+                    format = sb.ToString();
+                else
+                    text = sb.ToString();
+                if (specialDateFormat != "")
+                {
+                    format = specialDateFormat;
+                }
+
+                if (forColWidth)
+                {
+                    NetFormatForWidth = format;
+                    NetTextFormatForWidth = text;
+                }
+                else
+                {
+                    NetFormat = format;
+                    NetTextFormat = text;
+                }
+                if (Culture == null)
+                {
+                    Culture = CultureInfo.CurrentCulture;
+                }
+            }
+            internal string FormatFraction(double d)
+            {
+                int numerator, denomerator;
+
+                int intPart = (int)d;
+
+                string[] fmt = FractionFormat.Split('/');
+
+                int fixedDenominator;
+                if (!int.TryParse(fmt[1], out fixedDenominator))
+                {
+                    fixedDenominator = 0;
+                }
+                
+                if (d == 0 || double.IsNaN(d))
+                {
+                    if (fmt[0].Trim() == "" && fmt[1].Trim() == "")
+                    {
+                        return new string(' ', FractionFormat.Length);
+                    }
+                    else
+                    {
+                        return 0.ToString(fmt[0]) + "/" + 1.ToString(fmt[0]);
+                    }
+                }
+
+                int maxDigits = fmt[1].Length;
+                string sign = d < 0 ? "-" : "";
+                if (fixedDenominator == 0)
+                {
+                    List<double> numerators = new List<double>() { 1, 0 };
+                    List<double> denominators = new List<double>() { 0, 1 };
+
+                    if (maxDigits < 1 && maxDigits > 12)
+                    {
+                        throw (new ArgumentException("Number of digits out of range (1-12)"));
+                    }
+
+                    int maxNum = 0;
+                    for (int i = 0; i < maxDigits; i++)
+                    {
+                        maxNum += 9 * (int)(Math.Pow((double)10, (double)i));
+                    }
+
+                    double divRes = 1 / ((double)Math.Abs(d) - intPart);
+                    double result, prevResult = double.NaN;
+                    int listPos = 2, index = 1;
+                    while (true)
+                    {
+                        index++;
+                        double intDivRes = Math.Floor(divRes);
+                        numerators.Add((intDivRes * numerators[index - 1] + numerators[index - 2]));
+                        if (numerators[index] > maxNum)
+                        {
+                            break;
+                        }
+
+                        denominators.Add((intDivRes * denominators[index - 1] + denominators[index - 2]));
+
+                        result = numerators[index] / denominators[index];
+                        if (denominators[index] > maxNum)
+                        {
+                            break;
+                        }
+                        listPos = index;
+
+                        if (result == prevResult) break;
+
+                        if (result == d) break;
+
+                        prevResult = result;
+
+                        divRes = 1 / (divRes - intDivRes);  //Rest
+                    }
+                    
+                    numerator = (int)numerators[listPos];
+                    denomerator = (int)denominators[listPos];
+                }
+                else
+                {
+                    numerator = (int)Math.Round((d - intPart) / (1D / fixedDenominator), 0);
+                    denomerator = fixedDenominator;
+                }
+                if (numerator == denomerator || numerator==0)
+                {
+                    if(numerator == denomerator) intPart++;
+                    return sign + intPart.ToString(NetFormat).Replace("?", new string(' ', FractionFormat.Length));
+                }
+                else if (intPart == 0)
+                {
+                    return sign + FmtInt(numerator, fmt[0]) + "/" + FmtInt(denomerator, fmt[1]);
+                }
+                else
+                {
+                    return sign + intPart.ToString(NetFormat).Replace("?", FmtInt(numerator, fmt[0]) + "/" + FmtInt(denomerator, fmt[1]));
+                }
+            }
+
+            private string FmtInt(double value, string format)
+            {
+                string v = value.ToString("#");
+                string pad = "";
+                if (v.Length < format.Length)
+                {
+                    for (int i = format.Length - v.Length-1; i >= 0; i--)
+                    {
+                        if (format[i] == '?')
+                        {
+                            pad += " ";
+                        }
+                        else if (format[i] == ' ')
+                        {
+                            pad += "0";
+                        }
+                    }
+                }
+                return pad + v;
+            }
+        }
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelXfsXml.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelXfsXml.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/ExcelXfsXml.cs	(revision 9616)
@@ -0,0 +1,876 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Drawing;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml access class xfs records. This is the top level style object.
+    /// </summary>
+    public sealed class ExcelXfs : StyleXmlHelper
+    {
+        ExcelStyles _styles;
+        internal ExcelXfs(XmlNamespaceManager nameSpaceManager, ExcelStyles styles) : base(nameSpaceManager)
+        {
+            _styles = styles;
+            isBuildIn = false;
+        }
+        internal ExcelXfs(XmlNamespaceManager nsm, XmlNode topNode, ExcelStyles styles) :
+            base(nsm, topNode)
+        {
+            _styles = styles;
+            _xfID = GetXmlNodeInt("@xfId");
+            if (_xfID == 0) isBuildIn = true; //Normal taggen
+            _numFmtId = GetXmlNodeInt("@numFmtId");
+            _fontId = GetXmlNodeInt("@fontId");
+            _fillId = GetXmlNodeInt("@fillId");
+            _borderId = GetXmlNodeInt("@borderId");
+            _readingOrder = GetReadingOrder(GetXmlNodeString(readingOrderPath));
+            _indent = GetXmlNodeInt(indentPath);
+            _shrinkToFit = GetXmlNodeString(shrinkToFitPath) == "1" ? true : false; 
+            _verticalAlignment = GetVerticalAlign(GetXmlNodeString(verticalAlignPath));
+            _horizontalAlignment = GetHorizontalAlign(GetXmlNodeString(horizontalAlignPath));
+            _wrapText = GetXmlNodeString(wrapTextPath) == "1" ? true : false;
+            _textRotation = GetXmlNodeInt(textRotationPath);
+            _hidden = GetXmlNodeBool(hiddenPath);
+            _locked = GetXmlNodeBool(lockedPath,true);
+        }
+
+        private ExcelReadingOrder GetReadingOrder(string value)
+        {
+            switch(value)
+            {
+                case "1":
+                    return ExcelReadingOrder.LeftToRight;
+                case "2":
+                    return ExcelReadingOrder.RightToLeft;
+                default:
+                    return ExcelReadingOrder.ContextDependent;
+            }
+        }
+
+        private ExcelHorizontalAlignment GetHorizontalAlign(string align)
+        {
+            if (align == "") return ExcelHorizontalAlignment.General;
+            align = align.Substring(0, 1).ToUpper() + align.Substring(1, align.Length - 1);
+            try
+            {
+                return (ExcelHorizontalAlignment)Enum.Parse(typeof(ExcelHorizontalAlignment), align);
+            }
+            catch
+            {
+                return ExcelHorizontalAlignment.General;
+            }
+        }
+
+        private ExcelVerticalAlignment GetVerticalAlign(string align)
+        {
+            if (align == "") return ExcelVerticalAlignment.Bottom;
+            align = align.Substring(0, 1).ToUpper() + align.Substring(1, align.Length - 1);
+            try
+            {
+                return (ExcelVerticalAlignment)Enum.Parse(typeof(ExcelVerticalAlignment), align);
+            }
+            catch
+            {
+                return ExcelVerticalAlignment.Bottom;
+            }
+        }
+        internal void Xf_ChangedEvent(object sender, EventArgs e)
+        {
+            //if (_cell != null)
+            //{
+            //    if (!Styles.ChangedCells.ContainsKey(_cell.Id))
+            //    {
+            //        //_cell.Style = "";
+            //        _cell.SetNewStyleID(int.MinValue.ToString());
+            //        Styles.ChangedCells.Add(_cell.Id, _cell);
+            //    }
+            //}
+        }
+        int _xfID;
+        /// <summary>
+        /// Style index
+        /// </summary>
+        public int XfId
+        {
+            get
+            {
+                return _xfID;
+            }
+            set
+            {
+                _xfID = value;
+            }
+        }
+        #region Internal Properties
+        int _numFmtId;
+        internal int NumberFormatId
+        {
+            get
+            {
+                return _numFmtId;
+            }
+            set
+            {
+                _numFmtId = value;
+            }
+        }
+        int _fontId;
+        internal int FontId
+        {
+            get
+            {
+                return _fontId;
+            }
+            set
+            {
+                _fontId = value;
+            }
+        }
+        int _fillId;
+        internal int FillId
+        {
+            get
+            {
+                return _fillId;
+            }
+            set
+            {
+                _fillId = value;
+            }
+        }
+        int _borderId;
+        internal int BorderId
+        {
+            get
+            {
+                return _borderId;
+            }
+            set
+            {
+                _borderId = value;
+            }
+        }
+        private bool isBuildIn
+        {
+            get;
+            set;
+        }
+        //internal bool ApplyNumberFormat
+        //{
+        //    get
+        //    {
+        //        return GetXmlNode("@applyNumberFormat") == "1" ? true : false;
+        //    }
+        //    set
+        //    {
+        //        SetXmlNode("@applyNumberFormat", value ? "1" : "0");
+        //    }
+        //}
+        //internal bool ApplyFont
+        //{
+        //    get
+        //    {
+        //        return GetXmlNode("@applyFont") == "1" ? true : false;
+        //    }
+        //    set
+        //    {
+        //        SetXmlNode("@applyFont", value ? "1" : "0");
+        //    }
+        //}
+        //internal bool ApplyFill
+        //{
+        //    get
+        //    {
+        //        return GetXmlNode("@applyFill") == "1" ? true : false;
+        //    }
+        //    set
+        //    {
+        //        SetXmlNode("@applyFill", value ? "1" : "0");
+        //    }
+        //}
+        //internal bool ApplyBorder
+        //{
+        //    get
+        //    {
+        //        return GetXmlNode("@applyBorder") == "1" ? true : false;
+        //    }
+        //    set
+        //    {
+        //        SetXmlNode("@applyBorder", value ? "1" : "0");
+        //    }
+        //}
+        //internal bool ApplyAlignment
+        //{
+        //    get
+        //    {
+        //        return GetXmlNode("@applyAlignment") == "1" ? true : false;
+        //    }
+        //    set
+        //    {
+        //        SetXmlNode("@applyAlignment", value ? "1" : "0");
+        //    }
+        //}
+        //internal bool ApplyProtection
+        //{
+        //    get
+        //    {
+        //        return GetXmlNode("@applyProtection") == "1" ? true : false;
+        //    }
+        //    set
+        //    {
+        //        SetXmlNode("@applyProtection", value ? "1" : "0");
+        //    }
+        //}
+        #endregion
+        #region Public Properties
+        public ExcelStyles Styles { get; private set; }
+        /// <summary>
+        /// Numberformat properties
+        /// </summary>
+        public ExcelNumberFormatXml Numberformat 
+        {
+            get
+            {
+                return _styles.NumberFormats[_numFmtId < 0 ? 0 : _numFmtId];
+            }
+        }
+        /// <summary>
+        /// Font properties
+        /// </summary>
+        public ExcelFontXml Font 
+        { 
+           get
+           {
+               return _styles.Fonts[_fontId < 0 ? 0 : _fontId];
+           }
+        }
+        /// <summary>
+        /// Fill properties
+        /// </summary>
+        public ExcelFillXml Fill
+        {
+            get
+            {
+                return _styles.Fills[_fillId < 0 ? 0 : _fillId];
+            }
+        }        
+        /// <summary>
+        /// Border style properties
+        /// </summary>
+        public ExcelBorderXml Border
+        {
+            get
+            {
+                return _styles.Borders[_borderId < 0 ? 0 : _borderId];
+            }
+        }
+        const string horizontalAlignPath = "d:alignment/@horizontal";
+        ExcelHorizontalAlignment _horizontalAlignment = ExcelHorizontalAlignment.General;
+        /// <summary>
+        /// Horizontal alignment
+        /// </summary>
+        public ExcelHorizontalAlignment HorizontalAlignment
+        {
+            get
+            {
+                return _horizontalAlignment;
+            }
+            set
+            {
+                _horizontalAlignment = value;
+            }
+        }
+        const string verticalAlignPath = "d:alignment/@vertical";
+        ExcelVerticalAlignment _verticalAlignment=ExcelVerticalAlignment.Bottom;
+        /// <summary>
+        /// Vertical alignment
+        /// </summary>
+        public ExcelVerticalAlignment VerticalAlignment
+        {
+            get
+            {
+                return _verticalAlignment;
+            }
+            set
+            {
+                _verticalAlignment = value;
+            }
+        }
+        const string wrapTextPath = "d:alignment/@wrapText";
+        bool _wrapText=false;
+        /// <summary>
+        /// Wraped text
+        /// </summary>
+        public bool WrapText
+        {
+            get
+            {
+                return _wrapText;
+            }
+            set
+            {
+                _wrapText = value;
+            }
+        }
+        string textRotationPath = "d:alignment/@textRotation";
+        int _textRotation = 0;
+        /// <summary>
+        /// Text rotation angle
+        /// </summary>
+        public int TextRotation
+        {
+            get
+            {
+                return _textRotation;
+            }
+            set
+            {
+                _textRotation = value;
+            }
+        }
+        const string lockedPath = "d:protection/@locked";
+        bool _locked = true;
+        /// <summary>
+        /// Locked when sheet is protected
+        /// </summary>
+        public bool Locked
+        {
+            get
+            {
+                return _locked;
+            }
+            set
+            {
+                _locked = value;
+            }
+        }
+        const string hiddenPath = "d:protection/@hidden";
+        bool _hidden = false;
+        /// <summary>
+        /// Hide formulas when sheet is protected
+        /// </summary>
+        public bool Hidden
+        {
+            get
+            {
+                return _hidden;
+            }
+            set
+            {
+                _hidden = value;
+            }
+        }
+        const string readingOrderPath = "d:alignment/@readingOrder";
+        ExcelReadingOrder _readingOrder = ExcelReadingOrder.ContextDependent;
+        /// <summary>
+        /// Readingorder
+        /// </summary>
+        public ExcelReadingOrder ReadingOrder
+        {
+            get
+            {
+                return _readingOrder;
+            }
+            set
+            {
+                _readingOrder = value;
+            }
+        }
+        const string shrinkToFitPath = "d:alignment/@shrinkToFit";
+        bool _shrinkToFit = false;
+        /// <summary>
+        /// Shrink to fit
+        /// </summary>
+        public bool ShrinkToFit
+        {
+            get
+            {
+                return _shrinkToFit;
+            }
+            set
+            {
+                _shrinkToFit = value;
+            }
+        }
+        const string indentPath = "d:alignment/@indent";
+        int _indent = 0;
+        /// <summary>
+        /// Indentation
+        /// </summary>
+        public int Indent
+        {
+            get
+            {
+                return _indent;
+            }
+            set
+            {
+                _indent=value;
+            }
+        }
+        #endregion
+        internal void RegisterEvent(ExcelXfs xf)
+        {
+            //                RegisterEvent(xf, xf.Xf_ChangedEvent);
+        }
+        internal override string Id
+        {
+
+            get
+            {
+                return XfId + "|" + NumberFormatId.ToString() + "|" + FontId.ToString() + "|" + FillId.ToString() + "|" + BorderId.ToString() + VerticalAlignment.ToString() + "|" + HorizontalAlignment.ToString() + "|" + WrapText.ToString() + "|" + ReadingOrder.ToString() + "|" + isBuildIn.ToString() + TextRotation.ToString() + Locked.ToString() + Hidden.ToString() + ShrinkToFit.ToString() + Indent.ToString(); 
+                //return Numberformat.Id + "|" + Font.Id + "|" + Fill.Id + "|" + Border.Id + VerticalAlignment.ToString() + "|" + HorizontalAlignment.ToString() + "|" + WrapText.ToString() + "|" + ReadingOrder.ToString(); 
+            }
+        }
+        internal ExcelXfs Copy()
+        {
+            return Copy(_styles);
+        }        
+        internal ExcelXfs Copy(ExcelStyles styles)
+        {
+            ExcelXfs newXF = new ExcelXfs(NameSpaceManager, styles);
+            newXF.NumberFormatId = _numFmtId;
+            newXF.FontId = _fontId;
+            newXF.FillId = _fillId;
+            newXF.BorderId = _borderId;
+            newXF.XfId = _xfID;
+            newXF.ReadingOrder = _readingOrder;
+            newXF.HorizontalAlignment = _horizontalAlignment;
+            newXF.VerticalAlignment = _verticalAlignment;
+            newXF.WrapText = _wrapText;
+            newXF.ShrinkToFit = _shrinkToFit;
+            newXF.Indent = _indent;
+            newXF.TextRotation = _textRotation;
+            newXF.Locked = _locked;
+            newXF.Hidden = _hidden;
+            return newXF;
+        }
+
+        internal int GetNewID(ExcelStyleCollection<ExcelXfs> xfsCol, StyleBase styleObject, eStyleClass styleClass, eStyleProperty styleProperty, object value)
+        {
+            ExcelXfs newXfs = this.Copy();
+            switch(styleClass)
+            {
+                case eStyleClass.Numberformat:
+                    newXfs.NumberFormatId = GetIdNumberFormat(styleProperty, value);
+                    styleObject.SetIndex(newXfs.NumberFormatId);
+                    break;
+                case eStyleClass.Font:
+                {
+                    newXfs.FontId = GetIdFont(styleProperty, value);
+                    styleObject.SetIndex(newXfs.FontId);
+                    break;
+                }
+                case eStyleClass.Fill:
+                case eStyleClass.FillBackgroundColor:
+                case eStyleClass.FillPatternColor:
+                    newXfs.FillId = GetIdFill(styleClass, styleProperty, value);
+                    styleObject.SetIndex(newXfs.FillId);
+                    break;
+                case eStyleClass.GradientFill:
+                case eStyleClass.FillGradientColor1:
+                case eStyleClass.FillGradientColor2:
+                    newXfs.FillId = GetIdGradientFill(styleClass, styleProperty, value);
+                    styleObject.SetIndex(newXfs.FillId);
+                    break;
+                case eStyleClass.Border:
+                case eStyleClass.BorderBottom:
+                case eStyleClass.BorderDiagonal:
+                case eStyleClass.BorderLeft:
+                case eStyleClass.BorderRight:
+                case eStyleClass.BorderTop:
+                    newXfs.BorderId = GetIdBorder(styleClass, styleProperty, value);
+                    styleObject.SetIndex(newXfs.BorderId);
+                    break;
+                case eStyleClass.Style:
+                    switch(styleProperty)
+                    {
+                        case eStyleProperty.XfId:
+                            newXfs.XfId = (int)value;
+                            break;
+                        case eStyleProperty.HorizontalAlign:
+                            newXfs.HorizontalAlignment=(ExcelHorizontalAlignment)value;
+                            break;
+                        case eStyleProperty.VerticalAlign:
+                            newXfs.VerticalAlignment = (ExcelVerticalAlignment)value;
+                            break;
+                        case eStyleProperty.WrapText:
+                            newXfs.WrapText = (bool)value;
+                            break;
+                        case eStyleProperty.ReadingOrder:
+                            newXfs.ReadingOrder = (ExcelReadingOrder)value;
+                            break;
+                        case eStyleProperty.ShrinkToFit:
+                            newXfs.ShrinkToFit=(bool)value;
+                            break;
+                        case eStyleProperty.Indent:
+                            newXfs.Indent = (int)value;
+                            break;
+                        case eStyleProperty.TextRotation:
+                            newXfs.TextRotation = (int)value;
+                            break;
+                        case eStyleProperty.Locked:
+                            newXfs.Locked = (bool)value;
+                            break;
+                        case eStyleProperty.Hidden:
+                            newXfs.Hidden = (bool)value;
+                            break;
+                        default:
+                            throw (new Exception("Invalid property for class style."));
+
+                    }
+                    break;
+                default:
+                    break;
+            }
+            int id = xfsCol.FindIndexByID(newXfs.Id);
+            if (id < 0)
+            {
+                return xfsCol.Add(newXfs.Id, newXfs);
+            }
+            return id;
+        }
+
+        private int GetIdBorder(eStyleClass styleClass, eStyleProperty styleProperty, object value)
+        {
+            ExcelBorderXml border = Border.Copy();
+
+            switch (styleClass)
+            {
+                case eStyleClass.BorderBottom:
+                    SetBorderItem(border.Bottom, styleProperty, value);
+                    break;
+                case eStyleClass.BorderDiagonal:
+                    SetBorderItem(border.Diagonal, styleProperty, value);
+                    break;
+                case eStyleClass.BorderLeft:
+                    SetBorderItem(border.Left, styleProperty, value);
+                    break;
+                case eStyleClass.BorderRight:
+                    SetBorderItem(border.Right, styleProperty, value);
+                    break;
+                case eStyleClass.BorderTop:
+                    SetBorderItem(border.Top, styleProperty, value);
+                    break;
+                case eStyleClass.Border:
+                    if (styleProperty == eStyleProperty.BorderDiagonalUp)
+                    {
+                        border.DiagonalUp = (bool)value;
+                    }
+                    else if (styleProperty == eStyleProperty.BorderDiagonalDown)
+                    {
+                        border.DiagonalDown = (bool)value;
+                    }
+                    else
+                    {
+                        throw (new Exception("Invalid property for class Border."));
+                    }
+                    break;
+                default:
+                    throw (new Exception("Invalid class/property for class Border."));
+            }
+            int subId;
+            string id = border.Id;
+            subId = _styles.Borders.FindIndexByID(id);
+            if (subId == int.MinValue)
+            {
+                return _styles.Borders.Add(id, border);
+            }
+            return subId;
+        }
+
+        private void SetBorderItem(ExcelBorderItemXml excelBorderItem, eStyleProperty styleProperty, object value)
+        {
+            if(styleProperty==eStyleProperty.Style)
+            {
+                excelBorderItem.Style = (ExcelBorderStyle)value;
+            }
+            else if (styleProperty == eStyleProperty.Color || styleProperty== eStyleProperty.Tint || styleProperty==eStyleProperty.IndexedColor)
+            {
+                if (excelBorderItem.Style == ExcelBorderStyle.None)
+                {
+                    throw(new Exception("Can't set bordercolor when style is not set."));
+                }
+                excelBorderItem.Color.Rgb = value.ToString();
+            }
+        }
+
+        private int GetIdFill(eStyleClass styleClass, eStyleProperty styleProperty, object value)
+        {
+            ExcelFillXml fill = Fill.Copy();
+
+            switch (styleProperty)
+            {
+                case eStyleProperty.PatternType:
+                    if (fill is ExcelGradientFillXml)
+                    {
+                        fill = new ExcelFillXml(NameSpaceManager);
+                    }
+                    fill.PatternType = (ExcelFillStyle)value;
+                    break;
+                case eStyleProperty.Color:
+                case eStyleProperty.Tint:
+                case eStyleProperty.IndexedColor:
+                case eStyleProperty.AutoColor:
+                    if (fill is ExcelGradientFillXml)
+                    {
+                        fill = new ExcelFillXml(NameSpaceManager);
+                    }
+                    if (fill.PatternType == ExcelFillStyle.None)
+                    {
+                        throw (new ArgumentException("Can't set color when patterntype is not set."));
+                    }
+                    ExcelColorXml destColor;
+                    if (styleClass==eStyleClass.FillPatternColor)
+                    {
+                        destColor = fill.PatternColor;
+                    }
+                    else
+                    {
+                        destColor = fill.BackgroundColor;
+                    }
+
+                    if (styleProperty == eStyleProperty.Color)
+                    {
+                        destColor.Rgb = value.ToString();
+                    }
+                    else if (styleProperty == eStyleProperty.Tint)
+                    {
+                        destColor.Tint = (decimal)value;
+                    }
+                    else if (styleProperty == eStyleProperty.IndexedColor)
+                    {
+                        destColor.Indexed = (int)value;
+                    }
+                    else
+                    {
+                        destColor.Auto = (bool)value;
+                    }
+
+                    break;
+                default:
+                    throw (new ArgumentException("Invalid class/property for class Fill."));
+            }
+            int subId;
+            string id = fill.Id;
+            subId = _styles.Fills.FindIndexByID(id);
+            if (subId == int.MinValue)
+            {
+                return _styles.Fills.Add(id, fill);
+            }
+            return subId;
+        }
+        private int GetIdGradientFill(eStyleClass styleClass, eStyleProperty styleProperty, object value)
+        {
+            ExcelGradientFillXml fill;
+            if(Fill is ExcelGradientFillXml)
+            {
+                fill = (ExcelGradientFillXml)Fill.Copy();
+            }
+            else
+            {
+                fill = new ExcelGradientFillXml(Fill.NameSpaceManager);
+                fill.GradientColor1.SetColor(Color.White);
+                fill.GradientColor2.SetColor(Color.FromArgb(79,129,189));
+                fill.Type=ExcelFillGradientType.Linear;
+                fill.Degree=90;
+                fill.Top = double.NaN;
+                fill.Bottom = double.NaN;
+                fill.Left = double.NaN;
+                fill.Right = double.NaN;
+            }
+
+            switch (styleProperty)
+            {
+                case eStyleProperty.GradientType:
+                    fill.Type = (ExcelFillGradientType)value;
+                    break;
+                case eStyleProperty.GradientDegree:
+                    fill.Degree = (double)value;
+                    break;
+                case eStyleProperty.GradientTop:
+                    fill.Top = (double)value;
+                    break;
+                case eStyleProperty.GradientBottom: 
+                    fill.Bottom = (double)value;
+                    break;
+                case eStyleProperty.GradientLeft:
+                    fill.Left = (double)value;
+                    break;
+                case eStyleProperty.GradientRight:
+                    fill.Right = (double)value;
+                    break;
+                case eStyleProperty.Color:
+                case eStyleProperty.Tint:
+                case eStyleProperty.IndexedColor:
+                case eStyleProperty.AutoColor:
+                    ExcelColorXml destColor;
+
+                    if (styleClass == eStyleClass.FillGradientColor1)
+                    {
+                        destColor = fill.GradientColor1;
+                    }
+                    else
+                    {
+                        destColor = fill.GradientColor2;
+                    }
+                    
+                    if (styleProperty == eStyleProperty.Color)
+                    {
+                        destColor.Rgb = value.ToString();
+                    }
+                    else if (styleProperty == eStyleProperty.Tint)
+                    {
+                        destColor.Tint = (decimal)value;
+                    }
+                    else if (styleProperty == eStyleProperty.IndexedColor)
+                    {
+                        destColor.Indexed = (int)value;
+                    }
+                    else
+                    {
+                        destColor.Auto = (bool)value;
+                    }
+                    break;
+                default:
+                    throw (new ArgumentException("Invalid class/property for class Fill."));
+            }
+            int subId;
+            string id = fill.Id;
+            subId = _styles.Fills.FindIndexByID(id);
+            if (subId == int.MinValue)
+            {
+                return _styles.Fills.Add(id, fill);
+            }
+            return subId;
+        }
+
+        private int GetIdNumberFormat(eStyleProperty styleProperty, object value)
+        {
+            if (styleProperty == eStyleProperty.Format)
+            {
+                ExcelNumberFormatXml item=null;
+                if (!_styles.NumberFormats.FindByID(value.ToString(), ref item))
+                {
+                    item = new ExcelNumberFormatXml(NameSpaceManager) { Format = value.ToString(), NumFmtId = _styles.NumberFormats.NextId++ };
+                    _styles.NumberFormats.Add(value.ToString(), item);
+                }
+                return item.NumFmtId;
+            }
+            else
+            {
+                throw (new Exception("Invalid property for class Numberformat"));
+            }
+        }
+        private int GetIdFont(eStyleProperty styleProperty, object value)
+        {
+            ExcelFontXml fnt = Font.Copy();
+
+            switch (styleProperty)
+            {
+                case eStyleProperty.Name:
+                    fnt.Name = value.ToString();
+                    break;
+                case eStyleProperty.Size:
+                    fnt.Size = (float)value;
+                    break;
+                case eStyleProperty.Family:
+                    fnt.Family = (int)value;
+                    break;
+                case eStyleProperty.Bold:
+                    fnt.Bold = (bool)value;
+                    break;
+                case eStyleProperty.Italic:
+                    fnt.Italic = (bool)value;
+                    break;
+                case eStyleProperty.Strike:
+                    fnt.Strike = (bool)value;
+                    break;
+                case eStyleProperty.UnderlineType:
+                    fnt.UnderLineType = (ExcelUnderLineType)value;
+                    break;
+                case eStyleProperty.Color:
+                    fnt.Color.Rgb=value.ToString();
+                    break;
+                case eStyleProperty.VerticalAlign:
+                    fnt.VerticalAlign = ((ExcelVerticalAlignmentFont)value) == ExcelVerticalAlignmentFont.None ? "" : value.ToString().ToLower();
+                    break;
+                default:
+                    throw (new Exception("Invalid property for class Font"));
+            }
+            int subId;
+            string id = fnt.Id;
+            subId = _styles.Fonts.FindIndexByID(id);
+            if (subId == int.MinValue)
+            {
+                return _styles.Fonts.Add(id,fnt);
+            }
+            return subId;
+        }
+        internal override XmlNode CreateXmlNode(XmlNode topNode)
+        {
+            return CreateXmlNode(topNode, false);
+        }
+        internal XmlNode CreateXmlNode(XmlNode topNode, bool isCellStyleXsf)
+        {
+            TopNode = topNode;
+            if(_numFmtId>=0) SetXmlNodeString("@numFmtId", _numFmtId.ToString());
+            if(_fontId >= 0) SetXmlNodeString("@fontId", _styles.Fonts[_fontId].newID.ToString());
+            if (_fillId >= 0) SetXmlNodeString("@fillId", _styles.Fills[_fillId].newID.ToString());
+            if(_borderId >= 0) SetXmlNodeString("@borderId", _styles.Borders[_borderId].newID.ToString());
+            if(_horizontalAlignment != ExcelHorizontalAlignment.General) this.SetXmlNodeString(horizontalAlignPath, SetAlignString(_horizontalAlignment));
+            if (!isCellStyleXsf && _xfID > int.MinValue && _styles.CellStyleXfs.Count>0)
+                SetXmlNodeString("@xfId", _styles.CellStyleXfs[_xfID].newID.ToString());
+
+            if (_verticalAlignment != ExcelVerticalAlignment.Bottom) this.SetXmlNodeString(verticalAlignPath, SetAlignString(_verticalAlignment));
+            if(_wrapText) this.SetXmlNodeString(wrapTextPath, "1");
+            if(_readingOrder!=ExcelReadingOrder.ContextDependent) this.SetXmlNodeString(readingOrderPath, ((int)_readingOrder).ToString());
+            if (_shrinkToFit) this.SetXmlNodeString(shrinkToFitPath, "1");
+            if (_indent > 0) SetXmlNodeString(indentPath, _indent.ToString());
+            if (_textRotation > 0) this.SetXmlNodeString(textRotationPath, _textRotation.ToString());
+            if (!_locked) this.SetXmlNodeString(lockedPath, "0");
+            if (_hidden) this.SetXmlNodeString(hiddenPath, "1");
+            return TopNode;
+        }
+
+        private string SetAlignString(Enum align)
+        {
+            string newName = Enum.GetName(align.GetType(), align);
+            return newName.Substring(0, 1).ToLower() + newName.Substring(1, newName.Length - 1);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/StyleXmlHelper.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/StyleXmlHelper.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Style/XmlAccess/StyleXmlHelper.cs	(revision 9616)
@@ -0,0 +1,58 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+namespace OfficeOpenXml.Style.XmlAccess
+{
+    /// <summary>
+    /// Xml helper class for cell style classes
+    /// </summary>
+    public abstract class  StyleXmlHelper : XmlHelper
+    {
+        internal StyleXmlHelper(XmlNamespaceManager nameSpaceManager) : base(nameSpaceManager)
+        { 
+
+        }
+        internal StyleXmlHelper(XmlNamespaceManager nameSpaceManager, XmlNode topNode) : base(nameSpaceManager, topNode)
+        {
+        }
+        internal abstract XmlNode CreateXmlNode(XmlNode top);
+        internal abstract string Id
+        {
+            get;
+        }
+        internal long useCnt=0;
+        internal int newID=int.MinValue;
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTable.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTable.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTable.cs	(revision 9616)
@@ -0,0 +1,610 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		30-AUG-2010
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using System.Text.RegularExpressions;
+
+namespace OfficeOpenXml.Table
+{
+    /// <summary>
+    /// Table style Enum
+    /// </summary>
+    public enum TableStyles
+    {
+        None,
+        Custom,
+        Light1,
+        Light2,
+        Light3,
+        Light4,
+        Light5,
+        Light6,
+        Light7,
+        Light8,
+        Light9,
+        Light10,
+        Light11,
+        Light12,
+        Light13,
+        Light14,
+        Light15,
+        Light16,
+        Light17,
+        Light18,
+        Light19,
+        Light20,
+        Light21,
+        Medium1,
+        Medium2,
+        Medium3,
+        Medium4,
+        Medium5,
+        Medium6,
+        Medium7,
+        Medium8,
+        Medium9,
+        Medium10,
+        Medium11,
+        Medium12,
+        Medium13,
+        Medium14,
+        Medium15,
+        Medium16,
+        Medium17,
+        Medium18,
+        Medium19,
+        Medium20,
+        Medium21,
+        Medium22,
+        Medium23,
+        Medium24,
+        Medium25,
+        Medium26,
+        Medium27,
+        Medium28,
+        Dark1,
+        Dark2,
+        Dark3,
+        Dark4,
+        Dark5,
+        Dark6,
+        Dark7,
+        Dark8,
+        Dark9,
+        Dark10,
+        Dark11,
+    }
+    /// <summary>
+    /// An Excel Table
+    /// </summary>
+    public class ExcelTable : XmlHelper
+    {
+        internal ExcelTable(PackageRelationship rel, ExcelWorksheet sheet) : 
+            base(sheet.NameSpaceManager)
+        {
+            WorkSheet = sheet;
+            TableUri = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+            RelationshipID = rel.Id;
+            var pck = sheet._package.Package;
+            Part=pck.GetPart(TableUri);
+
+            TableXml = new XmlDocument();
+            LoadXmlSafe(TableXml, Part.GetStream());
+            init();
+            Address = new ExcelAddressBase(GetXmlNodeString("@ref"));
+        }
+        internal ExcelTable(ExcelWorksheet sheet, ExcelAddressBase address, string name, int tblId) : 
+            base(sheet.NameSpaceManager)
+	    {
+            WorkSheet = sheet;
+            Address = address;
+            TableXml = new XmlDocument();
+            LoadXmlSafe(TableXml, GetStartXml(name, tblId), Encoding.UTF8); 
+            TopNode = TableXml.DocumentElement;
+
+            init();
+
+            //If the table is just one row we can not have a header.
+            if (address._fromRow == address._toRow)
+            {
+                ShowHeader = false;
+            }
+        }
+
+        private void init()
+        {
+            TopNode = TableXml.DocumentElement;
+            SchemaNodeOrder = new string[] { "autoFilter", "tableColumns", "tableStyleInfo" };
+        }
+        private string GetStartXml(string name, int tblId)
+        {
+            string xml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?>";
+            xml += string.Format("<table xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" id=\"{0}\" name=\"{1}\" displayName=\"{2}\" ref=\"{3}\" headerRowCount=\"1\">",
+            tblId,
+            name,
+            cleanDisplayName(name),
+            Address.Address);
+            xml += string.Format("<autoFilter ref=\"{0}\" />", Address.Address);
+
+            int cols=Address._toCol-Address._fromCol+1;
+            xml += string.Format("<tableColumns count=\"{0}\">",cols);
+            var names = new Dictionary<string, string>();            
+            for(int i=1;i<=cols;i++)
+            {
+                var cell = WorkSheet.Cells[Address._fromRow, Address._fromCol+i-1];
+                string colName;
+                if (cell.Value == null || names.ContainsKey(cell.Value.ToString()))
+                {
+                    //Get an unique name
+                    int a=i;
+                    do
+                    {
+                        colName = string.Format("Column{0}", a++);
+                    }
+                    while (names.ContainsKey(colName));
+                }
+                else
+                {
+                    colName = System.Security.SecurityElement.Escape(cell.Value.ToString());
+                }
+                names.Add(colName, colName);
+                xml += string.Format("<tableColumn id=\"{0}\" name=\"{1}\" />", i,colName);
+            }
+            xml += "</tableColumns>";
+            xml += "<tableStyleInfo name=\"TableStyleMedium9\" showFirstColumn=\"0\" showLastColumn=\"0\" showRowStripes=\"1\" showColumnStripes=\"0\" /> ";
+            xml += "</table>";
+
+            return xml;
+        }
+        private string cleanDisplayName(string name) 
+        {
+            return Regex.Replace(name, @"[^\w\.-_]", "_");
+        }
+        internal PackagePart Part
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// Provides access to the XML data representing the table in the package.
+        /// </summary>
+        public XmlDocument TableXml
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The package internal URI to the Table Xml Document.
+        /// </summary>
+        public Uri TableUri
+        {
+            get;
+            internal set;
+        }
+        internal string RelationshipID
+        {
+            get;
+            set;
+        }
+        const string ID_PATH = "@id";
+        internal int Id 
+        {
+            get
+            {
+                return GetXmlNodeInt(ID_PATH);
+            }
+            set
+            {
+                SetXmlNodeString(ID_PATH, value.ToString());
+            }
+        }
+        const string NAME_PATH = "@name";
+        const string DISPLAY_NAME_PATH = "@displayName";
+        /// <summary>
+        /// The name of the table object in Excel
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return GetXmlNodeString(NAME_PATH);
+            }
+            set 
+            {
+                if(WorkSheet.Workbook.ExistsTableName(value))
+                {
+                    throw (new ArgumentException("Tablename is not unique"));
+                }
+                string prevName = Name;
+                if (WorkSheet.Tables._tableNames.ContainsKey(prevName))
+                {
+                    int ix=WorkSheet.Tables._tableNames[prevName];
+                    WorkSheet.Tables._tableNames.Remove(prevName);
+                    WorkSheet.Tables._tableNames.Add(value,ix);
+                }
+                SetXmlNodeString(NAME_PATH, value);
+                SetXmlNodeString(DISPLAY_NAME_PATH, cleanDisplayName(value));
+            }
+        }
+        /// <summary>
+        /// The worksheet of the table
+        /// </summary>
+        public ExcelWorksheet WorkSheet
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The address of the table
+        /// </summary>
+        public ExcelAddressBase Address
+        {
+            get;
+            internal set;
+        }
+        ExcelTableColumnCollection _cols = null;
+        /// <summary>
+        /// Collection of the columns in the table
+        /// </summary>
+        public ExcelTableColumnCollection Columns
+        {
+            get
+            {
+                if(_cols==null)
+                {
+                    _cols = new ExcelTableColumnCollection(this);
+                }
+                return _cols;
+            }
+        }
+        TableStyles _tableStyle = TableStyles.Medium6;
+        /// <summary>
+        /// The table style. If this property is cusom, the style from the StyleName propery is used.
+        /// </summary>
+        public TableStyles TableStyle
+        {
+            get
+            {
+                return _tableStyle;
+            }
+            set
+            {
+                _tableStyle=value;
+                if (value != TableStyles.Custom)
+                {
+                    SetXmlNodeString(STYLENAME_PATH, "TableStyle" + value.ToString());
+                }
+            }
+        }
+        const string HEADERROWCOUNT_PATH = "@headerRowCount";
+        const string AUTOFILTER_PATH = "d:autoFilter/@ref";
+        /// <summary>
+        /// If the header row is visible or not
+        /// </summary>
+        public bool ShowHeader
+        {
+            get
+            {
+                return GetXmlNodeInt(HEADERROWCOUNT_PATH)!=0;
+            }
+            set
+            {
+                if (Address._toRow - Address._fromRow < 1 && value ||
+                    Address._toRow - Address._fromRow == 1 && value && ShowTotal)
+                {
+                    throw (new Exception("Cant set ShowHeader-property. Table has too few rows"));
+                }
+
+                if(value)
+                {
+                    DeleteNode(HEADERROWCOUNT_PATH);
+                    WriteAutoFilter(ShowTotal);
+                }
+                else
+                {
+                    SetXmlNodeString(HEADERROWCOUNT_PATH, "0");
+                    DeleteAllNode(AUTOFILTER_PATH);
+                }
+            }
+        }
+        internal ExcelAddressBase AutoFilterAddress
+        {
+            get
+            {
+                string a=GetXmlNodeString(AUTOFILTER_PATH);
+                if (a == "")
+                {
+                    return null;
+                }
+                else
+                {
+                    return new ExcelAddressBase(a);
+                }
+            }
+        }
+        private void WriteAutoFilter(bool showTotal)
+        {
+            string autofilterAddress;
+            if (ShowHeader)
+            {
+                if (showTotal)
+                {
+                    autofilterAddress = ExcelCellBase.GetAddress(Address._fromRow, Address._fromCol, Address._toRow - 1, Address._toCol);
+                }
+                else
+                {
+                    autofilterAddress = Address.Address;
+                }
+                SetXmlNodeString(AUTOFILTER_PATH, autofilterAddress);
+            }
+        }
+        /// <summary>
+        /// If the header row has an autofilter
+        /// </summary>
+        public bool ShowFilter 
+        { 
+            get
+            {
+                return ShowHeader && AutoFilterAddress != null;
+            }
+            set
+            {
+                if (ShowHeader)
+                {
+                    if (value)
+                    {
+                        WriteAutoFilter(ShowTotal);
+                    }
+                    else 
+                    {
+                        DeleteAllNode(AUTOFILTER_PATH);
+                    }
+                }
+                else if(value)
+                {
+                    throw(new InvalidOperationException("Filter can only be applied when ShowHeader is set to true"));
+                }
+            }
+        }
+        const string TOTALSROWCOUNT_PATH = "@totalsRowCount";
+        const string TOTALSROWSHOWN_PATH = "@totalsRowShown";
+        /// <summary>
+        /// If the total row is visible or not
+        /// </summary>
+        public bool ShowTotal
+        {
+            get
+            {
+                return GetXmlNodeInt(TOTALSROWCOUNT_PATH) == 1;
+            }
+            set
+            {
+                if (value != ShowTotal)
+                {
+                    if (value)
+                    {
+                        Address=new ExcelAddress(WorkSheet.Name, ExcelAddressBase.GetAddress(Address.Start.Row, Address.Start.Column, Address.End.Row+1, Address.End.Column));
+                    }
+                    else
+                    {
+                        Address = new ExcelAddress(WorkSheet.Name, ExcelAddressBase.GetAddress(Address.Start.Row, Address.Start.Column, Address.End.Row - 1, Address.End.Column));
+                    }
+                    SetXmlNodeString("@ref", Address.Address);
+                    if (value)
+                    {
+                        SetXmlNodeString(TOTALSROWCOUNT_PATH, "1");
+                    }
+                    else
+                    {
+                        DeleteNode(TOTALSROWCOUNT_PATH);
+                    }
+                    WriteAutoFilter(value);
+                }
+            }
+        }
+        const string STYLENAME_PATH = "d:tableStyleInfo/@name";
+        /// <summary>
+        /// The style name for custum styles
+        /// </summary>
+        public string StyleName
+        {
+            get
+            {
+                return GetXmlNodeString(STYLENAME_PATH);
+            }
+            set
+            {
+                if (value.StartsWith("TableStyle"))
+                {
+                    try
+                    {
+                        _tableStyle = (TableStyles)Enum.Parse(typeof(TableStyles), value.Substring(10,value.Length-10), true);
+                    }
+                    catch
+                    {
+                        _tableStyle = TableStyles.Custom;
+                    }
+                }
+                else if (value == "None")
+                {
+                    _tableStyle = TableStyles.None;
+                    value = "";
+                }
+                else
+                {
+                    _tableStyle = TableStyles.Custom;
+                }
+                SetXmlNodeString(STYLENAME_PATH,value,true);
+            }
+        }
+        const string SHOWFIRSTCOLUMN_PATH = "d:tableStyleInfo/@showFirstColumn";
+        /// <summary>
+        /// Display special formatting for the first row
+        /// </summary>
+        public bool ShowFirstColumn
+        {
+            get
+            {
+                return GetXmlNodeBool(SHOWFIRSTCOLUMN_PATH);
+            }
+            set
+            {
+                SetXmlNodeBool(SHOWFIRSTCOLUMN_PATH, value, false);
+            }   
+        }
+        const string SHOWLASTCOLUMN_PATH = "d:tableStyleInfo/@showLastColumn";
+        /// <summary>
+        /// Display special formatting for the last row
+        /// </summary>
+        public bool ShowLastColumn
+        {
+            get
+            {
+                return GetXmlNodeBool(SHOWLASTCOLUMN_PATH);
+            }
+            set
+            {
+                SetXmlNodeBool(SHOWLASTCOLUMN_PATH, value, false);
+            }
+        }
+        const string SHOWROWSTRIPES_PATH = "d:tableStyleInfo/@showRowStripes";
+        /// <summary>
+        /// Display banded rows
+        /// </summary>
+        public bool ShowRowStripes
+        {
+            get
+            {
+                return GetXmlNodeBool(SHOWROWSTRIPES_PATH);
+            }
+            set
+            {
+                SetXmlNodeBool(SHOWROWSTRIPES_PATH, value, false);
+            }
+        }
+        const string SHOWCOLUMNSTRIPES_PATH = "d:tableStyleInfo/@showColumnStripes";
+        /// <summary>
+        /// Display banded columns
+        /// </summary>
+        public bool ShowColumnStripes
+        {
+            get
+            {
+                return GetXmlNodeBool(SHOWCOLUMNSTRIPES_PATH);
+            }
+            set
+            {
+                SetXmlNodeBool(SHOWCOLUMNSTRIPES_PATH, value, false);
+            }
+        }
+
+        const string TOTALSROWCELLSTYLE_PATH = "@totalsRowCellStyle";
+        /// <summary>
+        /// Named style used for the total row
+        /// </summary>
+        public string TotalsRowCellStyle
+        {
+            get
+            {
+                return GetXmlNodeString(TOTALSROWCELLSTYLE_PATH);
+            }
+            set
+            {
+                if (WorkSheet.Workbook.Styles.NamedStyles.FindIndexByID(value) < 0)
+                {
+                    throw (new Exception(string.Format("Named style {0} does not exist.", value)));
+                }
+                SetXmlNodeString(TopNode, TOTALSROWCELLSTYLE_PATH, value, true);
+
+                if (ShowTotal)
+                {
+                    WorkSheet.Cells[Address._toRow, Address._fromCol, Address._toRow, Address._toCol].StyleName = value;
+                }
+            }
+        }
+        const string DATACELLSTYLE_PATH = "@dataCellStyle";
+        /// <summary>
+        /// Named style used for the data cells
+        /// </summary>
+        public string DataCellStyleName
+        {
+            get
+            {
+                return GetXmlNodeString(DATACELLSTYLE_PATH);
+            }
+            set
+            {
+                if (WorkSheet.Workbook.Styles.NamedStyles.FindIndexByID(value) < 0)
+                {
+                    throw (new Exception(string.Format("Named style {0} does not exist.", value)));
+                }
+                SetXmlNodeString(TopNode, DATACELLSTYLE_PATH, value, true);
+
+                int fromRow = Address._fromRow + (ShowHeader ? 1 : 0),
+                    toRow = Address._toRow - (ShowTotal ? 1 : 0);
+
+                if (fromRow < toRow)
+                {
+                    WorkSheet.Cells[fromRow, Address._fromCol, toRow, Address._toCol].StyleName = value;
+                }
+            }
+        }
+        const string HEADERROWCELLSTYLE_PATH = "@headerRowCellStyle";
+        /// <summary>
+        /// Named style used for the header row
+        /// </summary>
+        public string HeaderRowCellStyle
+        {
+            get
+            {
+                return GetXmlNodeString(HEADERROWCELLSTYLE_PATH);
+            }
+            set
+            {
+                if (WorkSheet.Workbook.Styles.NamedStyles.FindIndexByID(value) < 0)
+                {
+                    throw (new Exception(string.Format("Named style {0} does not exist.", value)));
+                }
+                SetXmlNodeString(TopNode, HEADERROWCELLSTYLE_PATH, value, true);
+
+                if (ShowHeader)
+                {
+                    WorkSheet.Cells[Address._fromRow, Address._fromCol, Address._fromRow, Address._toCol].StyleName = value;
+                }
+
+            }
+        }        
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTableCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTableCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTableCollection.cs	(revision 9616)
@@ -0,0 +1,179 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		30-AUG-2010
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO.Packaging;
+using System.Xml;
+
+namespace OfficeOpenXml.Table
+{
+    /// <summary>
+    /// A collection of table objects
+    /// </summary>
+    public class ExcelTableCollection : IEnumerable<ExcelTable>
+    {
+        List<ExcelTable> _tables = new List<ExcelTable>();
+        internal Dictionary<string, int> _tableNames = new Dictionary<string, int>();
+        ExcelWorksheet _ws;        
+        internal ExcelTableCollection(ExcelWorksheet ws)
+        {
+            Package pck = ws._package.Package;
+            _ws = ws;
+            foreach(XmlElement node in ws.WorksheetXml.SelectNodes("//d:tableParts/d:tablePart", ws.NameSpaceManager))
+            {
+                var rel = ws.Part.GetRelationship(node.GetAttribute("id",ExcelPackage.schemaRelationships));
+                var tbl = new ExcelTable(rel, ws);
+                if (tbl.Id + 1 > _ws.Workbook._nextTableID) _ws.Workbook._nextTableID = tbl.Id + 1;
+                _tableNames.Add(tbl.Name, _tables.Count);
+                _tables.Add(tbl);
+            }
+        }
+        private ExcelTable Add(ExcelTable tbl)
+        {
+            _tables.Add(tbl);
+            _tableNames.Add(tbl.Name, _tables.Count - 1);
+            if (tbl.Id >= _ws.Workbook._nextTableID)
+            {
+                _ws.Workbook._nextTableID = tbl.Id + 1;
+            }
+            return tbl;
+        }
+
+        /// <summary>
+        /// Create a table on the supplied range
+        /// </summary>
+        /// <param name="Range">The range address including header and total row</param>
+        /// <param name="Name">The name of the table. Must be unique </param>
+        /// <returns>The table object</returns>
+        public ExcelTable Add(ExcelAddressBase Range, string Name)
+        {
+            if (string.IsNullOrEmpty(Name))
+            {
+                Name = GetNewTableName();
+            }
+            else if (_ws.Workbook.ExistsTableName(Name))
+            {
+                throw (new ArgumentException("Tablename is not unique"));
+            }
+            foreach (var t in _tables)
+            {
+                if (t.Address.Collide(Range) != ExcelAddressBase.eAddressCollition.No)
+                {
+                    throw (new ArgumentException(string.Format("Table range collides with table {0}", t.Name)));
+                }
+            }
+            return Add(new ExcelTable(_ws, Range, Name, _ws.Workbook._nextTableID));
+        }
+
+        internal string GetNewTableName()
+        {
+            string name = "Table1";
+            int i = 2;
+            while (_ws.Workbook.ExistsTableName(name))
+            {
+                name = string.Format("Table{0}", i++);
+            }
+            return name;
+        }
+        /// <summary>
+        /// Number of items in the collection
+        /// </summary>
+        public int Count
+        {
+            get
+            {
+                return _tables.Count;
+            }
+        }
+        /// <summary>
+        /// Get the table object from a range.
+        /// </summary>
+        /// <param name="Range">The range</param>
+        /// <returns>The table. Null if no range matches</returns>
+        public ExcelTable GetFromRange(ExcelRangeBase Range)
+        {
+            foreach (var tbl in Range.Worksheet.Tables)
+            {
+                if (tbl.Address._address == Range._address)
+                {
+                    return tbl;
+                }
+            }
+            return null;
+        }
+        /// <summary>
+        /// The table Index. Base 0.
+        /// </summary>
+        /// <param name="Index"></param>
+        /// <returns></returns>
+        public ExcelTable this[int Index]
+        {
+            get
+            {
+                if (Index < 0 || Index >= _tables.Count)
+                {
+                    throw (new ArgumentOutOfRangeException("Table index out of range"));
+                }
+                return _tables[Index];
+            }
+        }
+        /// <summary>
+        /// Indexer
+        /// </summary>
+        /// <param name="Name">The name of the table</param>
+        /// <returns>The table. Null if the table name is not found in the collection</returns>
+        public ExcelTable this[string Name]
+        {
+            get
+            {
+                if (_tableNames.ContainsKey(Name))
+                {
+                    return _tables[_tableNames[Name]];
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+        public IEnumerator<ExcelTable> GetEnumerator()
+        {
+            return _tables.GetEnumerator();
+        }
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _tables.GetEnumerator();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTableColumn.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTableColumn.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTableColumn.cs	(revision 9616)
@@ -0,0 +1,218 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		30-AUG-2010
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Table
+{
+    /// <summary>
+    /// Build-in table row functions
+    /// </summary>
+    public enum RowFunctions
+    {
+        Average,        
+        Count,
+        CountNums,
+        Custom,
+        Max,
+        Min,
+        None,
+        StdDev,
+        Sum,
+        Var
+    }
+
+    /// <summary>
+    /// A table column
+    /// </summary>
+    public class ExcelTableColumn : XmlHelper
+    {
+        ExcelTable _tbl;
+        internal ExcelTableColumn(XmlNamespaceManager ns, XmlNode topNode, ExcelTable tbl, int pos) :
+            base(ns, topNode)
+        {
+            _tbl = tbl;
+            Position = pos;
+        }
+        /// <summary>
+        /// The column id
+        /// </summary>
+        public int Id 
+        {
+            get
+            {
+                return GetXmlNodeInt("@id");
+            }
+            set
+            {
+                SetXmlNodeString("@id", value.ToString());
+            }
+        }
+        /// <summary>
+        /// The position of the column
+        /// </summary>
+        public int Position
+        {
+            get;
+            private set;
+        }
+        /// <summary>
+        /// The name of the column
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return GetXmlNodeString("@name");
+            }
+            set
+            {
+                SetXmlNodeString("@name", value);
+            }
+        }
+        /// <summary>
+        /// A string text in the total row
+        /// </summary>
+        public string TotalsRowLabel
+        {
+            get
+            {
+                return GetXmlNodeString("@totalsRowLabel");
+            }
+            set
+            {
+                SetXmlNodeString("@totalsRowLabel", value);
+            }
+        }
+        /// <summary>
+        /// Build-in total row functions.
+        /// To set a custom Total row formula use the TotalsRowFormula property
+        /// <seealso cref="TotalsRowFormula"/>
+        /// </summary>
+        public RowFunctions TotalsRowFunction
+        {
+            get
+            {
+                if (GetXmlNodeString("@totalsRowFunction") == "")
+                {
+                    return RowFunctions.None;
+                }
+                else
+                {
+                    return (RowFunctions)Enum.Parse(typeof(RowFunctions), GetXmlNodeString("@totalsRowFunction"), true);
+                }
+            }
+            set
+            {
+                if (value == RowFunctions.Custom)
+                {
+                    throw(new Exception("Use the TotalsRowFormula-property to set a custom table formula"));
+                }
+                string s = value.ToString();
+                s = s.Substring(0, 1).ToLower() + s.Substring(1, s.Length - 1);
+                SetXmlNodeString("@totalsRowFunction", s);
+            }
+        }
+        const string TOTALSROWFORMULA_PATH = "d:totalsRowFormula";
+        /// <summary>
+        /// Sets a custom Totals row Formula.
+        /// Be carefull with this property since it is not validated. 
+        /// <example>
+        /// tbl.Columns[9].TotalsRowFormula = string.Format("SUM([{0}])",tbl.Columns[9].Name);
+        /// </example>
+        /// </summary>
+        public string TotalsRowFormula
+        {
+            get
+            {
+                return GetXmlNodeString(TOTALSROWFORMULA_PATH);
+            }
+            set
+            {
+                if (value.StartsWith("=")) value = value.Substring(1, value.Length - 1);
+                SetXmlNodeString("@totalsRowFunction", "custom");                
+                SetXmlNodeString(TOTALSROWFORMULA_PATH, value);
+            }
+        }
+        const string DATACELLSTYLE_PATH = "@dataCellStyle";
+        /// <summary>
+        /// The named style for datacells in the column
+        /// </summary>
+        public string DataCellStyleName
+        {
+            get
+            {
+                return GetXmlNodeString(DATACELLSTYLE_PATH);
+            }
+            set
+            {
+                if(_tbl.WorkSheet.Workbook.Styles.NamedStyles.FindIndexByID(value)<0)
+                {
+                    throw(new Exception(string.Format("Named style {0} does not exist.",value)));
+                }
+                SetXmlNodeString(TopNode, DATACELLSTYLE_PATH, value,true);
+               
+                int fromRow=_tbl.Address._fromRow + (_tbl.ShowHeader?1:0),
+                    toRow=_tbl.Address._toRow - (_tbl.ShowTotal?1:0),
+                    col=_tbl.Address._fromCol+Position;
+
+                if (fromRow < toRow)
+                {
+                    _tbl.WorkSheet.Cells[fromRow, col, toRow, col].StyleName = value;
+                }
+            }
+        }
+  		const string CALCULATEDCOLUMNFORMULA_PATH = "d:calculatedColumnFormula";
+ 		/// <summary>
+ 		/// Sets a calculated column Formula.
+ 		/// Be carefull with this property since it is not validated. 
+ 		/// <example>
+ 		/// tbl.Columns[9].CalculatedColumnFormula = string.Format("SUM(MyDataTable[[#This Row],[{0}]])",tbl.Columns[9].Name);
+ 		/// </example>
+ 		/// </summary>
+ 		public string CalculatedColumnFormula
+ 		{
+ 			get
+ 			{
+ 				return GetXmlNodeString(CALCULATEDCOLUMNFORMULA_PATH);
+ 			}
+ 			set
+ 			{
+ 				if (value.StartsWith("=")) value = value.Substring(1, value.Length - 1);
+ 				SetXmlNodeString(CALCULATEDCOLUMNFORMULA_PATH, value);
+ 			}
+ 		}
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTableColumnCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTableColumnCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/ExcelTableColumnCollection.cs	(revision 9616)
@@ -0,0 +1,119 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		30-AUG-2010
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Table
+{
+    /// <summary>
+    /// A collection of table columns
+    /// </summary>
+    public class ExcelTableColumnCollection : IEnumerable<ExcelTableColumn>
+    {
+        List<ExcelTableColumn> _cols = new List<ExcelTableColumn>();
+        Dictionary<string, int> _colNames = new Dictionary<string, int>();
+        public ExcelTableColumnCollection(ExcelTable table)
+        {
+            Table = table;
+            foreach(XmlNode node in table.TableXml.SelectNodes("//d:table/d:tableColumns/d:tableColumn",table.NameSpaceManager))
+            {                
+                _cols.Add(new ExcelTableColumn(table.NameSpaceManager, node, table, _cols.Count));
+                _colNames.Add(_cols[_cols.Count - 1].Name, _cols.Count - 1);
+            }
+        }
+        /// <summary>
+        /// A reference to the table object
+        /// </summary>
+        public ExcelTable Table
+        {
+            get;
+            private set;
+        }
+        /// <summary>
+        /// Number of items in the collection
+        /// </summary>
+        public int Count
+        {
+            get
+            {
+                return _cols.Count;
+            }
+        }
+        /// <summary>
+        /// The column Index. Base 0.
+        /// </summary>
+        /// <param name="Index"></param>
+        /// <returns></returns>
+        public ExcelTableColumn this[int Index]
+        {
+            get
+            {
+                if (Index < 0 || Index >= _cols.Count)
+                {
+                    throw (new ArgumentOutOfRangeException("Column index out of range"));
+                }
+                return _cols[Index] as ExcelTableColumn;
+            }
+        }
+        /// <summary>
+        /// Indexer
+        /// </summary>
+        /// <param name="Name">The name of the table</param>
+        /// <returns>The table column. Null if the table name is not found in the collection</returns>
+        public ExcelTableColumn this[string Name]
+        {
+            get
+            {
+                if (_colNames.ContainsKey(Name))
+                {
+                    return _cols[_colNames[Name]];
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+
+        IEnumerator<ExcelTableColumn> IEnumerable<ExcelTableColumn>.GetEnumerator()
+        {
+            return _cols.GetEnumerator();
+        }
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _cols.GetEnumerator();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotCacheDefinition.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotCacheDefinition.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotCacheDefinition.cs	(revision 9616)
@@ -0,0 +1,264 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		21-MAR-2011
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using System.Linq;
+namespace OfficeOpenXml.Table.PivotTable
+{
+    public enum eSourceType
+    {
+        /// <summary>
+        /// Indicates that the cache contains data that consolidates ranges.
+        /// </summary>
+        Consolidation,
+        /// <summary>
+        /// Indicates that the cache contains data from an external data source.
+        /// </summary>
+        External,
+        /// <summary>
+        /// Indicates that the cache contains a scenario summary report
+        /// </summary>
+        Scenario,
+        /// <summary>
+        /// Indicates that the cache contains worksheet data
+        /// </summary>
+        Worksheet
+    }
+    /// <summary>
+    /// Cache definition. This class defines the source data. Note that one cache definition can be shared between many pivot tables.
+    /// </summary>
+    public class ExcelPivotCacheDefinition : XmlHelper
+    {
+        internal ExcelPivotCacheDefinition(XmlNamespaceManager ns, ExcelPivotTable pivotTable) :
+            base(ns, null)
+        {
+            foreach (var r in pivotTable.Part.GetRelationshipsByType(ExcelPackage.schemaRelationships + "/pivotCacheDefinition"))
+            {
+                Relationship = r;
+            }
+            CacheDefinitionUri = PackUriHelper.ResolvePartUri(Relationship.SourceUri, Relationship.TargetUri);
+
+            var pck = pivotTable.WorkSheet._package.Package;
+            Part = pck.GetPart(CacheDefinitionUri);
+            CacheDefinitionXml = new XmlDocument();
+            LoadXmlSafe(CacheDefinitionXml, Part.GetStream());
+
+            TopNode = CacheDefinitionXml.DocumentElement;
+            PivotTable = pivotTable;
+            if (CacheSource == eSourceType.Worksheet)
+            {
+                var worksheetName = GetXmlNodeString(_sourceWorksheetPath);
+                if (pivotTable.WorkSheet.Workbook.Worksheets.Any(t => t.Name == worksheetName))
+                {
+                    _sourceRange = pivotTable.WorkSheet.Workbook.Worksheets[worksheetName].Cells[GetXmlNodeString(_sourceAddressPath)];
+                }
+            }
+        }
+        internal ExcelPivotCacheDefinition(XmlNamespaceManager ns, ExcelPivotTable pivotTable, ExcelRangeBase sourceAddress, int tblId) :
+            base(ns, null)
+        {
+            PivotTable = pivotTable;
+
+            var pck = pivotTable.WorkSheet._package.Package;
+            
+            //CacheDefinition
+            CacheDefinitionXml = new XmlDocument();
+            LoadXmlSafe(CacheDefinitionXml, GetStartXml(sourceAddress), Encoding.UTF8);
+            CacheDefinitionUri = GetNewUri(pck, "/xl/pivotCache/pivotCacheDefinition{0}.xml", tblId); 
+            Part = pck.CreatePart(CacheDefinitionUri, ExcelPackage.schemaPivotCacheDefinition);
+            TopNode = CacheDefinitionXml.DocumentElement;
+
+            //CacheRecord. Create an empty one.
+            CacheRecordUri = GetNewUri(pck, "/xl/pivotCache/pivotCacheRecords{0}.xml", tblId); 
+            var cacheRecord = new XmlDocument();
+            cacheRecord.LoadXml("<pivotCacheRecords xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" count=\"0\" />");
+            var recPart = pck.CreatePart(CacheRecordUri, ExcelPackage.schemaPivotCacheRecords);
+            cacheRecord.Save(recPart.GetStream());
+
+            RecordRelationship = Part.CreateRelationship(PackUriHelper.ResolvePartUri(CacheDefinitionUri, CacheRecordUri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/pivotCacheRecords");
+            RecordRelationshipID = RecordRelationship.Id;
+
+            CacheDefinitionXml.Save(Part.GetStream());
+        }        
+        /// <summary>
+        /// Reference to the internal package part
+        /// </summary>
+        internal PackagePart Part
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// Provides access to the XML data representing the cache definition in the package.
+        /// </summary>
+        public XmlDocument CacheDefinitionXml { get; private set; }
+        /// <summary>
+        /// The package internal URI to the pivottable cache definition Xml Document.
+        /// </summary>
+        public Uri CacheDefinitionUri
+        {
+            get;
+            internal set;
+        }
+        internal Uri CacheRecordUri
+        {
+            get;
+            set;
+        }
+        internal PackageRelationship Relationship
+        {
+            get;
+            set;
+        }
+        internal PackageRelationship RecordRelationship
+        {
+            get;
+            set;
+        }
+        internal string RecordRelationshipID 
+        {
+            get
+            {
+                return GetXmlNodeString("@r:id");
+            }
+            set
+            {
+                SetXmlNodeString("@r:id", value);
+            }
+        }
+        /// <summary>
+        /// Referece to the PivoTable object
+        /// </summary>
+        public ExcelPivotTable PivotTable
+        {
+            get;
+            private set;
+        }
+        
+        const string _sourceWorksheetPath="d:cacheSource/d:worksheetSource/@sheet";
+        const string _sourceAddressPath = "d:cacheSource/d:worksheetSource/@ref";
+        internal ExcelRangeBase _sourceRange = null;
+        /// <summary>
+        /// The source data range when the pivottable has a worksheet datasource. 
+        /// The number of columns in the range must be intact if this property is changed.
+        /// The range must be in the same workbook as the pivottable.
+        /// </summary>
+        public ExcelRangeBase SourceRange
+        {
+            get
+            {
+                if (_sourceRange == null)
+                {
+                    if (CacheSource == eSourceType.Worksheet)
+                    {
+                        var ws = PivotTable.WorkSheet.Workbook.Worksheets[GetXmlNodeString(_sourceWorksheetPath)];
+                        if (ws != null)
+                        {
+                            _sourceRange = ws.Cells[GetXmlNodeString(_sourceAddressPath)];
+                        }
+                    }
+                    else
+                    {
+                        throw (new ArgumentException("The cachesource is not a worksheet"));
+                    }
+                }
+                return _sourceRange;
+            }
+            set
+            {
+                if (PivotTable.WorkSheet.Workbook != value.Worksheet.Workbook)
+                {
+                    throw (new ArgumentException("Range must be in the same package as the pivottable"));
+                }
+
+                var sr=SourceRange;
+                if (value.End.Column - value.Start.Column != sr.End.Column - sr.Start.Column)
+                {
+                    throw (new ArgumentException("Can not change the number of columns(fields) in the SourceRange"));
+                }
+
+                SetXmlNodeString(_sourceWorksheetPath, value.Worksheet.Name);
+                SetXmlNodeString(_sourceAddressPath, value.FirstAddress);
+                _sourceRange = value;
+            }
+        }
+        /// <summary>
+        /// Type of source data
+        /// </summary>
+        public eSourceType CacheSource
+        {
+            get
+            {
+                var s=GetXmlNodeString("d:cacheSource/@type");
+                if (s == "")
+                {
+                    return eSourceType.Worksheet;
+                }
+                else
+                {
+                    return (eSourceType)Enum.Parse(typeof(eSourceType), s, true);
+                }
+            }
+        }
+        private string GetStartXml(ExcelRangeBase sourceAddress)
+        {
+            string xml="<pivotCacheDefinition xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" r:id=\"\" refreshOnLoad=\"1\" refreshedBy=\"SomeUser\" refreshedDate=\"40504.582403125001\" createdVersion=\"1\" refreshedVersion=\"3\" recordCount=\"5\" upgradeOnRefresh=\"1\">";
+
+            xml += "<cacheSource type=\"worksheet\">";
+            xml += string.Format("<worksheetSource ref=\"{0}\" sheet=\"{1}\" /> ", sourceAddress.Address, sourceAddress.WorkSheet);
+            xml += "</cacheSource>";
+            xml += string.Format("<cacheFields count=\"{0}\">", sourceAddress._toCol - sourceAddress._fromCol + 1);
+            var sourceWorksheet = PivotTable.WorkSheet.Workbook.Worksheets[sourceAddress.WorkSheet];
+            for (int col = sourceAddress._fromCol; col <= sourceAddress._toCol; col++)
+            {
+                if (sourceWorksheet == null || sourceWorksheet.Cell(sourceAddress._fromRow, col).Value == null || sourceWorksheet.Cell(sourceAddress._fromRow, col).Value.ToString().Trim() == "")
+                {
+                    xml += string.Format("<cacheField name=\"Column{0}\" numFmtId=\"0\">", col - sourceAddress._fromCol + 1);
+                }
+                else
+                {
+                    xml += string.Format("<cacheField name=\"{0}\" numFmtId=\"0\">", sourceWorksheet.Cell(sourceAddress._fromRow, col).Value);
+                }
+                //xml += "<sharedItems containsNonDate=\"0\" containsString=\"0\" containsBlank=\"1\" /> ";
+                xml += "<sharedItems containsBlank=\"1\" /> ";
+                xml += "</cacheField>";
+            }
+            xml += "</cacheFields>";
+            xml += "</pivotCacheDefinition>";
+
+            return xml;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTable.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTable.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTable.cs	(revision 9616)
@@ -0,0 +1,949 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		21-MAR-2011
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.IO.Packaging;
+using System.Text.RegularExpressions;
+using OfficeOpenXml.Table;
+
+namespace OfficeOpenXml.Table.PivotTable
+{
+    /// <summary>
+    /// An Excel Pivottable
+    /// </summary>
+    public class ExcelPivotTable : XmlHelper
+    {
+        internal ExcelPivotTable(PackageRelationship rel, ExcelWorksheet sheet) : 
+            base(sheet.NameSpaceManager)
+        {
+            WorkSheet = sheet;
+            PivotTableUri = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+            Relationship = rel;
+            var pck = sheet._package.Package;
+            Part=pck.GetPart(PivotTableUri);
+
+            PivotTableXml = new XmlDocument();
+            LoadXmlSafe(PivotTableXml, Part.GetStream());
+            init();
+            TopNode = PivotTableXml.DocumentElement;
+            Address = new ExcelAddressBase(GetXmlNodeString("d:location/@ref"));
+
+            _cacheDefinition = new ExcelPivotCacheDefinition(sheet.NameSpaceManager, this);
+            LoadFields();
+
+            //Add row fields.
+            foreach (XmlElement rowElem in TopNode.SelectNodes("d:rowFields/d:field", NameSpaceManager))
+            {
+                int x;
+                if (int.TryParse(rowElem.GetAttribute("x"), out x) && x >= 0)
+                {
+                    RowFields.AddInternal(Fields[x]);
+                }
+                else
+                {
+                    rowElem.ParentNode.RemoveChild(rowElem);
+                }
+            }
+
+            ////Add column fields.
+            foreach (XmlElement colElem in TopNode.SelectNodes("d:colFields/d:field", NameSpaceManager))
+            {
+                int x;
+                if(int.TryParse(colElem.GetAttribute("x"),out x) && x >= 0)
+                {
+                    ColumnFields.AddInternal(Fields[x]);
+                }
+                else
+                {
+                    colElem.ParentNode.RemoveChild(colElem);
+                }
+            }
+
+            //Add Page elements
+            //int index = 0;
+            foreach (XmlElement pageElem in TopNode.SelectNodes("d:pageFields/d:pageField", NameSpaceManager))
+            {
+                int fld;
+                if (int.TryParse(pageElem.GetAttribute("fld"), out fld) && fld >= 0)
+                {
+                    var field = Fields[fld];
+                    field._pageFieldSettings = new ExcelPivotTablePageFieldSettings(NameSpaceManager, pageElem, field, fld);
+                    PageFields.AddInternal(field);
+                }
+            }
+
+            //Add data elements
+            //index = 0;
+            foreach (XmlElement dataElem in TopNode.SelectNodes("d:dataFields/d:dataField", NameSpaceManager))
+            {
+                int fld;
+                if (int.TryParse(dataElem.GetAttribute("fld"), out fld) && fld >= 0)
+                {
+                    var field = Fields[fld];
+                    var dataField = new ExcelPivotTableDataField(NameSpaceManager, dataElem, field);
+                    DataFields.AddInternal(dataField);
+                }
+            }
+        }
+        /// <summary>
+        /// Add a new pivottable
+        /// </summary>
+        /// <param name="sheet">The worksheet</param>
+        /// <param name="address">the address of the pivottable</param>
+        /// <param name="sourceAddress">The address of the Source data</param>
+        /// <param name="name"></param>
+        /// <param name="tblId"></param>
+        internal ExcelPivotTable(ExcelWorksheet sheet, ExcelAddressBase address,ExcelRangeBase sourceAddress, string name, int tblId) : 
+            base(sheet.NameSpaceManager)
+	    {
+            WorkSheet = sheet;
+            Address = address;
+            var pck = sheet._package.Package;
+
+            PivotTableXml = new XmlDocument();
+            LoadXmlSafe(PivotTableXml, GetStartXml(name, tblId, address, sourceAddress), Encoding.UTF8);
+            TopNode = PivotTableXml.DocumentElement;
+            PivotTableUri =  GetNewUri(pck, "/xl/pivotTables/pivotTable{0}.xml", tblId);
+            init();
+
+            Part = pck.CreatePart(PivotTableUri, ExcelPackage.schemaPivotTable);
+            PivotTableXml.Save(Part.GetStream());
+            
+            //Worksheet-Pivottable relationship
+            Relationship = sheet.Part.CreateRelationship(PackUriHelper.ResolvePartUri(sheet.WorksheetUri, PivotTableUri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/pivotTable");
+
+            _cacheDefinition = new ExcelPivotCacheDefinition(sheet.NameSpaceManager, this, sourceAddress, tblId);
+            _cacheDefinition.Relationship=Part.CreateRelationship(PackUriHelper.ResolvePartUri(PivotTableUri, _cacheDefinition.CacheDefinitionUri), TargetMode.Internal, ExcelPackage.schemaRelationships + "/pivotCacheDefinition");
+
+            sheet.Workbook.AddPivotTable(CacheID.ToString(), _cacheDefinition.CacheDefinitionUri);
+
+            LoadFields();
+
+            using (var r=sheet.Cells[address.Address])
+            {
+                r.Clear();
+            }
+        }
+        private void init()
+        {
+            SchemaNodeOrder = new string[] { "location", "pivotFields", "rowFields", "rowItems", "colFields", "colItems", "pageFields", "pageItems", "dataFields", "dataItems", "formats", "pivotTableStyleInfo" };
+        }
+        private void LoadFields()
+        {
+            //Fields.Clear();
+            //int ix=0;
+            //foreach(XmlElement fieldNode in PivotXml.SelectNodes("//d:pivotFields/d:pivotField",NameSpaceManager))
+            //{
+            //    Fields.AddInternal(new ExcelPivotTableField(NameSpaceManager, fieldNode, this, ix++));
+            //}
+
+            int index = 0;
+            //Add fields.
+            foreach (XmlElement fieldElem in TopNode.SelectNodes("d:pivotFields/d:pivotField", NameSpaceManager))
+            {
+                var fld = new ExcelPivotTableField(NameSpaceManager, fieldElem, this, index, index++);
+                Fields.AddInternal(fld);
+            }
+
+            //Add fields.
+            index = 0;
+            foreach (XmlElement fieldElem in _cacheDefinition.TopNode.SelectNodes("d:cacheFields/d:cacheField", NameSpaceManager))
+            {
+                var fld = Fields[index++];
+                fld.SetCacheFieldNode(fieldElem);
+            }
+
+
+        }
+        private string GetStartXml(string name, int id, ExcelAddressBase address, ExcelAddressBase sourceAddress)
+        {
+            string xml = string.Format("<pivotTableDefinition xmlns=\"http://schemas.openxmlformats.org/spreadsheetml/2006/main\" name=\"{0}\" cacheId=\"{1}\" dataOnRows=\"1\" applyNumberFormats=\"0\" applyBorderFormats=\"0\" applyFontFormats=\"0\" applyPatternFormats=\"0\" applyAlignmentFormats=\"0\" applyWidthHeightFormats=\"1\" dataCaption=\"Data\"  createdVersion=\"4\" showMemberPropertyTips=\"0\" useAutoFormatting=\"1\" itemPrintTitles=\"1\" indent=\"0\" compact=\"0\" compactData=\"0\" gridDropZones=\"1\">", name, id);
+
+            xml += string.Format("<location ref=\"{0}\" firstHeaderRow=\"1\" firstDataRow=\"1\" firstDataCol=\"1\" /> ", address.FirstAddress);
+            xml += string.Format("<pivotFields count=\"{0}\">", sourceAddress._toCol-sourceAddress._fromCol+1);
+            for (int col = sourceAddress._fromCol; col <= sourceAddress._toCol; col++)
+            {
+                xml += "<pivotField showAll=\"0\" />"; //compact=\"0\" outline=\"0\" subtotalTop=\"0\" includeNewItemsInFilter=\"1\"     
+            }
+
+            xml += "</pivotFields>";
+            xml += "<pivotTableStyleInfo name=\"PivotStyleMedium9\" showRowHeaders=\"1\" showColHeaders=\"1\" showRowStripes=\"0\" showColStripes=\"0\" showLastColumn=\"1\" />";
+            xml += "</pivotTableDefinition>";
+            return xml;
+        }
+        internal PackagePart Part
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// Provides access to the XML data representing the pivottable in the package.
+        /// </summary>
+        public XmlDocument PivotTableXml { get; private set; }
+        /// <summary>
+        /// The package internal URI to the pivottable Xml Document.
+        /// </summary>
+        public Uri PivotTableUri
+        {
+            get;
+            internal set;
+        }
+        internal PackageRelationship Relationship
+        {
+            get;
+            set;
+        }
+        const string ID_PATH = "@id";
+        internal int Id
+        {
+            get
+            {
+                return GetXmlNodeInt(ID_PATH);
+            }
+            set
+            {
+                SetXmlNodeString(ID_PATH, value.ToString());
+            }
+        }
+        const string NAME_PATH = "@name";
+        const string DISPLAY_NAME_PATH = "@displayName";
+        /// <summary>
+        /// Name of the pivottable object in Excel
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return GetXmlNodeString(NAME_PATH);
+            }
+            set
+            {
+                if (WorkSheet.Workbook.ExistsTableName(value))
+                {
+                    throw (new ArgumentException("PivotTable name is not unique"));
+                }
+                string prevName = Name;
+                if (WorkSheet.Tables._tableNames.ContainsKey(prevName))
+                {
+                    int ix = WorkSheet.Tables._tableNames[prevName];
+                    WorkSheet.Tables._tableNames.Remove(prevName);
+                    WorkSheet.Tables._tableNames.Add(value, ix);
+                }
+                SetXmlNodeString(NAME_PATH, value);
+                SetXmlNodeString(DISPLAY_NAME_PATH, cleanDisplayName(value));
+            }
+        }        
+        ExcelPivotCacheDefinition _cacheDefinition = null;
+        /// <summary>
+        /// Reference to the pivot table cache definition object
+        /// </summary>
+        public ExcelPivotCacheDefinition CacheDefinition
+        {
+            get
+            {
+                if (_cacheDefinition == null)
+                {
+                    _cacheDefinition = new ExcelPivotCacheDefinition(NameSpaceManager, this, null, 1);
+                }
+                return _cacheDefinition;
+            }
+        }
+        private string cleanDisplayName(string name)
+        {
+            return Regex.Replace(name, @"[^\w\.-_]", "_");
+        }
+        #region "Public Properties"
+
+        /// <summary>
+        /// The worksheet where the pivottable is located
+        /// </summary>
+        public ExcelWorksheet WorkSheet
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// The location of the pivot table
+        /// </summary>
+        public ExcelAddressBase Address
+        {
+            get;
+            internal set;
+        }
+        /// <summary>
+        /// If multiple datafields are displayed in the row area or the column area
+        /// </summary>
+        public bool DataOnRows 
+        { 
+            get
+            {
+                return GetXmlNodeBool("@dataOnRows");
+            }
+            set
+            {
+                SetXmlNodeBool("@dataOnRows",value);
+            }
+        }
+        /// <summary>
+        /// if true apply legacy table autoformat number format properties.
+        /// </summary>
+        public bool ApplyNumberFormats 
+        { 
+            get
+            {
+                return GetXmlNodeBool("@applyNumberFormats");
+            }
+            set
+            {
+                SetXmlNodeBool("@applyNumberFormats",value);
+            }
+        }
+        /// <summary>
+        /// If true apply legacy table autoformat border properties
+        /// </summary>
+        public bool ApplyBorderFormats 
+        { 
+            get
+            {
+                return GetXmlNodeBool("@applyBorderFormats");
+            }
+            set
+            {
+                SetXmlNodeBool("@applyBorderFormats",value);
+            }
+        }
+        /// <summary>
+        /// If true apply legacy table autoformat font properties
+        /// </summary>
+        public bool ApplyFontFormats
+        { 
+            get
+            {
+                return GetXmlNodeBool("@applyFontFormats");
+            }
+            set
+            {
+                SetXmlNodeBool("@applyFontFormats",value);
+            }
+        }
+        /// <summary>
+        /// If true apply legacy table autoformat pattern properties
+        /// </summary>
+        public bool ApplyPatternFormats
+        { 
+            get
+            {
+                return GetXmlNodeBool("@applyPatternFormats");
+            }
+            set
+            {
+                SetXmlNodeBool("@applyPatternFormats",value);
+            }
+        }
+        /// <summary>
+        /// If true apply legacy table autoformat width/height properties.
+        /// </summary>
+        public bool ApplyWidthHeightFormats
+        { 
+            get
+            {
+                return GetXmlNodeBool("@applyWidthHeightFormats");
+            }
+            set
+            {
+                SetXmlNodeBool("@applyWidthHeightFormats",value);
+            }
+        }
+        /// <summary>
+        /// Show member property information
+        /// </summary>
+        public bool ShowMemberPropertyTips
+        { 
+            get
+            {
+                return GetXmlNodeBool("@showMemberPropertyTips");
+            }
+            set
+            {
+                SetXmlNodeBool("@showMemberPropertyTips",value);
+            }
+        }
+        /// <summary>
+        /// Show the drill indicators
+        /// </summary>
+        public bool ShowCalcMember
+        {
+            get
+            {
+                return GetXmlNodeBool("@showCalcMbrs");
+            }
+            set
+            {
+                SetXmlNodeBool("@showCalcMbrs", value);
+            }
+        }       
+        /// <summary>
+        /// If the user is prevented from drilling down on a PivotItem or aggregate value
+        /// </summary>
+        public bool EnableDrill
+        {
+            get
+            {
+                return GetXmlNodeBool("@enableDrill", true);
+            }
+            set
+            {
+                SetXmlNodeBool("@enableDrill", value);
+            }
+        }
+        /// <summary>
+        /// Show the drill down buttons
+        /// </summary>
+        public bool ShowDrill
+        {
+            get
+            {
+                return GetXmlNodeBool("@showDrill", true);
+            }
+            set
+            {
+                SetXmlNodeBool("@showDrill", value);
+            }
+        }
+        /// <summary>
+        /// If the tooltips should be displayed for PivotTable data cells.
+        /// </summary>
+        public bool ShowDataTips
+        {
+            get
+            {
+                return GetXmlNodeBool("@showDataTips", true);
+            }
+            set
+            {
+                SetXmlNodeBool("@showDataTips", value, true);
+            }
+        }
+        /// <summary>
+        /// If the row and column titles from the PivotTable should be printed.
+        /// </summary>
+        public bool FieldPrintTitles
+        {
+            get
+            {
+                return GetXmlNodeBool("@fieldPrintTitles");
+            }
+            set
+            {
+                SetXmlNodeBool("@fieldPrintTitles", value);
+            }
+        }
+        /// <summary>
+        /// If the row and column titles from the PivotTable should be printed.
+        /// </summary>
+        public bool ItemPrintTitles
+        {
+            get
+            {
+                return GetXmlNodeBool("@itemPrintTitles");
+            }
+            set
+            {
+                SetXmlNodeBool("@itemPrintTitles", value);
+            }
+        }
+        /// <summary>
+        /// If the grand totals should be displayed for the PivotTable columns
+        /// </summary>
+        public bool ColumGrandTotals
+        {
+            get
+            {
+                return GetXmlNodeBool("@colGrandTotals");
+            }
+            set
+            {
+                SetXmlNodeBool("@colGrandTotals", value);
+            }
+        }        
+        /// <summary>
+        /// If the grand totals should be displayed for the PivotTable rows
+        /// </summary>
+        public bool RowGrandTotals
+        {
+            get
+            {
+                return GetXmlNodeBool("@rowGrandTotals");
+            }
+            set
+            {
+                SetXmlNodeBool("@rowGrandTotals", value);
+            }
+        }        
+        /// <summary>
+        /// If the drill indicators expand collapse buttons should be printed.
+        /// </summary>
+        public bool PrintDrill
+        {
+            get
+            {
+                return GetXmlNodeBool("@printDrill");
+            }
+            set
+            {
+                SetXmlNodeBool("@printDrill", value);
+            }
+        }        
+        /// <summary>
+        /// Indicates whether to show error messages in cells.
+        /// </summary>
+        public bool ShowError
+        {
+            get
+            {
+                return GetXmlNodeBool("@showError");
+            }
+            set
+            {
+                SetXmlNodeBool("@showError", value);
+            }
+        }        
+        /// <summary>
+        /// The string to be displayed in cells that contain errors.
+        /// </summary>
+        public string ErrorCaption
+        {
+            get
+            {
+                return GetXmlNodeString("@errorCaption");
+            }
+            set
+            {
+                SetXmlNodeString("@errorCaption", value);
+            }
+        }        
+        /// <summary>
+        /// Specifies the name of the value area field header in the PivotTable. 
+        /// This caption is shown when the PivotTable when two or more fields are in the values area.
+        /// </summary>
+        public string DataCaption
+        {
+            get
+            {
+                return GetXmlNodeString("@dataCaption");
+            }
+            set
+            {
+                SetXmlNodeString("@dataCaption", value);
+            }
+        }        
+        /// <summary>
+        /// Show field headers
+        /// </summary>
+        public bool ShowHeaders
+        {
+            get
+            {
+                return GetXmlNodeBool("@showHeaders");
+            }
+            set
+            {
+                SetXmlNodeBool("@showHeaders", value);
+            }
+        }
+        /// <summary>
+        /// The number of page fields to display before starting another row or column
+        /// </summary>
+        public int PageWrap
+        {
+            get
+            {
+                return GetXmlNodeInt("@pageWrap");
+            }
+            set
+            {
+                if(value<0)
+                {
+                    throw new Exception("Value can't be negative");
+                }
+                SetXmlNodeString("@pageWrap", value.ToString());
+            }
+        }
+        /// <summary>
+        /// A boolean that indicates whether legacy auto formatting has been applied to the PivotTable view
+        /// </summary>
+        public bool UseAutoFormatting
+        { 
+            get
+            {
+                return GetXmlNodeBool("@useAutoFormatting");
+            }
+            set
+            {
+                SetXmlNodeBool("@useAutoFormatting",value);
+            }
+        } 
+        /// <summary>
+        /// A boolean that indicates whether the in-grid drop zones should be displayed at runtime, and whether classic layout is applied
+        /// </summary>
+        public bool GridDropZones
+        { 
+            get
+            {
+                return GetXmlNodeBool("@gridDropZones");
+            }
+            set
+            {
+                SetXmlNodeBool("@gridDropZones",value);
+            }
+        }
+        /// <summary>
+        /// Specifies the indentation increment for compact axis and can be used to set the Report Layout to Compact Form
+        /// </summary>
+        public int Indent
+        { 
+            get
+            {
+                return GetXmlNodeInt("@indent");
+            }
+            set
+            {
+                SetXmlNodeString("@indent",value.ToString());
+            }
+        }
+        /// <summary>
+        /// A boolean that indicates whether data fields in the PivotTable should be displayed in outline form
+        /// </summary>
+        public bool OutlineData
+        {
+            get
+            {
+                return GetXmlNodeBool("@outlineData");
+            }
+            set
+            {
+                SetXmlNodeBool("@outlineData", value);
+            }
+        }
+        /// <summary>
+        /// a boolean that indicates whether new fields should have their outline flag set to true
+        /// </summary>
+        public bool Outline
+        {
+            get
+            {
+                return GetXmlNodeBool("@outline");
+            }
+            set
+            {
+                SetXmlNodeBool("@outline", value);
+            }
+        }
+        /// <summary>
+        /// A boolean that indicates whether the fields of a PivotTable can have multiple filters set on them
+        /// </summary>
+        public bool MultipleFieldFilters
+        {
+            get
+            {
+                return GetXmlNodeBool("@multipleFieldFilters");
+            }
+            set
+            {
+                SetXmlNodeBool("@multipleFieldFilters", value);
+            }
+        }
+        /// <summary>
+        /// A boolean that indicates whether new fields should have their compact flag set to true
+        /// </summary>
+        public bool Compact
+        { 
+            get
+            {
+                return GetXmlNodeBool("@compact");
+            }
+            set
+            {
+                SetXmlNodeBool("@compact",value);
+            }
+        }        
+        /// <summary>
+        /// A boolean that indicates whether the field next to the data field in the PivotTable should be displayed in the same column of the spreadsheet
+        /// </summary>
+        public bool CompactData
+        { 
+            get
+            {
+                return GetXmlNodeBool("@compactData");
+            }
+            set
+            {
+                SetXmlNodeBool("@compactData",value);
+            }
+        }
+        /// <summary>
+        /// Specifies the string to be displayed for grand totals.
+        /// </summary>
+        public string GrandTotalCaption
+        {
+            get
+            {
+                return GetXmlNodeString("@grandTotalCaption");
+            }
+            set
+            {
+                SetXmlNodeString("@grandTotalCaption", value);
+            }
+        }
+        /// <summary>
+        /// Specifies the string to be displayed in row header in compact mode.
+        /// </summary>
+        public string RowHeaderCaption 
+        {
+            get
+            {
+                return GetXmlNodeString("@rowHeaderCaption");
+            }
+            set
+            {
+                SetXmlNodeString("@rowHeaderCaption", value);                
+            }
+        }
+        /// <summary>
+        /// Specifies the string to be displayed in cells with no value
+        /// </summary>
+        public string MissingCaption
+        {
+            get
+            {
+                return GetXmlNodeString("@missingCaption");
+            }
+            set
+            {
+                SetXmlNodeString("@missingCaption", value);                
+            }
+        }
+        const string FIRSTHEADERROW_PATH="d:location/@firstHeaderRow";
+        /// <summary>
+        /// Specifies the first row of the PivotTable header, relative to the top left cell in the ref value
+        /// </summary>
+        public int FirstHeaderRow
+        {
+            get
+            {
+                return GetXmlNodeInt(FIRSTHEADERROW_PATH);
+            }
+            set
+            {
+                SetXmlNodeString(FIRSTHEADERROW_PATH, value.ToString());
+            }
+        }
+        const string FIRSTDATAROW_PATH = "d:location/@firstDataRow";
+        /// <summary>
+        /// Specifies the first column of the PivotTable data, relative to the top left cell in the ref value
+        /// </summary>
+        public int FirstDataRow
+        {
+            get
+            {
+                return GetXmlNodeInt(FIRSTDATAROW_PATH);
+            }
+            set
+            {
+                SetXmlNodeString(FIRSTDATAROW_PATH, value.ToString());
+            }
+        }
+        const string FIRSTDATACOL_PATH = "d:location/@firstDataCol";
+        /// <summary>
+        /// Specifies the first column of the PivotTable data, relative to the top left cell in the ref value
+        /// </summary>
+        public int FirstDataCol
+        {
+            get
+            {
+                return GetXmlNodeInt(FIRSTDATACOL_PATH);
+            }
+            set
+            {
+                SetXmlNodeString(FIRSTDATACOL_PATH, value.ToString());
+            }
+        }
+        ExcelPivotTableFieldCollection _fields = null;
+        /// <summary>
+        /// The fields in the table 
+        /// </summary>
+        public ExcelPivotTableFieldCollection Fields
+        {
+            get
+            {
+                if (_fields == null)
+                {
+                    _fields = new ExcelPivotTableFieldCollection(this, "");
+                }
+                return _fields;
+            }
+        }
+        ExcelPivotTableRowColumnFieldCollection _rowFields = null;
+        /// <summary>
+        /// Row label fields 
+        /// </summary>
+        public ExcelPivotTableRowColumnFieldCollection RowFields
+        {
+            get
+            {
+                if (_rowFields == null)
+                {
+                    _rowFields = new ExcelPivotTableRowColumnFieldCollection(this, "rowFields");
+                }
+                return _rowFields;
+            }
+        }
+        ExcelPivotTableRowColumnFieldCollection _columnFields = null;
+        /// <summary>
+        /// Column label fields 
+        /// </summary>
+        public ExcelPivotTableRowColumnFieldCollection ColumnFields
+        {
+            get
+            {
+                if (_columnFields == null)
+                {
+                    _columnFields = new ExcelPivotTableRowColumnFieldCollection(this, "colFields");
+                }
+                return _columnFields;
+            }
+        }
+        ExcelPivotTableDataFieldCollection _dataFields = null;
+        /// <summary>
+        /// Value fields 
+        /// </summary>
+        public ExcelPivotTableDataFieldCollection DataFields
+        {
+            get
+            {
+                if (_dataFields == null)
+                {
+                    _dataFields = new ExcelPivotTableDataFieldCollection(this);
+                }
+                return _dataFields;
+            }
+        }
+        ExcelPivotTableRowColumnFieldCollection _pageFields = null;
+        /// <summary>
+        /// Report filter fields
+        /// </summary>
+        public ExcelPivotTableRowColumnFieldCollection PageFields
+        {
+            get
+            {
+                if (_pageFields == null)
+                {
+                    _pageFields = new ExcelPivotTableRowColumnFieldCollection(this, "pageFields");
+                }
+                return _pageFields;
+            }
+        }
+        const string STYLENAME_PATH = "d:pivotTableStyleInfo/@name";
+        /// <summary>
+        /// Pivot style name. Used for custom styles
+        /// </summary>
+        public string StyleName
+        {
+            get
+            {
+                return GetXmlNodeString(StyleName);
+            }
+            set
+            {
+                if (value.StartsWith("PivotStyle"))
+                {
+                    try
+                    {
+                        _tableStyle = (TableStyles)Enum.Parse(typeof(TableStyles), value.Substring(10, value.Length - 10), true);
+                    }
+                    catch
+                    {
+                        _tableStyle = TableStyles.Custom;
+                    }
+                }
+                else if (value == "None")
+                {
+                    _tableStyle = TableStyles.None;
+                    value = "";
+                }
+                else
+                {
+                    _tableStyle = TableStyles.Custom;
+                }
+                SetXmlNodeString(STYLENAME_PATH, value, true);
+            }
+        }
+        TableStyles _tableStyle = Table.TableStyles.Medium6;
+        /// <summary>
+        /// The table style. If this property is cusom the style from the StyleName propery is used.
+        /// </summary>
+        public TableStyles TableStyle
+        {
+            get
+            {
+                return _tableStyle;
+            }
+            set
+            {
+                _tableStyle=value;
+                if (value != TableStyles.Custom)
+                {
+                    SetXmlNodeString(STYLENAME_PATH, "PivotStyle" + value.ToString());
+                }
+            }
+        }
+
+        #endregion
+        #region "Internal Properties"
+        internal int CacheID 
+        { 
+                get
+                {
+                    return GetXmlNodeInt("@cacheId");
+                }
+                set
+                {
+                    SetXmlNodeString("@cacheId",value.ToString());
+                }
+        }
+
+        #endregion
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableCollection.cs	(revision 9616)
@@ -0,0 +1,167 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		21-MAR-2011
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.IO.Packaging;
+using System.Xml;
+
+namespace OfficeOpenXml.Table.PivotTable
+{
+    /// <summary>
+    /// A collection of pivottable objects
+    /// </summary>
+    public class ExcelPivotTableCollection : IEnumerable<ExcelPivotTable>
+    {
+        List<ExcelPivotTable> _pivotTables = new List<ExcelPivotTable>();
+        internal Dictionary<string, int> _pivotTableNames = new Dictionary<string, int>();
+        ExcelWorksheet _ws;        
+        internal ExcelPivotTableCollection(ExcelWorksheet ws)
+        {
+            Package pck = ws._package.Package;
+            _ws = ws;            
+            foreach(var rel in ws.Part.GetRelationships())
+            {
+                if (rel.RelationshipType == ExcelPackage.schemaRelationships + "/pivotTable")
+                {
+                    var tbl = new ExcelPivotTable(rel, ws);
+                    _pivotTableNames.Add(tbl.Name, _pivotTables.Count);
+                    if (tbl.Id + 1 > _ws.Workbook._nextPivotTableID) _ws.Workbook._nextPivotTableID = tbl.Id + 1;
+                    _pivotTables.Add(tbl);
+                }
+            }
+        }
+        private ExcelPivotTable Add(ExcelPivotTable tbl)
+        {
+            _pivotTables.Add(tbl);
+            _pivotTableNames.Add(tbl.Name, _pivotTables.Count - 1);
+            if (tbl.Id >= _ws.Workbook._nextPivotTableID)
+            {
+                _ws.Workbook._nextPivotTableID = tbl.Id + 1;
+            }
+            return tbl;
+        }
+
+        /// <summary>
+        /// Create a pivottable on the supplied range
+        /// </summary>
+        /// <param name="Range">The range address including header and total row</param>
+        /// <param name="Source">The Source data range address</param>
+        /// <param name="Name">The name of the table. Must be unique </param>
+        /// <returns>The pivottable object</returns>
+        public ExcelPivotTable Add(ExcelAddressBase Range, ExcelRangeBase Source, string Name)
+        {
+            if (string.IsNullOrEmpty(Name))
+            {
+                Name = GetNewTableName();
+            }
+            if (Range.WorkSheet != _ws.Name)
+            {
+                throw(new Exception("The Range must be in the current worksheet"));
+            }
+            else if (_ws.Workbook.ExistsTableName(Name))
+            {
+                throw (new ArgumentException("Tablename is not unique"));
+            }
+            foreach (var t in _pivotTables)
+            {
+                if (t.Address.Collide(Range) != ExcelAddressBase.eAddressCollition.No)
+                {
+                    throw (new ArgumentException(string.Format("Table range collides with table {0}", t.Name)));
+                }
+            }
+            return Add(new ExcelPivotTable(_ws, Range, Source, Name, _ws.Workbook._nextPivotTableID++));
+        }
+
+        internal string GetNewTableName()
+        {
+            string name = "Pivottable1";
+            int i = 2;
+            while (_ws.Workbook.ExistsPivotTableName(name))
+            {
+                name = string.Format("Pivottable{0}", i++);
+            }
+            return name;
+        }
+        public int Count
+        {
+            get
+            {
+                return _pivotTables.Count;
+            }
+        }
+        /// <summary>
+        /// The pivottable Index. Base 0.
+        /// </summary>
+        /// <param name="Index"></param>
+        /// <returns></returns>
+        public ExcelPivotTable this[int Index]
+        {
+            get
+            {
+                if (Index < 0 || Index >= _pivotTables.Count)
+                {
+                    throw (new ArgumentOutOfRangeException("PivotTable index out of range"));
+                }
+                return _pivotTables[Index];
+            }
+        }
+        /// <summary>
+        /// Pivottabes accesed by name
+        /// </summary>
+        /// <param name="Name">The name of the pivottable</param>
+        /// <returns>The Pivotable. Null if the no match is found</returns>
+        public ExcelPivotTable this[string Name]
+        {
+            get
+            {
+                if (_pivotTableNames.ContainsKey(Name))
+                {
+                    return _pivotTables[_pivotTableNames[Name]];
+                }
+                else
+                {
+                    return null;
+                }
+            }
+        }
+        public IEnumerator<ExcelPivotTable> GetEnumerator()
+        {
+            return _pivotTables.GetEnumerator();
+        }
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _pivotTables.GetEnumerator();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableDataField.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableDataField.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableDataField.cs	(revision 9616)
@@ -0,0 +1,232 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		21-MAR-2011
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style.XmlAccess;
+
+namespace OfficeOpenXml.Table.PivotTable
+{
+    /// <summary>
+    /// A pivo table data field
+    /// </summary>
+    public class ExcelPivotTableDataField : XmlHelper
+    {
+        internal ExcelPivotTableDataField(XmlNamespaceManager ns, XmlNode topNode,ExcelPivotTableField field) :
+            base(ns, topNode)
+        {
+            if (topNode.Attributes.Count == 0)
+            {
+                Index = field.Index;
+                BaseField = 0;
+                BaseItem = 0;
+            }
+            
+            Field = field;
+        }
+        /// <summary>
+        /// The field
+        /// </summary>
+        public ExcelPivotTableField Field
+        {
+            get;
+            private set;
+        }
+        /// <summary>
+        /// The index of the datafield
+        /// </summary>
+        public int Index 
+        { 
+            get
+            {
+                return GetXmlNodeInt("@fld");
+            }
+            internal set
+            {
+                SetXmlNodeString("@fld",value.ToString());
+            }
+        }
+        /// <summary>
+        /// The name of the datafield
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return GetXmlNodeString("@name");
+            }
+            set
+            {
+                if (Field._table.DataFields.ExistsDfName(value, this))
+                {
+                    throw (new InvalidOperationException("Duplicate datafield name"));
+                }
+                SetXmlNodeString("@name", value);
+            }
+        }
+        /// <summary>
+        /// Field index. Reference to the field collection
+        /// </summary>
+        public int BaseField
+        {
+            get
+            {
+                return GetXmlNodeInt("@baseField");
+            }
+            set
+            {
+                SetXmlNodeString("@baseField", value.ToString());
+            }
+        }
+        /// <summary>
+        /// Specifies the index to the base item when the ShowDataAs calculation is in use
+        /// </summary>
+        public int BaseItem
+        {
+            get
+            {
+                return GetXmlNodeInt("@baseItem");
+            }
+            set
+            {
+                SetXmlNodeString("@baseItem", value.ToString());
+            }
+        }
+        /// <summary>
+        /// Number format id. 
+        /// </summary>
+        internal int NumFmtId
+        {
+            get
+            {
+                return GetXmlNodeInt("@numFmtId");
+            }
+            set
+            {
+                SetXmlNodeString("@numFmtId", value.ToString());
+            }
+        }
+        /// <summary>
+        /// Number format for the data column
+        /// </summary>
+        public string Format
+        {
+            get
+            {
+                foreach (var nf in Field._table.WorkSheet.Workbook.Styles.NumberFormats)
+                {
+                    if (nf.NumFmtId == NumFmtId)
+                    {
+                        return nf.Format;
+                    }
+                }
+                return Field._table.WorkSheet.Workbook.Styles.NumberFormats[0].Format;
+            }
+            set
+            {
+                var styles = Field._table.WorkSheet.Workbook.Styles;
+
+                ExcelNumberFormatXml nf = null;
+                if (!styles.NumberFormats.FindByID(value, ref nf))
+                {
+                    nf = new ExcelNumberFormatXml(NameSpaceManager) { Format = value, NumFmtId = styles.NumberFormats.NextId++ };
+                    styles.NumberFormats.Add(value, nf);
+                }
+                NumFmtId = nf.NumFmtId;
+            }
+        }
+        /// <summary>
+        /// Type of aggregate function
+        /// </summary>
+        public DataFieldFunctions Function
+        {
+            get
+            {
+                string s=GetXmlNodeString("@subtotal");
+                if(s=="")
+                {
+                    return DataFieldFunctions.None;
+                }
+                else
+                {
+                    return (DataFieldFunctions)Enum.Parse(typeof(DataFieldFunctions), s, true);
+                }
+            }
+            set
+            {
+                string v;
+                switch(value)
+                {
+                    case DataFieldFunctions.None:
+                        DeleteNode("@subtotal");
+                        return;
+                    case DataFieldFunctions.CountNums:
+                        v="CountNums";
+                        break;
+                    case DataFieldFunctions.StdDev:
+                        v="stdDev";
+                        break;
+                    case DataFieldFunctions.StdDevP:
+                        v="stdDevP";
+                        break;
+                    default:
+                        v=value.ToString().ToLower();
+                        break;
+                }                
+                SetXmlNodeString("@subtotal", v);
+            }
+        }
+        ///Since we have no items, Excel will crash when we use showDataAs options that require baseItem's
+        //public eShowDataAs ShowDataAs
+        //{
+        //    get
+        //    {
+        //        string s = GetXmlNodeString("@showDataAs");
+        //        if (s == "")
+        //        {
+        //            return eShowDataAs.Normal;
+        //        }
+        //        else
+        //        {
+        //            return (eShowDataAs)Enum.Parse(typeof(eShowDataAs), s, true);
+        //        }
+        //    }
+        //    set
+        //    {
+        //        string v = value.ToString();
+        //        v = v.Substring(0, 1).ToLower() + v.Substring(1);
+        //        SetXmlNodeString("@showDataAs", v);
+        //    }
+        //}
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableField.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableField.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableField.cs	(revision 9616)
@@ -0,0 +1,1076 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		21-MAR-2011
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+
+namespace OfficeOpenXml.Table.PivotTable
+{
+    
+    /// <summary>
+    /// Defines the axis for a PivotTable
+    /// </summary>
+    public enum ePivotFieldAxis
+    {
+        /// <summary>
+        /// None
+        /// </summary>
+        None=-1,
+        /// <summary>
+        /// Column axis
+        /// </summary>
+        Column,
+        /// <summary>
+        /// Page axis (Include Count Filter) 
+        /// 
+        /// </summary>
+        Page,
+        /// <summary>
+        /// Row axis
+        /// </summary>
+        Row,
+        /// <summary>
+        /// Values axis
+        /// </summary>
+        Values 
+    }
+    /// <summary>
+    /// Build-in table row functions
+    /// </summary>
+    public enum DataFieldFunctions
+    {
+        Average,
+        Count,
+        CountNums,
+        Max,
+        Min,
+        Product,
+        None,
+        StdDev,
+        StdDevP,
+        Sum,
+        Var,
+        VarP
+    }
+    /// <summary>
+    /// Defines the data formats for a field in the PivotTable
+    /// </summary>
+    public enum eShowDataAs
+    {
+        /// <summary>
+        /// Indicates the field is shown as the "difference from" a value.
+        /// </summary>
+        Difference,
+        /// <summary>
+        /// Indicates the field is shown as the "index.
+        /// </summary>
+        Index, 
+        /// <summary>
+        /// Indicates that the field is shown as its normal datatype.
+        /// </summary>
+        Normal, 
+        /// <summary>
+        /// /Indicates the field is show as the "percentage of" a value
+        /// </summary>
+        Percent, 
+        /// <summary>
+        /// Indicates the field is shown as the "percentage difference from" a value.
+        /// </summary>
+        PercentDiff, 
+        /// <summary>
+        /// Indicates the field is shown as the percentage of column.
+        /// </summary>
+        PercentOfCol,
+        /// <summary>
+        /// Indicates the field is shown as the percentage of row
+        /// </summary>
+        PercentOfRow, 
+        /// <summary>
+        /// Indicates the field is shown as percentage of total.
+        /// </summary>
+        PercentOfTotal, 
+        /// <summary>
+        /// Indicates the field is shown as running total in the table.
+        /// </summary>
+        RunTotal,        
+    }
+      /// <summary>
+     /// Built-in subtotal functions
+     /// </summary>
+    [Flags] 
+    public enum eSubTotalFunctions 
+     {
+         None=1,
+         Count=2, 
+         CountA=4, 
+         Avg=8, 
+         Default=16, 
+         Min=32, 
+         Max=64, 
+         Product=128, 
+         StdDev=256, 
+         StdDevP=512, 
+         Sum=1024, 
+         Var=2048, 
+         VarP=4096
+     }
+    /// <summary>
+    /// Data grouping
+    /// </summary>
+    [Flags]
+    public enum eDateGroupBy
+    {
+        Years = 1,
+        Quarters = 2,
+        Months = 4,
+        Days = 8,
+        Hours = 16,
+        Minutes = 32,
+        Seconds = 64
+    }
+    /// <summary>
+    /// Sorting
+    /// </summary>
+    public enum eSortType
+    {
+        None,
+        Ascending,
+        Descending
+    }
+    /// <summary>
+    /// A pivot table field.
+    /// </summary>
+    public class ExcelPivotTableField : XmlHelper
+    {
+        internal ExcelPivotTable _table;
+        internal ExcelPivotTableField(XmlNamespaceManager ns, XmlNode topNode,ExcelPivotTable table, int index, int baseIndex) :
+            base(ns, topNode)
+        {
+            Index = index;
+            BaseIndex = baseIndex;
+            _table = table;
+        }
+        public int Index
+        {
+            get;
+            set;
+        }
+        internal int BaseIndex
+        {
+            get;
+            set;
+        }
+        /// <summary>
+        /// Name of the field
+        /// </summary>
+        public string Name 
+        { 
+            get
+            {
+                string v = GetXmlNodeString("@name");
+                if (v == "")
+                {
+                    return _cacheFieldHelper.GetXmlNodeString("@name");
+                }
+                else
+                {
+                    return GetXmlNodeString("@name");
+                }
+            }
+            set
+            {
+                SetXmlNodeString("@name", value);
+            }
+        }
+        /// <summary>
+        /// Compact mode
+        /// </summary>
+        public bool Compact
+        { 
+            get
+            {
+                return GetXmlNodeBool("@compact");
+            }
+            set
+            {
+                SetXmlNodeBool("@compact",value);
+            }
+        }
+        /// <summary>
+        /// A boolean that indicates whether the items in this field should be shown in Outline form
+        /// </summary>
+        public bool Outline 
+        { 
+            get
+            {
+                return GetXmlNodeBool("@outline");
+            }
+            set
+            {
+                SetXmlNodeBool("@outline",value);
+            }
+        }
+        /// <summary>
+        /// The custom text that is displayed for the subtotals label
+        /// </summary>
+        public bool SubtotalTop 
+        { 
+            get
+            {
+                return GetXmlNodeBool("@subtotalTop");
+            }
+            set
+            {
+                SetXmlNodeBool("@subtotalTop",value);
+            }
+        }
+        /// <summary>
+        /// A boolean that indicates whether to show all items for this field
+        /// </summary>
+        public bool ShowAll 
+        { 
+            get
+            {
+                return GetXmlNodeBool("@showAll");
+            }
+            set
+            {
+                SetXmlNodeBool("@showAll",value);
+            }
+        }
+        /// <summary>
+        /// The type of sort that is applied to this field
+        /// </summary>
+        public eSortType Sort
+        {
+            get
+            {
+                string v = GetXmlNodeString("@sortType");
+                return v == "" ? eSortType.None : (eSortType)Enum.Parse(typeof(eSortType), v, true);
+            }
+            set
+            {
+                if (value == eSortType.None)
+                {
+                    DeleteNode("@sortType");
+                }
+                else
+                {
+                    SetXmlNodeString("@sortType", value.ToString().ToLower());
+                }
+            }
+        }
+        /// <summary>
+        /// A boolean that indicates whether manual filter is in inclusive mode
+        /// </summary>
+        public bool IncludeNewItemsInFilter
+        { 
+            get
+            {
+                return GetXmlNodeBool("@includeNewItemsInFilter");
+            }
+            set
+            {
+                SetXmlNodeBool("@includeNewItemsInFilter",value);
+            }
+        }
+         /// <summary>
+         /// Enumeration of the different subtotal operations that can be applied to page, row or column fields
+         /// </summary>
+         public eSubTotalFunctions SubTotalFunctions
+         {
+            get
+            {
+                eSubTotalFunctions ret = 0;
+                XmlNodeList nl = TopNode.SelectNodes("d:items/d:item/@t", NameSpaceManager);
+                if (nl.Count == 0) return eSubTotalFunctions.None;
+                foreach (XmlAttribute item in nl)
+                {
+                    try
+                    {
+                        ret |= (eSubTotalFunctions)Enum.Parse(typeof(eSubTotalFunctions), item.Value, true);
+                    }
+                    catch (ArgumentException ex)
+                    {
+                        throw new ArgumentException("Unable to parse value of " + item.Value + " to a valid pivot table subtotal function", ex);
+                    }
+                }
+                return ret;
+             }
+             set
+             {
+                 if ((value & eSubTotalFunctions.None) == eSubTotalFunctions.None && (value != eSubTotalFunctions.None))
+                 {
+                     throw (new ArgumentException("Value None can not be combined with other values."));
+                 }
+                 if ((value & eSubTotalFunctions.Default) == eSubTotalFunctions.Default && (value != eSubTotalFunctions.Default))
+                 {
+                     throw (new ArgumentException("Value Default can not be combined with other values."));
+                 }
+
+
+                 // remove old attribute                 
+                 XmlNodeList nl = TopNode.SelectNodes("d:items/d:item/@t", NameSpaceManager);
+                 if (nl.Count > 0)
+                 {
+                     foreach (XmlAttribute item in nl)
+                     {
+                         DeleteNode("@" + item.Value + "Subtotal");
+                         item.OwnerElement.ParentNode.RemoveChild(item.OwnerElement);
+                     }
+                 }
+                 
+ 
+                 if (value==eSubTotalFunctions.None)
+                 {
+                     // for no subtotals, set defaultSubtotal to off
+                     SetXmlNodeBool("@defaultSubtotal", false);
+                     TopNode.InnerXml = "";
+                 }
+                 else
+                 {
+                     string innerXml = "";
+                     int count = 0;
+                     foreach (eSubTotalFunctions e in Enum.GetValues(typeof(eSubTotalFunctions)))
+                    {
+                        if ((value & e) == e)
+                        {
+                            var newTotalType = e.ToString();
+                            var totalType = char.ToLower(newTotalType[0]) + newTotalType.Substring(1);
+                            // add new attribute
+                            SetXmlNodeBool("@" + totalType + "Subtotal", true);
+                            innerXml += "<item t=\"" + totalType + "\" />";
+                            count++;
+                        }
+                    }
+                    TopNode.InnerXml = string.Format("<items count=\"{0}\">{1}</items>", count, innerXml);
+                 }
+             }
+         }
+        /// <summary>
+        /// Type of axis
+        /// </summary>
+        public ePivotFieldAxis Axis
+        {
+            get
+            {
+                switch(GetXmlNodeString("@axis"))
+                {
+                    case "axisRow":
+                        return ePivotFieldAxis.Row;
+                    case "axisCol":
+                        return ePivotFieldAxis.Column;
+                    case "axisPage":
+                        return ePivotFieldAxis.Page;
+                    case "axisValues":
+                        return ePivotFieldAxis.Values;
+                    default:
+                        return ePivotFieldAxis.None;
+                }
+            }
+            internal set
+            {
+                switch (value)
+                {
+                    case ePivotFieldAxis.Row:
+                        SetXmlNodeString("@axis","axisRow");
+                        break;
+                    case ePivotFieldAxis.Column:
+                        SetXmlNodeString("@axis","axisCol");
+                        break;
+                    case ePivotFieldAxis.Values:
+                        SetXmlNodeString("@axis", "axisValues");
+                        break;
+                    case ePivotFieldAxis.Page:
+                        SetXmlNodeString("@axis", "axisPage");
+                        break;
+                    default:
+                        DeleteNode("@axis");
+                        break;
+                }
+            }
+        }        
+        /// <summary>
+        /// If the field is a row field
+        /// </summary>
+        public bool IsRowField
+        {
+            get
+            {
+                return (TopNode.SelectSingleNode(string.Format("../../d:rowFields/d:field[@x={0}]", Index), NameSpaceManager) != null);
+            }
+            internal set
+            {
+                if (value)
+                {
+                    var rowsNode = TopNode.SelectSingleNode("../../d:rowFields", NameSpaceManager);
+                    if (rowsNode == null)
+                    {
+                        _table.CreateNode("d:rowFields");
+                    }
+                    rowsNode = TopNode.SelectSingleNode("../../d:rowFields", NameSpaceManager);
+
+                    AppendField(rowsNode, Index, "field", "x");
+                    if (BaseIndex == Index)
+                    {
+                        TopNode.InnerXml = "<items count=\"1\"><item t=\"default\" /></items>";
+                    }
+                    else
+                    {
+                        TopNode.InnerXml = "<items count=\"0\"></items>";
+                    }
+                }
+                else
+                {
+                    XmlElement node = TopNode.SelectSingleNode(string.Format("../../d:rowFields/d:field[@x={0}]", Index), NameSpaceManager) as XmlElement;
+                     if (node != null)
+                     {
+                         node.ParentNode.RemoveChild(node);
+                     }
+                }
+            }
+        }
+        /// <summary>
+        /// If the field is a column field
+        /// </summary>
+        public bool IsColumnField
+        {
+            get
+            {
+                return (TopNode.SelectSingleNode(string.Format("../../d:colFields/d:field[@x={0}]", Index), NameSpaceManager) != null);
+            }
+            internal set
+            {
+                if (value)
+                {
+                    var columnsNode = TopNode.SelectSingleNode("../../d:colFields", NameSpaceManager);
+                    if (columnsNode == null)
+                    {
+                        _table.CreateNode("d:colFields");
+                    }
+                    columnsNode = TopNode.SelectSingleNode("../../d:colFields", NameSpaceManager);
+
+                    AppendField(columnsNode, Index, "field", "x");
+                    if (BaseIndex == Index)
+                    {
+                        TopNode.InnerXml = "<items count=\"1\"><item t=\"default\" /></items>";
+                    }
+                    else
+                    {
+                        TopNode.InnerXml = "<items count=\"0\"></items>";
+                    }
+                }
+                else
+                {
+                    XmlElement node = TopNode.SelectSingleNode(string.Format("../../d:colFields/d:field[@x={0}]", Index), NameSpaceManager) as XmlElement;
+                    if (node != null)
+                    {
+                        node.ParentNode.RemoveChild(node);
+                    }
+                }
+            }
+        }
+        /// <summary>
+        /// If the field is a datafield
+        /// </summary>
+        public bool IsDataField
+        {
+            get
+            {
+                return GetXmlNodeBool("@dataField", false);
+            }
+        }
+        /// <summary>
+        /// If the field is a page field.
+        /// </summary>
+        public bool IsPageField
+        {
+            get
+            {
+                return (Axis==ePivotFieldAxis.Page);
+            }
+            internal set
+            {
+                if (value)
+                {
+                    var dataFieldsNode = TopNode.SelectSingleNode("../../d:pageFields", NameSpaceManager);
+                    if (dataFieldsNode == null)
+                    {
+                        _table.CreateNode("d:pageFields");
+                        dataFieldsNode = TopNode.SelectSingleNode("../../d:pageFields", NameSpaceManager);
+                    }
+
+                    TopNode.InnerXml = "<items count=\"1\"><item t=\"default\" /></items>";
+
+                    XmlElement node = AppendField(dataFieldsNode, Index, "pageField", "fld");
+                    _pageFieldSettings = new ExcelPivotTablePageFieldSettings(NameSpaceManager, node, this, Index);
+                }
+                else
+                {
+                    _pageFieldSettings = null;
+                    XmlElement node = TopNode.SelectSingleNode(string.Format("../../d:pageFields/d:pageField[@fld={0}]", Index), NameSpaceManager) as XmlElement;
+                    if (node != null)
+                    {
+                        node.ParentNode.RemoveChild(node);
+                    }
+                }
+            }
+        }
+        //public ExcelPivotGrouping DateGrouping
+        //{
+
+        //}
+        internal ExcelPivotTablePageFieldSettings _pageFieldSettings = null;
+        public ExcelPivotTablePageFieldSettings PageFieldSettings
+        {
+            get
+            {
+                return _pageFieldSettings;
+            }
+        }
+        internal eDateGroupBy DateGrouping
+        {
+            get;
+            set;
+        }
+        ExcelPivotTableFieldGroup _grouping=null;
+        /// <summary>
+        /// Grouping settings. 
+        /// Null if the field has no grouping otherwise ExcelPivotTableFieldNumericGroup or ExcelPivotTableFieldNumericGroup.
+        /// </summary>        
+        public ExcelPivotTableFieldGroup Grouping
+        {
+            get
+            {
+                return _grouping;
+            }
+        }
+        #region Private & internal Methods
+        internal XmlElement AppendField(XmlNode rowsNode, int index, string fieldNodeText, string indexAttrText)
+        {
+            XmlElement prevField = null, newElement;
+            foreach (XmlElement field in rowsNode.ChildNodes)
+            {
+                string x = field.GetAttribute(indexAttrText);
+                int fieldIndex;
+                if(int.TryParse(x, out fieldIndex))
+                {
+                    if (fieldIndex == index)    //Row already exists
+                    {
+                        return field;
+                    }
+                    else if (fieldIndex > index)
+                    {
+                        newElement = rowsNode.OwnerDocument.CreateElement(fieldNodeText, ExcelPackage.schemaMain);
+                        newElement.SetAttribute(indexAttrText, index.ToString());
+                        rowsNode.InsertAfter(newElement, field);
+                    }
+                }
+                prevField=field;
+            }
+            newElement = rowsNode.OwnerDocument.CreateElement(fieldNodeText, ExcelPackage.schemaMain);
+            newElement.SetAttribute(indexAttrText, index.ToString());
+            rowsNode.InsertAfter(newElement, prevField);
+
+            return newElement;
+        }
+        internal XmlHelperInstance _cacheFieldHelper = null;
+        internal void SetCacheFieldNode(XmlNode cacheField)
+        {
+            _cacheFieldHelper = new XmlHelperInstance(NameSpaceManager, cacheField);
+            var groupNode = cacheField.SelectSingleNode("d:fieldGroup", NameSpaceManager);
+            if (groupNode!=null)
+            {
+                var groupBy = groupNode.SelectSingleNode("d:rangePr/@groupBy", NameSpaceManager);
+                if (groupBy==null)
+                {
+                    _grouping = new ExcelPivotTableFieldNumericGroup(NameSpaceManager, cacheField);
+                }
+                else
+                {
+                    DateGrouping=(eDateGroupBy)Enum.Parse(typeof(eDateGroupBy), groupBy.Value, true);
+                    _grouping = new ExcelPivotTableFieldDateGroup(NameSpaceManager, groupNode);
+                }
+            }
+        }
+        #endregion
+        #region Grouping
+        internal ExcelPivotTableFieldDateGroup SetDateGroup(eDateGroupBy GroupBy, DateTime StartDate, DateTime EndDate, int interval)
+        {
+            ExcelPivotTableFieldDateGroup group;
+            group = new ExcelPivotTableFieldDateGroup(NameSpaceManager, _cacheFieldHelper.TopNode);
+            _cacheFieldHelper.SetXmlNodeBool("d:sharedItems/@containsDate", true);
+            _cacheFieldHelper.SetXmlNodeBool("d:sharedItems/@containsNonDate", false);
+            _cacheFieldHelper.SetXmlNodeBool("d:sharedItems/@containsSemiMixedTypes", false);
+
+            group.TopNode.InnerXml += string.Format("<fieldGroup base=\"{0}\"><rangePr groupBy=\"{1}\" /><groupItems /></fieldGroup>", BaseIndex, GroupBy.ToString().ToLower());
+
+            if (StartDate.Year < 1900)
+            {
+                _cacheFieldHelper.SetXmlNodeString("d:fieldGroup/d:rangePr/@startDate", "1900-01-01T00:00:00");
+            }
+            else
+            {
+                _cacheFieldHelper.SetXmlNodeString("d:fieldGroup/d:rangePr/@startDate", StartDate.ToString("s", CultureInfo.InvariantCulture));
+                _cacheFieldHelper.SetXmlNodeString("d:fieldGroup/d:rangePr/@autoStart", "0");
+            }
+
+            if (EndDate==DateTime.MaxValue)
+            {
+                _cacheFieldHelper.SetXmlNodeString("d:fieldGroup/d:rangePr/@endDate", "9999-12-31T00:00:00");
+            }
+            else
+            {
+                _cacheFieldHelper.SetXmlNodeString("d:fieldGroup/d:rangePr/@endDate", EndDate.ToString("s", CultureInfo.InvariantCulture));
+                _cacheFieldHelper.SetXmlNodeString("d:fieldGroup/d:rangePr/@autoEnd", "0");
+            }
+
+            int items = AddDateGroupItems(group, GroupBy, StartDate, EndDate, interval);
+            AddFieldItems(items);
+
+            _grouping = group;
+            return group;
+        }
+        internal ExcelPivotTableFieldNumericGroup SetNumericGroup(double start, double end, double interval)
+        {
+            ExcelPivotTableFieldNumericGroup group;
+            group = new ExcelPivotTableFieldNumericGroup(NameSpaceManager, _cacheFieldHelper.TopNode);
+            _cacheFieldHelper.SetXmlNodeBool("d:sharedItems/@containsNumber", true);
+            _cacheFieldHelper.SetXmlNodeBool("d:sharedItems/@containsInteger", true);
+            _cacheFieldHelper.SetXmlNodeBool("d:sharedItems/@containsSemiMixedTypes", false);
+            _cacheFieldHelper.SetXmlNodeBool("d:sharedItems/@containsString", false);
+
+            group.TopNode.InnerXml += string.Format("<fieldGroup base=\"{0}\"><rangePr autoStart=\"0\" autoEnd=\"0\" startNum=\"{1}\" endNum=\"{2}\" groupInterval=\"{3}\"/><groupItems /></fieldGroup>", BaseIndex, start.ToString(CultureInfo.InvariantCulture), end.ToString(CultureInfo.InvariantCulture), interval.ToString(CultureInfo.InvariantCulture));
+            int items = AddNumericGroupItems(group, start, end, interval);
+            AddFieldItems(items);
+
+            _grouping = group;
+            return group;
+        }
+
+        private int AddNumericGroupItems(ExcelPivotTableFieldNumericGroup group, double start, double end, double interval)
+        {
+            if (interval < 0)
+            {
+                throw (new Exception("The interval must be a positiv"));
+            }
+            if (start > end)
+            {
+                throw(new Exception("Then End number must be larger than the Start number"));
+            }
+
+            XmlElement groupItems = group.TopNode.SelectSingleNode("d:fieldGroup/d:groupItems", group.NameSpaceManager) as XmlElement;
+            int items = 2;
+            //First date
+            double index=start;
+            double nextIndex=start+interval;
+            AddGroupItem(groupItems, "<" + start.ToString(CultureInfo.InvariantCulture));
+
+            while (index < end)
+            {
+                AddGroupItem(groupItems, string.Format("{0}-{1}", index.ToString(CultureInfo.InvariantCulture), nextIndex.ToString(CultureInfo.InvariantCulture)));
+                index=nextIndex;
+                nextIndex+=interval;
+                items++;
+            }
+            AddGroupItem(groupItems, ">" + nextIndex.ToString(CultureInfo.InvariantCulture));
+            return items;
+        }
+
+        private void AddFieldItems(int items)
+        {
+            XmlElement prevNode = null;
+            XmlElement itemsNode = TopNode.SelectSingleNode("d:items", NameSpaceManager) as XmlElement;
+            for (int x = 0; x < items; x++)
+            {
+                var itemNode = itemsNode.OwnerDocument.CreateElement("item", ExcelPackage.schemaMain);
+                itemNode.SetAttribute("x", x.ToString());
+                if (prevNode == null)
+                {
+                    itemsNode.PrependChild(itemNode);
+                }
+                else
+                {
+                    itemsNode.InsertAfter(itemNode, prevNode);
+                }
+                prevNode = itemNode;
+            }
+            itemsNode.SetAttribute("count", (items + 1).ToString());
+        }
+
+        private int AddDateGroupItems(ExcelPivotTableFieldGroup group, eDateGroupBy GroupBy, DateTime StartDate, DateTime EndDate, int interval)
+        {
+            XmlElement groupItems = group.TopNode.SelectSingleNode("d:fieldGroup/d:groupItems", group.NameSpaceManager) as XmlElement;
+            int items = 2;
+            //First date
+            AddGroupItem(groupItems, "<" + StartDate.ToString("s", CultureInfo.InvariantCulture).Substring(0, 10));
+
+            switch (GroupBy)
+            {
+                case eDateGroupBy.Seconds:
+                case eDateGroupBy.Minutes:
+                    AddTimeSerie(60, groupItems);
+                    items += 60;
+                    break;
+                case eDateGroupBy.Hours:
+                    AddTimeSerie(24, groupItems);
+                    items += 24;
+                    break;
+                case eDateGroupBy.Days:
+                    if (interval == 1)
+                    {
+                        DateTime dt = new DateTime(2008, 1, 1); //pick a year with 366 days
+                        while (dt.Year == 2008)
+                        {
+                            AddGroupItem(groupItems, dt.ToString("dd-MMM"));
+                            dt = dt.AddDays(1);
+                        }
+                        items += 366;
+                    }
+                    else
+                    {
+                        DateTime dt = StartDate;
+                        items = 0;
+                        while (dt < EndDate)
+                        {
+                            AddGroupItem(groupItems, dt.ToString("dd-MMM"));
+                            dt = dt.AddDays(interval);
+                            items++;
+                        }
+                    }
+                    break;
+                case eDateGroupBy.Months:
+                    AddGroupItem(groupItems, "jan");
+                    AddGroupItem(groupItems, "feb");
+                    AddGroupItem(groupItems, "mar");
+                    AddGroupItem(groupItems, "apr");
+                    AddGroupItem(groupItems, "may");
+                    AddGroupItem(groupItems, "jun");
+                    AddGroupItem(groupItems, "jul");
+                    AddGroupItem(groupItems, "aug");
+                    AddGroupItem(groupItems, "sep");
+                    AddGroupItem(groupItems, "oct");
+                    AddGroupItem(groupItems, "nov");
+                    AddGroupItem(groupItems, "dec");
+                    items += 12;
+                    break;
+                case eDateGroupBy.Quarters:
+                    AddGroupItem(groupItems, "Qtr1");
+                    AddGroupItem(groupItems, "Qtr2");
+                    AddGroupItem(groupItems, "Qtr3");
+                    AddGroupItem(groupItems, "Qtr4");
+                    items += 4;
+                    break;
+                case eDateGroupBy.Years:
+                    if(StartDate.Year>=1900 && EndDate!=DateTime.MaxValue)
+                    {
+                        for (int year = StartDate.Year; year <= EndDate.Year; year++)
+                        {
+                            AddGroupItem(groupItems, year.ToString());
+                        }
+                        items += EndDate.Year - StartDate.Year+1;
+                    }
+                    break;
+                default:
+                    throw (new Exception("unsupported grouping"));
+            }
+
+            //Lastdate
+            AddGroupItem(groupItems, ">" + EndDate.ToString("s", CultureInfo.InvariantCulture).Substring(0, 10));
+            return items;
+        }
+
+        private void AddTimeSerie(int count, XmlElement groupItems)
+        {
+            for (int i = 0; i < count; i++)
+            {
+                AddGroupItem(groupItems, string.Format("{0:00}", i));
+            }
+        }
+
+        private void AddGroupItem(XmlElement groupItems, string value)
+        {
+            var s = groupItems.OwnerDocument.CreateElement("s", ExcelPackage.schemaMain);
+            s.SetAttribute("v", value);
+            groupItems.AppendChild(s);
+        }
+        #endregion
+        internal ExcelPivotTableFieldCollectionBase<ExcelPivotTableFieldItem> _items=null;
+        /// <summary>
+        /// Pivottable field Items. Used for grouping.
+        /// </summary>
+        public ExcelPivotTableFieldCollectionBase<ExcelPivotTableFieldItem> Items
+        {
+            get
+            {
+                if (_items == null)
+                {
+                    _items = new ExcelPivotTableFieldCollectionBase<ExcelPivotTableFieldItem>(_table);
+                    foreach (XmlNode node in TopNode.SelectNodes("d:items//d:item", NameSpaceManager))
+                    {
+                        var item = new ExcelPivotTableFieldItem(NameSpaceManager, node,this);
+                        if (item.T == "")
+                        {
+                            _items.AddInternal(item);
+                        }
+                    }
+                    //if (_grouping is ExcelPivotTableFieldDateGroup)
+                    //{
+                    //    ExcelPivotTableFieldDateGroup dtgrp = ((ExcelPivotTableFieldDateGroup)_grouping);
+
+                    //    ExcelPivotTableFieldItem minItem=null, maxItem=null;
+                    //    foreach (var item in _items)
+                    //    {
+                    //        if (item.X == 0)
+                    //        {
+                    //            minItem = item;
+                    //        }
+                    //        else if (maxItem == null || maxItem.X < item.X)
+                    //        {
+                    //            maxItem = item;
+                    //        }
+                    //    }
+                    //    if (dtgrp.AutoStart)
+                    //    {
+                    //        _items._list.Remove(minItem);
+                    //    }
+                    //    if (dtgrp.AutoEnd)
+                    //    {
+                    //        _items._list.Remove(maxItem);
+                    //    }
+
+                    //}
+                }
+                return _items;
+            }
+        }
+        /// <summary>
+        /// Add numberic grouping to the field
+        /// </summary>
+        /// <param name="Start">Start value</param>
+        /// <param name="End">End value</param>
+        /// <param name="Interval">Interval</param>
+        public void AddNumericGrouping(double Start, double End, double Interval)
+        {
+            ValidateGrouping();
+            SetNumericGroup(Start, End, Interval);
+        }
+        /// <summary>
+        /// Add a date grouping on this field.
+        /// </summary>
+        /// <param name="groupBy">Group by</param>
+        public void AddDateGrouping(eDateGroupBy groupBy)
+        {
+            AddDateGrouping(groupBy, DateTime.MinValue, DateTime.MaxValue,1);
+        }
+        /// <summary>
+        /// Add a date grouping on this field.
+        /// </summary>
+        /// <param name="groupBy">Group by</param>
+        /// <param name="startDate">Fixed start date. Use DateTime.MinValue for auto</param>
+        /// <param name="endDate">Fixed end date. Use DateTime.MaxValue for auto</param>
+        public void AddDateGrouping(eDateGroupBy groupBy, DateTime startDate, DateTime endDate)
+        {
+            AddDateGrouping(groupBy, startDate, endDate, 1);
+        }
+        /// <summary>
+        /// Add a date grouping on this field.
+        /// </summary>
+        /// <param name="days">Number of days when grouping on days</param>
+        /// <param name="startDate">Fixed start date. Use DateTime.MinValue for auto</param>
+        /// <param name="endDate">Fixed end date. Use DateTime.MaxValue for auto</param>
+        public void AddDateGrouping(int days, DateTime startDate, DateTime endDate)
+        {
+            AddDateGrouping(eDateGroupBy.Days, startDate, endDate, days);
+        }
+        private void AddDateGrouping(eDateGroupBy groupBy, DateTime startDate, DateTime endDate, int groupInterval)
+        {
+            if (groupInterval < 1 || groupInterval >= Int16.MaxValue)
+            {
+                throw (new ArgumentOutOfRangeException("Group interval is out of range"));
+            }
+            if (groupInterval > 1 && groupBy != eDateGroupBy.Days)
+            {
+                throw (new ArgumentException("Group interval is can only be used when groupBy is Days"));
+            }
+            ValidateGrouping();
+
+            bool firstField = true;            
+            List<ExcelPivotTableField> fields=new List<ExcelPivotTableField>();
+            //Seconds
+            if ((groupBy & eDateGroupBy.Seconds) == eDateGroupBy.Seconds)
+            {
+                fields.Add(AddField(eDateGroupBy.Seconds, startDate, endDate, ref firstField));
+            }
+            //Minutes
+            if ((groupBy & eDateGroupBy.Minutes) == eDateGroupBy.Minutes)
+            {
+                fields.Add(AddField(eDateGroupBy.Minutes, startDate, endDate, ref firstField));
+            }
+            //Hours
+            if ((groupBy & eDateGroupBy.Hours) == eDateGroupBy.Hours)
+            {
+                fields.Add(AddField(eDateGroupBy.Hours, startDate, endDate, ref firstField));
+            }
+            //Days
+            if ((groupBy & eDateGroupBy.Days) == eDateGroupBy.Days)
+            {
+                fields.Add(AddField(eDateGroupBy.Days, startDate, endDate, ref firstField, groupInterval));
+            }
+            //Month
+            if ((groupBy & eDateGroupBy.Months) == eDateGroupBy.Months)
+            {
+                fields.Add(AddField(eDateGroupBy.Months, startDate, endDate, ref firstField));
+            }
+            //Quarters
+            if ((groupBy & eDateGroupBy.Quarters) == eDateGroupBy.Quarters)
+            {
+                fields.Add(AddField(eDateGroupBy.Quarters, startDate, endDate, ref firstField));
+            }
+            //Years
+            if ((groupBy & eDateGroupBy.Years) == eDateGroupBy.Years)
+            {
+                fields.Add(AddField(eDateGroupBy.Years, startDate, endDate, ref firstField));
+            }
+
+            if (fields.Count > 1) _cacheFieldHelper.SetXmlNodeString("d:fieldGroup/@par", (_table.Fields.Count - 1).ToString());
+            if (groupInterval != 1)
+            {
+                _cacheFieldHelper.SetXmlNodeString("d:fieldGroup/d:rangePr/@groupInterval", groupInterval.ToString());
+            }
+            else
+            {
+                _cacheFieldHelper.DeleteNode("d:fieldGroup/d:rangePr/@groupInterval");
+            }
+            _items = null;
+        }
+
+        private void ValidateGrouping()
+        {
+            if (!(IsColumnField || IsRowField))
+            {
+                throw (new Exception("Field must be a row or column field"));
+            }
+            foreach (var field in _table.Fields)
+            {
+                if (field.Grouping != null)
+                {
+                    throw (new Exception("Grouping already exists"));
+                }
+            }
+        }
+        private ExcelPivotTableField AddField(eDateGroupBy groupBy, DateTime startDate, DateTime endDate, ref  bool firstField)
+        {
+            return AddField(groupBy, startDate, endDate, ref firstField,1);
+        }
+        private ExcelPivotTableField AddField(eDateGroupBy groupBy, DateTime startDate, DateTime endDate, ref  bool firstField, int interval)
+        {
+            if (firstField == false)
+            {
+                //Pivot field
+                var topNode = _table.PivotTableXml.SelectSingleNode("//d:pivotFields", _table.NameSpaceManager);
+                var fieldNode = _table.PivotTableXml.CreateElement("pivotField", ExcelPackage.schemaMain);
+                fieldNode.SetAttribute("compact", "0");
+                fieldNode.SetAttribute("outline", "0");
+                fieldNode.SetAttribute("showAll", "0");
+                fieldNode.SetAttribute("defaultSubtotal", "0");
+                topNode.AppendChild(fieldNode);
+
+                var field = new ExcelPivotTableField(_table.NameSpaceManager, fieldNode, _table, _table.Fields.Count, Index);
+                field.DateGrouping = groupBy;
+
+                XmlNode rowColFields;
+                if (IsRowField)
+                {
+                    rowColFields=TopNode.SelectSingleNode("../../d:rowFields", NameSpaceManager);
+                }
+                else
+                {
+                    rowColFields = TopNode.SelectSingleNode("../../d:colFields", NameSpaceManager);
+                }
+
+                int fieldIndex, index = 0;
+                foreach (XmlElement rowfield in rowColFields.ChildNodes)
+                {
+                    if (int.TryParse(rowfield.GetAttribute("x"), out fieldIndex))
+                    {
+                        if (_table.Fields[fieldIndex].BaseIndex == BaseIndex)
+                        {
+                            var newElement = rowColFields.OwnerDocument.CreateElement("field", ExcelPackage.schemaMain);
+                            newElement.SetAttribute("x", field.Index.ToString());
+                            rowColFields.InsertBefore(newElement, rowfield);
+                            break;
+                        }
+                    }
+                    index++;
+                }
+
+                if (IsRowField)
+                {
+                    _table.RowFields.Insert(field, index);
+                }
+                else
+                {
+                    _table.ColumnFields.Insert(field, index);
+                }
+                
+                _table.Fields.AddInternal(field);
+
+                AddCacheField(field, startDate, endDate, interval);
+                return field;
+            }
+            else
+            {
+                firstField = false;
+                DateGrouping = groupBy;
+                Compact = false;
+                SetDateGroup(groupBy, startDate, endDate, interval);
+                return this;
+            }
+        }
+        private void AddCacheField(ExcelPivotTableField field, DateTime startDate, DateTime endDate, int interval)
+        {
+            //Add Cache definition field.
+            var cacheTopNode = _table.CacheDefinition.CacheDefinitionXml.SelectSingleNode("//d:cacheFields", _table.NameSpaceManager);
+            var cacheFieldNode = _table.CacheDefinition.CacheDefinitionXml.CreateElement("cacheField", ExcelPackage.schemaMain);
+
+            cacheFieldNode.SetAttribute("name", field.DateGrouping.ToString());
+            cacheFieldNode.SetAttribute("databaseField", "0");
+            cacheTopNode.AppendChild(cacheFieldNode);
+            field.SetCacheFieldNode(cacheFieldNode);
+
+            field.SetDateGroup(field.DateGrouping, startDate, endDate, interval);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableFieldCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableFieldCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableFieldCollection.cs	(revision 9616)
@@ -0,0 +1,323 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		21-MAR-2011
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Table.PivotTable
+{
+    /// <summary>
+    /// Base collection class for pivottable fields
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    public class ExcelPivotTableFieldCollectionBase<T> : IEnumerable<T>
+    {
+        protected ExcelPivotTable _table;
+        internal List<T> _list = new List<T>();
+        internal ExcelPivotTableFieldCollectionBase(ExcelPivotTable table)
+        {
+            _table = table;
+        }
+        public IEnumerator<T> GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+        public int Count
+        {
+            get
+            {
+                return _list.Count;
+            }
+        }
+        internal void AddInternal(T field)
+        {
+            _list.Add(field);
+        }
+        internal void Clear()
+        {
+            _list.Clear();
+        }
+        public T this[int Index]
+        {
+            get
+            {
+                if (Index < 0 || Index >= _list.Count)
+                {
+                    throw (new ArgumentOutOfRangeException("Index out of range"));
+                }
+                return _list[Index];
+            }
+        }
+    }
+    public class ExcelPivotTableFieldCollection : ExcelPivotTableFieldCollectionBase<ExcelPivotTableField>
+    {
+        internal ExcelPivotTableFieldCollection(ExcelPivotTable table, string topNode) :
+            base(table)
+        {
+
+        }
+        /// <summary>
+        /// Indexer by name
+        /// </summary>
+        /// <param name="name"></param>
+        /// <returns></returns>
+        public ExcelPivotTableField this[string name]
+        {
+            get
+            {
+                foreach (var field in _list)
+                {
+                    if (field.Name == name)
+                    {
+                        return field;
+                    }
+                }
+                return null;
+            }
+        }
+        /// <summary>
+        /// Returns the date group field.
+        /// </summary>
+        /// <param name="GroupBy">The type of grouping</param>
+        /// <returns>The matching field. If none is found null is returned</returns>
+        public ExcelPivotTableField GetDateGroupField(eDateGroupBy GroupBy)
+        {
+            foreach (var fld in _list)
+            {
+                if (fld.Grouping is ExcelPivotTableFieldDateGroup && (((ExcelPivotTableFieldDateGroup)fld.Grouping).GroupBy) == GroupBy)
+                {
+                    return fld;
+                }
+            }
+            return null;
+        }
+        /// <summary>
+        /// Returns the numeric group field.
+        /// </summary>
+        /// <returns>The matching field. If none is found null is returned</returns>
+        public ExcelPivotTableField GetNumericGroupField()
+        {
+            foreach (var fld in _list)
+            {
+                if (fld.Grouping is ExcelPivotTableFieldNumericGroup)
+                {
+                    return fld;
+                }
+            }
+            return null;
+        }
+    }
+    /// <summary>
+    /// Collection class for Row and column fields in a Pivottable 
+    /// </summary>
+    public class ExcelPivotTableRowColumnFieldCollection : ExcelPivotTableFieldCollectionBase<ExcelPivotTableField>
+    {
+        internal string _topNode;
+        internal ExcelPivotTableRowColumnFieldCollection(ExcelPivotTable table, string topNode) :
+            base(table)
+	    {
+            _topNode=topNode;
+	    }
+
+        /// <summary>
+        /// Add a new row/column field
+        /// </summary>
+        /// <param name="Field">The field</param>
+        /// <returns>The new field</returns>
+        public ExcelPivotTableField Add(ExcelPivotTableField Field)
+        {
+            SetFlag(Field, true);
+            _list.Add(Field);
+            return Field;
+        }
+        /// <summary>
+        /// Insert a new row/column field
+        /// </summary>
+        /// <param name="Field">The field</param>
+        /// <param name="Index">The position to insert the field</param>
+        /// <returns>The new field</returns>
+        internal ExcelPivotTableField Insert(ExcelPivotTableField Field, int Index)
+        {
+            SetFlag(Field, true);
+            _list.Insert(Index, Field);
+            return Field;
+        }
+        private void SetFlag(ExcelPivotTableField field, bool value)
+        {
+            switch (_topNode)
+            {
+                case "rowFields":
+                    if (field.IsColumnField || field.IsPageField)
+                    {
+                        throw(new Exception("This field is a column or page field. Can't add it to the RowFields collection"));
+                    }
+                    field.IsRowField = value;
+                    field.Axis = ePivotFieldAxis.Row;
+                    break;
+                case "colFields":
+                    if (field.IsRowField || field.IsPageField)
+                    {
+                        throw (new Exception("This field is a row or page field. Can't add it to the ColumnFields collection"));
+                    }
+                    field.IsColumnField = value;
+                    field.Axis = ePivotFieldAxis.Column;
+                    break;
+                case "pageFields":
+                    if (field.IsColumnField || field.IsRowField)
+                    {
+                        throw (new Exception("Field is a column or row field. Can't add it to the PageFields collection"));
+                    }
+                    if (_table.Address._fromRow < 3)
+                    {
+                        throw(new Exception(string.Format("A pivot table with page fields must be located above row 3. Currenct location is {0}", _table.Address.Address)));
+                    }
+                    field.IsPageField = value;
+                    field.Axis = ePivotFieldAxis.Page;
+                    break;
+                case "dataFields":
+                    
+                    break;
+            }
+        }
+        /// <summary>
+        /// Remove a field
+        /// </summary>
+        /// <param name="Field"></param>
+        public void Remove(ExcelPivotTableField Field)
+        {
+            if(!_list.Contains(Field))
+            {
+                throw new ArgumentException("Field not in collection");
+            }
+            SetFlag(Field, false);            
+            _list.Remove(Field);            
+        }
+        /// <summary>
+        /// Remove a field at a specific position
+        /// </summary>
+        /// <param name="Index"></param>
+        public void RemoveAt(int Index)
+        {
+            if (Index > -1 && Index < _list.Count)
+            {
+                throw(new IndexOutOfRangeException());
+            }
+            SetFlag(_list[Index], false);
+            _list.RemoveAt(Index);      
+        }
+    }
+    /// <summary>
+    /// Collection class for data fields in a Pivottable 
+    /// </summary>
+    public class ExcelPivotTableDataFieldCollection : ExcelPivotTableFieldCollectionBase<ExcelPivotTableDataField>
+    {
+        internal ExcelPivotTableDataFieldCollection(ExcelPivotTable table) :
+            base(table)
+        {
+
+        }
+        /// <summary>
+        /// Add a new datafield
+        /// </summary>
+        /// <param name="field">The field</param>
+        /// <returns>The new datafield</returns>
+        public ExcelPivotTableDataField Add(ExcelPivotTableField field)
+        {
+            var dataFieldsNode = field.TopNode.SelectSingleNode("../../d:dataFields", field.NameSpaceManager);
+            if (dataFieldsNode == null)
+            {
+                _table.CreateNode("d:dataFields");
+                dataFieldsNode = field.TopNode.SelectSingleNode("../../d:dataFields", field.NameSpaceManager);
+            }
+
+            XmlElement node = _table.PivotTableXml.CreateElement("dataField", ExcelPackage.schemaMain);
+            node.SetAttribute("fld", field.Index.ToString());
+            dataFieldsNode.AppendChild(node);
+
+            //XmlElement node = field.AppendField(dataFieldsNode, field.Index, "dataField", "fld");
+            field.SetXmlNodeBool("@dataField", true,false);
+
+            var dataField = new ExcelPivotTableDataField(field.NameSpaceManager, node, field);
+            ValidateDupName(dataField);
+
+            _list.Add(dataField);
+            return dataField;
+        }
+        private void ValidateDupName(ExcelPivotTableDataField dataField)
+        {
+            if(ExistsDfName(dataField.Field.Name, null))
+            {
+                var index = 2;
+                string name;
+                do
+                {
+                    name = dataField.Field.Name + "_" + index++.ToString();
+                }
+                while (ExistsDfName(name,null));
+                dataField.Name = name;
+            }
+        }
+
+        internal bool ExistsDfName(string name, ExcelPivotTableDataField datafield)
+        {
+            name = name.ToLower();
+            foreach (var df in _list)
+            {
+                if (((!string.IsNullOrEmpty(df.Name) && df.Name.ToLower() == name) ||
+                     (string.IsNullOrEmpty(df.Name) && df.Field.Name.ToLower() == name)) && datafield != df)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+        /// <summary>
+        /// Remove a datafield
+        /// </summary>
+        /// <param name="dataField"></param>
+        public void Remove(ExcelPivotTableDataField dataField)
+        {
+            XmlElement node = dataField.Field.TopNode.SelectSingleNode(string.Format("../../d:dataFields/d:dataField[@fld={0}]", dataField.Index), dataField.NameSpaceManager) as XmlElement;
+            if (node != null)
+            {
+                node.ParentNode.RemoveChild(node);
+            }
+            _list.Remove(dataField);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableFieldGroup.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableFieldGroup.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableFieldGroup.cs	(revision 9616)
@@ -0,0 +1,160 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		21-MAR-2011
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+using System.Globalization;
+
+namespace OfficeOpenXml.Table.PivotTable
+{
+    /// <summary>
+    /// Base class for pivot table field groups
+    /// </summary>
+    public class ExcelPivotTableFieldGroup : XmlHelper
+    {
+        internal ExcelPivotTableFieldGroup(XmlNamespaceManager ns, XmlNode topNode) :
+            base(ns, topNode)
+        {
+            
+        }
+    }
+    /// <summary>
+    /// A date group
+    /// </summary>
+    public class ExcelPivotTableFieldDateGroup : ExcelPivotTableFieldGroup
+    {
+        internal ExcelPivotTableFieldDateGroup(XmlNamespaceManager ns, XmlNode topNode) :
+            base(ns, topNode)
+        {
+        }
+        const string groupByPath = "d:fieldGroup/d:rangePr/@groupBy";
+        /// <summary>
+        /// How to group the date field
+        /// </summary>
+        public eDateGroupBy GroupBy
+        {
+            get
+            {
+                string v = GetXmlNodeString(groupByPath);
+                if (v != "")
+                {
+                    return (eDateGroupBy)Enum.Parse(typeof(eDateGroupBy), v, true);
+                }
+                else
+                {
+                    throw (new Exception("Invalid date Groupby"));
+                }
+            }
+            private set
+            {
+                SetXmlNodeString(groupByPath, value.ToString().ToLower());
+            }
+        }
+        /// <summary>
+        /// Auto detect start date
+        /// </summary>
+        public bool AutoStart
+        {
+            get
+            {
+                return GetXmlNodeBool("@autoStart", false);
+            }
+        }
+        /// <summary>
+        /// Auto detect end date
+        /// </summary>
+        public bool AutoEnd
+        {
+            get
+            {
+                return GetXmlNodeBool("@autoStart", false);
+            }
+        }
+    }
+    /// <summary>
+    /// A pivot table field numeric grouping
+    /// </summary>
+    public class ExcelPivotTableFieldNumericGroup : ExcelPivotTableFieldGroup
+    {
+        internal ExcelPivotTableFieldNumericGroup(XmlNamespaceManager ns, XmlNode topNode) :
+            base(ns, topNode)
+        {
+        }
+        const string startPath = "d:fieldGroup/d:rangePr/@startNum";
+        /// <summary>
+        /// Start value
+        /// </summary>
+        public double Start
+        {
+            get
+            {
+                return (double)GetXmlNodeDoubleNull(startPath);
+            }
+            private set
+            {
+                SetXmlNodeString(startPath,value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string endPath = "d:fieldGroup/d:rangePr/@endNum";
+        /// <summary>
+        /// End value
+        /// </summary>
+        public double End
+        {
+            get
+            {
+                return (double)GetXmlNodeDoubleNull(endPath);
+            }
+            private set
+            {
+                SetXmlNodeString(endPath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+        const string groupIntervalPath = "d:fieldGroup/d:rangePr/@groupInterval";
+        /// <summary>
+        /// Interval
+        /// </summary>
+        public double Interval
+        {
+            get
+            {
+                return (double)GetXmlNodeDoubleNull(groupIntervalPath);
+            }
+            private set
+            {
+                SetXmlNodeString(groupIntervalPath, value.ToString(CultureInfo.InvariantCulture));
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableFieldItem.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableFieldItem.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTableFieldItem.cs	(revision 9616)
@@ -0,0 +1,92 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		21-MAR-2011
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Table.PivotTable
+{
+    /// <summary>
+    /// A field Item. Used for grouping
+    /// </summary>
+    public class ExcelPivotTableFieldItem : XmlHelper
+    {
+        ExcelPivotTableField _field;
+        internal ExcelPivotTableFieldItem(XmlNamespaceManager ns, XmlNode topNode, ExcelPivotTableField field) :
+            base(ns, topNode)
+        {
+           _field = field;
+        }
+        /// <summary>
+        /// The text. Unique values only
+        /// </summary>
+        public string Text
+        {
+            get
+            {
+                return GetXmlNodeString("@n");
+            }
+            set
+            {
+                if(string.IsNullOrEmpty(value))
+                {
+                    DeleteNode("@n");
+                    return;
+                }
+                foreach (var item in _field.Items)
+                {
+                    if (item.Text == value)
+                    {
+                        throw(new ArgumentException("Duplicate Text"));
+                    }
+                }
+                SetXmlNodeString("@n", value);
+            }
+        }
+        internal int X
+        {
+            get
+            {
+                return GetXmlNodeInt("@x"); 
+            }
+        }
+        internal string T
+        {
+            get
+            {
+                return GetXmlNodeString("@t");
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTablePageFieldSettings.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTablePageFieldSettings.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Table/PivotTable/ExcelPivotTablePageFieldSettings.cs	(revision 9616)
@@ -0,0 +1,118 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		Added		21-MAR-2011
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml.Table.PivotTable
+{
+    /// <summary>
+    /// A page / report filter field
+    /// </summary>
+    public class ExcelPivotTablePageFieldSettings  : XmlHelper
+    {
+        ExcelPivotTableField _field;
+        internal ExcelPivotTablePageFieldSettings(XmlNamespaceManager ns, XmlNode topNode, ExcelPivotTableField field, int index) :
+            base(ns, topNode)
+        {
+            if (GetXmlNodeString("@hier")=="")
+            {
+                Hier = -1;
+            }
+            _field = field;
+        }
+        internal int Index 
+        { 
+            get
+            {
+                return GetXmlNodeInt("@fld");
+            }
+            set
+            {
+                SetXmlNodeString("@fld",value.ToString());
+            }
+        }
+        /// <summary>
+        /// The Name of the field
+        /// </summary>
+        public string Name
+        {
+            get
+            {
+                return GetXmlNodeString("@name");
+            }
+            set
+            {
+                SetXmlNodeString("@name", value);
+            }
+        }
+        /***** Dont work. Need items to be populated. ****/
+        ///// <summary>
+        ///// The selected item 
+        ///// </summary>
+        //public int SelectedItem
+        //{
+        //    get
+        //    {
+        //        return GetXmlNodeInt("@item");
+        //    }
+        //    set
+        //    {
+        //        if (value < 0) throw new InvalidOperationException("Can't be negative");
+        //        SetXmlNodeString("@item", value.ToString());
+        //    }
+        //}
+        internal int NumFmtId
+        {
+            get
+            {
+                return GetXmlNodeInt("@numFmtId");
+            }
+            set
+            {
+                SetXmlNodeString("@numFmtId", value.ToString());
+            }
+        }
+        internal int Hier
+        {
+            get
+            {
+                return GetXmlNodeInt("@hier");
+            }
+            set
+            {
+                SetXmlNodeString("@hier", value.ToString());
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/AddressUtility.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/AddressUtility.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/AddressUtility.cs	(revision 9616)
@@ -0,0 +1,29 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace OfficeOpenXml.Utils
+{
+    public static class AddressUtility
+    {
+        public static string ParseEntireColumnSelections(string address)
+        {
+            string parsedAddress = address;
+            var matches = Regex.Matches(address, "[A-Z]+:[A-Z]+");
+            foreach (Match match in matches)
+            {
+                AddRowNumbersToEntireColumnRange(ref parsedAddress, match.Value);
+            }
+            return parsedAddress;
+        }
+
+        private static void AddRowNumbersToEntireColumnRange(ref string address, string range)
+        {
+            var parsedRange = string.Format("{0}{1}", range, ExcelPackage.MaxRows);
+            var splitArr = parsedRange.Split(new char[] { ':' });
+            address = address.Replace(range, string.Format("{0}1:{1}", splitArr[0], splitArr[1]));
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/Argument.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/Argument.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/Argument.cs	(revision 9616)
@@ -0,0 +1,53 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.Utils
+{
+    internal class Argument<T> : IArgument<T>
+    {
+        public Argument(T @value)
+        {
+            _value = @value;
+        }
+
+        private T _value;
+
+        T IArgument<T>.Value
+        {
+            get { return _value; }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/ArgumentExtensions.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/ArgumentExtensions.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/ArgumentExtensions.cs	(revision 9616)
@@ -0,0 +1,95 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.Utils
+{
+    /// <summary>
+    /// Extension methods for guarding
+    /// </summary>
+    public static class ArgumentExtensions
+    {
+
+        /// <summary>
+        /// Throws an ArgumentNullException if argument is null
+        /// </summary>
+        /// <typeparam name="T">Argument type</typeparam>
+        /// <param name="argument">Argument to check</param>
+        /// <param name="argumentName">parameter/argument name</param>
+        /// <exception cref="ArgumentNullException"></exception>
+        public static void IsNotNull<T>(this IArgument<T> argument, string argumentName)
+            where T : class
+        {
+            argumentName = string.IsNullOrEmpty(argumentName) ? "value" : argumentName;
+            if (argument.Value == null)
+            {
+                throw new ArgumentNullException(argumentName);
+            }
+        }
+
+        /// <summary>
+        /// Throws an <see cref="ArgumentNullException"/> if the string argument is null or empty
+        /// </summary>
+        /// <param name="argument">Argument to check</param>
+        /// <param name="argumentName">parameter/argument name</param>
+        /// <exception cref="ArgumentNullException"></exception>
+        public static void IsNotNullOrEmpty(this IArgument<string> argument, string argumentName)
+        {
+            if (string.IsNullOrEmpty(argument.Value))
+            {
+                throw new ArgumentNullException(argumentName);
+            }
+        }
+
+        /// <summary>
+        /// Throws an ArgumentOutOfRangeException if the value of the argument is out of the supplied range
+        /// </summary>
+        /// <typeparam name="T">Type implementing <see cref="IComparable"/></typeparam>
+        /// <param name="argument">The argument to check</param>
+        /// <param name="min">Min value of the supplied range</param>
+        /// <param name="max">Max value of the supplied range</param>
+        /// <param name="argumentName">parameter/argument name</param>
+        /// <exception cref="ArgumentOutOfRangeException"></exception>
+        public static void IsInRange<T>(this IArgument<T> argument, T min, T max, string argumentName)
+            where T : IComparable
+        {
+            if (!(argument.Value.CompareTo(min) >= 0 && argument.Value.CompareTo(max) <= 0))
+            {
+                throw new ArgumentOutOfRangeException(argumentName);
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/CompoundDocument.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/CompoundDocument.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/CompoundDocument.cs	(revision 9616)
@@ -0,0 +1,716 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		01-01-2012
+ * Jan Källman      Added compression support 27-03-2012
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Runtime.InteropServices;
+using comTypes = System.Runtime.InteropServices.ComTypes;
+using System.IO;
+
+namespace OfficeOpenXml.Utils
+{
+    internal class CompoundDocument
+    {
+        internal class StoragePart
+        {
+            public StoragePart()
+            {
+
+            }
+            internal Dictionary<string, StoragePart> SubStorage = new Dictionary<string, StoragePart>();
+            internal Dictionary<string, byte[]> DataStreams = new Dictionary<string, byte[]>();
+        }
+        internal StoragePart Storage = null;
+        internal CompoundDocument()
+        {
+        }
+        internal CompoundDocument(byte[] doc)
+        {
+            ILockBytes lb;
+            var iret = CreateILockBytesOnHGlobal(IntPtr.Zero, true, out lb);
+
+            IntPtr buffer = Marshal.AllocHGlobal(doc.Length);
+            Marshal.Copy(doc, 0, buffer, doc.Length);
+            UIntPtr readSize;
+            lb.WriteAt(0, buffer, doc.Length, out readSize);
+            Marshal.FreeHGlobal(buffer);
+
+            if (StgIsStorageILockBytes(lb) == 0)
+            {
+                IStorage storage = null;
+                if (StgOpenStorageOnILockBytes(
+                    lb,
+                    null,
+                    STGM.DIRECT | STGM.READ | STGM.SHARE_EXCLUSIVE,
+                    IntPtr.Zero,
+                    0,
+                    out storage) == 0)
+                {
+                    Storage = new StoragePart();
+                    ReadParts(storage, Storage);
+                    Marshal.ReleaseComObject(storage);
+                }
+            }
+            else
+            {
+                throw (new InvalidDataException(string.Format("Part is not a compound document")));
+            }
+        }
+        #region  Compression
+        /// <summary>
+        /// Compression using a run length encoding algorithm.
+        /// See MS-OVBA Section 2.4
+        /// </summary>
+        /// <param name="part">Byte array to decompress</param>
+        /// <returns></returns>
+        internal static byte[] CompressPart(byte[] part)
+        {
+            MemoryStream ms = new MemoryStream(4096);
+            BinaryWriter br = new BinaryWriter(ms);
+            br.Write((byte)1);
+
+            int compStart = 1;
+            int compEnd = 4098;
+            int decompStart = 0;
+            int decompEnd = part.Length < 4096 ? part.Length : 4096;
+
+            while (decompStart < decompEnd && compStart < compEnd)
+            {
+                byte[] chunk = CompressChunk(part, ref decompStart);
+                ushort header;
+                if (chunk == null || chunk.Length == 0)
+                {
+                    header = 4096 | 0x600;  //B=011 A=0
+                }
+                else
+                {
+                    header = (ushort)(((chunk.Length - 1) & 0xFFF));
+                    header |= 0xB000;   //B=011 A=1
+                    br.Write(header);
+                    br.Write(chunk);                    
+                }
+                decompEnd = part.Length < decompStart + 4096 ? part.Length : decompStart+4096;
+            }
+
+            
+            br.Flush();
+            return ms.ToArray();        
+        }
+        private static byte[] CompressChunk(byte[] buffer, ref int startPos)
+        {
+            var comprBuffer=new byte[4096];
+            int flagPos = 0;
+            int cPos=1;
+            int dPos = startPos;
+            int dEnd=startPos+4096 < buffer.Length? startPos+4096 : buffer.Length;
+            while(dPos<dEnd)
+            {
+                byte tokenFlags = 0;
+                for (int i = 0; i < 8; i++)
+                {
+                    if (dPos - startPos > 0)
+                    {
+                        int bestCandidate = -1;
+                        int bestLength = 0;
+                        int candidate = dPos - 1;
+                        int bitCount = GetLengthBits(dPos-startPos);
+                        int bits = (16 - bitCount);
+                        ushort lengthMask = (ushort)((0xFFFF) >> bits);
+
+                        while (candidate >= startPos)
+                        {
+                            if (buffer[candidate] == buffer[dPos])
+                            {
+                                int length = 1;
+
+                                while (buffer.Length > dPos + length && buffer[candidate + length] == buffer[dPos + length] && length < lengthMask)
+                                {
+                                    length++;
+                                }
+                                if (length > bestLength)
+                                {
+                                    bestCandidate = candidate;
+                                    bestLength = length;
+                                    if (bestLength == lengthMask)
+                                    {
+                                        break;
+                                    }
+                                }
+                            }
+                            candidate--;
+                        }
+                        if (bestLength >= 3)    //Copy token
+                        {
+                            tokenFlags |= (byte)(1 << i);
+
+                            UInt16 offsetMask = (ushort)~lengthMask;
+                            ushort token = (ushort)(((ushort)(dPos - (bestCandidate+1))) << (bitCount) | (ushort)(bestLength - 3));
+                            Array.Copy(BitConverter.GetBytes(token), 0, comprBuffer, cPos, 2);
+                            dPos = dPos + bestLength;
+                            cPos += 2;
+                            //SetCopy Token                        
+                        }
+                        else
+                        {
+                            comprBuffer[cPos++] = buffer[dPos++];
+                        }
+                    }
+                    
+                    else
+                    {
+                        comprBuffer[cPos++] = buffer[dPos++];
+                    }
+                    if (dPos >= dEnd) break;
+                }
+                comprBuffer[flagPos] = tokenFlags;
+                flagPos = cPos++;
+            }
+            var ret = new byte[cPos - 1];
+            Array.Copy(comprBuffer, ret, ret.Length);
+            startPos = dEnd;
+            return ret;
+        }
+        internal static byte[] DecompressPart(byte[] part)
+        {
+            return DecompressPart(part, 0);
+        }
+        /// <summary>
+        /// Decompression using a run length encoding algorithm.
+        /// See MS-OVBA Section 2.4
+        /// </summary>
+        /// <param name="part">Byte array to decompress</param>
+        /// <param name="startPos"></param>
+        /// <returns></returns>
+        internal static byte[] DecompressPart(byte[] part, int startPos)
+        {
+
+            if (part[startPos] != 1)
+            {
+                return null;
+            }
+            MemoryStream ms = new MemoryStream(4096);
+            BinaryWriter br=new BinaryWriter(ms);
+            int compressPos = startPos+1;
+            while(compressPos<part.Length-1)
+            {
+                byte[] chunk = GetChunk(part, ref compressPos);
+                if (chunk != null)
+                {
+                    br.Write(chunk);
+                }
+            }
+            br.Flush();
+            return ms.ToArray();
+        }
+        private static byte[] GetChunk(byte[] compBuffer, ref int pos)
+        {
+            ushort header = BitConverter.ToUInt16(compBuffer, pos);
+            int  decomprPos=0;
+            byte[] buffer = new byte[4098];
+            int size = (int)(header & 0xFFF)+3;
+            int endPos = pos+size;
+            int a = (int)(header & 0x7000) >> 12;
+            int b = (int)(header & 0x8000) >> 15;
+            pos += 2;
+            if (b == 1) //Compressed chunk
+            {
+                while (pos < compBuffer.Length && pos < endPos)
+                {
+                    //Decompress token
+                    byte token = compBuffer[pos++];
+                    if (pos >= endPos)
+                        break;
+                    for (int i = 0; i < 8; i++)
+                    {
+                        //Literal token
+                        if ((token & (1 << i)) == 0)
+                        {
+                            buffer[decomprPos++] = compBuffer[pos++];
+                        }
+                        else //copy token
+                        {
+                            var t = BitConverter.ToUInt16(compBuffer, pos);
+                            int bitCount = GetLengthBits(decomprPos);
+                            int bits = (16 - bitCount);
+                            ushort lengthMask = (ushort)((0xFFFF) >> bits);
+                            UInt16 offsetMask = (ushort)~lengthMask;
+                            var length = (lengthMask & t) + 3;
+                            var offset = (offsetMask & t) >> (bitCount);
+                            int source = decomprPos - offset - 1;
+                            for (int c = 0; c < length; c++)
+                            {
+                                buffer[decomprPos++] = buffer[source++];
+                            }
+
+                            pos += 2;
+
+                        }
+                        if (pos >= endPos)
+                            break;
+                    }
+                }
+                if (decomprPos > 0)
+                {
+                    byte[] ret = new byte[decomprPos];
+                    Array.Copy(buffer, ret, decomprPos);
+                    return ret;
+                }
+                else
+                {
+                    return null;
+                }
+            }
+            else //Raw chunk
+            {
+                byte[] ret = new byte[size];
+                Array.Copy(compBuffer, pos, ret,0, size);
+                pos += size;
+                return ret;
+            }
+        }
+        private static int GetLengthBits(int decompPos)
+        {
+            if (decompPos <= 16)
+            {
+                return 12;
+            }
+            else if (decompPos <= 32)
+            {
+                return 11;
+            }
+            else if (decompPos <= 64)
+            {
+                return 10;
+            }
+            else if (decompPos <= 128)
+            {
+                return 9;
+            }
+            else if (decompPos <= 256)
+            {
+                return 8;
+            }
+            else if (decompPos <= 512)
+            {
+                return 7;
+            }
+            else if (decompPos <= 1024)
+            {
+                return 6;
+            }
+            else if (decompPos <= 2048)
+            {
+                return 5;
+            }
+            else if (decompPos <= 4096)
+            {
+                return 4;
+            }
+            else
+            {
+                //We should never end up here, but if so this is the formula to calculate the bits...
+                return 12 - (int)Math.Truncate(Math.Log(decompPos - 1 >> 4, 2) + 1);
+            }
+        }
+        #endregion
+        #region "API declare"
+        [ComImport]
+        [Guid("0000000d-0000-0000-C000-000000000046")]
+        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+        internal interface IEnumSTATSTG
+        {
+            // The user needs to allocate an STATSTG array whose size is celt. 
+            [PreserveSig]
+            uint Next(
+                uint celt,
+                [MarshalAs(UnmanagedType.LPArray), Out] 
+            System.Runtime.InteropServices.ComTypes.STATSTG[] rgelt,
+                out uint pceltFetched
+            );
+
+            void Skip(uint celt);
+
+            void Reset();
+
+            [return: MarshalAs(UnmanagedType.Interface)]
+            IEnumSTATSTG Clone();
+        }
+
+        [ComImport]
+        [Guid("0000000b-0000-0000-C000-000000000046")]
+        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
+        interface IStorage
+        {
+            void CreateStream(
+                /* [string][in] */ string pwcsName,
+                /* [in] */ uint grfMode,
+                /* [in] */ uint reserved1,
+                /* [in] */ uint reserved2,
+                /* [out] */ out comTypes.IStream ppstm);
+
+            void OpenStream(
+                /* [string][in] */ string pwcsName,
+                /* [unique][in] */ IntPtr reserved1,
+                /* [in] */ uint grfMode,
+                /* [in] */ uint reserved2,
+                /* [out] */ out comTypes.IStream ppstm);
+
+            void CreateStorage(
+                /* [string][in] */ string pwcsName,
+                /* [in] */ uint grfMode,
+                /* [in] */ uint reserved1,
+                /* [in] */ uint reserved2,
+                /* [out] */ out IStorage ppstg);
+
+            void OpenStorage(
+                /* [string][unique][in] */ string pwcsName,
+                /* [unique][in] */ IStorage pstgPriority,
+                /* [in] */ STGM grfMode,
+                /* [unique][in] */ IntPtr snbExclude,
+                /* [in] */ uint reserved,
+                /* [out] */ out IStorage ppstg);
+
+            void CopyTo(
+                [InAttribute] uint ciidExclude,
+                [InAttribute] Guid[] rgiidExclude,
+                [InAttribute] IntPtr snbExclude,
+                [InAttribute] IStorage pstgDest
+            );
+
+            void MoveElementTo(
+                /* [string][in] */ string pwcsName,
+                /* [unique][in] */ IStorage pstgDest,
+                /* [string][in] */ string pwcsNewName,
+                /* [in] */ uint grfFlags);
+
+            void Commit(
+                /* [in] */ uint grfCommitFlags);
+
+            void Revert();
+
+            void EnumElements(
+                /* [in] */ uint reserved1,
+                /* [size_is][unique][in] */ IntPtr reserved2,
+                /* [in] */ uint reserved3,
+                /* [out] */ out IEnumSTATSTG ppenum);
+
+            void DestroyElement(
+                /* [string][in] */ string pwcsName);
+
+            void RenameElement(
+                /* [string][in] */ string pwcsOldName,
+                /* [string][in] */ string pwcsNewName);
+
+            void SetElementTimes(
+                /* [string][unique][in] */ string pwcsName,
+                /* [unique][in] */ System.Runtime.InteropServices.ComTypes.FILETIME pctime,
+                /* [unique][in] */ System.Runtime.InteropServices.ComTypes.FILETIME patime,
+                /* [unique][in] */ System.Runtime.InteropServices.ComTypes.FILETIME pmtime);
+
+            void SetClass(
+                /* [in] */ Guid clsid);
+
+            void SetStateBits(
+                /* [in] */ uint grfStateBits,
+                /* [in] */ uint grfMask);
+
+            void Stat(
+                /* [out] */ out System.Runtime.InteropServices.ComTypes.STATSTG pstatstg,
+                /* [in] */ uint grfStatFlag);
+
+        }
+        [ComVisible(false)]
+        [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("0000000A-0000-0000-C000-000000000046")]
+        internal interface ILockBytes
+        {
+            void ReadAt(long ulOffset, System.IntPtr pv, int cb, out UIntPtr pcbRead);
+            void WriteAt(long ulOffset, System.IntPtr pv, int cb, out UIntPtr pcbWritten);
+            void Flush();
+            void SetSize(long cb);
+            void LockRegion(long libOffset, long cb, int dwLockType);
+            void UnlockRegion(long libOffset, long cb, int dwLockType);
+            void Stat(out System.Runtime.InteropServices.ComTypes.STATSTG pstatstg, int grfStatFlag);
+        }
+        [Flags]
+        internal enum STGM : int
+        {
+            DIRECT = 0x00000000,
+            TRANSACTED = 0x00010000,
+            SIMPLE = 0x08000000,
+            READ = 0x00000000,
+            WRITE = 0x00000001,
+            READWRITE = 0x00000002,
+            SHARE_DENY_NONE = 0x00000040,
+            SHARE_DENY_READ = 0x00000030,
+            SHARE_DENY_WRITE = 0x00000020,
+            SHARE_EXCLUSIVE = 0x00000010,
+            PRIORITY = 0x00040000,
+            DELETEONRELEASE = 0x04000000,
+            NOSCRATCH = 0x00100000,
+            CREATE = 0x00001000,
+            CONVERT = 0x00020000,
+            FAILIFTHERE = 0x00000000,
+            NOSNAPSHOT = 0x00200000,
+            DIRECT_SWMR = 0x00400000,
+        }
+
+        internal enum STATFLAG : uint
+        {
+            STATFLAG_DEFAULT = 0,
+            STATFLAG_NONAME = 1,
+            STATFLAG_NOOPEN = 2
+        }
+
+        internal enum STGTY : int
+        {
+            STGTY_STORAGE = 1,
+            STGTY_STREAM = 2,
+            STGTY_LOCKBYTES = 3,
+            STGTY_PROPERTY = 4
+        }
+        [DllImport("ole32.dll")]
+        private static extern int StgIsStorageFile(
+            [MarshalAs(UnmanagedType.LPWStr)] string pwcsName);
+        [DllImport("ole32.dll")]
+        private static extern int StgIsStorageILockBytes(
+            ILockBytes plkbyt);
+
+
+        [DllImport("ole32.dll")]
+        static extern int StgOpenStorage(
+            [MarshalAs(UnmanagedType.LPWStr)] string pwcsName,
+            IStorage pstgPriority,
+            STGM grfMode,
+            IntPtr snbExclude,
+            uint reserved,
+            out IStorage ppstgOpen);
+
+        [DllImport("ole32.dll")]
+        static extern int StgOpenStorageOnILockBytes(
+            ILockBytes plkbyt,
+            IStorage pStgPriority,
+            STGM grfMode,
+            IntPtr snbEnclude,
+            uint reserved,
+            out IStorage ppstgOpen);
+        [DllImport("ole32.dll")]
+        static extern int CreateILockBytesOnHGlobal(
+            IntPtr hGlobal,
+            bool fDeleteOnRelease,
+            out ILockBytes ppLkbyt);
+
+        [DllImport("ole32.dll")]
+        static extern int StgCreateDocfileOnILockBytes(ILockBytes plkbyt, STGM grfMode, int reserved, out IStorage ppstgOpen);
+        
+        #endregion
+        internal static int IsStorageFile(string Name)
+        {
+            return StgIsStorageFile(Name);
+        }
+        internal static int IsStorageILockBytes(ILockBytes lb)
+        {
+            return StgIsStorageILockBytes(lb);
+        }
+        internal ILockBytes GetLockbyte(MemoryStream stream)
+        {
+            ILockBytes lb;
+            var iret = CreateILockBytesOnHGlobal(IntPtr.Zero, true, out lb);
+            byte[] docArray = stream.GetBuffer();
+            IntPtr buffer = Marshal.AllocHGlobal(docArray.Length);
+            Marshal.Copy(docArray, 0, buffer, docArray.Length);
+            UIntPtr readSize;
+            lb.WriteAt(0, buffer, docArray.Length, out readSize);
+            Marshal.FreeHGlobal(buffer);
+            return lb;
+        }
+        private MemoryStream ReadParts(IStorage storage, StoragePart storagePart)
+        {
+            MemoryStream ret = null;
+            comTypes.STATSTG statstg;
+
+            storage.Stat(out statstg, (uint)STATFLAG.STATFLAG_DEFAULT);
+
+            IEnumSTATSTG pIEnumStatStg = null;
+            storage.EnumElements(0, IntPtr.Zero, 0, out pIEnumStatStg);
+
+            comTypes.STATSTG[] regelt = { statstg };
+            uint fetched = 0;
+            uint res = pIEnumStatStg.Next(1, regelt, out fetched);
+
+            //if (regelt[0].pwcsName == "DataSpaces")
+            //{
+            //    PrintStorage(storage, regelt[0],"");
+            //}
+            while (res != 1)
+            {
+                foreach (var item in regelt)
+                {
+                    if (item.type == 1)
+                    {
+                        IStorage subStorage;
+                        storage.OpenStorage(item.pwcsName, null, STGM.DIRECT | STGM.READ | STGM.SHARE_EXCLUSIVE, IntPtr.Zero, 0, out subStorage);
+                        StoragePart subStoragePart=new StoragePart();
+                        storagePart.SubStorage.Add(item.pwcsName, subStoragePart);
+                        ReadParts(subStorage, subStoragePart);
+                    }
+                    else
+                    {
+                        storagePart.DataStreams.Add(item.pwcsName, GetOleStream(storage, item));                    
+                    }
+                }
+                res = pIEnumStatStg.Next(1, regelt, out fetched);
+            }
+            Marshal.ReleaseComObject(pIEnumStatStg);
+            return ret;
+        }
+        // Help method to print a storage part binary to c:\temp
+        //private void PrintStorage(IStorage storage, System.Runtime.InteropServices.ComTypes.STATSTG sTATSTG, string topName)
+        //{
+        //    IStorage ds;
+        //    if (topName.Length > 0)
+        //    {
+        //        topName = topName[0] < 'A' ? topName.Substring(1, topName.Length - 1) : topName;
+        //    }
+        //    storage.OpenStorage(sTATSTG.pwcsName,
+        //        null,
+        //        (uint)(STGM.DIRECT | STGM.READ | STGM.SHARE_EXCLUSIVE),
+        //        IntPtr.Zero,
+        //        0,
+        //        out ds);
+
+        //    System.Runtime.InteropServices.ComTypes.STATSTG statstgSub;
+        //    ds.Stat(out statstgSub, (uint)STATFLAG.STATFLAG_DEFAULT);
+
+        //    IEnumSTATSTG pIEnumStatStgSub = null;
+        //    System.Runtime.InteropServices.ComTypes.STATSTG[] regeltSub = { statstgSub };
+        //    ds.EnumElements(0, IntPtr.Zero, 0, out pIEnumStatStgSub);
+
+        //    uint fetched = 0;
+        //    while (pIEnumStatStgSub.Next(1, regeltSub, out fetched) == 0)
+        //    {
+        //        string sName = regeltSub[0].pwcsName[0] < 'A' ? regeltSub[0].pwcsName.Substring(1, regeltSub[0].pwcsName.Length - 1) : regeltSub[0].pwcsName;
+        //        if (regeltSub[0].type == 1)
+        //        {
+        //            PrintStorage(ds, regeltSub[0], topName + sName + "_");
+        //        }
+        //        else if(regeltSub[0].type==2)
+        //        {
+        //            File.WriteAllBytes(@"c:\temp\" + topName + sName + ".bin", GetOleStream(ds, regeltSub[0]));
+        //        }
+        //    }
+        //}    }
+        /// <summary>
+        /// Read the stream and return it as a byte-array
+        /// </summary>
+        /// <param name="storage"></param>
+        /// <param name="statstg"></param>
+        /// <returns></returns>
+        private byte[] GetOleStream(IStorage storage, comTypes.STATSTG statstg)
+        {
+            comTypes.IStream pIStream;
+            storage.OpenStream(statstg.pwcsName,
+               IntPtr.Zero,
+               (uint)(STGM.READ | STGM.SHARE_EXCLUSIVE),
+               0,
+               out pIStream);
+
+            byte[] data = new byte[statstg.cbSize];
+            pIStream.Read(data, (int)statstg.cbSize, IntPtr.Zero);
+            Marshal.ReleaseComObject(pIStream);
+
+            return data;
+        }
+        internal byte[] Save()
+        {
+            ILockBytes lb;
+            var iret = CreateILockBytesOnHGlobal(IntPtr.Zero, true, out lb);
+
+            IStorage storage = null;
+            byte[] ret = null;
+
+            //Create the document in-memory
+            if (StgCreateDocfileOnILockBytes(lb,
+                    STGM.CREATE | STGM.READWRITE | STGM.SHARE_EXCLUSIVE | STGM.TRANSACTED, 
+                    0,
+                    out storage)==0)
+            {
+                foreach(var store in this.Storage.SubStorage)
+                {
+                    CreateStore(store.Key, store.Value, storage);
+                }
+                CreateStreams(this.Storage, storage);                                
+                lb.Flush();
+                
+                //Now copy the unmanaged stream to a byte array --> memory stream
+                var statstg = new comTypes.STATSTG();
+                lb.Stat(out statstg, 0);
+                int size = (int)statstg.cbSize;
+                IntPtr buffer = Marshal.AllocHGlobal(size);
+                UIntPtr readSize;
+                ret=new byte[size];
+                lb.ReadAt(0, buffer, size, out readSize);
+                Marshal.Copy(buffer, ret, 0, size);
+                Marshal.FreeHGlobal(buffer);
+            }
+            Marshal.ReleaseComObject(storage);
+            Marshal.ReleaseComObject(lb);
+
+            return ret;
+        }
+
+        private void CreateStore(string name, StoragePart subStore, IStorage storage)
+        {
+            IStorage subStorage;
+            storage.CreateStorage(name, (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out subStorage);
+            storage.Commit(0);
+            foreach (var store in subStore.SubStorage)
+            {
+                CreateStore(store.Key, store.Value, subStorage);
+            }
+            
+            CreateStreams(subStore, subStorage);
+        }
+
+        private void CreateStreams(StoragePart subStore, IStorage subStorage)
+        {
+            foreach (var ds in subStore.DataStreams)
+            {
+                comTypes.IStream stream;
+                subStorage.CreateStream(ds.Key, (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out stream);
+                stream.Write(ds.Value, ds.Value.Length, IntPtr.Zero);
+            }
+            subStorage.Commit(0);
+        }
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/EncryptedPackageHandler.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/EncryptedPackageHandler.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/EncryptedPackageHandler.cs	(revision 9616)
@@ -0,0 +1,1094 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ **************************************************************************************
+ * This class is created with the help of the MS-OFFCRYPTO PDF documentation... http://msdn.microsoft.com/en-us/library/cc313071(office.12).aspx
+ * Decryption library for Office Open XML files(Lyquidity) and Sminks very nice example 
+ * on "Reading compound documents in c#" on Stackoverflow. Many thanks!
+ ***************************************************************************************
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		10-AUG-2010
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Runtime.InteropServices; 
+using comTypes=System.Runtime.InteropServices.ComTypes;
+using System.IO;
+using System.Security.Cryptography;
+using System.IO.Packaging; 
+namespace OfficeOpenXml.Utils
+{
+    /// <summary>
+    /// Handles the EncryptionInfo stream
+    /// </summary>
+    internal class EncryptionInfo
+    {
+        internal short MajorVersion;
+        internal short MinorVersion;
+        internal Flags Flags;
+        internal uint HeaderSize;
+        internal EncryptionHeader Header;
+        internal EncryptionVerifier Verifier;
+        internal void ReadBinary(byte[] data)
+        {
+            MajorVersion = BitConverter.ToInt16(data, 0);
+            MinorVersion = BitConverter.ToInt16(data, 2);
+
+            Flags = (Flags)BitConverter.ToInt32(data, 4);
+            HeaderSize = (uint)BitConverter.ToInt32(data, 8);
+
+            /**** EncryptionHeader ****/
+            Header = new EncryptionHeader();
+            Header.Flags = (Flags)BitConverter.ToInt32(data, 12);
+            Header.SizeExtra = BitConverter.ToInt32(data, 16);
+            Header.AlgID = (AlgorithmID)BitConverter.ToInt32(data, 20);
+            Header.AlgIDHash = (AlgorithmHashID)BitConverter.ToInt32(data, 24);
+            Header.KeySize = BitConverter.ToInt32(data, 28);
+            Header.ProviderType = (ProviderType)BitConverter.ToInt32(data, 32);
+            Header.Reserved1 = BitConverter.ToInt32(data, 36);
+            Header.Reserved2 = BitConverter.ToInt32(data, 40);
+
+            byte[] text = new byte[(int)HeaderSize - 34];
+            Array.Copy(data, 44, text, 0, (int)HeaderSize - 34);
+            Header.CSPName = UTF8Encoding.Unicode.GetString(text);
+
+            int pos = (int)HeaderSize + 12;
+
+            /**** EncryptionVerifier ****/
+            Verifier = new EncryptionVerifier();
+            Verifier.SaltSize = (uint)BitConverter.ToInt32(data, pos);
+            Verifier.Salt = new byte[Verifier.SaltSize];
+
+            Array.Copy(data, pos + 4, Verifier.Salt, 0, Verifier.SaltSize);
+
+            Verifier.EncryptedVerifier = new byte[16];
+            Array.Copy(data, pos + 20, Verifier.EncryptedVerifier, 0, 16);
+
+            Verifier.VerifierHashSize = (uint)BitConverter.ToInt32(data, pos + 36);
+            Verifier.EncryptedVerifierHash = new byte[Verifier.VerifierHashSize];
+            Array.Copy(data, pos + 40, Verifier.EncryptedVerifierHash, 0, Verifier.VerifierHashSize);
+        }
+        internal byte[] WriteBinary()
+        {
+            MemoryStream ms=new MemoryStream();
+            BinaryWriter bw = new BinaryWriter(ms);
+
+            bw.Write(MajorVersion);
+            bw.Write(MinorVersion);
+            bw.Write((int)Flags);
+            byte[] header = Header.WriteBinary();
+            bw.Write((uint)header.Length);
+            bw.Write(header);
+            bw.Write(Verifier.WriteBinary());
+
+            bw.Flush();
+            return ms.ToArray();
+        }
+
+    }
+    /// <summary>
+    /// Encryption Header inside the EncryptionInfo stream
+    /// </summary>
+    internal class EncryptionHeader
+    {
+        internal Flags Flags;
+        internal int SizeExtra;             //MUST be 0x00000000.
+        internal AlgorithmID AlgID;         //MUST be 0x0000660E (AES-128), 0x0000660F (AES-192), or 0x00006610 (AES-256).
+        internal AlgorithmHashID AlgIDHash; //MUST be 0x00008004 (SHA-1).
+        internal int KeySize;               //MUST be 0x00000080 (AES-128), 0x000000C0 (AES-192), or 0x00000100 (AES-256).
+        internal ProviderType ProviderType; //SHOULD<10> be 0x00000018 (AES).
+        internal int Reserved1;             //Undefined and MUST be ignored.
+        internal int Reserved2;             //MUST be 0x00000000 and MUST be ignored.
+        internal string CSPName;            //SHOULD<11> be set to either "Microsoft Enhanced RSA and AES Cryptographic Provider" or "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)" as a null-terminated Unicode string.
+        internal byte[] WriteBinary()
+        {
+            MemoryStream ms = new MemoryStream();
+            BinaryWriter bw = new BinaryWriter(ms);
+
+            bw.Write((int)Flags);
+            bw.Write(SizeExtra);
+            bw.Write((int)AlgID);
+            bw.Write((int)AlgIDHash);
+            bw.Write((int)KeySize);
+            bw.Write((int)ProviderType);
+            bw.Write(Reserved1);
+            bw.Write(Reserved2);
+            bw.Write(Encoding.Unicode.GetBytes(CSPName));
+
+            bw.Flush();
+            return ms.ToArray();
+        }
+    }
+    /// <summary>
+    /// Encryption verifier inside the EncryptionInfo stream
+    /// </summary>
+    internal class EncryptionVerifier
+    {
+        internal uint SaltSize;              // An unsigned integer that specifies the size of the Salt field. It MUST be 0x00000010.
+        internal byte[] Salt;                //(16 bytes): An array of bytes that specifies the salt value used during password hash generation. It MUST NOT be the same data used for the verifier stored encrypted in the EncryptedVerifier field.
+        internal byte[] EncryptedVerifier;   //(16 bytes): MUST be the randomly generated Verifier value encrypted using the algorithm chosen by the implementation.
+        internal uint VerifierHashSize;      //(4 bytes): An unsigned integer that specifies the number of bytes needed to contain the hash of the data used to generate the EncryptedVerifier field.
+        internal byte[] EncryptedVerifierHash; //(variable): An array of bytes that contains the encrypted form of the hash of the randomly generated Verifier value. The length of the array MUST be the size of the encryption block size multiplied by the number of blocks needed to encrypt the hash of the Verifier. If the encryption algorithm is RC4, the length MUST be 20 bytes. If the encryption algorithm is AES, the length MUST be 32 bytes.
+        internal byte[] WriteBinary()
+        {
+            MemoryStream ms = new MemoryStream();
+            BinaryWriter bw = new BinaryWriter(ms);
+
+            bw.Write(SaltSize);
+            bw.Write(Salt);
+            bw.Write(EncryptedVerifier);
+            bw.Write(0x14);                 //Sha1 is 20 bytes  (Encrypted is 32)
+            bw.Write(EncryptedVerifierHash);
+
+            bw.Flush();
+            return ms.ToArray();
+        }
+    }
+    [Flags]
+    internal enum Flags
+    {
+        Reserved1 = 1,   // (1 bit): MUST be set to zero, and MUST be ignored.
+        Reserved2 = 2,   // (1 bit): MUST be set to zero, and MUST be ignored.
+        fCryptoAPI= 4,   // (1 bit): A flag that specifies whether CryptoAPI RC4 or [ECMA-376] encryption is used. It MUST be set to 1 unless fExternal is 1. If fExternal is set to 1, it MUST be set to zero.        
+        fDocProps = 8,   // (1 bit): MUST be set to zero if document properties are encrypted. Otherwise, it MUST be set to 1. Encryption of document properties is specified in section 2.3.5.4.
+        fExternal = 16,  // (1 bit): If extensible encryption is used, it MUST be set to 1. Otherwise, it MUST be set to zero. If this field is set to 1, all other fields in this structure MUST be set to zero.
+        fAES      = 32   //(1 bit): If the protected content is an [ECMA-376] document, it MUST be set to 1. Otherwise, it MUST be set to zero. If the fAES bit is set to 1, the fCryptoAPI bit MUST also be set to 1
+    }
+    internal enum AlgorithmID
+    {
+        Flags   = 0x00000000,   // Determined by Flags
+        RC4     = 0x00006801,   // RC4
+        AES128  = 0x0000660E,   // 128-bit AES
+        AES192  = 0x0000660F,   // 192-bit AES
+        AES256  = 0x00006610    // 256-bit AES
+    }
+    internal enum AlgorithmHashID
+    {
+        App =  0x00000000,
+        SHA1 = 0x00008004,
+    }
+    internal enum ProviderType
+    {
+        Flags=0x00000000,//Determined by Flags
+        RC4=0x00000001,
+        AES=0x00000018,
+    }
+    /// <summary>
+    /// Handels encrypted Excel documents 
+    /// </summary>
+    internal class EncryptedPackageHandler
+    {        
+        [DllImport("ole32.dll")]
+        private static extern int StgIsStorageFile(
+            [MarshalAs(UnmanagedType.LPWStr)] string pwcsName);
+        [DllImport("ole32.dll")]
+        private static extern int StgIsStorageILockBytes(
+            ILockBytes plkbyt);
+
+
+        [DllImport("ole32.dll")]
+        static extern int StgOpenStorage(
+            [MarshalAs(UnmanagedType.LPWStr)] string pwcsName,
+            IStorage pstgPriority,
+            STGM grfMode,
+            IntPtr snbExclude,
+            uint reserved,
+            out IStorage ppstgOpen);
+
+        [DllImport("ole32.dll")]
+        static extern int StgOpenStorageOnILockBytes(
+            ILockBytes plkbyt,
+            IStorage pStgPriority,
+            STGM grfMode,
+            IntPtr snbEnclude,
+            uint reserved,
+            out IStorage ppstgOpen);
+        [DllImport("ole32.dll")]
+        static extern int CreateILockBytesOnHGlobal(
+            IntPtr hGlobal,
+            bool fDeleteOnRelease,
+            out ILockBytes ppLkbyt);
+
+        [DllImport("ole32.dll")]
+        static extern int StgCreateDocfileOnILockBytes(ILockBytes plkbyt, STGM grfMode, int reserved, out IStorage ppstgOpen);
+        internal static int IsStorageFile(string Name)
+        {
+            return StgIsStorageFile(Name);
+        }
+        internal static int IsStorageILockBytes(ILockBytes lb)
+        {
+            return StgIsStorageILockBytes(lb);
+        }
+        /// <summary>
+        /// Read the package from the OLE document and decrypt it using the supplied password
+        /// </summary>
+        /// <param name="fi">The file</param>
+        /// <param name="encryption"></param>
+        /// <returns></returns>
+        internal MemoryStream DecryptPackage(FileInfo fi, ExcelEncryption encryption)
+        {
+            MemoryStream ret = null;
+            if (StgIsStorageFile(fi.FullName) == 0)
+            {
+                IStorage storage = null;
+                if (StgOpenStorage(
+                    fi.FullName,
+                    null,
+                    STGM.DIRECT | STGM.READ | STGM.SHARE_EXCLUSIVE,
+                    IntPtr.Zero,
+                    0,
+                    out storage) == 0)
+                {
+                    ret = GetStreamFromPackage(storage, encryption);                    
+                    Marshal.ReleaseComObject(storage);
+                }
+            }
+            else
+            {
+                throw(new InvalidDataException(string.Format("File {0} is not an encrypted package",fi.FullName)));
+            }
+            return ret;
+        }
+        /// <summary>
+        /// Read the package from the OLE document and decrypt it using the supplied password
+        /// </summary>
+        /// <param name="stream">The memory stream. </param>
+        /// <param name="encryption">The encryption object from the Package</param>
+        /// <returns></returns>
+        internal MemoryStream DecryptPackage(MemoryStream stream, ExcelEncryption encryption)
+        {
+            //Create the lockBytes object.
+            ILockBytes lb = GetLockbyte(stream);
+
+            MemoryStream ret = null;
+
+            if (StgIsStorageILockBytes(lb) == 0)
+            {
+                IStorage storage = null;
+                if (StgOpenStorageOnILockBytes(
+                        lb,
+                        null,
+                        STGM.DIRECT | STGM.READ | STGM.SHARE_EXCLUSIVE,
+                        IntPtr.Zero,
+                        0,
+                        out storage) == 0)
+                {
+                    ret = GetStreamFromPackage(storage, encryption);
+                }
+                Marshal.ReleaseComObject(storage);
+            }
+            else
+            {
+                throw (new InvalidDataException("The stream is not an encrypted package"));
+            }
+            Marshal.ReleaseComObject(lb);
+
+            return ret;
+        }
+        internal ILockBytes GetLockbyte(MemoryStream stream)
+        {
+            ILockBytes lb;
+            var iret = CreateILockBytesOnHGlobal(IntPtr.Zero, true, out lb);
+            byte[] docArray = stream.GetBuffer();
+            IntPtr buffer = Marshal.AllocHGlobal(docArray.Length);
+            Marshal.Copy(docArray, 0, buffer, docArray.Length);
+            UIntPtr readSize;
+            lb.WriteAt(0, buffer, docArray.Length, out readSize);
+            Marshal.FreeHGlobal(buffer);
+            return lb;
+        }
+        /// <summary>
+        /// Encrypts a package
+        /// </summary>
+        /// <param name="package">The package as a byte array</param>
+        /// <param name="encryption">The encryption info from the workbook</param>
+        /// <returns></returns>
+        internal MemoryStream EncryptPackage(byte[] package, ExcelEncryption encryption)
+        {
+            byte[] encryptionKey;
+            //Create the Encryption Info. This also returns the Encryptionkey
+            var encryptionInfo = CreateEncryptionInfo(encryption.Password, 
+                    encryption.Algorithm == EncryptionAlgorithm.AES128 ? 
+                        AlgorithmID.AES128 : 
+                    encryption.Algorithm == EncryptionAlgorithm.AES192 ? 
+                        AlgorithmID.AES192 : 
+                        AlgorithmID.AES256, out encryptionKey);
+
+            ILockBytes lb;
+            var iret = CreateILockBytesOnHGlobal(IntPtr.Zero, true, out lb);
+
+            IStorage storage = null;
+            MemoryStream ret = null;
+
+            //Create the document in-memory
+            if (StgCreateDocfileOnILockBytes(lb,
+                    STGM.CREATE | STGM.READWRITE | STGM.SHARE_EXCLUSIVE | STGM.TRANSACTED, 
+                    0,
+                    out storage)==0)
+            {
+                //First create the dataspace storage
+                CreateDataSpaces(storage);
+
+                //Create the Encryption info Stream
+                comTypes.IStream stream;
+                storage.CreateStream("EncryptionInfo", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), (uint)0, (uint)0, out stream);
+                byte[] ei=encryptionInfo.WriteBinary();
+                stream.Write(ei, ei.Length, IntPtr.Zero);
+                stream = null;
+
+                //Encrypt the package
+                byte[] encryptedPackage=EncryptData(encryptionKey, package, false);
+
+                storage.CreateStream("EncryptedPackage", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), (uint)0, (uint)0, out stream);
+
+                //Write Size here
+                MemoryStream ms = new MemoryStream();
+                BinaryWriter bw = new BinaryWriter(ms);
+                bw.Write((ulong)package.LongLength);
+                bw.Flush();
+                byte[] length = ms.ToArray();
+                //Write Encrypted data length first as an unsigned long
+                stream.Write(length, length.Length, IntPtr.Zero);
+                //And now the Encrypted data
+                stream.Write(encryptedPackage, encryptedPackage.Length, IntPtr.Zero);
+                stream = null;
+                storage.Commit(0);
+                lb.Flush();
+
+                //Now copy the unmanaged stream to a byte array --> memory stream
+                var statstg = new comTypes.STATSTG();
+                lb.Stat(out statstg, 0);
+                int size = (int)statstg.cbSize;
+                IntPtr buffer = Marshal.AllocHGlobal(size);
+                UIntPtr readSize;
+                byte[] pack=new byte[size];
+                lb.ReadAt(0, buffer, size, out readSize);
+                Marshal.Copy(buffer, pack, 0, size);
+                Marshal.FreeHGlobal(buffer);
+
+                ret = new MemoryStream();
+                ret.Write(pack, 0, size);
+            }
+            Marshal.ReleaseComObject(storage);
+            Marshal.ReleaseComObject(lb);
+            return ret;
+        }
+        #region "Dataspaces Stream methods"
+        private void CreateDataSpaces(IStorage storage)
+        {
+            IStorage dataSpaces;
+            storage.CreateStorage("\x06" + "DataSpaces", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out dataSpaces);
+            storage.Commit(0);
+
+            //Version Stream
+            comTypes.IStream versionStream;
+            dataSpaces.CreateStream("Version", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out versionStream);
+            byte[] version = CreateVersionStream();
+            versionStream.Write(version,version.Length, IntPtr.Zero);
+
+            //DataSpaceMap
+            comTypes.IStream dataSpaceMapStream;
+            dataSpaces.CreateStream("DataSpaceMap", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out dataSpaceMapStream);
+            byte[] dataSpaceMap = CreateDataSpaceMap();
+            dataSpaceMapStream.Write(dataSpaceMap, dataSpaceMap.Length, IntPtr.Zero);
+
+            //DataSpaceInfo
+            IStorage dataSpaceInfo;
+            dataSpaces.CreateStorage("DataSpaceInfo", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out dataSpaceInfo);
+
+            comTypes.IStream strongEncryptionDataSpaceStream;
+            dataSpaceInfo.CreateStream("StrongEncryptionDataSpace", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out strongEncryptionDataSpaceStream);
+            byte[] strongEncryptionDataSpace = CreateStrongEncryptionDataSpaceStream();
+            strongEncryptionDataSpaceStream.Write(strongEncryptionDataSpace, strongEncryptionDataSpace.Length, IntPtr.Zero);
+            dataSpaceInfo.Commit(0);
+
+            //TransformInfo
+            IStorage tranformInfo;
+            dataSpaces.CreateStorage("TransformInfo", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out tranformInfo);
+
+            IStorage strongEncryptionTransform;
+            tranformInfo.CreateStorage("StrongEncryptionTransform", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out strongEncryptionTransform);
+
+            comTypes.IStream primaryStream;
+            strongEncryptionTransform.CreateStream("\x06Primary", (uint)(STGM.CREATE | STGM.WRITE | STGM.DIRECT | STGM.SHARE_EXCLUSIVE), 0, 0, out primaryStream);
+            byte[] primary = CreateTransformInfoPrimary();
+            primaryStream.Write(primary, primary.Length, IntPtr.Zero);
+            tranformInfo.Commit(0);
+            dataSpaces.Commit(0);
+        }
+        private byte[] CreateStrongEncryptionDataSpaceStream()
+        {
+            MemoryStream ms = new MemoryStream();
+            BinaryWriter bw = new BinaryWriter(ms);
+
+            bw.Write((int)8);       //HeaderLength
+            bw.Write((int)1);       //EntryCount
+
+            string tr = "StrongEncryptionTransform";    
+            bw.Write((int)tr.Length);
+            bw.Write(UTF8Encoding.Unicode.GetBytes(tr + "\0")); // end \0 is for padding
+            
+            bw.Flush(); 
+            return ms.ToArray();
+        }
+        private byte[] CreateVersionStream()
+        {
+            MemoryStream ms = new MemoryStream();
+            BinaryWriter bw = new BinaryWriter(ms);
+
+            bw.Write((short)0x3C);  //Major
+            bw.Write((short)0);     //Minor
+            bw.Write(UTF8Encoding.Unicode.GetBytes("Microsoft.Container.DataSpaces"));
+            bw.Write((int)1);       //ReaderVersion
+            bw.Write((int)1);       //UpdaterVersion
+            bw.Write((int)1);       //WriterVersion
+        
+            bw.Flush();
+            return ms.ToArray();
+        }
+        private byte[] CreateDataSpaceMap()
+        {
+            MemoryStream ms = new MemoryStream();
+            BinaryWriter bw = new BinaryWriter(ms);
+
+            bw.Write((int)8);       //HeaderLength
+            bw.Write((int)1);       //EntryCount
+            string s1 = "EncryptedPackage";
+            string s2 = "StrongEncryptionDataSpace";
+            bw.Write((int)s1.Length + s2.Length+0x14);  
+            bw.Write((int)1);       //ReferenceComponentCount
+            bw.Write((int)0);       //Stream=0
+            bw.Write((int)s1.Length*2); //Length s1
+            bw.Write(UTF8Encoding.Unicode.GetBytes(s1));
+            bw.Write((int)(s2.Length-1) * 2);   //Length s2
+            bw.Write(UTF8Encoding.Unicode.GetBytes(s2 + "\0"));   // end \0 is for padding
+
+            bw.Flush();
+            return ms.ToArray();
+        }
+        private byte[] CreateTransformInfoPrimary()
+        {
+            MemoryStream ms = new MemoryStream();
+            BinaryWriter bw = new BinaryWriter(ms);
+            string TransformID="{FF9A3F03-56EF-4613-BDD5-5A41C1D07246}";
+            string TransformName = "Microsoft.Container.EncryptionTransform";
+            bw.Write(TransformID.Length * 2 + 12);
+            bw.Write((int)1);
+            bw.Write(TransformID.Length * 2);
+            bw.Write(UTF8Encoding.Unicode.GetBytes(TransformID));
+            bw.Write(TransformName.Length * 2);
+            bw.Write(UTF8Encoding.Unicode.GetBytes(TransformName+"\0"));
+            bw.Write((int)1);   //ReaderVersion
+            bw.Write((int)1);   //UpdaterVersion
+            bw.Write((int)1);   //WriterVersion
+
+            bw.Write((int)0);
+            bw.Write((int)0);
+            bw.Write((int)0);       //CipherMode
+            bw.Write((int)4);       //Reserved
+
+            bw.Flush();
+            return ms.ToArray();
+        }
+        #endregion
+        /// <summary>
+        /// Create an EncryptionInfo object to encrypt a workbook
+        /// </summary>
+        /// <param name="password">The password</param>
+        /// <param name="algID"></param>
+        /// <param name="key">The Encryption key</param>
+        /// <returns></returns>
+        private EncryptionInfo CreateEncryptionInfo(string password, AlgorithmID algID, out byte[] key)
+        {
+            if (algID == AlgorithmID.Flags || algID == AlgorithmID.RC4)
+            {
+                throw(new ArgumentException("algID must be AES128, AES192 or AES256"));
+            }
+            var encryptionInfo = new EncryptionInfo();
+            encryptionInfo.MajorVersion = 4;
+            encryptionInfo.MinorVersion = 2;
+            encryptionInfo.Flags = Flags.fAES | Flags.fCryptoAPI;
+            
+            //Header
+            encryptionInfo.Header = new EncryptionHeader();
+            encryptionInfo.Header.AlgID = algID;
+            encryptionInfo.Header.AlgIDHash = AlgorithmHashID.SHA1;
+            encryptionInfo.Header.Flags = encryptionInfo.Flags;
+            encryptionInfo.Header.KeySize = 
+                (algID == AlgorithmID.AES128 ? 0x80 : algID == AlgorithmID.AES192 ? 0xC0 : 0x100);
+            encryptionInfo.Header.ProviderType = ProviderType.AES;
+            encryptionInfo.Header.CSPName = "Microsoft Enhanced RSA and AES Cryptographic Provider\0";
+            encryptionInfo.Header.Reserved1 = 0;
+            encryptionInfo.Header.Reserved2 = 0;
+            encryptionInfo.Header.SizeExtra = 0;
+            
+            //Verifier
+            encryptionInfo.Verifier = new EncryptionVerifier();
+            encryptionInfo.Verifier.Salt = new byte[16];
+
+            var rnd = RandomNumberGenerator.Create();
+            rnd.GetBytes(encryptionInfo.Verifier.Salt);
+            encryptionInfo.Verifier.SaltSize = 0x10;
+
+            key = GetPasswordHash(password, encryptionInfo);
+            
+            var verifier = new byte[16];
+            rnd.GetBytes(verifier);
+            encryptionInfo.Verifier.EncryptedVerifier = EncryptData(key, verifier,true);
+
+            //AES = 32 Bits
+            encryptionInfo.Verifier.VerifierHashSize = 0x20;
+            SHA1 sha= new SHA1Managed();
+            var verifierHash = sha.ComputeHash(verifier);
+
+            encryptionInfo.Verifier.EncryptedVerifierHash = EncryptData(key, verifierHash, false);
+
+            return encryptionInfo;
+        }
+        private byte[] EncryptData(byte[] key, byte[] data, bool useDataSize)
+        {
+            RijndaelManaged aes = new RijndaelManaged();
+            aes.KeySize = key.Length*8;
+            aes.Mode = CipherMode.ECB;
+            aes.Padding = PaddingMode.Zeros;
+
+            //Encrypt the data
+            var crypt = aes.CreateEncryptor(key, null);
+            var ms = new MemoryStream();
+            var cs = new CryptoStream(ms, crypt, CryptoStreamMode.Write);
+            cs.Write(data, 0, data.Length);
+            
+            cs.FlushFinalBlock();
+            
+            byte[] ret;
+            if (useDataSize)
+            {
+                ret = new byte[data.Length];
+                ms.Seek(0, SeekOrigin.Begin);
+                ms.Read(ret, 0, data.Length);  //Truncate any padded Zeros
+                return ret;
+            }
+            else
+            {
+                return ms.ToArray();
+            }
+        }
+
+        private MemoryStream GetStreamFromPackage(IStorage storage, ExcelEncryption encryption)
+        {
+            MemoryStream ret=null;        
+            comTypes.STATSTG statstg;
+            
+            storage.Stat(out statstg, (uint)STATFLAG.STATFLAG_DEFAULT);
+
+            IEnumSTATSTG pIEnumStatStg = null;
+            storage.EnumElements(0, IntPtr.Zero, 0, out pIEnumStatStg);
+
+            comTypes.STATSTG[] regelt = { statstg };
+            uint fetched = 0;
+            uint res = pIEnumStatStg.Next(1, regelt, out fetched);
+
+            //if (regelt[0].pwcsName == "DataSpaces")
+            //{
+            //    PrintStorage(storage, regelt[0],"");
+            //}
+            if (res == 0)
+            {
+                byte[] data;
+                EncryptionInfo encryptionInfo = null;
+                while (res != 1)
+                {
+                    switch (statstg.pwcsName)
+                    {
+                        case "EncryptionInfo":
+                            data = GetOleStream(storage, statstg);
+                            //File.WriteAllBytes(@"c:\temp\EncInfo1.bin", data);
+                            encryptionInfo = new EncryptionInfo();
+                            encryptionInfo.ReadBinary(data);
+
+                            encryption.Algorithm = encryptionInfo.Header.AlgID == AlgorithmID.AES128 ? 
+                                EncryptionAlgorithm.AES128 :
+                            encryptionInfo.Header.AlgID == AlgorithmID.AES192 ? 
+                                EncryptionAlgorithm.AES192 : 
+                                EncryptionAlgorithm.AES256;
+                            break;
+                        case "EncryptedPackage":
+                            data = GetOleStream(storage, statstg);
+                            ret = DecryptDocument(data, encryptionInfo, encryption.Password);
+                            break;
+                    }
+
+                    if ((res = pIEnumStatStg.Next(1, regelt, out fetched)) != 1)
+                    {
+                        statstg = regelt[0];
+                    }
+                }
+            }
+            Marshal.ReleaseComObject(pIEnumStatStg);
+            return ret;
+        }
+        // Help method to print a storage part binary to c:\temp
+        //private void PrintStorage(IStorage storage, System.Runtime.InteropServices.ComTypes.STATSTG sTATSTG, string topName)
+        //{
+        //    IStorage ds;
+        //    if (topName.Length > 0)
+        //    {
+        //        topName = topName[0] < 'A' ? topName.Substring(1, topName.Length - 1) : topName;
+        //    }
+        //    storage.OpenStorage(sTATSTG.pwcsName,
+        //        null,
+        //        (uint)(STGM.DIRECT | STGM.READ | STGM.SHARE_EXCLUSIVE),
+        //        IntPtr.Zero,
+        //        0,
+        //        out ds);
+
+        //    System.Runtime.InteropServices.ComTypes.STATSTG statstgSub;
+        //    ds.Stat(out statstgSub, (uint)STATFLAG.STATFLAG_DEFAULT);
+
+        //    IEnumSTATSTG pIEnumStatStgSub = null;
+        //    System.Runtime.InteropServices.ComTypes.STATSTG[] regeltSub = { statstgSub };
+        //    ds.EnumElements(0, IntPtr.Zero, 0, out pIEnumStatStgSub);
+
+        //    uint fetched = 0;
+        //    while (pIEnumStatStgSub.Next(1, regeltSub, out fetched) == 0)
+        //    {
+        //        string sName = regeltSub[0].pwcsName[0] < 'A' ? regeltSub[0].pwcsName.Substring(1, regeltSub[0].pwcsName.Length - 1) : regeltSub[0].pwcsName;
+        //        if (regeltSub[0].type == 1)
+        //        {
+        //            PrintStorage(ds, regeltSub[0], topName + sName + "_");
+        //        }
+        //        else if(regeltSub[0].type==2)
+        //        {
+        //            File.WriteAllBytes(@"c:\temp\" + topName + sName + ".bin", GetOleStream(ds, regeltSub[0]));
+        //        }
+        //    }
+        //}
+
+        /// <summary>
+        /// Decrypt a document
+        /// </summary>
+        /// <param name="data">The Encrypted data</param>
+        /// <param name="encryptionInfo">Encryption Info object</param>
+        /// <param name="password">The password</param>
+        /// <returns></returns>
+        private MemoryStream DecryptDocument(byte[] data, EncryptionInfo encryptionInfo, string password)
+        {
+            if (encryptionInfo == null)
+            {
+                throw(new InvalidDataException("Invalid document. EncryptionInfo is missing"));
+            }
+            long size = BitConverter.ToInt64(data,0);
+
+            var encryptedData = new byte[data.Length - 8];
+            Array.Copy(data, 8, encryptedData, 0, encryptedData.Length);
+            
+            MemoryStream doc = new MemoryStream();
+
+            if (encryptionInfo.Header.AlgID == AlgorithmID.AES128 || (encryptionInfo.Header.AlgID == AlgorithmID.Flags  && ((encryptionInfo.Flags & (Flags.fAES | Flags.fExternal | Flags.fCryptoAPI)) == (Flags.fAES | Flags.fCryptoAPI)))
+                ||
+                encryptionInfo.Header.AlgID == AlgorithmID.AES192
+                ||
+                encryptionInfo.Header.AlgID == AlgorithmID.AES256
+                ) 
+            {
+                RijndaelManaged decryptKey = new RijndaelManaged();
+                decryptKey.KeySize = encryptionInfo.Header.KeySize;
+                decryptKey.Mode = CipherMode.ECB;
+                decryptKey.Padding = PaddingMode.None;
+
+                var key=GetPasswordHash(password, encryptionInfo);
+
+                if (IsPasswordValid(key, encryptionInfo))
+                {
+                    ICryptoTransform decryptor = decryptKey.CreateDecryptor(
+                                                             key,
+                                                             null);
+
+
+                    MemoryStream dataStream = new MemoryStream(encryptedData);
+
+                    CryptoStream cryptoStream = new CryptoStream(dataStream,
+                                                                  decryptor,
+                                                                  CryptoStreamMode.Read);
+
+                    var decryptedData = new byte[size];
+
+                    cryptoStream.Read(decryptedData, 0, (int)size);
+                    doc.Write(decryptedData, 0, (int)size);
+                }
+                else
+                {
+                    throw(new UnauthorizedAccessException("Invalid password"));
+                }
+            }
+            return doc;
+        }
+        /// <summary>
+        /// Validate the password
+        /// </summary>
+        /// <param name="key">The encryption key</param>
+        /// <param name="encryptionInfo">The encryption info extracted from the ENCRYPTIOINFO stream inside the OLE document</param>
+        /// <returns></returns>
+        private bool IsPasswordValid(byte[] key, EncryptionInfo encryptionInfo)
+        {
+            RijndaelManaged decryptKey = new RijndaelManaged();
+            decryptKey.KeySize = encryptionInfo.Header.KeySize;
+            decryptKey.Mode = CipherMode.ECB;
+            decryptKey.Padding = PaddingMode.None;
+
+            ICryptoTransform decryptor = decryptKey.CreateDecryptor(
+                                                     key,
+                                                     null);
+
+
+            //Decrypt the verifier
+            MemoryStream dataStream = new MemoryStream(encryptionInfo.Verifier.EncryptedVerifier);
+            CryptoStream cryptoStream = new CryptoStream(dataStream,
+                                                          decryptor,
+                                                          CryptoStreamMode.Read);
+            var decryptedVerifier = new byte[16];
+            cryptoStream.Read(decryptedVerifier, 0, 16);
+
+            dataStream = new MemoryStream(encryptionInfo.Verifier.EncryptedVerifierHash);
+
+            cryptoStream = new CryptoStream(    dataStream,
+                                                decryptor,
+                                                CryptoStreamMode.Read);
+
+            //Decrypt the verifier hash
+            var decryptedVerifierHash = new byte[16];
+            cryptoStream.Read(decryptedVerifierHash, 0, (int)16);
+
+            //Get the hash for the decrypted verifier
+            var sha = new SHA1Managed();
+            var hash = sha.ComputeHash(decryptedVerifier);
+
+            //Equal?
+            for (int i = 0; i < 16; i++)
+            {
+                if (hash[i] != decryptedVerifierHash[i])
+                {
+                    return false;
+                }
+            }
+            return true;
+        }
+
+        /// <summary>
+        /// Read the stream and return it as a byte-array
+        /// </summary>
+        /// <param name="storage"></param>
+        /// <param name="statstg"></param>
+        /// <returns></returns>
+        private byte[] GetOleStream(IStorage storage, comTypes.STATSTG statstg)
+        {
+            comTypes.IStream pIStream;
+            storage.OpenStream(statstg.pwcsName,
+               IntPtr.Zero,
+               (uint)(STGM.READ | STGM.SHARE_EXCLUSIVE),
+               0,
+               out pIStream);
+
+            byte[] data = new byte[statstg.cbSize];
+            pIStream.Read(data, (int)statstg.cbSize, IntPtr.Zero);
+            Marshal.ReleaseComObject(pIStream);
+
+            return data;
+        } 
+        /// <summary>
+        /// Create the hash.
+        /// This method is written with the help of Lyquidity library, many thanks for this nice sample
+        /// </summary>
+        /// <param name="password">The password</param>
+        /// <param name="encryptionInfo">The encryption info extracted from the ENCRYPTIOINFO stream inside the OLE document</param>
+        /// <returns>The hash to encrypt the document</returns>
+        private byte[] GetPasswordHash(string password, EncryptionInfo encryptionInfo)
+        {
+            byte[] hash = null;
+            byte[] tempHash = new byte[4+20];    //Iterator + prev. hash
+            try
+            {
+                HashAlgorithm hashProvider;
+                if (encryptionInfo.Header.AlgIDHash == AlgorithmHashID.SHA1 || encryptionInfo.Header.AlgIDHash == AlgorithmHashID.App && (encryptionInfo.Flags & Flags.fExternal) == 0)
+                {
+                    hashProvider = new SHA1CryptoServiceProvider();
+                }
+                else if (encryptionInfo.Header.KeySize > 0 && encryptionInfo.Header.KeySize < 80)
+                {
+                    throw new NotSupportedException("RC4 Hash provider is not supported. Must be SHA1(AlgIDHash == 0x8004)");
+                }
+                else
+                {
+                    throw new NotSupportedException("Hash provider is invalid. Must be SHA1(AlgIDHash == 0x8004)");
+                }
+
+                hash = hashProvider.ComputeHash(CombinePassword(encryptionInfo.Verifier.Salt, password));
+
+                //Iterate 50 000 times, inserting i in first 4 bytes and then the prev. hash in byte 5-24
+                for (int i = 0; i < 50000; i++)
+                {
+                    Array.Copy(BitConverter.GetBytes(i), tempHash, 4);
+                    Array.Copy(hash, 0, tempHash, 4, hash.Length);     
+               
+                    hash = hashProvider.ComputeHash(tempHash);
+                }
+
+                // Append "block" (0)
+                Array.Copy(hash, tempHash, hash.Length);
+                Array.Copy(System.BitConverter.GetBytes(0), 0, tempHash, hash.Length, 4);
+                hash = hashProvider.ComputeHash(tempHash);
+
+                /***** Now use the derived key algorithm *****/
+                byte[] derivedKey = new byte[64];
+                int keySizeBytes = encryptionInfo.Header.KeySize / 8;
+
+                //First XOR hash bytes with 0x36 and fill the rest with 0x36
+                for (int i = 0; i < derivedKey.Length; i++)
+                    derivedKey[i] = (byte)(i < hash.Length ? 0x36 ^ hash[i] : 0x36);
+                
+
+                byte[] X1 = hashProvider.ComputeHash(derivedKey);
+
+                //if verifier size is bigger than the key size we can return X1
+                if (encryptionInfo.Verifier.VerifierHashSize > keySizeBytes)
+                    return FixHashSize(X1,keySizeBytes);
+
+                //Else XOR hash bytes with 0x5C and fill the rest with 0x5C
+                for (int i = 0; i < derivedKey.Length; i++)
+                    derivedKey[i] = (byte)(i < hash.Length ? 0x5C ^ hash[i] : 0x5C);
+
+                byte[] X2 = hashProvider.ComputeHash(derivedKey);
+
+                //Join the two and return 
+                byte[] join = new byte[X1.Length + X2.Length];
+
+                Array.Copy(X1, 0, join, 0, X1.Length);
+                Array.Copy(X2, 0, join, X1.Length, X2.Length);
+
+                return FixHashSize(join,keySizeBytes);
+            }
+            catch (Exception ex)
+            {
+                throw (new Exception("An error occured when the encryptionkey was created", ex));
+            }
+        }
+
+        private byte[] FixHashSize(byte[] hash, int size)
+        {
+            byte[] buff = new byte[size];
+            Array.Copy(hash, buff, size);
+            return buff;
+        }
+        private byte[] CombinePassword(byte[] salt, string password)
+        {
+            if (password == "")
+            {
+                password = "VelvetSweatshop";   //Used if Password is blank
+            }
+            // Convert password to unicode...
+            byte[] passwordBuf = UnicodeEncoding.Unicode.GetBytes(password);
+            
+            byte[] inputBuf = new byte[salt.Length + passwordBuf.Length];
+            Array.Copy(salt, inputBuf, salt.Length);
+            Array.Copy(passwordBuf, 0, inputBuf, salt.Length, passwordBuf.Length);            
+            return inputBuf;
+        }
+        internal static ushort CalculatePasswordHash(string Password)
+        {
+            //Calculate the hash
+            //Thanks to Kohei Yoshida for the sample http://kohei.us/2008/01/18/excel-sheet-protection-password-hash/
+            ushort hash = 0;
+            for (int i = Password.Length - 1; i >= 0; i--)
+            {
+                hash ^= Password[i];
+                hash = (ushort)(((ushort)((hash >> 14) & 0x01))
+                                |
+                                ((ushort)((hash << 1) & 0x7FFF)));  //Shift 1 to the left. Overflowing bit 15 goes into bit 0
+            }
+
+            hash ^= (0x8000 | ('N' << 8) | 'K'); //Xor NK with high bit set(0xCE4B)
+            hash ^= (ushort)Password.Length;
+
+            return hash;
+        }
+    }
+    [ComImport] 
+    [Guid("0000000d-0000-0000-C000-000000000046")] 
+    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 
+    internal interface IEnumSTATSTG 
+    { 
+        // The user needs to allocate an STATSTG array whose size is celt. 
+        [PreserveSig] 
+        uint Next( 
+            uint celt, 
+            [MarshalAs(UnmanagedType.LPArray), Out] 
+            System.Runtime.InteropServices.ComTypes.STATSTG[] rgelt, 
+            out uint pceltFetched 
+        ); 
+ 
+        void Skip(uint celt); 
+ 
+        void Reset(); 
+ 
+        [return: MarshalAs(UnmanagedType.Interface)] 
+        IEnumSTATSTG Clone(); 
+    } 
+ 
+    [ComImport] 
+    [Guid("0000000b-0000-0000-C000-000000000046")] 
+    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 
+    interface IStorage 
+    { 
+        void CreateStream( 
+            /* [string][in] */ string pwcsName, 
+            /* [in] */ uint grfMode, 
+            /* [in] */ uint reserved1, 
+            /* [in] */ uint reserved2, 
+            /* [out] */ out comTypes.IStream ppstm); 
+        
+        void OpenStream( 
+            /* [string][in] */ string pwcsName, 
+            /* [unique][in] */ IntPtr reserved1, 
+            /* [in] */ uint grfMode, 
+            /* [in] */ uint reserved2,
+            /* [out] */ out comTypes.IStream ppstm); 
+ 
+        void CreateStorage( 
+            /* [string][in] */ string pwcsName, 
+            /* [in] */ uint grfMode, 
+            /* [in] */ uint reserved1, 
+            /* [in] */ uint reserved2, 
+            /* [out] */ out IStorage ppstg); 
+ 
+        void OpenStorage( 
+            /* [string][unique][in] */ string pwcsName, 
+            /* [unique][in] */ IStorage pstgPriority, 
+            /* [in] */ uint grfMode, 
+            /* [unique][in] */ IntPtr snbExclude, 
+            /* [in] */ uint reserved, 
+            /* [out] */ out IStorage ppstg);
+
+        void CopyTo(
+            [InAttribute] uint ciidExclude,
+            [InAttribute] Guid[] rgiidExclude,
+            [InAttribute] IntPtr snbExclude,
+            [InAttribute] IStorage pstgDest
+        );
+ 
+        void MoveElementTo( 
+            /* [string][in] */ string pwcsName, 
+            /* [unique][in] */ IStorage pstgDest, 
+            /* [string][in] */ string pwcsNewName, 
+            /* [in] */ uint grfFlags); 
+ 
+        void Commit( 
+            /* [in] */ uint grfCommitFlags); 
+ 
+        void Revert(); 
+ 
+        void EnumElements( 
+            /* [in] */ uint reserved1, 
+            /* [size_is][unique][in] */ IntPtr reserved2, 
+            /* [in] */ uint reserved3, 
+            /* [out] */ out IEnumSTATSTG ppenum); 
+ 
+        void DestroyElement( 
+            /* [string][in] */ string pwcsName); 
+ 
+        void RenameElement( 
+            /* [string][in] */ string pwcsOldName, 
+            /* [string][in] */ string pwcsNewName); 
+ 
+        void SetElementTimes( 
+            /* [string][unique][in] */ string pwcsName, 
+            /* [unique][in] */ System.Runtime.InteropServices.ComTypes.FILETIME pctime, 
+            /* [unique][in] */ System.Runtime.InteropServices.ComTypes.FILETIME patime, 
+            /* [unique][in] */ System.Runtime.InteropServices.ComTypes.FILETIME pmtime); 
+ 
+        void SetClass( 
+            /* [in] */ Guid clsid); 
+ 
+        void SetStateBits( 
+            /* [in] */ uint grfStateBits, 
+            /* [in] */ uint grfMask); 
+ 
+        void Stat( 
+            /* [out] */ out System.Runtime.InteropServices.ComTypes.STATSTG pstatstg, 
+            /* [in] */ uint grfStatFlag); 
+ 
+    }
+    [ComVisible(false)]
+    [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("0000000A-0000-0000-C000-000000000046")]
+    internal interface ILockBytes
+    {
+        void ReadAt(long ulOffset, System.IntPtr pv, int cb, out UIntPtr pcbRead);
+        void WriteAt(long ulOffset, System.IntPtr pv, int cb, out UIntPtr pcbWritten);
+        void Flush();
+        void SetSize(long cb);
+        void LockRegion(long libOffset, long cb, int dwLockType);
+        void UnlockRegion(long libOffset, long cb, int dwLockType);
+        void Stat(out System.Runtime.InteropServices.ComTypes.STATSTG pstatstg, int grfStatFlag);
+    }
+    [Flags] 
+    internal enum STGM : int 
+    { 
+        DIRECT = 0x00000000, 
+        TRANSACTED = 0x00010000, 
+        SIMPLE = 0x08000000, 
+        READ = 0x00000000, 
+        WRITE = 0x00000001, 
+        READWRITE = 0x00000002, 
+        SHARE_DENY_NONE = 0x00000040, 
+        SHARE_DENY_READ = 0x00000030, 
+        SHARE_DENY_WRITE = 0x00000020, 
+        SHARE_EXCLUSIVE = 0x00000010, 
+        PRIORITY = 0x00040000, 
+        DELETEONRELEASE = 0x04000000, 
+        NOSCRATCH = 0x00100000, 
+        CREATE = 0x00001000, 
+        CONVERT = 0x00020000, 
+        FAILIFTHERE = 0x00000000, 
+        NOSNAPSHOT = 0x00200000, 
+        DIRECT_SWMR = 0x00400000, 
+    } 
+ 
+    internal enum STATFLAG : uint 
+    { 
+        STATFLAG_DEFAULT = 0, 
+        STATFLAG_NONAME = 1, 
+        STATFLAG_NOOPEN = 2 
+    } 
+ 
+    internal enum STGTY : int 
+    { 
+        STGTY_STORAGE = 1, 
+        STGTY_STREAM = 2, 
+        STGTY_LOCKBYTES = 3, 
+        STGTY_PROPERTY = 4 
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/IArgument.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/IArgument.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/IArgument.cs	(revision 9616)
@@ -0,0 +1,48 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.Utils
+{
+    /// <summary>
+    /// An argument
+    /// </summary>
+    /// <typeparam name="T">Argument Type</typeparam>
+    public interface IArgument<T>
+    {
+        T Value { get; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/IExcelCell.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/IExcelCell.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/IExcelCell.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Jan Källman		                Initial Release		        2009-10-01
+ * Jan Källman		License changed GPL-->LGPL 2011-12-16
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace OfficeOpenXml.Style
+{
+    internal interface IExcelCell
+    {
+        #region "public properties"
+        object Value {get;set;}
+        string StyleName { get; }
+        int StyleID { get; set; }
+        ExcelStyle Style { get; }
+        Uri Hyperlink { get; set; }
+        string Formula { get; set; }
+        string FormulaR1C1 { get; set; }
+        #endregion
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/IValidationResult.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/IValidationResult.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/IValidationResult.cs	(revision 9616)
@@ -0,0 +1,13 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.Utils
+{
+    public interface IValidationResult
+    {
+        void IsTrue();
+        void IsFalse();
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/Require.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/Require.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/Require.cs	(revision 9616)
@@ -0,0 +1,52 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm   		                Added       		        2011-01-01
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.Utils
+{
+    /// <summary>
+    /// Utility for validation
+    /// </summary>
+    public static class Require
+    {
+        public static IArgument<T> Argument<T>(T argument)
+        {
+            return new Argument<T>(argument);
+        }
+
+
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/SqRefUtility.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/SqRefUtility.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/SqRefUtility.cs	(revision 9616)
@@ -0,0 +1,39 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace OfficeOpenXml.Utils
+{
+    /// <summary>
+    /// Class for handling translation between ExcelAddresses and sqref addresses.
+    /// </summary>
+    public static class SqRefUtility
+    {
+       /// <summary>
+       /// Transforms an address to a valid sqRef address.
+       /// </summary>
+       /// <param name="address">The address to transform</param>
+       /// <returns>A valid SqRef address</returns>
+       public static string ToSqRefAddress(string address)
+       {
+           Require.Argument(address).IsNotNullOrEmpty(address);
+           address = address.Replace(",", " ");
+           address = new Regex("[ ]+").Replace(address, " ");
+           return address;
+       }
+
+       /// <summary>
+       /// Transforms an sqRef address into a excel address
+       /// </summary>
+       /// <param name="address">The address to transform</param>
+       /// <returns>A valid excel address</returns>
+       public static string FromSqRefAddress(string address)
+       {
+           Require.Argument(address).IsNotNullOrEmpty(address);
+           address = address.Replace(" ", ",");
+           return address;
+       }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/ValidationResult.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/ValidationResult.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/Utils/ValidationResult.cs	(revision 9616)
@@ -0,0 +1,50 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.Utils
+{
+    public class ValidationResult : IValidationResult
+    {
+        public ValidationResult(bool result)
+            : this(result, null)
+        {
+            
+        }
+
+        public ValidationResult(bool result, string errorMessage)
+        {
+            _result = result;
+            _errorMessage = errorMessage;
+        }
+
+        private bool _result;
+        private string _errorMessage;
+
+        private void Throw()
+        {
+            if(string.IsNullOrEmpty(_errorMessage))
+            {
+                throw new InvalidOperationException();
+            }
+            throw new InvalidOperationException(_errorMessage);
+        }
+
+        void IValidationResult.IsTrue()
+        {
+            if (!_result)
+            {
+                Throw();
+            }
+        }
+
+        void IValidationResult.IsFalse()
+        {
+            if (_result)
+            {
+                Throw();
+            }
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBAModuleCollection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBAModuleCollection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBAModuleCollection.cs	(revision 9616)
@@ -0,0 +1,206 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		12-APR-2012
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.VBA
+{
+    /// <summary>
+    /// Base class for VBA collections
+    /// </summary>
+    /// <typeparam name="T"></typeparam>
+    public class ExcelVBACollectionBase<T> : IEnumerable<T>
+    {
+        internal protected List<T> _list=new List<T>();        
+        public IEnumerator<T> GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+
+        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
+        {
+            return _list.GetEnumerator();
+        }
+        /// <summary>
+        /// Indexer
+        /// </summary>
+        /// <param name="Name">Name</param>
+        /// <returns></returns>
+        public T this [string Name]
+        {
+            get
+            {
+                return _list.Find((f) => f.GetType().GetProperty("Name").GetValue(f, null).ToString().ToLower() == Name.ToLower());
+            }
+        }
+        /// <summary>
+        /// Indexer
+        /// </summary>
+        /// <param name="Index">Position</param>
+        /// <returns></returns>
+        public T this[int Index]
+        {
+            get
+            {
+                return _list[Index];
+            }
+        }
+        /// <summary>
+        /// Number of items in the collection
+        /// </summary>
+        public int Count
+        {
+            get { return _list.Count; }
+        }
+        /// <summary>
+        /// If a specific name exists in the collection
+        /// </summary>
+        /// <param name="Name">The name</param>
+        /// <returns>True if the name exists</returns>
+        public bool Exists(string Name)
+        {
+            return _list.Exists((f) => f.GetType().GetProperty("Name").GetValue(f, null).ToString().ToLower() == Name.ToLower());
+        }
+        /// <summary>
+        /// Removes the item
+        /// </summary>
+        /// <param name="Item"></param>
+        public void Remove(T Item)
+        {
+            _list.Remove(Item);
+        }
+        /// <summary>
+        /// Removes the item at the specified index
+        /// </summary>
+        /// <param name="index">THe index</param>
+        public void RemoveAt(int index)
+        {
+            _list.RemoveAt(index);
+        }
+        
+        internal void Clear()
+        {
+            _list.Clear();
+        }
+    }
+    /// <summary>
+    /// Collection class for VBA modules
+    /// </summary>
+    public class ExcelVbaModuleCollection : ExcelVBACollectionBase<ExcelVBAModule>
+    {
+        ExcelVbaProject _project;
+        internal ExcelVbaModuleCollection (ExcelVbaProject project)
+	    {
+            _project=project;
+	    }
+        internal void Add(ExcelVBAModule Item)
+        {
+            _list.Add(Item);
+        }
+        /// <summary>
+        /// Adds a new VBA Module
+        /// </summary>
+        /// <param name="Name">The name of the module</param>
+        /// <returns>The module object</returns>
+        public ExcelVBAModule AddModule(string Name)
+        {
+            var m = new ExcelVBAModule();
+            m.Name = Name;
+            m.Type = eModuleType.Module;
+            m.Attributes._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Name", Value = Name, DataType = eAttributeDataType.String });
+            m.Type = eModuleType.Module;
+            _list.Add(m);
+            return m;
+        }
+        /// <summary>
+        /// Adds a new VBA class
+        /// </summary>
+        /// <param name="Name">The name of the class</param>
+        /// <param name="Exposed">Private or Public not createble</param>
+        /// <returns>The class object</returns>
+        public ExcelVBAModule AddClass(string Name, bool Exposed)
+        {
+            var m = new ExcelVBAModule();
+            m.Name = Name;            
+            m.Type = eModuleType.Class;
+            m.Attributes._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Name", Value = Name, DataType = eAttributeDataType.String });
+            m.Attributes._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Base", Value = "0{FCFB3D2A-A0FA-1068-A738-08002B3371B5}", DataType = eAttributeDataType.String });
+            m.Attributes._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_GlobalNameSpace", Value = "False", DataType = eAttributeDataType.NonString });
+            m.Attributes._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Creatable", Value = "False", DataType = eAttributeDataType.NonString });
+            m.Attributes._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_PredeclaredId", Value = "False", DataType = eAttributeDataType.NonString });
+            m.Attributes._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Exposed", Value = Exposed ? "True" : "False", DataType = eAttributeDataType.NonString });
+            m.Attributes._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_TemplateDerived", Value = "False", DataType = eAttributeDataType.NonString });
+            m.Attributes._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Customizable", Value = "False", DataType = eAttributeDataType.NonString });
+
+            //m.Code = _project.GetBlankClassModule(Name, Exposed);
+            m.Private = !Exposed;
+            //m.ClassID=
+            _list.Add(m);
+            return m;
+        }
+    }
+    /// <summary>
+    /// A collection of the vba projects references
+    /// </summary>
+    public class ExcelVbaReferenceCollection : ExcelVBACollectionBase<ExcelVbaReference>
+    {        
+        internal ExcelVbaReferenceCollection()
+        {
+
+        }
+        /// <summary>
+        /// Adds a new reference 
+        /// </summary>
+        /// <param name="Item">The reference object</param>
+        public void Add(ExcelVbaReference Item)
+        {
+            _list.Add(Item);
+        }
+    }
+    /// <summary>
+    /// A collection of the module level attributes
+    /// </summary>
+    public class ExcelVbaModuleAttributesCollection : ExcelVBACollectionBase<ExcelVbaModuleAttribute>
+    {
+        internal string GetAttributeText()
+        {
+            StringBuilder sb=new StringBuilder();
+
+            foreach (var attr in this)
+            {
+                sb.AppendFormat("Attribute {0} = {1}\r\n", attr.Name, attr.DataType==eAttributeDataType.String ? "\"" + attr.Value + "\"" : attr.Value);
+            }
+            return sb.ToString();
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBAProject.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBAProject.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBAProject.cs	(revision 9616)
@@ -0,0 +1,1120 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * If you want to understand this code have a look at the Office VBA File Format Structure Specification (MS-OVBA.PDF) or
+ * http://msdn.microsoft.com/en-us/library/cc313094(v=office.12).aspx
+ * 
+ * * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		26-MAR-2012
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.IO.Packaging;
+using System.IO;
+using OfficeOpenXml.Utils;
+using System.Security.Cryptography.Pkcs;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Cryptography;
+using System.Text.RegularExpressions;
+
+namespace OfficeOpenXml.VBA
+{
+    /// <summary>
+    /// Represents the VBA project part of the package
+    /// </summary>
+    public class ExcelVbaProject
+    {
+        const string schemaRelVba = "http://schemas.microsoft.com/office/2006/relationships/vbaProject";
+        internal const string PartUri = @"/xl/vbaProject.bin";
+        #region Classes & Enums
+        /// <summary>
+        /// Type of system where the VBA project was created.
+        /// </summary>
+        public enum eSyskind
+        {
+            Win16 = 0,
+            Win32 = 1,
+            Macintosh = 2,
+            Win64 = 3
+        }
+
+        #endregion
+        internal ExcelVbaProject(ExcelWorkbook wb)
+        {
+            _wb = wb;
+            _pck = _wb._package.Package;
+            References = new ExcelVbaReferenceCollection();
+            Modules = new ExcelVbaModuleCollection(this);
+            var rel = _wb.Part.GetRelationshipsByType(schemaRelVba).FirstOrDefault();
+            if (rel != null)
+            {
+                Uri = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+                Part = _pck.GetPart(Uri);
+                GetProject();                
+            }
+            else
+            {
+                Lcid = 0;
+                Part = null;
+            }
+        }
+        internal ExcelWorkbook _wb;
+        internal Package _pck;
+        #region Dir Stream Properties
+        /// <summary>
+        /// System kind. Default Win32.
+        /// </summary>
+        public eSyskind SystemKind { get; set; }
+        /// <summary>
+        /// Name of the project
+        /// </summary>
+        public string Name { get; set; }
+        /// <summary>
+        /// A description of the project
+        /// </summary>
+        public string Description { get; set; }
+        /// <summary>
+        /// A helpfile
+        /// </summary>
+        public string HelpFile1 { get; set; }
+        /// <summary>
+        /// Secondary helpfile
+        /// </summary>
+        public string HelpFile2 { get; set; }
+        /// <summary>
+        /// Context if refering the helpfile
+        /// </summary>
+        public int HelpContextID { get; set; }
+        /// <summary>
+        /// Conditional compilation constants
+        /// </summary>
+        public string Constants { get; set; }
+        /// <summary>
+        /// Codepage for encoding. Default is current regional setting.
+        /// </summary>
+        public int CodePage { get; internal set; }
+        internal int LibFlags { get; set; }
+        internal int MajorVersion { get; set; }
+        internal int MinorVersion { get; set; }
+        internal int Lcid { get; set; }
+        internal int LcidInvoke { get; set; }
+        internal string ProjectID { get; set; }
+        internal string ProjectStreamText { get; set; }
+        /// <summary>
+        /// Project references
+        /// </summary>        
+        public ExcelVbaReferenceCollection References { get; set; }
+        /// <summary>
+        /// Code Modules (Modules, classes, designer code)
+        /// </summary>
+        public ExcelVbaModuleCollection Modules { get; set; }
+        ExcelVbaSignature _signature = null;
+        /// <summary>
+        /// The digital signature
+        /// </summary>
+        public ExcelVbaSignature Signature
+        {
+            get
+            {
+                if (_signature == null)
+                {
+                    _signature=new ExcelVbaSignature(Part);
+                }
+                return _signature;
+            }
+        }
+        ExcelVbaProtection _protection=null;
+        /// <summary>
+        /// VBA protection 
+        /// </summary>
+        public ExcelVbaProtection Protection
+        {
+            get
+            {
+                if (_protection == null)
+                {
+                    _protection = new ExcelVbaProtection(this);
+                }
+                return _protection;
+            }
+        }
+        #endregion
+        #region Read Project
+        private void GetProject()
+        {
+
+            var stream = Part.GetStream();
+            byte[] vba;
+            vba = new byte[stream.Length];
+            stream.Read(vba, 0, (int)stream.Length);
+
+            Document = new CompoundDocument(vba);
+            ReadDirStream();
+            ProjectStreamText = Encoding.GetEncoding(CodePage).GetString(Document.Storage.DataStreams["PROJECT"]);
+            ReadModules();
+            ReadProjectProperties();
+        }
+        private void ReadModules()
+        {
+            foreach (var modul in Modules)
+            {
+                var stream = Document.Storage.SubStorage["VBA"].DataStreams[modul.streamName];
+                var byCode = CompoundDocument.DecompressPart(stream, (int)modul.ModuleOffset);
+                string code = Encoding.GetEncoding(CodePage).GetString(byCode);
+                int pos=0;
+                while(pos+9<code.Length && code.Substring(pos,9)=="Attribute")
+                {
+                    int linePos=code.IndexOf("\r\n",pos);
+                    string[] lineSplit;
+                    if(linePos>0)
+                    {
+                        lineSplit = code.Substring(pos + 9, linePos - pos - 9).Split('=');
+                    }
+                    else
+                    {
+                        lineSplit=code.Substring(pos+9).Split(new char[]{'='},1);
+                    }
+                    if (lineSplit.Length > 1)
+                    {
+                        lineSplit[1] = lineSplit[1].Trim();
+                        var attr = 
+                            new ExcelVbaModuleAttribute()
+                        {
+                            Name = lineSplit[0].Trim(),
+                            DataType = lineSplit[1].StartsWith("\"") ? eAttributeDataType.String : eAttributeDataType.NonString,
+                            Value = lineSplit[1].StartsWith("\"") ? lineSplit[1].Substring(1, lineSplit[1].Length - 2) : lineSplit[1]
+                        };
+                        modul.Attributes._list.Add(attr);
+                    }
+                    pos = linePos + 2;
+                }
+                modul.Code=code.Substring(pos);
+            }
+        }
+
+        private void ReadProjectProperties()
+        {
+            _protection = new ExcelVbaProtection(this);
+            string prevPackage = "";
+            var lines = Regex.Split(ProjectStreamText, "\r\n");
+            foreach (string line in lines)
+            {
+                if (line.StartsWith("["))
+                {
+
+                }
+                else
+                {
+                    var split = line.Split('=');
+                    if (split.Length > 1 && split[1].Length > 1 && split[1].StartsWith("\"")) //Remove any double qouates
+                    {
+                        split[1] = split[1].Substring(1, split[1].Length - 2);
+                    }
+                    switch (split[0])
+                    {
+                        case "ID":
+                            ProjectID = split[1];
+                            break;
+                        case "Document":
+                            string mn = split[1].Substring(0, split[1].IndexOf("/&H"));
+                            Modules[mn].Type = eModuleType.Document;
+                            break;
+                        case "Package":
+                            prevPackage = split[1];
+                            break;
+                        case "BaseClass":
+                            Modules[split[1]].Type = eModuleType.Designer;
+                            Modules[split[1]].ClassID = prevPackage;
+                            break;
+                        case "Module":
+                            Modules[split[1]].Type = eModuleType.Module;
+                            break;
+                        case "Class":
+                            Modules[split[1]].Type = eModuleType.Class;
+                            break;
+                        case "HelpFile":
+                        case "Name":
+                        case "HelpContextID":
+                        case "Description":
+                        case "VersionCompatible32":
+                            break;
+                        //393222000"
+                        case "CMG":
+                            byte[] cmg = Decrypt(split[1]);
+                            _protection.UserProtected = (cmg[0] & 1) != 0;
+                            _protection.HostProtected = (cmg[0] & 2) != 0;
+                            _protection.VbeProtected = (cmg[0] & 4) != 0;
+                            break;
+                        case "DPB":
+                            byte[] dpb = Decrypt(split[1]);
+                            if (dpb.Length >= 28)
+                            {
+                                byte reserved = dpb[0];
+                                var flags = new byte[3];
+                                Array.Copy(dpb, 1, flags, 0, 3);
+                                var keyNoNulls = new byte[4];
+                                _protection.PasswordKey = new byte[4];
+                                Array.Copy(dpb, 4, keyNoNulls, 0, 4);
+                                var hashNoNulls = new byte[20];
+                                _protection.PasswordHash = new byte[20];
+                                Array.Copy(dpb, 8, hashNoNulls, 0, 20);
+                                //Handle 0x00 bitwise 2.4.4.3 
+                                for (int i = 0; i < 24; i++)
+                                {
+                                    int bit = 128 >> (int)((i % 8));
+                                    if (i < 4)
+                                    {
+                                        if ((int)(flags[0] & bit) == 0)
+                                        {
+                                            _protection.PasswordKey[i] = 0;
+                                        }
+                                        else
+                                        {
+                                            _protection.PasswordKey[i] = keyNoNulls[i];
+                                        }
+                                    }
+                                    else
+                                    {
+                                        int flagIndex = (i - i % 8) / 8;
+                                        if ((int)(flags[flagIndex] & bit) == 0)
+                                        {
+                                            _protection.PasswordHash[i - 4] = 0;
+                                        }
+                                        else
+                                        {
+                                            _protection.PasswordHash[i - 4] = hashNoNulls[i - 4];
+                                        }
+                                    }
+                                }
+                            }
+                            break;
+                        case "GC":
+                            _protection.VisibilityState = Decrypt(split[1])[0] == 0xFF;
+
+                            break;
+                    }
+                }
+            }
+        }
+
+        /// <summary>
+        /// 2.4.3.3 Decryption
+        /// </summary>
+        /// <param name="value">Byte hex string</param>
+        /// <returns>The decrypted value</returns>
+        private byte[] Decrypt(string value)
+        {
+            byte[] enc = GetByte(value);
+            byte[] dec = new byte[(value.Length - 1)];
+            byte seed, version, projKey, ignoredLength;
+            seed = enc[0];
+            dec[0] = (byte)(enc[1] ^ seed);
+            dec[1] = (byte)(enc[2] ^ seed);
+            for (int i = 2; i < enc.Length - 1; i++)
+            {
+                dec[i] = (byte)(enc[i + 1] ^ (enc[i - 1] + dec[i - 1]));
+            }
+            version = dec[0];
+            projKey = dec[1];
+            ignoredLength = (byte)((seed & 6) / 2);
+            int datalength = BitConverter.ToInt32(dec, ignoredLength + 2);
+            var data = new byte[datalength];
+            Array.Copy(dec, 6 + ignoredLength, data, 0, datalength);
+            return data;
+        }
+        /// <summary>
+        /// 2.4.3.2 Encryption
+        /// </summary>
+        /// <param name="value"></param>
+        /// <returns>Byte hex string</returns>
+        private string Encrypt(byte[] value)
+        {
+            byte[] seed = new byte[1];
+            var rn = RandomNumberGenerator.Create();
+            rn.GetBytes(seed);
+            BinaryWriter br = new BinaryWriter(new MemoryStream());
+            byte[] enc = new byte[value.Length + 10];
+            enc[0] = seed[0];
+            enc[1] = (byte)(2 ^ seed[0]);
+
+            byte projKey = 0;
+
+            foreach (var c in ProjectID)
+            {
+                projKey += (byte)c;
+            }
+            enc[2] = (byte)(projKey ^ seed[0]);
+            var ignoredLength = (seed[0] & 6) / 2;
+            for (int i = 0; i < ignoredLength; i++)
+            {
+                br.Write(seed[0]);
+            }
+            br.Write(value.Length);
+            br.Write(value);
+
+            int pos = 3;
+            byte pb = projKey;
+            foreach (var b in ((MemoryStream)br.BaseStream).ToArray())
+            {
+                enc[pos] = (byte)(b ^ (enc[pos - 2] + pb));
+                pos++;
+                pb = b;
+            }
+
+            return GetString(enc, pos - 1);
+        }
+        private string GetString(byte[] value, int max)
+        {
+            string ret = "";
+            for (int i = 0; i <= max; i++)
+            {
+                if (value[i] < 16)
+                {
+                    ret += "0" + value[i].ToString("x");
+                }
+                else
+                {
+                    ret += value[i].ToString("x");
+                }
+            }
+            return ret.ToUpper();
+        }
+        private byte[] GetByte(string value)
+        {
+            byte[] ret = new byte[value.Length / 2];
+            for (int i = 0; i < ret.Length; i++)
+            {
+                ret[i] = byte.Parse(value.Substring(i * 2, 2), System.Globalization.NumberStyles.AllowHexSpecifier);
+            }
+            return ret;
+        }
+        private void ReadDirStream()
+        {
+            byte[] dir = CompoundDocument.DecompressPart(Document.Storage.SubStorage["VBA"].DataStreams["dir"]);
+            MemoryStream ms = new MemoryStream(dir);
+            BinaryReader br = new BinaryReader(ms);
+            ExcelVbaReference currentRef = null;
+            string referenceName = "";
+            ExcelVBAModule currentModule = null;
+            bool terminate = false;
+            while (br.BaseStream.Position < br.BaseStream.Length && terminate == false)
+            {
+                ushort id = br.ReadUInt16();
+                uint size = br.ReadUInt32();
+                switch (id)
+                {
+                    case 0x01:
+                        SystemKind = (eSyskind)br.ReadUInt32();
+                        break;
+                    case 0x02:
+                        Lcid = (int)br.ReadUInt32();
+                        break;
+                    case 0x03:
+                        CodePage = (int)br.ReadUInt16();
+                        break;
+                    case 0x04:
+                        Name = GetString(br, size);
+                        break;
+                    case 0x05:
+                        Description = GetUnicodeString(br, size);
+                        break;
+                    case 0x06:
+                        HelpFile1 = GetString(br, size);
+                        break;
+                    case 0x3D:
+                        HelpFile2 = GetString(br, size);
+                        break;
+                    case 0x07:
+                        HelpContextID = (int)br.ReadUInt32();
+                        break;
+                    case 0x08:
+                        LibFlags = (int)br.ReadUInt32();
+                        break;
+                    case 0x09:
+                        MajorVersion = (int)br.ReadUInt32();
+                        MinorVersion = (int)br.ReadUInt16();
+                        break;
+                    case 0x0C:
+                        Constants = GetUnicodeString(br, size);
+                        break;
+                    case 0x0D:
+                        uint sizeLibID = br.ReadUInt32();
+                        var regRef = new ExcelVbaReference();
+                        regRef.Name = referenceName;
+                        regRef.ReferenceRecordID = id;
+                        regRef.Libid = GetString(br, sizeLibID);
+                        uint reserved1 = br.ReadUInt32();
+                        ushort reserved2 = br.ReadUInt16();
+                        References.Add(regRef);
+                        break;
+                    case 0x0E:
+                        var projRef = new ExcelVbaReferenceProject();
+                        projRef.ReferenceRecordID = id;
+                        projRef.Name = referenceName;
+                        sizeLibID = br.ReadUInt32();
+                        projRef.Libid = GetString(br, sizeLibID);
+                        sizeLibID = br.ReadUInt32();
+                        projRef.LibIdRelative = GetString(br, sizeLibID);
+                        projRef.MajorVersion = br.ReadUInt32();
+                        projRef.MinorVersion = br.ReadUInt16();
+                        References.Add(projRef);
+                        break;
+                    case 0x0F:
+                        ushort modualCount = br.ReadUInt16();
+                        break;
+                    case 0x13:
+                        ushort cookie = br.ReadUInt16();
+                        break;
+                    case 0x14:
+                        LcidInvoke = (int)br.ReadUInt32();
+                        break;
+                    case 0x16:
+                        referenceName = GetUnicodeString(br, size);
+                        break;
+                    case 0x19:
+                        currentModule = new ExcelVBAModule();
+                        currentModule.Name = GetUnicodeString(br, size);
+                        Modules.Add(currentModule);
+                        break;
+                    case 0x1A:
+                        currentModule.streamName = GetUnicodeString(br, size);
+                        break;
+                    case 0x1C:
+                        currentModule.Description = GetUnicodeString(br, size);
+                        break;
+                    case 0x1E:
+                        currentModule.HelpContext = (int)br.ReadUInt32();
+                        break;
+                    case 0x21:
+                    case 0x22:
+                        break;
+                    case 0x2B:      //Modul Terminator
+                        break;
+                    case 0x2C:
+                        currentModule.Cookie = br.ReadUInt16();
+                        break;
+                    case 0x31:
+                        currentModule.ModuleOffset = br.ReadUInt32();
+                        break;
+                    case 0x10:
+                        terminate = true;
+                        break;
+                    case 0x30:
+                        var extRef = (ExcelVbaReferenceControl)currentRef;
+                        var sizeExt = br.ReadUInt32();
+                        extRef.LibIdExternal = GetString(br, sizeExt);
+
+                        uint reserved4 = br.ReadUInt32();
+                        ushort reserved5 = br.ReadUInt16();
+                        extRef.OriginalTypeLib = new Guid(br.ReadBytes(16));
+                        extRef.Cookie = br.ReadUInt32();
+                        break;
+                    case 0x33:
+                        currentRef = new ExcelVbaReferenceControl();
+                        currentRef.ReferenceRecordID = id;
+                        currentRef.Name = referenceName;
+                        currentRef.Libid = GetString(br, size);
+                        References.Add(currentRef);
+                        break;
+                    case 0x2F:
+                        var contrRef = (ExcelVbaReferenceControl)currentRef;
+                        contrRef.ReferenceRecordID = id;
+
+                        var sizeTwiddled = br.ReadUInt32();
+                        contrRef.LibIdTwiddled = GetString(br, sizeTwiddled);
+                        var r1 = br.ReadUInt32();
+                        var r2 = br.ReadUInt16();
+
+                        break;
+                    case 0x25:
+                        currentModule.ReadOnly = true;
+                        break;
+                    case 0x28:
+                        currentModule.Private = true;
+                        break;
+                    default:
+                        break;
+                }
+            }
+        }
+        #endregion
+        #region Save Project
+        internal void Save()
+        {
+            if (Validate())
+            {
+                CompoundDocument doc = new CompoundDocument();
+                doc.Storage = new CompoundDocument.StoragePart();
+                var store = new CompoundDocument.StoragePart();
+                doc.Storage.SubStorage.Add("VBA", store);
+
+                store.DataStreams.Add("_VBA_PROJECT", CreateVBAProjectStream());
+                store.DataStreams.Add("dir", CreateDirStream());
+                foreach (var module in Modules)
+                {
+                    store.DataStreams.Add(module.Name, CompoundDocument.CompressPart(Encoding.GetEncoding(CodePage).GetBytes(module.Attributes.GetAttributeText() + module.Code)));
+                }
+
+                //Copy streams from the template, if used.
+                if (Document != null)
+                {
+                    foreach (var ss in Document.Storage.SubStorage)
+                    {
+                        if (ss.Key != "VBA")
+                        {
+                            doc.Storage.SubStorage.Add(ss.Key, ss.Value);
+                        }
+                    }
+                    foreach (var s in Document.Storage.DataStreams)
+                    {
+                        if (s.Key != "dir" && s.Key != "PROJECT" && s.Key != "PROJECTwm")
+                        {
+                            doc.Storage.DataStreams.Add(s.Key, s.Value);
+                        }
+                    }
+                }
+
+                doc.Storage.DataStreams.Add("PROJECT", CreateProjectStream());
+                doc.Storage.DataStreams.Add("PROJECTwm", CreateProjectwmStream());
+
+                if (Part == null)
+                {
+                    Uri = new Uri(PartUri, UriKind.Relative);
+                    Part = _pck.CreatePart(Uri, ExcelPackage.schemaVBA);
+                    var rel = _wb.Part.CreateRelationship(Uri, TargetMode.Internal, schemaRelVba);
+                }
+                var vbaBuffer=doc.Save();
+                var st = Part.GetStream(FileMode.Create);
+                st.Write(vbaBuffer, 0, vbaBuffer.Length);
+                st.Flush();
+                st.Close();
+                //Save the digital signture
+                Signature.Save(this);
+            }
+        }
+
+        private bool Validate()
+        {
+            Description = Description ?? "";
+            HelpFile1 = HelpFile1 ?? "";
+            HelpFile2 = HelpFile2 ?? "";
+            Constants = Constants ?? "";
+            return true;
+        }
+
+        /// <summary>
+        /// MS-OVBA 2.3.4.1
+        /// </summary>
+        /// <returns></returns>
+        private byte[] CreateVBAProjectStream()
+        {
+            BinaryWriter bw = new BinaryWriter(new MemoryStream());
+            bw.Write((ushort)0x61CC); //Reserved1
+            bw.Write((ushort)0xFFFF); //Version
+            bw.Write((byte)0x0); //Reserved3
+            bw.Write((ushort)0x0); //Reserved4
+            return ((MemoryStream)bw.BaseStream).ToArray();
+        }
+        /// <summary>
+        /// MS-OVBA 2.3.4.1
+        /// </summary>
+        /// <returns></returns>
+        private byte[] CreateDirStream()
+        {
+            BinaryWriter bw = new BinaryWriter(new MemoryStream());
+
+            /****** PROJECTINFORMATION Record ******/
+            bw.Write((ushort)1);        //ID
+            bw.Write((uint)4);          //Size
+            bw.Write((uint)SystemKind); //SysKind
+
+            bw.Write((ushort)2);        //ID
+            bw.Write((uint)4);          //Size
+            bw.Write((uint)Lcid);       //Lcid
+
+            bw.Write((ushort)0x14);     //ID
+            bw.Write((uint)4);          //Size
+            bw.Write((uint)LcidInvoke); //Lcid Invoke
+
+            bw.Write((ushort)3);        //ID
+            bw.Write((uint)2);          //Size
+            bw.Write((ushort)CodePage);   //Codepage
+
+            //ProjectName
+            bw.Write((ushort)4);                                            //ID
+            bw.Write((uint)Name.Length);                             //Size
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(Name)); //Project Name
+
+            //Description
+            bw.Write((ushort)5);                                            //ID
+            bw.Write((uint)Description.Length);                             //Size
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(Description)); //Project Name
+            bw.Write((ushort)0x40);                                           //ID
+            bw.Write((uint)Description.Length*2);                           //Size
+            bw.Write(Encoding.Unicode.GetBytes(Description));               //Project Description
+
+            //Helpfiles
+            bw.Write((ushort)6);                                           //ID
+            bw.Write((uint)HelpFile1.Length);                              //Size
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(HelpFile1));  //HelpFile1            
+            bw.Write((ushort)0x3D);                                           //ID
+            bw.Write((uint)HelpFile2.Length);                              //Size
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(HelpFile2));  //HelpFile2
+
+            //Help context id
+            bw.Write((ushort)7);            //ID
+            bw.Write((uint)4);              //Size
+            bw.Write((uint)HelpContextID);  //Help context id
+
+            //Libflags
+            bw.Write((ushort)8);            //ID
+            bw.Write((uint)4);              //Size
+            bw.Write((uint)0);  //Help context id
+
+            //Vba Version
+            bw.Write((ushort)9);            //ID
+            bw.Write((uint)4);              //Reserved
+            bw.Write((uint)MajorVersion);   //Reserved
+            bw.Write((ushort)MinorVersion); //Help context id
+
+            //Constants
+            bw.Write((ushort)0x0C);           //ID
+            bw.Write((uint)Constants.Length);              //Size
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(Constants));              //Help context id
+            bw.Write((ushort)0x3C);                                           //ID
+            bw.Write((uint)Constants.Length/2);                              //Size
+            bw.Write(Encoding.Unicode.GetBytes(Constants));  //HelpFile2
+
+            /****** PROJECTREFERENCES Record ******/
+            foreach (var reference in References)
+            {
+                WriteNameReference(bw, reference);
+
+                if (reference.ReferenceRecordID == 0x2F)
+                {
+                    WriteControlReference(bw, reference);
+                }
+                else if (reference.ReferenceRecordID == 0x33)
+                {
+                    WriteOrginalReference(bw, reference);
+                }
+                else if (reference.ReferenceRecordID == 0x0D)
+                {
+                    WriteRegisteredReference(bw, reference);
+                }
+                else if (reference.ReferenceRecordID == 0x0E)
+                {
+                    WriteProjectReference(bw, reference);
+                }
+            }
+
+            bw.Write((ushort)0x0F);
+            bw.Write((uint)0x02);
+            bw.Write((ushort)Modules.Count);
+            bw.Write((ushort)0x13);
+            bw.Write((uint)0x02);
+            bw.Write((ushort)0xFFFF);
+
+            foreach (var module in Modules)
+            {
+                WriteModuleRecord(bw, module);
+            }
+            bw.Write((ushort)0x10);             //Terminator
+            bw.Write((uint)0);              
+
+            return CompoundDocument.CompressPart(((MemoryStream)bw.BaseStream).ToArray());
+        }
+
+        private void WriteModuleRecord(BinaryWriter bw, ExcelVBAModule module)
+        {
+            bw.Write((ushort)0x19);
+            bw.Write((uint)module.Name.Length);
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(module.Name));     //Name
+
+            bw.Write((ushort)0x47);
+            bw.Write((uint)module.Name.Length*2);
+            bw.Write(Encoding.Unicode.GetBytes(module.Name));                   //Name
+
+            bw.Write((ushort)0x1A);
+            bw.Write((uint)module.Name.Length);
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(module.Name));     //Stream Name  
+
+            bw.Write((ushort)0x32);
+            bw.Write((uint)module.Name.Length*2);
+            bw.Write(Encoding.Unicode.GetBytes(module.Name));                   //Stream Name
+
+            module.Description = module.Description ?? "";
+            bw.Write((ushort)0x1C);
+            bw.Write((uint)module.Description.Length);
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(module.Description));     //Description
+
+            bw.Write((ushort)0x48);
+            bw.Write((uint)module.Description.Length*2);
+            bw.Write(Encoding.Unicode.GetBytes(module.Description));                   //Description
+
+            bw.Write((ushort)0x31);
+            bw.Write((uint)4);
+            bw.Write((uint)0);                              //Module Stream Offset (No PerformanceCache)
+
+            bw.Write((ushort)0x1E);
+            bw.Write((uint)4);
+            bw.Write((uint)module.HelpContext);            //Help context ID
+
+            bw.Write((ushort)0x2C);
+            bw.Write((uint)2);
+            bw.Write((ushort)0xFFFF);            //Help context ID
+
+            bw.Write((ushort)(module.Type == eModuleType.Module ? 0x21 : 0x22));
+            bw.Write((uint)0);
+
+            if (module.ReadOnly)
+            {
+                bw.Write((ushort)0x25);
+                bw.Write((uint)0);              //Readonly
+            }
+
+            if (module.Private)
+            {
+                bw.Write((ushort)0x28);
+                bw.Write((uint)0);              //Private
+            }
+
+            bw.Write((ushort)0x2B);             //Terminator
+            bw.Write((uint)0);              
+        }
+
+        private void WriteNameReference(BinaryWriter bw, ExcelVbaReference reference)
+        {
+            //Name record
+            bw.Write((ushort)0x16);                                             //ID
+            bw.Write((uint)reference.Name.Length);                              //Size
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(reference.Name));  //HelpFile1
+            bw.Write((ushort)0x3E);                                             //ID
+            bw.Write((uint)reference.Name.Length * 2);                            //Size
+            bw.Write(Encoding.Unicode.GetBytes(reference.Name));                //HelpFile2
+        }
+        private void WriteControlReference(BinaryWriter bw, ExcelVbaReference reference)
+        {
+            WriteOrginalReference(bw, reference);
+
+            bw.Write((ushort)0x2F);
+            var controlRef=(ExcelVbaReferenceControl)reference;
+            bw.Write((uint)(4 + controlRef.LibIdTwiddled.Length + 4 + 2));    // Size of SizeOfLibidTwiddled, LibidTwiddled, Reserved1, and Reserved2.
+            bw.Write((uint)controlRef.LibIdTwiddled.Length);                              //Size            
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(controlRef.LibIdTwiddled));  //LibID
+            bw.Write((uint)0);      //Reserved1
+            bw.Write((ushort)0);    //Reserved2
+            WriteNameReference(bw, reference);  //Name record again
+            bw.Write((ushort)0x30); //Reserved3
+            bw.Write((uint)(4 + controlRef.LibIdExternal.Length + 4 + 2 + 16 + 4));    //Size of SizeOfLibidExtended, LibidExtended, Reserved4, Reserved5, OriginalTypeLib, and Cookie
+            bw.Write((uint)controlRef.LibIdExternal.Length);                              //Size            
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(controlRef.LibIdExternal));  //LibID
+            bw.Write((uint)0);      //Reserved4
+            bw.Write((ushort)0);    //Reserved5
+            bw.Write(controlRef.OriginalTypeLib.ToByteArray());
+            bw.Write((uint)controlRef.Cookie);      //Cookie
+        }
+
+        private void WriteOrginalReference(BinaryWriter bw, ExcelVbaReference reference)
+        {
+            bw.Write((ushort)0x33);
+            bw.Write((uint)reference.Libid.Length);
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(reference.Libid));  //LibID
+        }
+        private void WriteProjectReference(BinaryWriter bw, ExcelVbaReference reference)
+        {
+            bw.Write((ushort)0x0E);
+            var projRef = (ExcelVbaReferenceProject)reference;
+            bw.Write((uint)(4 + projRef.Libid.Length + 4 + projRef.LibIdRelative.Length+4+2));
+            bw.Write((uint)projRef.Libid.Length);
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(projRef.Libid));  //LibAbsolute
+            bw.Write((uint)projRef.LibIdRelative.Length);
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(projRef.LibIdRelative));  //LibIdRelative
+            bw.Write(projRef.MajorVersion);
+            bw.Write(projRef.MinorVersion);
+        }
+
+        private void WriteRegisteredReference(BinaryWriter bw, ExcelVbaReference reference)
+        {
+            bw.Write((ushort)0x0D);
+            bw.Write((uint)(4+reference.Libid.Length+4+2));
+            bw.Write((uint)reference.Libid.Length);
+            bw.Write(Encoding.GetEncoding(CodePage).GetBytes(reference.Libid));  //LibID            
+            bw.Write((uint)0);      //Reserved1
+            bw.Write((ushort)0);    //Reserved2
+        }
+
+        private byte[] CreateProjectwmStream()
+        {
+            BinaryWriter bw = new BinaryWriter(new MemoryStream());
+
+            foreach (var module in Modules)
+            {
+                bw.Write(Encoding.GetEncoding(CodePage).GetBytes(module.Name));     //Name
+                bw.Write((byte)0); //Null
+                bw.Write(Encoding.Unicode.GetBytes(module.Name));                   //Name
+                bw.Write((ushort)0); //Null
+            }
+            bw.Write((ushort)0); //Null
+            return CompoundDocument.CompressPart(((MemoryStream)bw.BaseStream).ToArray());
+        }       
+        private byte[] CreateProjectStream()
+        {
+            StringBuilder sb = new StringBuilder();
+            sb.AppendFormat("ID=\"{0}\"\r\n", ProjectID);
+            foreach(var module in Modules)
+            {
+                if (module.Type == eModuleType.Document)
+                {
+                    sb.AppendFormat("Document={0}/&H00000000\r\n", module.Name);
+                }
+                else if (module.Type == eModuleType.Module)
+                {
+                    sb.AppendFormat("Module={0}\r\n", module.Name);
+                }
+                else if (module.Type == eModuleType.Class)
+                {
+                    sb.AppendFormat("Class={0}\r\n", module.Name);
+                }
+                else
+                {
+                    //Designer
+                    sb.AppendFormat("Package={0}\r\n", module.ClassID);
+                    sb.AppendFormat("BaseClass={0}\r\n", module.Name);
+                }
+            }
+            if (HelpFile1 != "")
+            {
+                sb.AppendFormat("HelpFile={0}\r\n", HelpFile1);
+            }
+            sb.AppendFormat("Name=\"{0}\"\r\n", Name);
+            sb.AppendFormat("HelpContextID={0}\r\n", HelpContextID);
+
+            if (!string.IsNullOrEmpty(Description))
+            {
+                sb.AppendFormat("Description=\"{0}\"\r\n", Description);
+            }
+            sb.AppendFormat("VersionCompatible32=\"393222000\"\r\n");
+
+            sb.AppendFormat("CMG=\"{0}\"\r\n", WriteProtectionStat());
+            sb.AppendFormat("DPB=\"{0}\"\r\n", WritePassword());
+            sb.AppendFormat("GC=\"{0}\"\r\n\r\n", WriteVisibilityState());
+
+            sb.Append("[Host Extender Info]\r\n");
+            sb.Append("&H00000001={3832D640-CF90-11CF-8E43-00A0C911005A};VBE;&H00000000\r\n");
+            sb.Append("\r\n");
+            sb.Append("[Workspace]\r\n");
+            foreach(var module in Modules)
+            {
+                sb.AppendFormat("{0}=0, 0, 0, 0, C \r\n",module.Name);              
+            }
+            string s = sb.ToString();
+            return Encoding.GetEncoding(CodePage).GetBytes(s);
+        }
+        private string WriteProtectionStat()
+        {
+            int stat=(_protection.UserProtected ? 1:0) |  
+                     (_protection.HostProtected ? 2:0) |
+                     (_protection.VbeProtected ? 4:0);
+
+            return Encrypt(BitConverter.GetBytes(stat));    
+        }
+        private string WritePassword()
+        {
+            byte[] nullBits=new byte[3];
+            byte[] nullKey = new byte[4];
+            byte[] nullHash = new byte[20];
+            if (Protection.PasswordKey == null)
+            {
+                return Encrypt(new byte[] { 0 });
+            }
+            else
+            {
+                Array.Copy(Protection.PasswordKey, nullKey, 4);
+                Array.Copy(Protection.PasswordHash, nullHash, 20);
+
+                //Set Null bits
+                for (int i = 0; i < 24; i++)
+                {
+                    byte bit = (byte)(128 >> (int)((i % 8)));
+                    if (i < 4)
+                    {
+                        if (nullKey[i] == 0)
+                        {
+                            nullKey[i] = 1;
+                        }
+                        else
+                        {
+                            nullBits[0] |= bit;
+                        }
+                    }
+                    else
+                    {
+                        if (nullHash[i - 4] == 0)
+                        {
+                            nullHash[i - 4] = 1;
+                        }
+                        else
+                        {
+                            int byteIndex = (i - i % 8) / 8;
+                            nullBits[byteIndex] |= bit;
+                        }
+                    }
+                }
+                //Write the Password Hash Data Structure (2.4.4.1)
+                BinaryWriter bw = new BinaryWriter(new MemoryStream());
+                bw.Write((byte)0xFF);
+                bw.Write(nullBits);
+                bw.Write(nullKey);
+                bw.Write(nullHash);
+                bw.Write((byte)0);
+                return Encrypt(((MemoryStream)bw.BaseStream).ToArray());
+            }
+        }
+        private string WriteVisibilityState()
+        {
+            return Encrypt(new byte[] { (byte)(Protection.VisibilityState ? 0xFF : 0) }); 
+        }
+        #endregion
+        private string GetString(BinaryReader br, uint size)
+        {
+            return GetString(br, size, System.Text.Encoding.GetEncoding(CodePage));
+        }
+        private string GetString(BinaryReader br, uint size, Encoding enc)
+        {
+            if (size > 0)
+            {
+                byte[] byteTemp = new byte[size];
+                byteTemp = br.ReadBytes((int)size);
+                return enc.GetString(byteTemp);
+            }
+            else
+            {
+                return "";
+            }
+        }
+        private string GetUnicodeString(BinaryReader br, uint size)
+        {
+            string s = GetString(br, size);
+            int reserved = br.ReadUInt16();
+            uint sizeUC = br.ReadUInt32();
+            string sUC = GetString(br, sizeUC, System.Text.Encoding.Unicode);
+            return sUC.Length == 0 ? s : sUC;
+        }
+        internal CompoundDocument Document { get; set; }
+        internal PackagePart Part { get; set; }
+        internal Uri Uri { get; private set; }
+        /// <summary>
+        /// Create a new VBA Project
+        /// </summary>
+        internal void Create()
+        {
+            if(Lcid>0)
+            {
+                throw (new InvalidOperationException("Package already contains a VBAProject"));
+            }
+            ProjectID = "{5DD90D76-4904-47A2-AF0D-D69B4673604E}";
+            Name = "VBAProject";
+            SystemKind = eSyskind.Win32;            //Default
+            Lcid = 1033;                            //English - United States
+            LcidInvoke = 1033;                      //English - United States
+            CodePage = Encoding.Default.CodePage;
+            MajorVersion = 1361024421;
+            MinorVersion = 6;
+            HelpContextID = 0;
+            Modules.Add(new ExcelVBAModule(_wb.CodeNameChange) { Name = "ThisWorkbook", Code = "", Attributes=GetDocumentAttributes("ThisWorkbook", "0{00020819-0000-0000-C000-000000000046}"), Type = eModuleType.Document, HelpContext = 0 });
+            foreach (var sheet in _wb.Worksheets)
+            {
+                if (!Modules.Exists(sheet.Name))
+                {
+                    Modules.Add(new ExcelVBAModule(sheet.CodeNameChange) { Name = sheet.Name, Code = "", Attributes = GetDocumentAttributes(sheet.Name, "0{00020820-0000-0000-C000-000000000046}"), Type = eModuleType.Document, HelpContext = 0 });
+                }
+            }
+            _protection = new ExcelVbaProtection(this) { UserProtected = false, HostProtected = false, VbeProtected = false, VisibilityState = true };
+        }
+        internal ExcelVbaModuleAttributesCollection GetDocumentAttributes(string name, string clsid)
+        {
+            var attr = new ExcelVbaModuleAttributesCollection();
+            attr._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Name", Value = name, DataType = eAttributeDataType.String });
+            attr._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Base", Value = clsid, DataType = eAttributeDataType.String });
+            attr._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_GlobalNameSpace", Value = "False", DataType = eAttributeDataType.NonString });
+            attr._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Creatable", Value = "False", DataType = eAttributeDataType.NonString });
+            attr._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_PredeclaredId", Value = "True", DataType = eAttributeDataType.NonString });
+            attr._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Exposed", Value = "False", DataType = eAttributeDataType.NonString });
+            attr._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_TemplateDerived", Value = "False", DataType = eAttributeDataType.NonString });
+            attr._list.Add(new ExcelVbaModuleAttribute() { Name = "VB_Customizable", Value = "True", DataType = eAttributeDataType.NonString });
+
+            return attr;
+        }
+        //internal string GetBlankDocumentModule(string name, string clsid)
+        //{
+        //    string ret=string.Format("Attribute VB_Name = \"{0}\"\r\n",name);
+        //    ret += string.Format("Attribute VB_Base = \"{0}\"\r\n", clsid);  //Microsoft.Office.Interop.Excel.WorksheetClass
+        //    ret += "Attribute VB_GlobalNameSpace = False\r\n";
+        //    ret += "Attribute VB_Creatable = False\r\n";
+        //    ret += "Attribute VB_PredeclaredId = True\r\n";
+        //    ret += "Attribute VB_Exposed = True\r\n";
+        //    ret += "Attribute VB_TemplateDerived = False\r\n";
+        //    ret += "Attribute VB_Customizable = True";
+        //    return ret;
+        //}
+        //internal string GetBlankModule(string name)
+        //{
+        //    return string.Format("Attribute VB_Name = \"{0}\"\r\n", name);
+        //}
+        //internal string GetBlankClassModule(string name, bool exposed)
+        //{
+        //    string ret=string.Format("Attribute VB_Name = \"{0}\"\r\n",name);
+        //    ret += string.Format("Attribute VB_Base = \"{0}\"\r\n", "0{FCFB3D2A-A0FA-1068-A738-08002B3371B5}");  
+        //    ret += "Attribute VB_GlobalNameSpace = False\r\n";
+        //    ret += "Attribute VB_Creatable = False\r\n";
+        //    ret += "Attribute VB_PredeclaredId = False\r\n";
+        //    ret += string.Format("Attribute VB_Exposed = {0}\r\n", exposed ? "True" : "False");
+        //    ret += "Attribute VB_TemplateDerived = False\r\n";
+        //    ret += "Attribute VB_Customizable = False\r\n";
+        //    return ret;
+        //}
+        /// <summary>
+        /// Remove the project from the package
+        /// </summary>
+        public void Remove()
+        {
+            if (Part == null) return;
+
+            foreach (var rel in Part.GetRelationships())
+            {
+                _pck.DeleteRelationship(rel.Id);
+            }
+            if (_pck.PartExists(Uri))
+            {
+                _pck.DeletePart(Uri);
+            }
+            Part = null;
+            Modules.Clear();
+            References.Clear();
+            Lcid = 0;
+            LcidInvoke = 0;
+            CodePage = 0;
+            MajorVersion = 0;
+            MinorVersion = 0;
+            HelpContextID = 0;
+        }
+        public override string ToString()
+        {
+            return Name;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBAReference.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBAReference.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBAReference.cs	(revision 9616)
@@ -0,0 +1,129 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		26-MAR-2012
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.VBA
+{
+    /// <summary>
+    /// A VBA reference
+    /// </summary>
+    public class ExcelVbaReference
+    {
+        /// <summary>
+        /// Constructor.
+        /// Defaults ReferenceRecordID to 0xD
+        /// </summary>
+        public ExcelVbaReference()
+        {
+            ReferenceRecordID = 0xD;
+        }
+        /// <summary>
+        /// The reference record ID. See MS-OVBA documentation for more info. 
+        /// </summary>
+        public int ReferenceRecordID { get; internal set; }
+        /// <summary>
+        /// The name of the reference
+        /// </summary>
+        public string Name { get; set; }
+        /// <summary>
+        /// LibID
+        /// For more info check MS-OVBA 2.1.1.8 LibidReference and 2.3.4.2.2 PROJECTREFERENCES
+        /// </summary>
+        public string Libid { get; set; }
+        /// <summary>
+        /// A string representation of the object (the Name)
+        /// </summary>
+        /// <returns></returns>
+        public override string ToString()
+        {
+            return Name;
+        }
+    }
+    /// <summary>
+    /// A reference to a twiddled type library
+    /// </summary>
+    public class ExcelVbaReferenceControl : ExcelVbaReference
+    {
+        /// <summary>
+        /// Constructor.
+        /// Sets ReferenceRecordID to 0x2F
+        /// </summary>
+        public ExcelVbaReferenceControl()
+        {
+            ReferenceRecordID = 0x2F;
+        }
+        /// <summary>
+        /// LibIdExternal 
+        /// For more info check MS-OVBA 2.1.1.8 LibidReference and 2.3.4.2.2 PROJECTREFERENCES
+        /// </summary>
+        public string LibIdExternal { get; set; }
+        /// <summary>
+        /// LibIdTwiddled
+        /// For more info check MS-OVBA 2.1.1.8 LibidReference and 2.3.4.2.2 PROJECTREFERENCES
+        /// </summary>
+        public string LibIdTwiddled { get; set; }
+        /// <summary>
+        /// A GUID that specifies the Automation type library the extended type library was generated from.
+        /// </summary>
+        public Guid OriginalTypeLib { get; set; }
+        internal uint Cookie { get; set; }
+    }
+    /// <summary>
+    /// A reference to an external VBA project
+    /// </summary>
+    public class ExcelVbaReferenceProject : ExcelVbaReference
+    {
+        /// <summary>
+        /// Constructor.
+        /// Sets ReferenceRecordID to 0x0E
+        /// </summary>
+        public ExcelVbaReferenceProject()
+        {
+            ReferenceRecordID = 0x0E;
+        }
+        /// <summary>
+        /// LibIdRelative
+        /// For more info check MS-OVBA 2.1.1.8 LibidReference and 2.3.4.2.2 PROJECTREFERENCES
+        /// </summary>
+        public string LibIdRelative { get; set; }
+        /// <summary>
+        /// Major version of the referenced VBA project
+        /// </summary>
+        public uint MajorVersion { get; set; }
+        /// <summary>
+        /// Minor version of the referenced VBA project
+        /// </summary>
+        public ushort MinorVersion { get; set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBASignature.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBASignature.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVBASignature.cs	(revision 9616)
@@ -0,0 +1,343 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		26-MAR-2012
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Security.Cryptography.X509Certificates;
+using System.Security.Cryptography.Pkcs;
+using OfficeOpenXml.Utils;
+using System.IO.Packaging;
+using System.IO;
+
+namespace OfficeOpenXml.VBA
+{
+    /// <summary>
+    /// The code signature properties of the project
+    /// </summary>
+    public class ExcelVbaSignature
+    {
+        const string schemaRelVbaSignature = "http://schemas.microsoft.com/office/2006/relationships/vbaProjectSignature";
+        PackagePart _vbaPart = null;
+        internal ExcelVbaSignature(PackagePart vbaPart)
+        {
+            _vbaPart = vbaPart;
+            GetSignature();
+        }
+        private void GetSignature()
+        {
+            if (_vbaPart == null) return;
+            var rel = _vbaPart.GetRelationshipsByType(schemaRelVbaSignature).FirstOrDefault();
+            if (rel != null)
+            {
+                Uri = PackUriHelper.ResolvePartUri(rel.SourceUri, rel.TargetUri);
+                Part = _vbaPart.Package.GetPart(Uri);
+
+                var stream = Part.GetStream();
+                BinaryReader br = new BinaryReader(stream);
+                uint cbSignature = br.ReadUInt32();        
+                uint signatureOffset = br.ReadUInt32();     //44 ??
+                uint cbSigningCertStore = br.ReadUInt32();  
+                uint certStoreOffset = br.ReadUInt32();     
+                uint cbProjectName = br.ReadUInt32();       
+                uint projectNameOffset = br.ReadUInt32();   
+                uint fTimestamp = br.ReadUInt32();
+                uint cbTimestampUrl = br.ReadUInt32();
+                uint timestampUrlOffset = br.ReadUInt32();  
+                byte[] signature = br.ReadBytes((int)cbSignature);
+                uint version = br.ReadUInt32();
+                uint fileType = br.ReadUInt32();
+
+                uint id = br.ReadUInt32();
+                while (id != 0)
+                {
+                    uint encodingType = br.ReadUInt32();
+                    uint length = br.ReadUInt32();
+                    if (length > 0)
+                    {
+                        byte[] value = br.ReadBytes((int)length);
+                        switch (id)
+                        {
+                            //Add property values here...
+                            case 0x20:
+                                Certificate = new X509Certificate2(value);
+                                break;
+                            default:
+                                break;
+                        }
+                    }
+                    id = br.ReadUInt32();
+                }
+                uint endel1 = br.ReadUInt32();  //0
+                uint endel2 = br.ReadUInt32();  //0
+                ushort rgchProjectNameBuffer = br.ReadUInt16();
+                ushort rgchTimestampBuffer = br.ReadUInt16();
+                Verifier = new SignedCms();
+                Verifier.Decode(signature);
+            }
+            else
+            {
+                Certificate = null;
+                Verifier = null;
+            }
+        }
+        //Create Oid from a bytearray
+        //private string ReadHash(byte[] content)
+        //{
+        //    StringBuilder builder = new StringBuilder();
+        //    int offset = 0x6;
+        //    if (0 < (content.Length))
+        //    {
+        //        byte num = content[offset];
+        //        byte num2 = (byte)(num / 40);
+        //        builder.Append(num2.ToString(null, null));
+        //        builder.Append(".");
+        //        num2 = (byte)(num % 40);
+        //        builder.Append(num2.ToString(null, null));
+        //        ulong num3 = 0L;
+        //        for (int i = offset + 1; i < content.Length; i++)
+        //        {
+        //            num2 = content[i];
+        //            num3 = (ulong)(ulong)(num3 << 7) + ((byte)(num2 & 0x7f));
+        //            if ((num2 & 0x80) == 0)
+        //            {
+        //                builder.Append(".");
+        //                builder.Append(num3.ToString(null, null));
+        //                num3 = 0L;
+        //            }
+        //            //1.2.840.113549.2.5
+        //        }
+        //    }
+
+
+        //    string oId = builder.ToString();
+
+        //    return oId;
+        //}
+        internal void Save(ExcelVbaProject proj)
+        {
+            if (Certificate == null || Certificate.HasPrivateKey==false)    //No signature. Remove any Signature part
+            {
+                if (Part != null)
+                {
+                    foreach (var r in Part.GetRelationships())
+                    {
+                        Part.DeleteRelationship(r.Id);
+                    }
+                    Part.Package.DeletePart(Part.Uri);
+                }
+                return;
+            }
+            var ms = new MemoryStream();
+            var bw = new BinaryWriter(ms);
+
+            byte[] certStore = GetCertStore();
+
+            byte[] cert = SignProject(proj);
+            bw.Write((uint)cert.Length);
+            bw.Write((uint)44);                  //?? 36 ref inside cert ??
+            bw.Write((uint)certStore.Length);    //cbSigningCertStore
+            bw.Write((uint)(cert.Length + 44));  //certStoreOffset
+            bw.Write((uint)0);                   //cbProjectName
+            bw.Write((uint)(cert.Length + certStore.Length + 44));    //projectNameOffset
+            bw.Write((uint)0);    //fTimestamp
+            bw.Write((uint)0);    //cbTimestampUrl
+            bw.Write((uint)(cert.Length + certStore.Length + 44 + 2));    //timestampUrlOffset
+            bw.Write(cert);
+            bw.Write(certStore);
+            bw.Write((ushort)0);//rgchProjectNameBuffer
+            bw.Write((ushort)0);//rgchTimestampBuffer
+            bw.Write((ushort)0);
+            bw.Flush();
+
+            var rel = proj.Part.GetRelationshipsByType(schemaRelVbaSignature).FirstOrDefault();
+            if (Part == null)
+            {
+
+                if (rel != null)
+                {
+                    Uri = rel.TargetUri;
+                    Part = proj._pck.GetPart(rel.TargetUri);
+                }
+                else
+                {
+                    Uri = new Uri("/xl/vbaProjectSignature.bin", UriKind.Relative);
+                    Part = proj._pck.CreatePart(Uri, ExcelPackage.schemaVBASignature);
+                }
+            }
+            if (rel == null)
+            {
+                proj.Part.CreateRelationship(PackUriHelper.ResolvePartUri(proj.Uri, Uri), TargetMode.Internal, schemaRelVbaSignature);                
+            }
+            var b = ms.ToArray();
+            Part.GetStream(FileMode.Create).Write(b, 0, b.Length);            
+        }
+
+        private byte[] GetCertStore()
+        {
+            var ms = new MemoryStream();
+            var bw = new BinaryWriter(ms);
+
+            bw.Write((uint)0); //Version
+            bw.Write((uint)0x54524543); //fileType
+
+            //SerializedCertificateEntry
+            var certData = Certificate.RawData;
+            bw.Write((uint)0x20);
+            bw.Write((uint)1);
+            bw.Write((uint)certData.Length);
+            bw.Write(certData);
+
+            //EndElementMarkerEntry
+            bw.Write((uint)0);
+            bw.Write((ulong)0);
+
+            bw.Flush();
+            return ms.ToArray();
+        }
+
+        private void WriteProp(BinaryWriter bw, int id, byte[] data)
+        {
+            bw.Write((uint)id);
+            bw.Write((uint)1);
+            bw.Write((uint)data.Length);
+            bw.Write(data);
+        }
+        internal byte[] SignProject(ExcelVbaProject proj)
+        {
+            if (!Certificate.HasPrivateKey)
+            {
+                //throw (new InvalidOperationException("The certificate doesn't have a private key"));
+                Certificate = null;
+                return null;
+            }
+            var hash = GetContentHash(proj);
+
+            BinaryWriter bw = new BinaryWriter(new MemoryStream());
+            bw.Write((byte)0x30); //Constructed Type 
+            bw.Write((byte)0x32); //Total length
+            bw.Write((byte)0x30); //Constructed Type 
+            bw.Write((byte)0x0E); //Length SpcIndirectDataContent
+            bw.Write((byte)0x06); //Oid Tag Indentifier 
+            bw.Write((byte)0x0A); //Lenght OId
+            bw.Write(new byte[] { 0x2B, 0x06, 0x01, 0x04, 0x01, 0x82, 0x37, 0x02, 0x01, 0x1D }); //Encoded Oid 1.3.6.1.4.1.311.2.1.29
+            bw.Write((byte)0x04);   //Octet String Tag Identifier
+            bw.Write((byte)0x00);   //Zero length
+
+            bw.Write((byte)0x30); //Constructed Type (DigestInfo)
+            bw.Write((byte)0x20); //Length DigestInfo
+            bw.Write((byte)0x30); //Constructed Type (Algorithm)
+            bw.Write((byte)0x0C); //length AlgorithmIdentifier
+            bw.Write((byte)0x06); //Oid Tag Indentifier 
+            bw.Write((byte)0x08); //Lenght OId
+            bw.Write(new byte[] { 0x2A, 0x86, 0x48, 0x86, 0xF7, 0x0D, 0x02, 0x05 }); //Encoded Oid for 1.2.840.113549.2.5 (AlgorithmIdentifier MD5)
+            bw.Write((byte)0x05);   //Null type identifier
+            bw.Write((byte)0x00);   //Null length
+            bw.Write((byte)0x04);   //Octet String Identifier
+            bw.Write((byte)hash.Length);   //Hash length
+            bw.Write(hash);                //Content hash
+
+            ContentInfo contentInfo = new ContentInfo(((MemoryStream)bw.BaseStream).ToArray());
+            contentInfo.ContentType.Value = "1.3.6.1.4.1.311.2.1.4";
+            Verifier = new SignedCms(contentInfo);
+            var signer = new CmsSigner(Certificate);
+            Verifier.ComputeSignature(signer, false);
+            return Verifier.Encode();
+        }
+
+        private byte[] GetContentHash(ExcelVbaProject proj)
+        {
+            //MS-OVBA 2.4.2
+            var enc = System.Text.Encoding.GetEncoding(proj.CodePage);
+            BinaryWriter bw = new BinaryWriter(new MemoryStream());
+            bw.Write(enc.GetBytes(proj.Name));
+            bw.Write(enc.GetBytes(proj.Constants));
+            foreach (var reference in proj.References)
+            {
+                if (reference.ReferenceRecordID == 0x0D)
+                {
+                    bw.Write((byte)0x7B);
+                }
+                if (reference.ReferenceRecordID == 0x0E)
+                {
+                    //var r = (ExcelVbaReferenceProject)reference;
+                    //BinaryWriter bwTemp = new BinaryWriter(new MemoryStream());
+                    //bwTemp.Write((uint)r.Libid.Length);
+                    //bwTemp.Write(enc.GetBytes(r.Libid));              
+                    //bwTemp.Write((uint)r.LibIdRelative.Length);
+                    //bwTemp.Write(enc.GetBytes(r.LibIdRelative));
+                    //bwTemp.Write(r.MajorVersion);
+                    //bwTemp.Write(r.MinorVersion);
+                    foreach (byte b in BitConverter.GetBytes((uint)reference.Libid.Length))  //Length will never be an UInt with 4 bytes that aren't 0 (> 0x00FFFFFF), so no need for the rest of the properties.
+                    {
+                        if (b != 0)
+                        {
+                            bw.Write(b);
+                        }
+                        else
+                        {
+                            break;
+                        }
+                    }
+                }
+            }
+            foreach (var module in proj.Modules)
+            {
+                var lines = module.Code.Split(new char[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries);
+                foreach (var line in lines)
+                {
+                    if (!line.StartsWith("attribute", true, null))
+                    {
+                        bw.Write(enc.GetBytes(line));
+                    }
+                }
+            }
+            var buffer = (bw.BaseStream as MemoryStream).ToArray();
+            var hp = System.Security.Cryptography.MD5CryptoServiceProvider.Create();
+            return hp.ComputeHash(buffer);
+        }
+        /// <summary>
+        /// The certificate to sign the VBA project.
+        /// <remarks>
+        /// This certificate must have a private key.
+        /// There is no validation that the certificate is valid for codesigning, so make sure it's valid to sign Excel files (Excel 2010 is more strict that prior versions).
+        /// </remarks>
+        /// </summary>
+        public X509Certificate2 Certificate { get; set; }
+        /// <summary>
+        /// The verifier
+        /// </summary>
+        public SignedCms Verifier { get; internal set; }
+        internal CompoundDocument Signature { get; set; }
+        internal PackagePart Part { get; set; }
+        internal Uri Uri { get; private set; }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVbaModule.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVbaModule.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVbaModule.cs	(revision 9616)
@@ -0,0 +1,149 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		26-MAR-2012
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.VBA
+{
+    /// <summary>
+    /// Type of VBA module
+    /// </summary>
+    public enum eModuleType
+    {
+        /// <summary>
+        /// A Workbook or Worksheet objects
+        /// </summary>
+        Document=0,
+        /// <summary>
+        /// A Module
+        /// </summary>
+        Module=1,
+        /// <summary>
+        /// A Class
+        /// </summary>
+        Class=2,
+        /// <summary>
+        /// Designer, typically a user form
+        /// </summary>
+        Designer=3
+    }
+    internal delegate void ModuleNameChange(string value);
+
+    /// <summary>
+    /// A VBA code module. 
+    /// </summary>
+    public class ExcelVBAModule
+    {
+        string _name = "";
+        ModuleNameChange _nameChangeCallback = null;
+        internal ExcelVBAModule()
+        {
+            Attributes = new ExcelVbaModuleAttributesCollection();
+        }
+        internal ExcelVBAModule(ModuleNameChange nameChangeCallback) :
+            this()
+        {
+            _nameChangeCallback = nameChangeCallback;
+        }
+        /// <summary>
+        /// The name of the module
+        /// </summary>
+        public string Name 
+        {   
+            get
+            {
+                return _name;
+            }
+            set
+            {
+                _name = value;
+                streamName = value;
+                if (_nameChangeCallback != null)
+                {
+                    _nameChangeCallback(value);
+                }
+            }
+        }
+        /// <summary>
+        /// A description of the module
+        /// </summary>
+        public string Description { get; set; }
+        private string _code="";
+        /// <summary>
+        /// The code without any module level attributes.
+        /// <remarks>Can contain function level attributes.</remarks> 
+        /// </summary>
+        public string Code {
+            get
+            {
+                return _code;
+            }
+            set
+            {
+                if(value.StartsWith("Attribute",StringComparison.InvariantCultureIgnoreCase) || value.StartsWith("VERSION",StringComparison.InvariantCultureIgnoreCase))
+                {
+                    throw(new InvalidOperationException("Code can't start with an Attribute or VERSION keyword. Attributes can be accessed through the Attributes collection."));
+                }
+                _code = value;
+            }
+        }
+        /// <summary>
+        /// A reference to the helpfile
+        /// </summary>
+        public int HelpContext { get; set; }
+        /// <summary>
+        /// Module level attributes.
+        /// </summary>
+        public ExcelVbaModuleAttributesCollection Attributes { get; internal set; }
+        /// <summary>
+        /// Type of module
+        /// </summary>
+        public eModuleType Type { get; internal set; }
+        /// <summary>
+        /// If the module is readonly
+        /// </summary>
+        public bool ReadOnly { get; set; }
+        /// <summary>
+        /// If the module is private
+        /// </summary>
+        public bool Private { get; set; }
+        internal string streamName { get; set; }
+        internal ushort Cookie { get; set; }
+        internal uint ModuleOffset { get; set; }
+        internal string ClassID { get; set; }
+        public override string ToString()
+        {
+            return Name;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVbaModuleAttribute.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVbaModuleAttribute.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVbaModuleAttribute.cs	(revision 9616)
@@ -0,0 +1,45 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace OfficeOpenXml.VBA
+{
+    /// <summary>
+    /// To determine if the attribute uses double quotes around the value
+    /// </summary>
+    public enum eAttributeDataType
+    {
+        /// <summary>
+        /// A string
+        /// </summary>
+        String=0,
+        /// <summary>
+        /// Not a string
+        /// </summary>
+        NonString=1
+    }
+    public class ExcelVbaModuleAttribute
+    {
+        internal ExcelVbaModuleAttribute()
+        {
+
+        }
+        /// <summary>
+        /// The name of the attribute
+        /// </summary>
+        public string Name { get; internal set; }
+        /// <summary>
+        /// The datatype. Determine if the attribute uses double quotes around the value.
+        /// </summary>
+        public eAttributeDataType DataType { get; internal set; }
+        /// <summary>
+        /// The value of the attribute without any double quotes.
+        /// </summary>
+        public string Value { get; set; }
+        public override string ToString()
+        {
+            return Name;
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVbaProtection.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVbaProtection.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/VBA/ExcelVbaProtection.cs	(revision 9616)
@@ -0,0 +1,112 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ *******************************************************************************
+ * Jan Källman		Added		12-APR-2012
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Security.Cryptography;
+
+namespace OfficeOpenXml.VBA
+{
+    /// <summary>
+    /// Vba security properties
+    /// </summary>
+    public class ExcelVbaProtection
+    {
+        ExcelVbaProject _project;
+        internal ExcelVbaProtection(ExcelVbaProject project)
+        {
+            _project = project;
+            VisibilityState = true;
+        }
+        /// <summary>
+        /// Specifies whether access to the VBA project was restricted by the user
+        /// </summary>
+        public bool UserProtected { get; internal set; }
+        /// <summary>
+        /// Specifies whether access to the VBA project was restricted by the VBA host application
+        /// </summary>
+        public bool HostProtected { get; internal set; }
+        /// <summary>
+        /// Specifies whether access to the VBA project was restricted by the VBA project editor
+        /// </summary>
+        public bool VbeProtected { get; internal set; }
+        /// <summary>
+        /// Specifies whether the VBA project is visible.
+        /// </summary>
+        public bool VisibilityState { get; internal set; }
+        internal byte[] PasswordHash { get; set; }
+        internal byte[] PasswordKey { get; set; }
+        /// <summary>
+        /// Password protect the VBA project.
+        /// An empty string or null will remove the password protection
+        /// </summary>
+        /// <param name="Password">The password</param>
+        public void SetPassword(string Password)
+        {
+
+            if (string.IsNullOrEmpty(Password))
+            {
+                PasswordHash = null;
+                PasswordKey = null;
+                VbeProtected = false;
+                HostProtected = false;
+                UserProtected = false;
+                VisibilityState = true;
+                _project.ProjectID = "{5DD90D76-4904-47A2-AF0D-D69B4673604E}";
+            }
+            else
+            {
+                //Join Password and Key
+                byte[] data;
+                //Set the key
+                PasswordKey = new byte[4];
+                RandomNumberGenerator r = RandomNumberGenerator.Create();
+                r.GetBytes(PasswordKey);
+
+                data = new byte[Password.Length + 4];
+                Array.Copy(Encoding.GetEncoding(_project.CodePage).GetBytes(Password), data, Password.Length);
+                VbeProtected = true;
+                VisibilityState = false;
+                Array.Copy(PasswordKey, 0, data, data.Length - 4, 4);
+
+                //Calculate Hash
+                var provider = SHA1.Create();
+                PasswordHash = provider.ComputeHash(data);
+                _project.ProjectID = "{00000000-0000-0000-0000-000000000000}";
+            }
+        }
+        //public void ValidatePassword(string Password)                     
+        //{
+
+        //}        
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/XmlHelper.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/XmlHelper.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/XmlHelper.cs	(revision 9616)
@@ -0,0 +1,820 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						         Date
+ * ******************************************************************************
+ * Jan Källman		    Initial Release		         2009-10-01
+ * Jan Källman		    License changed GPL-->LGPL 2011-12-27
+ * Eyal Seagull       Add "CreateComplexNode"    2012-04-03
+ * Eyal Seagull       Add "DeleteTopNode"        2012-04-13
+ *******************************************************************************/
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using OfficeOpenXml.Style;
+using System.IO.Packaging;
+using System.Globalization;
+using System.IO;
+namespace OfficeOpenXml
+{
+	/// <summary>
+	/// Help class containing XML functions. 
+	/// Can be Inherited 
+	/// </summary>
+	public abstract class XmlHelper
+	{
+		internal delegate int ChangedEventHandler(StyleBase sender, Style.StyleChangeEventArgs e);
+
+		internal XmlHelper(XmlNamespaceManager nameSpaceManager)
+		{
+			TopNode = null;
+			NameSpaceManager = nameSpaceManager;
+		}
+
+		internal XmlHelper(XmlNamespaceManager nameSpaceManager, XmlNode topNode)
+		{
+			TopNode = topNode;
+			NameSpaceManager = nameSpaceManager;
+		}
+		//internal bool ChangedFlag;
+		internal XmlNamespaceManager NameSpaceManager { get; set; }
+		internal XmlNode TopNode { get; set; }
+		string[] _schemaNodeOrder = null;
+		/// <summary>
+		/// Schema order list
+		/// </summary>
+		internal string[] SchemaNodeOrder
+		{
+			get
+			{
+				return _schemaNodeOrder;
+			}
+			set
+			{
+				_schemaNodeOrder = value;
+			}
+		}
+		internal XmlNode CreateNode(string path)
+		{
+			if (path == "")
+				return TopNode;
+			else
+				return CreateNode(path, false);
+		}
+		internal XmlNode CreateNode(string path, bool insertFirst)
+		{
+			XmlNode node = TopNode;
+			XmlNode prependNode = null;
+			foreach (string subPath in path.Split('/'))
+			{
+				XmlNode subNode = node.SelectSingleNode(subPath, NameSpaceManager);
+				if (subNode == null)
+				{
+					string nodeName;
+					string nodePrefix;
+
+					string nameSpaceURI = "";
+					string[] nameSplit = subPath.Split(':');
+
+					if (SchemaNodeOrder != null && subPath[0] != '@')
+					{
+						insertFirst = false;
+						prependNode = GetPrependNode(subPath, node);
+					}
+
+					if (nameSplit.Length > 1)
+					{
+						nodePrefix = nameSplit[0];
+						if (nodePrefix[0] == '@') nodePrefix = nodePrefix.Substring(1, nodePrefix.Length - 1);
+						nameSpaceURI = NameSpaceManager.LookupNamespace(nodePrefix);
+						nodeName = nameSplit[1];
+					}
+					else
+					{
+						nodePrefix = "";
+						nameSpaceURI = "";
+						nodeName = nameSplit[0];
+					}
+					if (subPath.StartsWith("@"))
+					{
+						XmlAttribute addedAtt = node.OwnerDocument.CreateAttribute(subPath.Substring(1, subPath.Length - 1), nameSpaceURI);  //nameSpaceURI
+						node.Attributes.Append(addedAtt);
+					}
+					else
+					{
+						if (nodePrefix == "")
+						{
+							subNode = node.OwnerDocument.CreateElement(nodeName, nameSpaceURI);
+						}
+						else
+						{
+							if (nodePrefix == "" || (node.OwnerDocument != null && node.OwnerDocument.DocumentElement != null && node.OwnerDocument.DocumentElement.NamespaceURI == nameSpaceURI &&
+									node.OwnerDocument.DocumentElement.Prefix == ""))
+							{
+								subNode = node.OwnerDocument.CreateElement(nodeName, nameSpaceURI);
+							}
+							else
+							{
+								subNode = node.OwnerDocument.CreateElement(nodePrefix, nodeName, nameSpaceURI);
+							}
+						}
+						if (prependNode != null)
+						{
+							node.InsertBefore(subNode, prependNode);
+							prependNode = null;
+						}
+						else if (insertFirst)
+						{
+							node.PrependChild(subNode);
+						}
+						else
+						{
+							node.AppendChild(subNode);
+						}
+					}
+				}
+				node = subNode;
+			}
+			return node;
+		}
+
+		/// <summary>
+		/// Options to insert a node in the XmlDocument
+		/// </summary>
+		internal enum eNodeInsertOrder
+		{
+			/// <summary>
+			/// Insert as first node of "topNode"
+			/// </summary>
+			First,
+
+			/// <summary>
+			/// Insert as the last child of "topNode"
+			/// </summary>
+			Last,
+
+			/// <summary>
+			/// Insert after the "referenceNode"
+			/// </summary>
+			After,
+
+			/// <summary>
+			/// Insert before the "referenceNode"
+			/// </summary>
+			Before,
+
+			/// <summary>
+			/// Use the Schema List to insert in the right order. If the Schema list
+			/// is null or empty, consider "Last" as the selected option
+			/// </summary>
+			SchemaOrder
+		}
+
+		/// <summary>
+		/// Create a complex node. Insert the node according to SchemaOrder
+		/// using the TopNode as the parent
+		/// </summary>
+		/// <param name="path"></param>
+		/// <returns></returns>
+		internal XmlNode CreateComplexNode(
+			string path)
+		{
+			return CreateComplexNode(
+				TopNode,
+				path,
+				eNodeInsertOrder.SchemaOrder,
+				null);
+		}
+
+		/// <summary>
+		/// Create a complex node. Insert the node according to the <paramref name="path"/>
+		/// using the <paramref name="topNode"/> as the parent
+		/// </summary>
+		/// <param name="topNode"></param>
+		/// <param name="path"></param>
+		/// <returns></returns>
+		internal XmlNode CreateComplexNode(
+			XmlNode topNode,
+			string path)
+		{
+			return CreateComplexNode(
+				topNode,
+				path,
+				eNodeInsertOrder.SchemaOrder,
+				null);
+		}
+
+		/// <summary>
+		/// Creates complex XML nodes
+    /// </summary>
+    /// <remarks>
+		/// 1. "d:conditionalFormatting"
+		///		1.1. Creates/find the first "conditionalFormatting" node
+		/// 
+		/// 2. "d:conditionalFormatting/@sqref"
+		///		2.1. Creates/find the first "conditionalFormatting" node
+		///		2.2. Creates (if not exists) the @sqref attribute
+		///
+		/// 3. "d:conditionalFormatting/@id='7'/@sqref='A9:B99'"
+		///		3.1. Creates/find the first "conditionalFormatting" node
+		///		3.2. Creates/update its @id attribute to "7"
+		///		3.3. Creates/update its @sqref attribute to "A9:B99"
+		///
+		/// 4. "d:conditionalFormatting[@id='7']/@sqref='X1:X5'"
+		///		4.1. Creates/find the first "conditionalFormatting" node with @id=7
+		///		4.2. Creates/update its @sqref attribute to "X1:X5"
+		///	
+		/// 5. "d:conditionalFormatting[@id='7']/@id='8'/@sqref='X1:X5'/d:cfRule/@id='AB'"
+		///		5.1. Creates/find the first "conditionalFormatting" node with @id=7
+		///		5.2. Set its @id attribute to "8"
+		///		5.2. Creates/update its @sqref attribute and set it to "X1:X5"
+		///		5.3. Creates/find the first "cfRule" node (inside the node)
+		///		5.4. Creates/update its @id attribute to "AB"
+		///	
+		/// 6. "d:cfRule/@id=''"
+		///		6.1. Creates/find the first "cfRule" node
+		///		6.1. Remove the @id attribute
+    ///	</remarks>
+		/// <param name="topNode"></param>
+		/// <param name="path"></param>
+		/// <param name="nodeInsertOrder"></param>
+		/// <param name="referenceNode"></param>
+		/// <returns>The last node creates/found</returns>
+		internal XmlNode CreateComplexNode(
+			XmlNode topNode,
+			string path,
+			eNodeInsertOrder nodeInsertOrder,
+			XmlNode referenceNode)
+		{
+			// Path is obrigatory
+			if ((path == null) || (path == string.Empty))
+			{
+				return topNode;
+			}
+
+			XmlNode node = topNode;
+			string nameSpaceURI = string.Empty;
+
+      //TODO: BUG: when the "path" contains "/" in an attrribue value, it gives an error.
+
+			// Separate the XPath to Nodes and Attributes
+			foreach (string subPath in path.Split('/'))
+			{
+				// The subPath can be any one of those:
+				// nodeName
+				// x:nodeName
+				// nodeName[find criteria]
+				// x:nodeName[find criteria]
+				// @attribute
+				// @attribute='attribute value'
+
+				// Check if the subPath has at least one character
+				if (subPath.Length > 0)
+				{
+					// Check if the subPath is an attribute (with or without value)
+					if (subPath.StartsWith("@"))
+					{
+						// @attribute										--> Create attribute
+						// @attribute=''								--> Remove attribute
+						// @attribute='attribute value' --> Create attribute + update value
+						string[] attributeSplit = subPath.Split('=');
+						string attributeName = attributeSplit[0].Substring(1, attributeSplit[0].Length - 1);
+						string attributeValue = null;	// Null means no attribute value
+
+						// Check if we have an attribute value to set
+						if (attributeSplit.Length > 1)
+						{
+							// Remove the ' or " from the attribute value
+							attributeValue = attributeSplit[1].Replace("'", "").Replace("\"", "");
+						}
+
+						// Get the attribute (if exists)
+						XmlAttribute attribute = (XmlAttribute)(node.Attributes.GetNamedItem(attributeName));
+
+						// Remove the attribute if value is empty (not null)
+						if (attributeValue == string.Empty)
+						{
+							// Only if the attribute exists
+							if (attribute != null)
+							{
+								node.Attributes.Remove(attribute);
+							}
+						}
+						else
+						{
+							// Create the attribue if does not exists
+							if (attribute == null)
+							{
+								// Create the attribute
+								attribute = node.OwnerDocument.CreateAttribute(
+									attributeName);
+
+								// Add it to the current node
+								node.Attributes.Append(attribute);
+							}
+
+							// Update the attribute value
+							if (attributeValue != null)
+							{
+								node.Attributes[attributeName].Value = attributeValue;
+							}
+						}
+					}
+					else
+					{
+						// nodeName
+						// x:nodeName
+						// nodeName[find criteria]
+						// x:nodeName[find criteria]
+
+						// Look for the node (with or without filter criteria)
+						XmlNode subNode = node.SelectSingleNode(subPath, NameSpaceManager);
+
+						// Check if the node does not exists
+						if (subNode == null)
+						{
+							string nodeName;
+							string nodePrefix;
+							string[] nameSplit = subPath.Split(':');
+							nameSpaceURI = string.Empty;
+
+							// Check if the name has a prefix like "d:nodeName"
+							if (nameSplit.Length > 1)
+							{
+								nodePrefix = nameSplit[0];
+								nameSpaceURI = NameSpaceManager.LookupNamespace(nodePrefix);
+								nodeName = nameSplit[1];
+							}
+							else
+							{
+								nodePrefix = string.Empty;
+								nameSpaceURI = string.Empty;
+								nodeName = nameSplit[0];
+							}
+
+							// Check if we have a criteria part in the node name
+							if (nodeName.IndexOf("[") > 0)
+							{
+								// remove the criteria from the node name
+								nodeName = nodeName.Substring(0, nodeName.IndexOf("["));
+							}
+
+							if (nodePrefix == string.Empty)
+							{
+								subNode = node.OwnerDocument.CreateElement(nodeName, nameSpaceURI);
+							}
+							else
+							{
+								if (node.OwnerDocument != null
+									&& node.OwnerDocument.DocumentElement != null
+									&& node.OwnerDocument.DocumentElement.NamespaceURI == nameSpaceURI
+									&& node.OwnerDocument.DocumentElement.Prefix == string.Empty)
+								{
+									subNode = node.OwnerDocument.CreateElement(
+										nodeName,
+										nameSpaceURI);
+								}
+								else
+								{
+									subNode = node.OwnerDocument.CreateElement(
+										nodePrefix,
+										nodeName,
+										nameSpaceURI);
+								}
+							}
+
+							// Check if we need to use the "SchemaOrder"
+							if (nodeInsertOrder == eNodeInsertOrder.SchemaOrder)
+							{
+								// Check if the Schema Order List is empty
+								if ((SchemaNodeOrder == null) || (SchemaNodeOrder.Length == 0))
+								{
+									// Use the "Insert Last" option when Schema Order List is empty
+									nodeInsertOrder = eNodeInsertOrder.Last;
+								}
+								else
+								{
+									// Find the prepend node in order to insert
+									referenceNode = GetPrependNode(nodeName, node);
+
+									if (referenceNode != null)
+									{
+										nodeInsertOrder = eNodeInsertOrder.Before;
+									}
+									else
+									{
+										nodeInsertOrder = eNodeInsertOrder.Last;
+									}
+								}
+							}
+
+							switch (nodeInsertOrder)
+							{
+								case eNodeInsertOrder.After:
+									node.InsertAfter(subNode, referenceNode);
+                                    referenceNode = null;
+                                    break;
+
+								case eNodeInsertOrder.Before:
+									node.InsertBefore(subNode, referenceNode);
+                                    referenceNode = null;
+									break;
+
+								case eNodeInsertOrder.First:
+									node.PrependChild(subNode);
+									break;
+
+								case eNodeInsertOrder.Last:
+									node.AppendChild(subNode);
+									break;
+							}
+						}
+
+						// Make the newly created node the top node when the rest of the path
+						// is being evaluated. So newly created nodes will be the children of the
+						// one we just created.
+						node = subNode;
+					}
+				}
+			}
+
+			// Return the last created/found node
+			return node;
+		}
+
+		/// <summary>
+		/// return Prepend node
+		/// </summary>
+		/// <param name="nodeName">name of the node to check</param>
+		/// <param name="node">Topnode to check children</param>
+		/// <returns></returns>
+		private XmlNode GetPrependNode(string nodeName, XmlNode node)
+		{
+			int pos = GetNodePos(nodeName);
+			if (pos < 0)
+			{
+				return null;
+			}
+			XmlNode prependNode = null;
+			foreach (XmlNode childNode in node.ChildNodes)
+			{
+				int childPos = GetNodePos(childNode.Name);
+				if (childPos > -1)  //Found?
+				{
+					if (childPos > pos) //Position is before
+					{
+						prependNode = childNode;
+						break;
+					}
+				}
+			}
+			return prependNode;
+		}
+		private int GetNodePos(string nodeName)
+		{
+			int ix = nodeName.IndexOf(":");
+			if (ix > 0)
+			{
+				nodeName = nodeName.Substring(ix + 1, nodeName.Length - (ix + 1));
+			}
+			for (int i = 0; i < _schemaNodeOrder.Length; i++)
+			{
+				if (nodeName == _schemaNodeOrder[i])
+				{
+					return i;
+				}
+			}
+			return -1;
+		}
+		internal void DeleteAllNode(string path)
+		{
+			string[] split = path.Split('/');
+			XmlNode node = TopNode;
+			foreach (string s in split)
+			{
+				node = node.SelectSingleNode(s, NameSpaceManager);
+				if (node != null)
+				{
+					if (node is XmlAttribute)
+					{
+						(node as XmlAttribute).OwnerElement.Attributes.Remove(node as XmlAttribute);
+					}
+					else
+					{
+						node.ParentNode.RemoveChild(node);
+					}
+				}
+				else
+				{
+					break;
+				}
+			}
+		}
+		internal void DeleteNode(string path)
+		{
+			var node = TopNode.SelectSingleNode(path, NameSpaceManager);
+			if (node != null)
+			{
+				if (node is XmlAttribute)
+				{
+					var att = (XmlAttribute)node;
+					att.OwnerElement.Attributes.Remove(att);
+				}
+				else
+				{
+					node.ParentNode.RemoveChild(node);
+				}
+			}
+		}
+    internal void DeleteTopNode()
+    {
+      TopNode.ParentNode.RemoveChild(TopNode);
+    }
+		internal void SetXmlNodeString(string path, string value)
+		{
+			SetXmlNodeString(TopNode, path, value, false, false);
+		}
+		internal void SetXmlNodeString(string path, string value, bool removeIfBlank)
+		{
+			SetXmlNodeString(TopNode, path, value, removeIfBlank, false);
+		}
+		internal void SetXmlNodeString(XmlNode node, string path, string value)
+		{
+			SetXmlNodeString(node, path, value, false, false);
+		}
+		internal void SetXmlNodeString(XmlNode node, string path, string value, bool removeIfBlank)
+		{
+			SetXmlNodeString(node, path, value, removeIfBlank, false);
+		}
+		internal void SetXmlNodeString(XmlNode node, string path, string value, bool removeIfBlank, bool insertFirst)
+		{
+			if (node == null)
+			{
+				return;
+			}
+			if (value == "" && removeIfBlank)
+			{
+				DeleteAllNode(path);
+			}
+			else
+			{
+				XmlNode nameNode = node.SelectSingleNode(path, NameSpaceManager);
+				if (nameNode == null)
+				{
+					CreateNode(path, insertFirst);
+					nameNode = node.SelectSingleNode(path, NameSpaceManager);
+				}
+				//if (nameNode.InnerText != value) HasChanged();
+				nameNode.InnerText = value;
+			}
+		}
+		internal void SetXmlNodeBool(string path, bool value)
+		{
+			SetXmlNodeString(TopNode, path, value ? "1" : "0", false, false);
+		}
+		internal void SetXmlNodeBool(string path, bool value, bool removeIf)
+		{
+			if (value == removeIf)
+			{
+				var node = TopNode.SelectSingleNode(path, NameSpaceManager);
+				if (node != null)
+				{
+					if (node is XmlAttribute)
+					{
+						var elem = (node as XmlAttribute).OwnerElement;
+						elem.ParentNode.RemoveChild(elem);
+					}
+					else
+					{
+						TopNode.RemoveChild(node);
+					}
+				}
+			}
+			else
+			{
+				SetXmlNodeString(TopNode, path, value ? "1" : "0", false, false);
+			}
+		}
+		internal bool ExistNode(string path)
+		{
+			if (TopNode == null || TopNode.SelectSingleNode(path, NameSpaceManager) == null)
+			{
+				return false;
+			}
+			else
+			{
+				return true;
+			}
+		}
+		internal bool? GetXmlNodeBoolNullable(string path)
+		{
+			var value = GetXmlNodeString(path);
+			if (string.IsNullOrEmpty(value))
+			{
+				return null;
+			}
+			return GetXmlNodeBool(path);
+		}
+		internal bool GetXmlNodeBool(string path)
+		{
+			return GetXmlNodeBool(path, false);
+		}
+		internal bool GetXmlNodeBool(string path, bool blankValue)
+		{
+			string value = GetXmlNodeString(path);
+			if (value == "1" || value == "-1" || value == "True")
+			{
+				return true;
+			}
+			else if (value == "")
+			{
+				return blankValue;
+			}
+			else
+			{
+				return false;
+			}
+		}
+		internal int GetXmlNodeInt(string path)
+		{
+			int i;
+			if (int.TryParse(GetXmlNodeString(path), out i))
+			{
+				return i;
+			}
+			else
+			{
+				return int.MinValue;
+			}
+		}
+        internal int? GetXmlNodeIntNull(string path)
+        {
+            int i;
+            string s = GetXmlNodeString(path);
+            if (s!="" && int.TryParse(s, out i))
+            {
+                return i;
+            }
+            else
+            {
+                return null;
+            }
+        }
+
+		internal decimal GetXmlNodeDecimal(string path)
+		{
+			decimal d;
+			if (decimal.TryParse(GetXmlNodeString(path), NumberStyles.Any, CultureInfo.InvariantCulture, out d))
+			{
+				return d;
+			}
+			else
+			{
+				return 0;
+			}
+		}
+		internal double? GetXmlNodeDoubleNull(string path)
+		{
+			string s = GetXmlNodeString(path);
+			if (s == "")
+			{
+				return null;
+			}
+			else
+			{
+				double v;
+				if (double.TryParse(s, NumberStyles.Number, CultureInfo.InvariantCulture, out v))
+				{
+					return v;
+				}
+				else
+				{
+					return null;
+				}
+			}
+		}
+		internal double GetXmlNodeDouble(string path)
+		{
+			string s = GetXmlNodeString(path);
+			if (s == "")
+			{
+				return double.NaN;
+			}
+			else
+			{
+				double v;
+				if (double.TryParse(s, NumberStyles.Number, CultureInfo.InvariantCulture, out v))
+				{
+					return v;
+				}
+				else
+				{
+					return double.NaN;
+				}
+			}
+		}
+    internal string GetXmlNodeString(XmlNode node, string path)
+    {
+      if (node == null)
+      {
+        return "";
+      }
+
+      XmlNode nameNode = node.SelectSingleNode(path, NameSpaceManager);
+
+      if (nameNode != null)
+      {
+        if (nameNode.NodeType == XmlNodeType.Attribute)
+        {
+          return nameNode.Value != null ? nameNode.Value : "";
+        }
+        else
+        {
+          return nameNode.InnerText;
+        }
+      }
+      else
+      {
+        return "";
+      }
+    }
+		internal string GetXmlNodeString(string path)
+		{
+            return GetXmlNodeString(TopNode, path);
+		}
+		internal static Uri GetNewUri(Package package, string sUri)
+		{
+			return GetNewUri(package, sUri, 1);
+		}
+		internal static Uri GetNewUri(Package package, string sUri, int id)
+		{
+			Uri uri;
+			do
+			{
+				uri = new Uri(string.Format(sUri, id++), UriKind.Relative);
+			}
+			while (package.PartExists(uri));
+			return uri;
+		}
+		/// <summary>
+		/// Insert the new node before any of the nodes in the comma separeted list
+		/// </summary>
+		/// <param name="parentNode">Parent node</param>
+		/// <param name="beforeNodes">comma separated list containing nodes to insert after. Left to right order</param>
+		/// <param name="newNode">The new node to be inserterd</param>
+		internal void InserAfter(XmlNode parentNode, string beforeNodes, XmlNode newNode)
+		{
+			string[] nodePaths = beforeNodes.Split(',');
+
+			foreach (string nodePath in nodePaths)
+			{
+				XmlNode node = parentNode.SelectSingleNode(nodePath, NameSpaceManager);
+				if (node != null)
+				{
+					parentNode.InsertAfter(newNode, node);
+					return;
+				}
+			}
+			parentNode.InsertAfter(newNode, null);
+		}
+        internal static void LoadXmlSafe(XmlDocument xmlDoc, Stream stream)
+        {
+            XmlReaderSettings settings = new XmlReaderSettings();
+            //Disable entity parsing (to aviod xmlbombs, External Entity Attacks etc).
+            settings.ProhibitDtd = true;
+
+            XmlReader reader = XmlReader.Create(stream, settings);            
+            xmlDoc.Load(reader);
+        }
+        internal static void LoadXmlSafe(XmlDocument xmlDoc, string xml, Encoding encoding)
+        {
+            var stream = new MemoryStream(encoding.GetBytes(xml));
+            LoadXmlSafe(xmlDoc, stream);
+        }
+	}
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/XmlHelperFactory.cs
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/XmlHelperFactory.cs	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/EPPlus-3.1.3/XmlHelperFactory.cs	(revision 9616)
@@ -0,0 +1,64 @@
+﻿/*******************************************************************************
+ * You may amend and distribute as you like, but don't remove this header!
+ *
+ * EPPlus provides server-side generation of Excel 2007/2010 spreadsheets.
+ * See http://www.codeplex.com/EPPlus for details.
+ *
+ * Copyright (C) 2011  Jan Källman
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
+ * See the GNU Lesser General Public License for more details.
+ *
+ * The GNU Lesser General Public License can be viewed at http://www.opensource.org/licenses/lgpl-license.php
+ * If you unfamiliar with this license or have questions about it, here is an http://www.gnu.org/licenses/gpl-faq.html
+ *
+ * All code and executables are provided "as is" with no warranty either express or implied. 
+ * The author accepts no liability for any damage or loss of business that this product may cause.
+ *
+ * Code change notes:
+ * 
+ * Author							Change						Date
+ * ******************************************************************************
+ * Mats Alm 		    Initial Release		        2011-05-01
+ * Jan Källman		    License changed GPL-->LGPL  2011-12-27
+ *******************************************************************************/
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml;
+
+namespace OfficeOpenXml
+{
+    internal class XmlHelperInstance : XmlHelper
+    {
+        internal XmlHelperInstance(XmlNamespaceManager namespaceManager)
+            : base(namespaceManager)
+        {}
+
+        internal XmlHelperInstance(XmlNamespaceManager namespaceManager, XmlNode topNode)
+            : base(namespaceManager, topNode)
+        {}
+
+    }
+
+    internal static class XmlHelperFactory
+    {
+        internal static XmlHelper Create(XmlNamespaceManager namespaceManager)
+        {
+            return new XmlHelperInstance(namespaceManager);
+        }
+
+        internal static XmlHelper Create(XmlNamespaceManager namespaceManager, XmlNode topNode)
+        {
+            return new XmlHelperInstance(namespaceManager, topNode);
+        }
+    }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/EPPlus License-3.1.3.txt
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/EPPlus License-3.1.3.txt	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/EPPlus License-3.1.3.txt	(revision 9616)
@@ -0,0 +1,147 @@
+HeuristicLab.EPPlus uses the EPPlus from http://epplus.codeplex.com/.
+                 
+GNU Library General Public License (LGPL)
+
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]
+
+Preamble
+
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
+
+We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
+
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+a) The modified work must itself be a software library.
+
+b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+
+c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+
+d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+
+(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+
+b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+
+c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+
+d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+
+e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+
+b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/HeuristicLab.EPPlus-3.1.3.csproj
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/HeuristicLab.EPPlus-3.1.3.csproj	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/HeuristicLab.EPPlus-3.1.3.csproj	(revision 9616)
@@ -0,0 +1,122 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{B8B9E73B-18DE-4781-8F31-D3472BA9DB66}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.EPPlus</RootNamespace>
+    <AssemblyName>HeuristicLab.EPPlus-3.1.3</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <TargetFrameworkProfile />
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x64</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
+    <DebugSymbols>true</DebugSymbols>
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <DebugType>full</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
+    <OutputPath>..\..\..\..\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <Optimize>true</Optimize>
+    <DebugType>pdbonly</DebugType>
+    <PlatformTarget>x86</PlatformTarget>
+    <ErrorReport>prompt</ErrorReport>
+    <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="Plugin.cs.frame" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <None Include="HeuristicLab.snk" />
+    <None Include="Properties\AssemblyInfo.cs.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\..\HeuristicLab.PluginInfrastructure\3.3\HeuristicLab.PluginInfrastructure-3.3.csproj">
+      <Project>{94186a6a-5176-4402-ae83-886557b53cca}</Project>
+      <Name>HeuristicLab.PluginInfrastructure-3.3</Name>
+      <Private>False</Private>
+    </ProjectReference>
+    <ProjectReference Include="..\EPPlus-3.1.3\EPPlus-3.1.3.csproj">
+      <Project>{7b288026-5502-4a39-bf41-77e086f3e4a3}</Project>
+      <Name>EPPlus-3.1.3</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <ItemGroup>
+    <Content Include="EPPlus License-3.1.3.txt">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <PropertyGroup>
+    <PreBuildEvent>set Path=%25Path%25;$(ProjectDir);$(SolutionDir)
+set ProjectDir=$(ProjectDir)
+set SolutionDir=$(SolutionDir)
+set Outdir=$(Outdir)
+
+call PreBuildEvent.cmd</PreBuildEvent>
+  </PropertyGroup>
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/Plugin.cs.frame
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/Plugin.cs.frame	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/Plugin.cs.frame	(revision 9616)
@@ -0,0 +1,31 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.EPPlus {
+  [Plugin("HeuristicLab.EPPlus", "HeuristicLab wrapper for EPPlus", "3.1.3.$WCREV$")]
+  [PluginFile("HeuristicLab.EPPlus-3.1.3.dll", PluginFileType.Assembly)]
+  [PluginFile("EPPlus-3.1.3.dll", PluginFileType.Assembly)]
+  [PluginFile("EPPlus License-3.1.3.txt", PluginFileType.License)]
+  public class HeuristicLabEPPlusPlugin : PluginBase {
+  }
+}
Index: branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/Properties/AssemblyInfo.cs.frame
===================================================================
--- branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/Properties/AssemblyInfo.cs.frame	(revision 9616)
+++ branches/HivePerformance/sources/HeuristicLab.ExtLibs/HeuristicLab.EPPlus/3.1.3/HeuristicLab.EPPlus-3.1.3/Properties/AssemblyInfo.cs.frame	(revision 9616)
@@ -0,0 +1,57 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.EPPlus")]
+[assembly: AssemblyDescription("Provides an interface to EPPlus")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2013 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("f70ed15d-9703-4c6f-b2f0-89ae10be305d")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("3.1.3")]
+[assembly: AssemblyFileVersion("3.1.3.$WCREV$")]
