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
63f53dbd
Kaydet (Commit)
63f53dbd
authored
Tem 02, 2014
tarafından
Armin Le Grand
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
i125189 corrected used transparency and handling to values used in the fallback SvxBrushItem
üst
efe87c0d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
13 deletions
+73
-13
unobrushitemhelper.cxx
svx/source/unodraw/unobrushitemhelper.cxx
+21
-9
paintfrm.cxx
sw/source/core/layout/paintfrm.cxx
+52
-4
No files found.
svx/source/unodraw/unobrushitemhelper.cxx
Dosyayı görüntüle @
63f53dbd
...
@@ -62,8 +62,9 @@ void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxI
...
@@ -62,8 +62,9 @@ void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem& rBrush, SfxI
rToSet
.
Put
(
XFillStyleItem
(
XFILL_SOLID
));
rToSet
.
Put
(
XFillStyleItem
(
XFILL_SOLID
));
rToSet
.
Put
(
XFillColorItem
(
String
(),
aColor
));
rToSet
.
Put
(
XFillColorItem
(
String
(),
aColor
));
// nTransparency is in range [0..255], convert to [0..100] which is used in XFillTransparenceItem
// #125189# nTransparency is in range [0..254], convert to [0..100] which is used in
rToSet
.
Put
(
XFillTransparenceItem
((((
sal_Int32
)
nTransparency
*
100
)
+
127
)
/
255
));
// XFillTransparenceItem (caution with the range which is in an *item-specific* range)
rToSet
.
Put
(
XFillTransparenceItem
((((
sal_Int32
)
nTransparency
*
100
)
+
127
)
/
254
));
}
}
else
if
(
GPOS_NONE
!=
rBrush
.
GetGraphicPos
())
else
if
(
GPOS_NONE
!=
rBrush
.
GetGraphicPos
())
{
{
...
@@ -182,8 +183,12 @@ SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, sal_Bool bSea
...
@@ -182,8 +183,12 @@ SvxBrushItem getSvxBrushItemForSolid(const SfxItemSet& rSourceSet, sal_Bool bSea
if
(
0
!=
nFillTransparence
)
if
(
0
!=
nFillTransparence
)
{
{
// nFillTransparence is in range [0..100] and needs to be in [0..255] unsigned
// #i125189# nFillTransparence is in range [0..100] and needs to be in [0..254] unsigned
aFillColor
.
SetTransparency
(
static_cast
<
sal_uInt8
>
((
nFillTransparence
*
255
)
/
100
));
// It is necessary to use the maximum of 0xfe for transparence for the SvxBrushItem
// since the oxff value is used for special purposes (like no fill and derive from parent)
const
sal_uInt8
aTargetTrans
(
std
::
min
(
sal_uInt8
(
0xfe
),
static_cast
<
sal_uInt8
>
((
nFillTransparence
*
254
)
/
100
)));
aFillColor
.
SetTransparency
(
aTargetTrans
);
}
}
return
SvxBrushItem
(
aFillColor
,
nBackgroundID
);
return
SvxBrushItem
(
aFillColor
,
nBackgroundID
);
...
@@ -233,8 +238,12 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
...
@@ -233,8 +238,12 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
if
(
0
!=
nFillTransparence
)
if
(
0
!=
nFillTransparence
)
{
{
// nFillTransparence is in range [0..100] and needs to be in [0..255] unsigned
// #i125189# nFillTransparence is in range [0..100] and needs to be in [0..254] unsigned
aMixedColor
.
SetTransparency
(
static_cast
<
sal_uInt8
>
((
nFillTransparence
*
255
)
/
100
));
// It is necessary to use the maximum of 0xfe for transparence for the SvxBrushItem
// since the oxff value is used for special purposes (like no fill and derive from parent)
const
sal_uInt8
aTargetTrans
(
std
::
min
(
sal_uInt8
(
0xfe
),
static_cast
<
sal_uInt8
>
((
nFillTransparence
*
254
)
/
100
)));
aMixedColor
.
SetTransparency
(
aTargetTrans
);
}
}
aRetval
=
SvxBrushItem
(
aMixedColor
,
nBackgroundID
);
aRetval
=
SvxBrushItem
(
aMixedColor
,
nBackgroundID
);
...
@@ -263,9 +272,12 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
...
@@ -263,9 +272,12 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
// take half orig transparence, add half transparent, clamp result
// take half orig transparence, add half transparent, clamp result
nFillTransparence
=
basegfx
::
clamp
((
sal_uInt16
)((
nFillTransparence
/
2
)
+
50
),
(
sal_uInt16
)
0
,
(
sal_uInt16
)
255
);
nFillTransparence
=
basegfx
::
clamp
((
sal_uInt16
)((
nFillTransparence
/
2
)
+
50
),
(
sal_uInt16
)
0
,
(
sal_uInt16
)
255
);
// nFillTransparence is in range [0..100] and needs to be in [0..255] unsigned
// #i125189# nFillTransparence is in range [0..100] and needs to be in [0..254] unsigned
aHatchColor
.
SetTransparency
(
static_cast
<
sal_uInt8
>
((
nFillTransparence
*
255
)
/
100
));
// It is necessary to use the maximum of 0xfe for transparence for the SvxBrushItem
// since the oxff value is used for special purposes (like no fill and derive from parent)
const
sal_uInt8
aTargetTrans
(
std
::
min
(
sal_uInt8
(
0xfe
),
static_cast
<
sal_uInt8
>
((
nFillTransparence
*
254
)
/
100
)));
aHatchColor
.
SetTransparency
(
aTargetTrans
);
aRetval
=
SvxBrushItem
(
aHatchColor
,
nBackgroundID
);
aRetval
=
SvxBrushItem
(
aHatchColor
,
nBackgroundID
);
}
}
...
@@ -316,7 +328,7 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
...
@@ -316,7 +328,7 @@ SvxBrushItem getSvxBrushItemFromSourceSet(const SfxItemSet& rSourceSet, sal_uInt
if
(
0
!=
nFillTransparence
)
if
(
0
!=
nFillTransparence
)
{
{
// nFillTransparence is in range [0..100] and needs to be in [0..100] signed
//
#i125189#
nFillTransparence is in range [0..100] and needs to be in [0..100] signed
aRetval
.
setGraphicTransparency
(
static_cast
<
sal_Int8
>
(
nFillTransparence
));
aRetval
.
setGraphicTransparency
(
static_cast
<
sal_Int8
>
(
nFillTransparence
));
}
}
...
...
sw/source/core/layout/paintfrm.cxx
Dosyayı görüntüle @
63f53dbd
...
@@ -5915,9 +5915,29 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
...
@@ -5915,9 +5915,29 @@ void SwFrm::PaintBackground( const SwRect &rRect, const SwPageFrm *pPage,
const sal_Bool bConsiderBackgroundTransparency = IsFlyFrm();
const sal_Bool bConsiderBackgroundTransparency = IsFlyFrm();
bool bDone(false);
bool bDone(false);
if
(
pOut
&&
aFillAttributes
.
get
()
&&
aFillAttributes
->
isUsed
())
// #i125189# We are also done when the new DrawingLayer FillAttributes are used
// or the FillStyle is set (different from XFILL_NONE)
if(pOut && aFillAttributes.get())
{
{
bDone
=
DrawFillAttributes
(
aFillAttributes
,
aOrigBackRect
,
aRect
,
*
pOut
);
if(aFillAttributes->isUsed())
{
// check if really something is painted
bDone = DrawFillAttributes(aFillAttributes, aOrigBackRect, aRect, *pOut);
}
if(!bDone)
{
// if not, still a FillStyle could be set but the transparency is at 100%,
// thus need to check the model data itself for FillStyle (do not rely on
// SdrAllFillAttributesHelper since it already contains optimized information,
// e.g. transparency leads to no fill)
const XFillStyle eFillStyle(static_cast< const XFillStyleItem& >(GetAttrSet()->Get(XATTR_FILLSTYLE)).GetValue());
if(XFILL_NONE != eFillStyle)
{
bDone = true;
}
}
}
}
if(!bDone)
if(!bDone)
...
@@ -6724,13 +6744,41 @@ sal_Bool SwFrm::GetBackgroundBrush(
...
@@ -6724,13 +6744,41 @@ sal_Bool SwFrm::GetBackgroundBrush(
/// considered for fly frames
/// considered for fly frames
const sal_Bool bConsiderBackgroundTransparency = pFrm->IsFlyFrm();
const sal_Bool bConsiderBackgroundTransparency = pFrm->IsFlyFrm();
// #i125189# Do not base the decision for using the parent's fill style for this
// frame when the new DrawingLayer FillAttributes are used on the SdrAllFillAttributesHelper
// information. There the data is already optimized to no fill in the case that the
// transparence is at 100% while no fill is the criteria for derivation
bool bNewDrawingLayerFillStyleIsUsedAndNotNoFill(false);
if(rFillAttributes.get())
{
// the new DrawingLayer FillStyle is used
if(rFillAttributes->isUsed())
{
// it's not XFILL_NONE
bNewDrawingLayerFillStyleIsUsedAndNotNoFill = true;
}
else
{
// maybe optimized already when 100% transparency is used somewhere, need to test
// XFillStyleItem directly from the model data
const XFillStyle eFillStyle(static_cast< const XFillStyleItem& >(pFrm->GetAttrSet()->Get(XATTR_FILLSTYLE)).GetValue());
if(XFILL_NONE != eFillStyle)
{
bNewDrawingLayerFillStyleIsUsedAndNotNoFill = true;
}
}
}
/// OD 20.08.2002 #99657#
/// OD 20.08.2002 #99657#
/// add condition:
/// add condition:
/// If <bConsiderBackgroundTransparency> is set - see above -,
/// If <bConsiderBackgroundTransparency> is set - see above -,
/// return brush of frame <pFrm>, if its color is *not* "no fill"/"auto fill"
/// return brush of frame <pFrm>, if its color is *not* "no fill"/"auto fill"
if (
if (
// done when FillAttributesare set
// #i125189# Done when the new DrawingLayer FillAttributes are used and
(
rFillAttributes
.
get
()
&&
rFillAttributes
->
isUsed
())
||
// not XFILL_NONE (see above)
bNewDrawingLayerFillStyleIsUsedAndNotNoFill ||
// done when SvxBrushItem is used
// done when SvxBrushItem is used
!rBack.GetColor().GetTransparency() || rBack.GetGraphicPos() != GPOS_NONE ||
!rBack.GetColor().GetTransparency() || rBack.GetGraphicPos() != GPOS_NONE ||
...
...
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