[ooo-build-commit] .: 13 commits - sc/inc sc/source

Jan Holesovsky kendy at kemper.freedesktop.org
Wed Oct 6 07:09:37 PDT 2010


 sc/inc/ViewSettingsSequenceDefines.hxx      |    2 
 sc/inc/dpobject.hxx                         |    4 +
 sc/inc/dpsave.hxx                           |    1 
 sc/inc/pivot.hxx                            |    1 
 sc/inc/unonames.hxx                         |    1 
 sc/source/core/data/dpobject.cxx            |   35 ++++++++++++++++-
 sc/source/core/data/dpsave.cxx              |    5 ++
 sc/source/core/data/dptabsrc.cxx            |    6 ++
 sc/source/core/data/pivot2.cxx              |    1 
 sc/source/core/data/table2.cxx              |   11 +++--
 sc/source/filter/xml/XMLExportDataPilot.cxx |   10 +++-
 sc/source/ui/dbgui/pvfundlg.cxx             |    5 +-
 sc/source/ui/dbgui/pvlaydlg.cxx             |   57 +++++++++++++++++++++++++---
 sc/source/ui/inc/pvlaydlg.hxx               |    1 
 sc/source/ui/inc/tabvwsh.hxx                |    1 
 sc/source/ui/view/gridwin2.cxx              |   13 ++++--
 sc/source/ui/view/prevwsh.cxx               |    2 
 sc/source/ui/view/tabvwsh.cxx               |    2 
 sc/source/ui/view/tabvwsh4.cxx              |    8 ---
 19 files changed, 133 insertions(+), 33 deletions(-)

New commits:
commit fe5efbdef8d91b7f5bdfb3e21e28c78f453842d4
Merge: 13d88ca... 3777925...
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Wed Oct 6 13:31:28 2010 +0200

    Merge commit 'ooo/OOO330_m9'

commit 3777925071dfc0289cc0ec7de9cf5ce942105949
Merge: e9fdb86... 89e87ff...
Author: obo <obo at openoffice.org>
Date:   Tue Sep 14 09:13:16 2010 +0200

    CWS-TOOLING: integrate CWS calc59

commit e9fdb8635e42de65da6ad043b16e032a871530d0
Merge: 03c89b4... abab763...
Author: obo <obo at openoffice.org>
Date:   Tue Sep 14 09:05:18 2010 +0200

    CWS-TOOLING: integrate CWS dba33i

commit 03c89b4caaea56cba69f6a94cf942aa6a3c71a0c
Merge: 0815e6f... b85c287...
Author: obo <obo at openoffice.org>
Date:   Tue Sep 14 07:53:51 2010 +0200

    CWS-TOOLING: integrate CWS impress200

commit 89e87ff83a65aca71eeb70126f3f4d1146297466
Author: Niklas Nebel <nn at openoffice.org>
Date:   Wed Sep 1 18:30:27 2010 +0200

    calc59: compiler warning

diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index c98fbe9..c62882b 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -958,7 +958,6 @@ PointerStyle ScDPLayoutDlg::NotifyMouseMove( const Point& rAt )
         if ( eCheckTarget != TYPE_SELECT )
         {
             // check if the target orientation is allowed for this field
-            bool bAllowed = true;
             ScDPFuncDataVec* fromArr = NULL;
             switch ( eDnDFromType )
             {
commit c8821620007e23a011ef8ceabe3560a754faaef9
Author: Niklas Nebel <nn at openoffice.org>
Date:   Wed Sep 1 17:53:25 2010 +0200

    calc59: #i114256# Don't move DataPilot fields to orientations that the source doesn't support

diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index e2145a4..9edc8f1 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -186,7 +186,7 @@ public:
     bool                IsDataDescriptionCell(const ScAddress& rPos);
 
     bool                IsDimNameInUse(const ::rtl::OUString& rName) const;
-    String				GetDimName( long nDim, BOOL& rIsDataLayout );
+    String              GetDimName( long nDim, BOOL& rIsDataLayout, sal_Int32* pFlags = NULL );
     BOOL                IsDuplicated( long nDim );
     long                GetDimCount();
     void                GetHeaderPositionData(const ScAddress& rPos, ::com::sun::star::sheet::DataPilotTableHeaderData& rData);
@@ -259,6 +259,8 @@ public:
                             PivotField* pRefColFields = NULL, SCSIZE nRefColCount = 0,
                             PivotField* pRefRowFields = NULL, SCSIZE nRefRowCount = 0,
                             PivotField* pRefPageFields = NULL, SCSIZE nRefPageCount = 0 );
+
+    static bool         IsOrientationAllowed( USHORT nOrient, sal_Int32 nDimFlags );
 };
 
 
diff --git a/sc/inc/pivot.hxx b/sc/inc/pivot.hxx
index 118b027..f2271e1 100644
--- a/sc/inc/pivot.hxx
+++ b/sc/inc/pivot.hxx
@@ -141,6 +141,7 @@ struct ScDPLabelData
     SCsCOL              mnCol;
     USHORT              mnFuncMask;     /// Page/Column/Row subtotal function.
     sal_Int32           mnUsedHier;     /// Used hierarchy.
+    sal_Int32           mnFlags;        /// Flags from the DataPilotSource dimension
     bool                mbShowAll;      /// true = Show all (also empty) results.
     bool                mbIsValue;      /// true = Sum or count in data field.
 
diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx
index e76072b..8ceacba 100644
--- a/sc/inc/unonames.hxx
+++ b/sc/inc/unonames.hxx
@@ -565,6 +565,7 @@
 #define SC_UNO_FIELD_SUBTOTALNAME   "FieldSubtotalName"
 #define SC_UNO_GRANDTOTAL_NAME      "GrandTotalName"
 #define SC_UNO_HAS_HIDDEN_MEMBER    "HasHiddenMember"
+#define SC_UNO_FLAGS                "Flags"
 
 //  (preliminary:)
 #define SC_UNO_REFVALUE				"ReferenceValue"
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 5e6bae7..8048f0e 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -65,6 +65,7 @@
 #include <com/sun/star/sheet/DataPilotTableHeaderData.hpp>
 #include <com/sun/star/sheet/DataPilotTablePositionData.hpp>
 #include <com/sun/star/sheet/DataPilotTablePositionType.hpp>
+#include <com/sun/star/sheet/DimensionFlags.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
@@ -845,7 +846,7 @@ bool ScDPObject::IsDimNameInUse(const OUString& rName) const
     return false;
 }
 
-String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout )
+String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout, sal_Int32* pFlags )
 {
     rIsDataLayout = FALSE;
     String aRet;
@@ -879,6 +880,10 @@ String ScDPObject::GetDimName( long nDim, BOOL& rIsDataLayout )
                     rIsDataLayout = TRUE;
                 else
                     aRet = String( aName );
+
+                if (pFlags)
+                    *pFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp,
+                                rtl::OUString::createFromAscii(SC_UNO_FLAGS), 0 );
             }
         }
     }
@@ -2003,6 +2008,8 @@ BOOL ScDPObject::FillLabelData(ScPivotParam& rParam)
                 GetHierarchies(nDim, pNewLabel->maHiers);
                 GetMembers(nDim, GetUsedHierarchy(nDim), pNewLabel->maMembers);
                 lcl_FillLabelData(*pNewLabel, xDimProp);
+                pNewLabel->mnFlags = ScUnoHelpFunctions::GetLongProperty( xDimProp,
+                                        rtl::OUString::createFromAscii(SC_UNO_FLAGS), 0 );
                 rParam.maLabelArray.push_back(pNewLabel);
             }
         }
@@ -2231,6 +2238,32 @@ void ScDPObject::ConvertOrientation( ScDPSaveData& rSaveData,
     }
 }
 
+// static
+bool ScDPObject::IsOrientationAllowed( USHORT nOrient, sal_Int32 nDimFlags )
+{
+    bool bAllowed = true;
+    switch (nOrient)
+    {
+        case sheet::DataPilotFieldOrientation_PAGE:
+            bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_PAGE_ORIENTATION ) == 0;
+            break;
+        case sheet::DataPilotFieldOrientation_COLUMN:
+            bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_COLUMN_ORIENTATION ) == 0;
+            break;
+        case sheet::DataPilotFieldOrientation_ROW:
+            bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_ROW_ORIENTATION ) == 0;
+            break;
+        case sheet::DataPilotFieldOrientation_DATA:
+            bAllowed = ( nDimFlags & sheet::DimensionFlags::NO_DATA_ORIENTATION ) == 0;
+            break;
+        default:
+            {
+                // allowed to remove from previous orientation
+            }
+    }
+    return bAllowed;
+}
+
 // -----------------------------------------------------------------------
 
 //	static
diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx
old mode 100755
new mode 100644
index ed334e5..2175648
--- a/sc/source/core/data/dptabsrc.cxx
+++ b/sc/source/core/data/dptabsrc.cxx
@@ -1576,6 +1576,7 @@ uno::Reference<beans::XPropertySetInfo> SAL_CALL ScDPDimension::getPropertySetIn
     static SfxItemPropertyMapEntry aDPDimensionMap_Impl[] =
     {
         {MAP_CHAR_LEN(SC_UNO_FILTER),	0,	&getCppuType((uno::Sequence<sheet::TableFilterField>*)0), 0, 0 },
+        {MAP_CHAR_LEN(SC_UNO_FLAGS),    0,  &getCppuType((sal_Int32*)0),                beans::PropertyAttribute::READONLY, 0 },
         {MAP_CHAR_LEN(SC_UNO_FUNCTION),	0,	&getCppuType((sheet::GeneralFunction*)0),	0, 0 },
         {MAP_CHAR_LEN(SC_UNO_ISDATALA),	0,	&getBooleanCppuType(),						beans::PropertyAttribute::READONLY, 0 },
         {MAP_CHAR_LEN(SC_UNO_NUMBERFO),	0,	&getCppuType((sal_Int32*)0),				beans::PropertyAttribute::READONLY, 0 },
@@ -1753,6 +1754,11 @@ uno::Any SAL_CALL ScDPDimension::getPropertyValue( const rtl::OUString& aPropert
         aRet <<= mpSubtotalName.get() ? *mpSubtotalName : OUString::createFromAscii("");
     else if (aNameStr.EqualsAscii(SC_UNO_HAS_HIDDEN_MEMBER))
         aRet <<= mbHasHiddenMember;
+    else if (aNameStr.EqualsAscii(SC_UNO_FLAGS))
+    {
+        sal_Int32 nFlags = 0;       // tabular data: all orientations are possible
+        aRet <<= nFlags;
+    }
     else
     {
         DBG_ERROR("unknown property");
diff --git a/sc/source/core/data/pivot2.cxx b/sc/source/core/data/pivot2.cxx
index 66bfd3b..d565e2c 100644
--- a/sc/source/core/data/pivot2.cxx
+++ b/sc/source/core/data/pivot2.cxx
@@ -82,6 +82,7 @@ ScDPLabelData::ScDPLabelData( const String& rName, short nCol, bool bIsValue ) :
     mnCol( nCol ),
     mnFuncMask( PIVOT_FUNC_NONE ),
     mnUsedHier( 0 ),
+    mnFlags( 0 ),
     mbShowAll( false ),
     mbIsValue( bIsValue )
 {
diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx
index 6ee2c1b..c0dfde8 100644
--- a/sc/source/ui/dbgui/pvfundlg.cxx
+++ b/sc/source/ui/dbgui/pvfundlg.cxx
@@ -735,8 +735,9 @@ ScDPShowDetailDlg::ScDPShowDetailDlg( Window* pParent, ScDPObject& rDPObj, USHOR
     for (long nDim=0; nDim<nDimCount; nDim++)
     {
         BOOL bIsDataLayout;
-        String aName = rDPObj.GetDimName( nDim, bIsDataLayout );
-        if ( !bIsDataLayout && !rDPObj.IsDuplicated( nDim ) )
+        sal_Int32 nDimFlags = 0;
+        String aName = rDPObj.GetDimName( nDim, bIsDataLayout, &nDimFlags );
+        if ( !bIsDataLayout && !rDPObj.IsDuplicated( nDim ) && ScDPObject::IsOrientationAllowed( nOrient, nDimFlags ) )
         {
             const ScDPSaveDimension* pDimension = pSaveData ? pSaveData->GetExistingDimensionByName(aName) : 0;
             if ( !pDimension || (pDimension->GetOrientation() != nOrient) )
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 867277e..c98fbe9 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -567,7 +567,9 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po
         }
     }
 
-    if (   (toArr->back().get() == NULL)
+    bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType );
+    if ( bAllowed
+        && (toArr->back().get() == NULL)
         && (!Contains( toArr, fData.mnCol, nAt )) )
     {
         // ggF. in anderem Fenster entfernen
@@ -714,7 +716,8 @@ void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPF
         {
             ScDPFuncData fData( *((*fromArr)[nFromIndex]) );
 
-            if ( Contains( fromArr, fData.mnCol, nAt ) )
+            bool bAllowed = IsOrientationAllowed( fData.mnCol, eToType );
+            if ( bAllowed && Contains( fromArr, fData.mnCol, nAt ) )
             {
                 fromWnd->DelField( nAt );
                 Remove( fromArr, nAt );
@@ -935,21 +938,42 @@ PointerStyle ScDPLayoutDlg::NotifyMouseMove( const Point& rAt )
     if ( bIsDrag )
     {
         Point aPos = ScreenToOutputPixel( rAt );
+        ScDPFieldType eCheckTarget = TYPE_SELECT;
 
         if ( aRectPage.IsInside( aPos ) )
-            ePtr = lclGetPointerForField( TYPE_PAGE );
+            eCheckTarget = TYPE_PAGE;
         else if ( aRectCol.IsInside( aPos ) )
-            ePtr = lclGetPointerForField( TYPE_COL );
+            eCheckTarget = TYPE_COL;
         else if ( aRectRow.IsInside( aPos ) )
-            ePtr = lclGetPointerForField( TYPE_ROW );
+            eCheckTarget = TYPE_ROW;
         else if ( aRectData.IsInside( aPos ) )
-            ePtr = lclGetPointerForField( TYPE_DATA );
+            eCheckTarget = TYPE_DATA;
         else if ( eDnDFromType != TYPE_SELECT )
             ePtr = POINTER_PIVOT_DELETE;
         else if ( aRectSelect.IsInside( aPos ) )
             ePtr = lclGetPointerForField( TYPE_SELECT );
         else
             ePtr = POINTER_NOTALLOWED;
+
+        if ( eCheckTarget != TYPE_SELECT )
+        {
+            // check if the target orientation is allowed for this field
+            bool bAllowed = true;
+            ScDPFuncDataVec* fromArr = NULL;
+            switch ( eDnDFromType )
+            {
+                case TYPE_PAGE:   fromArr = &aPageArr;   break;
+                case TYPE_COL:    fromArr = &aColArr;    break;
+                case TYPE_ROW:    fromArr = &aRowArr;    break;
+                case TYPE_DATA:   fromArr = &aDataArr;   break;
+                case TYPE_SELECT: fromArr = &aSelectArr; break;
+            }
+            ScDPFuncData fData( *((*fromArr)[nDnDFromIndex]) );
+            if (IsOrientationAllowed( fData.mnCol, eCheckTarget ))
+                ePtr = lclGetPointerForField( eCheckTarget );
+            else
+                ePtr = POINTER_NOTALLOWED;
+        }
     }
 
     return ePtr;
@@ -1218,6 +1242,28 @@ String ScDPLayoutDlg::GetLabelString( SCsCOL nCol )
     return String();
 }
 
+//----------------------------------------------------------------------------
+
+bool ScDPLayoutDlg::IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType )
+{
+    bool bAllowed = true;
+    ScDPLabelData* pData = GetLabelData( nCol );
+    DBG_ASSERT( pData, "LabelData not found" );
+    if (pData)
+    {
+        sheet::DataPilotFieldOrientation eOrient = sheet::DataPilotFieldOrientation_HIDDEN;
+        switch (eType)
+        {
+            case TYPE_PAGE:   eOrient = sheet::DataPilotFieldOrientation_PAGE;   break;
+            case TYPE_COL:    eOrient = sheet::DataPilotFieldOrientation_COLUMN; break;
+            case TYPE_ROW:    eOrient = sheet::DataPilotFieldOrientation_ROW;    break;
+            case TYPE_DATA:   eOrient = sheet::DataPilotFieldOrientation_DATA;   break;
+            case TYPE_SELECT: eOrient = sheet::DataPilotFieldOrientation_HIDDEN; break;
+        }
+        bAllowed = ScDPObject::IsOrientationAllowed( (USHORT)eOrient, pData->mnFlags );
+    }
+    return bAllowed;
+}
 
 //----------------------------------------------------------------------------
 
diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx
index b14501e..b7d3e52 100644
--- a/sc/source/ui/inc/pvlaydlg.hxx
+++ b/sc/source/ui/inc/pvlaydlg.hxx
@@ -198,6 +198,7 @@ private:
     Point                   DlgPos2WndPos   ( const Point& rPt, Window& rWnd );
     ScDPLabelData*          GetLabelData    ( SCsCOL nCol, size_t* pPos = NULL );
     String                  GetLabelString  ( SCsCOL nCol );
+    bool                    IsOrientationAllowed( SCsCOL nCol, ScDPFieldType eType );
     String                  GetFuncString   ( USHORT& rFuncMask, BOOL bIsValue = TRUE );
     BOOL                    Contains        ( ScDPFuncDataVec* pArr, SCsCOL nCol, size_t& nAt );
     void                    Remove          ( ScDPFuncDataVec* pArr, size_t nAt );
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 28cf67c..1105d9a 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -309,10 +309,17 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove )
                                                 aPosRect, nOrient, nDimPos );
     UpdateDragRect( bHasRange && bMove, aPosRect );
 
+    BOOL bIsDataLayout;
+    sal_Int32 nDimFlags = 0;
+    String aDimName = pDragDPObj->GetDimName( nDPField, bIsDataLayout, &nDimFlags );
+    bool bAllowed = !bHasRange || ScDPObject::IsOrientationAllowed( nOrient, nDimFlags );
+
     if (bMove)			// set mouse pointer
     {
         PointerStyle ePointer = POINTER_PIVOT_DELETE;
-        if ( bHasRange )
+        if ( !bAllowed )
+            ePointer = POINTER_NOTALLOWED;
+        else if ( bHasRange )
             switch (nOrient)
             {
                 case sheet::DataPilotFieldOrientation_COLUMN: ePointer = POINTER_PIVOT_COL;	break;
@@ -327,15 +334,13 @@ void ScGridWindow::DPTestMouse( const MouseEvent& rMEvt, BOOL bMove )
         if (!bHasRange)
             nOrient = sheet::DataPilotFieldOrientation_HIDDEN;
 
-        BOOL bIsDataLayout;
-        String aDimName = pDragDPObj->GetDimName( nDPField, bIsDataLayout );
         if ( bIsDataLayout && ( nOrient != sheet::DataPilotFieldOrientation_COLUMN &&
                                 nOrient != sheet::DataPilotFieldOrientation_ROW ) )
         {
             //	removing data layout is not allowed
             pViewData->GetView()->ErrorMessage(STR_PIVOT_MOVENOTALLOWED);
         }
-        else
+        else if ( bAllowed )
         {
             ScDPSaveData aSaveData( *pDragDPObj->GetSaveData() );
 
commit abab7634a5ec281f5606d10c3647a6f05011706f
Author: Frank Schoenheit [fs] <frank.schoenheit at sun.com>
Date:   Wed Sep 1 13:39:49 2010 +0200

    dba33i: #i111146# completely put the responsibility for remembering/restoring view data, when switching to the
    print preview and back, to SFX
    In particular, the following changes have been applied
    - the SfxViewFactory now supports a programmatic API name, as documented in XModel2.getAvailableViewControllerNames
    - the new SFX_IMPL_NAMED_VIEWFACTORY, complementing the existing SFX_IMPL_VIEWFACTORY, allows to create view
      factories for such named views
    - SfxViewFrame::SwitchToViewShell_Impl has been extended to recognize the case where a non-PrintPreview view
      is exchanged with another view. In this case, it preserves the view's view data at the model
    - Calc's own mechanism for preserving the standard view's view data, and restoring it when coming back from
      the print preview, has been removed completely.
    
    What probably is left here is to migrate the other applications from SFX_IMPL_VIEWFACTORY to SFX_IMPL_NAMED_VIEWFACTORY.
    This way, they could also benefit from the new mechanism. Also, the UNO API would then be more precise, as the
    view names would be speaking then, instead of the current "view<number>" names.

diff --git a/sc/inc/ViewSettingsSequenceDefines.hxx b/sc/inc/ViewSettingsSequenceDefines.hxx
index a729620..9f5c75f 100644
--- a/sc/inc/ViewSettingsSequenceDefines.hxx
+++ b/sc/inc/ViewSettingsSequenceDefines.hxx
@@ -103,6 +103,6 @@
 #define SC_PAGEVIEWZOOMVALUE				"PageViewZoomValue"
 #define SC_SHOWPAGEBREAKPREVIEW             "ShowPageBreakPreview"
 #define SC_VIEWID							"ViewId"
-#define SC_VIEW								"View"
+#define SC_VIEW								"view"
 
 #endif
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 91add9d..68cbfe5 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -144,7 +144,6 @@ private:
     ScNavigatorSettings*    pNavSettings;
 
     // used in first Activate
-    ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue > aPendingUserData;
     BOOL					bFirstActivate;
 
     BOOL					bActiveDrawSh;
diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 0acc879..c8775fd 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -108,7 +108,7 @@ SFX_IMPL_INTERFACE( ScPreviewShell, SfxViewShell, ScResId(SCSTR_PREVIEWSHELL) )
     SFX_POPUPMENU_REGISTRATION(ScResId(RID_POPUP_PREVIEW));
 }
 
-SFX_IMPL_VIEWFACTORY( ScPreviewShell, ScResId(STR_NONAME) )
+SFX_IMPL_NAMED_VIEWFACTORY( ScPreviewShell, "PrintPreview" )
 {
     SFX_VIEW_REGISTRATION(ScDocShell);
 }
diff --git a/sc/source/ui/view/tabvwsh.cxx b/sc/source/ui/view/tabvwsh.cxx
index ebeeb76..8a407e0 100644
--- a/sc/source/ui/view/tabvwsh.cxx
+++ b/sc/source/ui/view/tabvwsh.cxx
@@ -102,7 +102,7 @@ SFX_IMPL_INTERFACE(ScTabViewShell,SfxViewShell,ScResId(SCSTR_TABVIEWSHELL))
     //-->Added by PengYunQuan for Validity Cell Range Picker
 }
 
-SFX_IMPL_VIEWFACTORY( ScTabViewShell, ScResId(STR_NONAME) )
+SFX_IMPL_NAMED_VIEWFACTORY( ScTabViewShell, "Default" )
 {
     SFX_VIEW_REGISTRATION(ScDocShell);
 }
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index cd52b98..1e494c1 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -173,13 +173,6 @@ void __EXPORT ScTabViewShell::Activate(BOOL bMDI)
             SFX_APP()->Broadcast( SfxSimpleHint( SC_HINT_NAVIGATOR_UPDATEALL ) );
             bFirstActivate = FALSE;
 
-            if ( aPendingUserData.hasElements() )
-            {
-                //	#89897# read user data from print preview now, after ctor
-                DoReadUserDataSequence( aPendingUserData );
-                aPendingUserData.realloc( 0 );
-            }
-
             // #116278# ReadExtOptions (view settings from Excel import) must also be done
             // after the ctor, because of the potential calls to Window::Show.
             // Even after the fix for #104887# (Window::Show no longer notifies the access
@@ -1924,7 +1917,6 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame* pViewFrame,
     if ( pOldSh && pOldSh->ISA( ScPreviewShell ) )
     {
         ScPreviewShell* pPreviewShell = ((ScPreviewShell*)pOldSh);
-        aPendingUserData = pPreviewShell->GetSourceData();		// used in Activate
         nForceDesignMode = pPreviewShell->GetSourceDesignMode();
     }
 
commit aa1ce74fbfc75a7f1d611a56da6e2cc18fdfdd8e
Author: Niklas Nebel <nn at openoffice.org>
Date:   Mon Aug 30 18:45:51 2010 +0200

    calc59: #i114202# save table:show-empty attribute only if valid in ScDPSaveDimension

diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index 5651930..6e7d2b4 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -140,6 +140,7 @@ public:
     void					SetSubTotals(long nCount, const USHORT* pFuncs);
     long                    GetSubTotalsCount() const { return nSubTotalCount; }
     USHORT                  GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; }
+    bool                    HasShowEmpty() const;
     void					SetShowEmpty(BOOL bSet);
     BOOL                    GetShowEmpty() const { return BOOL(nShowEmptyMode); }
     void					SetFunction(USHORT nNew);		// enum GeneralFunction
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 84b5bdb..bdf788c 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -410,6 +410,11 @@ void ScDPSaveDimension::SetSubTotals(long nCount, const USHORT* pFuncs)
     bSubTotalDefault = FALSE;
 }
 
+bool ScDPSaveDimension::HasShowEmpty() const
+{
+    return nShowEmptyMode != SC_DPSAVEMODE_DONTKNOW;
+}
+
 void ScDPSaveDimension::SetShowEmpty(BOOL bSet)
 {
     nShowEmptyMode = bSet;
diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx b/sc/source/filter/xml/XMLExportDataPilot.cxx
index 5aa770b..cfd4cbb 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -503,9 +503,13 @@ void ScXMLExportDataPilot::WriteMembers(ScDPSaveDimension* pDim)
 
 void ScXMLExportDataPilot::WriteLevels(ScDPSaveDimension* pDim)
 {
-    rtl::OUStringBuffer sBuffer;
-    SvXMLUnitConverter::convertBool(sBuffer, pDim->GetShowEmpty());
-    rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_EMPTY, sBuffer.makeStringAndClear());
+    // #i114202# GetShowEmpty is only valid if HasShowEmpty is true.
+    if (pDim->HasShowEmpty())
+    {
+        rtl::OUStringBuffer sBuffer;
+        SvXMLUnitConverter::convertBool(sBuffer, pDim->GetShowEmpty());
+        rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_EMPTY, sBuffer.makeStringAndClear());
+    }
     SvXMLElementExport aElemDPL(rExport, XML_NAMESPACE_TABLE, XML_DATA_PILOT_LEVEL, sal_True, sal_True);
 
     WriteSubTotals(pDim);
commit d83475610402026e855d7e6a68518aca4cecccd0
Merge: 1f33e95... 0815e6f...
Author: Frank Schoenheit [fs] <frank.schoenheit at oracle.com>
Date:   Mon Aug 30 14:10:40 2010 +0200

    dba33h: merge after pulling OOO330.m6

commit b85c2871a3e7637b5702ac5e92e0c77036bec05e
Merge: 1f33e95... 5bf271a...
Author: Christian Lippka <christian.lippka at oracle.com>
Date:   Thu Aug 26 21:56:23 2010 +0200

    impress200: merge

commit 5bf271a630f50c69646c91f50e3db7b5adaf199a
Merge: 1f33e95... 7a86940...
Author: Andre Fischer<andre.f.fischer <Andre Fischer<andre.f.fischer at oracle.com>
Date:   Thu Jan 1 00:00:00 1970 +0000

    impress200: merge

commit 7a86940efec79bdf7e8c696f250c1a67378d3667
Merge: 1f33e95... 8ea1de3...
Author: Philipp Lohmann [pl] <Philipp.Lohmann at Oracle.COM>
Date:   Thu Aug 26 15:11:09 2010 +0200

    merge

commit 8ea1de30f486a26ff46a7ccdfc66742680125716
Author: Niklas Nebel <nn at openoffice.org>
Date:   Thu Aug 26 14:17:29 2010 +0200

    impress200: #i113884# check for overflow in ScTable::SetDrawPageSize

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index aeb2a19..c4141cc 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3100,10 +3100,13 @@ void ScTable::SetDrawPageSize(bool bResetStreamValid, bool bUpdateNoteCaptionPos
     ScDrawLayer* pDrawLayer = pDocument->GetDrawLayer();
     if( pDrawLayer )
     {
-        long x = GetColOffset( MAXCOL + 1 );
-        long y = GetRowOffset( MAXROW + 1 );
-        x = (long) ((double) x * HMM_PER_TWIPS);
-        y = (long) ((double) y * HMM_PER_TWIPS);
+        double fValX = GetColOffset( MAXCOL + 1 ) * HMM_PER_TWIPS;
+        double fValY = GetRowOffset( MAXROW + 1 ) * HMM_PER_TWIPS;
+        const long nMax = ::std::numeric_limits<long>::max();
+        // #i113884# Avoid int32 overflow with possible negative results than can cause bad effects.
+        // If the draw page size is smaller than all rows, only the bottom of the sheet is affected.
+        long x = ( fValX > (double)nMax ) ? nMax : (long) fValX;
+        long y = ( fValY > (double)nMax ) ? nMax : (long) fValY;
 
         if ( IsLayoutRTL() )		// IsNegativePage
             x = -x;


More information about the ooo-build-commit mailing list