summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-05-15 13:48:25 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-05-15 13:48:25 +0000
commit79ad1c597058615625961cd1e47ef5614aaf1a8c (patch)
treea720b9ea82bf9d0851de2b5c4f62dbe77c2651c5
parent5b43eb8f020c12b36a73aaf8326a681136d7b5b8 (diff)
CWS-TOOLING: integrate CWS datapilotrange
2009-05-14 15:00:09 +0200 oc r271892 : #i101920 2009-05-14 14:57:48 +0200 oc r271890 : #i101920 2009-04-15 01:41:12 +0200 kohei r270812 : ScDPObject::bInfoValid is no longer used at all. Removing it. 2009-04-15 01:30:31 +0200 kohei r270811 : removed redundant call to InvalidateSource(). SetSheetDesc() already calls it, so no need to call it twice. 2009-04-13 22:01:35 +0200 kohei r270739 : #i86791# Fixed odd drag-n-drop issues after source range has changed. It was because the arrays that keep track of each field's members were not flushed properly after the source range change. 2009-04-13 21:58:39 +0200 kohei r270738 : Fixed indentation mis-match. 2009-04-13 17:54:55 +0200 kohei r270737 : Fixed a build breakage after rebase. 2009-04-13 04:06:55 +0200 kohei r270728 : CWS-TOOLING: rebase CWS datapilotrange to trunk@270723 (milestone: DEV300:m46) 2009-01-06 06:57:12 +0100 kohei r265892 : migrated the change from the old cvs repo & modified to get it to build.
-rw-r--r--sc/inc/dpobject.hxx1
-rw-r--r--sc/source/core/data/dpobject.cxx8
-rw-r--r--sc/source/ui/dbgui/fieldwnd.cxx2
-rw-r--r--sc/source/ui/dbgui/pivot.hrc4
-rw-r--r--sc/source/ui/dbgui/pivot.src47
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx184
-rw-r--r--sc/source/ui/inc/pvlaydlg.hxx22
7 files changed, 214 insertions, 54 deletions
diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 1c91c771f..525f97824 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -107,7 +107,6 @@ private:
BOOL bSettingsChanged;
BOOL bAlive; // FALSE if only used to hold settings
BOOL bAllowMove;
- BOOL bInfoValid; // affects: nHeaderRows
long nHeaderRows; // page fields plus filter button
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 915f6b60c..64f3a2f5e 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -166,7 +166,6 @@ ScDPObject::ScDPObject( ScDocument* pD ) :
bSettingsChanged( FALSE ),
bAlive( FALSE ),
bAllowMove( FALSE ),
- bInfoValid( FALSE ),
nHeaderRows( 0 )
{
}
@@ -185,7 +184,6 @@ ScDPObject::ScDPObject(const ScDPObject& r) :
bSettingsChanged( FALSE ),
bAlive( FALSE ),
bAllowMove( FALSE ),
- bInfoValid( r.bInfoValid ),
nHeaderRows( r.nHeaderRows )
{
if (r.pSaveData)
@@ -310,7 +308,6 @@ void ScDPObject::WriteSourceDataTo( ScDPObject& rDest ) const
void ScDPObject::WriteTempDataTo( ScDPObject& rDest ) const
{
rDest.nHeaderRows = nHeaderRows;
- rDest.bInfoValid = bInfoValid;
}
BOOL ScDPObject::IsSheetData() const
@@ -344,7 +341,6 @@ void ScDPObject::CreateOutput()
long nOldRows = nHeaderRows;
nHeaderRows = pOutput->GetHeaderRows();
- bInfoValid = TRUE;
if ( bAllowMove && nHeaderRows != nOldRows )
{
@@ -449,13 +445,11 @@ void ScDPObject::CreateObjects()
void ScDPObject::InvalidateData()
{
bSettingsChanged = TRUE;
- bInfoValid = FALSE;
}
void ScDPObject::InvalidateSource()
{
xSource = NULL;
- bInfoValid = FALSE;
}
ScRange ScDPObject::GetNewOutputRange( BOOL& rOverflow )
@@ -535,8 +529,6 @@ void ScDPObject::RefreshAfterLoad()
}
else
nHeaderRows = 0; // nothing found, no drop-down lists
-
- bInfoValid = TRUE;
}
void ScDPObject::UpdateReference( UpdateRefMode eUpdateRefMode,
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 9a22575cc..360e16dae 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -629,7 +629,7 @@ void ScDPFieldWindow::DelField( size_t nDelIndex )
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 --git a/sc/source/ui/dbgui/pivot.hrc b/sc/source/ui/dbgui/pivot.hrc
index 4dea022f5..d142eb3a4 100644
--- a/sc/source/ui/dbgui/pivot.hrc
+++ b/sc/source/ui/dbgui/pivot.hrc
@@ -66,6 +66,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 --git a/sc/source/ui/dbgui/pivot.src b/sc/source/ui/dbgui/pivot.src
index a9e905988..ae0ceb792 100644
--- a/sc/source/ui/dbgui/pivot.src
+++ b/sc/source/ui/dbgui/pivot.src
@@ -158,7 +158,7 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
MapUnit = MAP_APPFONT ;
- Delta = 73 ;
+ Delta = 90 ;
};
Window WND_FIELD
{
@@ -178,17 +178,42 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
Text [ en-US ] = "Result" ;
Hide = TRUE ;
};
- FixedText FT_OUTAREA
+
+ FixedText FT_INAREA
{
Pos = MAP_APPFONT ( 12 , 203 ) ;
Size = MAP_APPFONT ( 59 , 8 ) ;
Hide = TRUE ;
+ Text [ en-US ] = "Selection from" ;
+ };
+ 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 [ en-US ] = "Shrink" ;
+ };
+
+ FixedText FT_OUTAREA
+ {
+ Pos = MAP_APPFONT ( 12 , 221 ) ;
+ Size = MAP_APPFONT ( 59 , 8 ) ;
+ Hide = TRUE ;
Text [ en-US ] = "Results to" ;
};
ListBox LB_OUTAREA
{
Border = TRUE ;
- Pos = MAP_APPFONT ( 73 , 201 ) ;
+ Pos = MAP_APPFONT ( 73 , 219 ) ;
Size = MAP_APPFONT ( 75 , 90 ) ;
TabStop = TRUE ;
DropDown = TRUE ;
@@ -197,14 +222,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 ;
@@ -212,7 +237,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 ;
@@ -220,7 +245,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 ;
@@ -228,7 +253,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 ;
@@ -236,7 +261,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 ;
@@ -244,7 +269,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 ;
@@ -252,7 +277,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 ;
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 1fd5cad50..21b270601 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -36,6 +36,7 @@
//----------------------------------------------------------------------------
#include "pvlaydlg.hxx"
+#include "dbdocfun.hxx"
#include <sfx2/dispatch.hxx>
#include <vcl/msgbox.hxx>
@@ -56,6 +57,7 @@
#include "pivot.hrc"
#include "dpobject.hxx"
#include "dpsave.hxx"
+#include "dpshttab.hxx"
#include "scmod.hxx"
#include "sc.hrc" //CHINA001
@@ -120,6 +122,11 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar
aFtInfo ( this, ScResId( FT_INFO ) ),
aFlAreas ( this, ScResId( FL_OUTPUT ) ),
+
+ aFtInArea ( this, ScResId( FT_INAREA) ),
+ aEdInPos ( this, ScResId( ED_INAREA) ),
+ aRbInPos ( this, ScResId( RB_INAREA ), &aEdInPos, this ),
+
aLbOutPos ( this, ScResId( LB_OUTAREA ) ),
aFtOutArea ( this, ScResId( FT_OUTAREA ) ),
aEdOutPos ( this, this, ScResId( ED_OUTAREA ) ),
@@ -143,6 +150,8 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar
bIsDrag ( FALSE ),
+ pEditActive ( NULL ),
+
eLastActiveType ( TYPE_SELECT ),
nOffset ( 0 ),
//
@@ -204,6 +213,10 @@ void __EXPORT ScDPLayoutDlg::Init()
for ( USHORT i = 0; i < FUNC_COUNT; ++i )
aFuncNameArr.push_back( String( ScResId( i + 1 ) ) );
+ aBtnMore.AddWindow( &aFlAreas );
+ aBtnMore.AddWindow( &aFtInArea );
+ aBtnMore.AddWindow( &aEdInPos );
+ aBtnMore.AddWindow( &aRbInPos );
aBtnMore.AddWindow( &aFtOutArea );
aBtnMore.AddWindow( &aLbOutPos );
aBtnMore.AddWindow( &aEdOutPos );
@@ -214,7 +227,6 @@ void __EXPORT ScDPLayoutDlg::Init()
aBtnMore.AddWindow( &aBtnTotalRow );
aBtnMore.AddWindow( &aBtnFilter );
aBtnMore.AddWindow( &aBtnDrillDown );
- aBtnMore.AddWindow( &aFlAreas );
aBtnMore.SetClickHdl( LINK( this, ScDPLayoutDlg, MoreClickHdl ) );
{
@@ -232,31 +244,35 @@ void __EXPORT ScDPLayoutDlg::Init()
aRowArr.resize( MAX_FIELDS );
aDataArr.resize( MAX_FIELDS );
- InitWndSelect( thePivotData.ppLabelArr, static_cast<long>(thePivotData.nLabels) );
- InitWnd( thePivotData.aPageArr, static_cast<long>(thePivotData.nPageCount), TYPE_PAGE );
- InitWnd( thePivotData.aColArr, static_cast<long>(thePivotData.nColCount), TYPE_COL );
- InitWnd( thePivotData.aRowArr, static_cast<long>(thePivotData.nRowCount), TYPE_ROW );
- InitWnd( thePivotData.aDataArr, static_cast<long>(thePivotData.nDataCount), TYPE_DATA );
-
- aSlider.SetPageSize( PAGE_SIZE );
- aSlider.SetVisibleSize( PAGE_SIZE );
- aSlider.SetLineSize( LINE_SIZE );
- aSlider.SetRange( Range( 0, static_cast<long>(((thePivotData.nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) );
-
- if ( thePivotData.nLabels > PAGE_SIZE )
+ ScRange inRange;
+ String inString;
+ if (xDlgDPObject->GetSheetDesc())
{
- aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) );
- aSlider.Show();
+ aEdInPos.Enable();
+ aRbInPos.Enable();
+ aOldRange = xDlgDPObject->GetSheetDesc()->aSourceRange;
+ aOldRange.Format( inString, SCR_ABS_3D, pDoc, pDoc->GetAddressConvention() );
+ aEdInPos.SetText(inString);
}
else
- aSlider.Hide();
+ {
+ /* Data is not reachable, so could be a remote database */
+ aEdInPos.Disable();
+ aRbInPos.Disable();
+ }
- // Ein-/Ausgabebereiche: ----------------------------------------------
+ InitFields();
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 )
{
@@ -475,6 +491,27 @@ void ScDPLayoutDlg::InitFocus()
aWndSelect.GrabFocus();
}
+void ScDPLayoutDlg::InitFields()
+{
+ InitWndSelect( thePivotData.ppLabelArr, static_cast<long>(thePivotData.nLabels) );
+ InitWnd( thePivotData.aPageArr, static_cast<long>(thePivotData.nPageCount), TYPE_PAGE );
+ InitWnd( thePivotData.aColArr, static_cast<long>(thePivotData.nColCount), TYPE_COL );
+ InitWnd( thePivotData.aRowArr, static_cast<long>(thePivotData.nRowCount), TYPE_ROW );
+ InitWnd( thePivotData.aDataArr, static_cast<long>(thePivotData.nDataCount), TYPE_DATA );
+
+ aSlider.SetPageSize( PAGE_SIZE );
+ aSlider.SetVisibleSize( PAGE_SIZE );
+ aSlider.SetLineSize( LINE_SIZE );
+ aSlider.SetRange( Range( 0, static_cast<long>(((thePivotData.nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) );
+
+ if ( thePivotData.nLabels > PAGE_SIZE )
+ {
+ aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) );
+ aSlider.Show();
+ }
+ else
+ aSlider.Hide();
+}
//----------------------------------------------------------------------------
@@ -1309,22 +1346,75 @@ BOOL ScDPLayoutDlg::GetPivotArrays( PivotField* pPageArr,
return bFit;
}
+void ScDPLayoutDlg::UpdateSrcRange()
+{
+ String theCurPosStr = aEdInPos.GetText();
+ USHORT nResult = ScRange().Parse(theCurPosStr, pDoc, pDoc->GetAddressConvention());
+
+ if ( SCA_VALID != (nResult & SCA_VALID) )
+ // invalid source range.
+ return;
+
+ ScRefAddress start, end;
+ ConvertDoubleRef(pDoc, theCurPosStr, 1, start, end, pDoc->GetAddressConvention());
+ ScRange aNewRange(start.GetAddress(), end.GetAddress());
+ ScSheetSourceDesc inSheet = *xDlgDPObject->GetSheetDesc();
+
+ if (inSheet.aSourceRange == aNewRange)
+ // new range is identical to the current range. Nothing to do.
+ return;
+
+ ScTabViewShell * pTabViewShell = pViewData->GetViewShell();
+ inSheet.aSourceRange = aNewRange;
+ xDlgDPObject->SetSheetDesc(inSheet);
+ xDlgDPObject->FillOldParam( thePivotData, FALSE );
+ xDlgDPObject->FillLabelData(thePivotData);
+
+ pTabViewShell->SetDialogDPObject(xDlgDPObject.get());
+ aLabelDataArr.clear();
+ aWndSelect.ClearFields();
+ aWndData.ClearFields();
+ aWndRow.ClearFields();
+ aWndCol.ClearFields();
+ aWndPage.ClearFields();
+
+ for (size_t i = 0; i < MAX_LABELS; ++i)
+ aSelectArr[i].reset();
+
+ for (size_t i = 0; i < MAX_FIELDS; ++i)
+ {
+ aRowArr[i].reset();
+ aColArr[i].reset();
+ aDataArr[i].reset();
+ }
+
+ for (size_t i = 0; i < MAX_PAGEFIELDS; ++i)
+ aPageArr[i].reset();
+
+ InitFields();
+}
//----------------------------------------------------------------------------
void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP )
{
- if ( bRefInputMode )
+ if ( !bRefInputMode || !pEditActive )
+ return;
+
+ if ( rRef.aStart != rRef.aEnd )
+ RefInputStart( pEditActive );
+
+ if ( pEditActive == &aEdInPos )
+ {
+ String aRefStr;
+ rRef.Format( aRefStr, SCR_ABS_3D, pDocP, pDocP->GetAddressConvention() );
+ pEditActive->SetRefString( aRefStr );
+ }
+ else if ( pEditActive == &aEdOutPos )
{
- 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, pDocP->GetAddressConvention() );
- aEdOutPos.SetRefString( aRefStr );
+ pEditActive->SetRefString( aRefStr );
}
}
@@ -1335,7 +1425,12 @@ void ScDPLayoutDlg::SetActive()
{
if ( bRefInputMode )
{
- aEdOutPos.GrabFocus();
+ if ( pEditActive )
+ pEditActive->GrabFocus();
+
+ if ( pEditActive == &aEdInPos )
+ EdInModifyHdl( NULL );
+ else if ( pEditActive == &aEdOutPos )
EdModifyHdl( NULL );
}
else
@@ -1374,7 +1469,7 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG )
String aOutPosStr( aEdOutPos.GetText() );
ScAddress aAdrDest;
BOOL bToNewTable = (aLbOutPos.GetSelectEntryPos() == 1);
- USHORT nResult = !bToNewTable ? aAdrDest.Parse( aOutPosStr, pDoc ) : 0;
+ USHORT nResult = !bToNewTable ? aAdrDest.Parse( aOutPosStr, pDoc, pDoc->GetAddressConvention() ) : 0;
if ( bToNewTable
|| ( (aOutPosStr.Len() > 0) && (SCA_VALID == (nResult & SCA_VALID)) ) )
@@ -1507,12 +1602,11 @@ IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButton *, EMPTYARG )
//----------------------------------------------------------------------------
-IMPL_LINK_INLINE_START( ScDPLayoutDlg, CancelHdl, CancelButton *, EMPTYARG )
+IMPL_LINK( ScDPLayoutDlg, CancelHdl, CancelButton *, EMPTYARG )
{
Close();
return 0;
}
-IMPL_LINK_INLINE_END( ScDPLayoutDlg, CancelHdl, CancelButton *, EMPTYARG )
//----------------------------------------------------------------------------
@@ -1524,9 +1618,18 @@ IMPL_LINK( ScDPLayoutDlg, MoreClickHdl, MoreButton *, EMPTYARG )
bRefInputMode = TRUE;
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse
//SFX_APPWINDOW->Enable();
+ if ( aEdInPos.IsEnabled() )
+ {
+ aEdInPos.Enable();
+ aEdInPos.GrabFocus();
+ aEdInPos.Enable();
+ }
+ else
+ {
aEdOutPos.Enable();
aEdOutPos.GrabFocus();
- aRbOutPos.Enable();
+ aEdOutPos.Enable();
+ }
}
else
{
@@ -1543,7 +1646,7 @@ IMPL_LINK( ScDPLayoutDlg, MoreClickHdl, MoreButton *, EMPTYARG )
IMPL_LINK( ScDPLayoutDlg, EdModifyHdl, Edit *, EMPTYARG )
{
String theCurPosStr = aEdOutPos.GetText();
- USHORT nResult = ScAddress().Parse( theCurPosStr, pDoc );
+ USHORT nResult = ScAddress().Parse( theCurPosStr, pDoc, pDoc->GetAddressConvention() );
if ( SCA_VALID == (nResult & SCA_VALID) )
{
@@ -1567,6 +1670,13 @@ IMPL_LINK( ScDPLayoutDlg, EdModifyHdl, Edit *, EMPTYARG )
}
+IMPL_LINK( ScDPLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG )
+{
+ UpdateSrcRange();
+ return 0;
+}
+
+
//----------------------------------------------------------------------------
IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG )
@@ -1620,4 +1730,16 @@ IMPL_LINK( ScDPLayoutDlg, ScrollHdl, ScrollBar *, EMPTYARG )
return 0;
}
+//----------------------------------------------------------------------------
+
+IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl )
+{
+ pEditActive = NULL;
+ if ( pCtrl == &aEdInPos )
+ pEditActive = &aEdInPos;
+ else if ( pCtrl == &aEdOutPos )
+ pEditActive = &aEdOutPos;
+
+ return 0;
+}
diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx
index b772c3a70..f94a7ed10 100644
--- a/sc/source/ui/inc/pvlaydlg.hxx
+++ b/sc/source/ui/inc/pvlaydlg.hxx
@@ -48,6 +48,7 @@
#include "pivot.hxx"
#include "anyrefdg.hxx"
#include "fieldwnd.hxx"
+#include "formula/funcutl.hxx"
/*==========================================================================*\
@@ -129,10 +130,18 @@ private:
FixedInfo aFtInfo;
FixedLine aFlAreas;
+
+ // DP source selection
+ FixedText aFtInArea;
+ ::formula::RefEdit aEdInPos;
+ ::formula::RefButton aRbInPos;
+
+ // DP output location
ListBox aLbOutPos;
FixedText aFtOutArea;
- formula::RefEdit aEdOutPos;
- formula::RefButton aRbOutPos;
+ formula::RefEdit aEdOutPos;
+ formula::RefButton aRbOutPos;
+
CheckBox aBtnIgnEmptyRows;
CheckBox aBtnDetectCat;
CheckBox aBtnTotalCol;
@@ -155,6 +164,8 @@ private:
size_t nDnDFromIndex;
BOOL bIsDrag;
+ ::formula::RefEdit* pEditActive;
+
Rectangle aRectPage;
Rectangle aRectRow;
Rectangle aRectCol;
@@ -173,6 +184,7 @@ private:
ScDPFuncDataVec aDataArr;
ScDPObjectPtr xDlgDPObject;
+ ScRange aOldRange;
ScPivotParam thePivotData;
ScViewData* pViewData;
ScDocument* pDoc;
@@ -184,6 +196,7 @@ private:
void InitWndSelect ( LabelData** ppLabelArr, long nLabels );
void InitWnd ( PivotField* pArr, long nCount, ScDPFieldType eType );
void InitFocus ();
+ void InitFields ();
void CalcWndSizes ();
Point DlgPos2WndPos ( const Point& rPt, Window& rWnd );
ScDPLabelData* GetLabelData ( SCsCOL nCol, size_t* pPos = NULL );
@@ -207,14 +220,19 @@ private:
USHORT& rColCount,
USHORT& rRowCount,
USHORT& rDataCount );
+
+ void UpdateSrcRange();
+
// Handler
DECL_LINK( ClickHdl, PushButton * );
DECL_LINK( ScrollHdl, ScrollBar * );
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* );
};