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
f8a1adaa
Kaydet (Commit)
f8a1adaa
authored
Şub 06, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#1158398 Uncaught exception
Change-Id: I943b6233554d91e1a14f545e30f95528ca592924
üst
b0bd6e9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
33 deletions
+39
-33
frmload.cxx
sfx2/source/view/frmload.cxx
+39
-33
No files found.
sfx2/source/view/frmload.cxx
Dosyayı görüntüle @
f8a1adaa
...
...
@@ -420,45 +420,51 @@ SfxObjectShellRef SfxFrameLoader_Impl::impl_findObjectShell( const Reference< XM
// --------------------------------------------------------------------------------------------------------------------
bool
SfxFrameLoader_Impl
::
impl_determineTemplateDocument
(
::
comphelper
::
NamedValueCollection
&
io_rDescriptor
)
const
{
const
OUString
sTemplateRegioName
=
io_rDescriptor
.
getOrDefault
(
"TemplateRegionName"
,
OUString
()
);
const
OUString
sTemplateName
=
io_rDescriptor
.
getOrDefault
(
"TemplateName"
,
OUString
()
);
const
OUString
sServiceName
=
io_rDescriptor
.
getOrDefault
(
"DocumentService"
,
OUString
()
);
const
OUString
sURL
=
io_rDescriptor
.
getOrDefault
(
"URL"
,
OUString
()
);
// determine the full URL of the template to use, if any
OUString
sTemplateURL
;
if
(
!
sTemplateRegioName
.
isEmpty
()
&&
!
sTemplateName
.
isEmpty
()
)
{
SfxDocumentTemplates
aTmpFac
;
aTmpFac
.
GetFull
(
sTemplateRegioName
,
sTemplateName
,
sTemplateURL
);
}
else
try
{
if
(
!
sServiceName
.
isEmpty
()
)
sTemplateURL
=
SfxObjectFactory
::
GetStandardTemplate
(
sServiceName
);
const
OUString
sTemplateRegioName
=
io_rDescriptor
.
getOrDefault
(
"TemplateRegionName"
,
OUString
()
);
const
OUString
sTemplateName
=
io_rDescriptor
.
getOrDefault
(
"TemplateName"
,
OUString
()
);
const
OUString
sServiceName
=
io_rDescriptor
.
getOrDefault
(
"DocumentService"
,
OUString
()
);
const
OUString
sURL
=
io_rDescriptor
.
getOrDefault
(
"URL"
,
OUString
()
);
// determine the full URL of the template to use, if any
OUString
sTemplateURL
;
if
(
!
sTemplateRegioName
.
isEmpty
()
&&
!
sTemplateName
.
isEmpty
()
)
{
SfxDocumentTemplates
aTmpFac
;
aTmpFac
.
GetFull
(
sTemplateRegioName
,
sTemplateName
,
sTemplateURL
);
}
else
sTemplateURL
=
SfxObjectFactory
::
GetStandardTemplate
(
SfxObjectShell
::
GetServiceNameFromFactory
(
sURL
)
);
}
{
if
(
!
sServiceName
.
isEmpty
()
)
sTemplateURL
=
SfxObjectFactory
::
GetStandardTemplate
(
sServiceName
);
else
sTemplateURL
=
SfxObjectFactory
::
GetStandardTemplate
(
SfxObjectShell
::
GetServiceNameFromFactory
(
sURL
)
);
}
if
(
!
sTemplateURL
.
isEmpty
()
)
{
// detect the filter for the template. Might still be NULL (if the template is broken, or does not
// exist, or some such), but this is handled by our caller the same way as if no template/URL was present.
const
SfxFilter
*
pTemplateFilter
=
impl_detectFilterForURL
(
sTemplateURL
,
io_rDescriptor
,
SFX_APP
()
->
GetFilterMatcher
()
);
if
(
pTemplateFilter
)
if
(
!
sTemplateURL
.
isEmpty
()
)
{
// load the template document, but, well, "as template"
io_rDescriptor
.
put
(
"FilterName"
,
OUString
(
pTemplateFilter
->
GetName
()
)
);
io_rDescriptor
.
put
(
"FileName"
,
OUString
(
sTemplateURL
)
);
io_rDescriptor
.
put
(
"AsTemplate"
,
sal_True
);
// #i21583#
// the DocumentService property will finally be used to create the document. Thus, override any possibly
// present value with the document service of the template.
io_rDescriptor
.
put
(
"DocumentService"
,
OUString
(
pTemplateFilter
->
GetServiceName
()
)
);
return
true
;
// detect the filter for the template. Might still be NULL (if the template is broken, or does not
// exist, or some such), but this is handled by our caller the same way as if no template/URL was present.
const
SfxFilter
*
pTemplateFilter
=
impl_detectFilterForURL
(
sTemplateURL
,
io_rDescriptor
,
SFX_APP
()
->
GetFilterMatcher
()
);
if
(
pTemplateFilter
)
{
// load the template document, but, well, "as template"
io_rDescriptor
.
put
(
"FilterName"
,
OUString
(
pTemplateFilter
->
GetName
()
)
);
io_rDescriptor
.
put
(
"FileName"
,
OUString
(
sTemplateURL
)
);
io_rDescriptor
.
put
(
"AsTemplate"
,
sal_True
);
// #i21583#
// the DocumentService property will finally be used to create the document. Thus, override any possibly
// present value with the document service of the template.
io_rDescriptor
.
put
(
"DocumentService"
,
OUString
(
pTemplateFilter
->
GetServiceName
()
)
);
return
true
;
}
}
}
catch
(...)
{
}
return
false
;
}
...
...
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