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
7ec3e51a
Kaydet (Commit)
7ec3e51a
authored
Tem 06, 2012
tarafından
Ariel Constenla-Haile
Kaydeden (comit)
Michael Meeks
Tem 06, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Check if Bitmap is empty before trying to scale it
http://svn.apache.org/viewvc?view=revision&revision=1224936
üst
e2799d25
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
filedlghelper.cxx
sfx2/source/dialog/filedlghelper.cxx
+23
-21
No files found.
sfx2/source/dialog/filedlghelper.cxx
Dosyayı görüntüle @
7ec3e51a
...
...
@@ -721,34 +721,36 @@ IMPL_LINK_NOARG(FileDialogHelper_Impl, TimeOutHdl_Impl)
// proper position and painting a frame
Bitmap
aBmp
=
maGraphic
.
GetBitmap
();
if
(
!
aBmp
.
IsEmpty
()
)
{
// scale the bitmap to the correct size
sal_Int32
nOutWidth
=
xFilePicker
->
getAvailableWidth
();
sal_Int32
nOutHeight
=
xFilePicker
->
getAvailableHeight
();
sal_Int32
nBmpWidth
=
aBmp
.
GetSizePixel
().
Width
();
sal_Int32
nBmpHeight
=
aBmp
.
GetSizePixel
().
Height
();
// scale the bitmap to the correct size
sal_Int32
nOutWidth
=
xFilePicker
->
getAvailableWidth
();
sal_Int32
nOutHeight
=
xFilePicker
->
getAvailableHeight
();
sal_Int32
nBmpWidth
=
aBmp
.
GetSizePixel
().
Width
();
sal_Int32
nBmpHeight
=
aBmp
.
GetSizePixel
().
Height
();
double
nXRatio
=
(
double
)
nOutWidth
/
nBmpWidth
;
double
nYRatio
=
(
double
)
nOutHeight
/
nBmpHeight
;
double
nXRatio
=
(
double
)
nOutWidth
/
nBmpWidth
;
double
nYRatio
=
(
double
)
nOutHeight
/
nBmpHeight
;
if
(
nXRatio
<
nYRatio
)
aBmp
.
Scale
(
nXRatio
,
nXRatio
);
else
aBmp
.
Scale
(
nYRatio
,
nYRatio
);
if
(
nXRatio
<
nYRatio
)
aBmp
.
Scale
(
nXRatio
,
nXRatio
);
else
aBmp
.
Scale
(
nYRatio
,
nYRatio
);
// Convert to true color, to allow CopyPixel
aBmp
.
Convert
(
BMP_CONVERSION_24BIT
);
// Convert to true color, to allow CopyPixel
aBmp
.
Convert
(
BMP_CONVERSION_24BIT
);
// and copy it into the Any
SvMemoryStream
aData
;
// and copy it into the Any
SvMemoryStream
aData
;
aData
<<
aBmp
;
aData
<<
aBmp
;
const
Sequence
<
sal_Int8
>
aBuffer
(
static_cast
<
const
sal_Int8
*
>
(
aData
.
GetData
()),
aData
.
GetEndOfData
()
);
const
Sequence
<
sal_Int8
>
aBuffer
(
static_cast
<
const
sal_Int8
*
>
(
aData
.
GetData
()),
aData
.
GetEndOfData
()
);
aAny
<<=
aBuffer
;
aAny
<<=
aBuffer
;
}
}
}
...
...
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