sc/inc/sc.hrc | 1 + sc/inc/scabstdlg.hxx | 8 ++++++++ sc/source/ui/attrdlg/scdlgfact.cxx | 12 ++++++++++-- sc/source/ui/attrdlg/scdlgfact.hxx | 10 ++++++++++ sc/source/ui/inc/xmlsourcedlg.hrc | 3 ++- sc/source/ui/inc/xmlsourcedlg.hxx | 7 ++++++- sc/source/ui/view/cellsh1.cxx | 17 ++++++++++++++++- sc/source/ui/xmlsource/xmlsourcedlg.cxx | 9 +++++++++ 8 files changed, 62 insertions(+), 5 deletions(-)
New commits: commit bf9f5d803cf1ed2db723be76fd7ab80c64e9e74e Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Wed Sep 26 20:21:03 2012 -0400 Launch the dialog for real. Change-Id: I974599f3bd30f5a70bad69d9fde727fef965933c diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 220896e..c75a000 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2441,7 +2441,22 @@ void ScCellShell::ExecuteDataPilotDialog() void ScCellShell::ExecuteXMLSourceDialog() { - fprintf(stdout, "ScCellShell::ExecuteXMLSourceDialog: launch xml dialog\n"); + ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); + if (!pFact) + return; + + ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell(); + if (!pTabViewShell) + return; + + boost::scoped_ptr<AbstractScXMLSourceDlg> pDlg( + pFact->CreateScXMLSourceDlg( + pTabViewShell->GetDialogParent(), RID_SCDLG_XML_SOURCE)); + + if (!pDlg) + return; + + pDlg->Execute(); } void ScCellShell::ExecuteSubtotals(SfxRequest& rReq) commit 10e83f59bf63e9fb6da7857bc9b21d3342b06775 Author: Kohei Yoshida <kohei.yosh...@gmail.com> Date: Wed Sep 26 20:13:42 2012 -0400 Abstract dialog instantiation code. Change-Id: I28e7b354928d349d9f6c90092ead2010cfe3c29b diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 0dcb1fe..5e5fad0 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -1088,6 +1088,7 @@ #define RID_SCDLG_FORMULA_CALCOPTIONS (SC_DIALOGS_START + 157) #define RID_SCDLG_COND_FORMAT_MANAGER (SC_DIALOGS_START + 158) +#define RID_SCDLG_XML_SOURCE (SC_DIALOGS_START + 159) #define SC_DIALOGS_END (SC_DIALOGS_START + 160) diff --git a/sc/inc/scabstdlg.hxx b/sc/inc/scabstdlg.hxx index 7081ddb..9623615 100644 --- a/sc/inc/scabstdlg.hxx +++ b/sc/inc/scabstdlg.hxx @@ -334,6 +334,11 @@ public: virtual bool IsDateConversionSet() const = 0; }; +class AbstractScXMLSourceDlg : public VclAbstractDialog +{ +public: +}; + //-------Scabstract fractory --------------------------- class ScAbstractDialogFactory { @@ -531,6 +536,9 @@ public: const SfxItemSet* pArgSet,int nId, ScTabViewShell *pTabVwSh ) = 0; virtual SfxAbstractTabDialog * CreateScSortDlg( Window* pParent, //add for ScSortDlg const SfxItemSet* pArgSet,int nId ) = 0; + + virtual AbstractScXMLSourceDlg* CreateScXMLSourceDlg(Window* pParent, int nId) = 0; + // for tabpage virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ) = 0; virtual GetTabPageRanges GetTabPageRangesFunc( sal_uInt16 nId ) = 0; diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 4dd4bc3..9257a9e 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -82,6 +82,7 @@ #include "colorformat.hxx" #include "condformatdlg.hxx" #include "condformatmgr.hxx" +#include "xmlsourcedlg.hxx" // ause #include "editutil.hxx" @@ -123,6 +124,7 @@ IMPL_ABSTDLG_BASE(AbstractScStringInputDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScTabBgColorDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScImportOptionsDlg_Impl); IMPL_ABSTDLG_BASE(AbstractScTextImportOptionsDlg_Impl); +IMPL_ABSTDLG_BASE(AbstractScXMLSourceDlg_Impl); IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); // AbstractTabDialog_Impl begin @@ -685,8 +687,6 @@ AbstractScTextImportOptionsDlg * ScAbstractDialogFactory_Impl::CreateScTextImpor return pDlg ? new AbstractScTextImportOptionsDlg_Impl(pDlg) : NULL; } - - AbstractScAutoFormatDlg * ScAbstractDialogFactory_Impl::CreateScAutoFormatDlg( Window* pParent, ScAutoFormat* pAutoFormat, const ScAutoFormatData* pSelFormatData, @@ -1595,6 +1595,14 @@ SfxAbstractTabDialog * ScAbstractDialogFactory_Impl::CreateScSortDlg( Window* return new AbstractTabDialog_Impl( pDlg ); return 0; } + +AbstractScXMLSourceDlg* ScAbstractDialogFactory_Impl::CreateScXMLSourceDlg(Window* pParent, int nId) +{ + ScXMLSourceDlg* pDlg = (nId == RID_SCDLG_XML_SOURCE) ? new ScXMLSourceDlg(pParent) : NULL; + + return pDlg ? new AbstractScXMLSourceDlg_Impl(pDlg) : NULL; +} + #undef SfxTabDialog #undef AbstractTabDialog_Impl diff --git a/sc/source/ui/attrdlg/scdlgfact.hxx b/sc/source/ui/attrdlg/scdlgfact.hxx index b4c6ddc..73b35d9 100644 --- a/sc/source/ui/attrdlg/scdlgfact.hxx +++ b/sc/source/ui/attrdlg/scdlgfact.hxx @@ -66,6 +66,7 @@ class ScTextImportOptionsDlg; class ScDataBarSettingsDlg; class ScCondFormatDlg; class ScCondFormatManagerDlg; +class ScXMLSourceDlg; #define DECL_ABSTDLG_BASE(Class,DialogClass) \ DialogClass* pDlg; \ @@ -389,6 +390,11 @@ class AbstractScTextImportOptionsDlg_Impl : public AbstractScTextImportOptionsDl virtual bool IsDateConversionSet() const; }; +class AbstractScXMLSourceDlg_Impl : public AbstractScXMLSourceDlg +{ + DECL_ABSTDLG_BASE(AbstractScXMLSourceDlg_Impl, ScXMLSourceDlg) +}; + //add for ScAttrDlg , ScHFEditDlg, ScStyleDlg, ScSubTotalDlg, ScCharDlg, ScParagraphDlg, ScValidationDlg, ScSortDlg class AbstractTabDialog_Impl : public SfxAbstractTabDialog { @@ -401,6 +407,7 @@ class AbstractTabDialog_Impl : public SfxAbstractTabDialog virtual void SetText( const XubString& rStr ); virtual String GetText() const; }; + //------------------------------------------------------------------------ //AbstractDialogFactory_Impl implementations class ScAbstractDialogFactory_Impl : public ScAbstractDialogFactory @@ -602,6 +609,9 @@ public: virtual SfxAbstractTabDialog * CreateScSortDlg( Window* pParent, //add for ScSortDlg const SfxItemSet* pArgSet,int nId ); + + virtual AbstractScXMLSourceDlg* CreateScXMLSourceDlg(Window* pParent, int nId); + // For TabPage virtual CreateTabPage GetTabPageCreatorFunc( sal_uInt16 nId ); diff --git a/sc/source/ui/inc/xmlsourcedlg.hrc b/sc/source/ui/inc/xmlsourcedlg.hrc index 323ef7c..b87b6a3 100644 --- a/sc/source/ui/inc/xmlsourcedlg.hrc +++ b/sc/source/ui/inc/xmlsourcedlg.hrc @@ -9,6 +9,7 @@ #include "sc.hrc" - +#define BTN_OK 0 +#define BTN_CANCEL 1 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file diff --git a/sc/source/ui/inc/xmlsourcedlg.hxx b/sc/source/ui/inc/xmlsourcedlg.hxx index 6177cf3..3d0237f 100644 --- a/sc/source/ui/inc/xmlsourcedlg.hxx +++ b/sc/source/ui/inc/xmlsourcedlg.hxx @@ -10,8 +10,13 @@ #ifndef __SC_XMLSOURCEDLG_HXX__ #define __SC_XMLSOURCEDLG_HXX__ -class XMLSourceDlg +#include "vcl/dialog.hxx" + +class ScXMLSourceDlg : public ModalDialog { +public: + ScXMLSourceDlg(Window* pParent); + virtual ~ScXMLSourceDlg(); }; #endif diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 59a133c..01a09dd 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -10,4 +10,13 @@ #include "xmlsourcedlg.hxx" #include "xmlsourcedlg.hrc" +ScXMLSourceDlg::ScXMLSourceDlg(Window* pParent) : + ModalDialog(pParent, RID_SCDLG_XML_SOURCE) +{ +} + +ScXMLSourceDlg::~ScXMLSourceDlg() +{ +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits