Commits

obo  committed 2837163 Merge

CWS-TOOLING: integrate CWS calc55

  • Participants
  • Parent commits 63f3395, 80113b4

Comments (0)

Files changed (40)

File chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx

     PROP_DOCUMENT_BASEDIAGRAM,
     PROP_DOCUMENT_ADDITIONAL_SHAPES,
     PROP_DOCUMENT_UPDATE_ADDIN,
-    PROP_DOCUMENT_NULL_DATE
+    PROP_DOCUMENT_NULL_DATE,
+    PROP_DOCUMENT_DISABLE_COMPLEX_CHARTTYPES,
+    PROP_DOCUMENT_DISABLE_DATATABLE_DIALOG
 };
 
 void lcl_AddPropertiesToVector(
                   PROP_DOCUMENT_NULL_DATE,
                   ::getCppuType( static_cast< const ::com::sun::star::util::DateTime * >(0)),
                   beans::PropertyAttribute::MAYBEVOID ));
+
+    rOutProperties.push_back(
+        Property( C2U( "DisableComplexChartTypes" ),
+                  PROP_DOCUMENT_DISABLE_COMPLEX_CHARTTYPES,
+                  ::getBooleanCppuType(),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT ) );
+    rOutProperties.push_back(
+        Property( C2U( "DisableDataTableDialog" ),
+                  PROP_DOCUMENT_DISABLE_DATATABLE_DIALOG,
+                  ::getBooleanCppuType(),
+                  beans::PropertyAttribute::BOUND
+                  | beans::PropertyAttribute::MAYBEDEFAULT ) );
 }
 
 const uno::Sequence< Property > & lcl_GetPropertySequence()
     aWrappedProperties.push_back( new WrappedAdditionalShapesProperty( *this ) );
     aWrappedProperties.push_back( new WrappedRefreshAddInAllowedProperty( *this ) );
     aWrappedProperties.push_back( new WrappedIgnoreProperty( C2U("NullDate"),Any() ) ); // i99104
+    aWrappedProperties.push_back( new WrappedIgnoreProperty( C2U( "DisableComplexChartTypes" ), uno::makeAny( sal_False ) ) );
+    aWrappedProperties.push_back( new WrappedIgnoreProperty( C2U( "DisableDataTableDialog" ), uno::makeAny( sal_False ) ) );
 
     return aWrappedProperties;
 }

File chart2/source/controller/dialogs/res_ErrorBar.cxx

 #include "RangeSelectionHelper.hxx"
 // for RANGE_SELECTION_INVALID_RANGE_BACKGROUND_COLOR
 #include "TabPageNotifiable.hxx"
+#include "macros.hxx"
 
 #include <rtl/math.hxx>
 #include <vcl/dialog.hxx>
         m_pParentWindow( pParent ),
         m_pParentDialog( pParentDialog ),
         m_pCurrentRangeChoosingField( 0 ),
-        m_bHasInternalDataProvider( true )
+        m_bHasInternalDataProvider( true ),
+        m_bDisableDataTableDialog( false )
 {
     if( m_bNoneAvailable )
         m_aRbNone.SetClickHdl( LINK( this, ErrorBarResources, CategoryChosen ));
     const uno::Reference< chart2::XChartDocument > & xChartDocument )
 {
     if( xChartDocument.is())
+    {
         m_bHasInternalDataProvider = xChartDocument->hasInternalDataProvider();
+        uno::Reference< beans::XPropertySet > xProps( xChartDocument, uno::UNO_QUERY );
+        if ( xProps.is() )
+        {
+            try
+            {
+                xProps->getPropertyValue( C2U( "DisableDataTableDialog" ) ) >>= m_bDisableDataTableDialog;
+            }
+            catch( uno::Exception& e )
+            {
+                ASSERT_EXCEPTION( e );
+            }
+        }
+    }
     m_apRangeSelectionHelper.reset( new RangeSelectionHelper( xChartDocument ));
 
     // has internal data provider => rename "cell range" to "from data"
     m_aLbFunction.Enable( bIsFunction );
 
     // range buttons
+    m_aRbRange.Enable( !m_bHasInternalDataProvider || !m_bDisableDataTableDialog );
     bool bShowRange = ( m_aRbRange.IsChecked());
     bool bCanChooseRange =
         ( bShowRange &&

File chart2/source/controller/dialogs/tp_ChartType.cxx

 
     bool bIsHighContrast = ( true && GetSettings().GetStyleSettings().GetHighContrastMode() );
 
+    bool bDisableComplexChartTypes = false;
+    uno::Reference< beans::XPropertySet > xProps( m_xChartModel, uno::UNO_QUERY );
+    if ( xProps.is() )
+    {
+        try
+        {
+            xProps->getPropertyValue( C2U( "DisableComplexChartTypes" ) ) >>= bDisableComplexChartTypes;
+        }
+        catch( uno::Exception& e )
+        {
+            ASSERT_EXCEPTION( e );
+        }
+    }
+
     m_aChartTypeDialogControllerList.push_back(new ColumnChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new BarChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new PieChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new AreaChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new LineChartDialogController() );
-    m_aChartTypeDialogControllerList.push_back(new XYChartDialogController() );
-    m_aChartTypeDialogControllerList.push_back(new BubbleChartDialogController() );
+    if ( !bDisableComplexChartTypes )
+    {
+        m_aChartTypeDialogControllerList.push_back(new XYChartDialogController() );
+        m_aChartTypeDialogControllerList.push_back(new BubbleChartDialogController() );
+    }
     m_aChartTypeDialogControllerList.push_back(new NetChartDialogController() );
-    m_aChartTypeDialogControllerList.push_back(new StockChartDialogController() );
+    if ( !bDisableComplexChartTypes )
+    {
+        m_aChartTypeDialogControllerList.push_back(new StockChartDialogController() );
+    }
     m_aChartTypeDialogControllerList.push_back(new CombiColumnLineChartDialogController() );
 
     ::std::vector< ChartTypeDialogController* >::const_iterator       aIter = m_aChartTypeDialogControllerList.begin();

File chart2/source/controller/inc/res_ErrorBar.hxx

                          m_apRangeSelectionHelper;
     Edit *               m_pCurrentRangeChoosingField;
     bool                 m_bHasInternalDataProvider;
+    bool                 m_bDisableDataTableDialog;
 
     DECL_LINK( CategoryChosen, void * );
     DECL_LINK( SynchronizePosAndNeg, void * );

File chart2/source/controller/main/ControllerCommandDispatch.cxx

 
     bool bShapeContext = ( m_pChartController ? m_pChartController->isShapeContext() : false );
 
+    bool bDisableDataTableDialog = false;
+    if ( m_xController.is() )
+    {
+        Reference< beans::XPropertySet > xProps( m_xController->getModel(), uno::UNO_QUERY );
+        if ( xProps.is() )
+        {
+            try
+            {
+                xProps->getPropertyValue( C2U( "DisableDataTableDialog" ) ) >>= bDisableDataTableDialog;
+            }
+            catch( uno::Exception& e )
+            {
+                ASSERT_EXCEPTION( e );
+            }
+        }
+    }
+
     // edit commands
     m_aCommandAvailability[ C2U(".uno:Cut")] = bIsWritable && bControllerStateIsValid && m_apControllerState->bIsDeleteableObjectSelected;
     m_aCommandAvailability[ C2U(".uno:Copy")] = bControllerStateIsValid && m_apControllerState->bHasSelectedObject;
 
     // depending on own data
     m_aCommandAvailability[ C2U(".uno:DataRanges")] = bIsWritable && bModelStateIsValid && (! m_apModelState->bHasOwnData);
-    m_aCommandAvailability[ C2U(".uno:DiagramData")] = bIsWritable && bModelStateIsValid &&  m_apModelState->bHasOwnData;
+    m_aCommandAvailability[ C2U(".uno:DiagramData")] = bIsWritable && bModelStateIsValid &&  m_apModelState->bHasOwnData && !bDisableDataTableDialog;
 
     // titles
     m_aCommandAvailability[ C2U(".uno:MainTitle")] = bIsWritable && bModelStateIsValid && m_apModelState->bHasMainTitle;
 
     // series arrangement
     m_aCommandAvailability[ C2U(".uno:Forward")] = ( bShapeContext ? isShapeControllerCommandAvailable( C2U( ".uno:Forward" ) ) :
-        ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesForward ) );
+        ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesForward && !bDisableDataTableDialog ) );
     m_aCommandAvailability[ C2U(".uno:Backward")] = ( bShapeContext ? isShapeControllerCommandAvailable( C2U( ".uno:Backward" ) ) :
-        ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesBackward ) );
+        ( bIsWritable && bControllerStateIsValid && m_apControllerState->bMayMoveSeriesBackward && !bDisableDataTableDialog ) );
 
     m_aCommandAvailability[ C2U(".uno:InsertDataLabels")] = bIsWritable;
     m_aCommandAvailability[ C2U(".uno:InsertDataLabel")] = bIsWritable;

File chart2/source/tools/WrappedPropertySet.cxx

 // header for define DELETEZ
 #include <tools/solar.h>
 
+#include <tools/debug.hxx>
+
 //.............................................................................
 namespace chart
 {
         else if( xInnerPropertySet.is() )
             xInnerPropertySet->setPropertyValue( rPropertyName, rValue );
         else
-            throw beans::UnknownPropertyException();
+        {
+#if OSL_DEBUG_LEVEL > 1
+            DBG_ERROR("found no inner property set to map to");
+#endif
+        }
     }
     catch( beans::UnknownPropertyException& ex )
     {
         else if( xInnerPropertySet.is() )
             aRet = xInnerPropertySet->getPropertyValue( rPropertyName );
         else
-            throw beans::UnknownPropertyException();
+        {
+#if OSL_DEBUG_LEVEL > 1
+            DBG_ERROR("found no inner property set to map to");
+#endif
+        }
     }
     catch( beans::UnknownPropertyException& ex )
     {

File javaunohelper/com/sun/star/lib/uno/helper/PropertySet.java

      *  @return The value of the property.
      */
     protected Object getPropertyValue(Property property)
-    throws com.sun.star.lang.WrappedTargetException
     {
         Object ret= null;
         try
                     ret= propField.get(this);
             }
         }
-        catch(java.lang.Exception e)
+        catch(java.lang.NoSuchFieldException e)
         {
-            throw new WrappedTargetException("PropertySet.setPropertyValue_NoBroadcast", this, e);
+            throw new java.lang.RuntimeException(e);
+        }
+        catch(java.lang.IllegalAccessException e)
+        {
+            throw new java.lang.RuntimeException(e);
         }
         return ret;
     }
                     {
                        value= getPropertyValue(prop);
                     } 
-                    catch(WrappedTargetException e) 
+                    catch(Exception e) 
                     {
                         continue;
                     }

File offapi/com/sun/star/sheet/NoConvergenceException.idl

+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __com_sun_star_sheet_NoConvergenceException_idl__
+#define __com_sun_star_sheet_NoConvergenceException_idl__
+
+#ifndef __com_sun_star_uno_Exception_idl__
+#include <com/sun/star/uno/Exception.idl>
+#endif
+
+//=============================================================================
+
+module com { module sun { module star { module sheet {
+
+//=============================================================================
+
+/** Thrown by a Calc Add-In function this exception indicates the 
+    function's algorithm did not converge to a meaningful result.
+
+    @since OOo 3.3
+ */
+exception NoConvergenceException : ::com::sun::star::uno::Exception{};
+
+//=============================================================================
+}; }; }; };
+//=============================================================================
+
+#endif

File offapi/com/sun/star/sheet/makefile.mk

 	NamedRangeFlag.idl\
 	NamedRanges.idl\
 	NamedRangesEnumeration.idl\
+	NoConvergenceException.idl\
 	PasteOperation.idl\
 	RangeSelectionArguments.idl\
 	RangeSelectionEvent.idl\

File sc/inc/chartuno.hxx

 #include "address.hxx"
 #include <svl/lstner.hxx>
 #include <tools/string.hxx>
- 
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/propertycontainer.hxx>
+
 #include <com/sun/star/table/XTableChart.hpp>
 #include <com/sun/star/table/XTableCharts.hpp>
 #include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
 #include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
 #include <com/sun/star/container/XNamed.hpp>
+#include <cppuhelper/compbase4.hxx>
 #include <cppuhelper/implbase4.hxx>
 
 
 };
 
 
-class ScChartObj : public cppu::WeakImplHelper4<
-							com::sun::star::table::XTableChart,
-							com::sun::star::document::XEmbeddedObjectSupplier,
-							com::sun::star::container::XNamed,
-							com::sun::star::lang::XServiceInfo >,
-						public SfxListener
+typedef ::cppu::WeakComponentImplHelper4<
+    ::com::sun::star::table::XTableChart,
+    ::com::sun::star::document::XEmbeddedObjectSupplier,
+    ::com::sun::star::container::XNamed,
+    ::com::sun::star::lang::XServiceInfo > ScChartObj_Base;
+
+typedef ::comphelper::OPropertyContainer ScChartObj_PBase;
+typedef ::comphelper::OPropertyArrayUsageHelper< ScChartObj > ScChartObj_PABase;
+
+class ScChartObj : public ::comphelper::OBaseMutex
+                  ,public ScChartObj_Base
+                  ,public ScChartObj_PBase
+                  ,public ScChartObj_PABase
+                  ,public SfxListener
 {
 private:
 	ScDocShell*				pDocShell;
 	void	Update_Impl( const ScRangeListRef& rRanges, bool bColHeaders, bool bRowHeaders );
 	void	GetData_Impl( ScRangeListRef& rRanges, bool& rColHeaders, bool& rRowHeaders ) const;
 
+protected:
+    // ::comphelper::OPropertySetHelper
+    virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+    virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
+        throw (::com::sun::star::uno::Exception);
+    using ::cppu::OPropertySetHelper::getFastPropertyValue;
+    virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
+
+    // ::comphelper::OPropertyArrayUsageHelper
+    virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const;
+
 public:
 							ScChartObj(ScDocShell* pDocSh, SCTAB nT, const String& rN);
 	virtual					~ScChartObj();
 
 	virtual void			Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
 
+    // XInterface
+    DECLARE_XINTERFACE()
+
+    // XTypeProvider
+    DECLARE_XTYPEPROVIDER()
+
+    // XComponent
+    virtual void SAL_CALL disposing();
+
 							// XTableChart
 	virtual sal_Bool SAL_CALL getHasColumnHeaders() throw(::com::sun::star::uno::RuntimeException);
 	virtual void SAL_CALL	setHasColumnHeaders( sal_Bool bHasColumnHeaders )
 								throw(::com::sun::star::uno::RuntimeException);
 	virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
 								throw(::com::sun::star::uno::RuntimeException);
+
+    // XPropertySet
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo()
+        throw (::com::sun::star::uno::RuntimeException);
 };
 
 #endif

File sc/inc/dpobject.hxx

 	virtual	ScDataObject*	Clone() const;
 
 	ScDPObject*	operator[](USHORT nIndex) const {return (ScDPObject*)At(nIndex);}
+    ScDPObject*	GetByName(const String& rName) const;
 
     void        DeleteOnTab( SCTAB nTab );
 	void		UpdateReference( UpdateRefMode eUpdateRefMode,

File sc/source/core/data/dpobject.cxx

     }
 }
 
+ScDPObject* ScDPCollection::GetByName(const String& rName) const
+{
+    for (USHORT i=0; i<nCount; i++)
+        if (static_cast<const ScDPObject*>(pItems[i])->GetName() == rName)
+            return static_cast<ScDPObject*>(pItems[i]);
+    return NULL;
+}
+
 String ScDPCollection::CreateNewName( USHORT nMin ) const
 {
 	String aBase = String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM("DataPilot"));

File sc/source/core/data/dpoutput.cxx

             Reference<beans::XPropertySet> xPropSet(xSource, UNO_QUERY);
             if (xPropSet.is())
             {
-                sal_Int32 nDataFieldCount = 0;
-                Any any = xPropSet->getPropertyValue(rtl::OUString::createFromAscii("DataFieldCount"));
-                if ((any >>= nDataFieldCount) && nDataFieldCount > 0)
+                sal_Int32 nDataFieldCount = ScUnoHelpFunctions::GetLongProperty( xPropSet,
+                                            rtl::OUString::createFromAscii(SC_UNO_DATAFIELDCOUNT) );
+                if (nDataFieldCount > 0)
                     aResData.DataFieldIndex = (nRow - nDataStartRow) % nDataFieldCount;
             }
 
     if (!xPropSet.is())
         return false;
 
-    sal_Int32 nDataFieldCount = 0;
-    Any any = xPropSet->getPropertyValue(rtl::OUString::createFromAscii("DataFieldCount"));
-    if (!(any >>= nDataFieldCount) || nDataFieldCount == 0)
+    sal_Int32 nDataFieldCount = ScUnoHelpFunctions::GetLongProperty( xPropSet,
+                                rtl::OUString::createFromAscii(SC_UNO_DATAFIELDCOUNT) );
+    if (nDataFieldCount == 0)
         // No data field is present in this datapilot table.
         return false;
 

File sc/source/core/data/dptabresmember.cxx

-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright IBM Corporation 2009.
- * Copyright 2009 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dptabresmember.cxx,v $
- * $Revision: 1.0 $
- *
- * 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 "dptabresmember.hxx"
-// -----------------------------------------------------------------------
-ScDPResultMember(  const ScDPResultData* pData, const ScDPParentDimData& rParentDimData ,
-									BOOL bForceSub ) :
-	pResultData( pData ),
-   	aParentDimData( rParentDimData ),
-    	/* pParentDim( pDim ),
-   	 pParentLevel( pLev ),
-   	 pMemberDesc( pDesc ),*/
-    	pChildDimension( NULL ),
-	pDataRoot( NULL ),
-	bHasElements( FALSE ),
-	bForceSubTotal( bForceSub ),
-	bHasHiddenDetails( FALSE ),
-	bInitialized( FALSE ),
-	nMemberStep( 1 ),
-	bAutoHidden( FALSE )
-{
-	// pParentLevel/pMemberDesc is 0 for root members
-}
-
-ScDPNormalResultMember::ScDPNormalResultMember(  const ScDPResultData* pData, 
-									BOOL bForceSub ) :
-	pResultData( pData ),
-    	pChildDimension( NULL ),
-	pDataRoot( NULL ),
-	bHasElements( FALSE ),
-	bForceSubTotal( bForceSub ),
-	bHasHiddenDetails( FALSE ),
-	bInitialized( FALSE ),
-	nMemberStep( 1 ),
-	bAutoHidden( FALSE )
-{
-}
-
-ScDPNormalResultMember::~ScDPNormalResultMember()
-{
-	delete pChildDimension;
-	delete pDataRoot;
-}
-
-String ScDPNormalResultMember::GetName() const
-{
-// Wang Xu Ming -- 2009-6-10
-// DataPilot Migration
-  const ScDPMember*   pMemberDesc = GetDPMember();
- // End Comments
-  if (pMemberDesc)
-		return pMemberDesc->GetNameStr();
-	else
-		return ScGlobal::GetRscString(STR_PIVOT_TOTAL);			// root member
-}
-
-void ScDPNormalResultMember::FillItemData( ScDPItemData& rData ) const
-{
-// Wang Xu Ming -- 2009-6-10
-// DataPilot Migration
-    const ScDPMember*   pMemberDesc = GetDPMember();
-// End Comments
-    if (pMemberDesc)
-        pMemberDesc->FillItemData( rData );
-    else
-        rData.SetString( ScGlobal::GetRscString(STR_PIVOT_TOTAL) );     // root member
-}
-
-BOOL ScDPNormalResultMember::IsNamedItem( /*const ScDPItemData& r */SCROW nIndex ) const
-{
-	//!	store ScDPMember pointer instead of ScDPMember ???
-  const ScDPMember*   pMemberDesc = GetDPMember();
-  if (pMemberDesc)
-		return ((ScDPMember*)pMemberDesc)->IsNamedItem(/* r*/ nIndex  );
-	return FALSE;
-}
-
-// Wang Xu Ming -- 2009-5-27
-// DataPilot Migration
-bool ScDPNormalResultMember::IsValidEntry( const vector< SCROW >& aMembers ) const
-{
-	    return GetEntryStatus( aMembers ) != ENTRY_INVALID;
-}
-// End Comments
-
-ENTRYSTATUS ScDPNormalResultMember::GetEntryStatus( const vector< SCROW >& aMembers ) const
-{
-    if ( !IsValid() )
-		return ENTRY_INVALID;
-
-    const ScDPResultDimension* pChildDim = GetChildDimension();
-    if (pChildDim)
-    {
-        if (aMembers.size() < 2)
-            return ENTRY_INVALID;
-
-        vector</*ScDPItemData*/SCROW>::const_iterator itr = aMembers.begin();
-        vector</*ScDPItemData*/SCROW> aChildMembers(++itr, aMembers.end());
-        return pChildDim->GetEntryStatus(aChildMembers);
-    }
-	else if( bHasHiddenDetails )
-		return ENTRY_HASHIDDENDETAIL;
-    else
-		return ENTRY_VALID;
-}
-
-void ScDPNormalResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev, 
-                                 size_t nPos, ScDPInitState& rInitState ,
-                                 BOOL bInitChild /*= TRUE */)
-    {
-	//	with LateInit, initialize only those members that have data
-	if ( pResultData->IsLateInit() )
-		return;
-
-	bInitialized = TRUE;
-
-    if (nPos >= ppDim.size()  )
-        return;
-
-	//	skip child dimension if details are not shown
-	if ( GetDPMember() && !GetDPMember()->getShowDetails() )
-	{
-         // Wang Xu Ming -- 2009-6-16
-        // Show DataLayout dimention
-        nMemberStep = 1;
-        while ( nPos < ppDim.size() )
-        {
-            if (  ppDim[nPos] ->getIsDataLayoutDimension() )
-            {
-                 if ( !pChildDimension )
-                        pChildDimension = new ScDPResultDimension( pResultData );
-                    pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState , FALSE );
-					return;
-            }
-            else 
-            { //find next dim
-                nPos ++;
-                nMemberStep ++;
-            }
-        }
-        // End Comments
-        bHasHiddenDetails = TRUE;	// only if there is a next dimension
-		return;
-	}
-    
-    if ( bInitChild )
-    {
-        pChildDimension = new ScDPResultDimension( pResultData );
-        pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState, TRUE  );
-    }
-}
-
-// Wang Xu Ming -- 2009-6-10
-// DataPilot Migration
-void ScDPNormalResultMember::LateInitFrom( LateInitParams& rParams/*const vector<ScDPDimension*>& ppDim, const vector<ScDPLevel*>& ppLev*/, 
-                                     const vector< SCROW >& pItemData,   size_t nPos,
-                                     ScDPInitState& rInitState )
-// End Comments
-{
-	//	without LateInit, everything has already been initialized
-	if ( !pResultData->IsLateInit() )
-		return;
-
-	bInitialized = TRUE;
-
-    if ( rParams.IsEnd( nPos )  /*nPos >= ppDim.size()*/)
-        // No next dimension.  Bail out.
-        return;
-
-    //	skip child dimension if details are not shown
-    if ( GetDPMember() && !GetDPMember()->getShowDetails() )
-    {
-        // Wang Xu Ming -- 2009-6-16
-        // DataPilot Migration
-        // Show DataLayout dimention
-        nMemberStep = 1;
-        while ( !rParams.IsEnd( nPos ) )
-        {
-            if (  rParams.GetDim( nPos ) ->getIsDataLayoutDimension() )
-            {
-                 if ( !pChildDimension )
-                        pChildDimension = new ScDPResultDimension( pResultData );
-                    rParams.SetInitChild( FALSE );
-                    pChildDimension->LateInitFrom( rParams, pItemData, nPos, rInitState );
-					return;
-            }
-            else 
-            { //find next dim
-                nPos ++;
-                nMemberStep ++;
-            }
-        }
-        // End Comments
-        bHasHiddenDetails = TRUE;   // only if there is a next dimension
-        return;
-    }
-
-    //	LateInitFrom is called several times...
-    if ( rParams.GetInitChild() )
-    {
-        if ( !pChildDimension )
-            pChildDimension = new ScDPResultDimension( pResultData );
-        pChildDimension->LateInitFrom( rParams, pItemData, nPos, rInitState );
-    }
-}
-
-BOOL ScDPNormalResultMember::IsSubTotalInTitle(long nMeasure) const
-{
-    BOOL bRet = FALSE;
-    if ( pChildDimension && /*pParentLevel*/GetParentLevel() &&
-         /*pParentLevel*/GetParentLevel()->IsOutlineLayout() && /*pParentLevel*/GetParentLevel()->IsSubtotalsAtTop() )
-    {
-        long nUserSubStart;
-        long nSubTotals = GetSubTotalCount( &nUserSubStart );
-        nSubTotals -= nUserSubStart;            // visible count
-        if ( nSubTotals )
-        {
-            if ( nMeasure == SC_DPMEASURE_ALL )
-                nSubTotals *= pResultData->GetMeasureCount();   // number of subtotals that will be inserted
-
-            // only a single subtotal row will be shown in the outline title row
-            if ( nSubTotals == 1 )
-                bRet = TRUE;
-        }
-    }
-    return bRet;
-}
-
-long ScDPNormalResultMember::GetSize(long nMeasure) const
-{
-	if ( !IsVisible() )
-		return 0;
-    const ScDPLevel*	   pParentLevel = GetParentLevel();
-    long nExtraSpace = 0;
-    if ( pParentLevel && pParentLevel->IsAddEmpty() )
-        ++nExtraSpace;
-
-	if ( pChildDimension )
-	{
-        //  outline layout takes up an extra row for the title only if subtotals aren't shown in that row
-        if ( pParentLevel && pParentLevel->IsOutlineLayout() && !IsSubTotalInTitle( nMeasure ) )
-            ++nExtraSpace;
-
-		long nSize = pChildDimension->GetSize(nMeasure);
-		long nUserSubStart;
-		long nUserSubCount = GetSubTotalCount( &nUserSubStart );
-		nUserSubCount -= nUserSubStart;     // for output size, use visible count
-		if ( nUserSubCount )
-		{
-			if ( nMeasure == SC_DPMEASURE_ALL )
-				nSize += pResultData->GetMeasureCount() * nUserSubCount;
-			else
-				nSize += nUserSubCount;
-		}
-		return nSize + nExtraSpace;
-	}
-	else
-	{
-		if ( nMeasure == SC_DPMEASURE_ALL )
-			return pResultData->GetMeasureCount() + nExtraSpace;
-		else
-			return 1 + nExtraSpace;
-	}
-}
-
-
-BOOL ScDPNormalResultMember::IsVisible() const
-{
-	//	not initialized -> shouldn't be there at all
-	//	(allocated only to preserve ordering)
-   const ScDPLevel*	pParentLevel = GetParentLevel();
-	return ( bHasElements || ( pParentLevel && pParentLevel->getShowEmpty() ) ) && IsValid() && bInitialized;
-}
-
-BOOL ScDPNormalResultMember::IsValid() const
-{
-	//	non-Valid members are left out of calculation
-
-	//	was member set no invisible at the DataPilotSource?
-  const ScDPMember*		pMemberDesc =GetDPMember();
-	if ( pMemberDesc && !pMemberDesc->getIsVisible() )
-		return FALSE;
-
-    if ( bAutoHidden )
-        return FALSE;
-
-	return TRUE;
-}
-
-BOOL ScDPNormalResultMember::HasHiddenDetails() const
-{
-    // bHasHiddenDetails is set only if the "show details" flag is off,
-    // and there was a child dimension to skip
-
-    return bHasHiddenDetails;
-}
-
-long ScDPNormalResultMember::GetSubTotalCount( long* pUserSubStart ) const
-{
-    if ( pUserSubStart )
-        *pUserSubStart = 0;     // default
-
-   const ScDPLevel*	pParentLevel = GetParentLevel();
-
-	if ( bForceSubTotal )		// set if needed for root members
-		return 1;				// grand total is always "automatic"
-	else if ( pParentLevel )
-	{
-		//!	direct access via ScDPLevel
-
-        uno::Sequence<sheet::GeneralFunction> aSeq = pParentLevel->getSubTotals();
-        long nSequence = aSeq.getLength();
-        if ( nSequence && aSeq[0] != sheet::GeneralFunction_AUTO )
-        {
-            // For manual subtotals, always add "automatic" as first function
-            // (used for calculation, but not for display, needed for sorting, see lcl_GetForceFunc)
-
-            ++nSequence;
-            if ( pUserSubStart )
-                *pUserSubStart = 1;     // visible subtotals start at 1
-        }
-        return nSequence;
-	}
-	else
-		return 0;
-}
-
-void ScDPNormalResultMember::ProcessData( const vector< SCROW >& aChildMembers, const ScDPResultDimension* pDataDim,
-                                    const vector< SCROW >& aDataMembers, const vector<ScDPValueData>& aValues )
-{
-    SetHasElements();
-
-    if (pChildDimension)
-        pChildDimension->ProcessData( aChildMembers, pDataDim, aDataMembers, aValues );
-
-    if ( !pDataRoot )
-    {
-        pDataRoot = new ScDPDataMember( pResultData, NULL );
-        if ( pDataDim )
-            pDataRoot->InitFrom( pDataDim );            // recursive
-    }
-
-    ScDPSubTotalState aSubState;        // initial state
-
-    long nUserSubCount = GetSubTotalCount();
-
-    // Calculate at least automatic if no subtotals are selected,
-    // show only own values if there's no child dimension (innermost).
-    if ( !nUserSubCount || !pChildDimension )
-        nUserSubCount = 1;
-  
-    const ScDPLevel*	pParentLevel = GetParentLevel();
-
-    for (long nUserPos=0; nUserPos<nUserSubCount; nUserPos++)   // including hidden "automatic"
-    {
-        // #i68338# if nUserSubCount is 1 (automatic only), don't set nRowSubTotalFunc
-        if ( pChildDimension && nUserSubCount > 1 )
-        {
-            aSubState.nRowSubTotalFunc = nUserPos;
-            aSubState.eRowForce = lcl_GetForceFunc( pParentLevel, nUserPos );
-        }
-
-        pDataRoot->ProcessData( aDataMembers, aValues, aSubState );
-    }
-}
-
-void ScDPNormalResultMember::FillMemberResults( uno::Sequence<sheet::MemberResult>* pSequences,
-											long& rPos, long nMeasure, BOOL bRoot,
-											const String* pMemberName,
-											const String* pMemberCaption )
-{
-	//	IsVisible() test is in ScDPResultDimension::FillMemberResults
-	//	(not on data layout dimension)
-
-	long nSize = GetSize(nMeasure);
-	sheet::MemberResult* pArray = pSequences->getArray();
-	DBG_ASSERT( rPos+nSize <= pSequences->getLength(), "bumm" );
-
-    BOOL bIsNumeric = FALSE;
-	String aName;
-	if ( pMemberName )			// if pMemberName != NULL, use instead of real member name
-		aName = *pMemberName;
-	else
-	{
-        ScDPItemData aItemData;
-        FillItemData( aItemData );
-        aName = aItemData.GetString();
-        bIsNumeric = aItemData.IsValue();
-	}
-    const ScDPDimension*		pParentDim = GetParentDim();
-    if ( bIsNumeric && pParentDim && pResultData->IsNumOrDateGroup( pParentDim->GetDimension() ) )
-    {
-        // Numeric group dimensions use numeric entries for proper sorting,
-        // but the group titles must be output as text.
-        bIsNumeric = FALSE;
-    }
-
-	String aCaption = aName;
-	if ( pMemberCaption )					// use pMemberCaption if != NULL
-		aCaption = *pMemberCaption;
-	if (!aCaption.Len())
-		aCaption = ScGlobal::GetRscString(STR_EMPTYDATA);
-
-    if ( !bIsNumeric )
-    {
-        // add a "'" character so a string isn't parsed as value in the output cell
-        //! have a separate bit in Flags (MemberResultFlags) instead?
-        aCaption.Insert( (sal_Unicode) '\'', 0 );
-    }
-
-	if ( nSize && !bRoot )					// root is overwritten by first dimension
-	{
-		pArray[rPos].Name    = rtl::OUString(aName);
-		pArray[rPos].Caption = rtl::OUString(aCaption);
-		pArray[rPos].Flags	|= sheet::MemberResultFlags::HASMEMBER;
-
-		//	set "continue" flag (removed for subtotals later)
-		for (long i=1; i<nSize; i++)
-			pArray[rPos+i].Flags |= sheet::MemberResultFlags::CONTINUE;
-	}
- 
-    const ScDPLevel*	pParentLevel = GetParentLevel();
-    long nExtraSpace = 0;
-    if ( pParentLevel && pParentLevel->IsAddEmpty() )
-        ++nExtraSpace;
-
-    BOOL bTitleLine = FALSE;
-    if ( pParentLevel && pParentLevel->IsOutlineLayout() )
-        bTitleLine = TRUE;
-
-    // if the subtotals are shown at the top (title row) in outline layout,
-	// no extra row for the subtotals is needed
-    BOOL bSubTotalInTitle = IsSubTotalInTitle( nMeasure );
-
-	BOOL bHasChild = ( pChildDimension != NULL );
-	if (bHasChild)
-	{
-        if ( bTitleLine )           // in tabular layout the title is on a separate row
-            ++rPos;                 // -> fill child dimension one row below
-
-		if (bRoot)		// same sequence for root member
-			pChildDimension->FillMemberResults( pSequences, rPos, nMeasure );
-		else
-            // Wang Xu Ming -- 2009-6-16
-            // DataPilot Migration
-            // for show details 
-            pChildDimension->FillMemberResults( pSequences + nMemberStep/*1*/, rPos, nMeasure ); 
-             // End Comments
-
-        if ( bTitleLine )           // title row is included in GetSize, so the following
-            --rPos;                 // positions are calculated with the normal values
-	}
-
-	rPos += nSize;
-
-    long nUserSubStart;
-	long nUserSubCount = GetSubTotalCount(&nUserSubStart);
-	if ( nUserSubCount && pChildDimension && !bSubTotalInTitle )
-	{
-		long nMemberMeasure = nMeasure;
-		long nSubSize = pResultData->GetCountForMeasure(nMeasure);
-
-		rPos -= nSubSize * (nUserSubCount - nUserSubStart);     // GetSize includes space for SubTotal
-        rPos -= nExtraSpace;                                    // GetSize includes the empty line
-
-		for (long nUserPos=nUserSubStart; nUserPos<nUserSubCount; nUserPos++)
-		{
-			for ( long nSubCount=0; nSubCount<nSubSize; nSubCount++ )
-			{
-				if ( nMeasure == SC_DPMEASURE_ALL )
-					nMemberMeasure = nSubCount;
-
-				ScSubTotalFunc eForce = SUBTOTAL_FUNC_NONE;
-				if (bHasChild)
-					eForce = lcl_GetForceFunc( pParentLevel, nUserPos );
-
-				String aSubStr = aName;		//! caption?
-				aSubStr += ' ';
-				aSubStr += pResultData->GetMeasureString(nMemberMeasure, FALSE, eForce);
-
-				pArray[rPos].Name    = rtl::OUString(aName);
-				pArray[rPos].Caption = rtl::OUString(aSubStr);
-				pArray[rPos].Flags = ( pArray[rPos].Flags |
-									( sheet::MemberResultFlags::HASMEMBER | sheet::MemberResultFlags::SUBTOTAL) ) &
-									~sheet::MemberResultFlags::CONTINUE;
-
-				if ( nMeasure == SC_DPMEASURE_ALL )
-				{
-					//	data layout dimension is (direct/indirect) child of this.
-					//	data layout dimension must have name for all entries.
-
-					uno::Sequence<sheet::MemberResult>* pLayoutSeq = pSequences;
-					if (!bRoot)
-						++pLayoutSeq;
-					ScDPResultDimension* pLayoutDim = pChildDimension;
-					while ( pLayoutDim && !pLayoutDim->IsDataLayout() )
-					{
-						pLayoutDim = pLayoutDim->GetFirstChildDimension();
-						++pLayoutSeq;
-					}
-					if ( pLayoutDim )
-					{
-						sheet::MemberResult* pLayoutArray = pLayoutSeq->getArray();
-						String aDataName = pResultData->GetMeasureDimensionName(nMemberMeasure);
-						pLayoutArray[rPos].Name = rtl::OUString(aDataName);
-					}
-				}
-
-				rPos += 1;
-			}
-		}
-
-        rPos += nExtraSpace;                                    // add again (subtracted above)
-	}
-}
-
-void ScDPNormalResultMember::FillDataResults( const ScDPResultMember* pRefMember,
-							uno::Sequence< uno::Sequence<sheet::DataResult> >& rSequence,
-							long& rRow, long nMeasure ) const
-{
-	//	IsVisible() test is in ScDPResultDimension::FillDataResults
-	//	(not on data layout dimension)
-    const ScDPLevel*	 pParentLevel = GetParentLevel();
-    long nStartRow = rRow;
-
-    long nExtraSpace = 0;
-    if ( pParentLevel && pParentLevel->IsAddEmpty() )
-        ++nExtraSpace;
-
-    BOOL bTitleLine = FALSE;
-    if ( pParentLevel && pParentLevel->IsOutlineLayout() )
-        bTitleLine = TRUE;
-
-    BOOL bSubTotalInTitle = IsSubTotalInTitle( nMeasure );
-
-	BOOL bHasChild = ( pChildDimension != NULL );
-	if (bHasChild)
-	{
-        if ( bTitleLine )           // in tabular layout the title is on a separate row
-            ++rRow;                 // -> fill child dimension one row below
-
-		pChildDimension->FillDataResults( pRefMember, rSequence, rRow, nMeasure );  // doesn't modify rRow
-		rRow += (USHORT) GetSize( nMeasure );
-
-        if ( bTitleLine )           // title row is included in GetSize, so the following
-            --rRow;                 // positions are calculated with the normal values
-	}
-
-    long nUserSubStart;
-	long nUserSubCount = GetSubTotalCount(&nUserSubStart);
-	if ( nUserSubCount || !bHasChild )
-	{
-        // Calculate at least automatic if no subtotals are selected,
-        // show only own values if there's no child dimension (innermost).
-		if ( !nUserSubCount || !bHasChild )
-		{
-			nUserSubCount = 1;
-			nUserSubStart = 0;
-		}
-
-		long nMemberMeasure = nMeasure;
-		long nSubSize = pResultData->GetCountForMeasure(nMeasure);
-		if (bHasChild)
-        {
-			rRow -= nSubSize * ( nUserSubCount - nUserSubStart );   // GetSize includes space for SubTotal
-            rRow -= nExtraSpace;                                    // GetSize includes the empty line
-        }
-
-        long nMoveSubTotal = 0;
-        if ( bSubTotalInTitle )
-        {
-            nMoveSubTotal = rRow - nStartRow;   // force to first (title) row
-            rRow = nStartRow;
-        }
-
-		if ( pDataRoot )
-		{
-			ScDPSubTotalState aSubState;		// initial state
-
-			for (long nUserPos=nUserSubStart; nUserPos<nUserSubCount; nUserPos++)
-			{
-				if ( bHasChild && nUserSubCount > 1 )
-				{
-					aSubState.nRowSubTotalFunc = nUserPos;
-					aSubState.eRowForce = lcl_GetForceFunc( /*pParentLevel*/GetParentLevel() , nUserPos );
-				}
-
-				for ( long nSubCount=0; nSubCount<nSubSize; nSubCount++ )
-				{
-					if ( nMeasure == SC_DPMEASURE_ALL )
-						nMemberMeasure = nSubCount;
-					else if ( pResultData->GetColStartMeasure() == SC_DPMEASURE_ALL )
-						nMemberMeasure = SC_DPMEASURE_ALL;
-
-					DBG_ASSERT( rRow < rSequence.getLength(), "bumm" );
-					uno::Sequence<sheet::DataResult>& rSubSeq = rSequence.getArray()[rRow];
-					long nSeqCol = 0;
-					pDataRoot->FillDataRow( pRefMember, rSubSeq, nSeqCol, nMemberMeasure, bHasChild, aSubState );
-
-					rRow += 1;
-				}
-			}
-		}
-		else
-			rRow += nSubSize * ( nUserSubCount - nUserSubStart );   // empty rows occur when ShowEmpty is true
-
-        // add extra space again if subtracted from GetSize above,
-        // add to own size if no children
-        rRow += nExtraSpace;
-
-        rRow += nMoveSubTotal;
-	}
-}
-
-void ScDPNormalResultMember::UpdateDataResults( const ScDPResultMember* pRefMember, long nMeasure ) const
-{
-    //  IsVisible() test is in ScDPResultDimension::FillDataResults
-    //  (not on data layout dimension)
-
-    BOOL bHasChild = ( pChildDimension != NULL );
-
-    long nUserSubCount = GetSubTotalCount();
-    // process subtotals even if not shown
-//  if ( nUserSubCount || !bHasChild )
-    {
-        // Calculate at least automatic if no subtotals are selected,
-        // show only own values if there's no child dimension (innermost).
-        if ( !nUserSubCount || !bHasChild )
-            nUserSubCount = 1;
-
-        long nMemberMeasure = nMeasure;
-        long nSubSize = pResultData->GetCountForMeasure(nMeasure);
-
-        if ( pDataRoot )
-        {
-            ScDPSubTotalState aSubState;        // initial state
-
-            for (long nUserPos=0; nUserPos<nUserSubCount; nUserPos++)   // including hidden "automatic"
-            {
-                if ( bHasChild && nUserSubCount > 1 )
-                {
-                    aSubState.nRowSubTotalFunc = nUserPos;
-                    aSubState.eRowForce = lcl_GetForceFunc( /*pParentLevel*/GetParentLevel() , nUserPos );
-                }
-
-                for ( long nSubCount=0; nSubCount<nSubSize; nSubCount++ )
-                {
-                    if ( nMeasure == SC_DPMEASURE_ALL )
-                        nMemberMeasure = nSubCount;
-                    else if ( pResultData->GetColStartMeasure() == SC_DPMEASURE_ALL )
-                        nMemberMeasure = SC_DPMEASURE_ALL;
-
-                    pDataRoot->UpdateDataRow( pRefMember, nMemberMeasure, bHasChild, aSubState );
-                }
-            }
-        }
-    }
-
-    if (bHasChild)  // child dimension must be processed last, so the column total is known
-    {
-        pChildDimension->UpdateDataResults( pRefMember, nMeasure );
-    }
-}
-
-void ScDPNormalResultMember::SortMembers( ScDPResultMember* pRefMember )
-{
-    BOOL bHasChild = ( pChildDimension != NULL );
-    if (bHasChild)
-        pChildDimension->SortMembers( pRefMember );     // sorting is done at the dimension
-
-    if ( IsRoot() && pDataRoot )
-    {
-        // use the row root member to sort columns
-        // sub total count is always 1
-
-        pDataRoot->SortMembers( pRefMember );
-    }
-}
-
-void ScDPNormalResultMember::DoAutoShow( ScDPResultMember* pRefMember )
-{
-    BOOL bHasChild = ( pChildDimension != NULL );
-    if (bHasChild)
-        pChildDimension->DoAutoShow( pRefMember );     // sorting is done at the dimension
-
-    if ( IsRoot()&& pDataRoot )
-    {
-        // use the row root member to sort columns
-        // sub total count is always 1
-
-        pDataRoot->DoAutoShow( pRefMember );
-    }
-}
-
-void ScDPNormalResultMember::ResetResults( BOOL bRoot )
-{
-    if (pDataRoot)
-        pDataRoot->ResetResults();
-
-    if (pChildDimension)
-        pChildDimension->ResetResults();
-
-// Wang Xu Ming -- 3/4/2009
-// Dim refresh and filter. SODC_19023
- //   if (!bRoot)
- //       bHasElements = FALSE;
-// End Comments
-}
-
-void ScDPNormalResultMember::UpdateRunningTotals( const ScDPResultMember* pRefMember, long nMeasure,
-                                            ScDPRunningTotalState& rRunning, ScDPRowTotals& rTotals ) const
-{
-    //  IsVisible() test is in ScDPResultDimension::FillDataResults
-    //  (not on data layout dimension)
-
-    rTotals.SetInColRoot( IsRoot() );
-
-    BOOL bHasChild = ( pChildDimension != NULL );
-
-    long nUserSubCount = GetSubTotalCount();
-    if ( nUserSubCount || !bHasChild )
-    {
-        // Calculate at least automatic if no subtotals are selected,
-        // show only own values if there's no child dimension (innermost).
-        if ( !nUserSubCount || !bHasChild )
-            nUserSubCount = 1;
-
-        long nMemberMeasure = nMeasure;
-        long nSubSize = pResultData->GetCountForMeasure(nMeasure);
-
-        if ( pDataRoot )
-        {
-            ScDPSubTotalState aSubState;        // initial state
-
-            for (long nUserPos=0; nUserPos<nUserSubCount; nUserPos++)   // including hidden "automatic"
-            {
-                if ( bHasChild && nUserSubCount > 1 )
-                {
-                    aSubState.nRowSubTotalFunc = nUserPos;
-                    aSubState.eRowForce = lcl_GetForceFunc( /*pParentLevel*/GetParentLevel(), nUserPos );
-                }
-
-                for ( long nSubCount=0; nSubCount<nSubSize; nSubCount++ )
-                {
-                    if ( nMeasure == SC_DPMEASURE_ALL )
-                        nMemberMeasure = nSubCount;
-                    else if ( pResultData->GetColStartMeasure() == SC_DPMEASURE_ALL )
-                        nMemberMeasure = SC_DPMEASURE_ALL;
-
-                    pDataRoot->UpdateRunningTotals( pRefMember, nMemberMeasure,
-                                        bHasChild, aSubState, rRunning, rTotals, *this );
-                }
-            }
-        }
-    }
-
-    if (bHasChild)  // child dimension must be processed last, so the column total is known
-    {
-        pChildDimension->UpdateRunningTotals( pRefMember, nMeasure, rRunning, rTotals );
-    }
-}
-
-void ScDPNormalResultMember::DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const
-{
-    lcl_DumpRow( String::CreateFromAscii("ScDPResultMember"), GetName(), NULL, pDoc, rPos );
-    SCROW nStartRow = rPos.Row();
-
-    if (pDataRoot)
-        pDataRoot->DumpState( pRefMember, pDoc, rPos );
-
-    if (pChildDimension)
-        pChildDimension->DumpState( pRefMember, pDoc, rPos );
-
-    lcl_Indent( pDoc, nStartRow, rPos );
-}
-
-ScDPAggData* ScDPNormalResultMember::GetColTotal( long nMeasure ) const
-{
-    return lcl_GetChildTotal( const_cast<ScDPAggData*>(&aColTotal), nMeasure );
-}
-
-void ScDPNormalResultMember::FillVisibilityData(ScDPResultVisibilityData& rData) const
-{
-    if (pChildDimension)
-        pChildDimension->FillVisibilityData(rData);
-}
-// Wang Xu Ming -- 2009-6-10
-// DataPilot Migration
-SCROW ScDPNormalResultMember::GetDataId( ) const 
-{
-// TODO:
- const ScDPMember*   pMemberDesc = GetDPMember();
-  if (pMemberDesc)
-        return  pMemberDesc->GetItemDataId();
-    return -1;
-}
-
-// -----------------------------------------------------------------------
-ScDPHideDetailsMember:: ScDPHideDetailsMember(  const ScDPResultData* pData,  const ScDPParentDimData& rParentDimData,
-                                              BOOL bForceSub ):ScDPResultMember(pData,rParentDimData, bForceSub)
-{
-    pOrigMember = new ScDPNormalResultMember(pData,rParentDimData, bForceSub);
-
-}

File sc/source/core/data/dptabresmember.hxx

-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * Copyright IBM Corporation 2009.
- * Copyright 2009 by Sun Microsystems, Inc.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * $RCSfile: dptabresmember.hxx,v $
- * $Revision: 1.0 $
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
- 
-#ifndef DPTABRESMEMBER_HXX
-#define DPTABRESMEMBER_HXX
-
-class ScDPNormalResultMember: public ScDPResultMember
-{
-private:
-	// Wang Xu Ming -- 2009-6-9
-	// DataPilot Migration
-	ScDPParentDimData		aParentDimData;
-	// End Comments
-	BOOL					bHasElements:1;
-	BOOL					bForceSubTotal:1;
-	BOOL					bHasHiddenDetails:1;
-	BOOL					bInitialized:1;
-	BOOL                    bAutoHidden:1;
-	ScDPAggData				aColTotal;				// to store column totals
-
-// Wang Xu Ming -- 2009-6-9
-// DataPilot Migration
-	USHORT					nMemberStep;			// step to show details
-// End Comments
-public:
-							// Wang Xu Ming -- 2009-6-9
-							// DataPilot Migration
-							ScDPNormalResultMember(  const ScDPResultData* pData,  const ScDPParentDimData& rParentDimData,
-								BOOL bForceSub );	//! Ref
-                            ScDPNormalResultMember(  const ScDPResultData* pData, BOOL bForceSub );
-							// End Comments
-							~ScDPNormalResultMember();
-
-							// Wang Xu Ming -- 2009-6-9
-							// DataPilot Migration
-							// Add parameter: BOOL bInitChild
-							void                InitFrom( const ::std::vector<ScDPDimension*>& ppDim, 
-								const ::std::vector<ScDPLevel*>& ppLev,
-								size_t nPos, 
-								ScDPInitState& rInitState, 
-								BOOL bInitChild = TRUE );
-							// End Comments
-							// Wang Xu Ming -- 2009-6-9
-							// DataPilot Migration 
-							void     LateInitFrom( 
-                                LateInitParams& rParams, 
-								const ::std::vector< SCROW >& pItemData,
-								size_t nPos,
-								ScDPInitState& rInitState);
-							// End Comments
-
-	String		        GetName() const;
-    void                  FillItemData( ScDPItemData& rData ) const;
-    BOOL				IsValid() const;
-	BOOL				IsVisible() const;
-	long				    GetSize(long nMeasure) const;
-	BOOL				HasHiddenDetails() const;
-	BOOL              IsSubTotalInTitle(long nMeasure) const;
-
-//	BOOL				SubTotalEnabled() const;
-	long				GetSubTotalCount( long* pUserSubStart = NULL ) const;
-
-// Wang Xu Ming -- 2009-6-9
-// DataPilot Migration
-// Use item index 
-//	BOOL				IsNamedItem( const ScDPItemData& r ) const;
-	BOOL				IsNamedItem( SCROW nIndex ) const;
-// End Comments
-    bool IsValidEntry( const ::std::vector< SCROW >& aMembers ) const;
-	ENTRYSTATUS GetEntryStatus( const ::std::vector<SCROW>& aMembers ) const;
-
-	void				SetHasElements()	{ bHasElements = TRUE; }
-	void                SetAutoHidden()     { bAutoHidden = TRUE; }
-
-    void                ProcessData( const ::std::vector<SCROW>& aChildMembers,
-                                     const ScDPResultDimension* pDataDim,
-                                     const ::std::vector<SCROW>& aDataMembers,
-                                     const ::std::vector<ScDPValueData>& aValues );
-
-	void				FillMemberResults( com::sun::star::uno::Sequence<
-												com::sun::star::sheet::MemberResult>* pSequences,
-											long& rPos, long nMeasure, BOOL bRoot,
-											const String* pMemberName,
-											const String* pMemberCaption );
-
-	void				FillDataResults( const ScDPResultMember* pRefMember,
-									com::sun::star::uno::Sequence<
-										com::sun::star::uno::Sequence<
-											com::sun::star::sheet::DataResult> >& rSequence,
-									long& rRow, long nMeasure ) const;
-
-	void				UpdateDataResults( const ScDPResultMember* pRefMember, long nMeasure ) const;
-	void				UpdateRunningTotals( const ScDPResultMember* pRefMember, long nMeasure,
-												ScDPRunningTotalState& rRunning, ScDPRowTotals& rTotals ) const;
-
-    void                SortMembers( ScDPResultMember* pRefMember );
-    void                DoAutoShow( ScDPResultMember* pRefMember );
-
-    void                ResetResults( BOOL bRoot );
-
-	void				DumpState( const ScDPResultMember* pRefMember, ScDocument* pDoc, ScAddress& rPos ) const;
-
-	// Wang Xu Ming -- 2009-6-9
-	// DataPilot Migration
-	const ScDPDimension*		GetParentDim() const			{ return aParentDimData.mpParentDim; }		//! Ref
-	const ScDPLevel*				GetParentLevel() const			{ return aParentDimData.mpParentLevel; }	//! Ref
-	const ScDPMember*			GetDPMember()const				{ return aParentDimData.mpMemberDesc; }		//! Ref
-	inline SCROW					GetOrder() const				{ return aParentDimData.mnOrder; }			//! Ref
-    inline BOOL                     IsRoot() const                   { return GetParentLevel() == NULL; }
-	// End Comments
-
-	ScDPAggData*		GetColTotal( long nMeasure ) const;
-
-    void                FillVisibilityData(ScDPResultVisibilityData& rData) const;
-// Wang Xu Ming -- 2009-6-10
-// DataPilot Migration
-    SCROW GetDataId( ) const ;
-// End Comments
-};
-
-class ScDPHideDetailsMember: public ScDPResultMember
-{
-private:
-    ScDPNormalResultMember *  pOrigMember;
-public:
-    ScDPHideDetailsMember(  const ScDPResultData* pData,  const ScDPParentDimData& rParentDimData,
-								BOOL bForceSub );
-
-
-};
-
-
-#endif //DPTABRESMEMBER_HXX

File sc/source/core/tool/addincol.cxx

 #include <com/sun/star/table/XCellRange.hpp>
 #include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/sheet/XCompatibilityNames.hpp>
+#include <com/sun/star/sheet/NoConvergenceException.hpp>
 
 #include "addincol.hxx"
 #include "addinhelpid.hxx"
 			if ( rWrapped.TargetException.getValueType().equals(
 					getCppuType( (lang::IllegalArgumentException*)0 ) ) )
 				nErrCode = errIllegalArgument;
+            else if ( rWrapped.TargetException.getValueType().equals(
+                    getCppuType( (sheet::NoConvergenceException*)0 ) ) )
+                nErrCode = errNoConvergence;
 			else
 	            nErrCode = errNoValue;
 		}
+        
         catch(uno::Exception&)
         {
             nErrCode = errNoValue;

File sc/source/core/tool/compiler.cxx

     ssStop
 };
 
+// ODFF names that are not written in the current mapping but to be recognized. 
+// New names will be written in a future relase, then exchange (!) with the 
+// names in formula/source/core/resource/core_resource.src to be able to still 
+// read the old names as well.
+struct FunctionName
+{
+    const sal_Char* pName;
+    OpCode          eOp;
+};
+static const FunctionName aOdffAliases[] = {
+    // Renamed old names:
+    // XXX none yet.
+    // Renamed new names:
+    { "BINOM.DIST.RANGE",   ocB },      // B -> BINOM.DIST.RANGE
+    { "LEGACY.TDIST",       ocTDist }   // TDIST -> LEGACY.TDIST
+};
+static const size_t nOdffAliases = sizeof(aOdffAliases) / sizeof(aOdffAliases[0]);
+
 static const sal_Char* pInternal[ 1 ] = { "TTT" };
 
 using namespace ::com::sun::star::i18n;
         aToken.SetOpCode(eOp);
         pRawToken = aToken.Clone();
     }
-    else
+    else if (mxSymbols->isODFF())
+    {
+        for (size_t i=0; i<nOdffAliases; ++i)
+        {
+            if (rName.EqualsIgnoreCaseAscii( aOdffAliases[i].pName))
+            {
+                ScRawToken aToken;
+                aToken.SetOpCode( aOdffAliases[i].eOp);
+                pRawToken = aToken.Clone();
+                bFound = TRUE;
+                break;  // for
+            }
+        }
+    }
+    if (!bFound)
     {
         String aIntName;
         if (mxSymbols->hasExternals())
 
 BOOL ScCompiler::IsMacro( const String& rName )
 {
+    String aName( rName);
     StarBASIC* pObj = 0;
     SfxObjectShell* pDocSh = pDoc->GetDocumentShell();
 
     else
         pObj = pSfxApp->GetBasic();
 
-    SbxMethod* pMeth = (SbxMethod*) pObj->Find( rName, SbxCLASS_METHOD );
+    // ODFF recommends to store user-defined functions prefixed with "USER.", 
+    // use only unprefixed name if encountered. BASIC doesn't allow '.' in a 
+    // function name so a function "USER.FOO" could not exist, and macro check 
+    // is assigned the lowest priority in function name check.
+    if (FormulaGrammar::isODFF( GetGrammar()) && aName.EqualsIgnoreCaseAscii( "USER.", 0, 5))
+        aName.Erase( 0, 5);
+
+    SbxMethod* pMeth = (SbxMethod*) pObj->Find( aName, SbxCLASS_METHOD );
     if( !pMeth )
     {
         pSfxApp->LeaveBasicCall();
         return FALSE;
     }
     ScRawToken aToken;
-    aToken.SetExternal( rName.GetBuffer() );
+    aToken.SetExternal( aName.GetBuffer() );
     aToken.eOp = ocMacro;
     pRawToken = aToken.Clone();
     pSfxApp->LeaveBasicCall();

File sc/source/filter/xml/xmldpimp.cxx

 		if (pDoc)
 		{
 			ScDPCollection* pDPCollection = pDoc->GetDPCollection();
+
+            // #i94570# Names have to be unique, or the tables can't be accessed by API.
+            if ( pDPCollection->GetByName(pDPObject->GetName()) )
+                pDPObject->SetName( String() );     // ignore the invalid name, create a new name in AfterXMLLoading
+
 			pDPObject->SetAlive(sal_True);
             pDPCollection->InsertNewTable(pDPObject);
 		}

File sc/source/filter/xml/xmlexprt.cxx

 				if ( sCLSID.equalsIgnoreAsciiCase(GetChartExport()->getChartCLSID()) )
 				{
                     // we have a chart
-                    uno::Reference< frame::XModel > xChartModel;
-                    if( ( xShapeProps->getPropertyValue( sPropModel ) >>= xChartModel ) &&
-                        xChartModel.is())
+                    ::rtl::OUString sRanges;
+                    if ( pDoc )
                     {
-                        uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
-                        uno::Reference< chart2::data::XDataReceiver > xReceiver( xChartModel, uno::UNO_QUERY );
-                        if( xChartDoc.is() && xReceiver.is() &&
-                            ! xChartDoc->hasInternalDataProvider())
+                        ::rtl::OUString aChartName;
+                        xShapeProps->getPropertyValue( sPersistName ) >>= aChartName;
+                        ScRange aEmptyRange;
+                        ScChartListener aSearcher( aChartName, pDoc, aEmptyRange );
+                        USHORT nIndex = 0;
+                        ScChartListenerCollection* pCollection = pDoc->GetChartListenerCollection();
+                        if ( pCollection && pCollection->Search( &aSearcher, nIndex ) )
                         {
-                            // we have a chart that gets its data from Calc
-                            bIsChart = true;
-                            uno::Sequence< ::rtl::OUString > aRepresentations(
-                                xReceiver->getUsedRangeRepresentations());
-                            SvXMLAttributeList* pAttrList = 0;
-                            if(aRepresentations.getLength())
+                            ScChartListener* pListener = static_cast< ScChartListener* >( pCollection->At( nIndex ) );
+                            if ( pListener )
                             {
-                                // add the ranges used by the chart to the shape
-                                // element to be able to start listening after
-                                // load (when the chart is not yet loaded)
-                                uno::Reference< chart2::data::XRangeXMLConversion > xRangeConverter( xChartDoc->getDataProvider(), uno::UNO_QUERY );
-                                ::rtl::OUString sRanges( lcl_RangeSequenceToString( aRepresentations, xRangeConverter ));
-                                pAttrList = new SvXMLAttributeList();
-                                pAttrList->AddAttribute(
-                                    GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken(XML_NOTIFY_ON_UPDATE_OF_RANGES) ), sRanges );
+                                const ScRangeListRef& rRangeList = pListener->GetRangeList();
+                                if ( rRangeList.Is() )
+                                {
+                                    ScRangeStringConverter::GetStringFromRangeList( sRanges, rRangeList, pDoc, FormulaGrammar::CONV_OOO );
+                                    if ( sRanges.getLength() > 0 )
+                                    {
+                                        bIsChart = true;
+                                        SvXMLAttributeList* pAttrList = new SvXMLAttributeList();
+                                        if ( pAttrList )
+                                        {
+                                            pAttrList->AddAttribute(
+                                                GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken( XML_NOTIFY_ON_UPDATE_OF_RANGES ) ), sRanges );
+                                        }
+                                        GetShapeExport()->exportShape( xShape, SEF_EXPORT_NO_CHART_DATA | SEF_DEFAULT, pPoint, pAttrList );
+                                    }
+                                }
                             }
-                            GetShapeExport()->exportShape(xShape, SEF_EXPORT_NO_CHART_DATA | SEF_DEFAULT, pPoint, pAttrList);
+                        }
+                    }
+
+                    if ( sRanges.getLength() == 0 )
+                    {
+                        uno::Reference< frame::XModel > xChartModel;
+                        if( ( xShapeProps->getPropertyValue( sPropModel ) >>= xChartModel ) &&
+                            xChartModel.is())
+                        {
+                            uno::Reference< chart2::XChartDocument > xChartDoc( xChartModel, uno::UNO_QUERY );
+                            uno::Reference< chart2::data::XDataReceiver > xReceiver( xChartModel, uno::UNO_QUERY );
+                            if( xChartDoc.is() && xReceiver.is() &&
+                                ! xChartDoc->hasInternalDataProvider())
+                            {
+                                // we have a chart that gets its data from Calc
+                                bIsChart = true;
+                                uno::Sequence< ::rtl::OUString > aRepresentations(
+                                    xReceiver->getUsedRangeRepresentations());
+                                SvXMLAttributeList* pAttrList = 0;
+                                if(aRepresentations.getLength())
+                                {
+                                    // add the ranges used by the chart to the shape
+                                    // element to be able to start listening after
+                                    // load (when the chart is not yet loaded)
+                                    uno::Reference< chart2::data::XRangeXMLConversion > xRangeConverter( xChartDoc->getDataProvider(), uno::UNO_QUERY );
+                                    sRanges = lcl_RangeSequenceToString( aRepresentations, xRangeConverter );
+                                    pAttrList = new SvXMLAttributeList();
+                                    pAttrList->AddAttribute(
+                                        GetNamespaceMap().GetQNameByKey( XML_NAMESPACE_DRAW, GetXMLToken(XML_NOTIFY_ON_UPDATE_OF_RANGES) ), sRanges );
+                                }
+                                GetShapeExport()->exportShape(xShape, SEF_EXPORT_NO_CHART_DATA | SEF_DEFAULT, pPoint, pAttrList);
+                            }
                         }
                     }
 

File sc/source/ui/dbgui/asciiopt.cxx

 		eCharSet = ScGlobal::GetCharsetValue( aToken );
 	}
 
-    // Language
-    if (nCount >= 4)
-    {    
-        aToken = rString.GetToken(3, ',');
-        eLang = static_cast<LanguageType>(aToken.ToInt32());
-    }
-
 		//
 		//	Startzeile
 		//
 
-    if ( nCount >= 5 )
+    if ( nCount >= 4 )
 	{
-        aToken = rString.GetToken(4,',');
+        aToken = rString.GetToken(3,',');
 		nStartRow = aToken.ToInt32();
 	}
 
 		//	Spalten-Infos
 		//
 
-    if ( nCount >= 6 )
+    if ( nCount >= 5 )
 	{
 		delete[] pColStart;
 		delete[] pColFormat;
 
-        aToken = rString.GetToken(5,',');
+        aToken = rString.GetToken(4,',');
 		nSub = aToken.GetTokenCount('/');
 		nInfoCount = nSub / 2;
 		if (nInfoCount)
 		}
 	}
 
+    // Language
+    if (nCount >= 6)
+    {    
+        aToken = rString.GetToken(5, ',');
+        eLang = static_cast<LanguageType>(aToken.ToInt32());
+    }
+
     // Import quoted field as text.
     if (nCount >= 7)
     {
 		aOutStr += ScGlobal::GetCharsetString( eCharSet );
 	aOutStr += ',';					// Token-Ende
 
-    // Language
-    aOutStr += String::CreateFromInt32(eLang);
-    aOutStr += ',';
-
 		//
 		//	Startzeile
 		//
 		aOutStr += String::CreateFromInt32(pColFormat[nInfo]);
 	}
 
+    // #i112025# the options string is used in macros and linked sheets,
+    // so new options must be added at the end, to remain compatible
+
+    aOutStr += ',';
+
+    // Language
+    aOutStr += String::CreateFromInt32(eLang);
     aOutStr += ',';
 
     // Import quoted field as text.

File sc/source/ui/docshell/dbdocfun.cxx

 				//	output range must be set at pNewObj
 
 				pDestObj = new ScDPObject( *pNewObj );
+
+                // #i94570# When changing the output position in the dialog, a new table is created
+                // with the settings from the old table, including the name.
+                // So we have to check for duplicate names here (before inserting).
+                if ( pDoc->GetDPCollection()->GetByName(pDestObj->GetName()) )
+                    pDestObj->SetName( String() );      // ignore the invalid name, create a new name below
+
 				pDestObj->SetAlive(TRUE);
                 if ( !pDoc->GetDPCollection()->InsertNewTable(pDestObj) )
 				{

File sc/source/ui/docshell/docsh.cxx

 #include "chgviset.hxx"
 #include <sfx2/request.hxx>
 #include <com/sun/star/document/UpdateDocMode.hpp>
+#include <com/sun/star/container/XContentEnumerationAccess.hpp>
+#include <com/sun/star/sheet/XSpreadsheetView.hpp>
+#include <com/sun/star/task/XJob.hpp>
 
 
 #include "scabstdlg.hxx" //CHINA001
 					// else;  nothing has to happen, because it is a user given name
 				}
 			}
+
+            // #i94570# DataPilot table names have to be unique, or the tables can't be accessed by API.
+            // If no name (or an invalid name, skipped in ScXMLDataPilotTableContext::EndElement) was set, create a new name.
+            ScDPCollection* pDPCollection = aDocument.GetDPCollection();
+            if ( pDPCollection )
+            {
+                USHORT nDPCount = pDPCollection->GetCount();
+                for (USHORT nDP=0; nDP<nDPCount; nDP++)
+                {
+                    ScDPObject* pDPObj = (*pDPCollection)[nDP];
+                    if ( !pDPObj->GetName().Len() )
+                        pDPObj->SetName( pDPCollection->CreateNewName() );
+                }
+            }
 		}
 		ScColumn::bDoubleAlloc = sal_False;
     }
 
 	//	only the latin script language is loaded
 	//	-> initialize the others from options (before loading)
-	InitOptions();
+    InitOptions(true);
 
 	GetUndoManager()->Clear();
 
                             }
                         }
                     }
+
+                    try
+                    {
+                        uno::Reference< uno::XComponentContext > xContext;
+                        uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory();
+                        uno::Reference< beans::XPropertySet > xProp( xServiceManager, uno::UNO_QUERY_THROW );
+                        xProp->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) ) >>= xContext;
+                        if ( xContext.is() )
+                        {
+                            uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xServiceManager, uno::UNO_QUERY_THROW );
+                            uno::Reference< container::XEnumeration> xEnum = xEnumAccess->createContentEnumeration(
+                                ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.sheet.SpreadsheetDocumentJob" ) ) );
+                            if ( xEnum.is() )
+                            {
+                                while ( xEnum->hasMoreElements() )
+                                {
+                                    uno::Any aAny = xEnum->nextElement();
+                                    uno::Reference< lang::XSingleComponentFactory > xFactory;
+                                    aAny >>= xFactory;
+                                    if ( xFactory.is() )
+                                    {
+                                        uno::Reference< task::XJob > xJob( xFactory->createInstanceWithContext( xContext ), uno::UNO_QUERY_THROW );
+                                        uno::Sequence< beans::NamedValue > aArgsForJob(1);
+                                        ScViewData* pViewData = GetViewData();
+                                        SfxViewShell* pViewShell = ( pViewData ? pViewData->GetViewShell() : NULL );
+                                        SfxViewFrame* pViewFrame = ( pViewShell ? pViewShell->GetViewFrame() : NULL );
+                                        SfxFrame* pFrame = ( pViewFrame ? &pViewFrame->GetFrame() : NULL );
+                                        uno::Reference< frame::XController > xController = ( pFrame ? pFrame->GetController() : 0 );
+                                        uno::Reference< sheet::XSpreadsheetView > xSpreadsheetView( xController, uno::UNO_QUERY_THROW );
+                                        aArgsForJob[0] = beans::NamedValue( ::rtl::OUString::createFromAscii( "SpreadsheetView" ),
+                                            uno::makeAny( xSpreadsheetView ) );
+                                        xJob->execute( aArgsForJob );
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    catch ( uno::Exception & )
+                    {
+                    }
                 }
                 break;
             case SFX_EVENT_SAVEDOC:

File sc/source/ui/docshell/docsh2.cxx

     aDocument.SetDrawDefaults();        // drawing layer defaults that are set only in InitNew
 
 	// InitOptions sets the document languages, must be called before CreateStandardStyles
-	InitOptions();
+    InitOptions(false);
 
 	aDocument.GetStyleSheetPool()->CreateStandardStyles();
 	aDocument.UpdStlShtPtrsFrmNms();

File sc/source/ui/docshell/docsh3.cxx

 
 //---------------------------------------------------------------------
 
-void ScDocShell::InitOptions()			// Fortsetzung von InitNew (CLOOKs)
+void ScDocShell::InitOptions(bool bForLoading)      // called from InitNew and Load
 {
 	//	Einstellungen aus dem SpellCheckCfg kommen in Doc- und ViewOptions
 
 	// zweistellige Jahreszahleneingabe aus Extras->Optionen->Allgemein->Sonstiges
     aDocOpt.SetYear2000( sal::static_int_cast<USHORT>( ::utl::MiscCfg().GetYear2000() ) );
 
+    if (bForLoading)
+    {
+        // #i112123# No style:decimal-places attribute means automatic decimals, not the configured default,
+        // so it must not be taken from the global options.
+        // Calculation settings are handled separately in ScXMLBodyContext::EndElement.
+        aDocOpt.SetStdPrecision( SvNumberFormatter::UNLIMITED_PRECISION );