Lines 68-73
Link Here
|
68 |
//---------------------------------------------------------------------------- |
68 |
//---------------------------------------------------------------------------- |
69 |
|
69 |
|
70 |
#include "pvlaydlg.hxx" |
70 |
#include "pvlaydlg.hxx" |
|
|
71 |
#include "dbdocfun.hxx" |
71 |
|
72 |
|
72 |
#include <sfx2/dispatch.hxx> |
73 |
#include <sfx2/dispatch.hxx> |
73 |
#include <vcl/msgbox.hxx> |
74 |
#include <vcl/msgbox.hxx> |
Lines 87-92
Link Here
|
87 |
#include "pivot.hrc" |
88 |
#include "pivot.hrc" |
88 |
#include "dpobject.hxx" |
89 |
#include "dpobject.hxx" |
89 |
#include "dpsave.hxx" |
90 |
#include "dpsave.hxx" |
|
|
91 |
#include "dpshttab.hxx" |
90 |
#include "scmod.hxx" |
92 |
#include "scmod.hxx" |
91 |
|
93 |
|
92 |
#include "sc.hrc" //CHINA001 |
94 |
#include "sc.hrc" //CHINA001 |
Lines 139-144
Link Here
|
139 |
aFtOutArea ( this, ScResId( FT_OUTAREA ) ), |
141 |
aFtOutArea ( this, ScResId( FT_OUTAREA ) ), |
140 |
aEdOutPos ( this, ScResId( ED_OUTAREA ) ), |
142 |
aEdOutPos ( this, ScResId( ED_OUTAREA ) ), |
141 |
aRbOutPos ( this, ScResId( RB_OUTAREA ), &aEdOutPos ), |
143 |
aRbOutPos ( this, ScResId( RB_OUTAREA ), &aEdOutPos ), |
|
|
144 |
aFtInArea ( this, ScResId( FT_INAREA) ), |
145 |
aEdInPos ( this, ScResId( ED_INAREA) ), |
146 |
aRbInPos ( this, ScResId( RB_INAREA ), &aEdInPos ), |
142 |
aFlAreas ( this, ScResId( FL_OUTPUT ) ), |
147 |
aFlAreas ( this, ScResId( FL_OUTPUT ) ), |
143 |
|
148 |
|
144 |
aFtPage ( this, ScResId( FT_PAGE ) ), |
149 |
aFtPage ( this, ScResId( FT_PAGE ) ), |
Lines 166-172
Link Here
|
166 |
GetViewData() ), |
171 |
GetViewData() ), |
167 |
pDoc ( ((ScTabViewShell*)SfxViewShell::Current())-> |
172 |
pDoc ( ((ScTabViewShell*)SfxViewShell::Current())-> |
168 |
GetViewData()->GetDocument() ), |
173 |
GetViewData()->GetDocument() ), |
169 |
bRefInputMode ( FALSE ) |
174 |
bRefInputMode ( TRUE ) |
170 |
{ |
175 |
{ |
171 |
xDlgDPObject->SetAlive( TRUE ); // needed to get structure information |
176 |
xDlgDPObject->SetAlive( TRUE ); // needed to get structure information |
172 |
xDlgDPObject->FillOldParam( thePivotData, FALSE ); |
177 |
xDlgDPObject->FillOldParam( thePivotData, FALSE ); |
Lines 249-254
Link Here
|
249 |
InitWnd( thePivotData.aRowArr, static_cast<long>(thePivotData.nRowCount), TYPE_ROW ); |
254 |
InitWnd( thePivotData.aRowArr, static_cast<long>(thePivotData.nRowCount), TYPE_ROW ); |
250 |
InitWnd( thePivotData.aDataArr, static_cast<long>(thePivotData.nDataCount), TYPE_DATA ); |
255 |
InitWnd( thePivotData.aDataArr, static_cast<long>(thePivotData.nDataCount), TYPE_DATA ); |
251 |
|
256 |
|
|
|
257 |
ScRange inRange; |
258 |
String inString; |
259 |
inRange = xDlgDPObject->GetSheetDesc()->aSourceRange; |
260 |
inRange.Format( inString, STD_FORMAT, pDoc); |
261 |
aEdInPos.SetText(inString); |
262 |
|
252 |
aSlider.SetPageSize( PAGE_SIZE ); |
263 |
aSlider.SetPageSize( PAGE_SIZE ); |
253 |
aSlider.SetVisibleSize( PAGE_SIZE ); |
264 |
aSlider.SetVisibleSize( PAGE_SIZE ); |
254 |
aSlider.SetLineSize( LINE_SIZE ); |
265 |
aSlider.SetLineSize( LINE_SIZE ); |
Lines 266-271
Link Here
|
266 |
|
277 |
|
267 |
aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) ); |
278 |
aLbOutPos .SetSelectHdl( LINK( this, ScDPLayoutDlg, SelAreaHdl ) ); |
268 |
aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) ); |
279 |
aEdOutPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdModifyHdl ) ); |
|
|
280 |
aEdInPos .SetModifyHdl( LINK( this, ScDPLayoutDlg, EdInModifyHdl ) ); |
269 |
aBtnOk .SetClickHdl ( LINK( this, ScDPLayoutDlg, OkHdl ) ); |
281 |
aBtnOk .SetClickHdl ( LINK( this, ScDPLayoutDlg, OkHdl ) ); |
270 |
aBtnCancel.SetClickHdl ( LINK( this, ScDPLayoutDlg, CancelHdl ) ); |
282 |
aBtnCancel.SetClickHdl ( LINK( this, ScDPLayoutDlg, CancelHdl ) ); |
271 |
|
283 |
|
Lines 1270-1286
Link Here
|
1270 |
|
1282 |
|
1271 |
void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDoc ) |
1283 |
void ScDPLayoutDlg::SetReference( const ScRange& rRef, ScDocument* pDoc ) |
1272 |
{ |
1284 |
{ |
|
|
1285 |
ScRefEdit *tmpREd; |
1286 |
ScRefButton *tmpRBtn; |
1287 |
|
1273 |
if ( bRefInputMode ) |
1288 |
if ( bRefInputMode ) |
1274 |
{ |
1289 |
{ |
|
|
1290 |
tmpRBtn = GetRefButton(); |
1291 |
tmpREd = tmpRBtn->GetReferencesEdit(); |
1275 |
if ( rRef.aStart != rRef.aEnd ) |
1292 |
if ( rRef.aStart != rRef.aEnd ) |
1276 |
RefInputStart( &aEdOutPos ); |
1293 |
RefInputStart( tmpREd, tmpRBtn); |
|
|
1294 |
|
1277 |
/* |
1295 |
/* |
1278 |
ScAddress aAdr( nStartCol, nStartRow, nStartTab ); |
1296 |
ScAddress aAdr( nStartCol, nStartRow, nStartTab ); |
1279 |
aAdr.PutInOrder( ScAddress( nEndCol, nEndRow, nEndTab ) ); |
1297 |
aAdr.PutInOrder( ScAddress( nEndCol, nEndRow, nEndTab ) ); |
1280 |
*/ |
1298 |
*/ |
|
|
1299 |
|
1281 |
String aRefStr; |
1300 |
String aRefStr; |
1282 |
rRef.aStart.Format( aRefStr, STD_FORMAT, pDoc ); |
1301 |
|
1283 |
aEdOutPos.SetRefString( aRefStr ); |
1302 |
if ( tmpREd== &aEdInPos) |
|
|
1303 |
{ |
1304 |
USHORT nFmt = SCR_ABS_3D; //!!! nCurTab fehlt noch |
1305 |
if ( rRef.aStart.Tab() != rRef.aEnd.Tab() ) |
1306 |
nFmt |= SCA_TAB2_3D; |
1307 |
rRef.Format( aRefStr, nFmt, pDoc ); |
1308 |
} |
1309 |
else |
1310 |
rRef.aStart.Format( aRefStr, STD_FORMAT, pDoc ); |
1311 |
|
1312 |
tmpREd->SetRefString( aRefStr ); |
1284 |
} |
1313 |
} |
1285 |
} |
1314 |
} |
1286 |
|
1315 |
|
Lines 1432-1437
Link Here
|
1432 |
).Execute(); |
1461 |
).Execute(); |
1433 |
aEdOutPos.GrabFocus(); |
1462 |
aEdOutPos.GrabFocus(); |
1434 |
} |
1463 |
} |
|
|
1464 |
|
1435 |
return 0; |
1465 |
return 0; |
1436 |
} |
1466 |
} |
1437 |
|
1467 |
|
Lines 1461-1467
Link Here
|
1461 |
} |
1491 |
} |
1462 |
else |
1492 |
else |
1463 |
{ |
1493 |
{ |
1464 |
bRefInputMode = FALSE; |
1494 |
|
1465 |
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse |
1495 |
//@BugID 54702 Enablen/Disablen nur noch in Basisklasse |
1466 |
//SFX_APPWINDOW->Disable(FALSE); //! allgemeine Methode im ScAnyRefDlg |
1496 |
//SFX_APPWINDOW->Disable(FALSE); //! allgemeine Methode im ScAnyRefDlg |
1467 |
} |
1497 |
} |
Lines 1498-1503
Link Here
|
1498 |
} |
1528 |
} |
1499 |
|
1529 |
|
1500 |
|
1530 |
|
|
|
1531 |
IMPL_LINK( ScDPLayoutDlg, EdInModifyHdl, Edit *, EMPTYARG ) |
1532 |
{ |
1533 |
|
1534 |
String theCurPosStr = aEdInPos.GetText(); |
1535 |
ScSheetSourceDesc inSheet = *(xDlgDPObject->GetSheetDesc()); |
1536 |
ScRange aR = xDlgDPObject->GetSheetDesc()->aSourceRange; |
1537 |
ScRefAddress start, end; |
1538 |
ConvertDoubleRef (pDoc, theCurPosStr, 1, start, end ); |
1539 |
inSheet.aSourceRange = ScRange(start.GetAddress(), end.GetAddress()); |
1540 |
xDlgDPObject->SetSheetDesc( inSheet); |
1541 |
xDlgDPObject->InvalidateSource(); |
1542 |
xDlgDPObject->Output(); |
1543 |
xDlgDPObject->SetAlive( TRUE ); // needed to get structure information |
1544 |
xDlgDPObject->FillOldParam( thePivotData, FALSE ); |
1545 |
xDlgDPObject->FillLabelData( thePivotData ); |
1546 |
|
1547 |
ScTabViewShell * pTabViewShell = pViewData->GetViewShell(); |
1548 |
pTabViewShell->SetDialogDPObject(&ScDPObject(*xDlgDPObject)); |
1549 |
|
1550 |
aR = xDlgDPObject->GetSheetDesc()->aSourceRange; |
1551 |
|
1552 |
USHORT i; |
1553 |
for ( i=0; i<MAX_LABELS; i++ ) |
1554 |
aSelectArr[i].reset(); |
1555 |
|
1556 |
for ( i=0; i<MAX_FIELDS; i++ ) |
1557 |
{ |
1558 |
RemoveField (TYPE_COL, i); |
1559 |
RemoveField (TYPE_ROW, i); |
1560 |
RemoveField (TYPE_DATA, i); |
1561 |
RemoveField (TYPE_PAGE, i); |
1562 |
} |
1563 |
|
1564 |
aLabelDataArr.clear(); |
1565 |
|
1566 |
aWndSelect.ClearFields(); |
1567 |
|
1568 |
InitWndSelect( thePivotData.ppLabelArr, thePivotData.nLabels ); |
1569 |
InitWnd( thePivotData.aColArr, thePivotData.nColCount, TYPE_COL ); |
1570 |
InitWnd( thePivotData.aRowArr, thePivotData.nRowCount, TYPE_ROW ); |
1571 |
InitWnd( thePivotData.aDataArr, thePivotData.nDataCount, TYPE_DATA ); |
1572 |
aSlider.SetPageSize( PAGE_SIZE ); |
1573 |
aSlider.SetVisibleSize( PAGE_SIZE ); |
1574 |
aSlider.SetLineSize( LINE_SIZE ); |
1575 |
aSlider.SetRange( Range( 0, ((thePivotData.nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE ) ); |
1576 |
|
1577 |
if ( thePivotData.nLabels > PAGE_SIZE ) |
1578 |
{ |
1579 |
aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) ); |
1580 |
aSlider.Show(); |
1581 |
} |
1582 |
else |
1583 |
aSlider.Hide(); |
1584 |
|
1585 |
if ( pViewData && pDoc ) |
1586 |
{ |
1587 |
/* |
1588 |
* Aus den RangeNames des Dokumentes werden nun die |
1589 |
* in einem Zeiger-Array gemerkt, bei denen es sich |
1590 |
* um sinnvolle Bereiche handelt |
1591 |
*/ |
1592 |
|
1593 |
aLbOutPos.Clear(); |
1594 |
aLbOutPos.InsertEntry( aStrUndefined, 0 ); |
1595 |
aLbOutPos.InsertEntry( aStrNewTable, 1 ); |
1596 |
|
1597 |
ScAreaNameIterator aIter( pDoc ); |
1598 |
String aName; |
1599 |
ScRange aRange; |
1600 |
String aRefStr; |
1601 |
while ( aIter.Next( aName, aRange ) ) |
1602 |
{ |
1603 |
if ( !aIter.WasDBName() ) // hier keine DB-Bereiche ! |
1604 |
{ |
1605 |
USHORT nInsert = aLbOutPos.InsertEntry( aName ); |
1606 |
|
1607 |
aRange.aStart.Format( aRefStr, SCA_ABS_3D, pDoc ); |
1608 |
aLbOutPos.SetEntryData( nInsert, new String( aRefStr ) ); |
1609 |
} |
1610 |
} |
1611 |
} |
1612 |
|
1613 |
|
1614 |
|
1615 |
//Init(); |
1616 |
return 0; |
1617 |
} |
1618 |
|
1619 |
|
1501 |
//---------------------------------------------------------------------------- |
1620 |
//---------------------------------------------------------------------------- |
1502 |
|
1621 |
|
1503 |
IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG ) |
1622 |
IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG ) |