ooo-build r15516 - in trunk: . patches/dev300



Author: kyoshida
Date: Tue Mar 10 03:51:09 2009
New Revision: 15516
URL: http://svn.gnome.org/viewvc/ooo-build?rev=15516&view=rev

Log:
2009-03-09  Kohei Yoshida  <kyoshida novell com>

	* patches/dev300/calc-dp-default-new-sheet.diff: set destination to a 
	new sheet by default only for new datapilot outputs. (n#483446)


Modified:
   trunk/ChangeLog
   trunk/patches/dev300/calc-dp-default-new-sheet.diff

Modified: trunk/patches/dev300/calc-dp-default-new-sheet.diff
==============================================================================
--- trunk/patches/dev300/calc-dp-default-new-sheet.diff	(original)
+++ trunk/patches/dev300/calc-dp-default-new-sheet.diff	Tue Mar 10 03:51:09 2009
@@ -1,10 +1,49 @@
 diff --git sc/source/ui/dbgui/pvlaydlg.cxx sc/source/ui/dbgui/pvlaydlg.cxx
-index 056e37e..155f3e0 100644
+index 99897a0..4dee615 100644
 --- sc/source/ui/dbgui/pvlaydlg.cxx
 +++ sc/source/ui/dbgui/pvlaydlg.cxx
-@@ -303,20 +303,10 @@ void __EXPORT ScDPLayoutDlg::Init()
+@@ -107,7 +107,7 @@ PointerStyle lclGetPointerForField( ScDPFieldType eType )
+ //----------------------------------------------------------------------------
+ 
+ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent,
+-                                    const ScDPObject& rDPObject )
++                                    const ScDPObject& rDPObject, bool bNewOutput )
+ 	:	ScAnyRefDlg	( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ),
+         aFlLayout       ( this, ScResId( FL_LAYOUT ) ),
+         aFtPage         ( this, ScResId( FT_PAGE ) ),
+@@ -167,7 +167,7 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar
+     xDlgDPObject->FillOldParam( thePivotData, FALSE );
+     xDlgDPObject->FillLabelData( thePivotData );
+ 
+-	Init();
++	Init(bNewOutput);
+ 	FreeResource();
+ }
+ 
+@@ -202,7 +202,7 @@ ScDPFieldWindow& ScDPLayoutDlg::GetFieldWindow( ScDPFieldType eType )
+     return aWndSelect;
+ }
+ 
+-void __EXPORT ScDPLayoutDlg::Init()
++void __EXPORT ScDPLayoutDlg::Init(bool bNewOutput)
+ {
+ 	DBG_ASSERT( pViewData && pDoc,
+ 				"Ctor-Initialisierung fehlgeschlagen!" );
+@@ -302,21 +302,33 @@ void __EXPORT ScDPLayoutDlg::Init()
+ 			}
  		}
  	}
++    
++    if (bNewOutput)
++    {
++        // Output to a new sheet by default for a brand-new output.
++        aLbOutPos.SelectEntryPos(1);
++        aEdOutPos.Disable();
++        aRbOutPos.Disable();
++    }
++    else
++    {
++        // Modifying an existing dp output.
  
 -	if ( thePivotData.nTab != MAXTAB+1 )
 -	{
@@ -20,10 +59,63 @@
 -		aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 );
 -		SelAreaHdl(NULL);
 -	}
-+    // Output to a new sheet by default.
-+    aLbOutPos.SelectEntryPos(1);
-+    aEdOutPos.Disable();
-+    aRbOutPos.Disable();
++        if ( thePivotData.nTab != MAXTAB+1 )
++        {
++            String aStr;
++            ScAddress( thePivotData.nCol,
++                       thePivotData.nRow,
++                       thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() );
++            aEdOutPos.SetText( aStr );
++            EdModifyHdl(0);
++        }
++        else
++        {
++            aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 );
++            SelAreaHdl(NULL);
++        }
++    }
  
  	aBtnIgnEmptyRows.Check( thePivotData.bIgnoreEmptyRows );
  	aBtnDetectCat   .Check( thePivotData.bDetectCategories );
+diff --git sc/source/ui/inc/pvlaydlg.hxx sc/source/ui/inc/pvlaydlg.hxx
+index ceebdb7..a3e08cb 100644
+--- sc/source/ui/inc/pvlaydlg.hxx
++++ sc/source/ui/inc/pvlaydlg.hxx
+@@ -89,7 +89,8 @@ public:
+                                 SfxBindings* pB,
+                                 SfxChildWindow* pCW,
+                                 Window* pParent,
+-                                const ScDPObject& rDPObject );
++                                const ScDPObject& rDPObject,
++                                bool bNewOutput );
+     virtual                 ~ScDPLayoutDlg();
+ 
+     virtual void            SetReference( const ScRange& rRef, ScDocument* pDoc );
+@@ -190,7 +191,7 @@ private:
+ 
+ private:
+     ScDPFieldWindow&        GetFieldWindow  ( ScDPFieldType eType );
+-    void                    Init            ();
++    void                    Init            (bool bNewOutput);
+     void                    InitWndSelect   ( LabelData** ppLabelArr, long nLabels );
+     void                    InitWnd         ( PivotField* pArr, long nCount, ScDPFieldType eType );
+     void                    InitFocus       ();
+diff --git sc/source/ui/view/tabvwshc.cxx sc/source/ui/view/tabvwshc.cxx
+index aa38b7a..b20876f 100644
+--- sc/source/ui/view/tabvwshc.cxx
++++ sc/source/ui/view/tabvwshc.cxx
+@@ -255,8 +255,13 @@ SfxModelessDialog* ScTabViewShell::CreateRefDialog(
+ 
+             if( pDialogDPObject )
+             {
++                // Check for an existing datapilot output.
++                ScViewData* pViewData = GetViewData();
++                ScDPObject* pObj = GetViewData()->GetDocument()->GetDPAtCursor(
++                    pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo());
++
+                 GetViewData()->SetRefTabNo( GetViewData()->GetTabNo() );
+-                pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject );
++                pResult = new ScDPLayoutDlg( pB, pCW, pParent, *pDialogDPObject, pObj == NULL);
+             }
+ 		}
+ 		break;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]