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-267
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 |
|
240 |
InitWndSelect( thePivotData.ppLabelArr, static_cast<long>(thePivotData.nLabels) ); |
252 |
ScRange inRange; |
241 |
InitWnd( thePivotData.aPageArr, static_cast<long>(thePivotData.nPageCount), TYPE_PAGE ); |
253 |
String inString; |
242 |
InitWnd( thePivotData.aColArr, static_cast<long>(thePivotData.nColCount), TYPE_COL ); |
254 |
if (xDlgDPObject->GetSheetDesc()) |
243 |
InitWnd( thePivotData.aRowArr, static_cast<long>(thePivotData.nRowCount), TYPE_ROW ); |
255 |
{ |
244 |
InitWnd( thePivotData.aDataArr, static_cast<long>(thePivotData.nDataCount), TYPE_DATA ); |
256 |
aEdInPos.Enable(); |
245 |
|
257 |
aRbInPos.Enable(); |
246 |
aSlider.SetPageSize( PAGE_SIZE ); |
258 |
aOldRange = xDlgDPObject->GetSheetDesc()->aSourceRange; |
247 |
aSlider.SetVisibleSize( PAGE_SIZE ); |
259 |
aOldRange.Format( inString, STD_FORMAT, pDoc); |
248 |
aSlider.SetLineSize( LINE_SIZE ); |
260 |
aEdInPos.SetText(inString); |
249 |
aSlider.SetRange( Range( 0, static_cast<long>(((thePivotData.nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) ); |
261 |
} |
250 |
|
262 |
else |
251 |
if ( thePivotData.nLabels > PAGE_SIZE ) |
263 |
{ |
252 |
{ |
264 |
/* Data is not reachable, so could be a remote database */ |
253 |
aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) ); |
265 |
aEdInPos.Disable(); |
254 |
aSlider.Show(); |
266 |
aRbInPos.Disable(); |
255 |
} |
267 |
} |
256 |
else |
|
|
257 |
aSlider.Hide(); |
258 |
|
268 |
|
259 |
// Ein-/Ausgabebereiche: ---------------------------------------------- |
269 |
InitFields(); |
260 |
|
270 |
|
261 |
aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) ); |
271 |
aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) ); |
262 |
aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) ); |
272 |
aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) ); |
|
|
273 |
aEdInPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdInModifyHdl ) ); |
263 |
aBtnOk .SetClickHdl ( LINK( this, ScDPLayoutDlg, OkHdl ) ); |
274 |
aBtnOk .SetClickHdl ( LINK( this, ScDPLayoutDlg, OkHdl ) ); |
264 |
aBtnCancel.SetClickHdl ( LINK( this, ScDPLayoutDlg, CancelHdl ) ); |
275 |
aBtnCancel.SetClickHdl ( LINK( this, ScDPLayoutDlg, CancelHdl ) ); |
|
|
276 |
Link aLink = LINK( this, ScDPLayoutDlg, GetFocusHdl ); |
277 |
if ( aEdInPos.IsEnabled() ) |
278 |
// Once disabled it will never get enabled, so no need to handle focus. |
279 |
aEdInPos.SetGetFocusHdl( aLink ); |
280 |
aEdOutPos.SetGetFocusHdl( aLink ); |
265 |
|
281 |
|
266 |
if ( pViewData && pDoc ) |
282 |
if ( pViewData && pDoc ) |
267 |
{ |
283 |
{ |
Lines 480-485
void ScDPLayoutDlg::InitFocus()
Link Here
|
480 |
aWndSelect.GrabFocus(); |
496 |
aWndSelect.GrabFocus(); |
481 |
} |
497 |
} |
482 |
|
498 |
|
|
|
499 |
void ScDPLayoutDlg::InitFields() |
500 |
{ |
501 |
InitWndSelect( thePivotData.ppLabelArr, static_cast<long>(thePivotData.nLabels) ); |
502 |
InitWnd( thePivotData.aPageArr, static_cast<long>(thePivotData.nPageCount), TYPE_PAGE ); |
503 |
InitWnd( thePivotData.aColArr, static_cast<long>(thePivotData.nColCount), TYPE_COL ); |
504 |
InitWnd( thePivotData.aRowArr, static_cast<long>(thePivotData.nRowCount), TYPE_ROW ); |
505 |
InitWnd( thePivotData.aDataArr, static_cast<long>(thePivotData.nDataCount), TYPE_DATA ); |
506 |
|
507 |
aSlider.SetPageSize( PAGE_SIZE ); |
508 |
aSlider.SetVisibleSize( PAGE_SIZE ); |
509 |
aSlider.SetLineSize( LINE_SIZE ); |
510 |
aSlider.SetRange( Range( 0, static_cast<long>(((thePivotData.nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) ); |
511 |
|
512 |
if ( thePivotData.nLabels > PAGE_SIZE ) |
513 |
{ |
514 |
aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) ); |
515 |
aSlider.Show(); |
516 |
} |
517 |
else |
518 |
aSlider.Hide(); |
519 |
} |
483 |
|
520 |
|
484 |
//---------------------------------------------------------------------------- |
521 |
//---------------------------------------------------------------------------- |
485 |
|
522 |
|
Lines 1314-1336
BOOL ScDPLayoutDlg::GetPivotArrays( P
Link Here
|
1314 |
return bFit; |
1351 |
return bFit; |
1315 |
} |
1352 |
} |
1316 |
|
1353 |
|
|
|
1354 |
void ScDPLayoutDlg::UpdateSrcRange() |
1355 |
{ |
1356 |
String theCurPosStr = aEdInPos.GetText(); |
1357 |
USHORT nResult = ScRange().Parse(theCurPosStr, pDoc); |
1358 |
|
1359 |
if ( SCA_VALID != (nResult & SCA_VALID) ) |
1360 |
// invalid source range. |
1361 |
return; |
1362 |
|
1363 |
ScRefAddress start, end; |
1364 |
ConvertDoubleRef(pDoc, theCurPosStr, 1, start, end); |
1365 |
ScRange aNewRange(start.GetAddress(), end.GetAddress()); |
1366 |
ScSheetSourceDesc inSheet = *xDlgDPObject->GetSheetDesc(); |
1367 |
|
1368 |
if (inSheet.aSourceRange == aNewRange) |
1369 |
// new range is identical to the current range. Nothing to do. |
1370 |
return; |
1371 |
|
1372 |
ScTabViewShell * pTabViewShell = pViewData->GetViewShell(); |
1373 |
inSheet.aSourceRange = aNewRange; |
1374 |
xDlgDPObject->SetSheetDesc(inSheet); |
1375 |
xDlgDPObject->InvalidateSource(); |
1376 |
xDlgDPObject->FillLabelData(thePivotData); |
1377 |
|
1378 |
pTabViewShell->SetDialogDPObject(xDlgDPObject.get()); |
1379 |
aLabelDataArr.clear(); |
1380 |
aWndSelect.ClearFields(); |
1381 |
aWndData.ClearFields(); |
1382 |
aWndRow.ClearFields(); |
1383 |
aWndCol.ClearFields(); |
1384 |
aWndPage.ClearFields(); |
1385 |
|
1386 |
for (USHORT i = 0; i < MAX_LABELS; ++i) |
1387 |
aSelectArr[i].reset(); |
1388 |
|
1389 |
for (USHORT i = 0; i < MAX_FIELDS; ++i) |
1390 |
{ |
1391 |
RemoveField(TYPE_COL, i); |
1392 |
RemoveField(TYPE_ROW, i); |
1393 |
RemoveField(TYPE_DATA, i); |
1394 |
} |
1395 |
|
1396 |
for (USHORT i = 0; i < MAX_PAGEFIELDS; ++i) |
1397 |
RemoveField(TYPE_PAGE, i); |
1398 |
|
1399 |
InitFields(); |
1400 |
|
1401 |
return; |
1402 |
} |
1317 |
|
1403 |
|
1318 |
//---------------------------------------------------------------------------- |
1404 |
//---------------------------------------------------------------------------- |
1319 |
|
1405 |
|
1320 |
void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) |
1406 |
void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDocP ) |
1321 |
{ |
1407 |
{ |
1322 |
if ( bRefInputMode ) |
1408 |
if ( !bRefInputMode || !pEditActive ) |
1323 |
{ |
1409 |
return; |
1324 |
if ( rRef.aStart != rRef.aEnd ) |
1410 |
|
1325 |
RefInputStart( &aEdOutPos ); |
1411 |
if ( rRef.aStart != rRef.aEnd ) |
1326 |
/* |
1412 |
RefInputStart( pEditActive ); |
1327 |
ScAddress aAdr( nStartCol, nStartRow, nStartTab ); |
1413 |
|
1328 |
aAdr.PutInOrder( ScAddress( nEndCol, nEndRow, nEndTab ) ); |
1414 |
if ( pEditActive == &aEdInPos ) |
1329 |
*/ |
1415 |
{ |
1330 |
String aRefStr; |
1416 |
String aRefStr; |
1331 |
rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP ); |
1417 |
rRef.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() ); |
1332 |
aEdOutPos.SetRefString( aRefStr ); |
1418 |
pEditActive->SetRefString( aRefStr ); |
1333 |
} |
1419 |
} |
|
|
1420 |
else if ( pEditActive == &aEdOutPos ) |
1421 |
{ |
1422 |
String aRefStr; |
1423 |
rRef.aStart.Format( aRefStr, STD_FORMAT, pDocP, pDocP->GetAddressConvention() ); |
1424 |
pEditActive->SetRefString( aRefStr ); |
1425 |
} |
1334 |
} |
1426 |
} |
1335 |
|
1427 |
|
1336 |
|
1428 |
|
Lines 1340-1347
void ScDPLayoutDlg::SetActive()
Link Here
|
1340 |
{ |
1432 |
{ |
1341 |
if ( bRefInputMode ) |
1433 |
if ( bRefInputMode ) |
1342 |
{ |
1434 |
{ |
1343 |
aEdOutPos.GrabFocus(); |
1435 |
if ( pEditActive ) |
1344 |
EdModifyHdl( NULL ); |
1436 |
pEditActive->GrabFocus(); |
|
|
1437 |
|
1438 |
if ( pEditActive == &aEdInPos ) |
1439 |
EdInModifyHdl( NULL ); |
1440 |
else if ( pEditActive == &aEdOutPos ) |
1441 |
EdModifyHdl( NULL ); |
1345 |
} |
1442 |
} |
1346 |
else |
1443 |
else |
1347 |
{ |
1444 |
{ |
Lines 1497-1508
IMPL_LINK( ScDPLayoutDlg, OkHdl, OKButto
Link Here
|
1497 |
|
1594 |
|
1498 |
//---------------------------------------------------------------------------- |
1595 |
//---------------------------------------------------------------------------- |
1499 |
|
1596 |
|
1500 |
IMPL_LINK_INLINE_START( ScDPLayoutDlg, CancelHdl, CancelButton *, EMPTYARG ) |
1597 |
IMPL_LINK( ScDPLayoutDlg, CancelHdl, CancelButton *, EMPTYARG ) |
1501 |
{ |
1598 |
{ |
|
|
1599 |
ScSheetSourceDesc inSheet = *xDlgDPObject->GetSheetDesc(); |
1600 |
inSheet.aSourceRange = aOldRange; |
1601 |
xDlgDPObject->SetSheetDesc(inSheet); |
1602 |
xDlgDPObject->InvalidateSource(); |
1502 |
Close(); |
1603 |
Close(); |
1503 |
return 0; |
1604 |
return 0; |
1504 |
} |
1605 |
} |
1505 |
IMPL_LINK_INLINE_END( ScDPLayoutDlg, CancelHdl, CancelButton *, EMPTYARG ) |
|
|
1506 |
|
1606 |
|
1507 |
|
1607 |
|
1508 |
//---------------------------------------------------------------------------- |
1608 |
//---------------------------------------------------------------------------- |
Lines 1514-1522
IMPL_LINK( ScDPLayoutDlg, MoreClickHdl,
Link Here
|
1514 |
bRefInputMode = TRUE; |
1614 |
bRefInputMode = TRUE; |
1515 |
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse |
1615 |
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse |
1516 |
//SFX_APPWINDOW->Enable(); |
1616 |
//SFX_APPWINDOW->Enable(); |
1517 |
aEdOutPos.Enable(); |
1617 |
if ( aEdInPos.IsEnabled() ) |
1518 |
aEdOutPos.GrabFocus(); |
1618 |
{ |
1519 |
aRbOutPos.Enable(); |
1619 |
aEdInPos.Enable(); |
|
|
1620 |
aEdInPos.GrabFocus(); |
1621 |
aEdInPos.Enable(); |
1622 |
} |
1623 |
else |
1624 |
{ |
1625 |
aEdOutPos.Enable(); |
1626 |
aEdOutPos.GrabFocus(); |
1627 |
aEdOutPos.Enable(); |
1628 |
} |
1520 |
} |
1629 |
} |
1521 |
else |
1630 |
else |
1522 |
{ |
1631 |
{ |
Lines 1557-1562
IMPL_LINK( ScDPLayoutDlg, EdModifyHdl, E
Link Here
|
1557 |
} |
1666 |
} |
1558 |
|
1667 |
|
1559 |
|
1668 |
|
|
|
1669 |
IMPL_LINK( ScDPLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG ) |
1670 |
{ |
1671 |
UpdateSrcRange(); |
1672 |
return 0; |
1673 |
} |
1674 |
|
1675 |
|
1560 |
//---------------------------------------------------------------------------- |
1676 |
//---------------------------------------------------------------------------- |
1561 |
|
1677 |
|
1562 |
IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG ) |
1678 |
IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG ) |
Lines 1610-1613
IMPL_LINK( ScDPLayoutDlg, ScrollHdl, Scr
Link Here
|
1610 |
return 0; |
1726 |
return 0; |
1611 |
} |
1727 |
} |
1612 |
|
1728 |
|
|
|
1729 |
//---------------------------------------------------------------------------- |
1730 |
|
1731 |
IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl ) |
1732 |
{ |
1733 |
pEditActive = NULL; |
1734 |
if ( pCtrl == &aEdInPos ) |
1735 |
pEditActive = &aEdInPos; |
1736 |
else if ( pCtrl == &aEdOutPos ) |
1737 |
pEditActive = &aEdOutPos; |
1738 |
|
1739 |
return 0; |
1740 |
} |
1613 |
|
1741 |
|