diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-11-14 23:30:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-11-17 20:10:50 +0000 |
commit | 77d6f58dddcc9aba0c9262c9ebb62f56e2845838 (patch) | |
tree | 15d2eda6a1ca069b22326ff2a2d09a5346f7338a /sc/source/ui | |
parent | 3b238706737c36d4772ec3f95b52fbde978bf20a (diff) |
convert text import options to .ui
Change-Id: Ice6228f0548507b0400c25f40d8aa7cb557c8088
Diffstat (limited to 'sc/source/ui')
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.cxx | 17 | ||||
-rw-r--r-- | sc/source/ui/attrdlg/scdlgfact.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/dbgui/textimportoptions.cxx | 55 | ||||
-rw-r--r-- | sc/source/ui/dbgui/textimportoptions.src | 102 | ||||
-rw-r--r-- | sc/source/ui/inc/textimportoptions.hrc | 30 | ||||
-rw-r--r-- | sc/source/ui/inc/textimportoptions.hxx | 16 | ||||
-rw-r--r-- | sc/source/ui/unoobj/filtuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun5.cxx | 4 |
8 files changed, 36 insertions, 194 deletions
diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index a23d0edf3f8f..f0fe0d65845e 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -668,23 +668,12 @@ AbstractScImportAsciiDlg * ScAbstractDialogFactory_Impl::CreateScImportAsciiDlg } // ScImportAsciiDlg end -AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg( Window* pParent, int nId ) +AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImportOptionsDlg(Window* pParent) { - ScTextImportOptionsDlg* pDlg = NULL; - switch (nId) - { - case RID_SCDLG_TEXT_IMPORT_OPTIONS: - pDlg = new ScTextImportOptionsDlg(pParent); - break; - default: - ; - } - - return pDlg ? new AbstractScTextImportOptionsDlg_Impl(pDlg) : NULL; + ScTextImportOptionsDlg* pDlg = new ScTextImportOptionsDlg(pParent); + return new AbstractScTextImportOptionsDlg_Impl(pDlg); } - - AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg( Window* pParent, ScAutoFormat* pAutoFormat, const ScAutoFormatData* pSelFormatData, diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index dfbd7fd272c7..2e16c9670951 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -401,7 +401,7 @@ public: SvStream* pInStream, int nId, ScImportAsciiCall eCall); - virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg( Window* pParent, int nId ); + virtual AbstractScTextImportOptionsDlg * CreateScTextImportOptionsDlg(Window* pParent); virtual AbstractScAutoFormatDlg * CreateScAutoFormatDlg( Window* pParent, //add for ScAutoFormatDlg ScAutoFormat* pAutoFormat, diff --git a/sc/source/ui/dbgui/textimportoptions.cxx b/sc/source/ui/dbgui/textimportoptions.cxx index 122151d8d0fa..503a5e4f5c4d 100644 --- a/sc/source/ui/dbgui/textimportoptions.cxx +++ b/sc/source/ui/dbgui/textimportoptions.cxx @@ -32,27 +32,18 @@ //------------------------------------------------------------------------ #include "textimportoptions.hxx" -#include "textimportoptions.hrc" - -#include "scresid.hxx" -#include "vcl/window.hxx" -#include "vcl/msgbox.hxx" #include "vcl/svapp.hxx" +#include "vcl/msgbox.hxx" +#include "vcl/window.hxx" -ScTextImportOptionsDlg::ScTextImportOptionsDlg(Window* pParent) : - ModalDialog(pParent, ScResId(RID_SCDLG_TEXT_IMPORT_OPTIONS)), - - maBtnOk(this, ScResId(BTN_OK)), - maBtnCancel(this, ScResId(BTN_CANCEL)), - maBtnHelp(this, ScResId(BTN_HELP)), - maFlChooseLang(this, ScResId(FL_CHOOSE_LANG)), - maRbAutomatic(this, ScResId(RB_AUTOMATIC)), - maRbCustom(this, ScResId(RB_CUSTOM)), - maLbCustomLang(this, ScResId(LB_CUSTOM_LANG)), - maFlOption(this, ScResId(FL_OPTION)), - maBtnConvertDate(this, ScResId(BTN_CONVERT_DATE)) +ScTextImportOptionsDlg::ScTextImportOptionsDlg(Window* pParent) + : ModalDialog(pParent, "TextImportOptionsDialog", "modules/scalc/ui/textimportoptions.ui") { - FreeResource(); + get(m_pBtnOk, "ok"); + get(m_pRbAutomatic, "automatic"); + get(m_pRbCustom, "custom"); + get(m_pBtnConvertDate, "convertdata"); + get(m_pLbCustomLang, "lang"); init(); } @@ -67,33 +58,33 @@ short ScTextImportOptionsDlg::Execute() LanguageType ScTextImportOptionsDlg::getLanguageType() const { - if (maRbAutomatic.IsChecked()) + if (m_pRbAutomatic->IsChecked()) return LANGUAGE_SYSTEM; - return maLbCustomLang.GetSelectLanguage(); + return m_pLbCustomLang->GetSelectLanguage(); } bool ScTextImportOptionsDlg::isDateConversionSet() const { - return maBtnConvertDate.IsChecked(); + return m_pBtnConvertDate->IsChecked(); } void ScTextImportOptionsDlg::init() { Link aLink = LINK( this, ScTextImportOptionsDlg, OKHdl ); - maBtnOk.SetClickHdl(aLink); + m_pBtnOk->SetClickHdl(aLink); aLink = LINK( this, ScTextImportOptionsDlg, RadioHdl ); - maRbAutomatic.SetClickHdl(aLink); - maRbCustom.SetClickHdl(aLink); + m_pRbAutomatic->SetClickHdl(aLink); + m_pRbCustom->SetClickHdl(aLink); - maRbAutomatic.Check(true); + m_pRbAutomatic->Check(true); - maLbCustomLang.SetLanguageList( + m_pLbCustomLang->SetLanguageList( LANG_LIST_ALL | LANG_LIST_ONLY_KNOWN, false, false); LanguageType eLang = Application::GetSettings().GetLanguage(); - maLbCustomLang.SelectLanguage(eLang); - maLbCustomLang.Disable(); + m_pLbCustomLang->SelectLanguage(eLang); + m_pLbCustomLang->Disable(); } IMPL_LINK_NOARG(ScTextImportOptionsDlg, OKHdl) @@ -104,13 +95,13 @@ IMPL_LINK_NOARG(ScTextImportOptionsDlg, OKHdl) IMPL_LINK( ScTextImportOptionsDlg, RadioHdl, RadioButton*, pBtn ) { - if (pBtn == &maRbAutomatic) + if (pBtn == m_pRbAutomatic) { - maLbCustomLang.Disable(); + m_pLbCustomLang->Disable(); } - else if (pBtn == &maRbCustom) + else if (pBtn == m_pRbCustom) { - maLbCustomLang.Enable(); + m_pLbCustomLang->Enable(); } return 0; } diff --git a/sc/source/ui/dbgui/textimportoptions.src b/sc/source/ui/dbgui/textimportoptions.src deleted file mode 100644 index f09e31c6b07a..000000000000 --- a/sc/source/ui/dbgui/textimportoptions.src +++ /dev/null @@ -1,102 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include "textimportoptions.hrc" - -ModalDialog RID_SCDLG_TEXT_IMPORT_OPTIONS -{ - HelpID = "sc:ModalDialog:RID_SCDLG_TEXT_IMPORT_OPTIONS"; - Text [ en-US ] = "Import Options" ; - Size = MAP_APPFONT ( 230 , 101 ) ; - Moveable = TRUE ; - Closeable = TRUE ; - OutputSize = TRUE ; - - OKButton BTN_OK - { - Pos = MAP_APPFONT ( 175, 6 ) ; - Size = MAP_APPFONT ( 50, 14 ) ; - DefButton = TRUE ; - }; - - CancelButton BTN_CANCEL - { - Pos = MAP_APPFONT ( 175, 23 ) ; - Size = MAP_APPFONT ( 50, 14 ) ; - }; - - HelpButton BTN_HELP - { - Pos = MAP_APPFONT ( 175, 43 ) ; - Size = MAP_APPFONT ( 50, 14 ) ; - }; - - FixedLine FL_CHOOSE_LANG - { - Pos = MAP_APPFONT( 6, 3 ) ; - Size = MAP_APPFONT( 165, 14 ) ; - - Text [ en-US ] = "Select the language to use for import" ; - }; - - RadioButton RB_AUTOMATIC - { - HelpID = "sc:RadioButton:RID_SCDLG_TEXT_IMPORT_OPTIONS:RB_AUTOMATIC"; - Pos = MAP_APPFONT( 12, 20 ) ; - Size = MAP_APPFONT( 159, 10 ) ; - TabStop = TRUE ; - - Text [ en-US ] = "Automatic" ; - }; - - RadioButton RB_CUSTOM - { - HelpID = "sc:RadioButton:RID_SCDLG_TEXT_IMPORT_OPTIONS:RB_CUSTOM"; - Pos = MAP_APPFONT( 12, 34 ) ; - Size = MAP_APPFONT( 159, 10 ) ; - TabStop = TRUE ; - - Text [ en-US ] = "Custom" ; - }; - - ListBox LB_CUSTOM_LANG - { - HelpID = "sc:ListBox:RID_SCDLG_TEXT_IMPORT_OPTIONS:LB_CUSTOM_LANG"; - Pos = MAP_APPFONT( 20, 50 ) ; - Size = MAP_APPFONT( 140, 120 ) ; - TabStop = TRUE ; - DropDown = TRUE ; - Sort = TRUE ; - }; - - FixedLine FL_OPTION - { - Pos = MAP_APPFONT( 6, 70 ); - Size = MAP_APPFONT( 165, 14 ); - Text [ en-US ] = "Options" ; - }; - - CheckBox BTN_CONVERT_DATE - { - HelpID = "sc:CheckBox:RID_SCDLG_TEXT_IMPORT_OPTIONS:BTN_CONVERT_DATE"; - Pos = MAP_APPFONT( 12, 86 ); - Size = MAP_APPFONT( 159, 10 ); - TabStop = TRUE ; - Text [ en-US ] = "Detect special numbers (such as dates)." ; - }; -}; diff --git a/sc/source/ui/inc/textimportoptions.hrc b/sc/source/ui/inc/textimportoptions.hrc deleted file mode 100644 index ea346cdecbf0..000000000000 --- a/sc/source/ui/inc/textimportoptions.hrc +++ /dev/null @@ -1,30 +0,0 @@ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <sc.hrc> - -#define BTN_OK 1 -#define BTN_CANCEL 2 -#define BTN_HELP 3 - -#define FL_CHOOSE_LANG 4 -#define RB_AUTOMATIC 5 -#define RB_CUSTOM 6 -#define LB_CUSTOM_LANG 7 -#define FL_OPTION 8 -#define BTN_CONVERT_DATE 9 diff --git a/sc/source/ui/inc/textimportoptions.hxx b/sc/source/ui/inc/textimportoptions.hxx index 27be357cef3e..31cdeec6a391 100644 --- a/sc/source/ui/inc/textimportoptions.hxx +++ b/sc/source/ui/inc/textimportoptions.hxx @@ -50,20 +50,14 @@ private: void init(); private: - OKButton maBtnOk; - CancelButton maBtnCancel; - HelpButton maBtnHelp; + OKButton* m_pBtnOk; - FixedLine maFlChooseLang; + RadioButton* m_pRbAutomatic; + RadioButton* m_pRbCustom; - RadioButton maRbAutomatic; - RadioButton maRbCustom; + SvxLanguageBox* m_pLbCustomLang; - SvxLanguageBox maLbCustomLang; - - FixedLine maFlOption; - - CheckBox maBtnConvertDate; + CheckBox* m_pBtnConvertDate; DECL_LINK(OKHdl, void *); diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index 1d35a9c9048f..bd4afdd644cb 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -236,8 +236,8 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute() throw(uno::RuntimeException) else { // HTML import. - ::std::auto_ptr<AbstractScTextImportOptionsDlg> pDlg( - pFact->CreateScTextImportOptionsDlg(NULL, RID_SCDLG_TEXT_IMPORT_OPTIONS)); + boost::scoped_ptr<AbstractScTextImportOptionsDlg> pDlg( + pFact->CreateScTextImportOptionsDlg(NULL)); if (pDlg->Execute() == RET_OK) { diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx index be970f4250c7..820b7b9e4bc3 100644 --- a/sc/source/ui/view/viewfun5.cxx +++ b/sc/source/ui/view/viewfun5.cxx @@ -309,8 +309,8 @@ sal_Bool ScViewFunc::PasteDataFormat( sal_uLong nFormatId, // this for html pasting only, but in the future it may // make sense to do it for other data types too. ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); - ::std::auto_ptr<AbstractScTextImportOptionsDlg> pDlg( - pFact->CreateScTextImportOptionsDlg(NULL, RID_SCDLG_TEXT_IMPORT_OPTIONS)); + boost::scoped_ptr<AbstractScTextImportOptionsDlg> pDlg( + pFact->CreateScTextImportOptionsDlg(NULL)); if (pDlg->Execute() == RET_OK) { |