summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRafael Dominguez <venccsralph@gmail.com>2012-08-08 22:58:30 -0430
committerRafael Dominguez <venccsralph@gmail.com>2012-08-10 17:12:28 -0430
commitf6ea2e072940d897cfef4ee5f837c47a8321a8f3 (patch)
tree1ade92de17ab7deea0853678c131d4b278ff202b /sfx2
parent3639f46e481d1ce661bc51b664fab9904eee8d43 (diff)
Show Template Manager instead of old dialog when creating a template.
- Only when experimental features is set. Change-Id: I81e2bba38506757afe202cba5c69560e3fa89f3c
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/appopen.cxx43
1 files changed, 33 insertions, 10 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index c162f3c14b22..1d1798ffb659 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -65,6 +65,7 @@
#include <unotools/localfilehelper.hxx>
#include <unotools/pathoptions.hxx>
#include <unotools/moduleoptions.hxx>
+#include <svtools/miscopt.hxx>
#include <svtools/templdlg.hxx>
#include <osl/file.hxx>
#include <unotools/extendedsecurityoptions.hxx>
@@ -98,6 +99,7 @@
#include <sfx2/filedlghelper.hxx>
#include <sfx2/docfac.hxx>
#include <sfx2/event.hxx>
+#include "templatedlg.hxx"
#include "openuriexternally.hxx"
using namespace ::com::sun::star;
@@ -563,22 +565,43 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
SfxErrorContext aEc(ERRCTX_SFX_NEWDOC);
if ( !pTemplNameItem && !pTemplFileNameItem )
{
- Window* pTopWin = GetTopWindow();
- SvtDocumentTemplateDialog* pDocTemplDlg = new SvtDocumentTemplateDialog( NULL );
- int nRet = pDocTemplDlg->Execute();
sal_Bool bNewWin = sal_False;
- if ( nRet == RET_OK )
+ Window* pTopWin = GetTopWindow();
+
+ SvtMiscOptions aMiscOptions;
+ if ( !aMiscOptions.IsExperimentalMode() )
{
- rReq.Done();
- if ( pTopWin != GetTopWindow() )
+ SvtDocumentTemplateDialog* pDocTemplDlg = new SvtDocumentTemplateDialog( NULL );
+ int nRet = pDocTemplDlg->Execute();
+ if ( nRet == RET_OK )
{
- // the dialogue opens a document -> a new TopWindow appears
- pTopWin = GetTopWindow();
- bNewWin = sal_True;
+ rReq.Done();
+ if ( pTopWin != GetTopWindow() )
+ {
+ // the dialogue opens a document -> a new TopWindow appears
+ pTopWin = GetTopWindow();
+ bNewWin = sal_True;
+ }
+ }
+
+ delete pDocTemplDlg;
+ }
+ else
+ {
+ SfxTemplateManagerDlg aTemplDlg(NULL);
+ int nRet = aTemplDlg.Execute();
+ if ( nRet == RET_OK )
+ {
+ rReq.Done();
+ if ( pTopWin != GetTopWindow() )
+ {
+ // the dialogue opens a document -> a new TopWindow appears
+ pTopWin = GetTopWindow();
+ bNewWin = sal_True;
+ }
}
}
- delete pDocTemplDlg;
if ( bNewWin && pTopWin )
// after the destruction of the dialogue its parent comes to top,
// but we want that the new document is on top