[ooo-build-commit] Branch 'ooo/master' - 6 commits - chart2/source sc/inc sc/source

Jan Holesovsky kendy at kemper.freedesktop.org
Thu May 28 17:20:15 PDT 2009


 chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx            |   48 ++
 chart2/source/controller/dialogs/TabPages.hrc                          |   16 
 chart2/source/controller/dialogs/tp_PolarOptions.cxx                   |   18 
 chart2/source/controller/dialogs/tp_PolarOptions.hrc                   |    4 
 chart2/source/controller/dialogs/tp_PolarOptions.hxx                   |    3 
 chart2/source/controller/dialogs/tp_PolarOptions.src                   |   18 
 chart2/source/controller/dialogs/tp_SeriesToAxis.cxx                   |   69 ++
 chart2/source/controller/dialogs/tp_SeriesToAxis.hrc                   |   48 ++
 chart2/source/controller/dialogs/tp_SeriesToAxis.hxx                   |    5 
 chart2/source/controller/dialogs/tp_SeriesToAxis.src                   |   29 -
 chart2/source/controller/inc/SeriesOptionsItemConverter.hxx            |    3 
 chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx              |    3 
 chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx |   35 +
 chart2/source/inc/CachedDataSequence.hxx                               |    2 
 chart2/source/inc/ChartModelHelper.hxx                                 |    6 
 chart2/source/inc/DataSeriesHelper.hxx                                 |    8 
 chart2/source/inc/RangeHighlighter.hxx                                 |    1 
 chart2/source/inc/UncachedDataSequence.hxx                             |    2 
 chart2/source/inc/chartview/ChartSfxItemIds.hxx                        |    3 
 chart2/source/model/main/ChartModel.cxx                                |   15 
 chart2/source/model/main/ChartModel_Persistence.cxx                    |    2 
 chart2/source/model/main/Diagram.cxx                                   |    9 
 chart2/source/tools/CachedDataSequence.cxx                             |   24 -
 chart2/source/tools/ChartModelHelper.cxx                               |   93 +++
 chart2/source/tools/DataSeriesHelper.cxx                               |   91 +++
 chart2/source/tools/ImplUndoManager.cxx                                |    4 
 chart2/source/tools/RangeHighlighter.cxx                               |   10 
 chart2/source/tools/UncachedDataSequence.cxx                           |   18 
 chart2/source/view/axes/ScaleAutomatism.cxx                            |    4 
 chart2/source/view/inc/VDataSeries.hxx                                 |    2 
 chart2/source/view/main/ChartItemPool.cxx                              |    1 
 chart2/source/view/main/ChartView.cxx                                  |    5 
 chart2/source/view/main/VDataSeries.cxx                                |   80 ---
 sc/inc/cell.hxx                                                        |    3 
 sc/inc/chart2uno.hxx                                                   |   82 +++
 sc/inc/chartlis.hxx                                                    |   41 +
 sc/inc/editutil.hxx                                                    |    5 
 sc/inc/formularesult.hxx                                               |   39 +
 sc/inc/unonames.hxx                                                    |    5 
 sc/source/core/data/cell.cxx                                           |    7 
 sc/source/core/data/cell2.cxx                                          |    2 
 sc/source/core/data/column.cxx                                         |    6 
 sc/source/core/data/column2.cxx                                        |    7 
 sc/source/core/data/column3.cxx                                        |   11 
 sc/source/core/data/table2.cxx                                         |   12 
 sc/source/core/tool/chartlis.cxx                                       |   52 ++
 sc/source/core/tool/chartpos.cxx                                       |   94 +---
 sc/source/core/tool/editutil.cxx                                       |   14 
 sc/source/filter/dif/difimp.cxx                                        |  195 ++++++--
 sc/source/filter/excel/xechart.cxx                                     |   10 
 sc/source/filter/excel/xestyle.cxx                                     |    4 
 sc/source/filter/excel/xetable.cxx                                     |    4 
 sc/source/filter/excel/xichart.cxx                                     |   20 
 sc/source/filter/excel/xiescher.cxx                                    |    2 
 sc/source/filter/html/htmlexp.cxx                                      |   26 +
 sc/source/filter/inc/dif.hxx                                           |    4 
 sc/source/filter/inc/xestyle.hxx                                       |    5 
 sc/source/filter/inc/xichart.hxx                                       |    4 
 sc/source/filter/inc/xlchart.hxx                                       |    1 
 sc/source/filter/qpro/qpro.cxx                                         |    2 
 sc/source/filter/xml/XMLExportIterator.cxx                             |    1 
 sc/source/filter/xml/XMLExportIterator.hxx                             |    3 
 sc/source/filter/xml/xmlexprt.cxx                                      |   34 +
 sc/source/filter/xml/xmlexprt.hxx                                      |    4 
 sc/source/ui/app/transobj.cxx                                          |    7 
 sc/source/ui/attrdlg/scdlgfact.cxx                                     |    2 
 sc/source/ui/docshell/docsh.cxx                                        |    2 
 sc/source/ui/docshell/docsh4.cxx                                       |    2 
 sc/source/ui/docshell/impex.cxx                                        |  235 ++++++++--
 sc/source/ui/docshell/servobj.cxx                                      |    2 
 sc/source/ui/inc/impex.hxx                                             |   14 
 sc/source/ui/unoobj/chart2uno.cxx                                      |  231 ++++++++-
 sc/source/ui/view/cellsh2.cxx                                          |    1 
 sc/source/ui/view/output2.cxx                                          |    6 
 sc/source/ui/view/tabvwsh4.cxx                                         |   40 -
 75 files changed, 1494 insertions(+), 426 deletions(-)

New commits:
commit 20ec7a9c4c9f1a71d391ec689c54746310357c2b
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Mon May 25 15:57:28 2009 +0000

    #i10000#: XclImpChChart::ReadChProperties( XclImpStream& rStrm ) double declared and defined

diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 4397925..4947a31 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -3472,11 +3472,6 @@ void XclImpChChart::ReadChText( XclImpStream& rStrm )
     }
 }
 
-void XclImpChChart::ReadChProperties( XclImpStream& rStrm )
-{
-    rStrm >> maProps.mnFlags >> maProps.mnEmptyMode;
-}
-
 void XclImpChChart::Finalize()
 {
     // finalize series (must be done first)
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index d85f251..901701a 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -1348,14 +1348,12 @@ public:
 private:
     /** Reads a CHSERIES group (data series source and formatting). */
     void                ReadChSeries( XclImpStream& rStrm );
-    /** Reads a CHPROPERTIES record. */
+    /** Reads a CHPROPERTIES record (global chart properties). */
     void                ReadChProperties( XclImpStream& rStrm );
     /** Reads a CHAXESSET group (primary/secondary axes set). */
     void                ReadChAxesSet( XclImpStream& rStrm );
     /** Reads a CHTEXT group (chart title and series/point captions). */
     void                ReadChText( XclImpStream& rStrm );
-    /** Reads a CHPROPERTIES record (global chart properties). */
-    void                ReadChProperties( XclImpStream& rStrm );
 
     /** Final processing after reading the entire chart data. */
     void                Finalize();
commit 9e3bdc288cf89d30c5168ed97faf95f1b4b53cbd
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Mon May 25 15:31:24 2009 +0000

    #i10000#: EXC_CHPROPS_SHOWVISCELLS -> EXC_CHPROPS_SHOWVISIBLEONLY

diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index a1ccd4e..b654818 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -2756,7 +2756,7 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
         // global chart properties (only 'include hidden cells' attribute for now)
         ScfPropertySet aDiagramProp( xDiagram );
         bool bIncludeHidden = aDiagramProp.GetBoolProperty( EXC_CHPROP_INCLUDEHIDDENCELLS );
-        ::set_flag( maProps.mnFlags,  EXC_CHPROPS_SHOWVISCELLS, !bIncludeHidden );
+        ::set_flag( maProps.mnFlags,  EXC_CHPROPS_SHOWVISIBLEONLY, !bIncludeHidden );
 
         // initialize API conversion (remembers xChartDoc internally)
         InitConversion( xChartDoc );
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 9aac9dc..4397925 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -3421,7 +3421,7 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressB
     if( xStandardApiChartDoc.is() )
     {
         ScfPropertySet aDiagramProp( xStandardApiChartDoc->getDiagram() );
-        bool bShowVisCells = (maProps.mnFlags & EXC_CHPROPS_SHOWVISCELLS);
+        bool bShowVisCells = (maProps.mnFlags & EXC_CHPROPS_SHOWVISIBLEONLY);
         aDiagramProp.SetBoolProperty( EXC_CHPROP_INCLUDEHIDDENCELLS, !bShowVisCells  );
     }
 
commit 1cac4ffd2f0bf1ec7a9472b2e19cc9eb9bf24b7b
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Tue May 19 16:12:07 2009 +0000

    #i10000#: fix CRLF. Sigh

diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx
index bcac059..154a26e 100644
--- a/sc/source/ui/attrdlg/scdlgfact.cxx
+++ b/sc/source/ui/attrdlg/scdlgfact.cxx
@@ -32,7 +32,7 @@
 #include "precompiled_sc.hxx"
 
 #if ! ENABLE_LAYOUT_EXPERIMENTAL
-#undef ENABLE_LAYOUT
+#undef ENABLE_LAYOUT
 #endif
 
 #undef SC_DLLIMPLEMENTATION
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 28263f0..4d3dfc1 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1261,26 +1261,26 @@ ErrCode ScTabViewShell::DoPrint( SfxPrinter *pPrinter,
     ScDocShell* pDocShell = GetViewData()->GetDocShell();
     if ( pDocShell->CheckPrint( pPrintDialog, &GetViewData()->GetMarkData(), bPrintSelected, bIsAPI ) )
     {
-        // get the list of affected sheets before SfxViewShell::Print
-        bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
-
-        uno::Sequence<sal_Int32> aSheets;
-        SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
-        USHORT nPrinted = 0;
-        for ( SCTAB nTab=0; nTab<nTabCount; nTab++ )
-            if ( bAllTabs || rMarkData.GetTableSelect(nTab) )
-            {
-                aSheets.realloc( nPrinted + 1 );
-                aSheets[nPrinted] = nTab;
-                ++nPrinted;
-            }
-
-        uno::Sequence < beans::PropertyValue > aProps(1);
-        aProps[0].Name=::rtl::OUString::createFromAscii("PrintSheets");
-        aProps[0].Value <<= aSheets;
-        SetAdditionalPrintOptions( aProps );
-
-        // SfxViewShell::DoPrint calls Print (after StartJob etc.)
+        // get the list of affected sheets before SfxViewShell::Print
+        bool bAllTabs = ( pPrintDialog ? ( pPrintDialog->GetCheckedSheetRange() == PRINTSHEETS_ALL ) : SC_MOD()->GetPrintOptions().GetAllSheets() );
+
+        uno::Sequence<sal_Int32> aSheets;
+        SCTAB nTabCount = pDocShell->GetDocument()->GetTableCount();
+        USHORT nPrinted = 0;
+        for ( SCTAB nTab=0; nTab<nTabCount; nTab++ )
+            if ( bAllTabs || rMarkData.GetTableSelect(nTab) )
+            {
+                aSheets.realloc( nPrinted + 1 );
+                aSheets[nPrinted] = nTab;
+                ++nPrinted;
+            }
+
+        uno::Sequence < beans::PropertyValue > aProps(1);
+        aProps[0].Name=::rtl::OUString::createFromAscii("PrintSheets");
+        aProps[0].Value <<= aSheets;
+        SetAdditionalPrintOptions( aProps );
+
+        // SfxViewShell::DoPrint calls Print (after StartJob etc.)
         nRet = SfxViewShell::DoPrint( pPrinter, pPrintDialog, bSilent, bIsAPI );
     }
 
commit 56dd3bf5bf4af58db303f06d2d6d078a00042ada
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Tue May 19 09:32:45 2009 +0000

    CWS-TOOLING: integrate CWS impress169
    2009-05-13 17:37:21 +0200 sj  r271865 : #i100942# applied patch, removed oversafe buffer check (now without warnings on 64 bit platform)
    2009-05-13 12:27:18 +0200 sj  r271855 : #i101769# fixed line/fill attributes for graphic objects
    2009-05-12 10:25:17 +0200 cl  r271799 : report correct minimum cell hight for empty cells
    2009-04-28 17:29:46 +0200 cl  r271334 : fixed merge error
    2009-04-28 16:18:01 +0200 cl  r271330 : fixed build error
    2009-04-28 12:38:09 +0200 cl  r271320 : #i100129# images for new layouts
    2009-04-27 19:12:06 +0200 cl  r271302 : CWS-TOOLING: rebase CWS impress169 to trunk at 270723 (milestone: DEV300:m46)
    2009-04-20 19:13:28 +0200 sj  r271012 : #i100942# applied patch, removed oversafe buffer check
    2009-04-09 18:00:01 +0200 sj  r270719 : #158488# added rectangular gradient support
    2009-04-09 17:49:52 +0200 sj  r270718 : #158488# added rectangular gradient support
    2009-04-09 17:46:24 +0200 sj  r270717 : #158488# added rectangular gradient support
    2009-03-26 18:16:34 +0100 cl  r270098 : #i99867# applied patch from jlcheng to correctly register table design pane
    2009-03-26 18:12:11 +0100 cl  r270097 : #i100220# leave some items default so they are not overridden if a new table style is set
    2009-03-26 18:11:10 +0100 cl  r270096 : #i100220# clear only those items that are also in the style when assigning a new table layout
    2009-03-26 15:56:24 +0100 cl  r270085 : #i99977# listen to outliner and dispose if outliner dies
    2009-03-26 15:47:29 +0100 cl  r270084 : #i99977# made the Outliner a SfxBroadcaster so others can listen for its death
    2009-03-24 19:10:05 +0100 sj  r269991 : #i100490# fixed text resize problem
    2009-03-23 14:31:11 +0100 sj  r269872 : #i96083# added patch, (dubious && and ||)
    2009-03-19 17:55:11 +0100 sj  r269764 : #i100275# applied patch, row height is now correct even for rows containing no text
    2009-03-18 18:10:52 +0100 sj  r269701 : #i93616# solved performance problem when loading document
    2009-03-18 16:20:40 +0100 sj  r269688 : removing unused code
    2009-03-18 16:19:22 +0100 sj  r269687 : removing unused code
    2009-03-18 16:17:54 +0100 sj  r269686 : removing unused code
    2009-03-18 10:28:07 +0100 cl  r269643 : #i100029# let cells be disposed as soon as the table model is disposed
    2009-03-17 15:56:50 +0100 cl  r269614 : #i99984# new impress photo layouts 3x2 and 2x2
    2009-03-17 15:36:35 +0100 cl  r269611 : #i99984# adding new impress photo layouts 3x2 and 2x2
    2009-03-16 18:43:48 +0100 cl  r269564 : #i55224# correct internal links if pages are changed
    2009-03-16 16:40:38 +0100 cl  r269559 : #i55224# correct internal hyperlinks if slides are changed/renamed
    2009-03-16 15:34:12 +0100 cl  r269553 : #i99427# invalidate slots after promote/demote
    2009-03-13 18:18:20 +0100 sj  r269492 : #i92421# fixed loop if loading encrypted ppt file
    2009-03-13 14:51:58 +0100 sj  r269481 : #i93002# fixed crash if saving presentation without master title placeholder
    2009-03-13 12:26:21 +0100 sj  r269468 : #i100147# do not exceed the max point count if creating simple polygon via ::GetSimple
    2009-03-12 17:00:45 +0100 sj  r269427 : #i82518# justifying rectangles for arc/pie and chord actions, fixed round rectangle problem

diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 0e1b251..ad164cd 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -2989,7 +2989,7 @@ XclImpSimpleDffManager::XclImpSimpleDffManager( const XclImpRoot& rRoot, SvStrea
     SvxMSDffManager( rDffStrm, rRoot.GetBasePath(), 0, 0, rRoot.GetDoc().GetDrawLayer(), 1440, COL_DEFAULT, 24, 0, &rRoot.GetTracer().GetBaseTracer() ),
     XclImpRoot( rRoot )
 {
-    SetSvxMSDffSettings( SVXMSDFF_SETTINGS_CROP_BITMAPS | SVXMSDFF_SETTINGS_IMPORT_EXCEL | SVXMSDFF_SETTINGS_IMPORT_IAS );
+    SetSvxMSDffSettings( SVXMSDFF_SETTINGS_CROP_BITMAPS | SVXMSDFF_SETTINGS_IMPORT_EXCEL );
 }
 
 XclImpSimpleDffManager::~XclImpSimpleDffManager()
commit 73c534f79edb26667cf7ce355716aad15f33a58e
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Mon May 18 16:46:40 2009 +0000

    CWS-TOOLING: integrate CWS koheichart01
    2009-05-15 06:32:38 +0200 hde  r271925 : header fixed
    2009-04-14 16:23:35 +0200 hde  r270792 : #100231#
    2009-04-14 16:13:48 +0200 hde  r270790 : #100231#
    2009-04-14 15:56:14 +0200 hde  r270787 : #100231#
    2009-04-14 14:28:40 +0200 hde  r270767 : #100231#
    2009-04-14 14:27:30 +0200 hde  r270766 : #100231#
    2009-04-14 09:43:07 +0200 hde  r270749 : #100231#
    2009-04-14 09:25:52 +0200 hde  r270748 : #100231#
    2009-03-25 16:18:26 +0100 iha  r270034 : #i91578# removed compiler warning
    2009-03-25 03:20:36 +0100 kohei  r269992 : fixed a silly typo in in-line comment.
    2009-03-24 17:03:57 +0100 kohei  r269977 : Let's use row and column's hidden flags, instead of width/height, to determine cell's
    hidden state.
    2009-03-24 16:53:10 +0100 kohei  r269973 : The chart positioner no longer needs to skip hidden cells, as hidden cells are handled
    elsewhere.
    2009-03-24 16:50:12 +0100 kohei  r269971 : the index should be 0-based (although chart2 doesn't appear to make use of this data any more).
    2009-03-24 16:47:56 +0100 kohei  r269969 : Skip hidden cells during cache (re-)build, when the include hidden cells flag is
    false.  Also avoid adding data cache when the cell is hidden.
    2009-03-24 06:05:53 +0100 kohei  r269909 : fixed the build breakage after the resync.
    2009-03-24 06:05:34 +0100 kohei  r269908 : fixed the build breakage after the resync.
    2009-03-23 23:38:36 +0100 kohei  r269900 : CWS-TOOLING: rebase CWS koheichart01 to trunk at 269781 (milestone: DEV300:m44)
    2009-03-17 13:11:40 +0100 iha  r269597 : #i91578# import IncludeHiddenCells from xlsx
    2009-03-17 12:56:09 +0100 iha  r269594 : #i91578# import IncludeHiddenCells from xls correctly
    2009-03-17 12:49:13 +0100 iha  r269592 : #i91578# import IncludeHiddenCells from xls correctly
    2009-03-16 17:03:55 +0100 iha  r269561 : #i91578# remove unused variable
    2009-03-16 10:22:30 +0100 iha  r269509 : #i91578# changed wording
    2009-03-04 17:07:16 +0100 iha  r268846 : #i91578# display of hidden cells - remove unused property 'IsHidden'
    2009-03-04 17:04:22 +0100 iha  r268845 : #i91578# display of hidden cells - remove unused property 'IsHidden'
    2009-03-04 17:03:43 +0100 iha  r268844 : #i91578# display of hidden cells - remove unused property 'IsHidden'
    2009-03-04 16:24:30 +0100 iha  r268843 : #i91578# display of hidden cells - added missing property description
    2009-03-04 15:13:04 +0100 iha  r268835 : #i91578# display of hidden cells - remove unused code
    2009-03-04 14:38:44 +0100 iha  r268832 : #i91578# display of hidden cells - reset state corretly when doing undo/redo
    2009-03-04 13:42:10 +0100 iha  r268822 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
    2009-03-04 13:40:10 +0100 iha  r268821 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
    2009-03-04 13:37:05 +0100 iha  r268820 : #i81209# #i91578# display of hidden cells - don't show hidden cells per default but keep the hidden ranges
    2009-03-03 11:18:39 +0100 iha  r268713 : #i91578# display of hidden cells - hide control if the functionality is not offered by the data provider
    2009-03-02 17:41:37 +0100 kohei  r268684 : removed unintended change from DEV300_m38, which was probably introduced due to some sort of
    problem during rebase.
    2009-02-27 18:51:34 +0100 iha  r268613 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
    2009-02-27 18:45:48 +0100 iha  r268612 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
    2009-02-27 18:44:17 +0100 iha  r268611 : #i91578# display of hidden cells - interface redesign: data provider+sequences are now controlled by the chart via a new parameter 'IncludeHiddenCells' thus unwanted values can be removed early in the communication
    2009-02-27 18:35:09 +0100 iha  r268610 : #i91578# display of hidden cells - copy-paste-scenario: export hidden flag per column on copy for migration to locale table during import upon paste
    2009-02-19 06:47:56 +0100 kohei  r268257 : also, set the default value of a cached cell to NaN just in case.
    2009-02-19 06:42:08 +0100 kohei  r268256 : Set the IsValue flag to false by default so that an empty cell is properly flaged as non-value.
    This fixes the broken missing value treatment.
    2009-02-18 20:16:30 +0100 iha  r268255 : #i91578# display of hidden cells - radio button 'leave gap' was not clickable anymore
    2009-02-17 17:57:24 +0100 iha  r268185 : #i91578# display of hidden cells - corrected range highlighting
    2009-02-17 15:39:52 +0100 iha  r268174 : #i91578# display of hidden cells - still display data point value in tip help of data points in writer
    2009-02-17 11:21:00 +0100 iha  r267861 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series
    2009-02-17 11:15:14 +0100 iha  r267853 : #i91578# display of hidden cells - do not show a space nor a legend entry for hidden series
    2009-02-16 16:48:10 +0100 iha  r267826 : #i91578# display of hidden cells - group related ids and minimize changes
    2009-02-16 14:32:11 +0100 iha  r267813 : #i91578# display of hidden cells - don't share resource identifier as this easily produces conflicts -> move IDs for series options page into a separate file
    2009-02-16 13:21:44 +0100 iha  r267795 : #i91578# display of hidden cells - remove unused member
    2009-02-16 13:13:40 +0100 iha  r267794 : #i91578# display of hidden cells - remove unused methods
    2009-02-16 13:00:10 +0100 iha  r267792 : #i91578# display of hidden - avoid unnecessary data copy
    2009-02-16 11:40:41 +0100 iha  r267785 : #i91578# display of hidden - corrected typo
    2009-02-16 11:28:39 +0100 iha  r267783 : #i91578# display of hidden - set correct dirty state in method setIncludeHiddenCells
    2009-02-13 17:04:50 +0100 iha  r267734 : #i91578# corrected position and visibility of the controls for display of hidden cells in case of stock charts
    2009-02-13 15:30:17 +0100 iha  r267724 : #i91578# charts without category range and charts with data from writer table were broken causes by features changes for display of hidden cells
    2009-01-14 19:47:28 +0100 kohei  r266330 : #i91578# Fixed the issue with incorrect tooltip category values.
    2009-01-05 22:27:03 +0100 kohei  r265887 : fixed a regression where the x-axis failed to display values when they were numeric or dates.
    2008-12-24 17:01:15 +0100 kohei  r265800 : CWS-TOOLING: rebase CWS koheichart01 to trunk at 265758 (milestone: DEV300:m38)
    2008-12-24 16:03:08 +0100 kohei  r265799 : a little more code cleanup, mostly on tab to whitespace conversion on
    modified lines and removal of unnecessary 'using' statements.
    2008-12-24 15:52:00 +0100 kohei  r265798 : removed unnecessary header inclusion & remove hidden data *only when* the 'include hidden cells'
    options it false!  I'm glad I caught this.
    2008-12-24 07:41:23 +0100 kohei  r265796 : replaced duplicated local functions with a single template function.
    2008-12-24 06:37:15 +0100 kohei  r265795 : reverted my last commit, because it was not the right approach.
    Instead of using the original data point index in the object name,
    leave that index alone, and remove hidden data in the tooltip text
    value lookup code.
    2008-12-23 23:10:42 +0100 kohei  r265793 : fixed the tooltips so that they would display correct values, taking into account
    the hidden data points (if any).
    2008-12-20 05:26:07 +0100 kohei  r265739 : CWS-TOOLING: rebase CWS koheichart01 to trunk at 264807 (milestone: DEV300:m37)
    2008-12-18 15:49:59 +0100 kohei  r265696 : removed markRangeDirty() for now, since that method is still a bit controvertial per Niklas's comment in i#91578.
    2008-12-05 20:27:24 +0100 kohei  r264918 : removed a compiler warning.
    2008-12-05 20:24:02 +0100 kohei  r264917 : removed a compilar warning.
    2008-12-03 17:06:22 +0100 kohei  r264800 : recovered the original keyword file before it was stripped.
    2008-12-01 22:00:24 +0100 kohei  r264640 : by default, "include hidden cells" attribute is true.
    2008-12-01 19:03:07 +0100 kohei  r264628 : added accelerator for the plot hidden values check box.
    2008-12-01 18:32:02 +0100 kohei  r264626 : changed wording per Ingrid's suggestion.
    2008-11-26 08:09:36 +0100 kohei  r264341 : the 'Starnding angle' fixed line was 6 pixel short.
    2008-11-26 08:02:47 +0100 kohei  r264340 : added include-hidden-cells check box for the pie chart type too & some code cleanup.
    2008-11-26 07:41:45 +0100 kohei  r264339 : relocate the controls correctly for line chart types.
    2008-11-26 07:14:26 +0100 kohei  r264337 : #i95714# fixed typos that caused incorrect scaling of the y-axis under some conditions.
    2008-11-26 07:11:54 +0100 kohei  r264336 : added "Include hidden cells" check box in the data series options tab page.
    2008-11-25 21:04:58 +0100 kohei  r264333 : don't check for the number of charts; when importing from xls, the count may be
    zero even when the document has charts.
    2008-11-25 19:55:50 +0100 kohei  r264332 : patch from ooo-build applied.  This implements chart listener
    that listens on cells show/hide state for the chart's data areas.
    2008-11-25 19:52:38 +0100 kohei  r264331 : patch from ooo-build applied.
    2008-11-25 19:29:54 +0100 kohei  r264329 : new xml token for include-hidden-cells attribute.

diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index dd13b90..bcd5c80 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -112,6 +112,7 @@ enum
     PROP_DIAGRAM_DATAROW_SOURCE,
 
     PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
+    PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
 
     PROP_DIAGRAM_SORT_BY_X_VALUES,
 
@@ -233,6 +234,13 @@ void lcl_AddPropertiesToVector(
                   beans::PropertyAttribute::BOUND
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
 
+    rOutProperties.push_back(
+        Property( C2U( "IncludeHiddenCells" ),
+                  PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
+                  ::getBooleanCppuType(),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT ));
+
     //new for XY charts
     rOutProperties.push_back(
         Property( C2U( "SortByXValues" ),
@@ -1970,6 +1978,44 @@ Any WrappedAutomaticSizeProperty::getPropertyDefault( const Reference< beans::XP
 //-----------------------------------------------------------------------------------------------------------------
 //-----------------------------------------------------------------------------------------------------------------
 
+//PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS
+class WrappedIncludeHiddenCellsProperty : public WrappedProperty
+{
+public:
+    WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
+    virtual ~WrappedIncludeHiddenCellsProperty();
+
+    virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const
+                        throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+private: //member
+    ::boost::shared_ptr< Chart2ModelContact >   m_spChart2ModelContact;
+};
+
+WrappedIncludeHiddenCellsProperty::WrappedIncludeHiddenCellsProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
+            : WrappedProperty(C2U("IncludeHiddenCells"),C2U("IncludeHiddenCells"))
+            , m_spChart2ModelContact( spChart2ModelContact )
+{
+}
+
+WrappedIncludeHiddenCellsProperty::~WrappedIncludeHiddenCellsProperty()
+{
+}
+
+void WrappedIncludeHiddenCellsProperty::setPropertyValue( const Any& rOuterValue, const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const
+                throw (beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
+{
+    sal_Bool bNewValue = false;
+    if( ! (rOuterValue >>= bNewValue) )
+        throw lang::IllegalArgumentException( C2U("Property Dim3D requires boolean value"), 0, 0 );
+
+    ChartModelHelper::setIncludeHiddenCells( bNewValue, m_spChart2ModelContact->getChartModel() );
+}
+
+//-----------------------------------------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------------------------------------
+
 // ____ XDiagramProvider ____
 Reference< chart2::XDiagram > SAL_CALL DiagramWrapper::getDiagram()
     throw (uno::RuntimeException)
@@ -2025,6 +2071,8 @@ const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
     aWrappedProperties.push_back( new WrappedProperty( C2U( "StackedBarsConnected" ), C2U( "ConnectBars" ) ) );
     aWrappedProperties.push_back( new WrappedSolidTypeProperty( m_spChart2ModelContact ) );
     aWrappedProperties.push_back( new WrappedAutomaticSizeProperty() );
+    aWrappedProperties.push_back( new WrappedIncludeHiddenCellsProperty( m_spChart2ModelContact ) );
+
     return aWrappedProperties;
 }
 
diff --git a/chart2/source/controller/dialogs/TabPages.hrc b/chart2/source/controller/dialogs/TabPages.hrc
index a9fb1ab..fb58fd4 100644
--- a/chart2/source/controller/dialogs/TabPages.hrc
+++ b/chart2/source/controller/dialogs/TabPages.hrc
@@ -83,22 +83,6 @@
 #define CTL_BITMAP_PREVIEW          6
 */
 
-//#define TP_OPTIONS                 908
-#define GRP_OPT_AXIS				1
-#define RBT_OPT_AXIS_1				2
-#define RBT_OPT_AXIS_2				3
-#define MT_GAP						4
-#define MT_OVERLAP					5
-#define FT_GAP						6
-#define FT_OVERLAP					7
-#define GB_BAR						8
-#define CB_CONNECTOR				9
-#define CB_BARS_SIDE_BY_SIDE       10
-#define FL_PLOT_MISSING_VALUES     11
-#define RB_DONT_PAINT              12
-#define RB_ASSUME_ZERO             13
-#define RB_CONTINUE_LINE           14
-
 //------------
 //from old chart tplabel.hrc
 
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index 30cf24e..bf0c1e6 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -32,7 +32,6 @@
 #include "tp_PolarOptions.hxx"
 #include "tp_PolarOptions.hrc"
 #include "ResId.hxx"
-#include "TabPages.hrc"
 #include "chartview/ChartSfxItemIds.hxx"
 #include "NoWarningThisInCTOR.hxx"
 
@@ -51,7 +50,9 @@ PolarOptionsTabPage::PolarOptionsTabPage( Window* pWindow,const SfxItemSet& rInA
     m_aFL_StartingAngle( this, SchResId( FL_STARTING_ANGLE ) ),
     m_aAngleDial( this, SchResId( CT_ANGLE_DIAL ) ),
     m_aFT_Degrees( this, SchResId( FT_ROTATION_DEGREES ) ),
-    m_aNF_StartingAngle( this, SchResId( NF_STARTING_ANGLE ) )
+    m_aNF_StartingAngle( this, SchResId( NF_STARTING_ANGLE ) ),
+    m_aFL_PlotOptions( this, SchResId( FL_PLOT_OPTIONS_POLAR ) ),
+    m_aCB_IncludeHiddenCells( this, SchResId( CB_INCLUDE_HIDDEN_CELLS_POLAR ) )
 {
     FreeResource();
 
@@ -78,6 +79,9 @@ BOOL PolarOptionsTabPage::FillItemSet( SfxItemSet& rOutAttrs )
     if( m_aCB_Clockwise.IsVisible() )
         rOutAttrs.Put(SfxBoolItem(SCHATTR_CLOCKWISE,m_aCB_Clockwise.IsChecked()));
 
+    if (m_aCB_IncludeHiddenCells.IsVisible())
+        rOutAttrs.Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_aCB_IncludeHiddenCells.IsChecked()));
+
     return TRUE;
 }
 
@@ -108,6 +112,16 @@ void PolarOptionsTabPage::Reset(const SfxItemSet& rInAttrs)
     {
         m_aCB_Clockwise.Show(FALSE);
     }
+    if (rInAttrs.GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, TRUE, &pPoolItem) == SFX_ITEM_SET)
+    {
+        bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+        m_aCB_IncludeHiddenCells.Check(bVal);
+    }
+    else
+    {
+        m_aCB_IncludeHiddenCells.Show(FALSE);
+        m_aFL_PlotOptions.Show(FALSE);
+    }
 }
 
 //.............................................................................
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hrc b/chart2/source/controller/dialogs/tp_PolarOptions.hrc
index 722155b..b275a72 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hrc
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hrc
@@ -28,9 +28,13 @@
  *
  ************************************************************************/
 
+#include "ResourceIds.hrc"
+
 #define CB_CLOCKWISE 1
+#define CB_INCLUDE_HIDDEN_CELLS_POLAR 2
 
 #define FL_STARTING_ANGLE 1
+#define FL_PLOT_OPTIONS_POLAR 2
 
 #define CT_ANGLE_DIAL 1
 
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.hxx b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
index af6074a..abb84a6 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.hxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.hxx
@@ -58,6 +58,9 @@ private:
     svx::DialControl m_aAngleDial;
     FixedText        m_aFT_Degrees;
     NumericField     m_aNF_StartingAngle;
+
+    FixedLine        m_aFL_PlotOptions;
+    CheckBox         m_aCB_IncludeHiddenCells;
 };
 
 //.............................................................................
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.src b/chart2/source/controller/dialogs/tp_PolarOptions.src
index b9c25bb..568583b 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.src
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.src
@@ -28,7 +28,6 @@
  *
  ************************************************************************/
 
-#include "TabPages.hrc"
 #include "tp_PolarOptions.hrc"
 #include "HelpIds.hrc"
 
@@ -47,8 +46,8 @@ TabPage TP_POLAROPTIONS
     };
     FixedLine FL_STARTING_ANGLE
     {
-        Pos = MAP_APPFONT ( 12 , 21  ) ;
-        Size = MAP_APPFONT ( 242 , 12 ) ;
+        Pos = MAP_APPFONT ( 6 , 21  ) ;
+        Size = MAP_APPFONT ( 248 , 12 ) ;
         Text [ en-US ] = "Starting angle" ;
     };
     Control CT_ANGLE_DIAL
@@ -75,4 +74,17 @@ TabPage TP_POLAROPTIONS
         Maximum = 359 ;
         SpinSize = 5 ;
     };
+    FixedLine FL_PLOT_OPTIONS_POLAR
+    {
+        Pos = MAP_APPFONT ( 6 , 90  ) ;
+        Size = MAP_APPFONT ( 248 , 8 ) ;
+        Text [ en-US ] = "Plot options";
+    };
+    CheckBox CB_INCLUDE_HIDDEN_CELLS_POLAR
+    {
+        Pos = MAP_APPFONT ( 12 , 104 ) ;
+        Size = MAP_APPFONT ( 200 , 10 ) ;
+        TabStop = TRUE ;
+        Text [ en-US ] = "Include ~values from hidden cells";
+    };
 };
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
index aa562e1..7812b8b 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
@@ -31,9 +31,9 @@
 // MARKER(update_precomp.py): autogen include statement, do not remove
 #include "precompiled_chart2.hxx"
 #include "tp_SeriesToAxis.hxx"
+#include "tp_SeriesToAxis.hrc"
 
 #include "ResId.hxx"
-#include "TabPages.hrc"
 #include "chartview/ChartSfxItemIds.hxx"
 #include "NoWarningThisInCTOR.hxx"
 
@@ -43,6 +43,8 @@
 #include <svtools/intitem.hxx>
 //SfxIntegerListItem
 #include <svtools/ilstitem.hxx>
+#include <svtools/controldims.hrc>
+
 #include <com/sun/star/chart/MissingValueTreatment.hpp>
 
 //.............................................................................
@@ -63,10 +65,12 @@ SchOptionTabPage::SchOptionTabPage(Window* pWindow,const SfxItemSet& rInAttrs) :
     aMTOverlap(this,SchResId(MT_OVERLAP)),
     aCBConnect(this,SchResId(CB_CONNECTOR)),
     aCBAxisSideBySide(this,SchResId(CB_BARS_SIDE_BY_SIDE)),
-    m_aFL_EmptyCells(this,SchResId(FL_PLOT_MISSING_VALUES)),
+    m_aFL_PlotOptions(this,SchResId(FL_PLOT_OPTIONS)),
+    m_aFT_MissingValues(this,SchResId(FT_MISSING_VALUES)), 
     m_aRB_DontPaint(this,SchResId(RB_DONT_PAINT)),
     m_aRB_AssumeZero(this,SchResId(RB_ASSUME_ZERO)),
     m_aRB_ContinueLine(this,SchResId(RB_CONTINUE_LINE)),
+    m_aCBIncludeHiddenCells(this,SchResId(CB_INCLUDE_HIDDEN_CELLS)), 
     m_bProvidesSecondaryYAxis(true),
     m_bProvidesOverlapAndGapWidth(false)
 {
@@ -123,6 +127,9 @@ BOOL SchOptionTabPage::FillItemSet(SfxItemSet& rOutAttrs)
     else if(m_aRB_ContinueLine.IsChecked())
         rOutAttrs.Put(SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT,::com::sun::star::chart::MissingValueTreatment::CONTINUE));
 
+    if (m_aCBIncludeHiddenCells.IsVisible())
+        rOutAttrs.Put(SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, m_aCBIncludeHiddenCells.IsChecked()));
+
     return TRUE;
 }
 
@@ -212,13 +219,26 @@ void SchOptionTabPage::Reset(const SfxItemSet& rInAttrs)
         }
         else
         {
+            m_aFT_MissingValues.Show(FALSE);
             m_aRB_DontPaint.Show(FALSE);
             m_aRB_AssumeZero.Show(FALSE);
             m_aRB_ContinueLine.Show(FALSE);
-            m_aFL_EmptyCells.Show(FALSE);
         }
     }
 
+    // Include hidden cells
+    if (rInAttrs.GetItemState(SCHATTR_INCLUDE_HIDDEN_CELLS, TRUE, &pPoolItem) == SFX_ITEM_SET)
+    {
+        bool bVal = static_cast<const SfxBoolItem*>(pPoolItem)->GetValue();
+        m_aCBIncludeHiddenCells.Check(bVal);
+    }
+    else
+    {
+        m_aCBIncludeHiddenCells.Show(FALSE);
+        if(!m_aFT_MissingValues.IsVisible())
+            m_aFL_PlotOptions.Show(FALSE);
+    }
+
     AdaptControlPositionsAndVisibility();
 }
 
@@ -231,6 +251,17 @@ void SchOptionTabPage::Init( bool bProvidesSecondaryYAxis, bool bProvidesOverlap
     AdaptControlPositionsAndVisibility();
 }
 
+void lcl_offsetControl(Control& rCtrl, long nXOffset, long nYOffset )
+{
+    Point aPos = rCtrl.GetPosPixel();
+    rCtrl.SetPosPixel( Point(aPos.getX() + nXOffset, aPos.getY() + nYOffset) );
+}
+
+void lcl_optimzeRadioButtonSize( RadioButton& rCtrl )
+{
+    rCtrl.SetSizePixel( rCtrl.CalcMinimumSize() );
+}
+
 void SchOptionTabPage::AdaptControlPositionsAndVisibility()
 {
     aRbtAxis1.Show(m_bProvidesSecondaryYAxis);
@@ -254,20 +285,30 @@ void SchOptionTabPage::AdaptControlPositionsAndVisibility()
         else
             aPos = aGrpBar.GetPosPixel();
 
-        long nDiffX = aRbtAxis1.GetPosPixel().getX() - aGrpAxis.GetPosPixel().getX();
-        long nDiffY = aRbtAxis1.GetPosPixel().getY() - aGrpAxis.GetPosPixel().getY();
-        long nDiffY1 = aRbtAxis2.GetPosPixel().getY() - aRbtAxis1.GetPosPixel().getY();
-
-        m_aFL_EmptyCells.SetPosPixel( aPos );
-        m_aRB_DontPaint.SetPosPixel( Point( aPos.getX() + nDiffX, aPos.getY() + nDiffY ) );
-        m_aRB_AssumeZero.SetPosPixel( Point( aPos.getX() + nDiffX, aPos.getY() + nDiffY + nDiffY1  ) );
-        m_aRB_ContinueLine.SetPosPixel( Point( aPos.getX() + nDiffX, aPos.getY() + nDiffY + nDiffY1 * 2 ) );
+        long nYOffset = aPos.getY() - m_aFL_PlotOptions.GetPosPixel().getY();
+        lcl_offsetControl(m_aFL_PlotOptions,       0, nYOffset);
+        lcl_offsetControl(m_aFT_MissingValues,     0, nYOffset);
+        lcl_offsetControl(m_aRB_DontPaint,         0, nYOffset);
+        lcl_offsetControl(m_aRB_AssumeZero,        0, nYOffset);
+        lcl_offsetControl(m_aRB_ContinueLine,      0, nYOffset);
+        lcl_offsetControl(m_aCBIncludeHiddenCells, 0, nYOffset);
     }
 
-    if( !m_aRB_DontPaint.IsVisible() )
+    m_aFT_MissingValues.SetSizePixel( m_aFT_MissingValues.CalcMinimumSize() );
+    lcl_optimzeRadioButtonSize( m_aRB_DontPaint );
+    lcl_optimzeRadioButtonSize( m_aRB_AssumeZero );
+    lcl_optimzeRadioButtonSize( m_aRB_ContinueLine );
+
+    Size aControlDistance( m_aFT_MissingValues.LogicToPixel( Size(RSC_SP_CTRL_DESC_X,RSC_SP_CTRL_GROUP_Y), MapMode(MAP_APPFONT) ) );
+    long nXOffset = m_aFT_MissingValues.GetPosPixel().getX() + m_aFT_MissingValues.GetSizePixel().getWidth() + aControlDistance.getWidth() - m_aRB_DontPaint.GetPosPixel().getX();
+    lcl_offsetControl(m_aRB_DontPaint,         nXOffset, 0);
+    lcl_offsetControl(m_aRB_AssumeZero,        nXOffset, 0);
+    lcl_offsetControl(m_aRB_ContinueLine,      nXOffset, 0);
+    
+    if( !m_aFT_MissingValues.IsVisible() )
     {
-        m_aRB_ContinueLine.SetPosPixel( m_aRB_AssumeZero.GetPosPixel() );
-        m_aRB_AssumeZero.SetPosPixel( m_aRB_DontPaint.GetPosPixel() );
+        //for example for stock charts
+        m_aCBIncludeHiddenCells.SetPosPixel( m_aFT_MissingValues.GetPosPixel() );
     }
 }
 //.............................................................................
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.hrc b/chart2/source/controller/dialogs/tp_SeriesToAxis.hrc
new file mode 100644
index 0000000..2e96dc7
--- /dev/null
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.hrc
@@ -0,0 +1,48 @@
+/*************************************************************************
+ *
+ * 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: ,v $
+ * $Revision: $
+ *
+ * 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.
+ *
+ ************************************************************************/
+
+#include "ResourceIds.hrc"
+
+#define GRP_OPT_AXIS				1
+#define RBT_OPT_AXIS_1				2
+#define RBT_OPT_AXIS_2				3
+#define MT_GAP						4
+#define MT_OVERLAP					5
+#define FT_GAP						6
+#define FT_OVERLAP					7
+#define GB_BAR						8
+#define CB_CONNECTOR				9
+#define CB_BARS_SIDE_BY_SIDE       10
+#define FL_PLOT_OPTIONS            11
+#define FT_MISSING_VALUES          12
+#define RB_DONT_PAINT              13
+#define RB_ASSUME_ZERO             14
+#define RB_CONTINUE_LINE           15
+#define CB_INCLUDE_HIDDEN_CELLS    16
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
index af1f703..d6516a0 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.hxx
@@ -74,11 +74,14 @@ private: //member
     CheckBox	aCBConnect;
     CheckBox    aCBAxisSideBySide;
 
-    FixedLine   m_aFL_EmptyCells;
+    FixedLine   m_aFL_PlotOptions;
+    FixedText   m_aFT_MissingValues;
     RadioButton m_aRB_DontPaint;
     RadioButton m_aRB_AssumeZero;
     RadioButton m_aRB_ContinueLine;
 
+    CheckBox    m_aCBIncludeHiddenCells;
+
     DECL_LINK(EnableHdl, RadioButton * );
 
     sal_Int32   m_nAllSeriesAxisIndex;
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.src b/chart2/source/controller/dialogs/tp_SeriesToAxis.src
index 850e795..422e07b 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.src
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.src
@@ -28,7 +28,7 @@
  *
  ************************************************************************/
 #include "HelpIds.hrc"
-#include "TabPages.hrc"
+#include "tp_SeriesToAxis.hrc"
 
 TabPage TP_OPTIONS
 {
@@ -120,7 +120,7 @@ TabPage TP_OPTIONS
         Pos = MAP_APPFONT ( 12 , 97 ) ;
         Size = MAP_APPFONT ( 200 , 10 ) ;
         TabStop = TRUE ;
-        Text [ en-US ] = "Connection Lines";
+        Text [ en-US ] = "Connection lines";
     };
 
     CheckBox CB_BARS_SIDE_BY_SIDE
@@ -131,16 +131,23 @@ TabPage TP_OPTIONS
         Text [ en-US ] = "Show ~bars side by side";
     };
     
-    FixedLine FL_PLOT_MISSING_VALUES
+    FixedLine FL_PLOT_OPTIONS
     {
         Pos = MAP_APPFONT ( 6 , 113  ) ;
         Size = MAP_APPFONT ( 248 , 8 ) ;
+        Text [ en-US ] = "Plot options";
+    };
+
+    FixedText FT_MISSING_VALUES
+    {
+        Pos = MAP_APPFONT ( 12 , 127  ) ;
+        Size = MAP_APPFONT ( 80 , 8 ) ;
         Text [ en-US ] = "Plot missing values";
     };
     
     RadioButton RB_DONT_PAINT
     {
-        Pos = MAP_APPFONT ( 12 , 127  ) ;
+        Pos = MAP_APPFONT ( 82 , 127  ) ;
         Size = MAP_APPFONT ( 80 , 10 ) ;
         TabStop = TRUE ;
         Text [ en-US ] = "~Leave gap";  
@@ -148,7 +155,7 @@ TabPage TP_OPTIONS
     
     RadioButton RB_ASSUME_ZERO
     {
-        Pos = MAP_APPFONT ( 12 , 141  ) ;
+        Pos = MAP_APPFONT ( 82 , 141  ) ;
         Size = MAP_APPFONT ( 80 , 10 ) ;
         TabStop = TRUE ;
         Text [ en-US ] = "~Assume zero";  
@@ -156,9 +163,17 @@ TabPage TP_OPTIONS
     
     RadioButton RB_CONTINUE_LINE
     {
-        Pos = MAP_APPFONT ( 12 , 155  ) ;
+        Pos = MAP_APPFONT ( 82 , 155  ) ;
         Size = MAP_APPFONT ( 80 , 10 ) ;
         TabStop = TRUE ;
         Text [ en-US ] = "~Continue line";  
-    };  
+    };
+      
+    CheckBox CB_INCLUDE_HIDDEN_CELLS
+    {
+        Pos = MAP_APPFONT ( 12 , 172 ) ;
+        Size = MAP_APPFONT ( 200 , 10 ) ;
+        TabStop = TRUE ;
+        Text [ en-US ] = "Include ~values from hidden cells";
+    };
 };
diff --git a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
index 5966449..1f5ddc3 100644
--- a/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
+++ b/chart2/source/controller/inc/SeriesOptionsItemConverter.hxx
@@ -93,6 +93,9 @@ private:
 
     ::com::sun::star::uno::Sequence< sal_Int32 > m_aSupportedMissingValueTreatments;
     sal_Int32 m_nMissingValueTreatment;
+
+    bool m_bSupportingPlottingOfHiddenCells;
+    bool m_bIncludeHiddenCells;
 };
 
 } //  namespace wrapper
diff --git a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
index 806565f..a9910e8 100644
--- a/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
+++ b/chart2/source/controller/itemsetwrapper/SchWhichPairs.hxx
@@ -163,7 +163,8 @@ const USHORT nDataPointWhichPairs[] =
     SCHATTR_STARTING_ANGLE,SCHATTR_STARTING_ANGLE, \
     SCHATTR_CLOCKWISE,SCHATTR_CLOCKWISE, \
     SCHATTR_MISSING_VALUE_TREATMENT,SCHATTR_MISSING_VALUE_TREATMENT, \
-    SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS
+    SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS,SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS, \
+    SCHATTR_INCLUDE_HIDDEN_CELLS,SCHATTR_INCLUDE_HIDDEN_CELLS
 
 const USHORT nSeriesOptionsWhichPairs[] =
 {
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index eae94e8..ad2aca8 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -93,6 +93,8 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
         , m_bClockwise(false)
         , m_aSupportedMissingValueTreatments()
         , m_nMissingValueTreatment(0)
+        , m_bSupportingPlottingOfHiddenCells(false)
+        , m_bIncludeHiddenCells(true)
 {
     try
     {
@@ -159,6 +161,23 @@ SeriesOptionsItemConverter::SeriesOptionsItemConverter(
         m_aSupportedMissingValueTreatments = ChartTypeHelper::getSupportedMissingValueTreatments( xChartType );
         m_nMissingValueTreatment = DiagramHelper::getCorrectedMissingValueTreatment(
             ChartModelHelper::findDiagram(m_xChartModel), xChartType );
+
+        uno::Reference< XChartDocument > xChartDoc( m_xChartModel, uno::UNO_QUERY );
+        uno::Reference< beans::XPropertySet > xProp( xChartDoc->getDataProvider(), uno::UNO_QUERY );
+        if( xProp.is() )
+        {
+            try
+            {
+                //test whether the data provider offers this property
+                xProp->getPropertyValue(C2U("IncludeHiddenCells"));
+                //if not exception is thrown the property is offered
+                m_bSupportingPlottingOfHiddenCells = true;
+                xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= m_bIncludeHiddenCells;
+            }
+            catch( const beans::UnknownPropertyException& )
+            {
+            }
+        }
     }
     catch( uno::Exception ex )
     {
@@ -341,6 +360,16 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( USHORT nWhichId, const SfxIte
             }
         }
         break;
+        case SCHATTR_INCLUDE_HIDDEN_CELLS:
+        {
+            if( m_bSupportingPlottingOfHiddenCells )
+            {
+                bool bIncludeHiddenCells = static_cast<const SfxBoolItem &>(rItemSet.Get(nWhichId)).GetValue();
+                if (bIncludeHiddenCells != m_bIncludeHiddenCells)
+                    bChanged = ChartModelHelper::setIncludeHiddenCells( bIncludeHiddenCells, m_xChartModel );
+            }
+        }
+        break;
     }
     return bChanged;
 }
@@ -412,6 +441,12 @@ void SeriesOptionsItemConverter::FillSpecialItem(
             rOutItemSet.Put( SfxIntegerListItem( nWhichId, aList ) );
             break;
         }
+        case SCHATTR_INCLUDE_HIDDEN_CELLS:
+        {
+            if( m_bSupportingPlottingOfHiddenCells )
+                rOutItemSet.Put( SfxBoolItem(nWhichId, m_bIncludeHiddenCells) );
+            break;
+        }
         default:
             break;
    }
diff --git a/chart2/source/inc/CachedDataSequence.hxx b/chart2/source/inc/CachedDataSequence.hxx
index e655e7d..35f444c 100644
--- a/chart2/source/inc/CachedDataSequence.hxx
+++ b/chart2/source/inc/CachedDataSequence.hxx
@@ -167,8 +167,6 @@ protected:
     // <properties>
     sal_Int32                                       m_nNumberFormatKey;
     ::rtl::OUString                                 m_sRole;
-    sal_Bool                                        m_bIsHidden;
-    ::com::sun::star::uno::Sequence< sal_Int32 >    m_aHiddenValues;
     // </properties>
 
     enum DataType
diff --git a/chart2/source/inc/ChartModelHelper.hxx b/chart2/source/inc/ChartModelHelper.hxx
index 0eb3aba..6f68c7b 100644
--- a/chart2/source/inc/ChartModelHelper.hxx
+++ b/chart2/source/inc/ChartModelHelper.hxx
@@ -87,6 +87,12 @@ public:
 
     static void triggerRangeHighlighting( const ::com::sun::star::uno::Reference<
                                 ::com::sun::star::frame::XModel >& xModel );
+
+    static bool isIncludeHiddenCells( const ::com::sun::star::uno::Reference<
+                                ::com::sun::star::frame::XModel >& xChartModel );
+
+    static bool setIncludeHiddenCells( bool bIncludeHiddenCells, const ::com::sun::star::uno::Reference<
+                                ::com::sun::star::frame::XModel >& xChartModel );
 };
 
 //.............................................................................
diff --git a/chart2/source/inc/DataSeriesHelper.hxx b/chart2/source/inc/DataSeriesHelper.hxx
index 699c51c..48b520e 100644
--- a/chart2/source/inc/DataSeriesHelper.hxx
+++ b/chart2/source/inc/DataSeriesHelper.hxx
@@ -42,6 +42,7 @@
 
 #include <vector>
 #include <functional>
+#include <hash_set>
 
 namespace chart
 {
@@ -180,6 +181,13 @@ OOO_DLLPUBLIC_CHARTTOOLS bool areAllSeriesAttachedToSameAxis(
         const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType,
         sal_Int32 & rOutAxisIndex );
 
+OOO_DLLPUBLIC_CHARTTOOLS bool hasUnhiddenData( const ::com::sun::star::uno::Reference<
+        ::com::sun::star::chart2::XDataSeries >& xSeries );
+
+OOO_DLLPUBLIC_CHARTTOOLS
+sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nClippedIndex, const ::com::sun::star::uno::Reference<
+        ::com::sun::star::chart2::data::XDataSequence >& xDataSequence, bool bTranslate );
+
 } //  namespace DataSeriesHelper
 } //  namespace chart
 
diff --git a/chart2/source/inc/RangeHighlighter.hxx b/chart2/source/inc/RangeHighlighter.hxx
index a23752e..eaec0a7 100644
--- a/chart2/source/inc/RangeHighlighter.hxx
+++ b/chart2/source/inc/RangeHighlighter.hxx
@@ -111,6 +111,7 @@ private:
     ::com::sun::star::uno::Sequence< ::com::sun::star::chart2::data::HighlightedRange >
         m_aSelectedRanges;
     sal_Int32 m_nAddedListenerCount;
+    bool m_bIncludeHiddenCells;
 };
 
 } //  namespace chart
diff --git a/chart2/source/inc/UncachedDataSequence.hxx b/chart2/source/inc/UncachedDataSequence.hxx
index 733c3ed..3ced152 100644
--- a/chart2/source/inc/UncachedDataSequence.hxx
+++ b/chart2/source/inc/UncachedDataSequence.hxx
@@ -186,8 +186,6 @@ protected:
     // <properties>
     sal_Int32                                       m_nNumberFormatKey;
     ::rtl::OUString                                 m_sRole;
-    sal_Bool                                        m_bIsHidden;
-    ::com::sun::star::uno::Sequence< sal_Int32 >    m_aHiddenValues;
     ::rtl::OUString                                 m_aXMLRange;
     // </properties>
 
diff --git a/chart2/source/inc/chartview/ChartSfxItemIds.hxx b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
index 52e47c0..067389e 100644
--- a/chart2/source/inc/chartview/ChartSfxItemIds.hxx
+++ b/chart2/source/inc/chartview/ChartSfxItemIds.hxx
@@ -209,8 +209,9 @@
 #define SCHATTR_CLOCKWISE               (SCHATTR_CHARTTYPE_START + 10)
 #define SCHATTR_MISSING_VALUE_TREATMENT     (SCHATTR_CHARTTYPE_START + 11)
 #define SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS (SCHATTR_CHARTTYPE_START + 12)
+#define SCHATTR_INCLUDE_HIDDEN_CELLS    (SCHATTR_CHARTTYPE_START + 13)
 
-#define SCHATTR_CHARTTYPE_END           SCHATTR_AVAILABLE_MISSING_VALUE_TREATMENTS
+#define SCHATTR_CHARTTYPE_END           SCHATTR_INCLUDE_HIDDEN_CELLS
 
 // items for transporting information to dialogs
 #define SCHATTR_MISC_START              (SCHATTR_CHARTTYPE_END + 1)
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 6753bbc..d89cdb3 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -43,6 +43,8 @@
 #include "DisposeHelper.hxx"
 #include "ControllerLockGuard.hxx"
 #include "ObjectIdentifier.hxx"
+#include "ChartModelHelper.hxx"
+
 #include <comphelper/InlineContainer.hxx>
 #include <comphelper/processfactory.hxx>
 
@@ -703,6 +705,19 @@ sal_Bool SAL_CALL ChartModel::hasInternalDataProvider()
     {
         // /--
         MutexGuard aGuard( m_aModelMutex );
+        uno::Reference< beans::XPropertySet > xProp( xProvider, uno::UNO_QUERY );
+        if( xProp.is() )
+        {
+            try
+            {
+                sal_Bool bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( Reference< frame::XModel >(this) );
+                xProp->setPropertyValue(C2U("IncludeHiddenCells"), uno::makeAny(bIncludeHiddenCells));
+            }
+            catch( const beans::UnknownPropertyException& )
+            {
+            }
+        }
+
         m_pImplChartModel->SetDataProvider( xProvider );
         // \--
     }
diff --git a/chart2/source/model/main/ChartModel_Persistence.cxx b/chart2/source/model/main/ChartModel_Persistence.cxx
index 23ca920..0fb90e0 100644
--- a/chart2/source/model/main/ChartModel_Persistence.cxx
+++ b/chart2/source/model/main/ChartModel_Persistence.cxx
@@ -37,6 +37,7 @@
 #include "ChartDebugTrace.hxx"
 #include "macros.hxx"
 #include "ChartViewHelper.hxx"
+#include "ChartModelHelper.hxx"
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/document/XExporter.hpp>
 #include <com/sun/star/document/XImporter.hpp>
@@ -407,6 +408,7 @@ void SAL_CALL ChartModel::initNew()
     try
     {
         m_pImplChartModel->CreateDefaultChart();
+        ChartModelHelper::setIncludeHiddenCells( false, this );
     }
     catch( uno::Exception & ex )
     {
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index 02bf2b7..308ed19 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -78,6 +78,7 @@ enum
     PROP_DIAGRAM_SORT_BY_X_VALUES,
     PROP_DIAGRAM_CONNECT_BARS,
     PROP_DIAGRAM_GROUP_BARS_PER_AXIS,
+    PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
     PROP_DIAGRAM_STARTING_ANGLE,
     PROP_DIAGRAM_RIGHT_ANGLED_AXES,
     PROP_DIAGRAM_PERSPECTIVE,
@@ -125,6 +126,13 @@ void lcl_AddPropertiesToVector(
                   | beans::PropertyAttribute::MAYBEDEFAULT ));
 
     rOutProperties.push_back(
+        Property( C2U("IncludeHiddenCells"),
+                  PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS,
+                  ::getBooleanCppuType(),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT ));
+
+    rOutProperties.push_back(
         Property( C2U( "StartingAngle" ),
                   PROP_DIAGRAM_STARTING_ANGLE,
                   ::getCppuType( reinterpret_cast< const sal_Int32 * >(0) ),
@@ -170,6 +178,7 @@ void lcl_AddDefaultsToMap(
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_SORT_BY_X_VALUES, false );
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_CONNECT_BARS, false );
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_GROUP_BARS_PER_AXIS, true );
+    ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_INCLUDE_HIDDEN_CELLS, true );
     ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_DIAGRAM_RIGHT_ANGLED_AXES, false );
     ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_DIAGRAM_STARTING_ANGLE, 90 );
 }
diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx
index 5d899ba..736a82a 100644
--- a/chart2/source/tools/CachedDataSequence.cxx
+++ b/chart2/source/tools/CachedDataSequence.cxx
@@ -68,9 +68,7 @@ enum
 {
 //     PROP_SOURCE_IDENTIFIER,
     PROP_NUMBERFORMAT_KEY,
-    PROP_PROPOSED_ROLE,
-    PROP_HIDDEN,
-    PROP_HIDDEN_VALUES
+    PROP_PROPOSED_ROLE
 };
 }  // anonymous namespace
 
@@ -82,7 +80,6 @@ namespace chart
 CachedDataSequence::CachedDataSequence()
         : OPropertyContainer( GetBroadcastHelper()),
           CachedDataSequence_Base( GetMutex()),
-          m_bIsHidden( true ),
           m_eCurrentDataType( NUMERICAL ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
 {
@@ -91,7 +88,6 @@ CachedDataSequence::CachedDataSequence()
 CachedDataSequence::CachedDataSequence( const Reference< uno::XComponentContext > & /*xContext*/ )
         : OPropertyContainer( GetBroadcastHelper()),
           CachedDataSequence_Base( GetMutex()),
-          m_bIsHidden( true ),
           m_eCurrentDataType( MIXED ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder( ))
 {
@@ -101,7 +97,6 @@ CachedDataSequence::CachedDataSequence( const Reference< uno::XComponentContext
 CachedDataSequence::CachedDataSequence( const ::std::vector< double > & rVector )
         : OPropertyContainer( GetBroadcastHelper()),
           CachedDataSequence_Base( GetMutex()),
-          m_bIsHidden( true ),
           m_eCurrentDataType( NUMERICAL ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
 {
@@ -112,7 +107,6 @@ CachedDataSequence::CachedDataSequence( const ::std::vector< double > & rVector
 CachedDataSequence::CachedDataSequence( const ::std::vector< OUString > & rVector )
         : OPropertyContainer( GetBroadcastHelper()),
           CachedDataSequence_Base( GetMutex()),
-          m_bIsHidden( true ),
           m_eCurrentDataType( TEXTUAL ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
 {
@@ -123,7 +117,6 @@ CachedDataSequence::CachedDataSequence( const ::std::vector< OUString > & rVecto
 CachedDataSequence::CachedDataSequence( const OUString & rSingleText )
         : OPropertyContainer( GetBroadcastHelper()),
           CachedDataSequence_Base( GetMutex()),
-          m_bIsHidden( true ),
           m_eCurrentDataType( TEXTUAL ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
 {
@@ -135,7 +128,6 @@ CachedDataSequence::CachedDataSequence( const OUString & rSingleText )
 CachedDataSequence::CachedDataSequence( const ::std::vector< Any > & rVector )
         : OPropertyContainer( GetBroadcastHelper()),
           CachedDataSequence_Base( GetMutex()),
-          m_bIsHidden( true ),
           m_eCurrentDataType( MIXED ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
 {
@@ -150,8 +142,6 @@ CachedDataSequence::CachedDataSequence( const CachedDataSequence & rSource )
           CachedDataSequence_Base( GetMutex()),
           m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
           m_sRole( rSource.m_sRole ),
-          m_bIsHidden( rSource.m_bIsHidden ),
-          m_aHiddenValues( rSource.m_aHiddenValues ),
           m_eCurrentDataType( rSource.m_eCurrentDataType ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
 {
@@ -187,18 +177,6 @@ void CachedDataSequence::registerProperties()
                       0,   // PropertyAttributes
                       & m_sRole,
                       ::getCppuType( & m_sRole ) );
-
-    registerProperty( C2U( "IsHidden" ),
-                      PROP_HIDDEN,
-                      0,   // PropertyAttributes
-                      & m_bIsHidden,
-                      ::getCppuType( & m_bIsHidden ) );
-
-    registerProperty( C2U( "HiddenValues" ),
-                      PROP_HIDDEN_VALUES,
-                      0,   // PropertyAttributes
-                      & m_aHiddenValues,
-                      ::getCppuType( & m_aHiddenValues ) );
 }
 
 Sequence< double > CachedDataSequence::Impl_getNumericalData() const
diff --git a/chart2/source/tools/ChartModelHelper.cxx b/chart2/source/tools/ChartModelHelper.cxx
index 1129fb4..b6d2ce9 100644
--- a/chart2/source/tools/ChartModelHelper.cxx
+++ b/chart2/source/tools/ChartModelHelper.cxx
@@ -33,6 +33,9 @@
 #include "ChartModelHelper.hxx"
 #include "macros.hxx"
 #include "DiagramHelper.hxx"
+#include "DataSourceHelper.hxx"
+#include "ControllerLockGuard.hxx"
+
 #include <com/sun/star/chart2/data/XDataReceiver.hpp>
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/chart2/XChartTypeContainer.hpp>
@@ -137,6 +140,96 @@ void ChartModelHelper::triggerRangeHighlighting( const uno::Reference< frame::XM
     }
 }
 
+bool ChartModelHelper::isIncludeHiddenCells( const uno::Reference< frame::XModel >& xChartModel )
+{
+    bool bIncluded = true;  // hidden cells are included by default.
+
+    uno::Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram(xChartModel) );
+    if (!xDiagram.is())
+        return bIncluded;
+
+    uno::Reference< beans::XPropertySet > xProp( xDiagram, uno::UNO_QUERY );
+    if (!xProp.is())
+        return bIncluded;
+
+    try
+    {
+        xProp->getPropertyValue(C2U("IncludeHiddenCells")) >>= bIncluded;
+    }
+    catch( const beans::UnknownPropertyException& )
+    {
+    }
+
+    return bIncluded;
+}
+
+bool ChartModelHelper::setIncludeHiddenCells( bool bIncludeHiddenCells, const uno::Reference< frame::XModel >& xChartModel )
+{
+    bool bChanged = false;
+    try
+    {
+        ControllerLockGuard aLockedControllers( xChartModel );
+
+        uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(xChartModel), uno::UNO_QUERY );
+        if (xDiagramProperties.is())
+        {
+            bool bOldValue = bIncludeHiddenCells;
+            xDiagramProperties->getPropertyValue( C2U("IncludeHiddenCells") ) >>= bOldValue;
+            if( bOldValue == bIncludeHiddenCells )
+                bChanged = true;
+
+            //set the property on all instances in all cases to get the different objects in sync!
+
+            uno::Any aNewValue = uno::makeAny(bIncludeHiddenCells);
+
+            try
+            {
+                uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
+                if( xChartDoc.is() )
+                {
+                    uno::Reference< beans::XPropertySet > xDataProviderProperties( xChartDoc->getDataProvider(), uno::UNO_QUERY );
+                    if( xDataProviderProperties.is() )
+                        xDataProviderProperties->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
+                }
+            }
+            catch( const beans::UnknownPropertyException& )
+            {
+                //the property is optional!
+            }
+
+            try
+            {
+                uno::Reference< chart2::data::XDataSource > xUsedData( DataSourceHelper::getUsedData( xChartModel ) );
+                if( xUsedData.is() )
+                {
+                    uno::Reference< beans::XPropertySet > xProp;
+                    uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aData( xUsedData->getDataSequences());
+                    for( sal_Int32 i=0; i<aData.getLength(); ++i )
+                    {
+                        xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getValues(), uno::UNO_QUERY ) );
+                        if(xProp.is())
+                            xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
+                        xProp.set( uno::Reference< beans::XPropertySet >( aData[i]->getLabel(), uno::UNO_QUERY ) );
+                        if(xProp.is())
+                            xProp->setPropertyValue(C2U("IncludeHiddenCells"), aNewValue );
+                    }
+                }
+            }
+            catch( const beans::UnknownPropertyException& )
+            {
+                //the property is optional!
+            }
+            
+            xDiagramProperties->setPropertyValue( C2U("IncludeHiddenCells"), aNewValue);
+        }
+    }
+    catch (uno::Exception& e)
+    {
+        ASSERT_EXCEPTION(e);
+    }
+    return bChanged;
+}
+
 //.............................................................................
 } //namespace chart
 //.............................................................................
diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx
index daba96d..5d27ec1 100644
--- a/chart2/source/tools/DataSeriesHelper.cxx
+++ b/chart2/source/tools/DataSeriesHelper.cxx
@@ -644,5 +644,96 @@ bool areAllSeriesAttachedToSameAxis( const uno::Reference< chart2::XChartType >&
     }
 }
 
+namespace
+{
+
+bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSequence >& xDataSequence )
+{
+    if( !xDataSequence.is() )
+        return false;
+    uno::Reference< beans::XPropertySet > xProp( xDataSequence, uno::UNO_QUERY );
+    if( xProp.is() )
+    {
+        uno::Sequence< sal_Int32 > aHiddenValues;
+        try
+        {
+            xProp->getPropertyValue( C2U( "HiddenValues" ) ) >>= aHiddenValues;
+            if( !aHiddenValues.getLength() )
+                return true;
+        }
+        catch( uno::Exception& e )
+        {
+            (void)e; // avoid warning
+            return true;
+        }
+    }
+    if( xDataSequence->getData().getLength() )
+        return true;
+    return false;
+}
+
+}
+
+bool hasUnhiddenData( const uno::Reference< chart2::XDataSeries >& xSeries )
+{
+    uno::Reference< chart2::data::XDataSource > xDataSource =
+        uno::Reference< chart2::data::XDataSource >( xSeries, uno::UNO_QUERY );
+
+    uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aDataSequences = xDataSource->getDataSequences();
+
+    for(sal_Int32 nN = aDataSequences.getLength();nN--;)
+    {
+        if( !aDataSequences[nN].is() )
+            continue;
+        if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getValues() ) )
+            return true;
+        if( lcl_SequenceHasUnhiddenData( aDataSequences[nN]->getLabel() ) )
+            return true;
+    }
+    return false;
+}
+
+struct lcl_LessIndex
+{
+    inline bool operator() ( const sal_Int32& first, const sal_Int32& second )
+    {
+        return ( first < second );
+    }
+};
+
+sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nIndex, const Reference< chart2::data::XDataSequence >& xDataSequence, bool bTranslate )
+{
+    if( !bTranslate )
+        return nIndex;
+
+    try
+    {
+        uno::Reference<beans::XPropertySet> xProp( xDataSequence, uno::UNO_QUERY );
+        if( xProp.is())
+        {
+            Sequence<sal_Int32> aHiddenIndicesSeq;
+            xProp->getPropertyValue( C2U("HiddenValues") ) >>= aHiddenIndicesSeq;
+            if( aHiddenIndicesSeq.getLength() )
+            {
+                ::std::vector< sal_Int32 > aHiddenIndices( ContainerHelper::SequenceToVector( aHiddenIndicesSeq ) );
+                ::std::sort( aHiddenIndices.begin(), aHiddenIndices.end(), lcl_LessIndex() );
+
+                sal_Int32 nHiddenCount = static_cast<sal_Int32>(aHiddenIndices.size());
+                for( sal_Int32 nN = 0; nN < nHiddenCount; ++nN)
+                {
+                    if( aHiddenIndices[nN] <= nIndex )
+                        nIndex += 1;
+                    else
+                        break;
+                }
+            }
+        }
+    }
+    catch (const beans::UnknownPropertyException&)
+    {
+    }
+    return nIndex;
+}
+
 } //  namespace DataSeriesHelper
 } //  namespace chart
diff --git a/chart2/source/tools/ImplUndoManager.cxx b/chart2/source/tools/ImplUndoManager.cxx
index d169091..f2309a9 100644
--- a/chart2/source/tools/ImplUndoManager.cxx
+++ b/chart2/source/tools/ImplUndoManager.cxx
@@ -37,6 +37,7 @@
 #include "ControllerLockGuard.hxx"
 #include "PropertyHelper.hxx"
 #include "DataSourceHelper.hxx"
+#include "ChartModelHelper.hxx"
 
 #include <com/sun/star/chart/XChartDataArray.hpp>
 #include <com/sun/star/chart2/XChartDocument.hpp>
@@ -170,6 +171,9 @@ void UndoElement::applyModelContentToModel(
             Reference< chart2::XChartDocument > xSource( xModelToCopyFrom, uno::UNO_QUERY_THROW );
             Reference< chart2::XChartDocument > xDestination( xInOutModelToChange, uno::UNO_QUERY_THROW );
 
+            // propagate the correct flag for plotting of hidden values to the data provider and all used sequences
+            ChartModelHelper::setIncludeHiddenCells( ChartModelHelper::isIncludeHiddenCells( xModelToCopyFrom ) , xInOutModelToChange );
+
             // diagram
             xDestination->setFirstDiagram( xSource->getFirstDiagram());
 
diff --git a/chart2/source/tools/RangeHighlighter.cxx b/chart2/source/tools/RangeHighlighter.cxx
index c53b589..4273129 100644
--- a/chart2/source/tools/RangeHighlighter.cxx
+++ b/chart2/source/tools/RangeHighlighter.cxx
@@ -38,6 +38,7 @@
 #include "ContainerHelper.hxx"
 #include "macros.hxx"
 #include "ObjectIdentifier.hxx"
+#include "DataSeriesHelper.hxx"
 
 #include <com/sun/star/chart2/XDataSeries.hpp>
 #include <com/sun/star/chart/ErrorBarStyle.hpp>
@@ -78,7 +79,8 @@ RangeHighlighter::RangeHighlighter(
     const Reference< view::XSelectionSupplier > & xSelectionSupplier ) :
         impl::RangeHighlighter_Base( m_aMutex ),
         m_xSelectionSupplier( xSelectionSupplier ),
-        m_nAddedListenerCount( 0 )
+        m_nAddedListenerCount( 0 ),
+        m_bIncludeHiddenCells(true)
 {
 }
 
@@ -104,6 +106,8 @@ void RangeHighlighter::determineRanges()
             if( xController.is())
                 xChartModel.set( xController->getModel());
 
+            m_bIncludeHiddenCells = ChartModelHelper::isIncludeHiddenCells( xChartModel );
+
             uno::Any aSelection( m_xSelectionSupplier->getSelection());
             OUString aCID;
             if(( aSelection >>= aCID ) &&
@@ -271,11 +275,13 @@ void RangeHighlighter::fillRangesForDataPoint( const Reference< uno::XInterface
                             -1,
                             nPreferredColor,
                             sal_False ));
+
+                sal_Int32 nUnhiddenIndex = DataSeriesHelper::translateIndexFromHiddenToFullSequence( nIndex, xValues, !m_bIncludeHiddenCells );
                 if( xValues.is())
                     aHilightedRanges.push_back(
                         chart2::data::HighlightedRange(
                             xValues->getSourceRangeRepresentation(),
-                            nIndex,
+                            nUnhiddenIndex,
                             nPreferredColor,
                             sal_False ));
             }
diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx
index 704ca26..8eb7bd5 100644
--- a/chart2/source/tools/UncachedDataSequence.cxx
+++ b/chart2/source/tools/UncachedDataSequence.cxx
@@ -63,8 +63,6 @@ enum
 //     PROP_SOURCE_IDENTIFIER,
     PROP_NUMBERFORMAT_KEY,
     PROP_PROPOSED_ROLE,
-    PROP_HIDDEN,
-    PROP_HIDDEN_VALUES,
     PROP_XML_RANGE
 };
 }  // anonymous namespace
@@ -79,7 +77,6 @@ UncachedDataSequence::UncachedDataSequence(
     const OUString & rRangeRepresentation )
         : OPropertyContainer( GetBroadcastHelper()),
           UncachedDataSequence_Base( GetMutex()),
-          m_bIsHidden( true ),
           m_xDataProvider( xIntDataProv ),
           m_aSourceRepresentation( rRangeRepresentation ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
@@ -93,7 +90,6 @@ UncachedDataSequence::UncachedDataSequence(
     const OUString & rRole )
         : OPropertyContainer( GetBroadcastHelper()),
           UncachedDataSequence_Base( GetMutex()),
-          m_bIsHidden( true ),
           m_xDataProvider( xIntDataProv ),
           m_aSourceRepresentation( rRangeRepresentation ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
@@ -109,8 +105,6 @@ UncachedDataSequence::UncachedDataSequence( const UncachedDataSequence & rSource
           UncachedDataSequence_Base( GetMutex()),
           m_nNumberFormatKey( rSource.m_nNumberFormatKey ),
           m_sRole( rSource.m_sRole ),
-          m_bIsHidden( rSource.m_bIsHidden ),
-          m_aHiddenValues( rSource.m_aHiddenValues ),
           m_xDataProvider( rSource.m_xDataProvider ),
           m_aSourceRepresentation( rSource.m_aSourceRepresentation ),
           m_xModifyEventForwarder( new ModifyListenerHelper::ModifyEventForwarder())
@@ -135,18 +129,6 @@ void UncachedDataSequence::registerProperties()
                       & m_sRole,
                       ::getCppuType( & m_sRole ) );
 
-    registerProperty( C2U( "IsHidden" ),
-                      PROP_HIDDEN,
-                      0,   // PropertyAttributes
-                      & m_bIsHidden,
-                      ::getCppuType( & m_bIsHidden ) );
-
-    registerProperty( C2U( "HiddenValues" ),
-                      PROP_HIDDEN_VALUES,
-                      0,   // PropertyAttributes
-                      & m_aHiddenValues,
-                      ::getCppuType( & m_aHiddenValues ) );
-
     registerProperty( C2U( "CachedXMLRange" ),
                       PROP_XML_RANGE,
                       0,   // PropertyAttributes
diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx
index 7c58236..3e412c4 100644
--- a/chart2/source/view/axes/ScaleAutomatism.cxx
+++ b/chart2/source/view/axes/ScaleAutomatism.cxx
@@ -134,7 +134,7 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
         if( m_aSourceScale.AxisType==AxisType::PERCENT )
             rExplicitScale.Minimum = 0.0;
         else if( ::rtl::math::isNan( m_fValueMinimum ) )
-            rExplicitScale.Minimum = 0.0;   //@todo get Minimum from scsaling or from plotter????
+            rExplicitScale.Minimum = 0.0;   //@todo get Minimum from scaling or from plotter????
         else
             rExplicitScale.Minimum = m_fValueMinimum;
     }
@@ -143,7 +143,7 @@ void ScaleAutomatism::calculateExplicitScaleAndIncrement(
     if( bAutoMaximum )
     {
         if( m_aSourceScale.AxisType==AxisType::PERCENT )
-            rExplicitScale.Minimum = 1.0;
+            rExplicitScale.Maximum = 1.0;
         else if( ::rtl::math::isNan( m_fValueMaximum ) )
             rExplicitScale.Maximum = 10.0;  //@todo get Maximum from scaling or from plotter????
         else
diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index e41340c..7e11efd 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -59,7 +59,7 @@ class VDataSequence
 {
 public:
     void init( const ::com::sun::star::uno::Reference<
-        ::com::sun::star::chart2::data::XDataSequence >& xModel);
+        ::com::sun::star::chart2::data::XDataSequence >& xModel );
     bool is() const;
     void clear();
     double getValue( sal_Int32 index ) const;
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index e00deac..4cc8699 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -184,6 +184,7 @@ ChartItemPool::ChartItemPool():
     ppPoolDefaults[SCHATTR_DIAGRAM_STYLE        - SCHATTR_START] = new SvxChartStyleItem( CHSTYLE_2D_COLUMN, SCHATTR_DIAGRAM_STYLE );
     ppPoolDefaults[SCHATTR_TEXTBREAK            - SCHATTR_START] = new SfxBoolItem( SCHATTR_TEXTBREAK, FALSE );
     ppPoolDefaults[SCHATTR_GROUP_BARS_PER_AXIS  - SCHATTR_START] = new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS, FALSE);
+    ppPoolDefaults[SCHATTR_INCLUDE_HIDDEN_CELLS - SCHATTR_START] = new SfxBoolItem(SCHATTR_INCLUDE_HIDDEN_CELLS, TRUE);
     ppPoolDefaults[SCHATTR_STARTING_ANGLE       - SCHATTR_START] = new SfxInt32Item( SCHATTR_STARTING_ANGLE, 90 );
     ppPoolDefaults[SCHATTR_CLOCKWISE            - SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, FALSE );
 
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 69bd598..4e8eac0 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -631,6 +631,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
     sal_Bool bSortByXValues = sal_False;
     sal_Bool bConnectBars = sal_False;
     sal_Bool bGroupBarsPerAxis = sal_True;
+    sal_Bool bIncludeHiddenCells = sal_True;
     sal_Int32 nStartingAngle = 90;
     try
     {
@@ -638,6 +639,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
         xDiaProp->getPropertyValue( C2U( "SortByXValues" ) ) >>= bSortByXValues;
         xDiaProp->getPropertyValue( C2U( "ConnectBars" ) ) >>= bConnectBars;
         xDiaProp->getPropertyValue( C2U( "GroupBarsPerAxis" ) ) >>= bGroupBarsPerAxis;
+        xDiaProp->getPropertyValue( C2U( "IncludeHiddenCells" ) ) >>= bIncludeHiddenCells;
         xDiaProp->getPropertyValue( C2U( "StartingAngle" ) ) >>= nStartingAngle;
     }
     catch( const uno::Exception & ex )
@@ -703,6 +705,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
                 uno::Reference< XDataSeries > xDataSeries( aSeriesList[nS], uno::UNO_QUERY );
                 if(!xDataSeries.is())
                     continue;
+                if( !bIncludeHiddenCells && !DataSeriesHelper::hasUnhiddenData(xDataSeries) )
+                    continue;
+
                 VDataSeries* pSeries = new VDataSeries( xDataSeries );
 
                 pSeries->setGlobalSeriesIndex(nGlobalSeriesIndex);
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index f7a81e9..eb90adb 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -37,6 +37,7 @@
 #include "LabelPositionHelper.hxx"
 #include "ChartTypeHelper.hxx"
 #include "ContainerHelper.hxx"
+#include "DataSeriesHelper.hxx"
 #include "MeanValueRegressionCurveCalculator.hxx"
 
 #include <com/sun/star/chart/MissingValueTreatment.hpp>
@@ -61,87 +62,10 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::chart2;
 using ::com::sun::star::uno::Reference;
 
-namespace
-{
-    struct lcl_LessIndex
-    {
-        inline bool operator() ( const sal_Int32& first,
-                             const sal_Int32& second )
-        {
-            return ( first < second );
-        }
-    };
-
-    void lcl_removeIndices( uno::Sequence< double >& rValues, const uno::Sequence< sal_Int32 >& rIndicesToRemove )
-    {
-        if( !rIndicesToRemove.getLength() )
-            return;
-
-        ::std::vector< sal_Int32 > aIndicesToRemove( ContainerHelper::SequenceToVector( rIndicesToRemove) );
-        ::std::sort( aIndicesToRemove.begin(), aIndicesToRemove.end(), lcl_LessIndex() );
-        
-        sal_Int32 nTarget=0;
-        sal_Int32 nR = 0;
-        sal_Int32 nRemove = aIndicesToRemove[nR];
-        for( sal_Int32 nSource=0; nSource<rValues.getLength(); nSource++ )
-        {
-            if( nSource<nRemove || nRemove==-1 )
-            {
-                if( nTarget < nSource )
-                    rValues[nTarget]=rValues[nSource];
-                nTarget++;
-                continue;
-            }
-            if( nSource==nRemove )
-            {
-                ++nR;
-                if( nR<static_cast<sal_Int32>(aIndicesToRemove.size()) )
-                    nRemove = aIndicesToRemove[nR];
-                else
-                    nRemove = -1;
-            }
-        }
-
-        if( nTarget>0 )
-            rValues.realloc( nTarget );
-        else
-            rValues.realloc(0);
-    }
-}
-
 void VDataSequence::init( const uno::Reference< data::XDataSequence >& xModel )
 {
-    bool bDisplayHiddenCells = true; //todo: make this configurable in future
-    bool bIsHidden = false;
-    uno::Sequence< sal_Int32 > aHiddenValues;
-    if( !bDisplayHiddenCells )
-    {
-        uno::Reference<beans::XPropertySet> xProp(xModel, uno::UNO_QUERY );
-        if( xProp.is())
-        {
-            try
-            {
-                xProp->getPropertyValue( C2U( "IsHidden" ) ) >>= bIsHidden;
-                xProp->getPropertyValue( C2U( "HiddenValues" ) ) >>= aHiddenValues;
-            }
-            catch( uno::Exception& e )
-            {
-                ASSERT_EXCEPTION( e );
-            }
-        }
-    }
-
     Model = xModel;
-    if( bDisplayHiddenCells || !bIsHidden )
-        Doubles = DataSequenceToDoubleSequence( xModel );
-
-    if( !bDisplayHiddenCells )
-    {
-        if( bIsHidden )
-            Doubles.realloc(0);
-        else if( aHiddenValues.getLength() )
-            lcl_removeIndices( Doubles, aHiddenValues );
-    }
+    Doubles = DataSequenceToDoubleSequence( xModel );
 }
 
 bool VDataSequence::is() const
diff --git a/sc/inc/chart2uno.hxx b/sc/inc/chart2uno.hxx
index 288de00..93afe64 100644
--- a/sc/inc/chart2uno.hxx
+++ b/sc/inc/chart2uno.hxx
@@ -35,6 +35,7 @@
 #include "rangelst.hxx"
 #include "externalrefmgr.hxx"
 #include "token.hxx"
+#include "chartlis.hxx"
 
 #include <svtools/lstner.hxx>
 #include <com/sun/star/chart/ChartDataRowSource.hpp>
@@ -54,7 +55,6 @@
 // #include <com/sun/star/lang/XUnoTunnel.hpp>
 // #endif
 #include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
 #include <cppuhelper/implbase4.hxx>
 #include <cppuhelper/implbase6.hxx>
 #include <cppuhelper/implbase7.hxx>
@@ -74,9 +74,10 @@ class ScDocument;
 // DataProvider ==============================================================
 
 class ScChart2DataProvider : public
-                ::cppu::WeakImplHelper3<
+                ::cppu::WeakImplHelper4<
                     ::com::sun::star::chart2::data::XDataProvider,
                     ::com::sun::star::chart2::data::XRangeXMLConversion,
+                    ::com::sun::star::beans::XPropertySet,
                     ::com::sun::star::lang::XServiceInfo>,
                 SfxListener
 {
@@ -125,6 +126,59 @@ public:
     virtual ::rtl::OUString SAL_CALL convertRangeFromXML( const ::rtl::OUString& sXMLRange )
         throw ( ::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::IllegalArgumentException );
 
+    // XPropertySet ----------------------------------------------------------
+
+    virtual ::com::sun::star::uno::Reference<
+        ::com::sun::star::beans::XPropertySetInfo> SAL_CALL
+        getPropertySetInfo() throw( ::com::sun::star::uno::RuntimeException);
+
+    virtual void SAL_CALL setPropertyValue(
+            const ::rtl::OUString& rPropertyName,
+            const ::com::sun::star::uno::Any& rValue)
+        throw( ::com::sun::star::beans::UnknownPropertyException,
+                ::com::sun::star::beans::PropertyVetoException,
+                ::com::sun::star::lang::IllegalArgumentException,
+                ::com::sun::star::lang::WrappedTargetException,
+                ::com::sun::star::uno::RuntimeException);
+
+    virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
+            const ::rtl::OUString& rPropertyName)
+        throw( ::com::sun::star::beans::UnknownPropertyException,
+                ::com::sun::star::lang::WrappedTargetException,
+                ::com::sun::star::uno::RuntimeException);
+
+    virtual void SAL_CALL addPropertyChangeListener(
+            const ::rtl::OUString& rPropertyName,
+            const ::com::sun::star::uno::Reference<
+            ::com::sun::star::beans::XPropertyChangeListener>& xListener)
+        throw( ::com::sun::star::beans::UnknownPropertyException,
+                ::com::sun::star::lang::WrappedTargetException,
+                ::com::sun::star::uno::RuntimeException);
+
+    virtual void SAL_CALL removePropertyChangeListener(
+            const ::rtl::OUString& rPropertyName,
+            const ::com::sun::star::uno::Reference<
+            ::com::sun::star::beans::XPropertyChangeListener>& rListener)
+        throw( ::com::sun::star::beans::UnknownPropertyException,
+                ::com::sun::star::lang::WrappedTargetException,
+                ::com::sun::star::uno::RuntimeException);
+
+    virtual void SAL_CALL addVetoableChangeListener(
+            const ::rtl::OUString& rPropertyName,
+            const ::com::sun::star::uno::Reference<
+            ::com::sun::star::beans::XVetoableChangeListener>& rListener)
+        throw( ::com::sun::star::beans::UnknownPropertyException,
+                ::com::sun::star::lang::WrappedTargetException,
+                ::com::sun::star::uno::RuntimeException);
+
+    virtual void SAL_CALL removeVetoableChangeListener(
+            const ::rtl::OUString& rPropertyName,
+            const ::com::sun::star::uno::Reference<
+            ::com::sun::star::beans::XVetoableChangeListener>& rListener)
+        throw( ::com::sun::star::beans::UnknownPropertyException,
+                ::com::sun::star::lang::WrappedTargetException,
+                ::com::sun::star::uno::RuntimeException);
+
     // XServiceInfo ----------------------------------------------------------
 
     virtual ::rtl::OUString SAL_CALL getImplementationName() throw(
@@ -158,6 +212,8 @@ private:
 private:
 
     ScDocument*                 m_pDocument;
+    SfxItemPropertySet          m_aPropSet;
+    sal_Bool                    m_bIncludeHiddenCells;
 };
 
 
@@ -287,7 +343,7 @@ class ScChart2DataSequence : public
 public:
     explicit ScChart2DataSequence( ScDocument* pDoc,
             const com::sun::star::uno::Reference< com::sun::star::chart2::data::XDataProvider >& xDP,
-            ::std::vector<ScSharedTokenRef>* pTokens);
+            ::std::vector<ScSharedTokenRef>* pTokens, bool bIncludeHiddenCells );
 
     virtual ~ScChart2DataSequence();
     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
@@ -404,6 +460,9 @@ public:
 // 	static ScChart2DataSequence* getImplementation( const com::sun::star::uno::Reference<
 // 									com::sun::star::uno::XInterface> xObj );
 
+private:
+    void setDataChangedHint(bool b);
+
     // Implementation --------------------------------------------------------
 
     void    RefChanged();
@@ -461,12 +520,24 @@ private:
         Item();
     };
 
+    class HiddenRangeListener : public ScChartHiddenRangeListener
+    {
+    public:
+        HiddenRangeListener(ScChart2DataSequence& rParent);
+        virtual ~HiddenRangeListener();
+
+        virtual void notify();
+
+    private:
+        ScChart2DataSequence& mrParent;
+    };
+
     ::std::list<Item>           m_aDataArray;
     ::com::sun::star::uno::Sequence<sal_Int32>  m_aHiddenValues;
 
     // properties
     ::com::sun::star::chart2::data::DataSequenceRole  m_aRole;
-    sal_Bool                    m_bHidden;
+    sal_Bool                    m_bIncludeHiddenCells;
 
     // internals
     typedef ::std::auto_ptr< ::std::vector<ScSharedTokenRef> >  TokenListPtr;
@@ -481,6 +552,7 @@ private:
     com::sun::star::uno::Reference < com::sun::star::chart2::data::XDataProvider > m_xDataProvider;
     SfxItemPropertySet		    m_aPropSet;
 
+    ::std::auto_ptr<HiddenRangeListener> m_pHiddenListener;
     ScLinkListener*             m_pValueListener;
     XModifyListenerArr_Impl     m_aValueListeners;
 
@@ -625,7 +697,7 @@ private:
 
     // properties
     ::com::sun::star::chart2::data::DataSequenceRole  m_aRole;
-    sal_Bool                    m_bHidden;
+    sal_Bool                    m_bIncludeHiddenCells;
     // internals
     ScRangeListRef              m_xRanges;
     ScDocument*                 m_pDocument;
diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index 33650dd..a8a97d3 100644
--- a/sc/inc/chartlis.hxx
+++ b/sc/inc/chartlis.hxx
@@ -41,6 +41,7 @@
 
 #include <memory>
 #include <vector>
+#include <list>
 #include <hash_set>
 
 class ScDocument;
@@ -131,9 +132,31 @@ public:
                         { return !operator==( r ); }
 };
 
+// ============================================================================
+
+class ScChartHiddenRangeListener
+{
+public:
+    ScChartHiddenRangeListener();
+    virtual ~ScChartHiddenRangeListener();
+    virtual void notify() = 0;
+};
+
+// ============================================================================
+
 class ScChartListenerCollection : public ScStrCollection
 {
+public:
+    struct RangeListenerItem
+    {
+        ScRange                     maRange;
+        ScChartHiddenRangeListener* mpListener;
+        explicit RangeListenerItem(const ScRange& rRange, ScChartHiddenRangeListener* p);
+    };
+
 private:
+    ::std::list<RangeListenerItem> maHiddenListeners;
+
     Timer			aTimer;
     ScDocument*		pDoc;
 
@@ -173,6 +196,24 @@ public:
     void            UpdateChartsContainingTab( SCTAB nTab );
 
     BOOL			operator==( const ScChartListenerCollection& );
+
+    /** 
+     * Start listening on hide/show change within specified cell range.  A 
+     * single listener may listen on multiple ranges when the caller passes 
+     * the same pointer multiple times with different ranges. 
+     *  
+     * Note that the caller is responsible for managing the life-cycle of the 
+     * listener instance. 
+     */
+    void            StartListeningHiddenRange( const ScRange& rRange, 
+                                               ScChartHiddenRangeListener* pListener );
+
+    /** 
+     * Remove all ranges associated with passed listener instance from the 
+     * list of hidden range listeners.  This does not delete the passed 
+     * listener instance. 
+     */
+    void            EndListeningHiddenRange( ScChartHiddenRangeListener* pListener );
 };
 
 
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index 9cccc82..9df643f 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -608,8 +608,9 @@
 #define SC_UNO_COMPILEFAP           "CompileFAP"
 
 // Chart2
-#define SC_UNONAME_ISHIDDEN         "IsHidden"
-#define SC_UNONAME_ROLE             "Role"
+#define SC_UNONAME_ROLE                 "Role"
+#define SC_UNONAME_HIDDENVALUES         "HiddenValues"
+#define SC_UNONAME_INCLUDEHIDDENCELLS   "IncludeHiddenCells"
 #define SC_UNONAME_HIDDENVALUES     "HiddenValues"
 
 // Solver
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 707e346..e84d3e4 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -623,8 +623,6 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
         {
             //	Charts muessen beim Ein-/Ausblenden angepasst werden
             ScChartListenerCollection* pCharts = pDestTab->pDocument->GetChartListenerCollection();
-            if ( pCharts && !pCharts->GetCount() )
-                pCharts = NULL;
 
             BOOL bWidth  = (nRow1==0 && nRow2==MAXROW && pColWidth && pDestTab->pColWidth);
             BOOL bHeight = (nCol1==0 && nCol2==MAXCOL && pRowHeight && pDestTab->pRowHeight);
@@ -2254,7 +2252,7 @@ void ScTable::ShowCol(SCCOL nCol, BOOL bShow)
                 SetDrawPageSize();
 
             ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
-            if ( pCharts && pCharts->GetCount() )
+            if ( pCharts )
                 pCharts->SetRangeDirty(ScRange( nCol, 0, nTab, nCol, MAXROW, nTab ));
         }
     }
@@ -2291,7 +2289,7 @@ void ScTable::ShowRow(SCROW nRow, BOOL bShow)
                 SetDrawPageSize();
 
             ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
-            if ( pCharts && pCharts->GetCount() )
+            if ( pCharts )
                 pCharts->SetRangeDirty(ScRange( 0, nRow, nTab, MAXCOL, nRow, nTab ));
         }
     }
@@ -2332,7 +2330,7 @@ void ScTable::DBShowRow(SCROW nRow, BOOL bShow)
         if (bWasVis != bShow)
         {
             ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
-            if ( pCharts && pCharts->GetCount() )
+            if ( pCharts )
                 pCharts->SetRangeDirty(ScRange( 0, nRow, nTab, MAXCOL, nRow, nTab ));
 
             if (pOutlineTable)
@@ -2380,7 +2378,7 @@ void ScTable::DBShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
         if ( bChanged )
         {
             ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
-            if ( pCharts && pCharts->GetCount() )
+            if ( pCharts )
                 pCharts->SetRangeDirty(ScRange( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab ));
         }
 
@@ -2432,7 +2430,7 @@ void ScTable::ShowRows(SCROW nRow1, SCROW nRow2, BOOL bShow)
         if ( bChanged )
         {
             ScChartListenerCollection* pCharts = pDocument->GetChartListenerCollection();
-            if ( pCharts && pCharts->GetCount() )
+            if ( pCharts )
                 pCharts->SetRangeDirty(ScRange( 0, nStartRow, nTab, MAXCOL, nEndRow, nTab ));
         }
 
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 8c4e876..00af942 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -42,6 +42,7 @@
 
 using namespace com::sun::star;
 using ::std::vector;
+using ::std::list;
 using ::std::hash_set;
 using ::std::auto_ptr;
 using ::std::unary_function;
@@ -454,9 +455,24 @@ BOOL ScChartListener::operator==( const ScChartListener& r )
     return *mpTokens == *r.mpTokens;
 }
 
+// ============================================================================
+
+ScChartHiddenRangeListener::ScChartHiddenRangeListener()
+{
+}
+
+ScChartHiddenRangeListener::~ScChartHiddenRangeListener()
+{
+    // empty d'tor
+}
 
 // === ScChartListenerCollection ======================================
 
+ScChartListenerCollection::RangeListenerItem::RangeListenerItem(const ScRange& rRange, ScChartHiddenRangeListener* p) :
+    maRange(rRange), mpListener(p)
+{
+}
+
 ScChartListenerCollection::ScChartListenerCollection( ScDocument* pDocP ) :
     ScStrCollection( 4, 4, FALSE ),
     pDoc( pDocP )
@@ -643,6 +659,14 @@ void ScChartListenerCollection::SetRangeDirty( const ScRange& rRange )
     }
     if ( bDirty )
         StartTimer();
+
+    // New hidden range listener implementation
+    for (list<RangeListenerItem>::iterator itr = maHiddenListeners.begin(), itrEnd = maHiddenListeners.end();
+          itr != itrEnd; ++itr)
+    {
+        if (itr->maRange.Intersects(rRange))
+            itr->mpListener->notify();
+    }
 }
 
 
@@ -682,6 +706,34 @@ BOOL ScChartListenerCollection::operator==( const ScChartListenerCollection& r )
     return TRUE;
 }
 
+void ScChartListenerCollection::StartListeningHiddenRange( const ScRange& rRange, ScChartHiddenRangeListener* pListener )
+{
+    RangeListenerItem aItem(rRange, pListener);
+    maHiddenListeners.push_back(aItem);
+}
+
+namespace {
+
+struct MatchListener : public ::std::unary_function<
+        ScChartListenerCollection::RangeListenerItem, bool>
+{
+    MatchListener(const ScChartHiddenRangeListener* pMatch) :
+        mpMatch(pMatch)
+    {
+    }
+
+    bool operator() (const ScChartListenerCollection::RangeListenerItem& rItem) const
+    {
+        return mpMatch == rItem.mpListener;
+    }
 
+private:
+    const ScChartHiddenRangeListener* mpMatch;
+};
 
+}
+void ScChartListenerCollection::EndListeningHiddenRange( ScChartHiddenRangeListener* pListener )
+{
+    maHiddenListeners.remove_if(MatchListener(pListener));
+}
 
diff --git a/sc/source/core/tool/chartpos.cxx b/sc/source/core/tool/chartpos.cxx
index 36ea082..2327555 100644
--- a/sc/source/core/tool/chartpos.cxx
+++ b/sc/source/core/tool/chartpos.cxx
@@ -307,27 +307,18 @@ void ScChartPositioner::CheckColRowHeaders()
     if ( aRangeListRef->Count() == 1 )
     {
         aRangeListRef->First()->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
-        // Beschriftungen auch nach hidden Cols/Rows finden
-        while ( nCol1 <= nCol2 && (pDocument->GetColFlags(
-                nCol1, nTab1) & CR_HIDDEN) != 0 )
-            nCol1++;
-        while ( nRow1 <= nRow2 && (pDocument->GetRowFlags(
-                nRow1, nTab1) & CR_HIDDEN) != 0 )
-            nRow1++;
         if ( nCol1 > nCol2 || nRow1 > nRow2 )
             bColStrings = bRowStrings = FALSE;
         else
         {
             for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++)
             {
-                if ( iCol==nCol1 || (pDocument->GetColFlags( iCol, nTab1) & CR_HIDDEN) == 0 )
-                    if (pDocument->HasValueData( iCol, nRow1, nTab1 ))
+                if (pDocument->HasValueData( iCol, nRow1, nTab1 ))
                         bColStrings = FALSE;
             }
             for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++)
             {
-                if ( iRow==nRow1 || (pDocument->GetRowFlags( iRow, nTab1) & CR_HIDDEN) == 0 )
-                    if (pDocument->HasValueData( nCol1, iRow, nTab1 ))
+                if (pDocument->HasValueData( nCol1, iRow, nTab1 ))
                         bRowStrings = FALSE;
             }
         }
@@ -341,43 +332,22 @@ void ScChartPositioner::CheckColRowHeaders()
         {
             pR->GetVars( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
             BOOL bTopRow = (nRow1 == nStartRow);
-            BOOL bHidOk;
             if ( bRowStrings && (bVert || nCol1 == nStartCol) )
             {	// NONE oder ROWS: RowStrings in jeder Selektion moeglich
                 // COLS oder BOTH: nur aus der ersten Spalte
-                while ( nCol1 <= nCol2 && (pDocument->GetColFlags(
-                        nCol1, nTab1) & CR_HIDDEN) != 0 )
-                    nCol1++;
-                while ( nRow1 <= nRow2 && (pDocument->GetRowFlags(
-                        nRow1, nTab1) & CR_HIDDEN) != 0 )
-                    nRow1++;
                 if ( nCol1 <= nCol2 )
                     for (iRow=nRow1; iRow<=nRow2 && bRowStrings; iRow++)
                     {
-                        if ( iRow==nRow1 || (pDocument->GetRowFlags( iRow, nTab1) & CR_HIDDEN) == 0 )
-                            if (pDocument->HasValueData( nCol1, iRow, nTab1 ))
+                        if (pDocument->HasValueData( nCol1, iRow, nTab1 ))
                                 bRowStrings = FALSE;
                     }
-                bHidOk = TRUE;
             }
-            else
-                bHidOk = FALSE;
             if ( bColStrings && bTopRow )
             {	// ColStrings nur aus der ersten Zeile
-                if ( !bHidOk )
-                {
-                    while ( nCol1 <= nCol2 && (pDocument->GetColFlags(
-                            nCol1, nTab1) & CR_HIDDEN) != 0 )
-                        nCol1++;
-                    while ( nRow1 <= nRow2 && (pDocument->GetRowFlags(
-                            nRow1, nTab1) & CR_HIDDEN) != 0 )
-                        nRow1++;
-                }
                 if ( nRow1 <= nRow2 )
                     for (iCol=nCol1; iCol<=nCol2 && bColStrings; iCol++)
                     {
-                        if ( iCol==nCol1 || (pDocument->GetColFlags( iCol, nTab1) & CR_HIDDEN) == 0 )
-                            if (pDocument->HasValueData( iCol, nRow1, nTab1 ))
+                        if (pDocument->HasValueData( iCol, nRow1, nTab1 ))
                                 bColStrings = FALSE;
                     }
             }
@@ -439,40 +409,34 @@ void ScChartPositioner::CreatePositionMap()
                     static_cast<ULONG>(nCol1));
             for ( nCol = nCol1; nCol <= nCol2; ++nCol, ++nInsCol )
             {
-                if ( (pDocument->GetColFlags( nCol, nTab) & CR_HIDDEN) == 0 )
-                {
-                    if ( bNoGlue || eGlue == SC_CHARTGLUE_ROWS )
-                    {	// meistens gleiche Cols
-                        if ( (pCol = (Table*) pCols->Get( nInsCol ))==NULL )
-                        {
-                            pCols->Insert( nInsCol, pNewRowTable );
-                            pCol = pNewRowTable;
-                            pNewRowTable = new Table;
-                        }
+                if ( bNoGlue || eGlue == SC_CHARTGLUE_ROWS )
+                {	// meistens gleiche Cols
+                    if ( (pCol = (Table*) pCols->Get( nInsCol ))==NULL )
+                    {
+                        pCols->Insert( nInsCol, pNewRowTable );
+                        pCol = pNewRowTable;
+                        pNewRowTable = new Table;
                     }
-                    else
-                    {	// meistens neue Cols
-                        if ( pCols->Insert( nInsCol, pNewRowTable ) )
-                        {
-                            pCol = pNewRowTable;
-                            pNewRowTable = new Table;
-                        }
-                        else
-                            pCol = (Table*) pCols->Get( nInsCol );
+                }
+                else
+                {	// meistens neue Cols
+                    if ( pCols->Insert( nInsCol, pNewRowTable ) )
+                    {
+                        pCol = pNewRowTable;
+                        pNewRowTable = new Table;
                     }
-                    // bei anderer Tabelle wurde bereits neuer ColKey erzeugt,
-                    // die Zeilen muessen fuer's Dummy fuellen gleich sein!
-                    ULONG nInsRow = (bNoGlue ? nNoGlueRow : nRow1);
-                    for ( nRow = nRow1; nRow <= nRow2; nRow++, nInsRow++ )
+                    else
+                        pCol = (Table*) pCols->Get( nInsCol );
+                }
+                // bei anderer Tabelle wurde bereits neuer ColKey erzeugt,
+                // die Zeilen muessen fuer's Dummy fuellen gleich sein!
+                ULONG nInsRow = (bNoGlue ? nNoGlueRow : nRow1);
+                for ( nRow = nRow1; nRow <= nRow2; nRow++, nInsRow++ )
+                {
+                    if ( pCol->Insert( nInsRow, pNewAddress ) )
                     {
-                        if ( (pDocument->GetRowFlags( nRow, nTab) & CR_HIDDEN) == 0 )
-                        {
-                            if ( pCol->Insert( nInsRow, pNewAddress ) )
-                            {
-                                pNewAddress->Set( nCol, nRow, nTab );
-                                pNewAddress = new ScAddress;
-                            }
-                        }
+                        pNewAddress->Set( nCol, nRow, nTab );
+                        pNewAddress = new ScAddress;
                     }
                 }
             }
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 36e528f..a1ccd4e 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -2740,7 +2740,7 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
     maRect.mnWidth = static_cast< sal_Int32 >( aPtSize.Width() << 16 );
     maRect.mnHeight = static_cast< sal_Int32 >( aPtSize.Height() << 16 );
 
-    // global chart properties
+    // global chart properties (default values)
     ::set_flag( maProps.mnFlags, EXC_CHPROPS_MANSERIES );
     ::set_flag( maProps.mnFlags, EXC_CHPROPS_SHOWVISIBLEONLY, false );
     maProps.mnEmptyMode = EXC_CHPROPS_EMPTY_SKIP;
@@ -2751,6 +2751,13 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
 
     if( xChartDoc.is() )
     {
+        Reference< XDiagram > xDiagram = xChartDoc->getFirstDiagram();
+
+        // global chart properties (only 'include hidden cells' attribute for now)
+        ScfPropertySet aDiagramProp( xDiagram );
+        bool bIncludeHidden = aDiagramProp.GetBoolProperty( EXC_CHPROP_INCLUDEHIDDENCELLS );
+        ::set_flag( maProps.mnFlags,  EXC_CHPROPS_SHOWVISCELLS, !bIncludeHidden );
+
         // initialize API conversion (remembers xChartDoc internally)
         InitConversion( xChartDoc );
 
@@ -2763,7 +2770,6 @@ XclExpChChart::XclExpChChart( const XclExpRoot& rRoot,
         mxTitle = lclCreateTitle( GetChRoot(), xTitled, EXC_CHOBJLINK_TITLE );
 
         // diagrams (axes sets)
-        Reference< XDiagram > xDiagram = xChartDoc->getFirstDiagram();
         sal_uInt16 nFreeGroupIdx = mxPrimAxesSet->Convert( xDiagram, 0 );
         if( !mxPrimAxesSet->Is3dChart() )
             mxSecnAxesSet->Convert( xDiagram, nFreeGroupIdx );
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index a4e518c..9aac9dc 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -40,6 +40,7 @@
 #include <com/sun/star/drawing/ProjectionMode.hpp>
 #include <com/sun/star/drawing/ShadeMode.hpp>
 #include <com/sun/star/chart/ChartAxisPosition.hpp>
+#include <com/sun/star/chart/XChartDocument.hpp>
 #include <com/sun/star/chart2/XChartDocument.hpp>
 #include <com/sun/star/chart2/XDiagram.hpp>
 #include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
@@ -3415,6 +3416,15 @@ void XclImpChChart::Convert( Reference< XChartDocument > xChartDoc, ScfProgressB
     if( xDiagram.is() && mxLegend.is() )
         xDiagram->setLegend( mxLegend->CreateLegend() );
 
+    // set the IncludeHiddenCells property via the old API as only this ensures that the data provider and al created sequences get this flag correctly
+    Reference< com::sun::star::chart::XChartDocument > xStandardApiChartDoc( xChartDoc, UNO_QUERY );
+    if( xStandardApiChartDoc.is() )
+    {
+        ScfPropertySet aDiagramProp( xStandardApiChartDoc->getDiagram() );
+        bool bShowVisCells = (maProps.mnFlags & EXC_CHPROPS_SHOWVISCELLS);
+        aDiagramProp.SetBoolProperty( EXC_CHPROP_INCLUDEHIDDENCELLS, !bShowVisCells  );
+    }
+
     // unlock the model
     FinishConversion( rProgress );
 }
@@ -3427,6 +3437,11 @@ void XclImpChChart::ReadChSeries( XclImpStream& rStrm )
     maSeries.push_back( xSeries );
 }
 
+void XclImpChChart::ReadChProperties( XclImpStream& rStrm )
+{
+    rStrm >> maProps.mnFlags >> maProps.mnEmptyMode;
+}
+
 void XclImpChChart::ReadChAxesSet( XclImpStream& rStrm )
 {
     XclImpChAxesSetRef xAxesSet( new XclImpChAxesSet( GetChRoot(), EXC_CHAXESSET_NONE ) );
diff --git a/sc/source/filter/inc/xichart.hxx b/sc/source/filter/inc/xichart.hxx
index b87eaf5..d85f251 100644
--- a/sc/source/filter/inc/xichart.hxx
+++ b/sc/source/filter/inc/xichart.hxx
@@ -1348,6 +1348,8 @@ public:
 private:
     /** Reads a CHSERIES group (data series source and formatting). */
     void                ReadChSeries( XclImpStream& rStrm );
+    /** Reads a CHPROPERTIES record. */
+    void                ReadChProperties( XclImpStream& rStrm );
     /** Reads a CHAXESSET group (primary/secondary axes set). */
     void                ReadChAxesSet( XclImpStream& rStrm );
     /** Reads a CHTEXT group (chart title and series/point captions). */
diff --git a/sc/source/filter/inc/xlchart.hxx b/sc/source/filter/inc/xlchart.hxx
index ffc7d82..7038fc1 100644
--- a/sc/source/filter/inc/xlchart.hxx
+++ b/sc/source/filter/inc/xlchart.hxx
@@ -97,6 +97,7 @@ namespace com { namespace sun { namespace star {
 #define EXC_CHPROP_FILLSTYLE                CREATE_OUSTRING( "FillStyle" )
 #define EXC_CHPROP_GAPWIDTHSEQ              CREATE_OUSTRING( "GapwidthSequence" )
 #define EXC_CHPROP_GEOMETRY3D               CREATE_OUSTRING( "Geometry3D" )
+#define EXC_CHPROP_INCLUDEHIDDENCELLS       CREATE_OUSTRING( "IncludeHiddenCells" )
 #define EXC_CHPROP_JAPANESE                 CREATE_OUSTRING( "Japanese" )
 #define EXC_CHPROP_LABEL                    CREATE_OUSTRING( "Label" )
 #define EXC_CHPROP_LABELPLACEMENT           CREATE_OUSTRING( "LabelPlacement" )
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index f73ca20..a4439bb 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -45,6 +45,7 @@
 #include "unoreflist.hxx"
 #include "compiler.hxx"
 #include "reftokenhelper.hxx"
+#include "chartlis.hxx"
 
 #include <sfx2/objsh.hxx>
 #include <tools/table.hxx>
@@ -89,12 +90,23 @@ using ::boost::shared_ptr;
 
 namespace
 {
+const SfxItemPropertyMap* lcl_GetDataProviderPropertyMap()
+{
+    static SfxItemPropertyMap aDataProviderPropertyMap_Impl[] =
+    {
+        {MAP_CHAR_LEN(SC_UNONAME_INCLUDEHIDDENCELLS), 0,		&getBooleanCppuType(),					0, 0 },
+        {0,0,0,0,0,0}
+    };
+    return aDataProviderPropertyMap_Impl;
+}
+
 const SfxItemPropertyMap* lcl_GetDataSequencePropertyMap()
 {
     static SfxItemPropertyMap aDataSequencePropertyMap_Impl[] =
     {
-        {MAP_CHAR_LEN(SC_UNONAME_ISHIDDEN), 0,		&getBooleanCppuType(),					0, 0 },
+        {MAP_CHAR_LEN(SC_UNONAME_HIDDENVALUES), 0, &getCppuType((uno::Sequence<sal_Int32>*)0 ),					0, 0 },
         {MAP_CHAR_LEN(SC_UNONAME_ROLE), 0, &getCppuType((::com::sun::star::chart2::data::DataSequenceRole*)0),					0, 0 },
+        {MAP_CHAR_LEN(SC_UNONAME_INCLUDEHIDDENCELLS), 0,		&getBooleanCppuType(),					0, 0 },
         {0,0,0,0,0,0}
     };
     return aDataSequencePropertyMap_Impl;
@@ -656,9 +668,6 @@ void Chart2Positioner::createPositionMap()
                 (bNoGlue ? 0 : static_cast<sal_uInt32>(nCol1));
             for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol, ++nInsCol)
             {
-                if ((mpDoc->GetColFlags(nCol, nTab) & CR_HIDDEN) != 0)
-                    continue;
-
                 if (bNoGlue || meGlue == GLUETYPE_ROWS)
                 {
                     pCol = static_cast<Table*>(pCols->Get(nInsCol));
@@ -683,9 +692,6 @@ void Chart2Positioner::createPositionMap()
                 sal_uInt32 nInsRow = static_cast<sal_uInt32>(bNoGlue ? nNoGlueRow : nRow1);
                 for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow, ++nInsRow)
                 {
-                    if ((mpDoc->GetRowFlags(nRow, nTab) & CR_HIDDEN) != 0)
-                        continue;
-
                     ScSingleRefData aCellData;
                     aCellData.InitFlags();
                     aCellData.SetFlag3D(true);
@@ -966,6 +972,8 @@ void lcl_convertTokenToString(OUString& rStr, const ScSharedTokenRef& rToken, Sc
 
 ScChart2DataProvider::ScChart2DataProvider( ScDocument* pDoc )
     : m_pDocument( pDoc)
+    , m_aPropSet(lcl_GetDataProviderPropertyMap())
+    , m_bIncludeHiddenCells( sal_True)
 {
     if ( m_pDocument )
         m_pDocument->AddUnoObject( *this);
@@ -1348,7 +1356,7 @@ private:
     {
         bool bExternal = ScRefTokenHelper::isExternalRef(mpHeaderCell);
         if (bExternal != ScRefTokenHelper::isExternalRef(pRange))
-            // internval vs external.
+            // internal vs external.
             return false;
 
         if (bExternal)
@@ -1498,7 +1506,7 @@ ScChart2DataProvider::createDataSource(
             {
                 auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
                 pTokens->push_back(pLabelToken);
-                Reference < chart2::data::XDataSequence > xLabelSeq(new ScChart2DataSequence(m_pDocument, this, pTokens.release()));
+                Reference < chart2::data::XDataSequence > xLabelSeq(new ScChart2DataSequence(m_pDocument, this, pTokens.release(), m_bIncludeHiddenCells));
                 Reference< beans::XPropertySet > xLabelProps(xLabelSeq, uno::UNO_QUERY);
                 if (xLabelProps.is())
                     xLabelProps->setPropertyValue(
@@ -1511,7 +1519,7 @@ ScChart2DataProvider::createDataSource(
         }
         auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
         pTokens->swap(aRefTokens2);
-        uno::Reference< chart2::data::XDataSequence > xSeq( new ScChart2DataSequence( m_pDocument, this, pTokens.release()) );
+        uno::Reference< chart2::data::XDataSequence > xSeq( new ScChart2DataSequence( m_pDocument, this, pTokens.release(), m_bIncludeHiddenCells) );
         pHeader->setValues(xSeq);
     }
     if (pHeader)
@@ -1569,7 +1577,7 @@ ScChart2DataProvider::createDataSource(
                 auto_ptr< vector<ScSharedTokenRef> > pTokens(new vector<ScSharedTokenRef>);
                 pTokens->reserve(1);
                 pTokens->push_back(pHeaderCell);
-                xLabelSeq.set(new ScChart2DataSequence(m_pDocument, this, pTokens.release()));
+                xLabelSeq.set(new ScChart2DataSequence(m_pDocument, this, pTokens.release(), m_bIncludeHiddenCells));
                 uno::Reference< beans::XPropertySet > xLabelProps(xLabelSeq, uno::UNO_QUERY);
                 if (xLabelProps.is())
                     xLabelProps->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SC_UNONAME_ROLE)), uno::makeAny(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("label"))));
@@ -1586,7 +1594,7 @@ ScChart2DataProvider::createDataSource(
 
         // FIXME: if there are no labels the column or row name should be taken
 
-        uno::Reference < chart2::data::XDataSequence > xSeq(new ScChart2DataSequence(m_pDocument, this, pRanges.release()));
+        uno::Reference < chart2::data::XDataSequence > xSeq(new ScChart2DataSequence(m_pDocument, this, pRanges.release(), m_bIncludeHiddenCells));
 
         pLabeled->setValues(xSeq);
         pLabeled->setLabel(xLabelSeq);
@@ -2197,7 +2205,7 @@ uno::Reference< chart2::data::XDataSequence > SAL_CALL
     // ScChart2DataSequence manages the life cycle of pRefTokens.
     vector<ScSharedTokenRef>* pRefTokens = new vector<ScSharedTokenRef>();
     pRefTokens->swap(aRefTokens);
-    xResult.set(new ScChart2DataSequence(m_pDocument, this, pRefTokens));
+    xResult.set(new ScChart2DataSequence(m_pDocument, this, pRefTokens, m_bIncludeHiddenCells));
 
     return xResult;
 }
@@ -2375,6 +2383,88 @@ private:
 
 }
 
+// DataProvider XPropertySet -------------------------------------------------
+
+uno::Reference< beans::XPropertySetInfo> SAL_CALL
+ScChart2DataProvider::getPropertySetInfo() throw( uno::RuntimeException)
+{
+    ScUnoGuard aGuard;
+    static uno::Reference<beans::XPropertySetInfo> aRef =
+        new SfxItemPropertySetInfo( m_aPropSet.getPropertyMap() );
+    return aRef;
+}
+
+
+void SAL_CALL ScChart2DataProvider::setPropertyValue(
+        const ::rtl::OUString& rPropertyName, const uno::Any& rValue)
+            throw( beans::UnknownPropertyException,
+                    beans::PropertyVetoException,
+                    lang::IllegalArgumentException,
+                    lang::WrappedTargetException, uno::RuntimeException)
+{
+    if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
+    {
+        if ( !(rValue >>= m_bIncludeHiddenCells))
+            throw lang::IllegalArgumentException();
+    }
+    else
+        throw beans::UnknownPropertyException();
+}
+
+
+uno::Any SAL_CALL ScChart2DataProvider::getPropertyValue(
+        const ::rtl::OUString& rPropertyName)
+            throw( beans::UnknownPropertyException,
+                    lang::WrappedTargetException, uno::RuntimeException)
+{
+    uno::Any aRet;
+    if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
+        aRet <<= m_bIncludeHiddenCells;
+    else
+        throw beans::UnknownPropertyException();
+    return aRet;
+}
+
+
+void SAL_CALL ScChart2DataProvider::addPropertyChangeListener(
+        const ::rtl::OUString& /*rPropertyName*/,
+        const uno::Reference< beans::XPropertyChangeListener>& /*xListener*/)
+            throw( beans::UnknownPropertyException,
+                    lang::WrappedTargetException, uno::RuntimeException)
+{
+    OSL_ENSURE( false, "Not yet implemented" );
+}
+
+
+void SAL_CALL ScChart2DataProvider::removePropertyChangeListener(
+        const ::rtl::OUString& /*rPropertyName*/,
+        const uno::Reference< beans::XPropertyChangeListener>& /*rListener*/)
+            throw( beans::UnknownPropertyException,
+                    lang::WrappedTargetException, uno::RuntimeException)
+{
+    OSL_ENSURE( false, "Not yet implemented" );
+}
+
+
+void SAL_CALL ScChart2DataProvider::addVetoableChangeListener(
+        const ::rtl::OUString& /*rPropertyName*/,
+        const uno::Reference< beans::XVetoableChangeListener>& /*rListener*/)
+            throw( beans::UnknownPropertyException,
+                    lang::WrappedTargetException, uno::RuntimeException)
+{
+    OSL_ENSURE( false, "Not yet implemented" );
+}
+
+
+void SAL_CALL ScChart2DataProvider::removeVetoableChangeListener(
+        const ::rtl::OUString& /*rPropertyName*/,
+        const uno::Reference< beans::XVetoableChangeListener>& /*rListener*/ )
+            throw( beans::UnknownPropertyException,
+                    lang::WrappedTargetException, uno::RuntimeException)
+{
+    OSL_ENSURE( false, "Not yet implemented" );
+}
+
 void ScChart2DataProvider::detectRangesFromDataSource(vector<ScSharedTokenRef>& rRefTokens,
                                                       chart::ChartDataRowSource& rRowSource,
                                                       bool& rRowSourceDetected,
@@ -2660,10 +2750,25 @@ ScChart2DataSequence::Item::Item() :
     ::rtl::math::setNan(&mfValue);
 }
 
+ScChart2DataSequence::HiddenRangeListener::HiddenRangeListener(ScChart2DataSequence& rParent) :
+    mrParent(rParent)
+{
+}
+
+ScChart2DataSequence::HiddenRangeListener::~HiddenRangeListener()
+{
+}
+
+void ScChart2DataSequence::HiddenRangeListener::notify()
+{
+    mrParent.setDataChangedHint(true);
+}
+
 ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
         const uno::Reference < chart2::data::XDataProvider >& xDP, 
-        vector<ScSharedTokenRef>* pTokens)
-    : m_bHidden( sal_False)
+        vector<ScSharedTokenRef>* pTokens,
+        bool bIncludeHiddenCells )
+    : m_bIncludeHiddenCells( bIncludeHiddenCells)
     , m_nObjectId( 0 )
     , m_pDocument( pDoc)
     , m_pTokens(pTokens)
@@ -2671,6 +2776,7 @@ ScChart2DataSequence::ScChart2DataSequence( ScDocument* pDoc,
     , m_pExtRefListener(NULL)
     , m_xDataProvider( xDP)
     , m_aPropSet(lcl_GetDataSequencePropertyMap())
+    , m_pHiddenListener(NULL)
     , m_pValueListener( NULL )
     , m_bGotDataChangedHint(false)
     , m_bExtDataRebuildQueued(false)
@@ -2700,6 +2806,12 @@ ScChart2DataSequence::~ScChart2DataSequence()
     if ( m_pDocument )
     {
         m_pDocument->RemoveUnoObject( *this);
+        if (m_pHiddenListener.get())
+        {
+            ScChartListenerCollection* pCLC = m_pDocument->GetChartListenerCollection();
+            if (pCLC)
+                pCLC->EndListeningHiddenRange(m_pHiddenListener.get());
+        }
         StopListeningToAllExternalRefs();
     }
 
@@ -2714,6 +2826,14 @@ void ScChart2DataSequence::RefChanged()
 
         if( m_pDocument )
         {
+            ScChartListenerCollection* pCLC = NULL;
+            if (m_pHiddenListener.get())
+            {
+                pCLC = m_pDocument->GetChartListenerCollection();
+                if (pCLC)
+                    pCLC->EndListeningHiddenRange(m_pHiddenListener.get());
+            }
+
             vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
             for (; itr != itrEnd; ++itr)
             {
@@ -2722,6 +2842,8 @@ void ScChart2DataSequence::RefChanged()
                     continue;
 
                 m_pDocument->StartListeningArea(aRange, m_pValueListener);
+                if (pCLC)
+                    pCLC->StartListeningHiddenRange(aRange, m_pHiddenListener.get());
             }
         }
     }
@@ -2765,17 +2887,21 @@ void ScChart2DataSequence::BuildDataCache()
                 {
                     for (SCROW nRow = aRange.aStart.Row(); nRow <= aRange.aEnd.Row(); ++nRow)
                     {
-                        m_aDataArray.push_back(Item());
-                        Item& rItem = m_aDataArray.back();
-                        ++nDataCount;
-                        USHORT nWidth = m_pDocument->GetColWidth(nCol, nTab);
-                        USHORT nHeight = m_pDocument->GetRowHeight(nRow, nTab);
-                        if (!nWidth || !nHeight)
+                        bool bColHidden = (m_pDocument->GetColFlags(nCol, nTab) & CR_HIDDEN);
+                        bool bRowHidden = (m_pDocument->GetRowFlags(nRow, nTab) & CR_HIDDEN);
+                        if (bColHidden || bRowHidden)
                         {
                             // hidden cell
                             ++nHiddenValueCount;
                             aHiddenValues.push_back(nDataCount-1);
+
+                            if( !m_bIncludeHiddenCells )
+                                continue;
                         }
+
+                        m_aDataArray.push_back(Item());
+                        Item& rItem = m_aDataArray.back();
+                        ++nDataCount;
     
                         ScAddress aAdr(nCol, nRow, nTab);
                         ScBaseCell* pCell = m_pDocument->GetCell(aAdr);
@@ -2987,7 +3113,6 @@ void ScChart2DataSequence::CopyData(const ScChart2DataSequence& r)
 
     m_aHiddenValues = r.m_aHiddenValues;
     m_aRole = r.m_aRole;
-    m_bHidden = r.m_bHidden;
 
     if (r.m_pRangeIndices.get())
         m_pRangeIndices.reset(new vector<sal_uInt32>(*r.m_pRangeIndices));
@@ -3023,7 +3148,8 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
             // delayed broadcast as in ScCellRangesBase
 
             if ( m_bGotDataChangedHint && m_pDocument )
-            {
+            {        
+                m_aDataArray.clear();
                 m_aDataArray.clear();
                 lang::EventObject aEvent;
                 aEvent.Source.set((cppu::OWeakObject*)this);
@@ -3124,7 +3250,7 @@ IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint )
         //  in the range are notified. So only a flag is set that is checked when
         //  SFX_HINT_DATACHANGED is received.
 
-        m_bGotDataChangedHint = true;
+        setDataChangedHint(true);
     }
     return 0;
 }
@@ -3513,7 +3639,7 @@ uno::Reference< util::XCloneable > SAL_CALL ScChart2DataSequence::createClone()
         }
     }
 
-    auto_ptr<ScChart2DataSequence> p(new ScChart2DataSequence(m_pDocument, m_xDataProvider, pTokensNew.release()));
+    auto_ptr<ScChart2DataSequence> p(new ScChart2DataSequence(m_pDocument, m_xDataProvider, pTokensNew.release(), m_bIncludeHiddenCells));
     p->CopyData(*this);
     Reference< util::XCloneable > xClone(p.release());
 
@@ -3541,11 +3667,23 @@ void SAL_CALL ScChart2DataSequence::addModifyListener( const uno::Reference< uti
         if (!m_pValueListener)
             m_pValueListener = new ScLinkListener( LINK( this, ScChart2DataSequence, ValueListenerHdl ) );
 
+        if (!m_pHiddenListener.get())
+            m_pHiddenListener.reset(new HiddenRangeListener(*this));
+
         if( m_pDocument )
         {
-            ULONG nCount = aRanges.Count();
-            for (ULONG i=0; i<nCount; i++)
-                m_pDocument->StartListeningArea( *aRanges.GetObject(i), m_pValueListener );
+            ScChartListenerCollection* pCLC = m_pDocument->GetChartListenerCollection();
+            vector<ScSharedTokenRef>::const_iterator itr = m_pTokens->begin(), itrEnd = m_pTokens->end();
+            for (; itr != itrEnd; ++itr)
+            {
+                ScRange aRange;
+                if (!ScRefTokenHelper::getRangeFromToken(aRange, *itr))
+                    continue;
+
+                m_pDocument->StartListeningArea( aRange, m_pValueListener );
+                if (pCLC)
+                    pCLC->StartListeningHiddenRange(aRange, m_pHiddenListener.get());
+            }
         }
 
         acquire();	// don't lose this object (one ref for all listeners)
@@ -3576,6 +3714,13 @@ void SAL_CALL ScChart2DataSequence::removeModifyListener( const uno::Reference<
                 if (m_pValueListener)
                     m_pValueListener->EndListeningAll();
 
+                if (m_pHiddenListener.get() && m_pDocument)
+                {
+                    ScChartListenerCollection* pCLC = m_pDocument->GetChartListenerCollection();
+                    if (pCLC)
+                        pCLC->EndListeningHiddenRange(m_pHiddenListener.get());
+                }
+
                 release();		// release the ref for the listeners
             }
 
@@ -3610,10 +3755,13 @@ void SAL_CALL ScChart2DataSequence::setPropertyValue(
         if ( !(rValue >>= m_aRole))
             throw lang::IllegalArgumentException();
     }
-    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISHIDDEN)))
+    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
     {
-        if ( !(rValue >>= m_bHidden))
+        sal_Bool bOldValue = m_bIncludeHiddenCells;
+        if ( !(rValue >>= m_bIncludeHiddenCells))
             throw lang::IllegalArgumentException();
+        if( bOldValue != m_bIncludeHiddenCells )
+            m_aDataArray.clear();//data array is dirty now
     }
     else
         throw beans::UnknownPropertyException();
@@ -3629,8 +3777,8 @@ uno::Any SAL_CALL ScChart2DataSequence::getPropertyValue(
     uno::Any aRet;
     if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ROLE)))
         aRet <<= m_aRole;
-    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISHIDDEN)))
-        aRet <<= m_bHidden;
+    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
+        aRet <<= m_bIncludeHiddenCells;
     else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM(SC_UNONAME_HIDDENVALUES)))
     {
         // This property is read-only thus cannot be set externally via 
@@ -3692,6 +3840,11 @@ void SAL_CALL ScChart2DataSequence::removeVetoableChangeListener(
     OSL_ENSURE( false, "Not yet implemented" );
 }
 
+void ScChart2DataSequence::setDataChangedHint(bool b)
+{
+    m_bGotDataChangedHint = b;
+}
+
 // XUnoTunnel
 
 // sal_Int64 SAL_CALL ScChart2DataSequence::getSomething(
@@ -3740,7 +3893,7 @@ ScChart2EmptyDataSequence::ScChart2EmptyDataSequence( ScDocument* pDoc,
         const uno::Reference < chart2::data::XDataProvider >& xDP,
         const ScRangeListRef& rRangeList,
         sal_Bool bColumn)
-    : m_bHidden( sal_False)
+    : m_bIncludeHiddenCells( sal_True)
     , m_xRanges( rRangeList)
     , m_pDocument( pDoc)
     , m_xDataProvider( xDP)
@@ -3889,8 +4042,8 @@ uno::Reference< util::XCloneable > SAL_CALL ScChart2EmptyDataSequence::createClo
         {
             xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ROLE )),
                                      uno::makeAny( m_aRole ));
-            xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_ISHIDDEN )),
-                                     uno::makeAny( m_bHidden ));
+            xProp->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS )),
+                                     uno::makeAny( m_bIncludeHiddenCells ));
         }
         return xClone;
     }
@@ -3935,9 +4088,9 @@ void SAL_CALL ScChart2EmptyDataSequence::setPropertyValue(
         if ( !(rValue >>= m_aRole))
             throw lang::IllegalArgumentException();
     }
-    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISHIDDEN)))
+    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
     {
-        if ( !(rValue >>= m_bHidden))
+        if ( !(rValue >>= m_bIncludeHiddenCells))
             throw lang::IllegalArgumentException();
     }
     else
@@ -3954,8 +4107,8 @@ uno::Any SAL_CALL ScChart2EmptyDataSequence::getPropertyValue(
     uno::Any aRet;
     if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ROLE)))
         aRet <<= m_aRole;
-    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_ISHIDDEN)))
-        aRet <<= m_bHidden;
+    else if ( rPropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SC_UNONAME_INCLUDEHIDDENCELLS)))
+        aRet <<= m_bIncludeHiddenCells;
     else
         throw beans::UnknownPropertyException();
     // TODO: support optional properties
commit 1e669a0e87ac5e4c56d41412700bcff3398f1a59
Author: Jens-Heiner Rechtien <hr at openoffice.org>
Date:   Mon May 18 15:28:50 2009 +0000

    CWS-TOOLING: integrate CWS calcmultiline
    2009-05-13 18:05:10 +0200 nn  r271868 : CWS-TOOLING: rebase CWS calcmultiline to trunk at 271830 (milestone: DEV300:m48)
    2009-03-15 00:59:24 +0100 erack  r269502 : #i100205# SYLK import/export: treat embedded double quotes and semicolons correctly; changes ID;PSCALC3 to ID;PCALCOOO32 due to incompatibility
    2009-03-10 17:54:33 +0100 er  r269286 : #i35913# multiline (newlines) as formula results; contributed by William S Fulton <wsfulton>

diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 656d589..f389a01 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -485,6 +485,9 @@ public:
     inline BOOL		IsHyperLinkCell() const { return pCode && pCode->IsHyperLink(); }
     EditTextObject*		CreateURLObject() ;
     void            GetURLResult( String& rURL, String& rCellText );
+
+    /** Determines whether or not the result string contains more than one paragraph */
+    bool            IsMultilineResult();
 };
 
 //			Iterator fuer Referenzen in einer Formelzelle
diff --git a/sc/inc/editutil.hxx b/sc/inc/editutil.hxx
index dc1d509..038acc1 100644
--- a/sc/inc/editutil.hxx
+++ b/sc/inc/editutil.hxx
@@ -63,8 +63,13 @@ class ScEditUtil
 
 public:
     static String ModifyDelimiters( const String& rOld );
+
+    /// Retrieves string with paragraphs delimited by spaces
     static String GetSpaceDelimitedString( const EditEngine& rEngine );
 
+    /// Retrieves string with paragraphs delimited by new lines ('\n').
+    static String GetMultilineString( const EditEngine& rEngine );
+
 public:
                 ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ,
                             const Point& rScrPosPixel,
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index 8c70f43..ab1318f 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -38,6 +38,11 @@
     and memory consumption. */
 class ScFormulaResult
 {
+    typedef unsigned char Multiline;
+    static const Multiline MULTILINE_UNKNOWN = 0;
+    static const Multiline MULTILINE_FALSE   = 1;
+    static const Multiline MULTILINE_TRUE    = 2;
+
     union
     {
         double          mfValue;    // double result direct for performance and memory consumption
@@ -47,6 +52,7 @@ class ScFormulaResult
     bool                mbToken :1; // whether content of union is a token
     bool                mbEmpty :1; // empty cell result
     bool                mbEmptyDisplayedAsString :1;    // only if mbEmpty
+    Multiline           meMultiline :2; // result is multiline
 
     /** Reset mnError, mbEmpty and mbEmptyDisplayedAsString to their defaults
         prior to assigning other types */
@@ -69,12 +75,14 @@ public:
                                 /** Effectively type svUnknown. */
                                 ScFormulaResult()
                                     : mpToken(NULL), mnError(0), mbToken(true),
-                                    mbEmpty(false), mbEmptyDisplayedAsString(false) {}
+                                    mbEmpty(false), mbEmptyDisplayedAsString(false),
+                                    meMultiline(MULTILINE_UNKNOWN) {}
 
                                 ScFormulaResult( const ScFormulaResult & r )
                                     : mnError( r.mnError), mbToken( r.mbToken),
                                     mbEmpty( r.mbEmpty),
-                                    mbEmptyDisplayedAsString( r.mbEmptyDisplayedAsString)
+                                    mbEmptyDisplayedAsString( r.mbEmptyDisplayedAsString),
+                                    meMultiline( r.meMultiline)
                                 {
                                     if (mbToken)
                                     {
@@ -99,7 +107,8 @@ public:
     /** Same comments as for SetToken() apply! */
     explicit                    ScFormulaResult( const formula::FormulaToken* p )
                                     : mnError(0), mbToken(false),
-                                    mbEmpty(false), mbEmptyDisplayedAsString(false)
+                                    mbEmpty(false), mbEmptyDisplayedAsString(false),
+                                    meMultiline(MULTILINE_UNKNOWN)
                                 {
                                     SetToken( p);
                                 }
@@ -153,6 +162,10 @@ public:
         details instead. */
     inline  bool                IsValue() const;
 
+    /** Determines whether or not the result is a string containing more than 
+        one paragraph */
+    inline  bool                IsMultiline() const;
+
     /** Get error code if set or GetCellResultType() is formula::svError or svUnknown,
         else 0. */
     inline  USHORT              GetResultError() const;
@@ -211,6 +224,7 @@ inline void ScFormulaResult::ResetToDefaults()
     mnError = 0;
     mbEmpty = false;
     mbEmptyDisplayedAsString = false;
+    meMultiline = MULTILINE_UNKNOWN;
 }
 
 
@@ -232,17 +246,20 @@ inline void ScFormulaResult::ResolveToken( const formula::FormulaToken * p )
                 mbToken = false;
                 // set in case mnError is 0 now, which shouldn't happen but ...
                 mfValue = 0.0;
+                meMultiline = MULTILINE_FALSE;
                 break;
             case formula::svEmptyCell:
                 mbEmpty = true;
                 mbEmptyDisplayedAsString = static_cast<const ScEmptyCellToken*>(p)->IsDisplayedAsString();
                 p->DecRef();
                 mbToken = false;
+                meMultiline = MULTILINE_FALSE;
                 break;
             case formula::svDouble:
                 mfValue = p->GetDouble();
                 p->DecRef();
                 mbToken = false;
+                meMultiline = MULTILINE_FALSE;
                 break;
             default:
                 mpToken = p;
@@ -270,6 +287,7 @@ inline void ScFormulaResult::Assign( const ScFormulaResult & r )
         mbToken = false;
         mbEmpty = true;
         mbEmptyDisplayedAsString = r.mbEmptyDisplayedAsString;
+        meMultiline = r.meMultiline;
     }
     else if (r.mbToken)
     {
@@ -352,6 +370,7 @@ inline void ScFormulaResult::SetDouble( double f )
             mpToken->DecRef();
         mfValue = f;
         mbToken = false;
+        meMultiline = MULTILINE_FALSE;
     }
 }
 
@@ -404,6 +423,19 @@ inline bool ScFormulaResult::IsValue() const
     return sv == formula::svDouble || sv == formula::svError || sv == formula::svEmptyCell;
 }
 
+inline bool ScFormulaResult::IsMultiline() const
+{
+    if (meMultiline == MULTILINE_UNKNOWN)
+    {
+        const String& rStr = GetString();
+        if (rStr.Len() && rStr.Search( _LF ) != STRING_NOTFOUND)
+            const_cast<ScFormulaResult*>(this)->meMultiline = MULTILINE_TRUE;
+        else
+            const_cast<ScFormulaResult*>(this)->meMultiline = MULTILINE_FALSE;
+    }
+    return meMultiline == MULTILINE_TRUE;
+}
+
 
 inline USHORT ScFormulaResult::GetResultError() const
 {
@@ -537,6 +569,7 @@ inline void ScFormulaResult::SetHybridDouble( double f )
     {
         mfValue = f;
         mbToken = false;
+        meMultiline = MULTILINE_FALSE;
     }
 }
 
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 07f6018..94e14ec 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1919,6 +1919,13 @@ void ScFormulaCell::GetURLResult( String& rURL, String& rCellText )
     }
 }
 
+bool ScFormulaCell::IsMultilineResult()
+{
+    if (!IsValue())
+        return aResult.IsMultiline();
+    return false;
+}
+
 EditTextObject* ScFormulaCell::CreateURLObject()
 {
     String aCellText;
diff --git a/sc/source/core/data/cell2.cxx b/sc/source/core/data/cell2.cxx
index 0dffbde..86c87c0 100644
--- a/sc/source/core/data/cell2.cxx
+++ b/sc/source/core/data/cell2.cxx
@@ -129,7 +129,7 @@ void ScEditCell::GetString( String& rString ) const
         // auch Text von URL-Feldern, Doc-Engine ist eine ScFieldEditEngine
         EditEngine& rEngine = pDoc->GetEditEngine();
         rEngine.SetText( *pData );
-        rString = ScEditUtil::GetSpaceDelimitedString(rEngine);     // space between paragraphs
+        rString = ScEditUtil::GetMultilineString(rEngine); // string with line separators between paragraphs
         // kurze Strings fuer Formeln merken
         if ( rString.Len() < MAXSTRLEN )
             ((ScEditCell*)this)->pString = new String( rString );   //! non-const
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index a05a1f7..6329e86 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2139,8 +2139,10 @@ BOOL ScColumn::HasEditCells(SCROW nStartRow, SCROW nEndRow, SCROW& rFirst) const
     while ( (nIndex < nCount) ? ((nRow=pItems[nIndex].nRow) <= nEndRow) : FALSE )
     {
         ScBaseCell* pCell = pItems[nIndex].pCell;
-        if ( pCell->GetCellType() == CELLTYPE_EDIT ||
-             IsAmbiguousScriptNonZero( pDocument->GetScriptType(nCol, nRow, nTab, pCell) ) )
+        CellType eCellType = pCell->GetCellType();
+        if ( eCellType == CELLTYPE_EDIT ||
+             IsAmbiguousScriptNonZero( pDocument->GetScriptType(nCol, nRow, nTab, pCell) ) ||
+             ((eCellType == CELLTYPE_FORMULA) && ((ScFormulaCell*)pCell)->IsMultilineResult()) )
         {
             rFirst = nRow;
             return TRUE;
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 3a70c4e..8f8d5ff 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -319,9 +319,12 @@ long ScColumn::GetNeededSize( SCROW nRow, OutputDevice* pDev,
         }
 
         BOOL bAddMargin = TRUE;
-        BOOL bEditEngine = ( pCell->GetCellType() == CELLTYPE_EDIT ||
+        CellType eCellType = pCell->GetCellType();
+
+        BOOL bEditEngine = ( eCellType == CELLTYPE_EDIT ||
                                 eOrient == SVX_ORIENTATION_STACKED ||
-                                IsAmbiguousScript( nScript ) );
+                                IsAmbiguousScript( nScript ) ||
+                                ((eCellType == CELLTYPE_FORMULA) && ((ScFormulaCell*)pCell)->IsMultilineResult()) );
 
         if (!bEditEngine)									// direkte Ausgabe
         {
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index da22ea3..250dde1 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -846,7 +846,16 @@ ScBaseCell* ScColumn::CloneCell(SCSIZE nIndex, USHORT nFlags, ScDocument& rDestD
                     rForm.GetString( aString );
                     // #33224# do not clone empty string
                     if (aString.Len() > 0)
-                        pNew = new ScStringCell( aString );
+                    {
+                        if ( rForm.IsMultilineResult() )
+                        {
+                            pNew = new ScEditCell( aString, &rDestDoc );
+                        }
+                        else
+                        {
+                            pNew = new ScStringCell( aString );
+                        }
+                    }
                 }
             }
         break;
diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx
index 8a47bde..0cbb085 100644
--- a/sc/source/core/tool/editutil.cxx
+++ b/sc/source/core/tool/editutil.cxx
@@ -82,19 +82,29 @@ String ScEditUtil::ModifyDelimiters( const String& rOld )
     return aRet;
 }
 
-String ScEditUtil::GetSpaceDelimitedString( const EditEngine& rEngine )
+static String lcl_GetDelimitedString( const EditEngine& rEngine, const sal_Char c )
 {
     String aRet;
     USHORT nParCount = rEngine.GetParagraphCount();
     for (USHORT nPar=0; nPar<nParCount; nPar++)
     {
         if (nPar > 0)
-            aRet += ' ';
+            aRet += c;
         aRet += rEngine.GetText( nPar );
     }
     return aRet;
 }
 
+String ScEditUtil::GetSpaceDelimitedString( const EditEngine& rEngine )
+{
+    return lcl_GetDelimitedString(rEngine, ' ');
+}
+
+String ScEditUtil::GetMultilineString( const EditEngine& rEngine )
+{
+    return lcl_GetDelimitedString(rEngine, '\n');
+}
+
 //------------------------------------------------------------------------
 
 Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, BOOL bForceToTop )
diff --git a/sc/source/filter/dif/difimp.cxx b/sc/source/filter/dif/difimp.cxx
index 1616305..723ee30 100644
--- a/sc/source/filter/dif/difimp.cxx
+++ b/sc/source/filter/dif/difimp.cxx
@@ -338,7 +338,7 @@ TOPIC DifParser::GetNextTopic( void )
 
     while( eS != S_END )
     {
-        if( !rIn.ReadUniOrByteStringLine( aLine ) )
+        if( !ReadNextLine( aLine ) )
         {
             eS = S_END;
             eRet = T_END;
@@ -406,10 +406,10 @@ TOPIC DifParser::GetNextTopic( void )
                 break;
             case S_UNKNOWN:
                 // 2 Zeilen ueberlesen
-                rIn.ReadUniOrByteStringLine( aLine );
+                ReadNextLine( aLine );
             case S_ERROR_L2:				// Fehler in Line 2 aufgetreten
                 // eine Zeile ueberlesen
-                rIn.ReadUniOrByteStringLine( aLine );
+                ReadNextLine( aLine );
                 eS = S_END;
                 break;
             default:
@@ -421,7 +421,7 @@ TOPIC DifParser::GetNextTopic( void )
 }
 
 
-void lcl_DeEscapeQuotesDif( String& rString )
+static void lcl_DeEscapeQuotesDif( String& rString )
 {
     //	Special handling for DIF import: Escaped (duplicated) quotes are resolved.
     //	Single quote characters are left in place because older versions didn't
@@ -437,25 +437,107 @@ void lcl_DeEscapeQuotesDif( String& rString )
     }
 }
 
+// Determine if passed in string is numeric data and set fVal/nNumFormat if so
+DATASET DifParser::GetNumberDataset( const sal_Unicode* pPossibleNumericData )
+{
+    DATASET eRet = D_SYNT_ERROR;
+    if( bPlain )
+    {
+        if( ScanFloatVal( pPossibleNumericData ) )
+            eRet = D_NUMERIC;
+        else
+            eRet = D_SYNT_ERROR;
+    }
+    else
+    {   // ...und zur Strafe mit'm Numberformatter...
+        DBG_ASSERT( pNumFormatter, "-DifParser::GetNextDataset(): No Formatter, more fun!" );
+        String aTestVal( pPossibleNumericData );
+        sal_uInt32 nFormat = 0;
+        double fTmpVal;
+        if( pNumFormatter->IsNumberFormat( aTestVal, nFormat, fTmpVal ) )
+        {
+            fVal = fTmpVal;
+            nNumFormat = nFormat;
+            eRet = D_NUMERIC;
+        }
+        else
+            eRet = D_SYNT_ERROR;
+    }
+    return eRet;
+}
+
+bool DifParser::ReadNextLine( String& rStr )
+{
+    if( aLookAheadLine.Len() == 0 )
+    {
+        return rIn.ReadUniOrByteStringLine( rStr );
+    }
+    else
+    {
+        rStr = aLookAheadLine;
+        aLookAheadLine.Erase();
+        return true;
+    }
+}
+
+// Look ahead in the stream to determine if the next line is the first line of 
+// a valid data record structure
+bool DifParser::LookAhead()
+{
+    const sal_Unicode* pAktBuffer;
+    bool bValidStructure = false;
+
+    DBG_ASSERT( aLookAheadLine.Len() == 0, "*DifParser::LookAhead(): LookAhead called twice in a row" );
+    rIn.ReadUniOrByteStringLine( aLookAheadLine );
+
+    pAktBuffer = aLookAheadLine.GetBuffer();
+
+    switch( *pAktBuffer )
+    {
+        case '-':                   // Special Datatype
+            pAktBuffer++;
+
+            if( Is1_0( pAktBuffer ) )
+            {
+                bValidStructure = true;
+            }
+            break;
+        case '0':                   // Numeric Data
+            pAktBuffer++;
+            if( *pAktBuffer == ',' )
+            {
+                pAktBuffer++;
+                bValidStructure = ( GetNumberDataset(pAktBuffer) != D_SYNT_ERROR );
+            }
+            break;
+        case '1':                   // String Data
+            if( Is1_0( aLookAheadLine.GetBuffer() ) )
+            {
+                bValidStructure = true;
+            }
+            break;
+    }
+    return bValidStructure;
+}
 
 DATASET	DifParser::GetNextDataset( void )
 {
     DATASET				eRet = D_UNKNOWN;
     String			    aLine;
-    const sal_Unicode*		pAkt;
+    const sal_Unicode*		pAktBuffer;
 
-    rIn.ReadUniOrByteStringLine( aLine );
+    ReadNextLine( aLine );
 
-    pAkt = aLine.GetBuffer();
+    pAktBuffer = aLine.GetBuffer();
 
-    switch( *pAkt )
+    switch( *pAktBuffer )
     {
         case '-':					// Special Datatype
-            pAkt++;
+            pAktBuffer++;
 
-            if( Is1_0( pAkt ) )
+            if( Is1_0( pAktBuffer ) )
             {
-                rIn.ReadUniOrByteStringLine( aLine );
+                ReadNextLine( aLine );
                 if( IsBOT( aLine.GetBuffer() ) )
                     eRet = D_BOT;
                 else if( IsEOD( aLine.GetBuffer() ) )
@@ -463,37 +545,16 @@ DATASET	DifParser::GetNextDataset( void )
             }
             break;
         case '0':					// Numeric Data
-            pAkt++;					// Wert in fVal, 2. Zeile in aData
-            if( *pAkt == ',' )
+            pAktBuffer++;			// Wert in fVal, 2. Zeile in aData
+            if( *pAktBuffer == ',' )
             {
-                pAkt++;
-                if( bPlain )
-                {
-                    if( ScanFloatVal( pAkt ) )
-                        eRet = D_NUMERIC;
-                    else
-                        eRet = D_SYNT_ERROR;
-                }
-                else
-                {	// ...und zur Strafe mit'm Numberformatter...
-                    DBG_ASSERT( pNumFormatter, "-DifParser::GetNextDataset(): No Formatter, more fun!" );
-                    String			aTestVal( pAkt );
-                    sal_uInt32		nFormat = 0;
-                    double			fTmpVal;
-                    if( pNumFormatter->IsNumberFormat( aTestVal, nFormat, fTmpVal ) )
-                    {
-                        fVal = fTmpVal;
-                        nNumFormat = nFormat;
-                        eRet = D_NUMERIC;
-                    }
-                    else
-                        eRet = D_SYNT_ERROR;
-                }
-                rIn.ReadUniOrByteStringLine( aData );
+                pAktBuffer++;
+                eRet = GetNumberDataset(pAktBuffer);
+                ReadNextLine( aData );
                 if ( eRet == D_SYNT_ERROR )
                 {   // for broken records write "#ERR: data" to cell
                     String aTmp( RTL_CONSTASCII_USTRINGPARAM( "#ERR: " ));
-                    aTmp += pAkt;
+                    aTmp += pAktBuffer;
                     aTmp.AppendAscii( " (" );
                     aTmp += aData;
                     aTmp += sal_Unicode(')');
@@ -505,18 +566,62 @@ DATASET	DifParser::GetNextDataset( void )
         case '1':					// String Data
             if( Is1_0( aLine.GetBuffer() ) )
             {
-                rIn.ReadUniOrByteStringLine( aLine );
-                DBG_ASSERT( aLine.Len() >= 2,
-                    "*DifParser::GetNextTopic(): Text ist zu kurz (mind. \"\")!" );
-                aData = aLine.Copy( 1, aLine.Len() - 2 );
-                lcl_DeEscapeQuotesDif( aData );
-                eRet = D_STRING;
+                ReadNextLine( aLine );
+                xub_StrLen nLineLength = aLine.Len();
+                const sal_Unicode* pLine = aLine.GetBuffer();
+
+                if( nLineLength >= 1 && *pLine == '"' )
+                {
+                    // Quotes are not always escaped (duplicated), see lcl_DeEscapeQuotesDif
+                    // A look ahead into the next line is needed in order to deal with 
+                    // multiline strings containing quotes
+                    if( LookAhead() )
+                    {
+                        // Single line string
+                        if( nLineLength >= 2 && pLine[nLineLength - 1] == '"' )
+                        {
+                            aData = aLine.Copy( 1, nLineLength - 2 );
+                            lcl_DeEscapeQuotesDif( aData );
+                            eRet = D_STRING;
+                        }
+                    }
+                    else
+                    {
+                        // Multiline string
+                        aData = aLine.Copy( 1 );
+                        bool bContinue = true;
+                        while ( bContinue )
+                        {
+                            aData.Append( '\n' );
+                            bContinue = !rIn.IsEof() && ReadNextLine( aLine );
+                            if( bContinue )
+                            {
+                                nLineLength = aLine.Len();
+                                if( nLineLength >= 1 )
+                                {
+                                    pLine = aLine.GetBuffer();
+                                    bContinue = !LookAhead();
+                                    if( bContinue )
+                                    {
+                                        aData.Append( aLine );
+                                    }
+                                    else if( pLine[nLineLength - 1] == '"' )
+                                    {
+                                        aData.Append( pLine, nLineLength - 1 );
+                                        lcl_DeEscapeQuotesDif( aData );
+                                        eRet = D_STRING;
+                                    }
+                                }
+                            }
+                        };
+                    }
+                }
             }
             break;
     }
 
     if( eRet == D_UNKNOWN )
-        rIn.ReadUniOrByteStringLine( aLine );
+        ReadNextLine( aLine );
 
     if( rIn.IsEof() )
         eRet = D_EOD;
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 575d453..d93eec3 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -2319,9 +2319,9 @@ sal_uInt32 XclExpXFBuffer::InsertWithFont( const ScPatternAttr* pPattern, sal_In
     return InsertCellXF( pPattern, nScript, NUMBERFORMAT_ENTRY_NOT_FOUND, nForceXclFont, bForceLineBreak );
 }
 
-sal_uInt32 XclExpXFBuffer::InsertWithNumFmt( const ScPatternAttr* pPattern, sal_Int16 nScript, ULONG nForceScNumFmt )
+sal_uInt32 XclExpXFBuffer::InsertWithNumFmt( const ScPatternAttr* pPattern, sal_Int16 nScript, ULONG nForceScNumFmt, bool bForceLineBreak )
 {
-    return InsertCellXF( pPattern, nScript, nForceScNumFmt, EXC_FONT_NOTFOUND, false );
+    return InsertCellXF( pPattern, nScript, nForceScNumFmt, EXC_FONT_NOTFOUND, bForceLineBreak );
 }
 
 sal_uInt32 XclExpXFBuffer::InsertStyle( const SfxStyleSheetBase* pStyleSheet )
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 1c7c945..8d27d2d 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -839,13 +839,15 @@ XclExpFormulaCell::XclExpFormulaCell(
 
         // #i41420# find script type according to result type (always latin for numeric results)
         sal_Int16 nScript = ApiScriptType::LATIN;
+        bool bForceLineBreak = false;
         if( nFormatType == NUMBERFORMAT_TEXT )
         {
             String aResult;
             mrScFmlaCell.GetString( aResult );
+            bForceLineBreak = mrScFmlaCell.IsMultilineResult();
             nScript = XclExpStringHelper::GetLeadingScriptType( rRoot, aResult );
         }
-        SetXFId( rRoot.GetXFBuffer().InsertWithNumFmt( pPattern, nScript, nAltScNumFmt ) );
+        SetXFId( rRoot.GetXFBuffer().InsertWithNumFmt( pPattern, nScript, nAltScNumFmt, bForceLineBreak ) );
     }
 
     // *** Convert the formula token array *** --------------------------------
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index b7ad67d..ecb2b2a 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -1154,9 +1154,31 @@ void ScHTMLExport::WriteCell( SCCOL nCol, SCROW nRow, SCTAB nTab )
     if ( !bFieldText )
     {
         if ( !aStrOut.Len() )
+        {
             TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak );		// #42573# keine komplett leere Zelle
+        }
         else
-            OUT_STR( aStrOut );
+        {
+            xub_StrLen nPos = aStrOut.Search( _LF );
+            if ( nPos == STRING_NOTFOUND )
+            {
+                OUT_STR( aStrOut );
+            }
+            else
+            {
+                xub_StrLen nStartPos = 0;
+                do
+                {
+                    String aSingleLine( aStrOut, nStartPos, nPos - nStartPos );
+                    OUT_STR( aSingleLine );
+                    TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak );
+                    nStartPos = nPos + 1;
+                } 
+                while( ( nPos = aStrOut.Search( _LF, nStartPos ) ) != STRING_NOTFOUND );
+                String aSingleLine( aStrOut, nStartPos, aStrOut.Len() - nStartPos );
+                OUT_STR( aSingleLine );
+            }
+        }
     }
     if ( pGraphEntry )
         WriteGraphEntry( pGraphEntry );
@@ -1194,7 +1216,7 @@ BOOL ScHTMLExport::WriteFieldText( const ScEditCell* pCell )
         for ( USHORT nPar=0; nPar < nParas; nPar++ )
         {
             if ( nPar > 0 )
-                rStrm << ' ';		// blank between paragraphs
+                TAG_ON( OOO_STRING_SVTOOLS_HTML_linebreak );
             SvUShorts aPortions;
             rEngine.GetPortions( nPar, aPortions );
             USHORT nCnt = aPortions.Count();
diff --git a/sc/source/filter/inc/dif.hxx b/sc/source/filter/inc/dif.hxx
index 0efa2b7..270878b 100644
--- a/sc/source/filter/inc/dif.hxx
+++ b/sc/source/filter/inc/dif.hxx
@@ -82,7 +82,11 @@ private:
     SvNumberFormatter*	pNumFormatter;
     SvStream&			rIn;
     BOOL				bPlain;
+    String              aLookAheadLine;
 
+    bool                ReadNextLine( String& rStr );
+    bool                LookAhead();
+    DATASET             GetNumberDataset( const sal_Unicode* pPossibleNumericData );
     static inline BOOL	IsBOT( const sal_Unicode* pRef );
     static inline BOOL	IsEOD( const sal_Unicode* pRef );
     static inline BOOL	Is1_0( const sal_Unicode* pRef );
diff --git a/sc/source/filter/inc/xestyle.hxx b/sc/source/filter/inc/xestyle.hxx
index 55cbc25..8485bb1 100644
--- a/sc/source/filter/inc/xestyle.hxx
+++ b/sc/source/filter/inc/xestyle.hxx
@@ -643,10 +643,13 @@ public:
         @param nXFFlags  Additional flags allowing to control the creation of an XF.
         @param nForceScNumFmt  The number format to be exported, e.g. formula
             result type. This format will always overwrite the cell's number format.
+        @param bForceLineBreak  true = Set line break flag unconditionally.
+            This is required for cells that contain multi-line text.
         @return  A unique XF record ID. */
     sal_uInt32          InsertWithNumFmt(
                             const ScPatternAttr* pPattern, sal_Int16 nScript,
-                            ULONG nForceScNumFmt );
+                            ULONG nForceScNumFmt,
+                            bool bForceLineBreak );
     /** Inserts the passed cell style. Creates a style XF record and a STYLE record.
         @return  A unique XF record ID. */
     sal_uInt32          InsertStyle( const SfxStyleSheetBase* pStyleSheet );
diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 3b7f33d..fe12ba2 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -71,7 +71,7 @@ FltError ScQProReader::readSheet( SCTAB nTab, ScDocument* pDoc, ScQProStyle *pSt
                 readString( aLabel, getLength() - 7 );
                 nStyle = nStyle >> 3;
                 pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle );
-                pDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aLabel ), (BOOL) TRUE );
+                pDoc->PutCell( nCol, nRow, nTab, ScBaseCell::CreateTextCell( aLabel, pDoc ), (BOOL) TRUE );
                 }
                 break;
 
diff --git a/sc/source/filter/xml/XMLExportIterator.cxx b/sc/source/filter/xml/XMLExportIterator.cxx
index 205336a..f11ce68 100644
--- a/sc/source/filter/xml/XMLExportIterator.cxx
+++ b/sc/source/filter/xml/XMLExportIterator.cxx
@@ -568,6 +568,7 @@ ScMyCell::ScMyCell() :
     aShapeList(),
     aDetectiveObjVec(),
     nValidationIndex(-1),
+    pBaseCell(NULL),
     bIsAutoStyle( sal_False ),
     bHasShape( sal_False ),
     bIsMergedBase( sal_False ),
diff --git a/sc/source/filter/xml/XMLExportIterator.hxx b/sc/source/filter/xml/XMLExportIterator.hxx
index d8fb9a9..295af1d 100644
--- a/sc/source/filter/xml/XMLExportIterator.hxx
+++ b/sc/source/filter/xml/XMLExportIterator.hxx
@@ -48,6 +48,7 @@ class	ScHorizontalCellIterator;
 struct	ScMyCell;
 class	ScXMLExport;
 class	ScFormatRangeStyles;
+class   ScBaseCell;
 
 //==============================================================================
 
@@ -312,6 +313,8 @@ struct ScMyCell
     sal_Int32					nNumberFormat;
     com::sun::star::table::CellContentType	nType;
 
+    ScBaseCell*                 pBaseCell;
+
     sal_Bool					bIsAutoStyle;
 
     sal_Bool					bHasShape;
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 728a90d..f0b631a 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2427,7 +2427,8 @@ void ScXMLExport::WriteCell (ScMyCell& aCell)
 
     if (!bIsEmpty)
     {
-        if ((aCell.nType == table::CellContentType_TEXT) && IsEditCell(aCell))
+        if ((aCell.nType == table::CellContentType_TEXT && IsEditCell(aCell)) || 
+            (aCell.nType == table::CellContentType_FORMULA && IsMultiLineFormulaCell(aCell)))
         {
             bEditCell = sal_True;
             uno::Reference<text::XText> xText(xCurrentTableCellRange->getCellByPosition(aCell.aCellAddress.Column, aCell.aCellAddress.Row), uno::UNO_QUERY);
@@ -2842,12 +2843,15 @@ sal_Bool ScXMLExport::IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& a
     return (aCell1.nType == aCell2.nType);
 }
 
-sal_Bool ScXMLExport::IsEditCell(const com::sun::star::table::CellAddress& aAddress) const
+sal_Bool ScXMLExport::IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell) const
 {
     ScAddress aCoreAddress(static_cast<SCCOL>(aAddress.Column),
                         static_cast<SCROW>(aAddress.Row),
                         static_cast<SCTAB>(aAddress.Sheet));
     ScBaseCell* pBaseCell = GetDocument() ? GetDocument()->GetCell(aCoreAddress) : NULL;
+    if (pMyCell)
+        pMyCell->pBaseCell = pBaseCell;
+
     if (pBaseCell)
         return (pBaseCell->GetCellType() == CELLTYPE_EDIT);
     return sal_False;
@@ -2867,12 +2871,36 @@ sal_Bool ScXMLExport::IsEditCell(ScMyCell& rCell) const
         return rCell.bIsEditCell;
     else
     {
-        rCell.bIsEditCell = IsEditCell(rCell.aCellAddress);
+         rCell.bIsEditCell = IsEditCell(rCell.aCellAddress, &rCell);
         rCell.bKnowWhetherIsEditCell = sal_True;
         return rCell.bIsEditCell;
     }
 }
 
+sal_Bool ScXMLExport::IsMultiLineFormulaCell(ScMyCell& rCell) const
+{
+    if (rCell.pBaseCell)
+    {
+        if (rCell.pBaseCell->GetCellType() != CELLTYPE_FORMULA)
+            return false;
+
+        return static_cast<ScFormulaCell*>(rCell.pBaseCell)->IsMultilineResult();
+    }
+
+    ScAddress aAddr(static_cast<SCCOL>(rCell.aCellAddress.Column), 
+                    static_cast<SCROW>(rCell.aCellAddress.Row),
+                    static_cast<SCTAB>(rCell.aCellAddress.Sheet));
+    ScBaseCell* pBaseCell = pDoc ? pDoc->GetCell(aAddr) : NULL;
+    if (!pBaseCell)
+        return false;
+
+    rCell.pBaseCell = pBaseCell;
+    if (rCell.pBaseCell->GetCellType() != CELLTYPE_FORMULA)
+        return false;
+
+    return static_cast<ScFormulaCell*>(rCell.pBaseCell)->IsMultilineResult();
+}
+
 //UNUSED2008-05  sal_Bool ScXMLExport::IsAnnotationEqual(const uno::Reference<table::XCell>& /* xCell1 */,
 //UNUSED2008-05                                          const uno::Reference<table::XCell>& /* xCell2 */)
 //UNUSED2008-05  {
diff --git a/sc/source/filter/xml/xmlexprt.hxx b/sc/source/filter/xml/xmlexprt.hxx
index 3962a23..efa9347 100644
--- a/sc/source/filter/xml/xmlexprt.hxx
+++ b/sc/source/filter/xml/xmlexprt.hxx
@@ -62,6 +62,7 @@ class XMLNumberFormatAttributesExportHelper;
 class ScChartListener;
 class SfxItemPool;
 class ScAddress;
+class ScBaseCell;
 
 typedef std::vector< com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > > ScMyXShapesVec;
 
@@ -187,9 +188,10 @@ class ScXMLExport : public SvXMLExport
     void SetRepeatAttribute (const sal_Int32 nEqualCellCount);
 
     sal_Bool IsCellTypeEqual (const ScMyCell& aCell1, const ScMyCell& aCell2) const;
-    sal_Bool IsEditCell(const com::sun::star::table::CellAddress& aAddress) const;
+     sal_Bool IsEditCell(const com::sun::star::table::CellAddress& aAddress, ScMyCell* pMyCell = NULL) const;
 //UNUSED2008-05  sal_Bool IsEditCell(const com::sun::star::uno::Reference <com::sun::star::table::XCell>& xCell) const;
     sal_Bool IsEditCell(ScMyCell& rCell) const;
+    sal_Bool IsMultiLineFormulaCell(ScMyCell& rCell) const;
 //UNUSED2008-05  sal_Bool IsAnnotationEqual(const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell1,
 //UNUSED2008-05                             const com::sun::star::uno::Reference<com::sun::star::table::XCell>& xCell2);
     sal_Bool IsCellEqual (ScMyCell& aCell1, ScMyCell& aCell2);
diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index 2935408..07cdd2c 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -313,6 +313,8 @@ sal_Bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor )
             BOOL bIncludeFiltered = pDoc->IsCutMode() || bUsedForLink;
 
             ScImportExport aObj( pDoc, aBlock );
+            if ( bUsedForLink )
+                aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, ' ', false ) );
             aObj.SetFormulas( pDoc->GetViewOptions().GetOption( VOPT_FORMULAS ) );
             aObj.SetIncludeFiltered( bIncludeFiltered );
 
@@ -817,7 +819,10 @@ void ScTransferObj::StripRefs( ScDocument* pDoc,
                 {
                     String aStr;
                     pFCell->GetString(aStr);
-                    pNew = new ScStringCell( aStr );
+                    if ( pFCell->IsMultilineResult() )
+                        pNew = new ScEditCell( aStr, pDestDoc );
+                    else
+                        pNew = new ScStringCell( aStr );
                 }
                 pDestDoc->PutCell( nCol,nRow,nDestTab, pNew );
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 2785abf..70c4c25 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -1076,6 +1076,7 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
             }
             bSetColWidths = TRUE;
             bSetSimpleTextColWidths = TRUE;
+            bSetRowHeights = TRUE;
         }
         else if (aFltName.EqualsAscii(pFilterSylk))
         {
@@ -1103,6 +1104,7 @@ BOOL __EXPORT ScDocShell::ConvertFrom( SfxMedium& rMedium )
                 SetError(eError);
             bSetColWidths = TRUE;
             bSetSimpleTextColWidths = TRUE;
+            bSetRowHeights = TRUE;
         }
         else if (aFltName.EqualsAscii(pFilterQPro6))
         {
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 373a4bb..2fed3ff 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2424,10 +2424,12 @@ long __EXPORT ScDocShell::DdeGetData( const String& rItem,
         if( aDdeTextFmt.EqualsAscii( "CSV" ) ||
             aDdeTextFmt.EqualsAscii( "FCSV" ) )
             aObj.SetSeparator( ',' );
+        aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, 0, false ) );
         return aObj.ExportData( rMimeType, rValue ) ? 1 : 0;
     }
 
     ScImportExport aObj( &aDocument, rItem );
+    aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, 0, false ) );
     if( aObj.IsRef() )
         return aObj.ExportData( rMimeType, rValue ) ? 1 : 0;
     return 0;
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index ed2fe83..0590de5 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -93,6 +93,21 @@ class StarBASIC;
 
 //========================================================================
 
+namespace
+{
+    const String SYLK_LF = String::CreateFromAscii("\x1b :");
+    const String DOUBLE_SEMICOLON = String::CreateFromAscii(";;");
+    const String DOUBLE_DOUBLEQUOTE = String::CreateFromAscii("\"\"");
+}
+
+enum SylkVersion
+{
+    SYLK_SCALC3,    // Wrote wrongly quoted strings and unescaped semicolons.
+    SYLK_OOO32,     // Correct strings, plus multiline content.
+    SYLK_OWN,       // Place our new versions, if any, before this value.
+    SYLK_OTHER      // Assume that aliens wrote correct strings.
+};
+
 
 // Gesamtdokument ohne Undo
 
@@ -102,7 +117,7 @@ ScImportExport::ScImportExport( ScDocument* p )
       nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ), 
       bFormulas( FALSE ), bIncludeFiltered( TRUE ),
       bAll( TRUE ), bSingle( TRUE ), bUndo( FALSE ),
-      bOverflow( FALSE ), mbApi( true )
+      bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
 {
     pUndoDoc = NULL;
     pExtOptions = NULL;
@@ -117,7 +132,7 @@ ScImportExport::ScImportExport( ScDocument* p, const ScAddress& rPt )
       nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ), 
       bFormulas( FALSE ), bIncludeFiltered( TRUE ),
       bAll( FALSE ), bSingle( TRUE ), bUndo( BOOL( pDocSh != NULL ) ),
-      bOverflow( FALSE ), mbApi( true )
+      bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
 {
     pUndoDoc = NULL;
     pExtOptions = NULL;
@@ -133,7 +148,7 @@ ScImportExport::ScImportExport( ScDocument* p, const ScRange& r )
       nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
       bFormulas( FALSE ), bIncludeFiltered( TRUE ),
       bAll( FALSE ), bSingle( FALSE ), bUndo( BOOL( pDocSh != NULL ) ),
-      bOverflow( FALSE ), mbApi( true )
+      bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
 {
     pUndoDoc = NULL;
     pExtOptions = NULL;
@@ -150,7 +165,7 @@ ScImportExport::ScImportExport( ScDocument* p, const String& rPos )
       nSizeLimit( 0 ), cSep( '\t' ), cStr( '"' ),
       bFormulas( FALSE ), bIncludeFiltered( TRUE ),
       bAll( FALSE ), bSingle( TRUE ), bUndo( BOOL( pDocSh != NULL ) ),
-      bOverflow( FALSE ), mbApi( true )
+      bOverflow( FALSE ), mbApi( true ), mExportTextOptions()
 {
     pUndoDoc = NULL;
     pExtOptions = NULL;
@@ -575,6 +590,7 @@ void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const String& rS
 }
 
 
+// This function could be replaced by endlub()
 // static
 void ScImportExport::WriteUnicodeOrByteEndl( SvStream& rStrm )
 {
@@ -605,7 +621,7 @@ enum DoubledQuoteMode
     DQM_SEPARATE	// end one string and begin next
 };
 
-const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String& rString,
+static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String& rString,
             sal_Unicode cStr, DoubledQuoteMode eMode )
 {
     p++;	//! jump over opening quote
@@ -653,8 +669,126 @@ const sal_Unicode* lcl_ScanString( const sal_Unicode* p, String& rString,
     return p;
 }
 
+void lcl_UnescapeSylk( String & rString, SylkVersion eVersion )
+{
+    // Older versions didn't escape the semicolon.
+    // Older versions quoted the string and doubled embedded quotes, but not 
+    // the semicolons, which was plain wrong.
+    if (eVersion >= SYLK_OOO32)
+        rString.SearchAndReplaceAll( DOUBLE_SEMICOLON, ';' );
+    else
+        rString.SearchAndReplaceAll( DOUBLE_DOUBLEQUOTE, '"' );
+
+    rString.SearchAndReplaceAll( SYLK_LF, _LF );
+}
+
+static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p,
+        String& rString, SylkVersion eVersion )
+{
+    const sal_Unicode* pStartQuote = p;
+    const sal_Unicode* pEndQuote = 0;
+    while( *(++p) )
+    {
+        if( *p == '"' )
+        {
+            pEndQuote = p;
+            if (eVersion >= SYLK_OOO32)
+            {
+                if (*(p+1) == ';')
+                {
+                    if (*(p+2) == ';')
+                    {
+                        p += 2;     // escaped ';'
+                        pEndQuote = 0;
+                    }
+                    else
+                        break;      // end field
+                }
+            }
+            else
+            {
+                if (*(p+1) == '"')
+                {
+                    ++p;            // escaped '"'
+                    pEndQuote = 0;
+                }
+                else if (*(p+1) == ';')
+                    break;          // end field
+            }
+        }
+    }
+    if (!pEndQuote)
+        pEndQuote = p;  // Take all data as string.
+    rString.Append( pStartQuote + 1, sal::static_int_cast<xub_StrLen>( pEndQuote - pStartQuote - 1 ) );
+    lcl_UnescapeSylk( rString, eVersion);
+    return p;
+}
+
+static const sal_Unicode* lcl_ScanSylkFormula( const sal_Unicode* p,
+        String& rString, SylkVersion eVersion )
+{
+    const sal_Unicode* pStart = p;
+    if (eVersion >= SYLK_OOO32)
+    {
+        while (*p)
+        {
+            if (*p == ';')
+            {
+                if (*(p+1) == ';')
+                    ++p;        // escaped ';'
+                else
+                    break;      // end field
+            }
+            ++p;
+        }
+        rString.Append( pStart, sal::static_int_cast<xub_StrLen>( p - pStart));
+        lcl_UnescapeSylk( rString, eVersion);
+    }
+    else
+    {
+        // Nasty. If in old versions the formula contained a semicolon, it was 
+        // quoted and embedded quotes were doubled, but semicolons were not. If 
+        // there was no semicolon, it could still contain quotes and doubled 
+        // embedded quotes if it was something like ="a""b", which was saved as 
+        // E"a""b" as is and has to be preserved, even if older versions 
+        // couldn't even load it correctly. However, theoretically another 
+        // field might follow and thus the line contain a semicolon again, such 
+        // as ...;E"a""b";...
+        bool bQuoted = false;
+        if (*p == '"')
+        {
+            // May be a quoted expression or just a string constant expression 
+            // with quotes.
+            while (*(++p))
+            {
+                if (*p == '"')
+                {
+                    if (*(p+1) == '"')
+                        ++p;            // escaped '"'
+                    else
+                        break;          // closing '"', had no ';' yet
+                }
+                else if (*p == ';')
+                {
+                    bQuoted = true;     // ';' within quoted expression
+                    break;
+                }
+            }
+            p = pStart;
+        }
+        if (bQuoted)
+            p = lcl_ScanSylkString( p, rString, eVersion);
+        else
+        {
+            while (*p && *p != ';')
+                ++p;
+            rString.Append( pStart, sal::static_int_cast<xub_StrLen>( p - pStart));
+        }
+    }
+    return p;
+}
 
-void lcl_WriteString( SvStream& rStrm, String& rString, sal_Unicode cStr )
+static void lcl_DoubleEscapeChar( String& rString, sal_Unicode cStr )
 {
     xub_StrLen n = 0;
     while( ( n = rString.Search( cStr, n ) ) != STRING_NOTFOUND )
@@ -662,9 +796,18 @@ void lcl_WriteString( SvStream& rStrm, String& rString, sal_Unicode cStr )
         rString.Insert( cStr, n );
         n += 2;
     }
+}
 
-    rString.Insert( cStr, 0 );
-    rString.Append( cStr );
+static void lcl_WriteString( SvStream& rStrm, String& rString, sal_Unicode cQuote, sal_Unicode cEsc )
+{
+    if (cEsc)
+        lcl_DoubleEscapeChar( rString, cEsc );
+
+    if (cQuote)
+    {
+        rString.Insert( cQuote, 0 );
+        rString.Append( cQuote );
+    }
 
     ScImportExport::WriteUnicodeOrByteString( rStrm, rString );
 }
@@ -1279,6 +1422,7 @@ BOOL ScImportExport::Doc2Text( SvStream& rStrm )
     SCCOL nEndCol = aRange.aEnd.Col();
     SCROW nEndRow = aRange.aEnd.Row();
     String aCell;
+    bool bConvertLF = (GetSystemLineEnd() != LINEEND_LF);
 
     for (nRow = nStartRow; nRow <= nEndRow; nRow++)
     {
@@ -1296,15 +1440,28 @@ BOOL ScImportExport::Doc2Text( SvStream& rStrm )
                         {
                             pDoc->GetFormula( nCol, nRow, aRange.aStart.Tab(), aCell, TRUE );
                             if( aCell.Search( cSep ) != STRING_NOTFOUND )
-                                lcl_WriteString( rStrm, aCell, cStr );
+                                lcl_WriteString( rStrm, aCell, cStr, cStr );
                             else
                                 lcl_WriteSimpleString( rStrm, aCell );
                         }
                         else
                         {
                             pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCell );
-                            if( aCell.Search( cSep ) != STRING_NOTFOUND )
-                                lcl_WriteString( rStrm, aCell, cStr );
+
+                            bool bMultiLineText = ( aCell.Search( _LF ) != STRING_NOTFOUND );
+                            if( bMultiLineText )
+                            {
+                                if( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSpace )
+                                    aCell.SearchAndReplaceAll( _LF, ' ' );
+                                else if ( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSystem && bConvertLF )
+                                    aCell.ConvertLineEnd();
+                            }
+
+                            if( mExportTextOptions.mcSeparatorConvertTo && cSep )
+                                aCell.SearchAndReplaceAll( cSep, mExportTextOptions.mcSeparatorConvertTo );
+
+                            if( mExportTextOptions.mbAddQuotes && ( aCell.Search( cSep ) != STRING_NOTFOUND ) )
+                                lcl_WriteString( rStrm, aCell, cStr, cStr );
                             else
                                 lcl_WriteSimpleString( rStrm, aCell );
                         }
@@ -1322,8 +1479,21 @@ BOOL ScImportExport::Doc2Text( SvStream& rStrm )
                     default:
                     {
                         pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCell );
-                        if( aCell.Search( cSep ) != STRING_NOTFOUND )
-                            lcl_WriteString( rStrm, aCell, cStr );
+
+                        bool bMultiLineText = ( aCell.Search( _LF ) != STRING_NOTFOUND );
+                        if( bMultiLineText )
+                        {
+                            if( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSpace )
+                                aCell.SearchAndReplaceAll( _LF, ' ' );
+                            else if ( mExportTextOptions.meNewlineConversion == ScExportTextOptions::ToSystem && bConvertLF )
+                                aCell.ConvertLineEnd();
+                        }
+
+                        if( mExportTextOptions.mcSeparatorConvertTo && cSep )
+                            aCell.SearchAndReplaceAll( cSep, mExportTextOptions.mcSeparatorConvertTo );
+
+                        if( mExportTextOptions.mbAddQuotes && ( aCell.Search( cSep ) != STRING_NOTFOUND ) )
+                            lcl_WriteString( rStrm, aCell, cStr, cStr );
                         else
                             lcl_WriteSimpleString( rStrm, aCell );
                     }
@@ -1348,6 +1518,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
 {
     BOOL bOk = TRUE;
     BOOL bMyDoc = FALSE;
+    SylkVersion eVersion = SYLK_OTHER;
 
     // US-English separators for StringToDouble
     sal_Unicode cDecSep = '.';
@@ -1424,8 +1595,8 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
                             if( *p == '"' )
                             {
                                 bText = TRUE;
-                                aText = '\'';       // force string cell
-                                p = lcl_ScanString( p, aText, '"', DQM_ESCAPE );
+                                aText.Erase();
+                                p = lcl_ScanSylkString( p, aText, eVersion);
                             }
                             else
                                 bText = FALSE;
@@ -1435,7 +1606,11 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
                             if ( !(*q == ';' && *(q+1) == 'I') )
                             {   // don't ignore value
                                 if( bText )
-                                    pDoc->SetString( nCol, nRow, aRange.aStart.Tab(), aText );
+                                {
+                                    pDoc->PutCell( nCol, nRow, aRange.aStart.Tab(), 
+                                            ScBaseCell::CreateTextCell( aText, pDoc),
+                                            (BOOL) TRUE);
+                                }
                                 else
                                 {
                                     double fVal = rtl_math_uStringToDouble( p,
@@ -1466,15 +1641,7 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
                             if( !bMyDoc || !bData )
                                 break;
                             aText = '=';
-                            if( *p == '"' )
-                                p = lcl_ScanString( p, aText, '"', DQM_ESCAPE );
-                            else
-                            {
-                                const sal_Unicode* q = p;
-                                while( *p && *p != ';' )
-                                    p++;
-                                aText.Append( q, sal::static_int_cast<xub_StrLen>( p-q ) );
-                            }
+                            p = lcl_ScanSylkFormula( p, aText, eVersion);
                             ScAddress aPos( nCol, nRow, aRange.aStart.Tab() );
                             /* FIXME: do we want GRAM_ODFF_A1 instead? At the
                              * end it probably should be GRAM_ODFF_R1C1, since
@@ -1584,7 +1751,11 @@ BOOL ScImportExport::Sylk2Doc( SvStream& rStrm )
             else if( cTag == 'I' && *p == 'D' )
             {
                 aLine.Erase( 0, 4 );
-                bMyDoc = aLine.EqualsAscii( "SCALC3" );
+                if (aLine.EqualsAscii( "CALCOOO32" ))
+                    eVersion = SYLK_OOO32;
+                else if (aLine.EqualsAscii( "SCALC3" ))
+                    eVersion = SYLK_SCALC3;
+                bMyDoc = (eVersion <= SYLK_OWN);
             }
             else if( cTag == 'E' )						// Ende
                 break;
@@ -1616,7 +1787,7 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
     String aCellStr;
     String aValStr;
     lcl_WriteSimpleString( rStrm,
-            String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM( "ID;PSCALC3" )) );
+            String( RTL_CONSTASCII_USTRINGPARAM( "ID;PCALCOOO32")));
     WriteUnicodeOrByteEndl( rStrm );
 
     for (nRow = nStartRow; nRow <= nEndRow; nRow++)
@@ -1661,6 +1832,7 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
                 case CELLTYPE_EDIT:
                 hasstring:
                     pDoc->GetString( nCol, nRow, aRange.aStart.Tab(), aCellStr );
+                    aCellStr.SearchAndReplaceAll( _LF, SYLK_LF );
 
                     aBufStr.AssignAscii(RTL_CONSTASCII_STRINGPARAM( "C;X" ));
                     aBufStr += String::CreateFromInt32( c );
@@ -1668,7 +1840,7 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
                     aBufStr += String::CreateFromInt32( r );
                     aBufStr.AppendAscii(RTL_CONSTASCII_STRINGPARAM( ";K" ));
                     lcl_WriteSimpleString( rStrm, aBufStr );
-                    lcl_WriteString( rStrm, aCellStr, '"' );
+                    lcl_WriteString( rStrm, aCellStr, '"', ';' );
 
                 checkformula:
                     if( bForm )
@@ -1730,12 +1902,7 @@ BOOL ScImportExport::Doc2Sylk( SvStream& rStrm )
                         }
                         lcl_WriteSimpleString( rStrm, aPrefix );
                         if ( aCellStr.Len() )
-                        {
-                            if( aCellStr.Search( ';' ) != STRING_NOTFOUND )
-                                lcl_WriteString( rStrm, aCellStr, '"' );
-                            else
-                                lcl_WriteSimpleString( rStrm, aCellStr );
-                        }
+                            lcl_WriteString( rStrm, aCellStr, 0, ';' );
                     }
                     WriteUnicodeOrByteEndl( rStrm );
                     break;
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index 33a77cb..b87a862 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -200,10 +200,12 @@ BOOL __EXPORT ScServerObject::GetData(
         if( aDdeTextFmt.EqualsAscii( "CSV" ) ||
             aDdeTextFmt.EqualsAscii( "FCSV" ) )
             aObj.SetSeparator( ',' );
+        aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, ' ', false ) );
         return aObj.ExportData( rMimeType, rData ) ? 1 : 0;
     }
 
     ScImportExport aObj( pDoc, aRange );
+    aObj.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::ToSpace, ' ', false ) );
     if( aObj.IsRef() )
         return aObj.ExportData( rMimeType, rData ) ? 1 : 0;
     return 0;
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index df80538..3abab58 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -42,6 +42,17 @@ class SvStream;
 class SfxMedium;
 class ScAsciiOptions;
 
+struct ScExportTextOptions
+{
+    enum NewlineConversion { ToSystem, ToSpace, None };
+    ScExportTextOptions( NewlineConversion eNewlineConversion = ToSystem, sal_Unicode cSeparatorConvertTo = 0, bool bAddQuotes = false ) : 
+        meNewlineConversion( eNewlineConversion ), mcSeparatorConvertTo( cSeparatorConvertTo ), mbAddQuotes( bAddQuotes ) {}
+
+    NewlineConversion meNewlineConversion;
+    sal_Unicode mcSeparatorConvertTo;   // Convert separator to this character
+    bool mbAddQuotes;
+};
+
 class ScImportExport
 {
     ScDocShell* pDocSh;
@@ -60,6 +71,7 @@ class ScImportExport
     BOOL		bUndo;					// Mit Undo?
     BOOL		bOverflow;				// zuviele Zeilen/Spalten
     bool        mbApi;
+    ScExportTextOptions mExportTextOptions;
 
     ScAsciiOptions*	pExtOptions;		// erweiterte Optionen
 
@@ -138,6 +150,8 @@ public:
 
     bool IsApi() const { return mbApi; }
     void SetApi( bool bApi ) { mbApi = bApi; }
+    const ScExportTextOptions& GetExportTextOptions() { return mExportTextOptions; }
+    void SetExportTextOptions( const ScExportTextOptions& options ) { mExportTextOptions = options; }
 };
 
 
diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx
index cf0d80a..c272e02 100644
--- a/sc/source/ui/view/cellsh2.cxx
+++ b/sc/source/ui/view/cellsh2.cxx
@@ -1067,6 +1067,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
                     DBG_ASSERT( pDoc, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pDoc is null!" );
 
                     ScImportExport aExport( pDoc, aRange );
+                    aExport.SetExportTextOptions( ScExportTextOptions( ScExportTextOptions::None, 0, false ) );
 
                     // #i87703# text to columns fails with tab separator
                     aExport.SetDelimiter( static_cast< sal_Unicode >( 0 ) );
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index dec757a..d1f1ee3 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1358,11 +1358,13 @@ void ScOutputData::DrawStrings( BOOL bPixelToLogic )
                 }
                 if (bDoCell && !bNeedEdit)
                 {
-                    if ( pCell->GetCellType() == CELLTYPE_FORMULA )
+                    BOOL bFormulaCell = (pCell->GetCellType() == CELLTYPE_FORMULA );
+                    if ( bFormulaCell )
                         lcl_CreateInterpretProgress( bProgress, pDoc, (ScFormulaCell*)pCell );
                     if ( aVars.SetText(pCell) )
                         pOldPattern = NULL;
-                    bNeedEdit = aVars.HasEditCharacters();
+                    bNeedEdit = aVars.HasEditCharacters() ||
+                                    (bFormulaCell && ((ScFormulaCell*)pCell)->IsMultilineResult());
                 }
                 if (bDoCell && !bNeedEdit)
                 {


More information about the ooo-build-commit mailing list