diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2010-09-15 17:23:05 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-09-15 17:23:05 +0200 |
commit | 340f9bd08cfe91054d3ed36e13c26d4fccce154f (patch) | |
tree | 1b4b56bab38e2cf3e02469c9e881bcca6f62240d /sc | |
parent | d8c68b41b4ffd318744d5fc2ca0e60bdc37aca4e (diff) |
calc-dp-default-new-sheet.diff: default output to new sheet
i#50886
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/dbgui/pvlaydlg.cxx | 36 | ||||
-rw-r--r-- | sc/source/ui/inc/pvlaydlg.hxx | 5 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshc.cxx | 7 |
3 files changed, 33 insertions, 15 deletions
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx index 1eca44a787ed..a6796739c841 100644 --- a/sc/source/ui/dbgui/pvlaydlg.cxx +++ b/sc/source/ui/dbgui/pvlaydlg.cxx @@ -105,7 +105,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 ) ), @@ -165,7 +165,7 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar xDlgDPObject->FillOldParam( thePivotData, FALSE ); xDlgDPObject->FillLabelData( thePivotData ); - Init(); + Init(bNewOutput); FreeResource(); } @@ -200,7 +200,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!" ); @@ -301,19 +301,31 @@ void __EXPORT ScDPLayoutDlg::Init() } } - if ( thePivotData.nTab != MAXTAB+1 ) + if (bNewOutput) { - String aStr; - ScAddress( thePivotData.nCol, - thePivotData.nRow, - thePivotData.nTab ).Format( aStr, STD_FORMAT, pDoc, pDoc->GetAddressConvention() ); - aEdOutPos.SetText( aStr ); - EdModifyHdl(0); + // Output to a new sheet by default for a brand-new output. + aLbOutPos.SelectEntryPos(1); + aEdOutPos.Disable(); + aRbOutPos.Disable(); } else { - aLbOutPos.SelectEntryPos( aLbOutPos.GetEntryCount()-1 ); - SelAreaHdl(NULL); + // Modifying an existing dp output. + + 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 ); diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx index c74b9e028d2f..2b77b37c67ad 100644 --- a/sc/source/ui/inc/pvlaydlg.hxx +++ b/sc/source/ui/inc/pvlaydlg.hxx @@ -87,7 +87,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 ); @@ -189,7 +190,7 @@ private: private: ScDPFieldWindow& GetFieldWindow ( ScDPFieldType eType ); - void Init (); + void Init (bool bNewOutput); void InitWndSelect ( const ::std::vector<ScDPLabelDataRef>& rLabels ); void InitWnd ( PivotField* pArr, long nCount, ScDPFieldType eType ); void InitFocus (); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 0a14ad6c1eba..fa3ba10db0d2 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -252,8 +252,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; |