Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
3a5f4018
Kaydet (Commit)
3a5f4018
authored
Ara 03, 2012
tarafından
Cédric Bosdonnat
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
New template manager out of experimental features
Change-Id: Ieb6b590060b1ca7a497049e974909c9661f1cc14
üst
ac4d26e3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
114 deletions
+12
-114
appopen.cxx
sfx2/source/appl/appopen.cxx
+8
-29
objserv.cxx
sfx2/source/doc/objserv.cxx
+4
-85
No files found.
sfx2/source/appl/appopen.cxx
Dosyayı görüntüle @
3a5f4018
...
...
@@ -566,37 +566,16 @@ void SfxApplication::NewDocExec_Impl( SfxRequest& rReq )
sal_Bool
bNewWin
=
sal_False
;
Window
*
pTopWin
=
GetTopWindow
();
SvtMiscOptions
aMiscOptions
;
if
(
!
aMiscOptions
.
IsExperimentalMode
()
)
SfxTemplateManagerDlg
aTemplDlg
(
NULL
);
int
nRet
=
aTemplDlg
.
Execute
();
if
(
nRet
==
RET_OK
)
{
SvtDocumentTemplateDialog
*
pDocTemplDlg
=
new
SvtDocumentTemplateDialog
(
NULL
);
int
nRet
=
pDocTemplDlg
->
Execute
();
if
(
nRet
==
RET_OK
)
rReq
.
Done
();
if
(
pTopWin
!=
GetTopWindow
()
)
{
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
;
}
// the dialogue opens a document -> a new TopWindow appears
pTopWin
=
GetTopWindow
();
bNewWin
=
sal_True
;
}
}
...
...
sfx2/source/doc/objserv.cxx
Dosyayı görüntüle @
3a5f4018
...
...
@@ -863,91 +863,10 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
case
SID_DOCTEMPLATE
:
{
// save as document templates
SvtMiscOptions
aMiscOptions
;
if
(
aMiscOptions
.
IsExperimentalMode
()
)
{
SfxTemplateManagerDlg
aDlg
(
NULL
);
aDlg
.
setDocumentModel
(
GetModel
());
aDlg
.
setSaveMode
(
true
);
aDlg
.
Execute
();
}
else
{
SfxDocumentTemplateDlg
*
pDlg
=
0
;
SfxErrorContext
aEc
(
ERRCTX_SFX_DOCTEMPLATE
,
GetTitle
());
SfxDocumentTemplates
*
pTemplates
=
new
SfxDocumentTemplates
;
if
(
!
rReq
.
GetArgs
()
)
{
pDlg
=
new
SfxDocumentTemplateDlg
(
0
,
pTemplates
);
if
(
RET_OK
==
pDlg
->
Execute
()
&&
pDlg
->
GetTemplateName
().
Len
())
{
rReq
.
AppendItem
(
SfxStringItem
(
SID_TEMPLATE_NAME
,
pDlg
->
GetTemplateName
()));
rReq
.
AppendItem
(
SfxStringItem
(
SID_TEMPLATE_REGIONNAME
,
pDlg
->
GetRegionName
()));
}
else
{
delete
pDlg
;
rReq
.
Ignore
();
return
;
}
}
SFX_REQUEST_ARG
(
rReq
,
pRegionItem
,
SfxStringItem
,
SID_TEMPLATE_REGIONNAME
,
sal_False
);
SFX_REQUEST_ARG
(
rReq
,
pNameItem
,
SfxStringItem
,
SID_TEMPLATE_NAME
,
sal_False
);
SFX_REQUEST_ARG
(
rReq
,
pRegionNrItem
,
SfxUInt16Item
,
SID_TEMPLATE_REGION
,
sal_False
);
if
(
(
!
pRegionItem
&&
!
pRegionNrItem
)
||
!
pNameItem
)
{
DBG_ASSERT
(
rReq
.
IsAPI
(),
"non-API call without Arguments"
);
#ifndef DISABLE_SCRIPTING
SbxBase
::
SetError
(
SbxERR_WRONG_ARGS
);
#endif
rReq
.
Ignore
();
return
;
}
::
rtl
::
OUString
aTemplateName
=
pNameItem
->
GetValue
();
::
rtl
::
OUString
aTemplateGroup
;
if
(
pRegionItem
)
aTemplateGroup
=
pRegionItem
->
GetValue
();
else
// pRegionNrItem must not be NULL, it was just checked
aTemplateGroup
=
pTemplates
->
GetFullRegionName
(
pRegionNrItem
->
GetValue
()
);
// check Group and Name
delete
pTemplates
;
sal_Bool
bOk
=
sal_False
;
try
{
uno
::
Reference
<
frame
::
XStorable
>
xStorable
(
GetModel
(),
uno
::
UNO_QUERY_THROW
);
uno
::
Reference
<
frame
::
XDocumentTemplates
>
xTemplates
(
frame
::
DocumentTemplates
::
create
(
comphelper
::
getProcessComponentContext
())
);
bOk
=
xTemplates
->
storeTemplate
(
aTemplateGroup
,
aTemplateName
,
xStorable
);
}
catch
(
uno
::
Exception
&
)
{
}
DELETEX
(
pDlg
);
rReq
.
SetReturnValue
(
SfxBoolItem
(
0
,
bOk
)
);
if
(
bOk
)
{
// update the Organizer runtime cache from the template
// component if the cache has already been created
// TODO/LATER: get rid of this cache duplication
SfxDocumentTemplates
aTemplates
;
aTemplates
.
ReInitFromComponent
();
}
else
{
ErrorHandler
::
HandleError
(
ERRCODE_IO_GENERAL
);
return
;
}
}
SfxTemplateManagerDlg
aDlg
(
NULL
);
aDlg
.
setDocumentModel
(
GetModel
());
aDlg
.
setSaveMode
(
true
);
aDlg
.
Execute
();
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment