diff -urp --exclude=CVS sc.clean/source/ui/dbgui/fieldwnd.cxx sc/source/ui/dbgui/fieldwnd.cxx --- sc.clean/source/ui/dbgui/fieldwnd.cxx 2008-02-05 11:16:56.000000000 -0500 +++ sc/source/ui/dbgui/fieldwnd.cxx 2008-02-13 12:26:03.000000000 -0500 @@ -644,7 +644,7 @@ void ScDPFieldWindow::DelField( size_t n void ScDPFieldWindow::ClearFields() { - if( eType == TYPE_SELECT ) + if( eType == TYPE_SELECT || eType == TYPE_PAGE || eType == TYPE_COL || eType == TYPE_ROW || eType == TYPE_DATA) { com::sun::star::uno::Reference < com::sun::star::accessibility::XAccessible > xTempAcc = xAccessible; if (!xTempAcc.is() && pAccessible) diff -urp --exclude=CVS sc.clean/source/ui/dbgui/pivot.hrc sc/source/ui/dbgui/pivot.hrc --- sc.clean/source/ui/dbgui/pivot.hrc 2008-02-05 11:16:56.000000000 -0500 +++ sc/source/ui/dbgui/pivot.hrc 2008-02-13 17:26:28.000000000 -0500 @@ -71,6 +71,10 @@ #define BTN_FILTER 29 #define BTN_DRILLDOWN 30 +#define FT_INAREA 40 +#define RB_INAREA 41 +#define ED_INAREA 42 + #define PIVOTSTR_SUM 1 #define PIVOTSTR_COUNT 2 #define PIVOTSTR_AVG 3 diff -urp --exclude=CVS sc.clean/source/ui/dbgui/pivot.src sc/source/ui/dbgui/pivot.src --- sc.clean/source/ui/dbgui/pivot.src 2008-02-05 11:16:56.000000000 -0500 +++ sc/source/ui/dbgui/pivot.src 2008-02-13 17:29:26.000000000 -0500 @@ -183,9 +183,50 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT Text [ en-US ] = "Result" ; Hide = TRUE ; }; + + FixedText FT_INAREA + { + Pos = MAP_APPFONT ( 12 , 203 ) ; + Size = MAP_APPFONT ( 59 , 8 ) ; + Hide = TRUE ; + Text [ en-US ] = "Selection from" ; + Text[ de ] = "Auswahl aus"; + Text[ es ] = "Selección de"; + Text[ fr ] = "Sélection à partir de"; + Text[ it ] = "Seleziona da"; + Text[ ja ] = "選択元"; + Text[ pt-BR ] = "Seleção de "; + Text[ zh-CN ] = "选择范围"; + Text[ zh-TW ] = "選項來源"; + }; + Edit ED_INAREA + { + Border = TRUE ; + Pos = MAP_APPFONT ( 73 , 201 ) ; + Size = MAP_APPFONT ( 100 , 12 ) ; + TabStop = TRUE ; + Hide = TRUE ; + }; + ImageButton RB_INAREA + { + Pos = MAP_APPFONT ( 177 , 200 ) ; + Size = MAP_APPFONT ( 13 , 15 ) ; + TabStop = TRUE ; + Hide = TRUE ; + QuickHelpText [ de ] = "Verkleinern" ; + QuickHelpText [ en-US ] = "Shrink" ; + QuickHelpText[ es ] = "Reducir"; + QuickHelpText[ fr ] = "Comprimer"; + QuickHelpText[ it ] = "Comprimi"; + QuickHelpText[ ja ] = "縮小"; + QuickHelpText[ pt-BR ] = "Diminuir"; + QuickHelpText[ zh-CN ] = "收缩"; + QuickHelpText[ zh-TW ] = "縮小"; + }; + FixedText FT_OUTAREA { - Pos = MAP_APPFONT ( 12 , 203 ) ; + Pos = MAP_APPFONT ( 12 , 221 ) ; Size = MAP_APPFONT ( 59 , 8 ) ; Hide = TRUE ; Text [ en-US ] = "Results to" ; @@ -193,7 +234,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT ListBox LB_OUTAREA { Border = TRUE ; - Pos = MAP_APPFONT ( 73 , 201 ) ; + Pos = MAP_APPFONT ( 73 , 219 ) ; Size = MAP_APPFONT ( 75 , 90 ) ; TabStop = TRUE ; DropDown = TRUE ; @@ -202,14 +243,14 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT Edit ED_OUTAREA { Border = TRUE ; - Pos = MAP_APPFONT ( 152 , 201 ) ; + Pos = MAP_APPFONT ( 152 , 219 ) ; Size = MAP_APPFONT ( 100 , 12 ) ; TabStop = TRUE ; Hide = TRUE ; }; ImageButton RB_OUTAREA { - Pos = MAP_APPFONT ( 256 , 200 ) ; + Pos = MAP_APPFONT ( 256 , 218 ) ; Size = MAP_APPFONT ( 13 , 15 ) ; TabStop = TRUE ; Hide = TRUE ; @@ -217,7 +258,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT }; CheckBox BTN_IGNEMPTYROWS { - Pos = MAP_APPFONT ( 12 , 219 ) ; + Pos = MAP_APPFONT ( 12 , 237 ) ; Size = MAP_APPFONT ( 124 , 10 ) ; TabStop = TRUE ; Hide = TRUE ; @@ -225,7 +266,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT }; CheckBox BTN_DETECTCAT { - Pos = MAP_APPFONT ( 142 , 219 ) ; + Pos = MAP_APPFONT ( 142 , 237 ) ; Size = MAP_APPFONT ( 124 , 10 ) ; TabStop = TRUE ; Hide = TRUE ; @@ -233,7 +274,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT }; CheckBox BTN_TOTALCOL { - Pos = MAP_APPFONT ( 12 , 233 ) ; + Pos = MAP_APPFONT ( 12 , 251 ) ; Size = MAP_APPFONT ( 124 , 10 ) ; TabStop = TRUE ; Hide = TRUE ; @@ -241,7 +282,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT }; CheckBox BTN_TOTALROW { - Pos = MAP_APPFONT ( 142 , 233 ) ; + Pos = MAP_APPFONT ( 142 , 251 ) ; Size = MAP_APPFONT ( 124 , 10 ) ; TabStop = TRUE ; Hide = TRUE ; @@ -249,7 +290,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT }; CheckBox BTN_FILTER { - Pos = MAP_APPFONT ( 12 , 247 ) ; + Pos = MAP_APPFONT ( 12 , 265 ) ; Size = MAP_APPFONT ( 124 , 10 ) ; TabStop = TRUE ; Hide = TRUE ; @@ -257,7 +298,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT }; CheckBox BTN_DRILLDOWN { - Pos = MAP_APPFONT ( 142 , 247 ) ; + Pos = MAP_APPFONT ( 142 , 265 ) ; Size = MAP_APPFONT ( 124 , 10 ) ; TabStop = TRUE ; Hide = TRUE ; Only in sc/source/ui/dbgui: pivot.src~ diff -urp --exclude=CVS sc.clean/source/ui/dbgui/pvlaydlg.cxx sc/source/ui/dbgui/pvlaydlg.cxx --- sc.clean/source/ui/dbgui/pvlaydlg.cxx 2008-02-05 11:16:56.000000000 -0500 +++ sc/source/ui/dbgui/pvlaydlg.cxx 2008-02-13 18:15:29.000000000 -0500 @@ -36,11 +36,12 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" - +#include //---------------------------------------------------------------------------- #include "pvlaydlg.hxx" +#include "dbdocfun.hxx" #include #include @@ -61,6 +62,7 @@ #include "pivot.hrc" #include "dpobject.hxx" #include "dpsave.hxx" +#include "dpshttab.hxx" #include "scmod.hxx" #include "sc.hrc" //CHINA001 @@ -129,6 +131,9 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBinding aFtOutArea ( this, ScResId( FT_OUTAREA ) ), aEdOutPos ( this, ScResId( ED_OUTAREA ) ), aRbOutPos ( this, ScResId( RB_OUTAREA ), &aEdOutPos ), + aFtInArea ( this, ScResId( FT_INAREA) ), + aEdInPos ( this, ScResId( ED_INAREA) ), + aRbInPos ( this, ScResId( RB_INAREA ), &aEdInPos ), aBtnIgnEmptyRows( this, ScResId( BTN_IGNEMPTYROWS ) ), aBtnDetectCat ( this, ScResId( BTN_DETECTCAT ) ), aBtnTotalCol ( this, ScResId( BTN_TOTALCOL ) ), @@ -148,6 +153,8 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBinding bIsDrag ( FALSE ), + pEditActive ( NULL ), + eLastActiveType ( TYPE_SELECT ), nOffset ( 0 ), // @@ -209,6 +216,9 @@ void __EXPORT ScDPLayoutDlg::Init() for ( USHORT i = 0; i < FUNC_COUNT; ++i ) aFuncNameArr.push_back( String( ScResId( i + 1 ) ) ); + aBtnMore.AddWindow( &aFtInArea ); + aBtnMore.AddWindow( &aEdInPos ); + aBtnMore.AddWindow( &aRbInPos ); aBtnMore.AddWindow( &aFtOutArea ); aBtnMore.AddWindow( &aLbOutPos ); aBtnMore.AddWindow( &aEdOutPos ); @@ -221,6 +231,7 @@ void __EXPORT ScDPLayoutDlg::Init() aBtnMore.AddWindow( &aBtnDrillDown ); aBtnMore.AddWindow( &aFlAreas ); aBtnMore.SetClickHdl( LINK( this, ScDPLayoutDlg, MoreClickHdl ) ); + aBtnMore.SetDelta(90); { Size aFieldSize( Window( this, ScResId( WND_FIELD ) ).GetSizePixel() ); @@ -243,6 +254,23 @@ void __EXPORT ScDPLayoutDlg::Init() InitWnd( thePivotData.aRowArr, static_cast(thePivotData.nRowCount), TYPE_ROW ); InitWnd( thePivotData.aDataArr, static_cast(thePivotData.nDataCount), TYPE_DATA ); + ScRange inRange; + String inString; + if (xDlgDPObject->GetSheetDesc()) + { + aEdInPos.Enable(); + aRbInPos.Enable(); + inRange = xDlgDPObject->GetSheetDesc()->aSourceRange; + inRange.Format( inString, STD_FORMAT, pDoc); + aEdInPos.SetText(inString); + } + else + { + /* Data is not reachable, so could be a remote database */ + aEdInPos.Disable(); + aRbInPos.Disable(); + } + aSlider.SetPageSize( PAGE_SIZE ); aSlider.SetVisibleSize( PAGE_SIZE ); aSlider.SetLineSize( LINE_SIZE ); @@ -260,8 +288,14 @@ void __EXPORT ScDPLayoutDlg::Init() aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) ); aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) ); + aEdInPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdInModifyHdl ) ); aBtnOk .SetClickHdl ( LINK( this, ScDPLayoutDlg, OkHdl ) ); aBtnCancel.SetClickHdl ( LINK( this, ScDPLayoutDlg, CancelHdl ) ); + Link aLink = LINK( this, ScDPLayoutDlg, GetFocusHdl ); + if ( aEdInPos.IsEnabled() ) + // Once disabled it will never get enabled, so no need to handle focus. + aEdInPos.SetGetFocusHdl( aLink ); + aEdOutPos.SetGetFocusHdl( aLink ); if ( pViewData && pDoc ) { @@ -1319,18 +1353,24 @@ BOOL ScDPLayoutDlg::GetPivotArrays( P void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) { - if ( bRefInputMode ) - { - if ( rRef.aStart != rRef.aEnd ) - RefInputStart( &aEdOutPos ); -/* - ScAddress aAdr( nStartCol, nStartRow, nStartTab ); - aAdr.PutInOrder( ScAddress( nEndCol, nEndRow, nEndTab ) ); -*/ - String aRefStr; - rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP ); - aEdOutPos.SetRefString( aRefStr ); - } + if ( !bRefInputMode || !pEditActive ) + return; + + if ( rRef.aStart != rRef.aEnd ) + RefInputStart( pEditActive ); + + if ( pEditActive == &aEdInPos ) + { + String aRefStr; + rRef.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() ); + pEditActive->SetRefString( aRefStr ); + } + else if ( pEditActive == &aEdOutPos ) + { + String aRefStr; + rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() ); + pEditActive->SetRefString( aRefStr ); + } } @@ -1340,8 +1380,13 @@ void ScDPLayoutDlg::SetActive() { if ( bRefInputMode ) { - aEdOutPos.GrabFocus(); - EdModifyHdl( NULL ); + if ( pEditActive ) + pEditActive->GrabFocus(); + + if ( pEditActive == &aEdInPos ) + EdInModifyHdl( NULL ); + else if ( pEditActive == &aEdOutPos ) + EdModifyHdl( NULL ); } else { @@ -1489,7 +1534,8 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButto ErrorBox( this, WinBits( WB_OK | WB_DEF_OK ), ScGlobal::GetRscString( STR_INVALID_TABREF ) ).Execute(); - aEdOutPos.GrabFocus(); + if ( pEditActive ) + pEditActive->GrabFocus(); } return 0; } @@ -1514,9 +1560,18 @@ IMPL_LINK( ScDPLayoutDlg, MoreClickHdl, bRefInputMode = TRUE; //@BugID 54702 Enablen/Disablen nur noch in Basisklasse //SFX_APPWINDOW->Enable(); - aEdOutPos.Enable(); - aEdOutPos.GrabFocus(); - aRbOutPos.Enable(); + if ( aEdInPos.IsEnabled() ) + { + aEdInPos.Enable(); + aEdInPos.GrabFocus(); + aEdInPos.Enable(); + } + else + { + aEdOutPos.Enable(); + aEdOutPos.GrabFocus(); + aEdOutPos.Enable(); + } } else { @@ -1557,6 +1612,99 @@ IMPL_LINK( ScDPLayoutDlg, EdModifyHdl, E } +IMPL_LINK( ScDPLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG ) +{ + String theCurPosStr = aEdInPos.GetText(); + + ScSheetSourceDesc inSheet = *(xDlgDPObject->GetSheetDesc()); + ScRange aR = xDlgDPObject->GetSheetDesc()->aSourceRange; + ScRefAddress start, end; + ConvertDoubleRef (pDoc, theCurPosStr, 1, start, end ); + inSheet.aSourceRange = ScRange(start.GetAddress(), end.GetAddress()); + xDlgDPObject->SetSheetDesc( inSheet); + xDlgDPObject->InvalidateSource(); + xDlgDPObject->Output(); + xDlgDPObject->SetAlive( TRUE ); // needed to get structure information + xDlgDPObject->FillOldParam( thePivotData, FALSE ); + xDlgDPObject->FillLabelData( thePivotData ); + + ScTabViewShell * pTabViewShell = pViewData->GetViewShell(); + ScDPObject tmpDPObject(*xDlgDPObject); + pTabViewShell->SetDialogDPObject(&tmpDPObject); + + aR = xDlgDPObject->GetSheetDesc()->aSourceRange; + + aLabelDataArr.clear(); + aWndSelect.ClearFields(); + aWndData.ClearFields(); + aWndRow.ClearFields(); + aWndCol.ClearFields(); + aWndPage.ClearFields(); + + USHORT i; + for ( i=0; i PAGE_SIZE ) + { + aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) ); + aSlider.Show(); + } + else + aSlider.Hide(); + + if ( pViewData && pDoc ) + { + /* + * Aus den RangeNames des Dokumentes werden nun die + * in einem Zeiger-Array gemerkt, bei denen es sich + * um sinnvolle Bereiche handelt + */ + + aLbOutPos.Clear(); + aLbOutPos.InsertEntry( aStrUndefined, 0 ); + aLbOutPos.InsertEntry( aStrNewTable, 1 ); + + ScAreaNameIterator aIter( pDoc ); + String aName; + ScRange aRange; + String aRefStr; + while ( aIter.Next( aName, aRange ) ) + { + if ( !aIter.WasDBName() ) // hier keine DB-Bereiche ! + { + USHORT nInsert = aLbOutPos.InsertEntry( aName ); + + aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc ); + aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) ); + } + } + } + + aEdInPos.GrabFocus(); + return 0; +} + + //---------------------------------------------------------------------------- IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG ) @@ -1610,4 +1758,16 @@ IMPL_LINK( ScDPLayoutDlg, ScrollHdl, Scr return 0; } +//---------------------------------------------------------------------------- + +IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl ) +{ + pEditActive = NULL; + if ( pCtrl == &aEdInPos ) + pEditActive = &aEdInPos; + else if ( pCtrl == &aEdOutPos ) + pEditActive = &aEdOutPos; + + return 0; +} Only in sc/source/ui/dbgui: pvlaydlg.cxx.orig diff -urp --exclude=CVS sc.clean/source/ui/inc/pvlaydlg.hxx sc/source/ui/inc/pvlaydlg.hxx --- sc.clean/source/ui/inc/pvlaydlg.hxx 2008-02-05 11:16:55.000000000 -0500 +++ sc/source/ui/inc/pvlaydlg.hxx 2008-02-13 16:32:46.000000000 -0500 @@ -147,6 +147,12 @@ private: FixedText aFtOutArea; ScRefEdit aEdOutPos; ScRefButton aRbOutPos; + + // For DP source selection + FixedText aFtInArea; + ScRefEdit aEdInPos; + ScRefButton aRbInPos; + CheckBox aBtnIgnEmptyRows; CheckBox aBtnDetectCat; CheckBox aBtnTotalCol; @@ -169,6 +175,8 @@ private: size_t nDnDFromIndex; BOOL bIsDrag; + ScRefEdit* pEditActive; + Rectangle aRectPage; Rectangle aRectRow; Rectangle aRectCol; @@ -227,8 +235,10 @@ private: DECL_LINK( SelAreaHdl, ListBox * ); DECL_LINK( MoreClickHdl, MoreButton * ); DECL_LINK( EdModifyHdl, Edit * ); + DECL_LINK( EdInModifyHdl, Edit * ); DECL_LINK( OkHdl, OKButton * ); DECL_LINK( CancelHdl, CancelButton * ); + DECL_LINK( GetFocusHdl, Control* ); };