diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-04-15 14:17:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-04-15 14:43:48 +0100 |
commit | 73318c3db8031127574a3371bf737eb926006d7b (patch) | |
tree | 6b47380b37f06b78539334b9a995efbf1f6933e1 /sc/source | |
parent | 5afadf4b7990cada27a62dc1aa7e97cc4ad3394d (diff) |
adapt code to select source .ui
Change-Id: I65d3f5acbe95985269c03b3e0c57c5cc80ca30d4
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 26 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/dbgui/dapitype.cxx | 57 | ||||
-rw-r--r-- | sc/source/ui/dbgui/dapitype.hrc | 6 | ||||
-rw-r--r-- | sc/source/ui/dbgui/dapitype.src | 77 | ||||
-rw-r--r-- | sc/source/ui/inc/dapitype.hxx | 18 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 2 |
7 files changed, 39 insertions, 150 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 0a24dd6fa88b..e9945b83f0d0 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -773,31 +773,13 @@ AbstractScDataPilotDatabaseDlg * ScAbstractDialogFactory_Impl::CreateScDataPilo return 0; } - - -AbstractScDataPilotSourceTypeDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSourceTypeDlg( Window* pParent, - sal_Bool bEnableExternal, - int nId ) +AbstractScDataPilotSourceTypeDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotSourceTypeDlg( + Window* pParent, bool bEnableExternal) { - ScDataPilotSourceTypeDlg * pDlg=NULL; - switch ( nId ) - { - case RID_SCDLG_DAPITYPE : - pDlg = new ScDataPilotSourceTypeDlg( pParent, bEnableExternal ); - break; - default: - break; - } - - if ( pDlg ) - return new AbstractScDataPilotSourceTypeDlg_Impl( pDlg ); - return 0; + ScDataPilotSourceTypeDlg* pDlg = new ScDataPilotSourceTypeDlg(pParent, bEnableExternal); + return new AbstractScDataPilotSourceTypeDlg_Impl(pDlg); } -// add for ScDataPilotSourceTypeDlg end - - - AbstractScDataPilotServiceDlg* ScAbstractDialogFactory_Impl::CreateScDataPilotServiceDlg( Window* pParent, const com::sun::star::uno::Sequence<OUString>& rServices, int nId ) diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index a86192bb02c6..a18767c5acc2 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -426,7 +426,8 @@ public: virtual AbstractScDataPilotDatabaseDlg * CreateScDataPilotDatabaseDlg (Window* pParent ,int nId ); //add for ScDataPilotDatabaseDlg - virtual AbstractScDataPilotSourceTypeDlg * CreateScDataPilotSourceTypeDlg ( Window* pParent, sal_Bool bEnableExternal, int nId ) ; //add for ScDataPilotSourceTypeDlg + virtual AbstractScDataPilotSourceTypeDlg* CreateScDataPilotSourceTypeDlg(Window* pParent, + bool bEnableExternal); virtual AbstractScDataPilotServiceDlg * CreateScDataPilotServiceDlg( Window* pParent, //add for ScDataPilotServiceDlg const com::sun::star::uno::Sequence<OUString>& rServices, diff --git a/sc/source/ui/dbgui/dapitype.cxx b/sc/source/ui/dbgui/dapitype.cxx index 2ccd998c5aac..a6f33df6e77b 100644 --- a/sc/source/ui/dbgui/dapitype.cxx +++ b/sc/source/ui/dbgui/dapitype.cxx @@ -33,34 +33,27 @@ using namespace com::sun::star; //------------------------------------------------------------------------- -ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg( Window* pParent, sal_Bool bEnableExternal ) : - ModalDialog ( pParent, ScResId( RID_SCDLG_DAPITYPE ) ), - // - aFlFrame ( this, ScResId( FL_FRAME ) ), - aBtnSelection ( this, ScResId( BTN_SELECTION ) ), - aBtnNamedRange ( this, ScResId( BTN_NAMED_RANGE ) ), - aBtnDatabase ( this, ScResId( BTN_DATABASE ) ), - aBtnExternal ( this, ScResId( BTN_EXTERNAL ) ), - aLbNamedRange ( this, ScResId( LB_NAMED_RANGE ) ), - aBtnOk ( this, ScResId( BTN_OK ) ), - aBtnCancel ( this, ScResId( BTN_CANCEL ) ), - aBtnHelp ( this, ScResId( BTN_HELP ) ) +ScDataPilotSourceTypeDlg::ScDataPilotSourceTypeDlg(Window* pParent, bool bEnableExternal) + : ModalDialog( pParent, "SelectSourceDialog", "modules/scalc/ui/selectsource.ui" ) { - aBtnSelection.SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); - aBtnNamedRange.SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); - aBtnDatabase.SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); - aBtnExternal.SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); + get(m_pBtnSelection, "selection"); + get(m_pBtnNamedRange, "namedrange"); + get(m_pBtnDatabase, "database"); + get(m_pBtnExternal, "external"); + get(m_pLbNamedRange, "rangelb"); + m_pBtnSelection->SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); + m_pBtnNamedRange->SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); + m_pBtnDatabase->SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); + m_pBtnExternal->SetClickHdl( LINK(this, ScDataPilotSourceTypeDlg, RadioClickHdl) ); if (!bEnableExternal) - aBtnExternal.Disable(); + m_pBtnExternal->Disable(); - aBtnSelection.Check(); + m_pBtnSelection->Check(); // Disabled unless at least one named range exists. - aLbNamedRange.Disable(); - aBtnNamedRange.Disable(); - - FreeResource(); + m_pLbNamedRange->Disable(); + m_pBtnNamedRange->Disable(); } ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg() @@ -69,39 +62,39 @@ ScDataPilotSourceTypeDlg::~ScDataPilotSourceTypeDlg() bool ScDataPilotSourceTypeDlg::IsDatabase() const { - return aBtnDatabase.IsChecked(); + return m_pBtnDatabase->IsChecked(); } bool ScDataPilotSourceTypeDlg::IsExternal() const { - return aBtnExternal.IsChecked(); + return m_pBtnExternal->IsChecked(); } bool ScDataPilotSourceTypeDlg::IsNamedRange() const { - return aBtnNamedRange.IsChecked(); + return m_pBtnNamedRange->IsChecked(); } OUString ScDataPilotSourceTypeDlg::GetSelectedNamedRange() const { - sal_uInt16 nPos = aLbNamedRange.GetSelectEntryPos(); - return aLbNamedRange.GetEntry(nPos); + sal_uInt16 nPos = m_pLbNamedRange->GetSelectEntryPos(); + return m_pLbNamedRange->GetEntry(nPos); } void ScDataPilotSourceTypeDlg::AppendNamedRange(const OUString& rName) { - aLbNamedRange.InsertEntry(rName); - if (aLbNamedRange.GetEntryCount() == 1) + m_pLbNamedRange->InsertEntry(rName); + if (m_pLbNamedRange->GetEntryCount() == 1) { // Select position 0 only for the first time. - aLbNamedRange.SelectEntryPos(0); - aBtnNamedRange.Enable(); + m_pLbNamedRange->SelectEntryPos(0); + m_pBtnNamedRange->Enable(); } } IMPL_LINK( ScDataPilotSourceTypeDlg, RadioClickHdl, RadioButton*, pBtn ) { - aLbNamedRange.Enable(pBtn == &aBtnNamedRange); + m_pLbNamedRange->Enable(pBtn == m_pBtnNamedRange); return 0; } diff --git a/sc/source/ui/dbgui/dapitype.hrc b/sc/source/ui/dbgui/dapitype.hrc index 203677baa4eb..0ed7e8532bdc 100644 --- a/sc/source/ui/dbgui/dapitype.hrc +++ b/sc/source/ui/dbgui/dapitype.hrc @@ -20,10 +20,6 @@ #define BTN_OK 1 #define BTN_CANCEL 2 #define BTN_HELP 3 -#define BTN_SELECTION 4 -#define BTN_NAMED_RANGE 5 -#define BTN_DATABASE 6 -#define BTN_EXTERNAL 7 #define FL_FRAME 8 #define FT_SERVICE 9 @@ -43,6 +39,4 @@ #define FT_OBJTYPE 23 #define LB_OBJTYPE 24 -#define LB_NAMED_RANGE 25 - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/dbgui/dapitype.src b/sc/source/ui/dbgui/dapitype.src index 961bf5887b61..39f34a8fb27f 100644 --- a/sc/source/ui/dbgui/dapitype.src +++ b/sc/source/ui/dbgui/dapitype.src @@ -20,83 +20,6 @@ #include "sc.hrc" #include "dapitype.hrc" - -ModalDialog RID_SCDLG_DAPITYPE -{ - Text [ en-US ] = "Select Source"; - OutputSize = TRUE ; - HelpId = HID_DATAPILOT_TYPE ; - SVLook = TRUE ; - Size = MAP_APPFONT ( 241 , 76 ) ; - Moveable = TRUE ; - Closeable = FALSE ; - - FixedLine FL_FRAME - { - Pos = MAP_APPFONT ( 6 , 6 ) ; - Size = MAP_APPFONT ( 173 , 8 ) ; - Text [ en-US ] = "Selection"; - }; - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 185 , 6 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - DefButton = TRUE ; - }; - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 185 , 23 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 185 , 43 ) ; - Size = MAP_APPFONT ( 50 , 14 ) ; - TabStop = TRUE ; - }; - RadioButton BTN_SELECTION - { - Pos = MAP_APPFONT ( 12 , 18 ) ; - Size = MAP_APPFONT ( 164 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Current selection"; - }; - RadioButton BTN_NAMED_RANGE - { - Pos = MAP_APPFONT ( 12 , 32 ) ; - Size = MAP_APPFONT ( 80 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Named range"; - }; - ListBox LB_NAMED_RANGE - { - Pos = MAP_APPFONT ( 100 , 31 ) ; - Size = MAP_APPFONT ( 70 , 10 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - }; - RadioButton BTN_DATABASE - { - Pos = MAP_APPFONT ( 12 , 46 ) ; - Size = MAP_APPFONT ( 164 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~Data source registered in %PRODUCTNAME"; - }; - RadioButton BTN_EXTERNAL - { - Pos = MAP_APPFONT ( 12 , 60 ) ; - Size = MAP_APPFONT ( 164 , 10 ) ; - TabStop = TRUE ; - Text [ en-US ] = "~External source/interface"; - }; -}; - - -//------------------------------------------------------------------------ - - ModalDialog RID_SCDLG_DAPISERVICE { OutputSize = TRUE ; diff --git a/sc/source/ui/inc/dapitype.hxx b/sc/source/ui/inc/dapitype.hxx index c74ae8a6ef2d..9cdbccb0bb4a 100644 --- a/sc/source/ui/inc/dapitype.hxx +++ b/sc/source/ui/inc/dapitype.hxx @@ -32,19 +32,15 @@ class ScDataPilotSourceTypeDlg : public ModalDialog { private: - FixedLine aFlFrame; - RadioButton aBtnSelection; - RadioButton aBtnNamedRange; - RadioButton aBtnDatabase; - RadioButton aBtnExternal; - ListBox aLbNamedRange; - OKButton aBtnOk; - CancelButton aBtnCancel; - HelpButton aBtnHelp; + RadioButton* m_pBtnSelection; + RadioButton* m_pBtnNamedRange; + RadioButton* m_pBtnDatabase; + RadioButton* m_pBtnExternal; + ListBox* m_pLbNamedRange; public: - ScDataPilotSourceTypeDlg( Window* pParent, sal_Bool bEnableExternal ); - ~ScDataPilotSourceTypeDlg(); + ScDataPilotSourceTypeDlg(Window* pParent, bool bEnableExternal); + ~ScDataPilotSourceTypeDlg(); bool IsDatabase() const; bool IsExternal() const; diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index ccb39b0c3222..528191bb1e01 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2479,7 +2479,7 @@ void ScCellShell::ExecuteDataPilotDialog() ::boost::scoped_ptr<AbstractScDataPilotSourceTypeDlg> pTypeDlg( pFact->CreateScDataPilotSourceTypeDlg( - pTabViewShell->GetDialogParent(), bEnableExt, RID_SCDLG_DAPITYPE)); + pTabViewShell->GetDialogParent(), bEnableExt)); // Populate named ranges (if any). ScRangeName* pRangeName = pDoc->GetRangeName(); |