[ooo-build-commit] .: 3 commits - patches/dev300

Kohei Yoshida kohei at kemper.freedesktop.org
Thu May 20 23:53:53 PDT 2010


 patches/dev300/apply                                                    |   74 
 patches/dev300/calc-cursor-split-view.diff                              |    5 
 patches/dev300/calc-distributed-cell-text-sc.diff                       |   11 
 patches/dev300/calc-find-replace-skip-filtered-sc.diff                  |    8 
 patches/dev300/calc-html-csv-import-force-text-cell.diff                |   10 
 patches/dev300/calc-increase-row-limit.diff                             |   26 
 patches/dev300/calc-insert-new-sheet-tab-sc.diff                        |   57 
 patches/dev300/calc-insert-new-sheet-tab-svtools.diff                   |   36 
 patches/dev300/calc-odf-export-autostyle-maxrow.diff                    |   25 
 patches/dev300/calc-ods-export-no-more-ushort.diff                      |   34 
 patches/dev300/calc-ods-sheet-protection-sc.diff                        |   90 
 patches/dev300/calc-perf-copy-table-flags.diff                          |  121 
 patches/dev300/calc-perf-extend-print-area.diff                         |  422 
 patches/dev300/calc-perf-filtering-with-notes.diff                      |    6 
 patches/dev300/calc-perf-flat-segment-tree.diff                         |  808 
 patches/dev300/calc-perf-import-dbf-sc.diff                             |   17 
 patches/dev300/calc-perf-last-rowflags-fix.diff                         |   64 
 patches/dev300/calc-perf-lazy-overlay-objects.diff                      |  201 
 patches/dev300/calc-perf-ods-import-properties.diff                     |  174 
 patches/dev300/calc-perf-ods-import-row-height.diff                     |  148 
 patches/dev300/calc-perf-page-and-manual-breaks-fwd-iterator.diff       |   32 
 patches/dev300/calc-perf-page-and-manual-breaks.diff                    | 1679 -
 patches/dev300/calc-perf-print-calc-pages.diff                          |  193 
 patches/dev300/calc-perf-sort.diff                                      |  113 
 patches/dev300/calc-perf-speedup-pagebreak-update.diff                  |  791 
 patches/dev300/calc-perf-table-hidden-flags.diff                        | 3903 ----
 patches/dev300/calc-perf-xls-import-cellstyles.diff                     |   49 
 patches/dev300/calc-print-selected-cells-fix.diff                       |   25 
 patches/dev300/calc-row-limit-bad-ushort.diff                           |   48 
 patches/dev300/calc-xls-export-hidden-row-height.diff                   |  105 
 patches/dev300/cws-calctabcolor-accessibility.diff                      |   26 
 patches/dev300/cws-calctabcolor-filter.diff                             |   32 
 patches/dev300/cws-calctabcolor-offapi.diff                             |   23 
 patches/dev300/cws-calctabcolor-officecfg.diff                          |   12 
 patches/dev300/cws-calctabcolor-oox.diff                                |  119 
 patches/dev300/cws-calctabcolor-sc.diff                                 | 2593 ++
 patches/dev300/cws-calctabcolor-svtools.diff                            |  296 
 patches/dev300/cws-calctabcolor-tools.diff                              |   13 
 patches/dev300/cws-calctabcolor-xmloff.diff                             |   24 
 patches/dev300/cws-koheirowlimitperf-mdds.diff                          |   96 
 patches/dev300/cws-koheirowlimitperf-sc.diff                            | 8888 ++++++++++
 patches/dev300/layout-post-cws-layoutdialogs2-mysteriously-missing.diff |    2 
 patches/dev300/sc-drwlayer-units.diff                                   |   15 
 patches/dev300/sc-filters-fill-fix.diff                                 |    4 
 patches/dev300/sc-overwrite-char-font-attrs.diff                        |  196 
 patches/dev300/sc-sheet-gridline-toggle.diff                            |   29 
 46 files changed, 11688 insertions(+), 9955 deletions(-)

New commits:
commit 8d2143ab508148a9bf693789d40af39713d91312
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri May 21 02:53:23 2010 -0400

    Adjusted or removed patches.
    
    * patches/dev300/apply:
    * patches/dev300/calc-cursor-split-view.diff:
    * patches/dev300/calc-distributed-cell-text-sc.diff:
    * patches/dev300/calc-find-replace-skip-filtered-sc.diff:
    * patches/dev300/calc-html-csv-import-force-text-cell.diff:
    * patches/dev300/calc-increase-row-limit.diff:
    * patches/dev300/calc-insert-new-sheet-tab-sc.diff:
    * patches/dev300/calc-insert-new-sheet-tab-svtools.diff:
    * patches/dev300/calc-odf-export-autostyle-maxrow.diff:
    * patches/dev300/calc-ods-export-no-more-ushort.diff:
    * patches/dev300/calc-ods-sheet-protection-sc.diff:
    * patches/dev300/calc-perf-copy-table-flags.diff:
    * patches/dev300/calc-perf-extend-print-area.diff:
    * patches/dev300/calc-perf-filtering-with-notes.diff:
    * patches/dev300/calc-perf-flat-segment-tree.diff:
    * patches/dev300/calc-perf-import-dbf-sc.diff:
    * patches/dev300/calc-perf-last-rowflags-fix.diff:
    * patches/dev300/calc-perf-lazy-overlay-objects.diff:
    * patches/dev300/calc-perf-ods-import-properties.diff:
    * patches/dev300/calc-perf-ods-import-row-height.diff:
    * patches/dev300/calc-perf-page-and-manual-breaks-fwd-iterator.diff:
    * patches/dev300/calc-perf-page-and-manual-breaks.diff:
    * patches/dev300/calc-perf-print-calc-pages.diff:
    * patches/dev300/calc-perf-sort.diff:
    * patches/dev300/calc-perf-speedup-pagebreak-update.diff:
    * patches/dev300/calc-perf-table-hidden-flags.diff:
    * patches/dev300/calc-perf-xls-import-cellstyles.diff:
    * patches/dev300/calc-print-selected-cells-fix.diff:
    * patches/dev300/calc-row-limit-bad-ushort.diff:
    * patches/dev300/calc-xls-export-hidden-row-height.diff:
    * patches/dev300/layout-post-cws-layoutdialogs2-mysteriously-missing.diff:
    * patches/dev300/sc-drwlayer-units.diff:
    * patches/dev300/sc-filters-fill-fix.diff:
    * patches/dev300/sc-overwrite-char-font-attrs.diff:
    * patches/dev300/sc-sheet-gridline-toggle.diff:

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 47143c4..f8e2f64 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -862,60 +862,13 @@ SectionOwner => kohei
 # Note: When up-streamed, remove evaluation-row-limit.diff
 calc-increase-row-limit.diff, n#443634, i#30215, kohei
 
-# check for last edited row when exporting automatic styles.
-calc-odf-export-autostyle-maxrow.diff, n#497610, i#109373, kohei
-
-# add implementation of flat_segment_tree and its wrapper classes.
-calc-perf-flat-segment-tree.diff, i#109369, kohei
-
-# speed up ods import by using flat_segment_tree.
-calc-perf-ods-import-properties.diff, n#498547, i#109384, kohei
-
-# squash USHORT where SCROW or SCCOL should have been used.
-calc-row-limit-bad-ushort.diff, n#509768, i#109385, kohei
-
-# better algorithm to search for best-fit zoom level during page break calculation,
-# and to optimize pagenations by as much as 900% by using better data structure
-# for flag storage.
-calc-perf-page-and-manual-breaks.diff, n#503482, i#109386, kohei
-
-# refactor to store hidden and filtered flags in flat_segment_tree structure.
-calc-perf-table-hidden-flags.diff, n#495140, i#109387, kohei
-
-# type cast to SCROW and SCCOL for row and column, not to USHORT!
-calc-ods-export-no-more-ushort.diff, n#501029, i#109385, kohei
-
-# Speed up sorting, especially on large data set.
-calc-perf-sort.diff, n#504827, i#109388, kohei
-
-# Speed up selection of large area, cursor placement in split view.
-calc-perf-lazy-overlay-objects.diff, n#511006, i#109389, kohei
-
-# Better algorithm for row flag copying.
-calc-perf-copy-table-flags.diff, n#514156, i#109386, kohei
-
 # don't show progress bar during row height adjustment if the row count is 
 # less than 1000.
 calc-perf-rowheight-no-progress-bar.diff, n#514156, kohei
 
-# speed up row's hidden state query during pagenation.
-calc-perf-page-and-manual-breaks-fwd-iterator.diff, n#503482, i#109386, kohei
-
-# Refactor row height storage to speed up page break updates.
-calc-perf-speedup-pagebreak-update.diff, n#554955, i#109391, kohei
-
-# Use manual breaks hidden/filtered flags when querying for last flagged row.
-calc-perf-last-rowflags-fix.diff, n#568146, i#109391, kohei
-
-# correctly export the heights of hidden rows.
-calc-xls-export-hidden-row-height.diff, n#573938, i#109391, kohei
-
 # correctly export the heights of rows with wrapped text.
 calc-xls-export-row-height-wrapped-text.diff, n#580094, kohei
 
-# fix for print selected cells functionality.
-calc-print-selected-cells-fix.diff, n#569328, i#109386, kohei
-
 [ LinuxOnly ]
 # accelerate linking, by extreme cunning i#63927
 # this is an increasingly marginal win ...
@@ -3543,7 +3496,6 @@ calc-perf-import-dbf-dbaccess.diff,     n#558505, kohei
 calc-perf-import-dbf-sc.diff,           n#558505, kohei
 
 # Speed up row height data import from ods documents.
-calc-perf-ods-import-row-height.diff, n#582693, kohei
 calc-perf-ods-import-cellstyles.diff, n#582693, kohei
 calc-perf-xls-import-cellstyles.diff, n#582693, kohei
 calc-perf-xls-import-cellstyles-fix.diff, n#594266, kohei
@@ -3552,14 +3504,8 @@ calc-perf-xls-import-cellstyles-fix2.diff, n#594235, kohei
 # Adjust the size of the broadcast slot machine to match the new row limit.
 calc-perf-adjust-slot-machine.diff, n#588554, kohei
 
-# Refactor ScTable::ExtendPrintArea() to make it run faster.
-calc-perf-extend-print-area.diff, i#109935, n#504618, kohei
-
 # Keep track of cells with SUBTOTAL functions the right way.
-calc-subtotal-function-update.diff, n#578802, kohei
-
-# Make ScPrintFunc::CalcPages() run faster.
-calc-perf-print-calc-pages.diff, i#109935, n#504618, kohei
+# FIXME dev300-m77 calc-subtotal-function-update.diff, n#578802, kohei - I believe upstream has a different fix for 3.3.
 
 [ CalcFixes ]
 
diff --git a/patches/dev300/calc-cursor-split-view.diff b/patches/dev300/calc-cursor-split-view.diff
index ec32a88..f4b98bc 100644
--- a/patches/dev300/calc-cursor-split-view.diff
+++ b/patches/dev300/calc-cursor-split-view.diff
@@ -69,7 +69,6 @@ index 02ce8fb..c098da8 100644
 +                aHandleColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor;
              std::vector< basegfx::B2DRange > aRanges;
              const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
-             basegfx::B2DRange aRB(aFillRect.Left(), aFillRect.Top(), aFillRect.Right() + 1, aFillRect.Bottom() + 1);
--- 
-1.7.0.1
+             basegfx::B2DRange aRB(mpAutoFillRect->Left(), mpAutoFillRect->Top(), mpAutoFillRect->Right() + 1, mpAutoFillRect->Bottom() + 1);
+
 
diff --git a/patches/dev300/calc-distributed-cell-text-sc.diff b/patches/dev300/calc-distributed-cell-text-sc.diff
index e0f26d5..9f01ae3 100644
--- a/patches/dev300/calc-distributed-cell-text-sc.diff
+++ b/patches/dev300/calc-distributed-cell-text-sc.diff
@@ -362,14 +362,6 @@ index 2967a27..c3397b6 100644
  #include <com/sun/star/table/TableBorder.hpp>
  #include <com/sun/star/sheet/XSheetConditionalEntries.hpp>
  #include <com/sun/star/sheet/XSheetConditionalEntry.hpp>
-@@ -66,6 +68,7 @@ using namespace ::formula;
- using ::rtl::OUString;
- 
- #define MAP(name,prefix,token,type,context)  { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_010 }
-+#define MAP_LATEST(name,prefix,token,type,context)  { name, sizeof(name)-1, prefix, token, type, context, SvtSaveOptions::ODFVER_LATEST }
- #define MAP_END()	{ NULL, 0, 0, XML_TOKEN_INVALID, 0, 0, SvtSaveOptions::ODFVER_010 }
- 
- const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
 @@ -86,6 +89,7 @@ const XMLPropertyMapEntry aXMLScCellStylesProperties[] =
      MAP( "HoriJustify", XML_NAMESPACE_FO, XML_TEXT_ALIGN, XML_TYPE_PROP_PARAGRAPH|XML_SC_TYPE_HORIJUSTIFY|MID_FLAG_MERGE_PROPERTY, 0 ),
      MAP( "HoriJustify", XML_NAMESPACE_STYLE, XML_TEXT_ALIGN_SOURCE, XML_TYPE_PROP_TABLE_CELL|XML_SC_TYPE_HORIJUSTIFYSOURCE|MID_FLAG_MERGE_PROPERTY, 0 ),
@@ -915,7 +907,7 @@ index 21b7c0c..c0b0d43 100644
          {MAP_CHAR_LEN(SC_UNONAME_SHADOW),	ATTR_SHADOW,		&getCppuType((table::ShadowFormat*)0),	0, 0 | CONVERT_TWIPS },
          {MAP_CHAR_LEN(SC_UNONAME_SHOWBORD), SC_WID_UNO_SHOWBORD,&getBooleanCppuType(),					0, 0 },
          {MAP_CHAR_LEN(SC_UNONAME_SHRINK_TO_FIT), ATTR_SHRINKTOFIT, &getBooleanCppuType(),               0, 0 },
-@@ -768,7 +779,8 @@ const SfxItemPropertySet* lcl_GetSheetPropertySet()
+@@ -768,8 +779,9 @@ const SfxItemPropertySet* lcl_GetSheetPropertySet()
          {MAP_CHAR_LEN(SC_UNONAME_VALIDAT),	SC_WID_UNO_VALIDAT,	&getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
          {MAP_CHAR_LEN(SC_UNONAME_VALILOC),	SC_WID_UNO_VALILOC,	&getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
          {MAP_CHAR_LEN(SC_UNONAME_VALIXML),	SC_WID_UNO_VALIXML,	&getCppuType((uno::Reference<beans::XPropertySet>*)0), 0, 0 },
@@ -923,6 +915,7 @@ index 21b7c0c..c0b0d43 100644
 +        {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS),	ATTR_VER_JUSTIFY,	&getCppuType((sal_Int32*)0), 0, 0 },
 +        {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0),   0, 0 },
          {MAP_CHAR_LEN(SC_UNONAME_WRITING),	ATTR_WRITINGDIR,	&getCppuType((sal_Int16*)0),			0, 0 },
+         {MAP_CHAR_LEN(SC_UNONAME_TABCOLOR), SC_WID_UNO_TABCOLOR, &getCppuType((sal_Int32*)0), 0, 0 },
          {0,0,0,0,0,0}
      };
 diff --git sc/source/ui/unoobj/styleuno.cxx sc/source/ui/unoobj/styleuno.cxx
diff --git a/patches/dev300/calc-find-replace-skip-filtered-sc.diff b/patches/dev300/calc-find-replace-skip-filtered-sc.diff
index 48f249f..0c8e1e6 100644
--- a/patches/dev300/calc-find-replace-skip-filtered-sc.diff
+++ b/patches/dev300/calc-find-replace-skip-filtered-sc.diff
@@ -14,15 +14,17 @@ diff --git sc/inc/table.hxx sc/inc/table.hxx
 index a6609b9..d039590 100644
 --- sc/inc/table.hxx
 +++ sc/inc/table.hxx
-@@ -771,6 +771,8 @@ private:
+@@ -771,8 +771,10 @@ private:
      // also invalidates script type, broadcasts for "calc as shown"
      void        InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* pAdrTo,
                                       BOOL bNumFormatChanged, BOOL bBroadcast );
 +
 +    void        SkipFilteredRows(SCROW& rRow, SCROW& rLastNonFilteredRow, bool bForward);
- };
- 
  
+     /** 
+      * In case the cell text goes beyond the column width, move the max column 
+      * position to the right.  This is called from ExtendPrintArea.
+      */
 diff --git sc/inc/unonames.hxx sc/inc/unonames.hxx
 index 7758265..06fca63 100644
 --- sc/inc/unonames.hxx
diff --git a/patches/dev300/calc-html-csv-import-force-text-cell.diff b/patches/dev300/calc-html-csv-import-force-text-cell.diff
index 89464ac..410c5e2 100644
--- a/patches/dev300/calc-html-csv-import-force-text-cell.diff
+++ b/patches/dev300/calc-html-csv-import-force-text-cell.diff
@@ -24,9 +24,9 @@ index 270acc3..2f11838 100644
  struct ScFunctionData;
  struct ScLineFlags;
  struct ScMergePatternState;
+ class ScFlatBoolRowSegments;
 +struct ScSetStringParam;
  
- 
  #define COLUMN_DELTA	4
 @@ -237,8 +238,7 @@ public:
                  //	TRUE = Zahlformat gesetzt
@@ -42,10 +42,11 @@ diff --git sc/inc/document.hxx sc/inc/document.hxx
 index ffba48d..fff03fe 100644
 --- sc/inc/document.hxx
 +++ sc/inc/document.hxx
-@@ -144,6 +144,7 @@ class SfxUndoManager;
+@@ -144,7 +144,8 @@ class SfxUndoManager;
  class ScFormulaParserPool;
  struct ScClipParam;        
  struct ScClipRangeNameData;
+ class ScRowBreakIterator;
 +struct ScSetStringParam;
  
  namespace com { namespace sun { namespace star {
@@ -110,10 +111,13 @@ diff --git sc/inc/table.hxx sc/inc/table.hxx
 index 0b1228b..a6609b9 100644
 --- sc/inc/table.hxx
 +++ sc/inc/table.hxx
-@@ -73,7 +73,7 @@ struct RowInfo;
+@@ -73,10 +73,10 @@ struct RowInfo;
  struct ScFunctionData;
  struct ScLineFlags;
  class CollatorWrapper;
+ class ScFlatUInt16RowSegments;
+ class ScFlatBoolRowSegments;
+ class ScFlatBoolColSegments;
 -
 +struct ScSetStringParam;
  
diff --git a/patches/dev300/calc-increase-row-limit.diff b/patches/dev300/calc-increase-row-limit.diff
index 3a180d2..63bb309 100644
--- a/patches/dev300/calc-increase-row-limit.diff
+++ b/patches/dev300/calc-increase-row-limit.diff
@@ -1,13 +1,3 @@
-From 5ce407cbdbb818d1f4ef5b84403ed4f2ecf37b3a Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:44 +0200
-Subject: [PATCH 196/768] calc-increase-row-limit.diff
-
----
- sc/inc/address.hxx            |    2 +-
- sc/source/ui/view/hdrcont.cxx |    2 +-
- 2 files changed, 2 insertions(+), 2 deletions(-)
-
 diff --git sc/inc/address.hxx sc/inc/address.hxx
 index 67cb480..6bd785e 100644
 --- sc/inc/address.hxx
@@ -21,19 +11,3 @@ index 67cb480..6bd785e 100644
  #define MAXCOLCOUNT_DEFINE 1024
  
  // Count values
-diff --git sc/source/ui/view/hdrcont.cxx sc/source/ui/view/hdrcont.cxx
-index 830dfa3..ce69872 100644
---- sc/source/ui/view/hdrcont.cxx
-+++ sc/source/ui/view/hdrcont.cxx
-@@ -102,7 +102,7 @@ ScHeaderControl::ScHeaderControl( Window* pParent, SelectionEngine* pSelectionEn
- 
-     nWidth = nSmallWidth = aSize.Width();
-     nBigWidth = LogicToPixel( Size( GetTextWidth(
--        String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("88888")) ), 0 ) ).Width() + 4;
-+        String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("8888888")) ), 0 ) ).Width() + 5;
- 
-     SetBackground();	// sonst Probleme auf OS/2 !?!?!
- }
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-insert-new-sheet-tab-sc.diff b/patches/dev300/calc-insert-new-sheet-tab-sc.diff
index 938555c..3349fcd 100644
--- a/patches/dev300/calc-insert-new-sheet-tab-sc.diff
+++ b/patches/dev300/calc-insert-new-sheet-tab-sc.diff
@@ -21,10 +21,8 @@ index 769969c..a4925e3 100644
              DropTargetHelper( this ),
              DragSourceHelper( this ),
              pViewData( pData ),
--            nMouseClickPageId( TABBAR_PAGE_NOTFOUND ),
--            nSelPageIdByMouse( TABBAR_PAGE_NOTFOUND ),
-+            nMouseClickPageId( TabBar::PAGE_NOT_FOUND ),
-+            nSelPageIdByMouse( TabBar::PAGE_NOT_FOUND ),
+             nMouseClickPageId( TabBar::PAGE_NOT_FOUND ),
+             nSelPageIdByMouse( TabBar::PAGE_NOT_FOUND ),
              bErrorShown( FALSE )
  {
      ScDocument* pDoc = pViewData->GetDocument();
@@ -35,8 +33,7 @@ index 769969c..a4925e3 100644
 -        nMouseClickPageId = GetPageId( rMEvt.GetPosPixel() );
 +        nMouseClickPageId = GetPageId( rMEvt.GetPosPixel(), true );
      else
--        nMouseClickPageId = TABBAR_PAGE_NOTFOUND;
-+        nMouseClickPageId = TabBar::PAGE_NOT_FOUND;
+         nMouseClickPageId = TabBar::PAGE_NOT_FOUND;
  
      TabBar::MouseButtonDown( rMEvt );
  }
@@ -45,9 +42,8 @@ index 769969c..a4925e3 100644
  
      // mouse button down and up on same page?
 -    if( nMouseClickPageId != GetPageId( aPos ) )
--        nMouseClickPageId = TABBAR_PAGE_NOTFOUND;
 +    if( nMouseClickPageId != GetPageId( aPos, true ) )
-+        nMouseClickPageId = TabBar::PAGE_NOT_FOUND;
+         nMouseClickPageId = TabBar::PAGE_NOT_FOUND;
 +
 +    if (nMouseClickPageId == TabBar::INSERT_TAB_POS)
 +    {
@@ -68,48 +64,3 @@ index 769969c..a4925e3 100644
      }
  
      if( nMouseClickPageId == 0 )
-@@ -192,7 +204,7 @@ void ScTabControl::MouseButtonUp( const MouseEvent& rMEvt )
-         SfxDispatcher* pDispatcher = pViewData->GetViewShell()->GetViewFrame()->GetDispatcher();
-         pDispatcher->Execute( nSlot, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD );
-         // forget page ID, to be really sure that the dialog is not called twice
--        nMouseClickPageId = TABBAR_PAGE_NOTFOUND;
-+        nMouseClickPageId = TabBar::PAGE_NOT_FOUND;
-     }
- 
-     TabBar::MouseButtonUp( rMEvt );
-@@ -204,7 +216,7 @@ void ScTabControl::Select()
-     nSelPageIdByMouse = nMouseClickPageId;
-     /*  Reset nMouseClickPageId, so that next Select() call may invalidate
-         nSelPageIdByMouse (i.e. if called from keyboard). */
--    nMouseClickPageId = TABBAR_PAGE_NOTFOUND;
-+    nMouseClickPageId = TabBar::PAGE_NOT_FOUND;
- 
-     ScModule* pScMod = SC_MOD();
-     ScDocument* pDoc = pViewData->GetDocument();
-@@ -390,7 +402,7 @@ void ScTabControl::ActivateView(BOOL bActivate)
- void ScTabControl::SetSheetLayoutRTL( BOOL bSheetRTL )
- {
-     SetEffectiveRTL( bSheetRTL );
--    nSelPageIdByMouse = TABBAR_PAGE_NOTFOUND;
-+    nSelPageIdByMouse = TabBar::PAGE_NOT_FOUND;
- }
- 
- 
-@@ -626,12 +638,12 @@ void ScTabControl::EndRenaming()
- void ScTabControl::Mirror()
- {
-     TabBar::Mirror();
--    if( nSelPageIdByMouse != TABBAR_PAGE_NOTFOUND )
-+    if( nSelPageIdByMouse != TabBar::PAGE_NOT_FOUND )
-     {
-         Rectangle aRect( GetPageRect( GetCurPageId() ) );
-         if( !aRect.IsEmpty() )
-             SetPointerPosPixel( aRect.Center() );
--        nSelPageIdByMouse = TABBAR_PAGE_NOTFOUND;  // only once after a Select()
-+        nSelPageIdByMouse = TabBar::PAGE_NOT_FOUND;  // only once after a Select()
-     }
- }
- 
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-insert-new-sheet-tab-svtools.diff b/patches/dev300/calc-insert-new-sheet-tab-svtools.diff
index 46d294f..3a72f39 100644
--- a/patches/dev300/calc-insert-new-sheet-tab-svtools.diff
+++ b/patches/dev300/calc-insert-new-sheet-tab-svtools.diff
@@ -34,16 +34,6 @@ index 70e7950..36dd938 100644
  #define WB_STDTABBAR        WB_BORDER
  
  // ------------------
-@@ -320,9 +321,6 @@ typedef USHORT TabBarPageBits;
- // - TabBar-Types -
- // ----------------
- 
--#define TABBAR_APPEND          ((USHORT)0xFFFF)
--#define TABBAR_PAGE_NOTFOUND   ((USHORT)0xFFFF)
--
- #define TABBAR_RENAMING_YES    ((long)TRUE)
- #define TABBAR_RENAMING_NO     ((long)FALSE)
- #define TABBAR_RENAMING_CANCEL ((long)2)
 @@ -331,6 +329,7 @@ typedef USHORT TabBarPageBits;
  // - TabBar -
  // ----------
@@ -60,7 +50,7 @@ index 70e7950..36dd938 100644
      Link            maSelectHdl;
      Link            maDoubleClickHdl;
      Link            maSplitHdl;
-@@ -397,9 +397,16 @@ private:
+@@ -397,11 +397,16 @@ private:
      SVT_DLLPRIVATE void			ImplSelect();
      SVT_DLLPRIVATE void			ImplActivatePage();
      SVT_DLLPRIVATE long			ImplDeactivatePage();
@@ -70,22 +60,13 @@ index 70e7950..36dd938 100644
                      DECL_DLLPRIVATE_LINK( ImplClickHdl, ImplTabButton* );
  
  public:
-+    static const USHORT APPEND;
-+    static const USHORT PAGE_NOT_FOUND;
-+    static const USHORT INSERT_TAB_POS;
+     static const sal_uInt16 APPEND;
+     static const sal_uInt16 PAGE_NOT_FOUND;
++    static const sal_uInt16 INSERT_TAB_POS;
 +
                      TabBar( Window* pParent, WinBits nWinStyle = WB_STDTABBAR );
      virtual         ~TabBar();
  
-@@ -424,7 +431,7 @@ public:
- 
-     void            InsertPage( USHORT nPageId, const XubString& rText,
-                                 TabBarPageBits nBits = 0,
--                                USHORT nPos = TABBAR_APPEND );
-+                                USHORT nPos = TabBar::APPEND );
-     void            RemovePage( USHORT nPageId );
-     void            MovePage( USHORT nPageId, USHORT nNewPos );
- 
 @@ -443,7 +450,7 @@ public:
      USHORT          GetPageCount() const;
      USHORT          GetPageId( USHORT nPos ) const;
@@ -95,15 +76,6 @@ index 70e7950..36dd938 100644
      Rectangle       GetPageRect( USHORT nPageId ) const;
      // returns the rectangle in which page tabs are drawn
      Rectangle		GetPageArea() const;
-@@ -458,7 +465,7 @@ public:
-     void            SelectPage( USHORT nPageId, BOOL bSelect = TRUE );
-     void            SelectPageRange( BOOL bSelect = FALSE,
-                                      USHORT nStartPos = 0,
--                                     USHORT nEndPos = TABBAR_APPEND );
-+                                     USHORT nEndPos = TabBar::APPEND );
-     USHORT          GetSelectPage( USHORT nSelIndex = 0 ) const;
-     USHORT          GetSelectPageCount() const;
-     BOOL            IsPageSelected( USHORT nPageId ) const;
 diff --git svtools/source/control/tabbar.cxx svtools/source/control/tabbar.cxx
 index 72a7f80..efb9cd3 100644
 --- svtools/source/control/tabbar.cxx
diff --git a/patches/dev300/calc-odf-export-autostyle-maxrow.diff b/patches/dev300/calc-odf-export-autostyle-maxrow.diff
deleted file mode 100644
index 51ae0d7..0000000
--- a/patches/dev300/calc-odf-export-autostyle-maxrow.diff
+++ /dev/null
@@ -1,25 +0,0 @@
-From 8fda197a40c76c9852cc1822dd9b2e49f0454bae Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:45 +0200
-Subject: [PATCH 197/768] calc-odf-export-autostyle-maxrow.diff
-
----
- sc/source/filter/xml/xmlexprt.cxx |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx
-index c217c79..b8f4b3e 100644
---- sc/source/filter/xml/xmlexprt.cxx
-+++ sc/source/filter/xml/xmlexprt.cxx
-@@ -2612,7 +2612,7 @@ void ScXMLExport::_ExportAutoStyles()
-                                         else
-                                             pRowStyles->AddNewTable(nTable, nRows);
-                                         sal_Int32 nRow = 0;
--                                        while ( /*nRow <= nRows && */nRow <= MAXROW)
-+                                        while (nRow <= nRows && nRow <= MAXROW)
-                                         {
-                                             sal_Int32 nIndex = 0;
-                                             uno::Reference <beans::XPropertySet> xRowProperties(xTableRows->getByIndex(nRow), uno::UNO_QUERY);
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-ods-export-no-more-ushort.diff b/patches/dev300/calc-ods-export-no-more-ushort.diff
deleted file mode 100644
index cb1f0d6..0000000
--- a/patches/dev300/calc-ods-export-no-more-ushort.diff
+++ /dev/null
@@ -1,34 +0,0 @@
-From 8b6be6d8f0602bd8c897a0c09ec2c75c5dfdee10 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:53 +0200
-Subject: [PATCH 203/768] calc-ods-export-no-more-ushort.diff
-
----
- sc/source/filter/xml/xmlexprt.cxx |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx
-index a0c0580..0cb0f63 100644
---- sc/source/filter/xml/xmlexprt.cxx
-+++ sc/source/filter/xml/xmlexprt.cxx
-@@ -2585,7 +2585,7 @@ void ScXMLExport::_ExportAutoStyles()
-                                                 pColumnStyles->AddFieldStyleName(nTable, nColumn, nIndex, bIsVisible);
-                                             }
-                                             sal_Int32 nOld(nColumn);
--                                            nColumn = pDoc->GetNextDifferentChangedCol(sal::static_int_cast<SCTAB>(nTable), static_cast<USHORT>(nColumn));
-+                                            nColumn = pDoc->GetNextDifferentChangedCol(sal::static_int_cast<SCTAB>(nTable), static_cast<SCCOL>(nColumn));
-                                             for (sal_Int32 i = nOld + 1; i < nColumn; ++i)
-                                                 pColumnStyles->AddFieldStyleName(nTable, i, nIndex, bIsVisible);
-                                         }
-@@ -2624,7 +2624,7 @@ void ScXMLExport::_ExportAutoStyles()
-                                                 pRowStyles->AddFieldStyleName(nTable, nRow, nIndex);
-                                             }
-                                             sal_Int32 nOld(nRow);
--                                            nRow = pDoc->GetNextDifferentChangedRow(sal::static_int_cast<SCTAB>(nTable), static_cast<USHORT>(nRow), false);
-+                                            nRow = pDoc->GetNextDifferentChangedRow(sal::static_int_cast<SCTAB>(nTable), static_cast<SCROW>(nRow), false);
-                                             for (sal_Int32 i = nOld + 1; i < nRow; ++i)
-                                                 pRowStyles->AddFieldStyleName(nTable, i, nIndex);
-                                         }
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-ods-sheet-protection-sc.diff b/patches/dev300/calc-ods-sheet-protection-sc.diff
index 78246f4..23aec44 100644
--- a/patches/dev300/calc-ods-sheet-protection-sc.diff
+++ b/patches/dev300/calc-ods-sheet-protection-sc.diff
@@ -1,24 +1,3 @@
-From bfb9dbb75ff888f34cdfa9fb64583871c1cdc075 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:08 +0200
-Subject: [PATCH 168/768] calc-ods-sheet-protection-sc.diff
-
----
- sc/inc/tabprotection.hxx                |   42 +++++---
- sc/source/core/data/tabprotection.cxx   |  169 ++++++++++++++++++++++++-------
- sc/source/filter/xml/xmlbodyi.cxx       |    8 ++-
- sc/source/filter/xml/xmlbodyi.hxx       |    4 +
- sc/source/filter/xml/xmlexprt.cxx       |   78 +++++++++++++-
- sc/source/filter/xml/xmlimprt.cxx       |   23 ++++-
- sc/source/filter/xml/xmlimprt.hxx       |   13 ++-
- sc/source/filter/xml/xmlsubti.cxx       |   27 ++++--
- sc/source/filter/xml/xmlsubti.hxx       |   19 +++-
- sc/source/filter/xml/xmltabi.cxx        |   85 ++++++++++++++--
- sc/source/filter/xml/xmltabi.hxx        |   22 ++++
- sc/source/ui/docshell/docsh.cxx         |    9 ++-
- sc/source/ui/miscdlgs/retypepassdlg.cxx |    2 +-
- 13 files changed, 417 insertions(+), 84 deletions(-)
-
 diff --git sc/inc/tabprotection.hxx sc/inc/tabprotection.hxx
 index 965ea30..4c87b6d 100644
 --- sc/inc/tabprotection.hxx
@@ -493,10 +472,10 @@ index e279431..fa3c29b 100644
      sal_Bool        bHadCalculationSettings;
  
 diff --git sc/source/filter/xml/xmlexprt.cxx sc/source/filter/xml/xmlexprt.cxx
-index be873cc..c217c79 100644
+index 70c35b3..395e57f 100644
 --- sc/source/filter/xml/xmlexprt.cxx
 +++ sc/source/filter/xml/xmlexprt.cxx
-@@ -1514,12 +1514,36 @@ void ScXMLExport::SetBodyAttributes()
+@@ -1517,12 +1517,36 @@ void ScXMLExport::SetBodyAttributes()
          AddAttribute(XML_NAMESPACE_TABLE, XML_STRUCTURE_PROTECTED, XML_TRUE);
          rtl::OUStringBuffer aBuffer;
          uno::Sequence<sal_Int8> aPassHash;
@@ -534,21 +513,21 @@ index be873cc..c217c79 100644
      }
  }
  
-@@ -1720,18 +1744,46 @@ void ScXMLExport::_ExportContent()
-                     AddAttribute(sAttrName, sOUTableName);
-                     AddAttribute(sAttrStyleName, aTableStyles[nTable]);
-                     uno::Reference<util::XProtectable> xProtectable (xTable, uno::UNO_QUERY);
+@@ -1722,18 +1746,46 @@ void ScXMLExport::_ExportContent()
+                         AddAttribute(sAttrStyleName, aTableStyles[nTable]);
+ 
+                         uno::Reference<util::XProtectable> xProtectable (xTable, uno::UNO_QUERY);
 +                    ScTableProtection* pProtect = NULL;
-                     if (xProtectable.is() && xProtectable->isProtected())
-                     {
-                         AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE);
--                        rtl::OUStringBuffer aBuffer;
-                         if (pDoc)
+                         if (xProtectable.is() && xProtectable->isProtected())
                          {
--                            ScTableProtection* pProtect = pDoc->GetTabProtection(static_cast<SCTAB>(nTable));
+                             AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTED, XML_TRUE);
+-                            rtl::OUStringBuffer aBuffer;
+                             if (pDoc)
+                             {
+-                                ScTableProtection* pProtect = pDoc->GetTabProtection(static_cast<SCTAB>(nTable));
 +                            pProtect = pDoc->GetTabProtection(static_cast<SCTAB>(nTable));
-                             if (pProtect)
--                                SvXMLUnitConverter::encodeBase64(aBuffer, pProtect->getPasswordHash(PASSHASH_OOO));
+                                 if (pProtect)
+-                                    SvXMLUnitConverter::encodeBase64(aBuffer, pProtect->getPasswordHash(PASSHASH_OOO));
 +                            {
 +                                rtl::OUStringBuffer aBuffer;
 +                                ScPasswordHash eHashUsed = PASSHASH_UNSPECIFIED;
@@ -580,16 +559,16 @@ index be873cc..c217c79 100644
 +
 +                                }
 +                            }
+                             }
+-                            if (aBuffer.getLength())
+-                                AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
                          }
--                        if (aBuffer.getLength())
--                            AddAttribute(XML_NAMESPACE_TABLE, XML_PROTECTION_KEY, aBuffer.makeStringAndClear());
-                     }
-                     rtl::OUString sPrintRanges;
-                     table::CellRangeAddress aColumnHeaderRange;
-@@ -1742,6 +1794,20 @@ void ScXMLExport::_ExportContent()
-                     else if (!pDoc->IsPrintEntireSheet(static_cast<SCTAB>(nTable)))
-                         AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT, XML_FALSE);
-                     SvXMLElementExport aElemT(*this, sElemTab, sal_True, sal_True);
+                         rtl::OUString sPrintRanges;
+                         table::CellRangeAddress aColumnHeaderRange;
+@@ -1744,6 +1796,20 @@ void ScXMLExport::_ExportContent()
+                         else if (!pDoc->IsPrintEntireSheet(static_cast<SCTAB>(nTable)))
+                             AddAttribute( XML_NAMESPACE_TABLE, XML_PRINT, XML_FALSE);
+                         SvXMLElementExport aElemT(*this, sElemTab, sal_True, sal_True);
 +
 +                    if (pProtect && pProtect->isProtected())
 +                    {
@@ -604,11 +583,11 @@ index be873cc..c217c79 100644
 +                        SvXMLElementExport aElemProtected(*this, aElemName, true, true);
 +                    }
 +
-                     CheckAttrList();
-                     WriteTableSource();
-                     WriteScenario();
+                         CheckAttrList();
+                         WriteTableSource();
+                         WriteScenario();
 diff --git sc/source/filter/xml/xmlimprt.cxx sc/source/filter/xml/xmlimprt.cxx
-index e2eb196..5495cf1 100644
+index dc5b6a6..ed8585f 100644
 --- sc/source/filter/xml/xmlimprt.cxx
 +++ sc/source/filter/xml/xmlimprt.cxx
 @@ -637,6 +637,7 @@ const SvXMLTokenMap& ScXMLImport::GetTableElemTokenMap()
@@ -644,15 +623,15 @@ index e2eb196..5495cf1 100644
      if( !pTableRowsElemTokenMap )
 @@ -700,9 +717,11 @@ const SvXMLTokenMap& ScXMLImport::GetTableAttrTokenMap()
          {
-             { XML_NAMESPACE_TABLE, XML_NAME,						XML_TOK_TABLE_NAME				},
-             { XML_NAMESPACE_TABLE, XML_STYLE_NAME,					XML_TOK_TABLE_STYLE_NAME		},
--            { XML_NAMESPACE_TABLE, XML_PROTECTED,					XML_TOK_TABLE_PROTECTION		},
+             { XML_NAMESPACE_TABLE,     XML_NAME,           XML_TOK_TABLE_NAME          },
+             { XML_NAMESPACE_TABLE,     XML_STYLE_NAME,     XML_TOK_TABLE_STYLE_NAME    },
+-            { XML_NAMESPACE_TABLE,     XML_PROTECTED,      XML_TOK_TABLE_PROTECTION    },
 +            { XML_NAMESPACE_TABLE, XML_PROTECTED,                   XML_TOK_TABLE_PROTECTED         },
-             { XML_NAMESPACE_TABLE, XML_PRINT_RANGES,				XML_TOK_TABLE_PRINT_RANGES		},
-             { XML_NAMESPACE_TABLE, XML_PROTECTION_KEY,				XML_TOK_TABLE_PASSWORD			},
+             { XML_NAMESPACE_TABLE,     XML_PRINT_RANGES,   XML_TOK_TABLE_PRINT_RANGES  },
+             { XML_NAMESPACE_TABLE,     XML_PROTECTION_KEY, XML_TOK_TABLE_PASSWORD      },
 +            { XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM, XML_TOK_TABLE_PASSHASH      },
 +            { XML_NAMESPACE_TABLE, XML_PROTECTION_KEY_DIGEST_ALGORITHM_2, XML_TOK_TABLE_PASSHASH_2  },
-             { XML_NAMESPACE_TABLE, XML_PRINT,               		XML_TOK_TABLE_PRINT             },
+             { XML_NAMESPACE_TABLE,     XML_PRINT,          XML_TOK_TABLE_PRINT         },
              XML_TOKEN_MAP_END
          };
 @@ -1662,6 +1681,7 @@ ScXMLImport::ScXMLImport(
@@ -1051,6 +1030,3 @@ index 02a7c01..0f237de 100644
  {
      Init();
  }
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-perf-copy-table-flags.diff b/patches/dev300/calc-perf-copy-table-flags.diff
deleted file mode 100644
index f8d1e0c..0000000
--- a/patches/dev300/calc-perf-copy-table-flags.diff
+++ /dev/null
@@ -1,121 +0,0 @@
-From 14653bb3b34c91101914fc0587be21b2ed5971f9 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:56 +0200
-Subject: [PATCH 206/768] calc-perf-copy-table-flags.diff
-
----
- sc/source/core/data/table2.cxx |   68 +++++++++++++++++++++++++++++----------
- 1 files changed, 50 insertions(+), 18 deletions(-)
-
-diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
-index 14e6aef..38efefb 100644
---- sc/source/core/data/table2.cxx
-+++ sc/source/core/data/table2.cxx
-@@ -653,6 +653,8 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-             //	Charts muessen beim Ein-/Ausblenden angepasst werden
-             ScChartListenerCollection* pCharts = pDestTab->pDocument->GetChartListenerCollection();
- 
-+            bool bFlagChange = false;
-+
-             BOOL bWidth  = (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth);
-             BOOL bHeight = (nCol1==0 && nCol2==MAXCOL && pRowHeight && pDestTab->pRowHeight);
- 
-@@ -663,18 +665,18 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-                 if (bWidth)
-                     for (SCCOL i=nCol1; i<=nCol2; i++)
-                     {
--                    bool bThisHidden = ColHidden(i);
--                    bool bHiddenChange = (pDestTab->ColHidden(i) != bThisHidden);
-+                        bool bThisHidden = ColHidden(i);
-+                        bool bHiddenChange = (pDestTab->ColHidden(i) != bThisHidden);
-                         bool bChange = bHiddenChange || (pDestTab->pColWidth[i] != pColWidth[i]);
-                         pDestTab->pColWidth[i] = pColWidth[i];
-                         pDestTab->pColFlags[i] = pColFlags[i];
--                    pDestTab->SetColHidden(i, i, bThisHidden);
-+                        pDestTab->SetColHidden(i, i, bThisHidden);
-                         //!	Aenderungen zusammenfassen?
-                         if (bHiddenChange && pCharts)
-                             pCharts->SetRangeDirty(ScRange( i, 0, nTab, i, MAXROW, nTab ));
- 
-                         if (bChange)
--                            pDestTab->InvalidatePageBreaks();
-+                            bFlagChange = true;
-                     }
- 
-                 if (bHeight)
-@@ -682,28 +684,58 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-                     bool bChange = pDestTab->pRowHeight->SumValues(nRow1, nRow2) != pRowHeight->SumValues(nRow1, nRow2);
- 
-                     if (bChange)
--                        pDestTab->InvalidatePageBreaks();
-+                        bFlagChange = true;
- 
-                     pDestTab->pRowHeight->CopyFrom( *pRowHeight, nRow1, nRow2);
--                    for (SCROW i=nRow1; i<=nRow2; i++)
-+                    pDestTab->pRowFlags->CopyFrom(*pRowFlags, nRow1, nRow2);
-+
-+                    // Hidden flags.
-+                    for (SCROW i = nRow1; i <= nRow2; ++i)
-                     {
--                        // TODO: might need some performance improvement, block
--                        // operations instead of single GetValue()/SetValue() calls.
--                        BYTE nThisRowFlags = pRowFlags->GetValue(i);
--                    bool bThisHidden = RowHidden(i);
--                    bool bHiddenChange = (pDestTab->RowHidden(i) != bThisHidden);
--                        pDestTab->pRowFlags->SetValue( i, nThisRowFlags );
--                    pDestTab->SetRowHidden(i, i, bThisHidden);
--                        //!	Aenderungen zusammenfassen?
--                        if (bHiddenChange && pCharts)
--                            pCharts->SetRangeDirty(ScRange( 0, i, nTab, MAXCOL, i, nTab ));
-+                        SCROW nThisLastRow, nDestLastRow;
-+                        bool bThisHidden = RowHidden(i, NULL, &nThisLastRow);
-+                        bool bDestHidden = pDestTab->RowHidden(i, NULL, &nDestLastRow);
- 
--                        if (bHiddenChange)
--                            pDestTab->InvalidatePageBreaks();
-+                        // If the segment sizes differ, we take the shorter segment of the two.
-+                        SCROW nLastRow = ::std::min(nThisLastRow, nDestLastRow);
-+                        if (nLastRow >= nRow2)
-+                            // the last row shouldn't exceed the upper bound the caller specified.
-+                            nLastRow = nRow2;
-+
-+                        pDestTab->SetRowHidden(i, nLastRow, bThisHidden);
-+
-+                        bool bThisHiddenChange = (bThisHidden != bDestHidden);
-+                        if (bThisHiddenChange && pCharts)
-+                        {
-+                            // Hidden flags differ.
-+                            pCharts->SetRangeDirty(ScRange(0, i, nTab, MAXCOL, nLastRow, nTab));
-+                        }
-+
-+                        if (bThisHiddenChange)
-+                            bFlagChange = true;
-+
-+                        // Jump to the last row of the identical flag segment.
-+                        i = nLastRow;
-+                    }
-+
-+                    // Filtered flags.
-+                    for (SCROW i = nRow1; i <= nRow2; ++i)
-+                    {
-+                        SCROW nLastRow;
-+                        bool bFiltered = RowFiltered(i, NULL, &nLastRow);
-+                        if (nLastRow >= nRow2)
-+                            // the last row shouldn't exceed the upper bound the caller specified.
-+                            nLastRow = nRow2;
-+                        pDestTab->SetRowFiltered(i, nLastRow, bFiltered);
-+                        i = nLastRow;
-                     }
-                 }
-                 pDestTab->DecRecalcLevel();
-             }
-+
-+            if (bFlagChange)
-+                pDestTab->InvalidatePageBreaks();
-+
-             pDestTab->SetOutlineTable( pOutlineTable );		// auch nur wenn bColRowFlags
-         }
-     }
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-perf-extend-print-area.diff b/patches/dev300/calc-perf-extend-print-area.diff
deleted file mode 100644
index e4d20ef..0000000
--- a/patches/dev300/calc-perf-extend-print-area.diff
+++ /dev/null
@@ -1,422 +0,0 @@
-From eb25ab3daf9a09084fd7c4195bfc2f8ba6a8e73c Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:07:53 +0200
-Subject: [PATCH 690/768] calc-perf-extend-print-area.diff
-
----
- sc/inc/document.hxx             |    5 +
- sc/inc/table.hxx                |   49 +++++++
- sc/source/core/data/column2.cxx |    4 +-
- sc/source/core/data/table1.cxx  |  284 +++++++++++++++++++++++++++++----------
- 4 files changed, 268 insertions(+), 74 deletions(-)
-
-diff --git sc/inc/document.hxx sc/inc/document.hxx
-index f5d530c..65c695b 100644
---- sc/inc/document.hxx
-+++ sc/inc/document.hxx
-@@ -929,6 +929,11 @@ public:
- 
-     SC_DLLPUBLIC BOOL			GetDataStart( SCTAB nTab, SCCOL& rStartCol, SCROW& rStartRow ) const;
- 
-+    /**
-+     * Find the maximum column position that contains printable data for the
-+     * specified row range.  The final column position must be equal or less
-+     * than the initial value of rEndCol.
-+     */
-     void			ExtendPrintArea( OutputDevice* pDev, SCTAB nTab,
-                                     SCCOL nStartCol, SCROW nStartRow,
-                                     SCCOL& rEndCol, SCROW nEndRow );
-diff --git sc/inc/table.hxx sc/inc/table.hxx
-index 8fe9ed1..c7611da 100644
---- sc/inc/table.hxx
-+++ sc/inc/table.hxx
-@@ -873,6 +873,55 @@ private:
-                                      BOOL bNumFormatChanged, BOOL bBroadcast );
- 
-     void        SkipFilteredRows(SCROW& rRow, SCROW& rLastNonFilteredRow, bool bForward);
-+
-+    /**
-+     * In case the cell text goes beyond the column width, move the max column
-+     * position to the right.  This is called from ExtendPrintArea.
-+     */
-+    void        MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY);
-+
-+    /**
-+     * Use this to iterate through non-empty visible cells in a single column.
-+     */
-+    class VisibleDataCellIterator
-+    {
-+    public:
-+        static SCROW ROW_NOT_FOUND;
-+
-+        explicit VisibleDataCellIterator(ScFlatBoolRowSegments& rRowSegs, ScColumn& rColumn);
-+        ~VisibleDataCellIterator();
-+
-+        /**
-+         * Set the start row position.  In case there is not visible data cell
-+         * at the specified row position, it will move to the position of the
-+         * first visible data cell below that point.
-+         *
-+         * @return First visible data cell if found, or NULL otherwise.
-+         */
-+        ScBaseCell* reset(SCROW nRow);
-+
-+        /**
-+         * Find the next visible data cell position.
-+         *
-+         * @return Next visible data cell if found, or NULL otherwise.
-+         */
-+        ScBaseCell* next();
-+
-+        /**
-+         * Get the current row position.
-+         *
-+         * @return Current row position, or ROW_NOT_FOUND if the iterator
-+         *         doesn't point to a valid data cell position.
-+         */
-+        SCROW getRow() const;
-+
-+    private:
-+        ScFlatBoolRowSegments& mrRowSegs;
-+        ScColumn& mrColumn;
-+        ScBaseCell* mpCell;
-+        SCROW mnCurRow;
-+        SCROW mnUBound;
-+    };
- };
- 
- 
-diff --git sc/source/core/data/column2.cxx sc/source/core/data/column2.cxx
-index 40554a7..bfcf846 100644
---- sc/source/core/data/column2.cxx
-+++ sc/source/core/data/column2.cxx
-@@ -1438,11 +1438,11 @@ BOOL ScColumn::GetPrevDataPos(SCROW& rRow) const
-     return bFound;
- }
- 
--BOOL ScColumn::GetNextDataPos(SCROW& rRow) const		// groesser als rRow
-+BOOL ScColumn::GetNextDataPos(SCROW& rRow) const		// greater than rRow
- {
-     SCSIZE nIndex;
-     if (Search( rRow, nIndex ))
--        ++nIndex;					// naechste Zelle
-+        ++nIndex;					// next cell
- 
-     BOOL bMore = ( nIndex < nCount );
-     if ( bMore )
-diff --git sc/source/core/data/table1.cxx sc/source/core/data/table1.cxx
-index 510d650..4b4f492 100644
---- sc/source/core/data/table1.cxx
-+++ sc/source/core/data/table1.cxx
-@@ -1440,88 +1440,131 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev,
-     double nPPTX = aPix1000.X() / 1000.0;
-     double nPPTY = aPix1000.Y() / 1000.0;
- 
--    BOOL bEmpty[MAXCOLCOUNT];
--    for (SCCOL i=0; i<=MAXCOL; i++)
--        bEmpty[i] = ( aCol[i].GetCellCount() == 0 );
-+    // First, mark those columns that we need to skip i.e. hidden and empty columns.
- 
--    SCSIZE nIndex;
--    SCCOL nPrintCol = rEndCol;
--    for (SCROW nRow = nStartRow; nRow<=nEndRow; nRow++)
-+    ScFlatBoolColSegments aSkipCols;
-+    aSkipCols.setInsertFromBack(true); // speed optimazation.
-+    aSkipCols.setFalse(0, MAXCOL);
-+    for (SCCOL i = 0; i <= MAXCOL; ++i)
-     {
--        if (!RowHidden(nRow))
-+        SCCOL nLastCol = i;
-+        if (ColHidden(i, NULL, &nLastCol))
-+        {
-+            // Columns are hidden in this range.
-+            aSkipCols.setTrue(i, nLastCol);
-+        }
-+        else
-         {
--            SCCOL nDataCol = rEndCol;
--            while (nDataCol > 0 && ( bEmpty[nDataCol] || !aCol[nDataCol].Search(nRow,nIndex) ) )
--                --nDataCol;
--            if (!ColHidden(nDataCol))
-+            // These columns are visible.  Check for empty columns.
-+            for (SCCOL j = i; j <= nLastCol; ++j)
-             {
--                ScBaseCell* pCell = aCol[nDataCol].GetCell(nRow);
--                if (pCell)
--                {
--                    CellType eType = pCell->GetCellType();
--                    if (eType == CELLTYPE_STRING || eType == CELLTYPE_EDIT
--                        || (eType == CELLTYPE_FORMULA && !((ScFormulaCell*)pCell)->IsValue()) )
--                    {
--                        BOOL bFormula = FALSE;	//! uebergeben
--                        long nPixel = pCell->GetTextWidth();
--
--                        // Breite bereits im Idle-Handler berechnet?
--                        if ( TEXTWIDTH_DIRTY == nPixel )
--                        {
--                            ScNeededSizeOptions aOptions;
--                            aOptions.bTotalSize	 = TRUE;
--                            aOptions.bFormula	 = bFormula;
--                            aOptions.bSkipMerged = FALSE;
--
--                            Fraction aZoom(1,1);
--                            nPixel = aCol[nDataCol].GetNeededSize( nRow,
--                                                        pDev,nPPTX,nPPTY,aZoom,aZoom,
--                                                        TRUE, aOptions );
--                            pCell->SetTextWidth( (USHORT)nPixel );
--                        }
-+                if (aCol[j].GetCellCount() == 0)
-+                    // empty
-+                    aSkipCols.setTrue(j,j);
-+            }
-+        }
-+        i = nLastCol;
-+    }
- 
--                        long nTwips = (long) (nPixel / nPPTX);
--                        long nDocW = GetColWidth( nDataCol );
-+    ScFlatBoolColSegments::RangeData aColData;
-+    for (SCCOL nCol = rEndCol; nCol >= 0; --nCol)
-+    {
-+        if (!aSkipCols.getRangeData(nCol, aColData))
-+            // Failed to get the data.  This should never happen!
-+            return;
- 
--                        long nMissing = nTwips - nDocW;
--                        if ( nMissing > 0 )
--                        {
--                            //	look at alignment
--
--                            const ScPatternAttr* pPattern = GetPattern( nDataCol, nRow );
--                            const SfxItemSet* pCondSet = NULL;
--                            if ( ((const SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue() )
--                                pCondSet = pDocument->GetCondResult( nDataCol, nRow, nTab );
--
--                            SvxCellHorJustify eHorJust = (SvxCellHorJustify)((const SvxHorJustifyItem&)
--                                            pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue();
--                            if ( eHorJust == SVX_HOR_JUSTIFY_CENTER )
--                                nMissing /= 2;							// distributed into both directions
--                            else
--                            {
--                                // STANDARD is LEFT (only text is handled here)
--                                BOOL bRight = ( eHorJust == SVX_HOR_JUSTIFY_RIGHT );
--                                if ( IsLayoutRTL() )
--                                    bRight = !bRight;
--                                if ( bRight )
--                                    nMissing = 0;		// extended only to the left (logical)
--                            }
--                        }
-+        if (aColData.mbValue)
-+        {
-+            // Skip these columns.
-+            nCol = aColData.mnCol1; // move toward 0.
-+            continue;
-+        }
- 
--                        SCCOL nCol = nDataCol;
--                        while (nMissing > 0 && nCol < MAXCOL)
--                        {
--                            ++nCol;
--                            nMissing -= GetColWidth( nCol );
--                        }
--                        if (nCol>nPrintCol)
--                            nPrintCol = nCol;
--                    }
--                }
-+        // These are visible and non-empty columns.
-+        for (SCCOL nDataCol = nCol; 0 <= nDataCol && nDataCol >= aColData.mnCol1; --nDataCol)
-+        {
-+            SCCOL nPrintCol = nDataCol;
-+            VisibleDataCellIterator aIter(*mpHiddenRows, aCol[nDataCol]);
-+            ScBaseCell* pCell = aIter.reset(nStartRow);
-+            if (!pCell)
-+                // No visible cells found in this column.  Skip it.
-+                continue;
-+
-+            while (pCell)
-+            {
-+                SCCOL nNewCol = nDataCol;
-+                SCROW nRow = aIter.getRow();
-+                MaybeAddExtraColumn(nNewCol, nRow, pDev, nPPTX, nPPTY);
-+                if (nNewCol > nPrintCol)
-+                    nPrintCol = nNewCol;
-+                pCell = aIter.next();
-             }
-+
-+            rEndCol = nPrintCol;
-+            return;
-         }
-+        nCol = aColData.mnCol1; // move toward 0.
-     }
--    rEndCol = nPrintCol;
-+}
-+
-+void ScTable::MaybeAddExtraColumn(SCCOL& rCol, SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY)
-+{
-+    ScBaseCell* pCell = aCol[rCol].GetCell(nRow);
-+    if (!pCell || !pCell->HasStringData())
-+        return;
-+
-+    bool bFormula = false;  //! ueberge
-+    long nPixel = pCell->GetTextWidth();
-+
-+    // Breite bereits im Idle-Handler berechnet?
-+    if ( TEXTWIDTH_DIRTY == nPixel )
-+    {
-+        ScNeededSizeOptions aOptions;
-+        aOptions.bTotalSize  = TRUE;
-+        aOptions.bFormula    = bFormula;
-+        aOptions.bSkipMerged = FALSE;
-+
-+        Fraction aZoom(1,1);
-+        nPixel = aCol[rCol].GetNeededSize(
-+            nRow, pDev, nPPTX, nPPTY, aZoom, aZoom, true, aOptions );
-+        pCell->SetTextWidth( (USHORT)nPixel );
-+    }
-+
-+    long nTwips = (long) (nPixel / nPPTX);
-+    long nDocW = GetColWidth( rCol );
-+
-+    long nMissing = nTwips - nDocW;
-+    if ( nMissing > 0 )
-+    {
-+        //  look at alignment
-+
-+        const ScPatternAttr* pPattern = GetPattern( rCol, nRow );
-+        const SfxItemSet* pCondSet = NULL;
-+        if ( ((const SfxUInt32Item&)pPattern->GetItem(ATTR_CONDITIONAL)).GetValue() )
-+            pCondSet = pDocument->GetCondResult( rCol, nRow, nTab );
-+
-+        SvxCellHorJustify eHorJust = (SvxCellHorJustify)((const SvxHorJustifyItem&)
-+                        pPattern->GetItem( ATTR_HOR_JUSTIFY, pCondSet )).GetValue();
-+        if ( eHorJust == SVX_HOR_JUSTIFY_CENTER )
-+            nMissing /= 2;                          // distributed into both directions
-+        else
-+        {
-+            // STANDARD is LEFT (only text is handled here)
-+            bool bRight = ( eHorJust == SVX_HOR_JUSTIFY_RIGHT );
-+            if ( IsLayoutRTL() )
-+                bRight = !bRight;
-+            if ( bRight )
-+                nMissing = 0;       // extended only to the left (logical)
-+        }
-+    }
-+
-+    SCCOL nNewCol = rCol;
-+    while (nMissing > 0 && nNewCol < MAXCOL)
-+    {
-+        ++nNewCol;
-+        nMissing -= GetColWidth(nNewCol);
-+    }
-+    rCol = nNewCol;
- }
- 
- void ScTable::DoColResize( SCCOL nCol1, SCCOL nCol2, SCSIZE nAdd )
-@@ -1612,7 +1655,104 @@ void ScTable::RestorePrintRanges( const ScPrintSaverTab& rSaveTab )
-     UpdatePageBreaks(NULL);
- }
- 
-+SCROW ScTable::VisibleDataCellIterator::ROW_NOT_FOUND = -1;
-+
-+ScTable::VisibleDataCellIterator::VisibleDataCellIterator(ScFlatBoolRowSegments& rRowSegs, ScColumn& rColumn) :
-+    mrRowSegs(rRowSegs),
-+    mrColumn(rColumn),
-+    mpCell(NULL),
-+    mnCurRow(ROW_NOT_FOUND),
-+    mnUBound(ROW_NOT_FOUND)
-+{
-+}
- 
-+ScTable::VisibleDataCellIterator::~VisibleDataCellIterator()
-+{
-+}
-+
-+ScBaseCell* ScTable::VisibleDataCellIterator::reset(SCROW nRow)
-+{
-+    if (nRow > MAXROW)
-+    {
-+        mnCurRow = ROW_NOT_FOUND;
-+        return NULL;
-+    }
- 
-+    ScFlatBoolRowSegments::RangeData aData;
-+    if (!mrRowSegs.getRangeData(nRow, aData))
-+    {
-+        mnCurRow = ROW_NOT_FOUND;
-+        return NULL;
-+    }
-+
-+    if (!aData.mbValue)
-+    {
-+        // specified row is visible.  Take it.
-+        mnCurRow = nRow;
-+        mnUBound = aData.mnRow2;
-+    }
-+    else
-+    {
-+        // specified row is not-visible.  The first visible row is the start of
-+        // the next segment.
-+        mnCurRow = aData.mnRow2 + 1;
-+        mnUBound = mnCurRow; // get range data on the next iteration.
-+        if (mnCurRow > MAXROW)
-+        {
-+            // Make sure the row doesn't exceed our current limit.
-+            mnCurRow = ROW_NOT_FOUND;
-+            return NULL;
-+        }
-+    }
- 
-+    mpCell = mrColumn.GetCell(mnCurRow);
-+    if (mpCell)
-+        // First visible cell found.
-+        return mpCell;
-+
-+    // Find a first visible cell below this row (if any).
-+    return next();
-+}
-+
-+ScBaseCell* ScTable::VisibleDataCellIterator::next()
-+{
-+    if (mnCurRow == ROW_NOT_FOUND)
-+        return NULL;
-+
-+    while (mrColumn.GetNextDataPos(mnCurRow))
-+    {
-+        if (mnCurRow > mnUBound)
-+        {
-+            // We don't know the visibility of this row range.  Query it.
-+            ScFlatBoolRowSegments::RangeData aData;
-+            if (!mrRowSegs.getRangeData(mnCurRow, aData))
-+            {
-+                mnCurRow = ROW_NOT_FOUND;
-+                return NULL;
-+            }
-+
-+            if (aData.mbValue)
-+            {
-+                // This row is invisible.  Skip to the last invisible row and
-+                // try again.
-+                mnCurRow = mnUBound = aData.mnRow2;
-+                continue;
-+            }
-+
-+            // This row is visible.
-+            mnUBound = aData.mnRow2;
-+        }
-+
-+        mpCell = mrColumn.GetCell(mnCurRow);
-+        if (mpCell)
-+            return mpCell;
-+    }
-+    mnCurRow = ROW_NOT_FOUND;
-+    return NULL;
-+}
-+
-+SCROW ScTable::VisibleDataCellIterator::getRow() const
-+{
-+    return mnCurRow;
-+}
- 
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-perf-filtering-with-notes.diff b/patches/dev300/calc-perf-filtering-with-notes.diff
index d3c7a3b..7a99c81 100644
--- a/patches/dev300/calc-perf-filtering-with-notes.diff
+++ b/patches/dev300/calc-perf-filtering-with-notes.diff
@@ -12,15 +12,15 @@ diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
 index bd14718..53877f9 100644
 --- sc/source/core/data/table2.cxx
 +++ sc/source/core/data/table2.cxx
-@@ -2381,8 +2381,6 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
- void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
+@@ -2532,8 +2532,6 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
+ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, bool bShow)
  {
      SCROW nStartRow = nRow1;
 -    IncRecalcLevel();
 -    InitializeNoteCaptions();
      while (nStartRow <= nRow2)
      {
-         BYTE nOldFlag = pRowFlags->GetValue(nStartRow) & CR_HIDDEN;
+         SCROW nEndRow = -1;
 @@ -2425,8 +2423,6 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
      //	to be done here.
      if (pOutlineTable)
diff --git a/patches/dev300/calc-perf-flat-segment-tree.diff b/patches/dev300/calc-perf-flat-segment-tree.diff
deleted file mode 100644
index f1f8b03..0000000
--- a/patches/dev300/calc-perf-flat-segment-tree.diff
+++ /dev/null
@@ -1,808 +0,0 @@
-From 0bbd9f0b38d731b4ecf71afb80646375fd67f5a4 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:46 +0200
-Subject: [PATCH 198/768] calc-perf-flat-segment-tree.diff
-
----
- sc/inc/segmenttree.hxx              |  175 +++++++++++
- sc/source/core/data/makefile.mk     |    4 +-
- sc/source/core/data/segmenttree.cxx |  583 +++++++++++++++++++++++++++++++++++
- 3 files changed, 761 insertions(+), 1 deletions(-)
- create mode 100644 sc/inc/segmenttree.hxx
- create mode 100644 sc/source/core/data/segmenttree.cxx
-
-diff --git sc/inc/segmenttree.hxx sc/inc/segmenttree.hxx
-new file mode 100644
-index 0000000..2900ad3
---- /dev/null
-+++ sc/inc/segmenttree.hxx
-@@ -0,0 +1,175 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: compressedarray.hxx,v $
-+ * $Revision: 1.7.32.2 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org 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 version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org.  If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+
-+#ifndef SC_SEGMENTTREE_HXX
-+#define SC_SEGMENTTREE_HXX
-+
-+#include "address.hxx"
-+
-+#include <memory>
-+
-+class ScFlatBoolSegmentsImpl;
-+
-+class ScFlatBoolRowSegments
-+{
-+public:
-+    struct RangeData
-+    {
-+        SCROW   mnRow1;
-+        SCROW   mnRow2;
-+        bool    mbValue;
-+    };
-+
-+    class ForwardIterator
-+    {
-+    public:
-+        explicit ForwardIterator(ScFlatBoolRowSegments& rSegs);
-+
-+        bool getValue(SCROW nPos, bool& rVal);
-+        SCROW getLastPos() const;
-+
-+    private:
-+        ScFlatBoolRowSegments&  mrSegs;
-+
-+        SCROW   mnCurPos;
-+        SCROW   mnLastPos;
-+        bool    mbCurValue;
-+    };
-+
-+    class RangeIterator
-+    {
-+    public:
-+        explicit RangeIterator(ScFlatBoolRowSegments& rSegs);
-+        bool getFirst(RangeData& rRange);
-+        bool getNext(RangeData& rRange);
-+    private:
-+        ScFlatBoolRowSegments& mrSegs;
-+    };
-+
-+    ScFlatBoolRowSegments();
-+    ScFlatBoolRowSegments(const ScFlatBoolRowSegments& r);
-+    ~ScFlatBoolRowSegments();
-+
-+    void setTrue(SCROW nRow1, SCROW nRow2);
-+    void setFalse(SCROW nRow1, SCROW nRow2);
-+    bool getValue(SCROW nRow);
-+    bool getRangeData(SCROW nRow, RangeData& rData);
-+    void removeSegment(SCROW nRow1, SCROW nRow2);
-+    void insertSegment(SCROW nRow, SCROW nSize, bool bSkipStartBoundary);
-+
-+    SCROW findLastNotOf(bool bValue) const;
-+
-+    void enableTreeSearch(bool bEnable);
-+    void setInsertFromBack(bool bInsertFromBack);
-+
-+private:
-+    ::std::auto_ptr<ScFlatBoolSegmentsImpl> mpImpl;
-+};
-+
-+// ============================================================================
-+
-+class ScFlatBoolColSegments
-+{
-+public:
-+    struct RangeData
-+    {
-+        SCCOL   mnCol1;
-+        SCCOL   mnCol2;
-+        bool    mbValue;
-+    };
-+    ScFlatBoolColSegments();
-+    ScFlatBoolColSegments(const ScFlatBoolColSegments& r);
-+    ~ScFlatBoolColSegments();
-+
-+    void setTrue(SCCOL nCol1, SCCOL nCol2);
-+    void setFalse(SCCOL nCol1, SCCOL nCol2);
-+    bool getValue(SCCOL nCol);
-+    bool getRangeData(SCCOL nCol, RangeData& rData);
-+    void removeSegment(SCCOL nCol1, SCCOL nCol2);
-+    void insertSegment(SCCOL nCol, SCCOL nSize, bool bSkipStartBoundary);
-+
-+    void enableTreeSearch(bool bEnable);
-+    void setInsertFromBack(bool bInsertFromBack);
-+
-+private:
-+    ::std::auto_ptr<ScFlatBoolSegmentsImpl> mpImpl;
-+};
-+
-+// ============================================================================
-+
-+class ScFlatUInt16SegmentsImpl;
-+
-+class ScFlatUInt16RowSegments
-+{
-+public:
-+    struct RangeData
-+    {
-+        SCROW       mnRow1;
-+        SCROW       mnRow2;
-+        sal_uInt16  mnValue;
-+    };
-+
-+    class ForwardIterator
-+    {
-+    public:
-+        explicit ForwardIterator(ScFlatUInt16RowSegments& rSegs);
-+
-+        bool getValue(SCROW nPos, sal_uInt16& rVal);
-+        SCROW getLastPos() const;
-+
-+    private:
-+        ScFlatUInt16RowSegments&  mrSegs;
-+
-+        SCROW       mnCurPos;
-+        SCROW       mnLastPos;
-+        sal_uInt16  mnCurValue;
-+    };
-+
-+    ScFlatUInt16RowSegments(sal_uInt16 nDefault);
-+    ScFlatUInt16RowSegments(const ScFlatUInt16RowSegments& r);
-+    ~ScFlatUInt16RowSegments();
-+
-+    void setValue(SCROW nRow1, SCROW nRow2, sal_uInt16 nValue);
-+    sal_uInt16 getValue(SCROW nRow);
-+    sal_uInt32 getSumValue(SCROW nRow1, SCROW nRow2);
-+    bool getRangeData(SCROW nRow, RangeData& rData);
-+    void removeSegment(SCROW nRow1, SCROW nRow2);
-+    void insertSegment(SCROW nRow, SCROW nSize, bool bSkipStartBoundary);
-+
-+    SCROW findLastNotOf(sal_uInt16 nValue) const;
-+
-+    void enableTreeSearch(bool bEnable);
-+    void setInsertFromBack(bool bInsertFromBack);
-+
-+private:
-+    ::std::auto_ptr<ScFlatUInt16SegmentsImpl> mpImpl;
-+};
-+
-+#endif
-diff --git sc/source/core/data/makefile.mk sc/source/core/data/makefile.mk
-index cf51e1e..2174d1d 100755
---- sc/source/core/data/makefile.mk
-+++ sc/source/core/data/makefile.mk
-@@ -98,6 +98,7 @@ SLOFILES =  \
-     $(SLO)$/patattr.obj \
-     $(SLO)$/pivot2.obj \
-     $(SLO)$/poolhelp.obj \
-+    $(SLO)$/segmenttree.obj \
-     $(SLO)$/sortparam.obj \
-     $(SLO)$/stlpool.obj \
-     $(SLO)$/stlsheet.obj \
-@@ -148,7 +149,8 @@ EXCEPTIONSFILES= \
-     $(SLO)$/dbdocutl.obj \
-     $(SLO)$/dptabsrc.obj \
-     $(SLO)$/drwlayer.obj \
--    $(SLO)$/globalx.obj
-+    $(SLO)$/globalx.obj \
-+    $(SLO)$/segmenttree.obj
- 
- .IF "$(OS)$(COM)$(CPUNAME)"=="LINUXGCCSPARC"
- NOOPTFILES= \
-diff --git sc/source/core/data/segmenttree.cxx sc/source/core/data/segmenttree.cxx
-new file mode 100644
-index 0000000..7f7be6a
---- /dev/null
-+++ sc/source/core/data/segmenttree.cxx
-@@ -0,0 +1,583 @@
-+/*************************************************************************
-+ *
-+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-+ *
-+ * Copyright 2008 by Sun Microsystems, Inc.
-+ *
-+ * OpenOffice.org - a multi-platform office productivity suite
-+ *
-+ * $RCSfile: compressedarray.hxx,v $
-+ * $Revision: 1.7.32.2 $
-+ *
-+ * This file is part of OpenOffice.org.
-+ *
-+ * OpenOffice.org is free software: you can redistribute it and/or modify
-+ * it under the terms of the GNU Lesser General Public License version 3
-+ * only, as published by the Free Software Foundation.
-+ *
-+ * OpenOffice.org 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 version 3 for more details
-+ * (a copy is included in the LICENSE file that accompanied this code).
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * version 3 along with OpenOffice.org.  If not, see
-+ * <http://www.openoffice.org/license.html>
-+ * for a copy of the LGPLv3 License.
-+ *
-+ ************************************************************************/
-+
-+// MARKER(update_precomp.py): autogen include statement, do not remove
-+#include "precompiled_sc.hxx"
-+
-+#include "segmenttree.hxx"
-+#include <mdds/flat_segment_tree.hpp>
-+
-+#include <limits>
-+
-+using ::std::numeric_limits;
-+
-+// ============================================================================
-+
-+template<typename _ValueType, typename _ExtValueType = _ValueType>
-+class ScFlatSegmentsImpl
-+{
-+public:
-+    typedef _ValueType ValueType;
-+    typedef _ExtValueType ExtValueType;
-+
-+    struct RangeData
-+    {
-+        SCCOLROW    mnPos1;
-+        SCCOLROW    mnPos2;
-+        ValueType   mnValue;
-+    };
-+
-+    ScFlatSegmentsImpl(SCCOLROW nMax, ValueType nDefault);
-+    ScFlatSegmentsImpl(const ScFlatSegmentsImpl& r);
-+    ~ScFlatSegmentsImpl();
-+
-+    void setValue(SCCOLROW nPos1, SCCOLROW nPos2, ValueType nValue);
-+    ValueType getValue(SCCOLROW nPos);
-+    ExtValueType getSumValue(SCCOLROW nPos1, SCCOLROW nPos2);
-+    bool getRangeData(SCCOLROW nPos, RangeData& rData);
-+    void removeSegment(SCCOLROW nPos1, SCCOLROW nPos2);
-+    void insertSegment(SCCOLROW nPos, SCCOLROW nSize, bool bSkipStartBoundary);
-+
-+    SCROW findLastNotOf(ValueType nValue) const;
-+
-+    // range iteration
-+    bool getFirst(RangeData& rData);
-+    bool getNext(RangeData& rData);
-+
-+    void enableTreeSearch(bool b)
-+    {
-+        mbTreeSearchEnabled = b;
-+    }
-+
-+    void setInsertFromBack(bool b)
-+    {
-+        mbInsertFromBack = b;
-+    }
-+
-+private:
-+    typedef ::mdds::flat_segment_tree<SCCOLROW, ValueType> fst_type;
-+    fst_type maSegments;
-+    typename fst_type::const_iterator maItr;
-+
-+    bool mbTreeSearchEnabled:1;
-+    bool mbInsertFromBack:1;
-+};
-+
-+template<typename _ValueType, typename _ExtValueType>
-+ScFlatSegmentsImpl<_ValueType, _ExtValueType>::ScFlatSegmentsImpl(SCCOLROW nMax, ValueType nDefault) :
-+    maSegments(0, nMax+1, nDefault),
-+    mbTreeSearchEnabled(true),
-+    mbInsertFromBack(false)
-+{
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+ScFlatSegmentsImpl<_ValueType, _ExtValueType>::ScFlatSegmentsImpl(const ScFlatSegmentsImpl<_ValueType, _ExtValueType>& r) :
-+    maSegments(r.maSegments),
-+    mbTreeSearchEnabled(r.mbTreeSearchEnabled),
-+    mbInsertFromBack(r.mbInsertFromBack)
-+{
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+ScFlatSegmentsImpl<_ValueType, _ExtValueType>::~ScFlatSegmentsImpl()
-+{
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+void ScFlatSegmentsImpl<_ValueType, _ExtValueType>::setValue(SCCOLROW nPos1, SCCOLROW nPos2, ValueType nValue)
-+{
-+    if (mbInsertFromBack)
-+        maSegments.insert_back(nPos1, nPos2+1, nValue);
-+    else
-+        maSegments.insert_front(nPos1, nPos2+1, nValue);
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+typename ScFlatSegmentsImpl<_ValueType, _ExtValueType>::ValueType ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getValue(SCCOLROW nPos)
-+{
-+    ValueType nValue = 0;
-+    if (!mbTreeSearchEnabled)
-+    {
-+        maSegments.search(nPos, nValue);
-+        return nValue;
-+    }
-+
-+    if (!maSegments.is_tree_valid())
-+        maSegments.build_tree();
-+
-+    maSegments.search_tree(nPos, nValue);
-+    return nValue;
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+typename ScFlatSegmentsImpl<_ValueType, _ExtValueType>::ExtValueType
-+ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getSumValue(SCCOLROW nPos1, SCCOLROW nPos2)
-+{
-+    RangeData aData;
-+    if (!getRangeData(nPos1, aData))
-+        return 0;
-+
-+    sal_uInt32 nValue = 0;
-+
-+    SCROW nCurPos = nPos1;
-+    SCROW nEndPos = aData.mnPos2;
-+    while (nEndPos <= nPos2)
-+    {
-+        nValue += aData.mnValue * (nEndPos - nCurPos + 1);
-+        nCurPos = nEndPos + 1;
-+        if (!getRangeData(nCurPos, aData))
-+            break;
-+
-+        nEndPos = aData.mnPos2;
-+    }
-+    if (nCurPos <= nPos2)
-+    {
-+        nEndPos = ::std::min(nEndPos, nPos2);
-+        nValue += aData.mnValue * (nEndPos - nCurPos + 1);
-+    }
-+    return nValue;
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+bool ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getRangeData(SCCOLROW nPos, RangeData& rData)
-+{
-+    ValueType nValue;
-+    SCCOLROW nPos1, nPos2;
-+
-+    if (mbTreeSearchEnabled)
-+    {
-+        if (!maSegments.is_tree_valid())
-+            maSegments.build_tree();
-+
-+        if (!maSegments.search_tree(nPos, nValue, &nPos1, &nPos2))
-+            return false;
-+    }
-+    else
-+    {
-+        // Conduct leaf-node only search.  Faster when searching between range insertion.
-+        if (!maSegments.search(nPos, nValue, &nPos1, &nPos2))
-+            return false;
-+    }
-+
-+    rData.mnPos1 = nPos1;
-+    rData.mnPos2 = nPos2-1; // end point is not inclusive.
-+    rData.mnValue = nValue;
-+    return true;
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+void ScFlatSegmentsImpl<_ValueType, _ExtValueType>::removeSegment(SCCOLROW nPos1, SCCOLROW nPos2)
-+{
-+    maSegments.shift_left(nPos1, nPos2);
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+void ScFlatSegmentsImpl<_ValueType, _ExtValueType>::insertSegment(SCCOLROW nPos, SCCOLROW nSize, bool bSkipStartBoundary)
-+{
-+    maSegments.shift_right(nPos, nSize, bSkipStartBoundary);
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+SCCOLROW ScFlatSegmentsImpl<_ValueType, _ExtValueType>::findLastNotOf(ValueType nValue) const
-+{
-+    SCCOLROW nPos = numeric_limits<SCCOLROW>::max(); // position not found.
-+    typename fst_type::const_reverse_iterator itr = maSegments.rbegin(), itrEnd = maSegments.rend();
-+    // Note that when searching in reverse direction, we need to skip the first
-+    // node, since the right-most leaf node does not store a valid value.
-+    for (++itr; itr != itrEnd; ++itr)
-+    {
-+        if (itr->second != nValue)
-+        {
-+            nPos = (--itr)->first - 1;
-+            break;
-+        }
-+    }
-+    return nPos;
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+bool ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getFirst(RangeData& rData)
-+{
-+    maItr = maSegments.begin();
-+    return getNext(rData);
-+}
-+
-+template<typename _ValueType, typename _ExtValueType>
-+bool ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getNext(RangeData& rData)
-+{
-+    typename fst_type::const_iterator itrEnd = maSegments.end();
-+    if (maItr == itrEnd)
-+        return false;
-+
-+    rData.mnPos1 = maItr->first;
-+    rData.mnValue = maItr->second;
-+
-+    ++maItr;
-+    if (maItr == itrEnd)
-+        return false;
-+
-+    rData.mnPos2 = maItr->first - 1;
-+    return true;
-+}
-+
-+// ============================================================================
-+
-+class ScFlatUInt16SegmentsImpl : public ScFlatSegmentsImpl<sal_uInt16, sal_uInt32>
-+{
-+public:
-+    explicit ScFlatUInt16SegmentsImpl(SCCOLROW nMax, sal_uInt16 nDefault) :
-+        ScFlatSegmentsImpl<sal_uInt16, sal_uInt32>(nMax, nDefault)
-+    {
-+    }
-+};
-+
-+// ----------------------------------------------------------------------------
-+
-+class ScFlatBoolSegmentsImpl : public ScFlatSegmentsImpl<bool>
-+{
-+public:
-+    explicit ScFlatBoolSegmentsImpl(SCCOLROW nMax) :
-+        ScFlatSegmentsImpl<bool>(nMax, false)
-+    {
-+    }
-+
-+    void setTrue(SCCOLROW nPos1, SCCOLROW nPos2);
-+    void setFalse(SCCOLROW nPos1, SCCOLROW nPos2);
-+};
-+
-+void ScFlatBoolSegmentsImpl::setTrue(SCCOLROW nPos1, SCCOLROW nPos2)
-+{
-+    setValue(nPos1, nPos2, true);
-+}
-+
-+void ScFlatBoolSegmentsImpl::setFalse(SCCOLROW nPos1, SCCOLROW nPos2)
-+{
-+    setValue(nPos1, nPos2, false);
-+}
-+
-+// ============================================================================
-+
-+ScFlatBoolRowSegments::ForwardIterator::ForwardIterator(ScFlatBoolRowSegments& rSegs) :
-+    mrSegs(rSegs), mnCurPos(0), mnLastPos(-1), mbCurValue(false)
-+{
-+}
-+
-+bool ScFlatBoolRowSegments::ForwardIterator::getValue(SCROW nPos, bool& rVal)
-+{
-+    if (nPos >= mnCurPos)
-+        // It can only go in a forward direction.
-+        mnCurPos = nPos;
-+
-+    if (mnCurPos > mnLastPos)
-+    {
-+        // position not in the current segment.  Update the current value.
-+        ScFlatBoolRowSegments::RangeData aData;
-+        if (!mrSegs.getRangeData(mnCurPos, aData))
-+            return false;
-+
-+        mbCurValue = aData.mbValue;
-+        mnLastPos = aData.mnRow2;
-+    }
-+
-+    rVal = mbCurValue;
-+    return true;
-+}
-+
-+SCROW ScFlatBoolRowSegments::ForwardIterator::getLastPos() const
-+{
-+    return mnLastPos;
-+}
-+
-+// ----------------------------------------------------------------------------
-+
-+ScFlatBoolRowSegments::RangeIterator::RangeIterator(ScFlatBoolRowSegments& rSegs) :
-+    mrSegs(rSegs)
-+{
-+}
-+
-+bool ScFlatBoolRowSegments::RangeIterator::getFirst(RangeData& rRange)
-+{
-+    ScFlatBoolSegmentsImpl::RangeData aData;
-+    if (!mrSegs.mpImpl->getFirst(aData))
-+        return false;
-+
-+    rRange.mnRow1  = static_cast<SCROW>(aData.mnPos1);
-+    rRange.mnRow2  = static_cast<SCROW>(aData.mnPos2);
-+    rRange.mbValue = static_cast<bool>(aData.mnValue);
-+    return true;
-+}
-+
-+bool ScFlatBoolRowSegments::RangeIterator::getNext(RangeData& rRange)
-+{
-+    ScFlatBoolSegmentsImpl::RangeData aData;
-+    if (!mrSegs.mpImpl->getNext(aData))
-+        return false;
-+
-+    rRange.mnRow1  = static_cast<SCROW>(aData.mnPos1);
-+    rRange.mnRow2  = static_cast<SCROW>(aData.mnPos2);
-+    rRange.mbValue = static_cast<bool>(aData.mnValue);
-+    return true;
-+}
-+
-+// ----------------------------------------------------------------------------
-+
-+ScFlatBoolRowSegments::ScFlatBoolRowSegments() :
-+    mpImpl(new ScFlatBoolSegmentsImpl(static_cast<SCCOLROW>(MAXROW)))
-+{
-+}
-+
-+ScFlatBoolRowSegments::ScFlatBoolRowSegments(const ScFlatBoolRowSegments& r) :
-+    mpImpl(new ScFlatBoolSegmentsImpl(*r.mpImpl))
-+{
-+}
-+
-+ScFlatBoolRowSegments::~ScFlatBoolRowSegments()
-+{
-+}
-+
-+void ScFlatBoolRowSegments::setTrue(SCROW nRow1, SCROW nRow2)
-+{
-+    mpImpl->setTrue(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
-+}
-+
-+void ScFlatBoolRowSegments::setFalse(SCROW nRow1, SCROW nRow2)
-+{
-+    mpImpl->setFalse(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
-+}
-+
-+bool ScFlatBoolRowSegments::getValue(SCROW nRow)
-+{
-+    return mpImpl->getValue(static_cast<SCCOLROW>(nRow));
-+}
-+
-+bool ScFlatBoolRowSegments::getRangeData(SCROW nRow, RangeData& rData)
-+{
-+    ScFlatBoolSegmentsImpl::RangeData aData;
-+    if (!mpImpl->getRangeData(static_cast<SCCOLROW>(nRow), aData))
-+        return false;
-+
-+    rData.mbValue = aData.mnValue;
-+    rData.mnRow1  = static_cast<SCROW>(aData.mnPos1);
-+    rData.mnRow2  = static_cast<SCROW>(aData.mnPos2);
-+    return true;
-+}
-+
-+void ScFlatBoolRowSegments::removeSegment(SCROW nRow1, SCROW nRow2)
-+{
-+    mpImpl->removeSegment(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
-+}
-+
-+void ScFlatBoolRowSegments::insertSegment(SCROW nRow, SCROW nSize, bool bSkipStartBoundary)
-+{
-+    mpImpl->insertSegment(static_cast<SCCOLROW>(nRow), static_cast<SCCOLROW>(nSize), bSkipStartBoundary);
-+}
-+
-+SCROW ScFlatBoolRowSegments::findLastNotOf(bool bValue) const
-+{
-+    return static_cast<SCROW>(mpImpl->findLastNotOf(bValue));
-+}
-+
-+void ScFlatBoolRowSegments::enableTreeSearch(bool bEnable)
-+{
-+    mpImpl->enableTreeSearch(bEnable);
-+}
-+
-+void ScFlatBoolRowSegments::setInsertFromBack(bool bInsertFromBack)
-+{
-+    mpImpl->setInsertFromBack(bInsertFromBack);
-+}
-+
-+// ============================================================================
-+
-+ScFlatBoolColSegments::ScFlatBoolColSegments() :
-+    mpImpl(new ScFlatBoolSegmentsImpl(static_cast<SCCOLROW>(MAXCOL)))
-+{
-+}
-+
-+ScFlatBoolColSegments::ScFlatBoolColSegments(const ScFlatBoolColSegments& r) :
-+    mpImpl(new ScFlatBoolSegmentsImpl(*r.mpImpl))
-+{
-+}
-+
-+ScFlatBoolColSegments::~ScFlatBoolColSegments()
-+{
-+}
-+
-+void ScFlatBoolColSegments::setTrue(SCCOL nCol1, SCCOL nCol2)
-+{
-+    mpImpl->setTrue(static_cast<SCCOLROW>(nCol1), static_cast<SCCOLROW>(nCol2));
-+}
-+
-+void ScFlatBoolColSegments::setFalse(SCCOL nCol1, SCCOL nCol2)
-+{
-+    mpImpl->setFalse(static_cast<SCCOLROW>(nCol1), static_cast<SCCOLROW>(nCol2));
-+}
-+
-+bool ScFlatBoolColSegments::getValue(SCCOL nCol)
-+{
-+    return mpImpl->getValue(static_cast<SCCOLROW>(nCol));
-+}
-+
-+bool ScFlatBoolColSegments::getRangeData(SCCOL nCol, RangeData& rData)
-+{
-+    ScFlatBoolSegmentsImpl::RangeData aData;
-+    if (!mpImpl->getRangeData(static_cast<SCCOLROW>(nCol), aData))
-+        return false;
-+
-+    rData.mbValue = aData.mnValue;
-+    rData.mnCol1  = static_cast<SCCOL>(aData.mnPos1);
-+    rData.mnCol2  = static_cast<SCCOL>(aData.mnPos2);
-+    return true;
-+}
-+
-+void ScFlatBoolColSegments::removeSegment(SCCOL nCol1, SCCOL nCol2)
-+{
-+    mpImpl->removeSegment(static_cast<SCCOLROW>(nCol1), static_cast<SCCOLROW>(nCol2));
-+}
-+
-+void ScFlatBoolColSegments::insertSegment(SCCOL nCol, SCCOL nSize, bool bSkipStartBoundary)
-+{
-+    mpImpl->insertSegment(static_cast<SCCOLROW>(nCol), static_cast<SCCOLROW>(nSize), bSkipStartBoundary);
-+}
-+
-+void ScFlatBoolColSegments::enableTreeSearch(bool bEnable)
-+{
-+    mpImpl->enableTreeSearch(bEnable);
-+}
-+
-+void ScFlatBoolColSegments::setInsertFromBack(bool bInsertFromBack)
-+{
-+    mpImpl->setInsertFromBack(bInsertFromBack);
-+}
-+
-+// ============================================================================
-+
-+
-+// ============================================================================
-+
-+ScFlatUInt16RowSegments::ForwardIterator::ForwardIterator(ScFlatUInt16RowSegments& rSegs) :
-+    mrSegs(rSegs), mnCurPos(0), mnLastPos(-1), mnCurValue(0)
-+{
-+}
-+
-+bool ScFlatUInt16RowSegments::ForwardIterator::getValue(SCROW nPos, sal_uInt16& rVal)
-+{
-+    if (nPos >= mnCurPos)
-+        // It can only go in a forward direction.
-+        mnCurPos = nPos;
-+
-+    if (mnCurPos > mnLastPos)
-+    {
-+        // position not in the current segment.  Update the current value.
-+        ScFlatUInt16RowSegments::RangeData aData;
-+        if (!mrSegs.getRangeData(mnCurPos, aData))
-+            return false;
-+
-+        mnCurValue = aData.mnValue;
-+        mnLastPos = aData.mnRow2;
-+    }
-+
-+    rVal = mnCurValue;
-+    return true;
-+}
-+
-+SCROW ScFlatUInt16RowSegments::ForwardIterator::getLastPos() const
-+{
-+    return mnLastPos;
-+}
-+
-+// ----------------------------------------------------------------------------
-+
-+ScFlatUInt16RowSegments::ScFlatUInt16RowSegments(sal_uInt16 nDefault) :
-+    mpImpl(new ScFlatUInt16SegmentsImpl(static_cast<SCCOLROW>(MAXROW), nDefault))
-+{
-+}
-+
-+ScFlatUInt16RowSegments::ScFlatUInt16RowSegments(const ScFlatUInt16RowSegments& r) :
-+    mpImpl(new ScFlatUInt16SegmentsImpl(*r.mpImpl))
-+{
-+}
-+
-+ScFlatUInt16RowSegments::~ScFlatUInt16RowSegments()
-+{
-+}
-+
-+void ScFlatUInt16RowSegments::setValue(SCROW nRow1, SCROW nRow2, sal_uInt16 nValue)
-+{
-+    mpImpl->setValue(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2), nValue);
-+}
-+
-+sal_uInt16 ScFlatUInt16RowSegments::getValue(SCROW nRow)
-+{
-+    return mpImpl->getValue(static_cast<SCCOLROW>(nRow));
-+}
-+
-+sal_uInt32 ScFlatUInt16RowSegments::getSumValue(SCROW nRow1, SCROW nRow2)
-+{
-+    return mpImpl->getSumValue(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
-+}
-+
-+bool ScFlatUInt16RowSegments::getRangeData(SCROW nRow, RangeData& rData)
-+{
-+    ScFlatUInt16SegmentsImpl::RangeData aData;
-+    if (!mpImpl->getRangeData(static_cast<SCCOLROW>(nRow), aData))
-+        return false;
-+
-+    rData.mnRow1  = aData.mnPos1;
-+    rData.mnRow2  = aData.mnPos2;
-+    rData.mnValue = aData.mnValue;
-+    return true;
-+}
-+
-+void ScFlatUInt16RowSegments::removeSegment(SCROW nRow1, SCROW nRow2)
-+{
-+    mpImpl->removeSegment(static_cast<SCCOLROW>(nRow1), static_cast<SCCOLROW>(nRow2));
-+}
-+
-+void ScFlatUInt16RowSegments::insertSegment(SCROW nRow, SCROW nSize, bool bSkipStartBoundary)
-+{
-+    mpImpl->insertSegment(static_cast<SCCOLROW>(nRow), static_cast<SCCOLROW>(nSize), bSkipStartBoundary);
-+}
-+
-+SCROW ScFlatUInt16RowSegments::findLastNotOf(sal_uInt16 nValue) const
-+{
-+    return static_cast<SCROW>(mpImpl->findLastNotOf(nValue));
-+}
-+
-+void ScFlatUInt16RowSegments::enableTreeSearch(bool bEnable)
-+{
-+    mpImpl->enableTreeSearch(bEnable);
-+}
-+
-+void ScFlatUInt16RowSegments::setInsertFromBack(bool bInsertFromBack)
-+{
-+    mpImpl->setInsertFromBack(bInsertFromBack);
-+}
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-perf-import-dbf-sc.diff b/patches/dev300/calc-perf-import-dbf-sc.diff
index 90e725b..8e9e76a 100644
--- a/patches/dev300/calc-perf-import-dbf-sc.diff
+++ b/patches/dev300/calc-perf-import-dbf-sc.diff
@@ -34,8 +34,8 @@ index 9ef97ac..f170952 100644
 +++ sc/inc/column.hxx
 @@ -68,6 +68,7 @@ struct ScLineFlags;
  struct ScMergePatternState;
- struct ScSetStringParam;
  class ScFlatBoolRowSegments;
+ struct ScSetStringParam;
 +struct ScColWidthParam;
  
  #define COLUMN_DELTA	4
@@ -97,10 +97,12 @@ diff --git sc/inc/dociter.hxx sc/inc/dociter.hxx
 index 749e674..ce1ee02 100644
 --- sc/inc/dociter.hxx
 +++ sc/inc/dociter.hxx
-@@ -35,6 +35,8 @@
+@@ -35,8 +35,10 @@
  #include "queryparam.hxx"
  
  #include <memory>
+ 
+ #include <set>
 +#include <vector>
 +#include <boost/shared_ptr.hpp>
  
@@ -114,8 +116,9 @@ index 749e674..ce1ee02 100644
  
  class ScDocumentIterator				// alle nichtleeren Zellen durchgehen
  {
-@@ -514,6 +517,42 @@ public:
-     const ScBaseCell*		GetCell() const			{ return pFoundCell; }
+@@ -514,7 +517,43 @@ public:
+     ::std::set<SCROW>::const_iterator maItr;
+     ::std::set<SCROW>::const_iterator maEnd;
  };
  
 +// ============================================================================
@@ -214,9 +217,10 @@ diff --git sc/inc/document.hxx sc/inc/document.hxx
 index 72b790c..5d33fb3 100644
 --- sc/inc/document.hxx
 +++ sc/inc/document.hxx
-@@ -146,6 +146,8 @@ class ScFormulaParserPool;
+@@ -146,7 +146,9 @@ class ScFormulaParserPool;
  struct ScClipParam;        
  struct ScClipRangeNameData;
+ class ScRowBreakIterator;
  struct ScSetStringParam;
 +class ScDocRowHeightUpdater;
 +struct ScColWidthParam;
@@ -244,10 +248,11 @@ diff --git sc/inc/table.hxx sc/inc/table.hxx
 index a901eab..ebe4ce1 100644
 --- sc/inc/table.hxx
 +++ sc/inc/table.hxx
-@@ -85,6 +85,7 @@ struct ScSetStringParam;
+@@ -85,7 +85,8 @@ struct ScSetStringParam;
  class ScFlatUInt16RowSegments;
  class ScFlatBoolRowSegments;
  class ScFlatBoolColSegments;
+ struct ScSetStringParam;
 +struct ScColWidthParam;
  
  class ScTable
diff --git a/patches/dev300/calc-perf-last-rowflags-fix.diff b/patches/dev300/calc-perf-last-rowflags-fix.diff
deleted file mode 100644
index d208066..0000000
--- a/patches/dev300/calc-perf-last-rowflags-fix.diff
+++ /dev/null
@@ -1,64 +0,0 @@
-From 55592591a21884aac479f487c9524943b628758b Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:57:01 +0200
-Subject: [PATCH 210/768] calc-perf-last-rowflags-fix.diff
-
----
- sc/source/core/data/table2.cxx |   33 ++++++++++++++++++++++++++-------
- 1 files changed, 26 insertions(+), 7 deletions(-)
-
-diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
-index 37e9568..5e4fcd7 100644
---- sc/source/core/data/table2.cxx
-+++ sc/source/core/data/table2.cxx
-@@ -2656,11 +2656,32 @@ BYTE ScTable::GetRowFlags( SCROW nRow ) const
- 
- SCROW ScTable::GetLastFlaggedRow() const
- {
--    if ( !pRowFlags )
--        return 0;
-+    SCROW nLastFound = 0;
-+    if (pRowFlags)
-+    {
-+        SCROW nRow = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast<BYTE>(CR_ALL) );
-+        if (ValidRow(nRow))
-+            nLastFound = nRow;
-+    }
-+
-+    if (!maRowManualBreaks.empty())
-+        nLastFound = ::std::max(nLastFound, *maRowManualBreaks.rbegin());
-+
-+    if (mpHiddenRows)
-+    {
-+        SCROW nRow = mpHiddenRows->findLastNotOf(false);
-+        if (ValidRow(nRow))
-+            nLastFound = ::std::max(nLastFound, nRow);
-+    }
-+
-+    if (mpFilteredRows)
-+    {
-+        SCROW nRow = mpFilteredRows->findLastNotOf(false);
-+        if (ValidRow(nRow))
-+            nLastFound = ::std::max(nLastFound, nRow);
-+    }
- 
--    SCROW nLastFound = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast<BYTE>(CR_ALL) );
--    return ValidRow(nLastFound) ? nLastFound : 0;
-+    return nLastFound;
- }
- 
- 
-@@ -2683,9 +2704,7 @@ SCROW ScTable::GetLastChangedRow() const
-     if ( !pRowFlags )
-         return 0;
- 
--    SCROW nLastFlags = pRowFlags->GetLastAnyBitAccess( 0, sal::static_int_cast<BYTE>(CR_ALL) );
--    if (!ValidRow(nLastFlags))
--        nLastFlags = 0;
-+    SCROW nLastFlags = GetLastFlaggedRow();
- 
-     // Find the last row position where the height is NOT the standard row
-     // height.
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-perf-lazy-overlay-objects.diff b/patches/dev300/calc-perf-lazy-overlay-objects.diff
deleted file mode 100644
index 140eeb0..0000000
--- a/patches/dev300/calc-perf-lazy-overlay-objects.diff
+++ /dev/null
@@ -1,201 +0,0 @@
-From 4aa220da4f58fb52a12c06fbe24736870b8deef9 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:55 +0200
-Subject: [PATCH 205/768] calc-perf-lazy-overlay-objects.diff
-
----
- sc/source/ui/inc/gridwin.hxx   |   20 +++++++++++++
- sc/source/ui/view/gridwin.cxx  |   59 +++++++++++++++++++++++-----------------
- sc/source/ui/view/gridwin4.cxx |    6 ++++
- 3 files changed, 60 insertions(+), 25 deletions(-)
-
-diff --git sc/source/ui/inc/gridwin.hxx sc/source/ui/inc/gridwin.hxx
-index 44ba299..d0dccdb 100644
---- sc/source/ui/inc/gridwin.hxx
-+++ sc/source/ui/inc/gridwin.hxx
-@@ -39,6 +39,7 @@
- 
- #include <vector>
- #include <memory>
-+#include <boost/shared_ptr.hpp>
- 
- // ---------------------------------------------------------------------------
- 
-@@ -113,6 +114,25 @@ private:
-     ::sdr::overlay::OverlayObjectList*              mpOOHeader;
-     ::sdr::overlay::OverlayObjectList*              mpOOShrink;
- 
-+    ::boost::shared_ptr<Rectangle> mpAutoFillRect;
-+
-+    /**
-+     * Stores current visible column and row ranges, used to avoid expensive
-+     * operations on objects that are outside visible area.
-+     */
-+    struct VisibleRange
-+    {
-+        SCCOL mnCol1;
-+        SCCOL mnCol2;
-+        SCROW mnRow1;
-+        SCROW mnRow2;
-+
-+        VisibleRange();
-+
-+        bool isInside(SCCOL nCol, SCROW nRow) const;
-+    };
-+    VisibleRange maVisibleRange;
-+
- private:
-     ScViewData*				pViewData;
-     ScSplitPos				eWhich;
-diff --git sc/source/ui/view/gridwin.cxx sc/source/ui/view/gridwin.cxx
-index 9af3125..9ff4a24 100644
---- sc/source/ui/view/gridwin.cxx
-+++ sc/source/ui/view/gridwin.cxx
-@@ -158,7 +158,19 @@ extern USHORT nScFillModeMouseModifier;				// global.cxx
- 
- #define SC_FILTERLISTBOX_LINES	12
- 
--//==================================================================
-+// ============================================================================
-+
-+ScGridWindow::VisibleRange::VisibleRange() :
-+    mnCol1(0), mnCol2(MAXCOL), mnRow1(0), mnRow2(MAXROW)
-+{
-+}
-+
-+bool ScGridWindow::VisibleRange::isInside(SCCOL nCol, SCROW nRow) const
-+{
-+    return mnCol1 <= nCol && nCol <= mnCol2 && mnRow1 <= nRow && nRow <= mnRow2;
-+}
-+
-+// ============================================================================
- 
- class ScFilterListBox : public ListBox
- {
-@@ -372,6 +384,7 @@ ScGridWindow::ScGridWindow( Window* pParent, ScViewData* pData, ScSplitPos eWhic
-             mpOODragRect( NULL ),
-             mpOOHeader( NULL ),
-             mpOOShrink( NULL ),
-+            mpAutoFillRect(static_cast<Rectangle*>(NULL)),
-             pViewData( pData ),
-             eWhich( eWhichPos ),
-             pNoteMarker( NULL ),
-@@ -1356,30 +1369,17 @@ BOOL ScGridWindow::TestMouse( const MouseEvent& rMEvt, BOOL bAction )
-         ScRange aMarkRange;
-         if (pViewData->GetSimpleArea( aMarkRange ) == SC_MARK_SIMPLE)
-         {
--            if ( aMarkRange.aStart.Tab() == pViewData->GetTabNo() )
-+            if (aMarkRange.aStart.Tab() == pViewData->GetTabNo() && mpAutoFillRect)
-             {
--                //	Block-Ende wie in DrawAutoFillMark
--                SCCOL nX = aMarkRange.aEnd.Col();
--                SCROW nY = aMarkRange.aEnd.Row();
--
--                Point aFillPos = pViewData->GetScrPos( nX, nY, eWhich, TRUE );
--                long nSizeXPix;
--                long nSizeYPix;
--                pViewData->GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix );
--                aFillPos.X() += nSizeXPix * nLayoutSign;
--                aFillPos.Y() += nSizeYPix;
--                if ( bLayoutRTL )
--                    aFillPos.X() -= 1;
--
-                 Point aMousePos = rMEvt.GetPosPixel();
--                //	Abfrage hier passend zu DrawAutoFillMark
--                //	(ein Pixel mehr als markiert)
--                if ( aMousePos.X() >= aFillPos.X()-3 && aMousePos.X() <= aFillPos.X()+4 &&
--                     aMousePos.Y() >= aFillPos.Y()-3 && aMousePos.Y() <= aFillPos.Y()+4 )
-+                if (mpAutoFillRect->IsInside(aMousePos))
-                 {
--                    SetPointer( Pointer( POINTER_CROSS ) );		//! dickeres Kreuz ?
-+                    SetPointer( Pointer( POINTER_CROSS ) );     //! dickeres Kreuz ?
-                     if (bAction)
-                     {
-+                        SCCOL nX = aMarkRange.aEnd.Col();
-+                        SCROW nY = aMarkRange.aEnd.Row();
-+
-                         if ( lcl_IsEditableMatrix( pViewData->GetDocument(), aMarkRange ) )
-                             pViewData->SetDragMode(
-                                 aMarkRange.aStart.Col(), aMarkRange.aStart.Row(), nX, nY, SC_FILL_MATRIX );
-@@ -5273,6 +5273,9 @@ void ScGridWindow::UpdateCursorOverlay()
-     SCCOL nX = pViewData->GetCurX();
-     SCROW nY = pViewData->GetCurY();
- 
-+    if (!maVisibleRange.isInside(nX, nY))
-+        return;
-+
-     //  don't show the cursor in overlapped cells
- 
-     ScDocument* pDoc = pViewData->GetDocument();
-@@ -5443,6 +5446,7 @@ void ScGridWindow::UpdateSelectionOverlay()
- void ScGridWindow::DeleteAutoFillOverlay()
- {
-     DELETEZ( mpOOAutoFill );
-+    mpAutoFillRect.reset();
- }
- 
- void ScGridWindow::UpdateAutoFillOverlay()
-@@ -5463,6 +5467,11 @@ void ScGridWindow::UpdateAutoFillOverlay()
-     {
-         SCCOL nX = aAutoMarkPos.Col();
-         SCROW nY = aAutoMarkPos.Row();
-+
-+        if (!maVisibleRange.isInside(nX, nY))
-+            // Autofill mark is not visible.  Bail out.
-+            return;
-+
-         SCTAB nTab = pViewData->GetTabNo();
-         ScDocument* pDoc = pViewData->GetDocument();
-         BOOL bLayoutRTL = pDoc->IsLayoutRTL( nTab );
-@@ -5478,7 +5487,7 @@ void ScGridWindow::UpdateAutoFillOverlay()
- 
-         aFillPos.Y() += nSizeYPix;
-         aFillPos.Y() -= 2;
--        Rectangle aFillRect( aFillPos, Size(6,6) );
-+        mpAutoFillRect.reset(new Rectangle(aFillPos, Size(6, 6)));
-     
-         // #i70788# get the OverlayManager safely
-         ::sdr::overlay::OverlayManager* pOverlayManager = getOverlayManager();
-@@ -5491,7 +5500,7 @@ void ScGridWindow::UpdateAutoFillOverlay()
-                 aHandleColor = SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCPAGEBREAKAUTOMATIC).nColor;
-             std::vector< basegfx::B2DRange > aRanges;
-             const basegfx::B2DHomMatrix aTransform(GetInverseViewTransformation());
--            basegfx::B2DRange aRB(aFillRect.Left(), aFillRect.Top(), aFillRect.Right() + 1, aFillRect.Bottom() + 1);
-+            basegfx::B2DRange aRB(mpAutoFillRect->Left(), mpAutoFillRect->Top(), mpAutoFillRect->Right() + 1, mpAutoFillRect->Bottom() + 1);
-             
-             aRB.transform(aTransform);
-             aRanges.push_back(aRB);
-@@ -5506,10 +5515,10 @@ void ScGridWindow::UpdateAutoFillOverlay()
-             mpOOAutoFill = new ::sdr::overlay::OverlayObjectList;
-             mpOOAutoFill->append(*pOverlay);
-         }
--    }
- 
--    if ( aOldMode != aDrawMode )
--        SetMapMode( aOldMode );
-+        if ( aOldMode != aDrawMode )
-+            SetMapMode( aOldMode );
-+    }
- }
- 
- void ScGridWindow::DeleteDragRectOverlay()
-diff --git sc/source/ui/view/gridwin4.cxx sc/source/ui/view/gridwin4.cxx
-index c485ea7..3b67789 100644
---- sc/source/ui/view/gridwin4.cxx
-+++ sc/source/ui/view/gridwin4.cxx
-@@ -449,6 +449,12 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod
-     SCROW nYBottom = nPosY + pViewData->VisibleCellsY(eVWhich);
-     if (nYBottom > MAXROW) nYBottom = MAXROW;
- 
-+    // Store the current visible range.
-+    maVisibleRange.mnCol1 = nPosX;
-+    maVisibleRange.mnCol2 = nXRight;
-+    maVisibleRange.mnRow1 = nPosY;
-+    maVisibleRange.mnRow2 = nYBottom;
-+
-     if (nX1 > nXRight || nY1 > nYBottom)
-         return;											// unsichtbar
-     if (nX2 > nXRight) nX2 = nXRight;
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-perf-ods-import-properties.diff b/patches/dev300/calc-perf-ods-import-properties.diff
deleted file mode 100644
index 9b4b205..0000000
--- a/patches/dev300/calc-perf-ods-import-properties.diff
+++ /dev/null
@@ -1,174 +0,0 @@
-From 4e84dfa7f26e1377673ae84466d58cf08c39a3b8 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 16:56:47 +0200
-Subject: [PATCH 199/768] calc-perf-ods-import-properties.diff
-
----
- sc/inc/attarray.hxx              |    3 +-
- sc/inc/column.hxx                |    4 +-
- sc/source/core/data/attarray.cxx |    6 ++--
- sc/source/core/data/column.cxx   |    6 +---
- sc/source/core/data/table2.cxx   |   43 ++++++++++++++-----------------------
- 5 files changed, 25 insertions(+), 37 deletions(-)
-
-diff --git sc/inc/attarray.hxx sc/inc/attarray.hxx
-index 7d26451..cbf4d26 100644
---- sc/inc/attarray.hxx
-+++ sc/inc/attarray.hxx
-@@ -36,6 +36,7 @@ class ScEditDataArray;
- class ScMarkArray;
- class ScPatternAttr;
- class ScStyleSheet;
-+class ScFlatBoolRowSegments;
- 
- class Rectangle;
- class SfxItemPoolCache;
-@@ -160,7 +161,7 @@ public:
-                                 BOOL bRefresh, BOOL bAttrs );
-     BOOL	RemoveAreaMerge( SCROW nStartRow, SCROW nEndRow );
- 
--    void	FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset );
-+    void	FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset );
-     BOOL	IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const;
- 
-     void	DeleteAreaSafe(SCROW nStartRow, SCROW nEndRow);
-diff --git sc/inc/column.hxx sc/inc/column.hxx
-index f900fbf..2ef9e90 100644
---- sc/inc/column.hxx
-+++ sc/inc/column.hxx
-@@ -67,7 +67,7 @@ struct ScFunctionData;
- struct ScLineFlags;
- struct ScMergePatternState;
- struct ScSetStringParam;
--
-+class ScFlatBoolRowSegments;
- 
- #define COLUMN_DELTA	4
- 
-@@ -332,7 +332,7 @@ public:
-     const ScStyleSheet*	GetSelectionStyle( const ScMarkData& rMark, BOOL& rFound ) const;
-     const ScStyleSheet*	GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRow2 ) const;
- 
--    void		FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset );
-+    void		FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset );
-     BOOL		IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const;
- 
-                 /// May return -1 if not found
-diff --git sc/source/core/data/attarray.cxx sc/source/core/data/attarray.cxx
-index 92a7f73..56185d5 100644
---- sc/source/core/data/attarray.cxx
-+++ sc/source/core/data/attarray.cxx
-@@ -54,6 +54,7 @@
- #include "rechead.hxx"
- #include "globstr.hrc"
- #include "cell.hxx"
-+#include "segmenttree.hxx"
- 
- #undef DBG_INVALIDATE
- #define DBGOUTPUT(s) \
-@@ -1757,8 +1758,7 @@ SCsROW ScAttrArray::GetNextUnprotected( SCsROW nRow, BOOL bUp ) const
-     return nRet;
- }
- 
--
--void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset )
-+void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
- {
-     SCROW nStart = 0;
-     SCSIZE nPos = 0;
-@@ -1770,7 +1770,7 @@ void ScAttrArray::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pU
- //			for (SCROW nRow = nStart; nRow <= nEnd; nRow++)
- //				pUsed[nRow] = TRUE;
- 
--            memset( &pUsed[nStart], TRUE, nEnd-nStart+1 );
-+            rUsedRows.setTrue(nStart, nEnd);
- 
-             if (bReset)
-             {
-diff --git sc/source/core/data/column.cxx sc/source/core/data/column.cxx
-index c4eceb1..49435ca 100644
---- sc/source/core/data/column.cxx
-+++ sc/source/core/data/column.cxx
-@@ -617,13 +617,11 @@ const ScStyleSheet*	ScColumn::GetAreaStyle( BOOL& rFound, SCROW nRow1, SCROW nRo
-     return bEqual ? pStyle : NULL;
- }
- 
--
--void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, BOOL* pUsed, BOOL bReset )
-+void ScColumn::FindStyleSheet( const SfxStyleSheetBase* pStyleSheet, ScFlatBoolRowSegments& rUsedRows, bool bReset )
- {
--    pAttrArray->FindStyleSheet( pStyleSheet, pUsed, bReset );
-+    pAttrArray->FindStyleSheet( pStyleSheet, rUsedRows, bReset );
- }
- 
--
- BOOL ScColumn::IsStyleSheetUsed( const ScStyleSheet& rStyle, BOOL bGatherAllStyles ) const
- {
-     return pAttrArray->IsStyleSheetUsed( rStyle, bGatherAllStyles );
-diff --git sc/source/core/data/table2.cxx sc/source/core/data/table2.cxx
-index 53877f9..b710be8 100644
---- sc/source/core/data/table2.cxx
-+++ sc/source/core/data/table2.cxx
-@@ -57,6 +57,7 @@
- #include "bcaslot.hxx"
- #include "postit.hxx"
- #include "globstr.hrc"
-+#include "segmenttree.hxx"
- 
- #include <math.h>
- 
-@@ -1846,36 +1847,24 @@ void ScTable::StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, BOOL bRem
-                                 double nPPTX, double nPPTY,
-                                 const Fraction& rZoomX, const Fraction& rZoomY )
- {
--    BOOL* pUsed = new BOOL[MAXROWCOUNT];
--    memset( pUsed, 0, sizeof(BOOL) * (MAXROWCOUNT) );
-+    ScFlatBoolRowSegments aUsedRows;
-+    for (SCCOL i = 0; i <= MAXCOL; ++i)
-+        aCol[i].FindStyleSheet(pStyleSheet, aUsedRows, bRemoved);
- 
--    SCCOL nCol;
--    for (nCol=0; nCol<=MAXCOL; nCol++)
--        aCol[nCol].FindStyleSheet( pStyleSheet, pUsed, bRemoved );
--
--    BOOL bFound = FALSE;
--    SCROW nStart = 0, nEnd = 0;
--    for (SCROW i=0; i<=MAXROW; i++)
-+    SCROW nRow = 0;
-+    while (nRow <= MAXROW)
-     {
--        if (pUsed[i])
--        {
--            if (!bFound)
--            {
--                nStart = i;
--                bFound = TRUE;
--            }
--            nEnd = i;
--        }
--        else if (bFound)
--        {
--            SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE );
--            bFound = FALSE;
--        }
--    }
--    if (bFound)
--        SetOptimalHeight( nStart, nEnd, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE );
-+        ScFlatBoolRowSegments::RangeData aData;
-+        if (!aUsedRows.getRangeData(nRow, aData))
-+            // search failed!
-+            return;
- 
--    delete[] pUsed;
-+        SCROW nEndRow = aData.mnRow2;
-+        if (aData.mbValue)
-+            SetOptimalHeight(nRow, nEndRow, 0, pDev, nPPTX, nPPTY, rZoomX, rZoomY, FALSE);
-+
-+        nRow = nEndRow + 1;
-+    }
- }
- 
- 
--- 
-1.7.0.1
-
diff --git a/patches/dev300/calc-perf-ods-import-row-height.diff b/patches/dev300/calc-perf-ods-import-row-height.diff
deleted file mode 100644
index 96f4632..0000000
--- a/patches/dev300/calc-perf-ods-import-row-height.diff
+++ /dev/null
@@ -1,148 +0,0 @@
-From c8dd797cc1473d3d699d075bc8c8c659676ebab4 Mon Sep 17 00:00:00 2001
-From: Jan Holesovsky <kendy at suse.cz>
-Date: Fri, 14 May 2010 17:07:46 +0200
-Subject: [PATCH 684/768] calc-perf-ods-import-row-height.diff
-
----
- sc/inc/document.hxx              |    3 +++
- sc/inc/table.hxx                 |   12 ++++++++++++
- sc/source/core/data/documen9.cxx |    3 +++
- sc/source/core/data/document.cxx |    5 +++++
- sc/source/core/data/table2.cxx   |   21 +++++++++++++++++++++

... etc. - the rest is truncated


More information about the ooo-build-commit mailing list