summaryrefslogtreecommitdiff
path: root/sc/source/ui/dbgui/pvlaydlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/dbgui/pvlaydlg.cxx')
-rw-r--r--sc/source/ui/dbgui/pvlaydlg.cxx462
1 files changed, 235 insertions, 227 deletions
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index d7e43d55ea55..f7e2001f14de 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -47,2 +47,3 @@
#include <vcl/msgbox.hxx>
+#include <vcl/layout.hxx>
@@ -86,2 +87,21 @@ Point DlgPos2WndPos( const Point& rPt, const Window& rWnd )
+static const OString* getFuncNames()
+{
+ static const OString gFuncNames[ PIVOT_MAXFUNC ] =
+ {
+ OString("sum") ,
+ OString("count") ,
+ OString("mean") ,
+ OString("max") ,
+ OString("min") ,
+ OString("product"),
+ OString("count2"),
+ OString("stdev") ,
+ OString("stdevp") ,
+ OString("var") ,
+ OString("varp") ,
+ };
+ return &gFuncNames[0];
+}
+
} // namespace
@@ -89,38 +109,3 @@ Point DlgPos2WndPos( const Point& rPt, const Window& rWnd )
ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pParent, const ScDPObject& rDPObject, bool bNewOutput ) :
- ScAnyRefDlg( pB, pCW, pParent, RID_SCDLG_PIVOT_LAYOUT ),
-
- maFlLayout( this, ScResId( FL_LAYOUT ) ),
- maFtPage( this, ScResId( FT_PAGE ) ),
- maWndPage( this, ScResId( WND_PAGE ), &maFtPage, HID_SC_DPLAY_PAGE ),
- maFtCol( this, ScResId( FT_COL ) ),
- maWndCol( this, ScResId( WND_COL ), &maFtCol, HID_SC_DPLAY_COLUMN ),
- maFtRow( this, ScResId( FT_ROW ) ),
- maWndRow( this, ScResId( WND_ROW ), &maFtRow, HID_SC_DPLAY_ROW ),
- maFtData( this, ScResId( FT_DATA ) ),
- maWndData( this, ScResId( WND_DATA ), &maFtData, HID_SC_DPLAY_DATA ),
- maWndSelect( this, ScResId( WND_SELECT ), NULL, HID_SC_DPLAY_SELECT ),
- maFtInfo( this, ScResId( FT_INFO ) ),
-
- maFlAreas( this, ScResId( FL_OUTPUT ) ),
- maFtInArea( this, ScResId( FT_INAREA) ),
- maEdInPos( this, this, &maFtInArea, ScResId( ED_INAREA) ),
- maRbInPos( this, ScResId( RB_INAREA ), &maEdInPos, this ),
- maLbOutPos( this, ScResId( LB_OUTAREA ) ),
- maFtOutArea( this, ScResId( FT_OUTAREA ) ),
- maEdOutPos( this, this, &maFtOutArea, ScResId( ED_OUTAREA ) ),
- maRbOutPos( this, ScResId( RB_OUTAREA ), &maEdOutPos, this ),
- maBtnIgnEmptyRows( this, ScResId( BTN_IGNEMPTYROWS ) ),
- maBtnDetectCat( this, ScResId( BTN_DETECTCAT ) ),
- maBtnTotalCol( this, ScResId( BTN_TOTALCOL ) ),
- maBtnTotalRow( this, ScResId( BTN_TOTALROW ) ),
- maBtnFilter( this, ScResId( BTN_FILTER ) ),
- maBtnDrillDown( this, ScResId( BTN_DRILLDOWN ) ),
-
- maBtnOk( this, ScResId( BTN_OK ) ),
- maBtnCancel( this, ScResId( BTN_CANCEL ) ),
- maBtnHelp( this, ScResId( BTN_HELP ) ),
- maBtnRemove( this, ScResId( BTN_REMOVE ) ),
- maBtnOptions( this, ScResId( BTN_OPTIONS ) ),
- maBtnMore( this, ScResId( BTN_MORE ) ),
-
+ ScAnyRefDlg( pB, pCW, pParent, "PivotTableLayout", "modules/scalc/ui/pivottablelayout.ui" ),
mxDlgDPObject( new ScDPObject( rDPObject ) ),
@@ -129,3 +114,2 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
mpRefInputEdit(NULL),
-
maStrUndefined(SC_RESSTR(SCSTR_UNDEFINED)),
@@ -137,2 +121,41 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
{
+ get( mpFtPage, "page_text" );
+ get( mpWndPage, "pagefield" );
+ get( mpFtCol, "column_text" );
+ get( mpWndCol, "columnfield" );
+ get( mpFtRow, "row_text" );
+ get( mpWndRow, "rowfield" );
+ get( mpFtData, "data_text" );
+ get( mpWndData, "datafield" );
+ get( mpWndSelect, "buttonfield" );
+ get( mpFtInfo, "info" );
+
+ mpWndPage->Init( this, mpFtPage );
+ mpWndCol->Init( this, mpFtCol );
+ mpWndRow->Init( this, mpFtRow );
+ mpWndData->Init( this, mpFtData );
+ mpWndSelect->Init( this, NULL );
+ mpWndSelect->SetName( get<FixedText>("select_text")->GetText());
+
+ get( mpFtInArea, "select_from" );
+ get( mpEdInPos, "rangesel1" );
+ get( mpRbInPos, "changebutton1" );
+ get( mpLbOutPos, "target_area" );
+ get( mpFtOutArea, "results_to" );
+ get( mpEdOutPos, "rangesel2" );
+ get( mpRbOutPos, "changebutton2" );
+ get( mpBtnIgnEmptyRows, "ignore_empty" );
+ get( mpBtnDetectCat, "detect_category" );
+ get( mpBtnTotalCol, "total_cols" );
+ get( mpBtnTotalRow, "total_rows" );
+ get( mpBtnFilter, "add_filter" );
+ get( mpBtnDrillDown, "drill_down" );
+
+ get( mpBtnOk, "ok" );
+ get( mpBtnCancel, "cancel" );
+ get( mpBtnRemove, "remove" );
+ get( mpBtnOptions, "options" );
+ get( mpExpander, "more" );
+ mpExpander->SetExpandedHdl( LINK( this, ScPivotLayoutDlg, ExpandHdl ) );
+
mxDlgDPObject->FillOldParam( maPivotData );
@@ -140,31 +163,19 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
- maBtnRemove.SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
- maBtnOptions.SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
+ mpBtnRemove->SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
+ mpBtnOptions->SetClickHdl( LINK( this, ScPivotLayoutDlg, ClickHdl ) );
maFuncNames.reserve( PIVOT_MAXFUNC );
- for ( sal_uInt16 i = 1; i <= PIVOT_MAXFUNC; ++i )
- maFuncNames.push_back(ScResId(i).toString());
-
- maBtnMore.AddWindow( &maFlAreas );
- maBtnMore.AddWindow( &maFtInArea );
- maBtnMore.AddWindow( &maEdInPos );
- maBtnMore.AddWindow( &maRbInPos );
- maBtnMore.AddWindow( &maFtOutArea );
- maBtnMore.AddWindow( &maLbOutPos );
- maBtnMore.AddWindow( &maEdOutPos );
- maBtnMore.AddWindow( &maRbOutPos );
- maBtnMore.AddWindow( &maBtnIgnEmptyRows );
- maBtnMore.AddWindow( &maBtnDetectCat );
- maBtnMore.AddWindow( &maBtnTotalCol );
- maBtnMore.AddWindow( &maBtnTotalRow );
- maBtnMore.AddWindow( &maBtnFilter );
- maBtnMore.AddWindow( &maBtnDrillDown );
- maBtnMore.SetClickHdl( LINK( this, ScPivotLayoutDlg, MoreClickHdl ) );
+ const OString* pFuncNames = getFuncNames();
+ for ( sal_uInt16 i = 0; i < PIVOT_MAXFUNC; ++i )
+ {
+ OUString tmpText = get<FixedText>(pFuncNames[i])->GetText();
+ maFuncNames.push_back(tmpText);
+ }
maFieldCtrls.reserve(5);
- maFieldCtrls.push_back(&maWndPage);
- maFieldCtrls.push_back(&maWndCol);
- maFieldCtrls.push_back(&maWndRow);
- maFieldCtrls.push_back(&maWndData);
- maFieldCtrls.push_back(&maWndSelect);
+ maFieldCtrls.push_back(mpWndPage);
+ maFieldCtrls.push_back(mpWndCol);
+ maFieldCtrls.push_back(mpWndRow);
+ maFieldCtrls.push_back(mpWndData);
+ maFieldCtrls.push_back(mpWndSelect);
@@ -174,4 +185,4 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
{
- maEdInPos.Enable();
- maRbInPos.Enable();
+ mpEdInPos->Enable();
+ mpRbInPos->Enable();
const ScSheetSourceDesc* p = mxDlgDPObject->GetSheetDesc();
@@ -179,3 +190,3 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
if (!aRangeName.isEmpty())
- maEdInPos.SetText(aRangeName);
+ mpEdInPos->SetText(aRangeName);
else
@@ -184,3 +195,3 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
OUString aStr(maOldRange.Format(SCR_ABS_3D, mpDoc, mpDoc->GetAddressConvention()));
- maEdInPos.SetText(aStr);
+ mpEdInPos->SetText(aStr);
}
@@ -190,4 +201,4 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
// data is not reachable, so could be a remote database
- maEdInPos.Disable();
- maRbInPos.Disable();
+ mpEdInPos->Disable();
+ mpRbInPos->Disable();
}
@@ -196,7 +207,7 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
- maLbOutPos.SetSelectHdl( LINK( this, ScPivotLayoutDlg, SelAreaHdl ) );
- maEdOutPos.SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdOutModifyHdl ) );
- maEdInPos.SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdInModifyHdl ) );
- maBtnOk.SetClickHdl( LINK( this, ScPivotLayoutDlg, OkHdl ) );
- maBtnCancel.SetClickHdl( LINK( this, ScPivotLayoutDlg, CancelHdl ) );
+ mpLbOutPos->SetSelectHdl( LINK( this, ScPivotLayoutDlg, SelAreaHdl ) );
+ mpEdOutPos->SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdOutModifyHdl ) );
+ mpEdInPos->SetModifyHdl( LINK( this, ScPivotLayoutDlg, EdInModifyHdl ) );
+ mpBtnOk->SetClickHdl( LINK( this, ScPivotLayoutDlg, OkHdl ) );
+ mpBtnCancel->SetClickHdl( LINK( this, ScPivotLayoutDlg, CancelHdl ) );
@@ -204,5 +215,5 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
Link aGetFocusLink = LINK(this, ScPivotLayoutDlg, GetRefEditFocusHdl);
- if (maEdInPos.IsEnabled())
- maEdInPos.SetGetFocusHdl(aGetFocusLink);
- maEdOutPos.SetGetFocusHdl(aGetFocusLink);
+ if (mpEdInPos->IsEnabled())
+ mpEdInPos->SetGetFocusHdl(aGetFocusLink);
+ mpEdOutPos->SetGetFocusHdl(aGetFocusLink);
@@ -216,5 +227,5 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
- maLbOutPos.Clear();
- maLbOutPos.InsertEntry( maStrUndefined, 0 );
- maLbOutPos.InsertEntry( maStrNewTable, 1 );
+ mpLbOutPos->Clear();
+ mpLbOutPos->InsertEntry( maStrUndefined, 0 );
+ mpLbOutPos->InsertEntry( maStrNewTable, 1 );
@@ -227,3 +238,3 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
{
- sal_uInt16 nInsert = maLbOutPos.InsertEntry( aName );
+ sal_uInt16 nInsert = mpLbOutPos->InsertEntry( aName );
@@ -231,3 +242,3 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
maRefStrs.push_back(new OUString(aRefStr));
- maLbOutPos.SetEntryData(nInsert, &maRefStrs.back());
+ mpLbOutPos->SetEntryData(nInsert, &maRefStrs.back());
}
@@ -239,5 +250,5 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
// Output to a new sheet by default for a brand-new output.
- maLbOutPos.SelectEntryPos(1);
- maEdOutPos.Disable();
- maRbOutPos.Disable();
+ mpLbOutPos->SelectEntryPos(1);
+ mpEdOutPos->Disable();
+ mpRbOutPos->Disable();
}
@@ -253,3 +264,3 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
maPivotData.nTab ).Format(STD_FORMAT, mpDoc, mpDoc->GetAddressConvention());
- maEdOutPos.SetText( aStr );
+ mpEdOutPos->SetText( aStr );
maOutputRefStr = aStr;
@@ -259,3 +270,3 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
{
- maLbOutPos.SelectEntryPos( maLbOutPos.GetEntryCount()-1 );
+ mpLbOutPos->SelectEntryPos( mpLbOutPos->GetEntryCount()-1 );
SelAreaHdl(NULL);
@@ -264,14 +275,12 @@ ScPivotLayoutDlg::ScPivotLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window
- maBtnIgnEmptyRows.Check( maPivotData.bIgnoreEmptyRows );
- maBtnDetectCat .Check( maPivotData.bDetectCategories );
- maBtnTotalCol .Check( maPivotData.bMakeTotalCol );
- maBtnTotalRow .Check( maPivotData.bMakeTotalRow );
+ mpBtnIgnEmptyRows->Check( maPivotData.bIgnoreEmptyRows );
+ mpBtnDetectCat->Check( maPivotData.bDetectCategories );
+ mpBtnTotalCol->Check( maPivotData.bMakeTotalCol );
+ mpBtnTotalRow->Check( maPivotData.bMakeTotalRow );
const ScDPSaveData* pSaveData = mxDlgDPObject->GetSaveData();
- maBtnFilter.Check( !pSaveData || pSaveData->GetFilterButton() );
- maBtnDrillDown.Check( !pSaveData || pSaveData->GetDrillDown() );
-
- GrabFieldFocus( maWndSelect );
+ mpBtnFilter->Check( !pSaveData || pSaveData->GetFilterButton() );
+ mpBtnDrillDown->Check( !pSaveData || pSaveData->GetDrillDown() );
- FreeResource();
+ GrabFieldFocus( mpWndSelect );
}
@@ -304,7 +313,7 @@ void ScPivotLayoutDlg::InitWndSelect(const ScDPLabelDataVector& rLabels)
ScPivotFuncData aFunc(maLabelData[i].mnCol, maLabelData[i].mnFuncMask);
- maWndSelect.AppendField(maLabelData[i].getDisplayName(), aFunc);
+ mpWndSelect->AppendField(maLabelData[i].getDisplayName(), aFunc);
}
}
- maWndSelect.ResetScrollBar();
- maWndSelect.Paint(Rectangle());
+ mpWndSelect->ResetScrollBar();
+ mpWndSelect->Paint(Rectangle());
}
@@ -334,3 +343,3 @@ void ScPivotLayoutDlg::InitWndData(const vector<ScPivotField>& rFields)
- maWndData.AppendField(aStr, aFunc);
+ mpWndData->AppendField(aStr, aFunc);
pData->mnFuncMask = nMask;
@@ -338,3 +347,3 @@ void ScPivotLayoutDlg::InitWndData(const vector<ScPivotField>& rFields)
}
- maWndData.ResetScrollBar();
+ mpWndData->ResetScrollBar();
}
@@ -372,13 +381,13 @@ void ScPivotLayoutDlg::InitFieldWindows()
-void ScPivotLayoutDlg::GrabFieldFocus( ScDPFieldControlBase& rFieldWindow )
+void ScPivotLayoutDlg::GrabFieldFocus( ScDPFieldControlBase* rFieldWindow )
{
- if( rFieldWindow.IsEmpty() )
+ if( rFieldWindow->IsEmpty() )
{
- if( maWndSelect.IsEmpty() )
- maBtnOk.GrabFocus();
+ if( mpWndSelect->IsEmpty() )
+ mpBtnOk->GrabFocus();
else
- maWndSelect.GrabFocus();
+ mpWndSelect->GrabFocus();
}
else
- rFieldWindow.GrabFocus();
+ rFieldWindow->GrabFocus();
}
@@ -387,3 +396,3 @@ void ScPivotLayoutDlg::AddField( size_t nFromIndex, ScPivotFieldType eToType, co
{
- ScPivotFuncData aFunc = maWndSelect.GetFuncData(nFromIndex); // local copy
+ ScPivotFuncData aFunc = mpWndSelect->GetFuncData(nFromIndex); // local copy
@@ -446,3 +455,3 @@ void ScPivotLayoutDlg::AppendField(size_t nFromIndex, ScPivotFieldType eToType)
{
- ScPivotFuncData aFunc = maWndSelect.GetFuncData(nFromIndex); // local copy
+ ScPivotFuncData aFunc = mpWndSelect->GetFuncData(nFromIndex); // local copy
@@ -709,3 +718,3 @@ void ScPivotLayoutDlg::RemoveField( ScPivotFieldType eFromType, size_t nIndex )
if (pWnd->IsEmpty())
- GrabFieldFocus(maWndSelect);
+ GrabFieldFocus(mpWndSelect);
}
@@ -765,3 +774,3 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI
vector<ScDPFieldControlBase::FuncItem> aFuncItems;
- maWndData.GetAllFuncItems(aFuncItems);
+ mpWndData->GetAllFuncItems(aFuncItems);
vector<ScDPFieldControlBase::FuncItem>::const_iterator it = aFuncItems.begin(), itEnd = aFuncItems.end();
@@ -805,3 +814,3 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI
{
- ScPivotFuncData& rFuncData = maWndData.GetFuncData(nFieldIndex);
+ ScPivotFuncData& rFuncData = mpWndData->GetFuncData(nFieldIndex);
boost::scoped_ptr<AbstractScDPFunctionDlg> pDlg(
@@ -818,3 +827,3 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI
// Get the new duplicate count since the function has changed.
- rFuncData.mnDupCount = maWndData.GetNextDupCount(rFuncData, nFieldIndex);
+ rFuncData.mnDupCount = mpWndData->GetNextDupCount(rFuncData, nFieldIndex);
@@ -828,3 +837,3 @@ void ScPivotLayoutDlg::NotifyDoubleClick( ScPivotFieldType eType, size_t nFieldI
}
- maWndData.SetFieldText(aStr, nFieldIndex, rFuncData.mnDupCount);
+ mpWndData->SetFieldText(aStr, nFieldIndex, rFuncData.mnDupCount);
}
@@ -854,4 +863,4 @@ void ScPivotLayoutDlg::NotifyFieldFocus( ScPivotFieldType eType, bool bGotFocus
- maBtnRemove.Enable( bEnable );
- maBtnOptions.Enable( bEnable );
+ mpBtnRemove->Enable( bEnable );
+ mpBtnOptions->Enable( bEnable );
if( bGotFocus )
@@ -873,6 +882,6 @@ void ScPivotLayoutDlg::NotifyMoveFieldToEnd( ScPivotFieldType eToType )
if( meLastActiveType == PIVOTFIELDTYPE_SELECT )
- maWndSelect.SelectNext();
+ mpWndSelect->SelectNext();
}
else
- GrabFieldFocus( maWndSelect );
+ GrabFieldFocus( mpWndSelect );
}
@@ -889,3 +898,3 @@ Size ScPivotLayoutDlg::GetStdFieldBtnSize() const
// is calculated relative to the size of the OK button.
- double w = static_cast<double>(maBtnOk.GetSizePixel().Width()) * 0.70;
+ double w = static_cast<double>(mpBtnOk->GetSizePixel().Width()) * 0.70;
return Size(static_cast<long>(w), FIELD_BTN_HEIGHT);
@@ -1089,21 +1098,21 @@ void ScPivotLayoutDlg::InitControlAndDlgSizes()
- maWndData.SetSizePixel(
- Size(maWndSelect.GetPosPixel().X() - maWndData.GetPosPixel().X() - FIELD_AREA_GAP*4,
+ mpWndData->SetSizePixel(
+ Size(mpWndSelect->GetPosPixel().X() - mpWndData->GetPosPixel().X() - FIELD_AREA_GAP*4,
185));
- maWndPage.SetSizePixel(
- Size(maWndData.GetSizePixel().Width() + 85,
- maWndCol.GetPosPixel().Y() - maWndPage.GetPosPixel().Y() - FIELD_AREA_GAP));
- maWndRow.SetSizePixel(
- Size(maWndData.GetPosPixel().X()-maWndRow.GetPosPixel().X() - FIELD_AREA_GAP,
- maWndData.GetSizePixel().Height()));
- maWndCol.SetSizePixel(
- Size(maWndData.GetPosPixel().X() - maWndCol.GetPosPixel().X() + maWndData.GetSizePixel().Width(),
- maWndData.GetPosPixel().Y() - maWndCol.GetPosPixel().Y() - FIELD_AREA_GAP));
+ mpWndPage->SetSizePixel(
+ Size(mpWndData->GetSizePixel().Width() + 85,
+ mpWndCol->GetPosPixel().Y() - mpWndPage->GetPosPixel().Y() - FIELD_AREA_GAP));
+ mpWndRow->SetSizePixel(
+ Size(mpWndData->GetPosPixel().X()-mpWndRow->GetPosPixel().X() - FIELD_AREA_GAP,
+ mpWndData->GetSizePixel().Height()));
+ mpWndCol->SetSizePixel(
+ Size(mpWndData->GetPosPixel().X() - mpWndCol->GetPosPixel().X() + mpWndData->GetSizePixel().Width(),
+ mpWndData->GetPosPixel().Y() - mpWndCol->GetPosPixel().Y() - FIELD_AREA_GAP));
// #i29203# align right border of page window with data window
- long nDataPosX = maWndData.GetPosPixel().X() + maWndData.GetSizePixel().Width();
- maWndPage.SetPosPixel(
- Point(nDataPosX - maWndPage.GetSizePixel().Width(),
- maWndPage.GetPosPixel().Y()));
+ long nDataPosX = mpWndData->GetPosPixel().X() + mpWndData->GetSizePixel().Width();
+ mpWndPage->SetPosPixel(
+ Point(nDataPosX - mpWndPage->GetSizePixel().Width(),
+ mpWndPage->GetPosPixel().Y()));
@@ -1114,10 +1123,10 @@ void ScPivotLayoutDlg::InitControlAndDlgSizes()
nH += GetSettings().GetStyleSettings().GetScrollBarSize() + OUTER_MARGIN_VER;
- maWndSelect.SetSizePixel(
+ mpWndSelect->SetSizePixel(
Size(2 * nFldW + ROW_FIELD_BTN_GAP + 10, nH));
- maWndPage.CalcSize();
- maWndRow.CalcSize();
- maWndCol.CalcSize();
- maWndData.CalcSize();
- maWndSelect.CalcSize();
+ mpWndPage->CalcSize();
+ mpWndRow->CalcSize();
+ mpWndCol->CalcSize();
+ mpWndData->CalcSize();
+ mpWndSelect->CalcSize();
@@ -1150,5 +1159,5 @@ void ScPivotLayoutDlg::AdjustDlgSize()
- Point aPosText = maFtInfo.GetPosPixel();
- Size aSizeText = maFtInfo.GetSizePixel();
- long nYRef = maWndData.GetPosPixel().Y() + maWndData.GetSizePixel().Height();
+ Point aPosText = mpFtInfo->GetPosPixel();
+ Size aSizeText = mpFtInfo->GetSizePixel();
+ long nYRef = mpWndData->GetPosPixel().Y() + mpWndData->GetSizePixel().Height();
if (aPosText.Y() > nYRef)
@@ -1172,18 +1181,17 @@ void ScPivotLayoutDlg::AdjustDlgSize()
aWndToMove.reserve(16);
- aWndToMove.push_back(&maFtInfo);
- aWndToMove.push_back(&maBtnMore);
- aWndToMove.push_back(&maFlAreas);
- aWndToMove.push_back(&maFtInArea);
- aWndToMove.push_back(&maEdInPos);
- aWndToMove.push_back(&maRbInPos);
- aWndToMove.push_back(&maFtOutArea);
- aWndToMove.push_back(&maLbOutPos);
- aWndToMove.push_back(&maEdOutPos);
- aWndToMove.push_back(&maRbOutPos);
- aWndToMove.push_back(&maBtnIgnEmptyRows);
- aWndToMove.push_back(&maBtnDetectCat);
- aWndToMove.push_back(&maBtnTotalCol);
- aWndToMove.push_back(&maBtnTotalRow);
- aWndToMove.push_back(&maBtnFilter);
- aWndToMove.push_back(&maBtnDrillDown);
+ aWndToMove.push_back(mpFtInfo);
+ //aWndToMove.push_back(mpBtnMore);
+ aWndToMove.push_back(mpFtInArea);
+ aWndToMove.push_back(mpEdInPos);
+ aWndToMove.push_back(mpRbInPos);
+ aWndToMove.push_back(mpFtOutArea);
+ aWndToMove.push_back(mpLbOutPos);
+ aWndToMove.push_back(mpEdOutPos);
+ aWndToMove.push_back(mpRbOutPos);
+ aWndToMove.push_back(mpBtnIgnEmptyRows);
+ aWndToMove.push_back(mpBtnDetectCat);
+ aWndToMove.push_back(mpBtnTotalCol);
+ aWndToMove.push_back(mpBtnTotalRow);
+ aWndToMove.push_back(mpBtnFilter);
+ aWndToMove.push_back(mpBtnDrillDown);
std::for_each(aWndToMove.begin(), aWndToMove.end(), MoveWndDown(nDelta));
@@ -1196,12 +1204,12 @@ bool ScPivotLayoutDlg::GetPivotArrays(
vector<ScPivotField> aPageFields;
- maWndPage.ConvertToPivotArray(aPageFields);
+ mpWndPage->ConvertToPivotArray(aPageFields);
vector<ScPivotField> aColFields;
- maWndCol.ConvertToPivotArray(aColFields);
+ mpWndCol->ConvertToPivotArray(aColFields);
vector<ScPivotField> aRowFields;
- maWndRow.ConvertToPivotArray(aRowFields);
+ mpWndRow->ConvertToPivotArray(aRowFields);
vector<ScPivotField> aDataFields;
- maWndData.ConvertToPivotArray(aDataFields);
+ mpWndData->ConvertToPivotArray(aDataFields);
@@ -1236,3 +1244,3 @@ void ScPivotLayoutDlg::UpdateSrcRange()
{
- OUString aSrcStr = maEdInPos.GetText();
+ OUString aSrcStr = mpEdInPos->GetText();
sal_uInt16 nResult = ScRange().Parse(aSrcStr, mpDoc, mpDoc->GetAddressConvention());
@@ -1248,3 +1256,3 @@ void ScPivotLayoutDlg::UpdateSrcRange()
aNewRange.aEnd = end.GetAddress();
- maEdInPos.SetRefValid(true);
+ mpEdInPos->SetRefValid(true);
eSrcType = SRC_REF;
@@ -1267,3 +1275,3 @@ void ScPivotLayoutDlg::UpdateSrcRange()
- maEdInPos.SetRefValid(bValid);
+ mpEdInPos->SetRefValid(bValid);
if (!bValid)
@@ -1271,3 +1279,3 @@ void ScPivotLayoutDlg::UpdateSrcRange()
// All attempts have failed. Give up.
- maBtnOk.Disable();
+ mpBtnOk->Disable();
return;
@@ -1278,3 +1286,3 @@ void ScPivotLayoutDlg::UpdateSrcRange()
- maBtnOk.Enable();
+ mpBtnOk->Enable();
@@ -1299,4 +1307,4 @@ void ScPivotLayoutDlg::UpdateSrcRange()
// for error.
- maEdInPos.SetRefValid(false);
- maBtnOk.Disable();
+ mpEdInPos->SetRefValid(false);
+ mpBtnOk->Disable();
return;
@@ -1319,7 +1327,7 @@ void ScPivotLayoutDlg::UpdateSrcRange()
maLabelData.clear();
- maWndSelect.ClearFields();
- maWndData.ClearFields();
- maWndRow.ClearFields();
- maWndCol.ClearFields();
- maWndPage.ClearFields();
+ mpWndSelect->ClearFields();
+ mpWndData->ClearFields();
+ mpWndRow->ClearFields();
+ mpWndCol->ClearFields();
+ mpWndPage->ClearFields();
@@ -1331,4 +1339,4 @@ void ScPivotLayoutDlg::UpdateOutputPos()
{
- sal_uInt16 nSelPos = maLbOutPos.GetSelectEntryPos();
- OUString aEntryStr = maLbOutPos.GetEntry(nSelPos);
+ sal_uInt16 nSelPos = mpLbOutPos->GetSelectEntryPos();
+ OUString aEntryStr = mpLbOutPos->GetEntry(nSelPos);
@@ -1337,5 +1345,5 @@ void ScPivotLayoutDlg::UpdateOutputPos()
// New sheet as output.
- maEdOutPos.Disable();
- maRbOutPos.Disable();
- maEdOutPos.SetText(OUString()); // Clear the reference text.
+ mpEdOutPos->Disable();
+ mpRbOutPos->Disable();
+ mpEdOutPos->SetText(OUString()); // Clear the reference text.
}
@@ -1343,5 +1351,5 @@ void ScPivotLayoutDlg::UpdateOutputPos()
{
- maEdOutPos.Enable();
- maRbOutPos.Enable();
- maEdOutPos.SetText(maOutputRefStr);
+ mpEdOutPos->Enable();
+ mpRbOutPos->Enable();
+ mpEdOutPos->SetText(maOutputRefStr);
OutputPosUpdated();
@@ -1351,5 +1359,5 @@ void ScPivotLayoutDlg::UpdateOutputPos()
// Named range as output. Get its corresponding reference string.
- const OUString* p = (const OUString*)maLbOutPos.GetEntryData(nSelPos);
+ const OUString* p = (const OUString*)mpLbOutPos->GetEntryData(nSelPos);
if (p)
- maEdOutPos.SetText(*p);
+ mpEdOutPos->SetText(*p);
}
@@ -1359,3 +1367,3 @@ void ScPivotLayoutDlg::OutputPosUpdated()
{
- OUString aOutPosStr = maEdOutPos.GetText();
+ OUString aOutPosStr = mpEdOutPos->GetText();
sal_uInt16 nResult = ScAddress().Parse(aOutPosStr, mpDoc, mpDoc->GetAddressConvention());
@@ -1365,3 +1373,3 @@ void ScPivotLayoutDlg::OutputPosUpdated()
// Not a valid reference.
- maEdOutPos.SetRefValid(false);
+ mpEdOutPos->SetRefValid(false);
return;
@@ -1369,3 +1377,3 @@ void ScPivotLayoutDlg::OutputPosUpdated()
- maEdOutPos.SetRefValid(true);
+ mpEdOutPos->SetRefValid(true);
@@ -1377,3 +1385,3 @@ void ScPivotLayoutDlg::OutputPosUpdated()
// This is NOT one of the named ranges.
- maLbOutPos.SelectEntryPos(0);
+ mpLbOutPos->SelectEntryPos(0);
return;
@@ -1385,3 +1393,3 @@ void ScPivotLayoutDlg::OutputPosUpdated()
size_t nPos = std::distance(itBeg, it);
- maLbOutPos.SelectEntryPos(nPos+2);
+ mpLbOutPos->SelectEntryPos(nPos+2);
}
@@ -1399,9 +1407,9 @@ void EnableAndGrabFocus(formula::RefEdit& rEdit)
-void ScPivotLayoutDlg::MoreBtnClicked()
+void ScPivotLayoutDlg::ExpanderClicked()
{
- mbRefInputMode = maBtnMore.GetState();
- if (!maBtnMore.GetState())
+ mbRefInputMode = mpExpander->get_expanded();
+ if (!mpExpander->get_expanded())
return;
- formula::RefEdit* p = maEdInPos.IsEnabled() ? &maEdInPos : &maEdOutPos;
+ formula::RefEdit* p = mpEdInPos->IsEnabled() ? mpEdInPos : mpEdOutPos;
EnableAndGrabFocus(*p);
@@ -1412,6 +1420,6 @@ void ScPivotLayoutDlg::RepaintFieldWindows()
Rectangle aRect; // currently has no effect whatsoever.
- maWndPage.Paint(aRect);
- maWndCol.Paint(aRect);
- maWndRow.Paint(aRect);
- maWndData.Paint(aRect);
+ mpWndPage->Paint(aRect);
+ mpWndCol->Paint(aRect);
+ mpWndRow->Paint(aRect);
+ mpWndData->Paint(aRect);
}
@@ -1423,11 +1431,11 @@ ScDPFieldControlBase* ScPivotLayoutDlg::GetFieldWindow(ScPivotFieldType eType)
case PIVOTFIELDTYPE_PAGE:
- return &maWndPage;
+ return mpWndPage;
case PIVOTFIELDTYPE_COL:
- return &maWndCol;
+ return mpWndCol;
case PIVOTFIELDTYPE_ROW:
- return &maWndRow;
+ return mpWndRow;
case PIVOTFIELDTYPE_DATA:
- return &maWndData;
+ return mpWndData;
case PIVOTFIELDTYPE_SELECT:
- return &maWndSelect;
+ return mpWndSelect;
default:
@@ -1445,12 +1453,12 @@ void ScPivotLayoutDlg::GetOtherFieldWindows(ScPivotFieldType eType, ScDPFieldCon
case PIVOTFIELDTYPE_PAGE:
- rpWnd1 = &maWndRow;
- rpWnd2 = &maWndCol;
+ rpWnd1 = mpWndRow;
+ rpWnd2 = mpWndCol;
break;
case PIVOTFIELDTYPE_COL:
- rpWnd1 = &maWndPage;
- rpWnd2 = &maWndRow;
+ rpWnd1 = mpWndPage;
+ rpWnd2 = mpWndRow;
break;
case PIVOTFIELDTYPE_ROW:
- rpWnd1 = &maWndPage;
- rpWnd2 = &maWndCol;
+ rpWnd1 = mpWndPage;
+ rpWnd2 = mpWndCol;
break;
@@ -1469,3 +1477,3 @@ void ScPivotLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDoc )
- if (mpRefInputEdit == &maEdInPos)
+ if (mpRefInputEdit == mpEdInPos)
{
@@ -1474,3 +1482,3 @@ void ScPivotLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDoc )
}
- else if (mpRefInputEdit == &maEdOutPos)
+ else if (mpRefInputEdit == mpEdOutPos)
{
@@ -1495,5 +1503,5 @@ void ScPivotLayoutDlg::SetActive()
- if (mpRefInputEdit == &maEdInPos)
+ if (mpRefInputEdit == mpEdInPos)
EdInModifyHdl( NULL );
- else if (mpRefInputEdit == &maEdOutPos)
+ else if (mpRefInputEdit == mpEdOutPos)
EdOutModifyHdl( NULL );
@@ -1514,3 +1522,3 @@ IMPL_LINK( ScPivotLayoutDlg, ClickHdl, PushButton *, pBtn )
- if( pBtn == &maBtnRemove )
+ if( pBtn == mpBtnRemove )
{
@@ -1519,3 +1527,3 @@ IMPL_LINK( ScPivotLayoutDlg, ClickHdl, PushButton *, pBtn )
}
- else if( pBtn == &maBtnOptions )
+ else if( pBtn == mpBtnOptions )
{
@@ -1529,5 +1537,5 @@ IMPL_LINK_NOARG(ScPivotLayoutDlg, OkHdl)
{
- OUString aOutPosStr = maEdOutPos.GetText();
+ OUString aOutPosStr = mpEdOutPos->GetText();
ScAddress aAdrDest;
- bool bToNewTable = (maLbOutPos.GetSelectEntryPos() == 1);
+ bool bToNewTable = (mpLbOutPos->GetSelectEntryPos() == 1);
sal_uInt16 nResult = !bToNewTable ? aAdrDest.Parse( aOutPosStr, mpDoc, mpDoc->GetAddressConvention() ) : 0;
@@ -1537,7 +1545,7 @@ IMPL_LINK_NOARG(ScPivotLayoutDlg, OkHdl)
// Invalid reference. Bail out.
- if ( !maBtnMore.GetState() )
- maBtnMore.SetState(true);
+ if ( !mpExpander->get_expanded() )
+ mpExpander->set_expanded(true);
ErrorBox(this, WinBits(WB_OK | WB_DEF_OK), ScGlobal::GetRscString(STR_INVALID_TABREF)).Execute();
- maEdOutPos.GrabFocus();
+ mpEdOutPos->GrabFocus();
return 0;
@@ -1566,8 +1574,8 @@ IMPL_LINK_NOARG(ScPivotLayoutDlg, OkHdl)
ScDPSaveData aSaveData;
- aSaveData.SetIgnoreEmptyRows( maBtnIgnEmptyRows.IsChecked() );
- aSaveData.SetRepeatIfEmpty( maBtnDetectCat.IsChecked() );
- aSaveData.SetColumnGrand( maBtnTotalCol.IsChecked() );
- aSaveData.SetRowGrand( maBtnTotalRow.IsChecked() );
- aSaveData.SetFilterButton( maBtnFilter.IsChecked() );
- aSaveData.SetDrillDown( maBtnDrillDown.IsChecked() );
+ aSaveData.SetIgnoreEmptyRows( mpBtnIgnEmptyRows->IsChecked() );
+ aSaveData.SetRepeatIfEmpty( mpBtnDetectCat->IsChecked() );
+ aSaveData.SetColumnGrand( mpBtnTotalCol->IsChecked() );
+ aSaveData.SetRowGrand( mpBtnTotalRow->IsChecked() );
+ aSaveData.SetFilterButton( mpBtnFilter->IsChecked() );
+ aSaveData.SetDrillDown( mpBtnDrillDown->IsChecked() );
@@ -1693,5 +1701,5 @@ IMPL_LINK_NOARG(ScPivotLayoutDlg, CancelHdl)
-IMPL_LINK_NOARG(ScPivotLayoutDlg, MoreClickHdl)
+IMPL_LINK_NOARG(ScPivotLayoutDlg, ExpandHdl)
{
- MoreBtnClicked();
+ ExpanderClicked();
return 0;