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
772323b4
Kaydet (Commit)
772323b4
authored
Agu 26, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Reduce nesting / style in thumbnail creation routines
Change-Id: I733b677f4d4c7dfdf6fef531b43e1de36131f55d
üst
b38de1f8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
45 deletions
+38
-45
objstor.cxx
sfx2/source/doc/objstor.cxx
+38
-45
No files found.
sfx2/source/doc/objstor.cxx
Dosyayı görüntüle @
772323b4
...
...
@@ -3512,28 +3512,25 @@ bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< embed
return
bResult
;
}
bool
SfxObjectShell
::
GenerateAndStoreThumbnail
(
bool
bEncrypted
,
bool
bIsTemplate
,
const
uno
::
Reference
<
embed
::
XStorage
>&
xStor
)
bool
SfxObjectShell
::
GenerateAndStoreThumbnail
(
bool
bEncrypted
,
bool
bIsTemplate
,
const
uno
::
Reference
<
embed
::
XStorage
>&
xStorage
)
{
bIsInGenerateThumbnail
=
true
;
//optimize thumbnail generate and store procedure to improve odt saving performance, i120030
//optimize thumbnail generate and store procedure to improve odt saving performance, i120030
bIsInGenerateThumbnail
=
true
;
bool
bResult
=
false
;
try
{
uno
::
Reference
<
embed
::
XStorage
>
xThumbnailStor
=
xStor
->
openStorageElement
(
OUString
(
"Thumbnails"
),
embed
::
ElementModes
::
READWRITE
);
if
(
xThumbnailStor
.
is
()
)
try
{
uno
::
Reference
<
embed
::
XStorage
>
xThumbnailStorage
=
xStorage
->
openStorageElement
(
OUString
(
"Thumbnails"
),
embed
::
ElementModes
::
READWRITE
);
if
(
xThumbnailStorage
.
is
()
)
{
uno
::
Reference
<
io
::
XStream
>
xStream
=
xThumbnailStor
->
openStreamElement
(
OUString
(
"thumbnail.png"
),
embed
::
ElementModes
::
READWRITE
);
uno
::
Reference
<
io
::
XStream
>
xStream
=
xThumbnailStorage
->
openStreamElement
(
OUString
(
"thumbnail.png"
),
embed
::
ElementModes
::
READWRITE
);
if
(
xStream
.
is
()
&&
WriteThumbnail
(
bEncrypted
,
bIsTemplate
,
xStream
))
{
uno
::
Reference
<
embed
::
XTransactedObject
>
xTransact
(
xThumbnailStor
,
uno
::
UNO_QUERY_THROW
);
xTransact
->
commit
();
uno
::
Reference
<
embed
::
XTransactedObject
>
xTransactedObject
(
xThumbnailStorage
,
uno
::
UNO_QUERY_THROW
);
xTransact
edObject
->
commit
();
bResult
=
true
;
}
}
...
...
@@ -3542,49 +3539,45 @@ bool SfxObjectShell::GenerateAndStoreThumbnail( bool bEncrypted,
{
}
bIsInGenerateThumbnail
=
false
;
//optimize thumbnail generate and store procedure to improve odt saving performance, i120030
//optimize thumbnail generate and store procedure to improve odt saving performance, i120030
bIsInGenerateThumbnail
=
false
;
return
bResult
;
}
bool
SfxObjectShell
::
WriteThumbnail
(
bool
bEncrypted
,
bool
bIsTemplate
,
const
uno
::
Reference
<
io
::
XStream
>&
xStream
)
bool
SfxObjectShell
::
WriteThumbnail
(
bool
bEncrypted
,
bool
bIsTemplate
,
const
uno
::
Reference
<
io
::
XStream
>&
xStream
)
{
bool
bResult
=
false
;
if
(
xStream
.
is
()
)
if
(
!
xStream
.
is
())
return
false
;
try
{
try
{
uno
::
Reference
<
io
::
XTruncate
>
xTruncate
(
xStream
->
getOutputStream
(),
uno
::
UNO_QUERY_THROW
);
xTruncate
->
truncate
();
uno
::
Reference
<
beans
::
XPropertySet
>
xSet
(
xStream
,
uno
::
UNO_QUERY
);
if
(
xSet
.
is
()
)
xSet
->
setPropertyValue
(
"MediaType"
,
uno
::
makeAny
(
OUString
(
"image/png"
)
)
);
if
(
bEncrypted
)
{
sal_uInt16
nResID
=
GraphicHelper
::
getThumbnailReplacementIDByFactoryName_Impl
(
OUString
::
createFromAscii
(
GetFactory
().
GetShortName
()
),
bIsTemplate
);
if
(
nResID
)
bResult
=
GraphicHelper
::
getThumbnailReplacement_Impl
(
nResID
,
xStream
);
}
else
uno
::
Reference
<
io
::
XTruncate
>
xTruncate
(
xStream
->
getOutputStream
(),
uno
::
UNO_QUERY_THROW
);
xTruncate
->
truncate
(
);
uno
::
Reference
<
beans
::
XPropertySet
>
xSet
(
xStream
,
uno
::
UNO_QUERY
);
if
(
xSet
.
is
())
xSet
->
setPropertyValue
(
"MediaType"
,
uno
::
makeAny
(
OUString
(
"image/png"
)));
if
(
bEncrypted
)
{
OUString
sFactoryName
=
OUString
::
createFromAscii
(
GetFactory
().
GetShortName
());
sal_uInt16
nResID
=
GraphicHelper
::
getThumbnailReplacementIDByFactoryName_Impl
(
sFactoryName
,
bIsTemplate
);
if
(
nResID
)
bResult
=
GraphicHelper
::
getThumbnailReplacement_Impl
(
nResID
,
xStream
);
}
else
{
boost
::
shared_ptr
<
GDIMetaFile
>
pMetaFile
=
GetPreviewMetaFile
(
false
);
if
(
pMetaFile
)
{
::
boost
::
shared_ptr
<
GDIMetaFile
>
pMetaFile
=
GetPreviewMetaFile
(
false
);
if
(
pMetaFile
)
{
bResult
=
GraphicHelper
::
getThumbnailFormatFromGDI_Impl
(
pMetaFile
.
get
(),
xStream
);
}
bResult
=
GraphicHelper
::
getThumbnailFormatFromGDI_Impl
(
pMetaFile
.
get
(),
xStream
);
}
}
catch
(
uno
::
Exception
&
)
{}
}
catch
(
uno
::
Exception
&
)
{}
return
bResult
;
}
...
...
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