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
3d96b1e0
Kaydet (Commit)
3d96b1e0
authored
Şub 13, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#737139 Uncaught exception
Change-Id: I75fc43e365afa44b54c27aeb8887f9e37954f03b
üst
5adc8214
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
49 deletions
+55
-49
pdfexport.cxx
filter/source/pdf/pdfexport.cxx
+55
-49
No files found.
filter/source/pdf/pdfexport.cxx
Dosyayı görüntüle @
3d96b1e0
...
@@ -305,65 +305,71 @@ static OUString getMimetypeForDocument( const Reference< XComponentContext >& xC
...
@@ -305,65 +305,71 @@ static OUString getMimetypeForDocument( const Reference< XComponentContext >& xC
const
Reference
<
XComponent
>&
xDoc
)
throw
()
const
Reference
<
XComponent
>&
xDoc
)
throw
()
{
{
OUString
aDocMimetype
;
OUString
aDocMimetype
;
// get document service name
try
Reference
<
com
::
sun
::
star
::
frame
::
XStorable
>
xStore
(
xDoc
,
UNO_QUERY
);
Reference
<
frame
::
XModuleManager2
>
xModuleManager
=
frame
::
ModuleManager
::
create
(
xContext
);
if
(
xStore
.
is
()
)
{
{
OUString
aDocServiceName
=
xModuleManager
->
identify
(
Reference
<
XInterface
>
(
xStore
,
uno
::
UNO_QUERY
)
);
// get document service name
if
(
!
aDocServiceName
.
isEmpty
()
)
Reference
<
com
::
sun
::
star
::
frame
::
XStorable
>
xStore
(
xDoc
,
UNO_QUERY
);
Reference
<
frame
::
XModuleManager2
>
xModuleManager
=
frame
::
ModuleManager
::
create
(
xContext
);
if
(
xStore
.
is
()
)
{
{
// get the actual filter name
OUString
aDocServiceName
=
xModuleManager
->
identify
(
Reference
<
XInterface
>
(
xStore
,
uno
::
UNO_QUERY
)
);
OUString
aFilterName
;
if
(
!
aDocServiceName
.
isEmpty
()
)
Reference
<
lang
::
XMultiServiceFactory
>
xConfigProvider
=
configuration
::
theDefaultProvider
::
get
(
xContext
);
uno
::
Sequence
<
uno
::
Any
>
aArgs
(
1
);
beans
::
NamedValue
aPathProp
;
aPathProp
.
Name
=
"nodepath"
;
aPathProp
.
Value
<<=
OUString
(
"/org.openoffice.Setup/Office/Factories/"
);
aArgs
[
0
]
<<=
aPathProp
;
Reference
<
container
::
XNameAccess
>
xSOFConfig
(
xConfigProvider
->
createInstanceWithArguments
(
"com.sun.star.configuration.ConfigurationAccess"
,
aArgs
),
uno
::
UNO_QUERY
);
Reference
<
container
::
XNameAccess
>
xApplConfig
;
xSOFConfig
->
getByName
(
aDocServiceName
)
>>=
xApplConfig
;
if
(
xApplConfig
.
is
()
)
{
{
xApplConfig
->
getByName
(
"ooSetupFactoryActualFilter"
)
>>=
aFilterName
;
// get the actual filter name
if
(
!
aFilterName
.
isEmpty
()
)
OUString
aFilterName
;
Reference
<
lang
::
XMultiServiceFactory
>
xConfigProvider
=
configuration
::
theDefaultProvider
::
get
(
xContext
);
uno
::
Sequence
<
uno
::
Any
>
aArgs
(
1
);
beans
::
NamedValue
aPathProp
;
aPathProp
.
Name
=
"nodepath"
;
aPathProp
.
Value
<<=
OUString
(
"/org.openoffice.Setup/Office/Factories/"
);
aArgs
[
0
]
<<=
aPathProp
;
Reference
<
container
::
XNameAccess
>
xSOFConfig
(
xConfigProvider
->
createInstanceWithArguments
(
"com.sun.star.configuration.ConfigurationAccess"
,
aArgs
),
uno
::
UNO_QUERY
);
Reference
<
container
::
XNameAccess
>
xApplConfig
;
xSOFConfig
->
getByName
(
aDocServiceName
)
>>=
xApplConfig
;
if
(
xApplConfig
.
is
()
)
{
{
// find the related type name
xApplConfig
->
getByName
(
"ooSetupFactoryActualFilter"
)
>>=
aFilterName
;
OUString
aTypeName
;
if
(
!
aFilterName
.
isEmpty
()
)
Reference
<
container
::
XNameAccess
>
xFilterFactory
(
xContext
->
getServiceManager
()
->
createInstanceWithContext
(
"com.sun.star.document.FilterFactory"
,
xContext
),
uno
::
UNO_QUERY
);
Sequence
<
beans
::
PropertyValue
>
aFilterData
;
xFilterFactory
->
getByName
(
aFilterName
)
>>=
aFilterData
;
for
(
sal_Int32
nInd
=
0
;
nInd
<
aFilterData
.
getLength
();
nInd
++
)
if
(
aFilterData
[
nInd
].
Name
==
"Type"
)
aFilterData
[
nInd
].
Value
>>=
aTypeName
;
if
(
!
aTypeName
.
isEmpty
()
)
{
{
// find the mediatype
// find the related type name
Reference
<
container
::
XNameAccess
>
xTypeDetection
(
OUString
aTypeName
;
xContext
->
getServiceManager
()
->
createInstanceWithContext
(
"com.sun.star.document.TypeDetection"
,
xContext
),
Reference
<
container
::
XNameAccess
>
xFilterFactory
(
UNO_QUERY
);
xContext
->
getServiceManager
()
->
createInstanceWithContext
(
"com.sun.star.document.FilterFactory"
,
xContext
),
uno
::
UNO_QUERY
);
Sequence
<
beans
::
PropertyValue
>
aTypeData
;
xTypeDetection
->
getByName
(
aTypeName
)
>>=
aTypeData
;
Sequence
<
beans
::
PropertyValue
>
aFilterData
;
for
(
sal_Int32
nInd
=
0
;
nInd
<
aTypeData
.
getLength
();
nInd
++
)
xFilterFactory
->
getByName
(
aFilterName
)
>>=
aFilterData
;
if
(
aTypeData
[
nInd
].
Name
==
"MediaType"
)
for
(
sal_Int32
nInd
=
0
;
nInd
<
aFilterData
.
getLength
();
nInd
++
)
aTypeData
[
nInd
].
Value
>>=
aDocMimetype
;
if
(
aFilterData
[
nInd
].
Name
==
"Type"
)
aFilterData
[
nInd
].
Value
>>=
aTypeName
;
if
(
!
aTypeName
.
isEmpty
()
)
{
// find the mediatype
Reference
<
container
::
XNameAccess
>
xTypeDetection
(
xContext
->
getServiceManager
()
->
createInstanceWithContext
(
"com.sun.star.document.TypeDetection"
,
xContext
),
UNO_QUERY
);
Sequence
<
beans
::
PropertyValue
>
aTypeData
;
xTypeDetection
->
getByName
(
aTypeName
)
>>=
aTypeData
;
for
(
sal_Int32
nInd
=
0
;
nInd
<
aTypeData
.
getLength
();
nInd
++
)
if
(
aTypeData
[
nInd
].
Name
==
"MediaType"
)
aTypeData
[
nInd
].
Value
>>=
aDocMimetype
;
}
}
}
}
}
}
}
}
}
}
}
catch
(...)
{
}
return
aDocMimetype
;
return
aDocMimetype
;
}
}
...
...
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