View | Details | Raw Unified | Return to issue 75050
Collapse All | Expand All

(-)ori/sc/inc/document.hxx (-3 / +10 lines)
Lines 704-710 Link Here
704
	void			PutCell(SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell,
704
	void			PutCell(SCCOL nCol, SCROW nRow, SCTAB nTab, ScBaseCell* pCell,
705
							ULONG nFormatIndex, BOOL bForceTab = FALSE);
705
							ULONG nFormatIndex, BOOL bForceTab = FALSE);
706
					//	return TRUE = Zahlformat gesetzt
706
					//	return TRUE = Zahlformat gesetzt
707
	BOOL			SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString );
707
	//BOOL			SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString );
708
	//for dataform
709
	SC_DLLPUBLIC  BOOL			SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const String& rString );
710
	//end
708
	void			SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
711
	void			SetValue( SCCOL nCol, SCROW nRow, SCTAB nTab, const double& rVal );
709
	void			SetNote( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPostIt& rNote );
712
	void			SetNote( SCCOL nCol, SCROW nRow, SCTAB nTab, const ScPostIt& rNote );
710
	void 			SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError);
713
	void 			SetError( SCCOL nCol, SCROW nRow, SCTAB nTab, const USHORT nError);
Lines 862-869 Link Here
862
							   SCCOL nEndCol,   SCTAB nEndTab,
865
							   SCCOL nEndCol,   SCTAB nEndTab,
863
							   SCROW nStartRow, SCSIZE nSize,
866
							   SCROW nStartRow, SCSIZE nSize,
864
							   ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL );
867
							   ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL );
865
	void			DeleteRow( const ScRange& rRange,
868
	//for dataform
869
	SC_DLLPUBLIC    void			DeleteRow( const ScRange& rRange,
866
							   ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL );
870
							   ScDocument* pRefUndoDoc = NULL, BOOL* pUndoOutline = NULL );
871
							   
867
	BOOL			InsertCol( SCROW nStartRow, SCTAB nStartTab,
872
	BOOL			InsertCol( SCROW nStartRow, SCTAB nStartTab,
868
							   SCROW nEndRow,   SCTAB nEndTab,
873
							   SCROW nEndRow,   SCTAB nEndTab,
869
							   SCCOL nStartCol, SCSIZE nSize, ScDocument* pRefUndoDoc = NULL );
874
							   SCCOL nStartCol, SCSIZE nSize, ScDocument* pRefUndoDoc = NULL );
Lines 1149-1155 Link Here
1149
											USHORT nNewHeight );
1154
											USHORT nNewHeight );
1150
	void			SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, BOOL bManual );
1155
	void			SetManualHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, BOOL bManual );
1151
1156
1152
	USHORT			GetColWidth( SCCOL nCol, SCTAB nTab ) const;
1157
	//for dataform
1158
	SC_DLLPUBLIC    USHORT			GetColWidth( SCCOL nCol, SCTAB nTab ) const;
1159
	
1153
	USHORT			GetRowHeight( SCROW nRow, SCTAB nTab ) const;
1160
	USHORT			GetRowHeight( SCROW nRow, SCTAB nTab ) const;
1154
	ULONG			GetRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const;
1161
	ULONG			GetRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab ) const;
1155
	ULONG			GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, double fScale ) const;
1162
	ULONG			GetScaledRowHeight( SCROW nStartRow, SCROW nEndRow, SCTAB nTab, double fScale ) const;
(-)ori/sc/inc/sc.hrc (-1 / +6 lines)
Lines 792-800 Link Here
792
792
793
#define SID_SORT_DESCENDING		(DATA_MENU_START + 23)
793
#define SID_SORT_DESCENDING		(DATA_MENU_START + 23)
794
#define SID_SORT_ASCENDING		(DATA_MENU_START + 24)
794
#define SID_SORT_ASCENDING		(DATA_MENU_START + 24)
795
#define SID_DATA_FORM		    (DATA_MENU_START + 25)
795
//
796
//
796
//
797
//
797
#define DATA_MENU_END           (DATA_MENU_START + 25)
798
#define DATA_MENU_END           (DATA_MENU_START + 26)
798
799
799
#define TAB_POPUP_START			(DATA_MENU_END)
800
#define TAB_POPUP_START			(DATA_MENU_END)
800
#define RID_POPUP_TAB			(TAB_POPUP_START)
801
#define RID_POPUP_TAB			(TAB_POPUP_START)
Lines 1587-1593 Link Here
1587
#define RID_SCDLG_DPDATEGROUP           (SC_DIALOGS_START + 136)
1588
#define RID_SCDLG_DPDATEGROUP           (SC_DIALOGS_START + 136)
1588
#define RID_SCDLG_DPSHOWDETAIL          (SC_DIALOGS_START + 137)
1589
#define RID_SCDLG_DPSHOWDETAIL          (SC_DIALOGS_START + 137)
1589
1590
1591
#define RID_SCDLG_DATAFORM				(SC_DIALOGS_START + 138)
1592
1593
1590
#define SID_PIVOT_AFMT					(SC_DIALOGS_START + 133)
1594
#define SID_PIVOT_AFMT					(SC_DIALOGS_START + 133)
1595
1591
#define SC_DIALOGS_END          (SC_DIALOGS_START + 150)
1596
#define SC_DIALOGS_END          (SC_DIALOGS_START + 150)
1592
1597
1593
#ifndef STD_MASKCOLOR
1598
#ifndef STD_MASKCOLOR
(-)ori/sc/inc/scabstdlg.hxx (+10 lines)
Lines 52-57 Link Here
52
#include "global.hxx"
52
#include "global.hxx"
53
#include "pivot.hxx"
53
#include "pivot.hxx"
54
54
55
#include <tabvwsh.hxx>
56
55
class ScAsciiOptions;
57
class ScAsciiOptions;
56
class ScAutoFormat;
58
class ScAutoFormat;
57
class ScAutoFormatData;
59
class ScAutoFormatData;
Lines 120-125 Link Here
120
	virtual DelCellCmd GetDelCellCmd() const = 0;
122
	virtual DelCellCmd GetDelCellCmd() const = 0;
121
};
123
};
122
124
125
//for dataform
126
class AbstractScDataFormDlg : public VclAbstractDialog  //add for ScDeleteCellDlg
127
{
128
129
};
130
123
class AbstractScDeleteContentsDlg: public VclAbstractDialog  //add for ScDeleteContentsDlg
131
class AbstractScDeleteContentsDlg: public VclAbstractDialog  //add for ScDeleteContentsDlg
124
{
132
{
125
public:
133
public:
Lines 333-338 Link Here
333
																		const ResId& rResId ) = 0;
341
																		const ResId& rResId ) = 0;
334
342
335
	virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, const ResId& rResId, BOOL bDisallowCellMove = FALSE ) = 0 ; //add for ScDeleteCellDlg
343
	virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, const ResId& rResId, BOOL bDisallowCellMove = FALSE ) = 0 ; //add for ScDeleteCellDlg
344
	//for dataform
345
	virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, const ResId& rResId, ScTabViewShell*	pTabViewShell ) = 0 ; //add for ScDataFormDlg
336
346
337
	virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,const ResId& rResId, //add for ScDeleteContentsDlg
347
	virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,const ResId& rResId, //add for ScDeleteContentsDlg
338
																 USHORT  nCheckDefaults = 0 ) = 0;
348
																 USHORT  nCheckDefaults = 0 ) = 0;
(-)ori/sc/sdi/cellsh.sdi (+1 lines)
Lines 65-70 Link Here
65
	SID_SBA_BRW_INSERT		[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
65
	SID_SBA_BRW_INSERT		[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
66
	SID_SELECT_DB			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
66
	SID_SELECT_DB			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
67
	SID_SORT				[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
67
	SID_SORT				[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
68
	SID_DATA_FORM			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
68
	FID_FILTER_OK			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
69
	FID_FILTER_OK			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
69
	SID_AUTO_FILTER			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
70
	SID_AUTO_FILTER			[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
70
	SID_AUTOFILTER_HIDE		[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
71
	SID_AUTOFILTER_HIDE		[ ExecMethod = ExecuteDB; StateMethod = GetDBState; ]
(-)ori/sc/sdi/scalc.sdi (+25 lines)
Lines 1606-1611 Link Here
1606
]
1606
]
1607
1607
1608
//--------------------------------------------------------------------------
1608
//--------------------------------------------------------------------------
1609
SfxVoidItem DataForm SID_DATA_FORM
1610
()
1611
[
1612
	/* flags: */
1613
	AutoUpdate = FALSE,
1614
	Cachable = Cachable,
1615
	FastCall = FALSE,
1616
	HasCoreId = FALSE,
1617
	HasDialog = TRUE,
1618
	ReadOnlyDoc = TRUE,
1619
	Toggle = FALSE,
1620
	Container = FALSE,
1621
	RecordAbsolute = FALSE,
1622
	RecordPerSet;
1623
	Synchron;
1624
1625
	/* config: */
1626
	AccelConfig = TRUE,
1627
	MenuConfig = TRUE,
1628
	StatusBarConfig = FALSE,
1629
	ToolBoxConfig = FALSE,
1630
	GroupId = GID_DATA;
1631
]
1632
1633
//--------------------------------------------------------------------------
1609
SfxVoidItem DataSubTotals SID_SUBTOTALS
1634
SfxVoidItem DataSubTotals SID_SUBTOTALS
1610
()
1635
()
1611
[
1636
[
(-)ori/sc/source/ui/attrdlg/scdlgfact.cxx (+24 lines)
Lines 81-86 Link Here
81
#include "tpstat.hxx" //add for ScDocStatPage
81
#include "tpstat.hxx" //add for ScDocStatPage
82
#include "tpusrlst.hxx" //add for ScTpUserLists
82
#include "tpusrlst.hxx" //add for ScTpUserLists
83
#include "tpview.hxx" //add for ScTpContentOptions
83
#include "tpview.hxx" //add for ScTpContentOptions
84
//for dataform
85
#include "datafdlg.hxx" //add for ScDataFormDlg
84
86
85
// ause
87
// ause
86
#include "editutil.hxx"
88
#include "editutil.hxx"
Lines 93-98 Link Here
93
IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); //add for ScDataPilotSourceTypeDlg
95
IMPL_ABSTDLG_BASE(AbstractScDataPilotSourceTypeDlg_Impl); //add for ScDataPilotSourceTypeDlg
94
IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl); //add for ScDataPilotServiceDlg
96
IMPL_ABSTDLG_BASE(AbstractScDataPilotServiceDlg_Impl); //add for ScDataPilotServiceDlg
95
IMPL_ABSTDLG_BASE(AbstractScDeleteCellDlg_Impl); //add for ScDeleteCellDlg
97
IMPL_ABSTDLG_BASE(AbstractScDeleteCellDlg_Impl); //add for ScDeleteCellDlg
98
//for dataform
99
IMPL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl); //add for ScDataFormDlg
96
IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl); //add for ScDeleteContentsDlg
100
IMPL_ABSTDLG_BASE(AbstractScDeleteContentsDlg_Impl); //add for ScDeleteContentsDlg
97
IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl); //add for ScFillSeriesDlg
101
IMPL_ABSTDLG_BASE(AbstractScFillSeriesDlg_Impl); //add for ScFillSeriesDlg
98
IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl); //add for ScGroupDlg
102
IMPL_ABSTDLG_BASE(AbstractScGroupDlg_Impl); //add for ScGroupDlg
Lines 761-766 Link Here
761
765
762
//add for ScDeleteCellDlg  end
766
//add for ScDeleteCellDlg  end
763
767
768
//add for ScDataFormDlg begin
769
AbstractScDataFormDlg* ScAbstractDialogFactory_Impl::CreateScDataFormDlg( Window* pParent, const ResId& rResId, ScTabViewShell*	pTabViewShell )
770
{
771
	ScDataFormDlg * pDlg=NULL;
772
	switch ( rResId.GetId() )
773
	{
774
		case RID_SCDLG_DATAFORM :
775
			pDlg = new ScDataFormDlg( pParent, pTabViewShell);
776
			break;
777
		default:
778
			break;
779
	}
780
781
	if ( pDlg )
782
		return new AbstractScDataFormDlg_Impl( pDlg );
783
	return 0;
784
}
785
786
//add for ScDataFormDlg  end
787
764
//add for ScDeleteContentsDlg begin
788
//add for ScDeleteContentsDlg begin
765
AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(Window* pParent,const ResId& rResId, //add for ScDeleteContentsDlg
789
AbstractScDeleteContentsDlg* ScAbstractDialogFactory_Impl::CreateScDeleteContentsDlg(Window* pParent,const ResId& rResId, //add for ScDeleteContentsDlg
766
																 USHORT  nCheckDefaults )
790
																 USHORT  nCheckDefaults )
(-)ori/sc/source/ui/attrdlg/scdlgfact.hxx (+10 lines)
Lines 45-50 Link Here
45
class ScDataPilotSourceTypeDlg;
45
class ScDataPilotSourceTypeDlg;
46
class ScDataPilotServiceDlg;
46
class ScDataPilotServiceDlg;
47
class ScDeleteCellDlg;
47
class ScDeleteCellDlg;
48
class ScDataFormDlg;
48
class ScDeleteContentsDlg;
49
class ScDeleteContentsDlg;
49
class ScFillSeriesDlg;
50
class ScFillSeriesDlg;
50
class ScGroupDlg;
51
class ScGroupDlg;
Lines 144-149 Link Here
144
	virtual DelCellCmd GetDelCellCmd() const;
145
	virtual DelCellCmd GetDelCellCmd() const;
145
};
146
};
146
147
148
//for dataform
149
class AbstractScDataFormDlg_Impl : public AbstractScDataFormDlg  //add for ScDataFormDlg
150
{
151
	DECL_ABSTDLG_BASE(AbstractScDataFormDlg_Impl,ScDataFormDlg);
152
};
153
147
class AbstractScDeleteContentsDlg_Impl : public AbstractScDeleteContentsDlg  //add for ScDeleteContentsDlg
154
class AbstractScDeleteContentsDlg_Impl : public AbstractScDeleteContentsDlg  //add for ScDeleteContentsDlg
148
{
155
{
149
	DECL_ABSTDLG_BASE( AbstractScDeleteContentsDlg_Impl,ScDeleteContentsDlg);
156
	DECL_ABSTDLG_BASE( AbstractScDeleteContentsDlg_Impl,ScDeleteContentsDlg);
Lines 371-376 Link Here
371
	virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, const ResId& rResId,
378
	virtual AbstractScDeleteCellDlg * CreateScDeleteCellDlg( Window* pParent, const ResId& rResId,
372
															BOOL bDisallowCellMove = FALSE ); //add for ScDeleteCellDlg
379
															BOOL bDisallowCellMove = FALSE ); //add for ScDeleteCellDlg
373
380
381
	//for dataform
382
	virtual AbstractScDataFormDlg * CreateScDataFormDlg( Window* pParent, const ResId& rResId, ScTabViewShell*	pTabViewShell); //add for ScDeleteCellDlg
383
															
374
	virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,const ResId& rResId, //add for ScDeleteContentsDlg
384
	virtual AbstractScDeleteContentsDlg * CreateScDeleteContentsDlg(Window* pParent,const ResId& rResId, //add for ScDeleteContentsDlg
375
																 USHORT  nCheckDefaults = 0 );
385
																 USHORT  nCheckDefaults = 0 );
376
386
(-)ori/sc/source/ui/inc/datafdlg.hrc (+49 lines)
Line 0 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile: datafdlg.hrc,v $
6
 *
7
 *  $Revision: 1.00 $
8
 *
9
 *  last change: $Author: rt $ $Date: 2005/09/08 21:37:12 $
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
36
#include "sc.hrc"	// -> RID_SCDLG_DATAFORM
37
38
//dataform
39
#define BTN_DATAFORM_NEW          1001
40
#define BTN_DATAFORM_DELETE       1002
41
#define BTN_DATAFORM_RESTORE      1003
42
#define BTN_DATAFORM_LAST         1004
43
#define BTN_DATAFORM_NEXT         1005
44
#define BTN_DATAFORM_CLOSE        1007
45
#define WND_DATAFORM_SCROLLBAR    1008
46
#define LAB_DATAFORM_RECORDNO     1009
47
48
#define FT_DATAFORM_FIXEDTEXT1    2001
49
#define ED_DATAFORM_EDIT1         2002
(-)ori/sc/source/ui/inc/datafdlg.hxx (+117 lines)
Line 0 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile: datafdlg.hxx,v $
6
 *
7
 *  $Revision: 1.00 $
8
 *
9
 *  last change: $Author: rt $ $Date: 2005/09/08 21:20:35 $
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
36
#ifndef SC_DATAFDLG_HXX
37
#define SC_DATAFDLG_HXX
38
39
40
#ifndef _SV_DIALOG_HXX //autogen
41
#include <vcl/dialog.hxx>
42
#endif
43
44
#ifndef _SV_BUTTON_HXX //autogen
45
#include <vcl/imagebtn.hxx>
46
#endif
47
48
#ifndef _SV_FIXED_HXX //autogen
49
#include <vcl/fixed.hxx>
50
#endif
51
52
53
54
#include "global.hxx"
55
56
#include <tabvwsh.hxx>
57
58
#define MAX_DATAFORM_COLS   256
59
#define MAX_DATAFORM_ROWS   32000
60
#define CTRL_HEIGHT         22
61
#define FIXED_WIDTH         60
62
#define EDIT_WIDTH          140 
63
#define FIXED_LEFT          12
64
#define EDIT_LEFT           78
65
#define LINE_HEIGHT         30
66
67
//zhangyun
68
class ScDataFormDlg : public ModalDialog
69
{
70
private:
71
72
	PushButton      aBtnNew;
73
	PushButton      aBtnDelete;
74
	PushButton      aBtnRestore;
75
	PushButton      aBtnLast;
76
	PushButton      aBtnNext;
77
	PushButton      aBtnClose;
78
	ScrollBar       aSlider;
79
	FixedText       aFixedText;
80
	//FixedText       aFixedText1;
81
	//Edit            aEdit1;
82
	
83
	ScTabViewShell*	pTabViewShell;
84
    ScDocument*     pDoc;
85
	sal_uInt16      aColLength;
86
	SCROW           aCurrentRow;
87
	SCCOL           nStartCol;
88
	SCCOL           nEndCol;
89
	SCROW	        nStartRow;
90
	SCROW	        nEndRow;
91
	SCTAB	        nTab;
92
	BOOL            bNoSelection;
93
	
94
	FixedText** pFixedTexts;
95
    Edit** pEdits;
96
97
public:
98
	ScDataFormDlg( Window* pParent, ScTabViewShell*	pTabViewShell);
99
	~ScDataFormDlg();
100
	
101
	void FillCtrls(SCROW nCurrentRow);
102
private:
103
104
	// Handler:
105
	DECL_LINK( Impl_NewHdl,		PushButton*    );
106
	DECL_LINK( Impl_LastHdl,	PushButton*    );
107
	DECL_LINK( Impl_NextHdl,	PushButton*    );
108
	
109
	DECL_LINK( Impl_RestoreHdl,	PushButton*    );
110
	DECL_LINK( Impl_DeleteHdl,	PushButton*    );
111
	DECL_LINK( Impl_CloseHdl,	PushButton*    );
112
	
113
	DECL_LINK( Impl_ScrollHdl,	ScrollBar*    );
114
};
115
#endif // SC_DATAFDLG_HXX
116
117
(-)ori/sc/source/ui/miscdlgs/datafdlg.cxx (+392 lines)
Line 0 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile: datafdlg.cxx,v $
6
 *
7
 *  $Revision: 1.00 $
8
 *
9
 *  last change: $Author: kz $ $Date: 2006/07/21 14:04:33 $
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
36
// MARKER(update_precomp.py): autogen include statement, do not remove
37
#include "precompiled_sc.hxx"
38
39
#undef SC_DLLIMPLEMENTATION
40
41
//------------------------------------------------------------------
42
43
#include "datafdlg.hxx"
44
#include "scresid.hxx"
45
#include "datafdlg.hrc"
46
#include "viewdata.hxx"
47
#include "document.hxx"
48
#include "docsh.hxx"
49
50
static BYTE nDelItemChecked=0;
51
#define HDL(hdl)			LINK( this, ScDataFormDlg, hdl )
52
53
//zhangyun
54
ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*	pTabViewShellOri) :
55
	ModalDialog     ( pParent, ScResId( RID_SCDLG_DATAFORM ) ),
56
	//
57
	aFixedText          ( this, ScResId( LAB_DATAFORM_RECORDNO ) ),
58
	aBtnNew          ( this, ScResId( BTN_DATAFORM_NEW ) ),
59
	aBtnDelete          ( this, ScResId( BTN_DATAFORM_DELETE ) ),
60
	aBtnRestore          ( this, ScResId( BTN_DATAFORM_RESTORE ) ),
61
	aBtnLast          ( this, ScResId( BTN_DATAFORM_LAST ) ),
62
	aBtnNext          ( this, ScResId( BTN_DATAFORM_NEXT ) ),
63
    aBtnClose          ( this, ScResId( BTN_DATAFORM_CLOSE ) ),
64
    aSlider			( this, ScResId( WND_DATAFORM_SCROLLBAR ) )
65
    //aSlider          ( this, ScResId( WND_DATAFORM_SCROLLBAR ) ),
66
    //aFixedText1          ( this, ScResId( FT_DATAFORM_FIXEDTEXT1 ) ),
67
    //aEdit1          ( this, ScResId( ED_DATAFORM_EDIT1 ) )
68
{
69
    pTabViewShell = pTabViewShellOri;
70
    FreeResource();
71
    //read header form current document, and add new controls
72
    DBG_ASSERT( pTabViewShell, "pTabViewShell is NULL! :-/" );
73
    ScViewData*	pViewData = pTabViewShell->GetViewData();
74
    
75
    //int aColLength=20;
76
    //FixedText** pFixedTexts;
77
    //Edit** pEdits;
78
    //pFixedTexts = new FixedText*[aColLength];
79
	//pEdits = new Edit*[aColLength];
80
    
81
    pDoc = pViewData->GetDocument();
82
    if (pDoc)
83
    {
84
        ScRange aRange;
85
        pViewData->GetSimpleArea( aRange );
86
        ScAddress aStart = aRange.aStart;
87
        ScAddress aEnd = aRange.aEnd;
88
        
89
        nStartCol = aStart.Col();
90
		nEndCol = aEnd.Col();
91
		nStartRow	= aStart.Row();
92
		nEndRow	= aEnd.Row();
93
		
94
		nTab = pViewData->GetTabNo();
95
		//if there is no selection
96
		if ((nStartCol == nEndCol) && (nStartRow == nEndRow))
97
		    bNoSelection = TRUE;
98
		
99
		if (bNoSelection)
100
		{
101
		    //find last not blank cell in row
102
		    for (int i=1;i<=MAX_DATAFORM_COLS;i++)
103
		    {
104
		        String	aColName;
105
		        nEndCol++;
106
		        pDoc->GetString( nEndCol, nStartRow, nTab, aColName );
107
		        int nColWidth = pDoc->GetColWidth( nEndCol, nTab );
108
		        if ( aColName.Len() == 0 && nColWidth)
109
		        {
110
                    nEndCol--;
111
                    break;
112
                }
113
		    }
114
		    
115
		    //find first not blank cell in row
116
		    for (int i=1;i<=MAX_DATAFORM_COLS;i++)
117
		    {
118
		        String	aColName;
119
		        if (nStartCol <= 0)
120
		            break;
121
		        nStartCol--;
122
123
		        pDoc->GetString( nStartCol, nStartRow, nTab, aColName );
124
		        int nColWidth = pDoc->GetColWidth( nEndCol, nTab );
125
		        if ( aColName.Len() == 0 && nColWidth)
126
		        {
127
                    nStartCol++;
128
                    break;
129
                }
130
		    }
131
		    
132
		    //skip leading hide column
133
		    for (int i=1;i<=MAX_DATAFORM_COLS;i++)
134
		    {
135
		        String	aColName;
136
		        int nColWidth = pDoc->GetColWidth( nStartCol, nTab );
137
		        if (nColWidth)
138
		            break;
139
		        nStartCol++;
140
		    }
141
142
		    if (nEndCol < nStartCol)
143
		        nEndCol = nStartCol;
144
		        
145
		    //find last not blank cell in row
146
		    for (int i=1;i<=MAX_DATAFORM_ROWS;i++)
147
		    {
148
		        String	aColName;
149
		        nEndRow++;
150
		        pDoc->GetString( nStartCol, nEndRow, nTab, aColName );
151
		        if ( aColName.Len() == 0 )
152
		        {
153
                    nEndRow--;
154
                    break;
155
                }
156
		    }
157
		    
158
		    //find first not blank cell in row
159
		    for (int i=1;i<=MAX_DATAFORM_ROWS;i++)
160
		    {
161
		        String	aColName;
162
		        if (nStartRow <= 0)
163
		            break;
164
		        nStartRow--;
165
166
		        pDoc->GetString( nStartCol, nStartRow, nTab, aColName );
167
		        if ( aColName.Len() == 0 )
168
		        {
169
                    nStartRow++;
170
                    break;
171
                }
172
		    }
173
174
		    if (nEndRow < nStartRow)
175
		        nEndRow = nStartRow;
176
		}
177
		
178
		aCurrentRow = nStartRow + 1;
179
		
180
		SCCOL	col;
181
		String	aFieldName;
182
183
		int nTop = 12;
184
185
		Size	nFixedSize(FIXED_WIDTH, CTRL_HEIGHT );
186
	    Size	nEditSize(EDIT_WIDTH, CTRL_HEIGHT );
187
		
188
		//pFtArray = new FixedText(this);
189
		aColLength = nEndCol - nStartCol + 1;
190
	    
191
	    //new the controls
192
	    pFixedTexts = new FixedText*[aColLength];
193
	    pEdits = new Edit*[aColLength];
194
	    
195
	    for(sal_uInt16 nIndex = 0; nIndex < aColLength; nIndex++)
196
		{
197
    		pDoc->GetString( nIndex + nStartCol, nStartRow, nTab, aFieldName );
198
    		int nColWidth = pDoc->GetColWidth( nIndex + nStartCol, nTab );
199
    		if (nColWidth)
200
    		{
201
        		pFixedTexts[nIndex] = new FixedText(this);
202
        		pEdits[nIndex] = new Edit(this, WB_BORDER);
203
        
204
        		pFixedTexts[nIndex]->SetSizePixel(nFixedSize);
205
        		pEdits[nIndex]->SetSizePixel(nEditSize);
206
        		pFixedTexts[nIndex]->SetPosPixel(Point(FIXED_LEFT, nTop));
207
        		pEdits[nIndex]->SetPosPixel(Point(EDIT_LEFT, nTop));
208
        		//pFixedTexts[nIndex]->SetText(String::CreateFromAscii("W4W-Filter Nr. "));
209
        		pFixedTexts[nIndex]->SetText(aFieldName);
210
        		pFixedTexts[nIndex]->Show();
211
        		pEdits[nIndex]->Show();
212
        		
213
        		nTop += LINE_HEIGHT;
214
    	    }
215
        	else
216
        	{
217
        	    pFixedTexts[nIndex] = NULL;
218
        		pEdits[nIndex] = NULL;
219
        	}
220
    	}
221
    	
222
    	Size nDialogSize = this->GetSizePixel();
223
        if (nTop > nDialogSize.Height())
224
        {
225
            nDialogSize.setHeight(nTop);
226
            this->SetSizePixel(nDialogSize);
227
        }
228
        Size nScrollSize = aSlider.GetSizePixel();
229
        nScrollSize.setHeight(nDialogSize.Height()-20);
230
        aSlider.SetSizePixel(nScrollSize);
231
    }
232
    
233
    FillCtrls(aCurrentRow);
234
    
235
    aSlider.SetPageSize( 10 );
236
    aSlider.SetVisibleSize( 1 );
237
    aSlider.SetLineSize( 1 );
238
    aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) );
239
    aSlider.Show();
240
    
241
    aBtnNew.SetClickHdl 	( HDL(Impl_NewHdl)    );
242
    aBtnLast.SetClickHdl 	( HDL(Impl_LastHdl)    );
243
    aBtnNext.SetClickHdl 	( HDL(Impl_NextHdl)    );
244
    
245
    aBtnRestore.SetClickHdl 	( HDL(Impl_RestoreHdl)    );
246
    aBtnDelete.SetClickHdl 	( HDL(Impl_DeleteHdl)    );
247
    aBtnClose.SetClickHdl 	( HDL(Impl_CloseHdl)    );
248
    
249
    aSlider.SetEndScrollHdl( HDL( Impl_ScrollHdl ) );
250
251
    //end
252
	//FreeResource();
253
}
254
255
__EXPORT ScDataFormDlg::~ScDataFormDlg()
256
{
257
    for(sal_uInt16 i = 0; i < aColLength; i++)
258
    {
259
	    if (pEdits[i])
260
    	    delete pEdits[i];
261
	    if (pFixedTexts[i])
262
    	    delete pFixedTexts[i];
263
    }
264
    if (pEdits)
265
    	delete pEdits;
266
	if (pFixedTexts)
267
    	delete pFixedTexts;
268
}
269
270
void ScDataFormDlg::FillCtrls(SCROW nCurrentRow)
271
{
272
    //ScViewData*	pViewData = pTabViewShell->GetViewData();
273
    
274
    //pDoc = pViewData->GetDocument();
275
    String	aFieldName;
276
    int nRecordNum = nEndRow - nStartRow;
277
    for(sal_uInt16 i = 0; i < aColLength; i++)
278
    {
279
	    if (pEdits[i])
280
	    {
281
    	    if (aCurrentRow<=nEndRow)
282
    	    {
283
    	        pDoc->GetString( i + nStartCol, aCurrentRow, nTab, aFieldName );
284
    	        pEdits[i]->SetText(aFieldName);
285
    	    }
286
    	    else
287
    	        pEdits[i]->SetText(String());
288
	    }
289
    }
290
    char sRecordStr[256];
291
	sprintf(sRecordStr, "%i / %i", aCurrentRow-nStartRow, nRecordNum);
292
    if (aCurrentRow<=nEndRow)
293
	    aFixedText.SetText(String::CreateFromAscii(sRecordStr));
294
	else
295
	    aFixedText.SetText(String::CreateFromAscii("New Record"));
296
	    
297
	aSlider.SetThumbPos(aCurrentRow-nStartRow-1);
298
}
299
300
IMPL_LINK( ScDataFormDlg, Impl_NewHdl, PushButton*, pBtn)
301
{
302
	ScViewData*	pViewData = pTabViewShell->GetViewData();
303
    ScDocShell* pDocSh = pViewData->GetDocShell();
304
    if (pDoc)
305
    {
306
		for(sal_uInt16 i = 0; i < aColLength; i++)
307
	    {
308
		    if (pEdits[i])
309
		    {
310
		        String	aFieldName=pEdits[i]->GetText();
311
		        pDoc->SetString( nStartCol + i, aCurrentRow, nTab, aFieldName );
312
		    }
313
	    }
314
		//String	aFieldName=pEdArray->GetText();
315
		
316
		//pDoc->SetString( nStartCol, nLastRow, nTab, aFieldName );
317
		aCurrentRow++;
318
		if (aCurrentRow >= nEndRow + 2)
319
		{
320
		    nEndRow ++ ;
321
		    aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) );
322
		}
323
		FillCtrls(aCurrentRow);
324
		pDocSh->SetDocumentModified();
325
		pDocSh->PostPaintGridAll();
326
327
    }
328
	return 0;
329
}
330
331
IMPL_LINK( ScDataFormDlg, Impl_LastHdl, PushButton*, pBtn)
332
{   
333
    if (pDoc)
334
    {
335
		if ( aCurrentRow > nStartRow +1 )
336
		    aCurrentRow--;
337
338
		FillCtrls(aCurrentRow);
339
    }
340
    return 0;
341
}
342
343
IMPL_LINK( ScDataFormDlg, Impl_NextHdl, PushButton*, pBtn)
344
{   
345
    if (pDoc)
346
    {
347
		if ( aCurrentRow <= nEndRow)
348
		    aCurrentRow++;
349
350
		FillCtrls(aCurrentRow);
351
    }
352
    return 0;
353
}
354
355
IMPL_LINK( ScDataFormDlg, Impl_RestoreHdl, PushButton*, pBtn)
356
{   
357
    if (pDoc)
358
    {
359
		FillCtrls(aCurrentRow);
360
    }
361
    return 0;
362
}
363
364
IMPL_LINK( ScDataFormDlg, Impl_DeleteHdl, PushButton*, pBtn)
365
{   
366
    ScViewData*	pViewData = pTabViewShell->GetViewData();
367
    ScDocShell* pDocSh = pViewData->GetDocShell();
368
    if (pDoc)
369
    {
370
		ScRange aRange(nStartCol, aCurrentRow, nTab, nEndCol, aCurrentRow, nTab);
371
		pDoc->DeleteRow(aRange);
372
		
373
		FillCtrls(aCurrentRow);
374
		pDocSh->SetDocumentModified();
375
		pDocSh->PostPaintGridAll();
376
    }
377
    return 0;
378
}
379
380
IMPL_LINK( ScDataFormDlg, Impl_CloseHdl, PushButton*, pBtn)
381
{   
382
    EndDialog( );
383
    return 0;
384
}
385
386
IMPL_LINK( ScDataFormDlg, Impl_ScrollHdl, ScrollBar*, EMPTYARG)
387
{   
388
    long nOffset = aSlider.GetThumbPos();
389
    aCurrentRow = nStartRow + nOffset + 1;
390
    FillCtrls(aCurrentRow);
391
    return 0;
392
}
(-)ori/sc/source/ui/miscdlgs/makefile.mk (+1 lines)
Lines 54-59 Link Here
54
# --- Files --------------------------------------------------------
54
# --- Files --------------------------------------------------------
55
55
56
SLOFILES =  \
56
SLOFILES =  \
57
	$(SLO)$/datafdlg.obj		\
57
	$(SLO)$/delcldlg.obj		\
58
	$(SLO)$/delcldlg.obj		\
58
	$(SLO)$/inscldlg.obj		\
59
	$(SLO)$/inscldlg.obj		\
59
	$(SLO)$/delcodlg.obj		\
60
	$(SLO)$/delcodlg.obj		\
(-)ori/sc/source/ui/src/datafdlg.src (+108 lines)
Line 0 Link Here
1
/*************************************************************************
2
 *
3
 *  OpenOffice.org - a multi-platform office productivity suite
4
 *
5
 *  $RCSfile: datafdlg.src,v $
6
 *
7
 *  $Revision: 1.00 $
8
 *
9
 *  last change: $Author: hr $ $Date: 2005/09/23 15:07:30 $
10
 *
11
 *  The Contents of this file are made available subject to
12
 *  the terms of GNU Lesser General Public License Version 2.1.
13
 *
14
 *
15
 *    GNU Lesser General Public License Version 2.1
16
 *    =============================================
17
 *    Copyright 2005 by Sun Microsystems, Inc.
18
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
19
 *
20
 *    This library is free software; you can redistribute it and/or
21
 *    modify it under the terms of the GNU Lesser General Public
22
 *    License version 2.1, as published by the Free Software Foundation.
23
 *
24
 *    This library is distributed in the hope that it will be useful,
25
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
26
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
27
 *    Lesser General Public License for more details.
28
 *
29
 *    You should have received a copy of the GNU Lesser General Public
30
 *    License along with this library; if not, write to the Free Software
31
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32
 *    MA  02111-1307  USA
33
 *
34
 ************************************************************************/
35
36
#include "datafdlg.hrc"
37
38
//zhangyun, dataform
39
ModalDialog RID_SCDLG_DATAFORM
40
{
41
	OutputSize = TRUE ;
42
	SVLook = TRUE ;
43
    Size = MAP_APPFONT ( 191 , 180 ) ;
44
	Text [ en-US ] = "Data Form" ;
45
	Moveable = TRUE ;
46
	Closeable = TRUE ;
47
	FixedText LAB_DATAFORM_RECORDNO
48
	{
49
		Pos = MAP_APPFONT ( 136 , 6 ) ;
50
        Size = MAP_APPFONT ( 50 , 12 ) ;
51
		Text [ en-US ] = "/" ;
52
	};
53
	PushButton BTN_DATAFORM_NEW
54
	{
55
		Pos = MAP_APPFONT ( 135 , 23 ) ;
56
		Size = MAP_APPFONT ( 50 , 14 ) ;
57
		TabStop = TRUE ;
58
		DefButton = TRUE ;
59
		Text [ en-US ] = "New" ;
60
	};
61
	PushButton BTN_DATAFORM_DELETE
62
	{
63
		Pos = MAP_APPFONT ( 135 , 40 ) ;
64
		Size = MAP_APPFONT ( 50 , 14 ) ;
65
		TabStop = TRUE ;
66
		Text [ en-US ] = "Delete" ;
67
	};
68
	PushButton BTN_DATAFORM_RESTORE
69
	{
70
		Pos = MAP_APPFONT ( 135 , 57 ) ;
71
		Size = MAP_APPFONT ( 50 , 14 ) ;
72
		TabStop = TRUE ;
73
		Text [ en-US ] = "Restore" ;
74
	};
75
	PushButton BTN_DATAFORM_LAST
76
	{
77
		Pos = MAP_APPFONT ( 135 , 82 ) ;
78
		Size = MAP_APPFONT ( 50 , 14 ) ;
79
		TabStop = TRUE ;
80
		Text [ en-US ] = "Last Record" ;
81
	};
82
	PushButton BTN_DATAFORM_NEXT
83
	{
84
		Pos = MAP_APPFONT ( 135 , 99 ) ;
85
		Size = MAP_APPFONT ( 50 , 14 ) ;
86
		TabStop = TRUE ;
87
		Text [ en-US ] = "Next Record" ;
88
	};
89
	PushButton BTN_DATAFORM_CLOSE
90
	{
91
		Pos = MAP_APPFONT ( 135 , 116 ) ;
92
		Size = MAP_APPFONT ( 50 , 14 ) ;
93
		TabStop = TRUE ;
94
		Text [ en-US ] = "Close" ;
95
	};
96
	ScrollBar WND_DATAFORM_SCROLLBAR
97
    {
98
        Pos = MAP_APPFONT ( 124 , 6 ) ;
99
        Size = MAP_APPFONT ( 8 , 135 ) ;
100
        HScroll = FALSE ;
101
        TabStop = FALSE ;
102
    };
103
};
104
//end
105
106
107
108
(-)ori/sc/source/ui/src/makefile.mk (+1 lines)
Lines 61-66 Link Here
61
	dbnamdlg.src \
61
	dbnamdlg.src \
62
	subtdlg.src  \
62
	subtdlg.src  \
63
	miscdlgs.src \
63
	miscdlgs.src \
64
	datafdlg.src \
64
	autofmt.src  \
65
	autofmt.src  \
65
	solvrdlg.src \
66
	solvrdlg.src \
66
	tabopdlg.src \
67
	tabopdlg.src \
(-)ori/sc/source/ui/view/cellsh2.cxx (+14 lines)
Lines 229-234 Link Here
229
			}
229
			}
230
			break;
230
			break;
231
231
232
		case SID_DATA_FORM:
233
			{
234
				ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
235
	            DBG_ASSERT(pFact, "ScAbstractFactory create fail!");//CHINA001
236
237
	            AbstractScDataFormDlg* pDlg = pFact->CreateScDataFormDlg( pTabViewShell->GetDialogParent(),ResId(RID_SCDLG_DATAFORM), pTabViewShell);
238
	            DBG_ASSERT(pDlg, "Dialog create fail!");//CHINA001
239
240
	            pDlg->Execute();
241
	            
242
				rReq.Done();
243
			}
244
			break;
245
			
232
		case SID_SUBTOTALS:
246
		case SID_SUBTOTALS:
233
			{
247
			{
234
				const SfxItemSet* pArgs = rReq.GetArgs();
248
				const SfxItemSet* pArgs = rReq.GetArgs();
(-)ori/sc/util/makefile.mk (+1 lines)
Lines 288-293 Link Here
288
		$(SLO)$/filldlg.obj			\
288
		$(SLO)$/filldlg.obj			\
289
		$(SLO)$/delcodlg.obj		\
289
		$(SLO)$/delcodlg.obj		\
290
		$(SLO)$/delcldlg.obj		\
290
		$(SLO)$/delcldlg.obj		\
291
		$(SLO)$/datafdlg.obj		\
291
		$(SLO)$/dapitype.obj	\
292
		$(SLO)$/dapitype.obj	\
292
		$(SLO)$/dapidata.obj	\
293
		$(SLO)$/dapidata.obj	\
293
		$(SLO)$/crdlg.obj			\
294
		$(SLO)$/crdlg.obj			\

Return to issue 75050