summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2020-12-24 11:32:51 +1100
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-12-26 19:25:17 +0100
commitb75c9642f0cae522c5cc0f059e801819662b2ddf (patch)
tree2afc38645359cc5dfd007b94b63117c8c1898239 /sw
parent43978d8f25a41c20c72d93cc3cb972c93c52674a (diff)
vcl: use Color:IsTransparent() where appropriate
Change-Id: I37bbab5f22f91faad65be8ef79734ce1ee6355d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108249 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/access/accframe.cxx4
-rw-r--r--sw/source/core/layout/atrfrm.cxx6
-rw-r--r--sw/source/core/layout/paintfrm.cxx14
-rw-r--r--sw/source/core/text/inftxt.cxx2
-rw-r--r--sw/source/filter/ww8/docxsdrexport.cxx2
5 files changed, 14 insertions, 14 deletions
diff --git a/sw/source/core/access/accframe.cxx b/sw/source/core/access/accframe.cxx
index a3ece547a8a9..2e47aefcdcf4 100644
--- a/sw/source/core/access/accframe.cxx
+++ b/sw/source/core/access/accframe.cxx
@@ -381,8 +381,8 @@ bool SwAccessibleFrame::IsOpaque( SwViewShell const *pVSh ) const
// If a fly frame has a transparent background color, we have to consider the background.
// But a background color "no fill"/"auto fill" should *not* be considered.
if( pFrame->IsFlyFrame() &&
- (rBack.GetColor().GetTransparency() != 0) &&
- (rBack.GetColor() != COL_TRANSPARENT)
+ rBack.GetColor().IsTransparent() &&
+ rBack.GetColor() != COL_TRANSPARENT
)
return true;
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 5d9ffa3e3254..73078517cc03 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -3205,8 +3205,8 @@ bool SwFlyFrameFormat::IsBackgroundTransparent() const
// from its anchor.
std::unique_ptr<SvxBrushItem> aBackground(makeBackgroundBrushItem());
if ( aBackground &&
- (aBackground->GetColor().GetTransparency() != 0) &&
- (aBackground->GetColor() != COL_TRANSPARENT)
+ aBackground->GetColor().IsTransparent() &&
+ aBackground->GetColor() != COL_TRANSPARENT
)
{
return true;
@@ -3215,7 +3215,7 @@ bool SwFlyFrameFormat::IsBackgroundTransparent() const
{
const GraphicObject *pTmpGrf = aBackground->GetGraphicObject();
if ( pTmpGrf &&
- (pTmpGrf->GetAttr().GetTransparency() != 0)
+ pTmpGrf->GetAttr().IsTransparent()
)
{
return true;
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 9609a6567af2..27bfd520e03c 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -1567,13 +1567,13 @@ static void lcl_implDrawGraphicBackgrd( const SvxBrushItem& _rBackgrdBrush,
/// and calculate transparency percent value
sal_Int8 nTransparencyPercent = 0;
bool bDrawTransparent = false;
- if ( aColor.GetTransparency() != 0 )
+ if ( aColor.IsTransparent() )
/// background color is transparent --> draw transparent.
{
bDrawTransparent = true;
nTransparencyPercent = (aColor.GetTransparency()*100 + 0x7F)/0xFF;
}
- else if ( (_rGraphicObj.GetAttr().GetTransparency() != 0) &&
+ else if ( (_rGraphicObj.GetAttr().IsTransparent()) &&
(_rBackgrdBrush.GetColor() == COL_TRANSPARENT) )
/// graphic is drawn transparent and background color is
/// "no fill"/"auto fill" --> draw transparent
@@ -2003,7 +2003,7 @@ void DrawGraphic(
if ( bConsiderBackgroundTransparency )
{
GraphicAttr aGrfAttr = pGrf->GetAttr();
- if ( (aGrfAttr.GetTransparency() != 0) &&
+ if ( (aGrfAttr.IsTransparent()) &&
(pBrush->GetColor() == COL_TRANSPARENT)
)
{
@@ -2040,7 +2040,7 @@ void DrawGraphic(
} eDrawStyle = Default;
if (bConsiderBackgroundTransparency &&
- ( ( aColor.GetTransparency() != 0) ||
+ ( ( aColor.IsTransparent()) ||
bTransparentGrfWithNoFillBackgrd ) )
{
eDrawStyle = Transparent;
@@ -3765,7 +3765,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const
if ( GetBackgroundBrush( aFillAttributes, pBackgrdBrush, xSectionTOXColor, aDummyRect, false, /*bConsiderTextBox=*/false) )
{
if ( xSectionTOXColor &&
- (xSectionTOXColor->GetTransparency() != 0) &&
+ (xSectionTOXColor->IsTransparent()) &&
(xSectionTOXColor != COL_TRANSPARENT) )
{
bBackgroundTransparent = true;
@@ -3776,7 +3776,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const
}
else if ( pBackgrdBrush )
{
- if ( (pBackgrdBrush->GetColor().GetTransparency() != 0) &&
+ if ( (pBackgrdBrush->GetColor().IsTransparent()) &&
(pBackgrdBrush->GetColor() != COL_TRANSPARENT) )
{
bBackgroundTransparent = true;
@@ -3786,7 +3786,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const
const GraphicObject *pTmpGrf =
pBackgrdBrush->GetGraphicObject();
if ( pTmpGrf &&
- (pTmpGrf->GetAttr().GetTransparency() != 0)
+ (pTmpGrf->GetAttr().IsTransparent())
)
{
bBackgroundTransparent = true;
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 8d6026886b35..54852e600c1b 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -714,7 +714,7 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, const SwLinePortion &rPo
// Handle semi-transparent text if necessary.
std::unique_ptr<SwTransparentTextGuard, o3tl::default_delete<SwTransparentTextGuard>> pTransparentText;
- if (m_pFnt->GetColor() != COL_AUTO && m_pFnt->GetColor().GetTransparency() != 0)
+ if (m_pFnt->GetColor() != COL_AUTO && m_pFnt->GetColor().IsTransparent())
{
pTransparentText.reset(new SwTransparentTextGuard(rPor, *this, aDrawInf));
}
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 570451503029..54ae41500552 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -1082,7 +1082,7 @@ void DocxSdrExport::writeDMLAndVMLDrawing(const SdrObject* sdrObj,
// Converts ARGB transparency (0..255) to drawingml alpha (opposite, and 0..100000)
static OString lcl_ConvertTransparency(const Color& rColor)
{
- if (rColor.GetTransparency() > 0)
+ if (rColor.IsTransparent())
{
sal_Int32 nTransparencyPercent = 100 - float(rColor.GetTransparency()) / 2.55;
return OString::number(nTransparencyPercent * oox::drawingml::PER_PERCENT);