diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-04-25 11:14:38 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:17 +0100 |
commit | 88ab6e32f70bf6ae3cbe0677942b71701069b4db (patch) | |
tree | 661768dd2948d27cfcbdad55917448e4181acb53 /sfx2 | |
parent | df5e8df4598c27a348dac30557535ec9205e3c04 (diff) |
park VclBuilder integration into SfxModalDialog for the moment
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/basedlgs.hxx | 6 | ||||
-rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 44 |
2 files changed, 48 insertions, 2 deletions
diff --git a/sfx2/inc/sfx2/basedlgs.hxx b/sfx2/inc/sfx2/basedlgs.hxx index cc90161cb78c..1461177a2b33 100644 --- a/sfx2/inc/sfx2/basedlgs.hxx +++ b/sfx2/inc/sfx2/basedlgs.hxx @@ -22,9 +22,10 @@ #include "sal/config.h" #include "sfx2/dllapi.h" #include "sal/types.h" +#include <vcl/builder.hxx> +#include <vcl/dialog.hxx> #include <vcl/floatwin.hxx> #include <vcl/timer.hxx> -#include <vcl/dialog.hxx> class TabPage; class SfxTabPage; @@ -69,7 +70,10 @@ private: SAL_DLLPRIVATE void init(); protected: + VclBuilder *m_pUIBuilder; + SfxModalDialog(Window *pParent, const ResId& ); + SfxModalDialog(Window *pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription ); SfxModalDialog(Window* pParent, sal_uInt32 nUniqueId, WinBits nWinStyle = WB_STDMODAL ); String& GetExtraData() { return aExtraData; } diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index 37a1e493eaea..d6c4fb041c7f 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -18,6 +18,7 @@ */ #include <stdlib.h> +#include <comphelper/processfactory.hxx> #include <vcl/fixed.hxx> #include <vcl/help.hxx> #include <vcl/msgbox.hxx> @@ -162,8 +163,47 @@ SfxModalDialog::SfxModalDialog(Window* pParent, const ResId &rResId ) : ModalDialog(pParent, rResId), nUniqId(rResId.GetId()), pInputSet(0), + pOutputSet(0), + m_pUIBuilder(0) +{ + init(); +} + +#define BASEPATH_SHARE_LAYER rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIConfig")) +#define RELPATH_SHARE_LAYER rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("soffice.cfg")) +#define SERVICENAME_PATHSETTINGS rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.PathSettings")) + +SfxModalDialog::SfxModalDialog(Window *pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription ) +: ModalDialog(pParent, 0), //todo + nUniqId(0), //todo + pInputSet(0), pOutputSet(0) { + namespace css = ::com::sun::star; + + /*to-do, check if user config has an override before using shared one, etc*/ + css::uno::Reference< css::beans::XPropertySet > xPathSettings( + ::comphelper::getProcessServiceFactory()->createInstance(SERVICENAME_PATHSETTINGS), + css::uno::UNO_QUERY_THROW); + + ::rtl::OUString sShareLayer; + xPathSettings->getPropertyValue(BASEPATH_SHARE_LAYER) >>= sShareLayer; + + // "UIConfig" is a "multi path" ... use first part only here! + sal_Int32 nPos = sShareLayer.indexOf(';'); + if (nPos > 0) + sShareLayer = sShareLayer.copy(0, nPos); + + // Note: May be an user uses URLs without a final slash! Check it ... + nPos = sShareLayer.lastIndexOf('/'); + if (nPos != sShareLayer.getLength()-1) + sShareLayer += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + + sShareLayer += RELPATH_SHARE_LAYER; // folder + sShareLayer += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/")); + /*to-do, can we merge all this foo with existing soffice.cfg finding code, etc*/ + + m_pUIBuilder = new VclBuilder(this, sShareLayer + rUIXMLDescription, rID); init(); } @@ -182,7 +222,8 @@ SfxModalDialog::SfxModalDialog(Window* pParent, ModalDialog(pParent, nWinStyle), nUniqId(nUniqueId), pInputSet(0), - pOutputSet(0) + pOutputSet(0), + m_pUIBuilder(0) { init(); } @@ -199,6 +240,7 @@ SfxModalDialog::~SfxModalDialog() { SetDialogData_Impl(); delete pOutputSet; + delete m_pUIBuilder; } void SfxModalDialog::CreateOutputItemSet( SfxItemPool& rPool ) |