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
50f1445b
Kaydet (Commit)
50f1445b
authored
Eyl 02, 2013
tarafından
Armin Le Grand
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
i122820 Corrected graphics creation, allow bigger limits if directly requested
üst
0eb5028a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
22 deletions
+69
-22
UnoGraphicExporter.cxx
svx/source/unodraw/UnoGraphicExporter.cxx
+69
-22
No files found.
svx/source/unodraw/UnoGraphicExporter.cxx
Dosyayı görüntüle @
50f1445b
...
@@ -225,6 +225,7 @@ namespace svx
...
@@ -225,6 +225,7 @@ namespace svx
{
{
// use new primitive conversion tooling
// use new primitive conversion tooling
basegfx
::
B2DRange
aRange
(
basegfx
::
B2DPoint
(
0.0
,
0.0
));
basegfx
::
B2DRange
aRange
(
basegfx
::
B2DPoint
(
0.0
,
0.0
));
sal_uInt32
nMaximumQuadraticPixels
(
500000
);
if
(
pSize
)
if
(
pSize
)
{
{
...
@@ -233,6 +234,10 @@ namespace svx
...
@@ -233,6 +234,10 @@ namespace svx
const
Size
aSize100th
(
Application
::
GetDefaultDevice
()
->
PixelToLogic
(
*
pSize
,
MapMode
(
MAP_100TH_MM
)));
const
Size
aSize100th
(
Application
::
GetDefaultDevice
()
->
PixelToLogic
(
*
pSize
,
MapMode
(
MAP_100TH_MM
)));
aRange
.
expand
(
basegfx
::
B2DPoint
(
aSize100th
.
Width
(),
aSize100th
.
Height
()));
aRange
.
expand
(
basegfx
::
B2DPoint
(
aSize100th
.
Width
(),
aSize100th
.
Height
()));
// when explicitely pixels are requested from the GraphicExporter, use a *very* high limit
// of 16gb (4096x4096 pixels), else use the default for the converters
nMaximumQuadraticPixels
=
std
::
min
(
sal_uInt32
(
4096
*
4096
),
sal_uInt32
(
pSize
->
Width
()
*
pSize
->
Height
()));
}
}
else
else
{
{
...
@@ -242,13 +247,42 @@ namespace svx
...
@@ -242,13 +247,42 @@ namespace svx
aRange
.
expand
(
basegfx
::
B2DPoint
(
aSize100th
.
Width
(),
aSize100th
.
Height
()));
aRange
.
expand
(
basegfx
::
B2DPoint
(
aSize100th
.
Width
(),
aSize100th
.
Height
()));
}
}
aBmpEx
=
convertMetafileToBitmapEx
(
rMtf
,
aRange
);
aBmpEx
=
convertMetafileToBitmapEx
(
rMtf
,
aRange
,
nMaximumQuadraticPixels
);
}
}
else
else
{
{
const
SvtOptionsDrawinglayer
aDrawinglayerOpt
;
const
SvtOptionsDrawinglayer
aDrawinglayerOpt
;
Size
aTargetSize
(
0
,
0
);
if
(
pSize
)
{
// #122820# If a concrete target size in pixels is given, use it
aTargetSize
=
*
pSize
;
// get hairline and full bound rect to evtl. reduce given target pixel size when
// it is known that it will be expanded to get the right and bottom hairlines right
Rectangle
aHairlineRect
;
const
Rectangle
aRect
(
rMtf
.
GetBoundRect
(
*
Application
::
GetDefaultDevice
(),
&
aHairlineRect
));
if
(
!
aRect
.
IsEmpty
()
&&
!
aHairlineRect
.
IsEmpty
())
{
if
(
aRect
.
Right
()
==
aHairlineRect
.
Right
()
||
aRect
.
Bottom
()
==
aHairlineRect
.
Bottom
())
{
if
(
aTargetSize
.
Width
())
{
aTargetSize
.
Width
()
-=
1
;
}
if
(
aTargetSize
.
Height
())
{
aTargetSize
.
Height
()
-=
1
;
}
}
}
}
const
GraphicConversionParameters
aParameters
(
const
GraphicConversionParameters
aParameters
(
pSize
?
*
pSize
:
Size
(
0
,
0
)
,
aTargetSize
,
true
,
// allow unlimited size
true
,
// allow unlimited size
aDrawinglayerOpt
.
IsAntiAliasing
(),
aDrawinglayerOpt
.
IsAntiAliasing
(),
aDrawinglayerOpt
.
IsSnapHorVerLinesToDiscrete
());
aDrawinglayerOpt
.
IsSnapHorVerLinesToDiscrete
());
...
@@ -429,26 +463,39 @@ VirtualDevice* GraphicExporter::CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWid
...
@@ -429,26 +463,39 @@ VirtualDevice* GraphicExporter::CreatePageVDev( SdrPage* pPage, sal_uIntPtr nWid
}
}
pVDev
->
SetMapMode
(
aMM
);
pVDev
->
SetMapMode
(
aMM
);
#ifdef DBG_UTIL
bool
bSuccess
(
false
);
sal_Bool
bAbort
=
!
#endif
// #122820# If available, use pixel size directly
pVDev
->
SetOutputSize
(
aPageSize
);
if
(
nWidthPixel
&&
nHeightPixel
)
DBG_ASSERT
(
!
bAbort
,
"virt. Device nicht korrekt erzeugt"
);
{
bSuccess
=
pVDev
->
SetOutputSizePixel
(
Size
(
nWidthPixel
,
nHeightPixel
));
SdrView
*
pView
=
new
SdrView
(
mpDoc
,
pVDev
);
}
pView
->
SetPageVisible
(
sal_False
);
else
pView
->
SetBordVisible
(
sal_False
);
{
pView
->
SetGridVisible
(
sal_False
);
bSuccess
=
pVDev
->
SetOutputSize
(
aPageSize
);
pView
->
SetHlplVisible
(
sal_False
);
}
pView
->
SetGlueVisible
(
sal_False
);
pView
->
ShowSdrPage
(
pPage
);
if
(
bSuccess
)
Region
aRegion
(
Rectangle
(
aPoint
,
aPageSize
)
);
{
SdrView
*
pView
=
new
SdrView
(
mpDoc
,
pVDev
);
ImplExportCheckVisisbilityRedirector
aRedirector
(
mpCurrentPage
);
pView
->
SetPageVisible
(
sal_False
);
pView
->
SetBordVisible
(
sal_False
);
pView
->
CompleteRedraw
(
pVDev
,
aRegion
,
&
aRedirector
);
pView
->
SetGridVisible
(
sal_False
);
pView
->
SetHlplVisible
(
sal_False
);
delete
pView
;
pView
->
SetGlueVisible
(
sal_False
);
pView
->
ShowSdrPage
(
pPage
);
Region
aRegion
(
Rectangle
(
aPoint
,
aPageSize
)
);
ImplExportCheckVisisbilityRedirector
aRedirector
(
mpCurrentPage
);
pView
->
CompleteRedraw
(
pVDev
,
aRegion
,
&
aRedirector
);
delete
pView
;
}
else
{
OSL_ENSURE
(
false
,
"Could not get a VirtualDevice of requested size (!)"
);
}
return
pVDev
;
return
pVDev
;
}
}
...
...
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