Lines 41-46
Link Here
|
41 |
//---------------------------------------------------------------------------- |
41 |
//---------------------------------------------------------------------------- |
42 |
|
42 |
|
43 |
#include "pvlaydlg.hxx" |
43 |
#include "pvlaydlg.hxx" |
|
|
44 |
#include "dbdocfun.hxx" |
44 |
|
45 |
|
45 |
#include <sfx2/dispatch.hxx> |
46 |
#include <sfx2/dispatch.hxx> |
46 |
#include <vcl/msgbox.hxx> |
47 |
#include <vcl/msgbox.hxx> |
Lines 61-66
Link Here
|
61 |
#include "pivot.hrc" |
62 |
#include "pivot.hrc" |
62 |
#include "dpobject.hxx" |
63 |
#include "dpobject.hxx" |
63 |
#include "dpsave.hxx" |
64 |
#include "dpsave.hxx" |
|
|
65 |
#include "dpshttab.hxx" |
64 |
#include "scmod.hxx" |
66 |
#include "scmod.hxx" |
65 |
|
67 |
|
66 |
#include "sc.hrc" //CHINA001 |
68 |
#include "sc.hrc" //CHINA001 |
Lines 125-130
ScDPLayoutDlg::ScDPLayoutDlg( SfxBinding
Link Here
|
125 |
aFtInfo ( this, ScResId( FT_INFO ) ), |
127 |
aFtInfo ( this, ScResId( FT_INFO ) ), |
126 |
|
128 |
|
127 |
aFlAreas ( this, ScResId( FL_OUTPUT ) ), |
129 |
aFlAreas ( this, ScResId( FL_OUTPUT ) ), |
|
|
130 |
|
131 |
aFtInArea ( this, ScResId( FT_INAREA) ), |
132 |
aEdInPos ( this, ScResId( ED_INAREA) ), |
133 |
aRbInPos ( this, ScResId( RB_INAREA ), &aEdInPos ), |
134 |
|
128 |
aLbOutPos ( this, ScResId( LB_OUTAREA ) ), |
135 |
aLbOutPos ( this, ScResId( LB_OUTAREA ) ), |
129 |
aFtOutArea ( this, ScResId( FT_OUTAREA ) ), |
136 |
aFtOutArea ( this, ScResId( FT_OUTAREA ) ), |
130 |
aEdOutPos ( this, ScResId( ED_OUTAREA ) ), |
137 |
aEdOutPos ( this, ScResId( ED_OUTAREA ) ), |
Lines 148-153
ScDPLayoutDlg::ScDPLayoutDlg( SfxBinding
Link Here
|
148 |
|
155 |
|
149 |
bIsDrag ( FALSE ), |
156 |
bIsDrag ( FALSE ), |
150 |
|
157 |
|
|
|
158 |
pEditActive ( NULL ), |
159 |
|
151 |
eLastActiveType ( TYPE_SELECT ), |
160 |
eLastActiveType ( TYPE_SELECT ), |
152 |
nOffset ( 0 ), |
161 |
nOffset ( 0 ), |
153 |
// |
162 |
// |
Lines 209-214
void __EXPORT ScDPLayoutDlg::Init()
Link Here
|
209 |
for ( USHORT i = 0; i < FUNC_COUNT; ++i ) |
218 |
for ( USHORT i = 0; i < FUNC_COUNT; ++i ) |
210 |
aFuncNameArr.push_back( String( ScResId( i + 1 ) ) ); |
219 |
aFuncNameArr.push_back( String( ScResId( i + 1 ) ) ); |
211 |
|
220 |
|
|
|
221 |
aBtnMore.AddWindow( &aFlAreas ); |
222 |
aBtnMore.AddWindow( &aFtInArea ); |
223 |
aBtnMore.AddWindow( &aEdInPos ); |
224 |
aBtnMore.AddWindow( &aRbInPos ); |
212 |
aBtnMore.AddWindow( &aFtOutArea ); |
225 |
aBtnMore.AddWindow( &aFtOutArea ); |
213 |
aBtnMore.AddWindow( &aLbOutPos ); |
226 |
aBtnMore.AddWindow( &aLbOutPos ); |
214 |
aBtnMore.AddWindow( &aEdOutPos ); |
227 |
aBtnMore.AddWindow( &aEdOutPos ); |
Lines 219-225
void __EXPORT ScDPLayoutDlg::Init()
Link Here
|
219 |
aBtnMore.AddWindow( &aBtnTotalRow ); |
232 |
aBtnMore.AddWindow( &aBtnTotalRow ); |
220 |
aBtnMore.AddWindow( &aBtnFilter ); |
233 |
aBtnMore.AddWindow( &aBtnFilter ); |
221 |
aBtnMore.AddWindow( &aBtnDrillDown ); |
234 |
aBtnMore.AddWindow( &aBtnDrillDown ); |
222 |
aBtnMore.AddWindow( &aFlAreas ); |
|
|
223 |
aBtnMore.SetClickHdl( LINK( this, ScDPLayoutDlg, MoreClickHdl ) ); |
235 |
aBtnMore.SetClickHdl( LINK( this, ScDPLayoutDlg, MoreClickHdl ) ); |
224 |
|
236 |
|
225 |
{ |
237 |
{ |
Lines 237-242
void __EXPORT ScDPLayoutDlg::Init()
Link Here
|
237 |
aRowArr.resize( MAX_FIELDS ); |
249 |
aRowArr.resize( MAX_FIELDS ); |
238 |
aDataArr.resize( MAX_FIELDS ); |
250 |
aDataArr.resize( MAX_FIELDS ); |
239 |
|
251 |
|
|
|
252 |
ScRange inRange; |
253 |
String inString; |
254 |
if (xDlgDPObject->GetSheetDesc()) |
255 |
{ |
256 |
aEdInPos.Enable(); |
257 |
aRbInPos.Enable(); |
258 |
inRange = xDlgDPObject->GetSheetDesc()->aSourceRange; |
259 |
inRange.Format( inString, STD_FORMAT, pDoc); |
260 |
aEdInPos.SetText(inString); |
261 |
} |
262 |
else |
263 |
{ |
264 |
/* Data is not reachable, so could be a remote database */ |
265 |
aEdInPos.Disable(); |
266 |
aRbInPos.Disable(); |
267 |
} |
268 |
|
240 |
InitWndSelect( thePivotData.ppLabelArr, static_cast<long>(thePivotData.nLabels) ); |
269 |
InitWndSelect( thePivotData.ppLabelArr, static_cast<long>(thePivotData.nLabels) ); |
241 |
InitWnd( thePivotData.aPageArr, static_cast<long>(thePivotData.nPageCount), TYPE_PAGE ); |
270 |
InitWnd( thePivotData.aPageArr, static_cast<long>(thePivotData.nPageCount), TYPE_PAGE ); |
242 |
InitWnd( thePivotData.aColArr, static_cast<long>(thePivotData.nColCount), TYPE_COL ); |
271 |
InitWnd( thePivotData.aColArr, static_cast<long>(thePivotData.nColCount), TYPE_COL ); |
Lines 260-267
void __EXPORT ScDPLayoutDlg::Init()
Link Here
|
260 |
|
289 |
|
261 |
aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) ); |
290 |
aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) ); |
262 |
aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) ); |
291 |
aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) ); |
|
|
292 |
aEdInPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdInModifyHdl ) ); |
263 |
aBtnOk .SetClickHdl ( LINK( this, ScDPLayoutDlg, OkHdl ) ); |
293 |
aBtnOk .SetClickHdl ( LINK( this, ScDPLayoutDlg, OkHdl ) ); |
264 |
aBtnCancel.SetClickHdl ( LINK( this, ScDPLayoutDlg, CancelHdl ) ); |
294 |
aBtnCancel.SetClickHdl ( LINK( this, ScDPLayoutDlg, CancelHdl ) ); |
|
|
295 |
Link aLink = LINK( this, ScDPLayoutDlg, GetFocusHdl ); |
296 |
if ( aEdInPos.IsEnabled() ) |
297 |
// Once disabled it will never get enabled, so no need to handle focus. |
298 |
aEdInPos.SetGetFocusHdl( aLink ); |
299 |
aEdOutPos.SetGetFocusHdl( aLink ); |
265 |
|
300 |
|
266 |
if ( pViewData && pDoc ) |
301 |
if ( pViewData && pDoc ) |
267 |
{ |
302 |
{ |
Lines 1314-1336
BOOL ScDPLayoutDlg::GetPivotArrays( P
Link Here
|
1314 |
return bFit; |
1349 |
return bFit; |
1315 |
} |
1350 |
} |
1316 |
|
1351 |
|
|
|
1352 |
bool ScDPLayoutDlg::UpdateSrcRange() |
1353 |
{ |
1354 |
String theCurPosStr = aEdInPos.GetText(); |
1355 |
USHORT nResult = ScRange().Parse(theCurPosStr, pDoc); |
1356 |
|
1357 |
if ( SCA_VALID != (nResult & SCA_VALID) ) |
1358 |
// invalid source range. |
1359 |
return false; |
1360 |
|
1361 |
ScRefAddress start, end; |
1362 |
ConvertDoubleRef(pDoc, theCurPosStr, 1, start, end); |
1363 |
ScRange aNewRange(start.GetAddress(), end.GetAddress()); |
1364 |
ScSheetSourceDesc inSheet = *xDlgDPObject->GetSheetDesc(); |
1365 |
|
1366 |
if (inSheet.aSourceRange == aNewRange) |
1367 |
// new range is identical to the current range. Nothing to do. |
1368 |
return true; |
1369 |
|
1370 |
ScTabViewShell * pTabViewShell = pViewData->GetViewShell(); |
1371 |
inSheet.aSourceRange = aNewRange; |
1372 |
xDlgDPObject->SetSheetDesc(inSheet); |
1373 |
xDlgDPObject->InvalidateSource(); |
1374 |
xDlgDPObject->Output(); |
1375 |
xDlgDPObject->SetAlive(true); // needed to get structure information |
1376 |
xDlgDPObject->FillOldParam(thePivotData, true); |
1377 |
xDlgDPObject->FillLabelData(thePivotData); |
1378 |
|
1379 |
pTabViewShell->SetDialogDPObject(xDlgDPObject.get()); |
1380 |
aLabelDataArr.clear(); |
1381 |
aWndSelect.ClearFields(); |
1382 |
aWndData.ClearFields(); |
1383 |
aWndRow.ClearFields(); |
1384 |
aWndCol.ClearFields(); |
1385 |
aWndPage.ClearFields(); |
1386 |
|
1387 |
return true; |
1388 |
} |
1317 |
|
1389 |
|
1318 |
//---------------------------------------------------------------------------- |
1390 |
//---------------------------------------------------------------------------- |
1319 |
|
1391 |
|
1320 |
void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) |
1392 |
void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) |
1321 |
{ |
1393 |
{ |
1322 |
if ( bRefInputMode ) |
1394 |
if ( !bRefInputMode || !pEditActive ) |
1323 |
{ |
1395 |
return; |
1324 |
if ( rRef.aStart != rRef.aEnd ) |
1396 |
|
1325 |
RefInputStart( &aEdOutPos ); |
1397 |
if ( rRef.aStart != rRef.aEnd ) |
1326 |
/* |
1398 |
RefInputStart( pEditActive ); |
1327 |
ScAddress aAdr( nStartCol, nStartRow, nStartTab ); |
1399 |
|
1328 |
aAdr.PutInOrder( ScAddress( nEndCol, nEndRow, nEndTab ) ); |
1400 |
if ( pEditActive == &aEdInPos ) |
1329 |
*/ |
1401 |
{ |
1330 |
String aRefStr; |
1402 |
String aRefStr; |
1331 |
rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP ); |
1403 |
rRef.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() ); |
1332 |
aEdOutPos.SetRefString( aRefStr ); |
1404 |
pEditActive->SetRefString( aRefStr ); |
1333 |
} |
1405 |
} |
|
|
1406 |
else if ( pEditActive == &aEdOutPos ) |
1407 |
{ |
1408 |
String aRefStr; |
1409 |
rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() ); |
1410 |
pEditActive->SetRefString( aRefStr ); |
1411 |
} |
1334 |
} |
1412 |
} |
1335 |
|
1413 |
|
1336 |
|
1414 |
|
Lines 1340-1347
void ScDPLayoutDlg::SetActive()
Link Here
|
1340 |
{ |
1418 |
{ |
1341 |
if ( bRefInputMode ) |
1419 |
if ( bRefInputMode ) |
1342 |
{ |
1420 |
{ |
1343 |
aEdOutPos.GrabFocus(); |
1421 |
if ( pEditActive ) |
1344 |
EdModifyHdl( NULL ); |
1422 |
pEditActive->GrabFocus(); |
|
|
1423 |
|
1424 |
if ( pEditActive == &aEdInPos ) |
1425 |
EdInModifyHdl( NULL ); |
1426 |
else if ( pEditActive == &aEdOutPos ) |
1427 |
EdModifyHdl( NULL ); |
1345 |
} |
1428 |
} |
1346 |
else |
1429 |
else |
1347 |
{ |
1430 |
{ |
Lines 1384-1389
IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButto
Link Here
|
1384 |
if ( bToNewTable |
1467 |
if ( bToNewTable |
1385 |
|| ( (aOutPosStr.Len() > 0) && (SCA_VALID == (nResult & SCA_VALID)) ) ) |
1468 |
|| ( (aOutPosStr.Len() > 0) && (SCA_VALID == (nResult & SCA_VALID)) ) ) |
1386 |
{ |
1469 |
{ |
|
|
1470 |
if (!UpdateSrcRange()) |
1471 |
{ |
1472 |
ErrorBox( this, WinBits(WB_OK | WB_DEF_OK), ScGlobal::GetRscString(STR_INVALID_TABREF) ).Execute(); |
1473 |
aEdInPos.GrabFocus(); |
1474 |
return 0; |
1475 |
} |
1387 |
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse |
1476 |
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse |
1388 |
//SFX_APPWINDOW->Enable(); |
1477 |
//SFX_APPWINDOW->Enable(); |
1389 |
|
1478 |
|
Lines 1514-1522
IMPL_LINK( ScDPLayoutDlg, MoreClickHdl,
Link Here
|
1514 |
bRefInputMode = TRUE; |
1603 |
bRefInputMode = TRUE; |
1515 |
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse |
1604 |
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse |
1516 |
//SFX_APPWINDOW->Enable(); |
1605 |
//SFX_APPWINDOW->Enable(); |
1517 |
aEdOutPos.Enable(); |
1606 |
if ( aEdInPos.IsEnabled() ) |
1518 |
aEdOutPos.GrabFocus(); |
1607 |
{ |
1519 |
aRbOutPos.Enable(); |
1608 |
aEdInPos.Enable(); |
|
|
1609 |
aEdInPos.GrabFocus(); |
1610 |
aEdInPos.Enable(); |
1611 |
} |
1612 |
else |
1613 |
{ |
1614 |
aEdOutPos.Enable(); |
1615 |
aEdOutPos.GrabFocus(); |
1616 |
aEdOutPos.Enable(); |
1617 |
} |
1520 |
} |
1618 |
} |
1521 |
else |
1619 |
else |
1522 |
{ |
1620 |
{ |
Lines 1557-1562
IMPL_LINK( ScDPLayoutDlg, EdModifyHdl, E
Link Here
|
1557 |
} |
1655 |
} |
1558 |
|
1656 |
|
1559 |
|
1657 |
|
|
|
1658 |
IMPL_LINK( ScDPLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG ) |
1659 |
{ |
1660 |
return 0; |
1661 |
} |
1662 |
|
1663 |
|
1560 |
//---------------------------------------------------------------------------- |
1664 |
//---------------------------------------------------------------------------- |
1561 |
|
1665 |
|
1562 |
IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG ) |
1666 |
IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG ) |
Lines 1610-1613
IMPL_LINK( ScDPLayoutDlg, ScrollHdl, Scr
Link Here
|
1610 |
return 0; |
1714 |
return 0; |
1611 |
} |
1715 |
} |
1612 |
|
1716 |
|
|
|
1717 |
//---------------------------------------------------------------------------- |
1718 |
|
1719 |
IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl ) |
1720 |
{ |
1721 |
pEditActive = NULL; |
1722 |
if ( pCtrl == &aEdInPos ) |
1723 |
pEditActive = &aEdInPos; |
1724 |
else if ( pCtrl == &aEdOutPos ) |
1725 |
pEditActive = &aEdOutPos; |
1726 |
|
1727 |
return 0; |
1728 |
} |
1613 |
|
1729 |
|