[Libreoffice-commits] core.git: cui/source drawinglayer/source editeng/source include/vcl sc/source svtools/source sw/source vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 8 08:09:15 UTC 2021


 cui/source/tabpages/chardlg.cxx             |    2 +-
 drawinglayer/source/tools/wmfemfhelper.cxx  |    4 ++--
 editeng/source/items/frmitems.cxx           |    6 +++---
 editeng/source/items/textitem.cxx           |    2 +-
 include/vcl/outdev.hxx                      |    4 ++--
 sc/source/filter/excel/xestyle.cxx          |    2 +-
 sc/source/filter/html/htmlexp.cxx           |    2 +-
 sc/source/ui/view/output.cxx                |    4 ++--
 svtools/source/table/tablecontrol_impl.cxx  |    2 +-
 sw/source/core/access/accframe.cxx          |    2 +-
 sw/source/filter/ww8/rtfattributeoutput.cxx |    6 +++---
 sw/source/filter/ww8/ww8atr.cxx             |    4 ++--
 sw/source/filter/ww8/ww8par6.cxx            |    2 +-
 sw/source/filter/xml/xmlexpit.cxx           |    2 +-
 vcl/source/bitmap/BitmapEx.cxx              |    2 +-
 vcl/source/font/font.cxx                    |    2 +-
 vcl/source/outdev/wallpaper.cxx             |    2 +-
 vcl/source/window/window2.cxx               |    4 ++--
 18 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit bac6c21fb20607db0758210bf9946b46ecbb2a6f
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Thu Jan 7 18:21:45 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jan 8 09:08:37 2021 +0100

    use more IsTransparent
    
    Change-Id: I3ef18a2601a51d56614b5da9b56e871bd33ec79e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108942
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 39cc697ff7ff..5751a9e8064f 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -1543,7 +1543,7 @@ void SvxCharEffectsPage::ResetColor_Impl( const SfxItemSet& rSet )
             m_aPreviewWin.Invalidate();
 
             Color aRGBColor = aColor;
-            if (aRGBColor.GetTransparency() && aColor != COL_AUTO)
+            if (aRGBColor.IsTransparent() && aColor != COL_AUTO)
             {
                 aRGBColor.SetTransparency(0);
             }
diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx
index 45e381f1c47a..a5f0278b0c64 100644
--- a/drawinglayer/source/tools/wmfemfhelper.cxx
+++ b/drawinglayer/source/tools/wmfemfhelper.cxx
@@ -1007,7 +1007,7 @@ namespace wmfemfhelper
                         rWallpaper.GetGradient(),
                         rProperty));
             }
-            else if(!rWallpaper.GetColor().GetTransparency())
+            else if(!rWallpaper.GetColor().IsTransparent())
             {
                 rTarget.append(
                     CreateColorWallpaper(
@@ -2236,7 +2236,7 @@ namespace wmfemfhelper
                                         rWallpaper.GetGradient(),
                                         rPropertyHolders.Current()));
                             }
-                            else if(!rWallpaper.GetColor().GetTransparency())
+                            else if(!rWallpaper.GetColor().IsTransparent())
                             {
                                 // create color background
                                 rTargetHolders.Current().append(
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 43a9be8e4635..6dfacab3ec6f 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1189,7 +1189,7 @@ bool SvxShadowItem::GetPresentation
             rText = ::GetColorString( aShadowColor ) + cpDelim;
             const char* pId = RID_SVXITEMS_TRANSPARENT_FALSE;
 
-            if ( aShadowColor.GetTransparency() )
+            if ( aShadowColor.IsTransparent() )
                 pId = RID_SVXITEMS_TRANSPARENT_TRUE;
             rText += EditResId(pId) +
                     cpDelim +
@@ -1205,7 +1205,7 @@ bool SvxShadowItem::GetPresentation
                     cpDelim;
 
             const char* pId = RID_SVXITEMS_TRANSPARENT_FALSE;
-            if ( aShadowColor.GetTransparency() )
+            if ( aShadowColor.IsTransparent() )
                 pId = RID_SVXITEMS_TRANSPARENT_TRUE;
             rText += EditResId(pId) +
                     cpDelim +
@@ -3096,7 +3096,7 @@ bool SvxBrushItem::GetPresentation
         rText = ::GetColorString( aColor ) + cpDelim;
         const char* pId = RID_SVXITEMS_TRANSPARENT_FALSE;
 
-        if ( aColor.GetTransparency() )
+        if ( aColor.IsTransparent() )
             pId = RID_SVXITEMS_TRANSPARENT_TRUE;
         rText += EditResId(pId);
     }
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index dd2205b670ab..5b931336426e 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -936,7 +936,7 @@ bool SvxTextLineItem::GetPresentation
 )   const
 {
     rText = GetValueTextByPos( GetValue() );
-    if( !mColor.GetTransparency() )
+    if( !mColor.IsTransparent() )
         rText += cpDelim + ::GetColorString( mColor );
     return true;
 }
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index d2e21fb0324c..6daab02f95f1 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1140,12 +1140,12 @@ public:
     void                        SetTextLineColor();
     void                        SetTextLineColor( const Color& rColor );
     const Color&                GetTextLineColor() const { return maTextLineColor; }
-    bool                        IsTextLineColor() const { return (maTextLineColor.GetTransparency() == 0); }
+    bool                        IsTextLineColor() const { return !maTextLineColor.IsTransparent(); }
 
     void                        SetOverlineColor();
     void                        SetOverlineColor( const Color& rColor );
     const Color&                GetOverlineColor() const { return maOverlineColor; }
-    bool                        IsOverlineColor() const { return (maOverlineColor.GetTransparency() == 0); }
+    bool                        IsOverlineColor() const { return !maOverlineColor.IsTransparent(); }
 
     void                        SetTextAlign( TextAlign eAlign );
     TextAlign                   GetTextAlign() const { return maFont.GetAlignment(); }
diff --git a/sc/source/filter/excel/xestyle.cxx b/sc/source/filter/excel/xestyle.cxx
index 7a5626047c99..031639564a78 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1873,7 +1873,7 @@ XclExpCellArea::XclExpCellArea() :
 bool XclExpCellArea::FillFromItemSet( const SfxItemSet& rItemSet, XclExpPalette& rPalette, bool bStyle )
 {
     const SvxBrushItem& rBrushItem = rItemSet.Get( ATTR_BACKGROUND );
-    if( rBrushItem.GetColor().GetTransparency() )
+    if( rBrushItem.GetColor().IsTransparent() )
     {
         mnPattern = EXC_PATT_NONE;
         mnForeColorId = XclExpPalette::GetColorIdFromIndex( EXC_COLOR_WINDOWTEXT );
diff --git a/sc/source/filter/html/htmlexp.cxx b/sc/source/filter/html/htmlexp.cxx
index f7e04a15c3c8..da5094ff23ff 100644
--- a/sc/source/filter/html/htmlexp.cxx
+++ b/sc/source/filter/html/htmlexp.cxx
@@ -608,7 +608,7 @@ void ScHTMLExport::WriteBody()
                 }
             }
         }
-        if ( !aHTMLStyle.aBackgroundColor.GetTransparency() )
+        if ( !aHTMLStyle.aBackgroundColor.IsTransparent() )
         {   // A transparent background color should always result in default
             // background of the browser. Also, HTMLOutFuncs::Out_Color() writes
             // black #000000 for COL_AUTO which is the same as white #ffffff with
diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 1da5dff9a3f8..a64f7f047e8d 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -920,7 +920,7 @@ void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const &
     if (pOldColor && (pBackground || pOldColor != pColor || pOldDataBarInfo || pDataBarInfo || pIconSetInfo || pOldIconSetInfo))
     {
         rRect.SetRight( nPosX-nSignedOneX );
-        if( !pOldColor->GetTransparency() )
+        if( !pOldColor->IsTransparent() )
         {
             rRenderContext.SetFillColor( *pOldColor );
             rRenderContext.DrawRect( rRect );
@@ -939,7 +939,7 @@ void drawCells(vcl::RenderContext& rRenderContext, std::optional<Color> const &
         if (pOldBackground)             // ==0 if hidden
         {
             Color aBackCol = pOldBackground->GetColor();
-            if ( !aBackCol.GetTransparency() )      //! partial transparency?
+            if ( !aBackCol.IsTransparent() )      //! partial transparency?
             {
                 rRenderContext.SetFillColor( aBackCol );
                 rRenderContext.DrawRect( rRect );
diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx
index 0327e33728b7..9926bb82e7c3 100644
--- a/svtools/source/table/tablecontrol_impl.cxx
+++ b/svtools/source/table/tablecontrol_impl.cxx
@@ -1856,7 +1856,7 @@ namespace svt::table
     void TableControl_Impl::invalidateRect(const tools::Rectangle &rInvalidateRect)
     {
         m_pDataWindow->Invalidate( rInvalidateRect,
-            m_pDataWindow->GetControlBackground().GetTransparency() ? InvalidateFlags::Transparent : InvalidateFlags::NONE );
+            m_pDataWindow->GetControlBackground().IsTransparent() ? InvalidateFlags::Transparent : InvalidateFlags::NONE );
     }
 
 
diff --git a/sw/source/core/access/accframe.cxx b/sw/source/core/access/accframe.cxx
index 2e47aefcdcf4..0aa31107279d 100644
--- a/sw/source/core/access/accframe.cxx
+++ b/sw/source/core/access/accframe.cxx
@@ -374,7 +374,7 @@ bool SwAccessibleFrame::IsOpaque( SwViewShell const *pVSh ) const
             return false;
 
         const SvxBrushItem &rBack = pFrame->GetAttrSet()->GetBackground();
-        if( !rBack.GetColor().GetTransparency() ||
+        if( !rBack.GetColor().IsTransparent() ||
              rBack.GetGraphicPos() != GPOS_NONE )
             return true;
 
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx
index 6213a509aa3e..3f39c585a0ab 100644
--- a/sw/source/filter/ww8/rtfattributeoutput.cxx
+++ b/sw/source/filter/ww8/rtfattributeoutput.cxx
@@ -801,7 +801,7 @@ void RtfAttributeOutput::TableBackgrounds(
             aColor = rBack.GetColor();
     }
 
-    if (!aColor.GetTransparency())
+    if (!aColor.IsTransparent())
     {
         m_aRowDefs.append(OOO_STRING_SVTOOLS_RTF_CLCBPAT);
         m_aRowDefs.append(static_cast<sal_Int32>(m_rExport.GetColor(aColor)));
@@ -2644,7 +2644,7 @@ void RtfAttributeOutput::CharAnimatedText(const SvxBlinkItem& rBlink)
 
 void RtfAttributeOutput::CharBackground(const SvxBrushItem& rBrush)
 {
-    if (!rBrush.GetColor().GetTransparency())
+    if (!rBrush.GetColor().IsTransparent())
     {
         m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CHCBPAT);
         m_aStyles.append(static_cast<sal_Int32>(m_rExport.GetColor(rBrush.GetColor())));
@@ -3460,7 +3460,7 @@ void RtfAttributeOutput::FormatBackground(const SvxBrushItem& rBrush)
         m_aFlyProperties.push_back(std::make_pair<OString, OString>(
             "fillColor", OString::number(wwUtility::RGBToBGR(rColor))));
     }
-    else if (!rBrush.GetColor().GetTransparency())
+    else if (!rBrush.GetColor().IsTransparent())
     {
         m_aStyles.append(OOO_STRING_SVTOOLS_RTF_CBPAT);
         m_aStyles.append(static_cast<sal_Int32>(m_rExport.GetColor(rBrush.GetColor())));
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index e05882cd09ad..e6501dc34ca3 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1554,7 +1554,7 @@ void WW8AttributeOutput::CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisM
  */
 bool WW8Export::TransBrush(const Color& rCol, WW8_SHD& rShd)
 {
-    if( rCol.GetTransparency() )
+    if( rCol.IsTransparent() )
         rShd = WW8_SHD();               // all zeros: transparent
     else
     {
@@ -1562,7 +1562,7 @@ bool WW8Export::TransBrush(const Color& rCol, WW8_SHD& rShd)
         rShd.SetBack( msfilter::util::TransColToIco( rCol ) );
         rShd.SetStyle( 0 );
     }
-    return !rCol.GetTransparency();
+    return !rCol.IsTransparent();
 }
 
 static sal_uInt32 SuitableBGColor(Color nIn)
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index fe4a3ec91d61..061a98923e21 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3603,7 +3603,7 @@ void SwWW8ImplReader::Read_TextForeColor(sal_uInt16, const sal_uInt8* pData, sho
         Color aColor(msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)));
 
         // At least when transparency is 0xff and the color is black, Word renders that as black.
-        if (aColor.GetTransparency() && aColor != COL_AUTO)
+        if (aColor.IsTransparent() && aColor != COL_AUTO)
         {
             aColor.SetTransparency(0);
         }
diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx
index d458936a0116..4ab794cc8a9c 100644
--- a/sw/source/filter/xml/xmlexpit.cxx
+++ b/sw/source/filter/xml/xmlexpit.cxx
@@ -882,7 +882,7 @@ bool SvXMLExportItemMapper::QueryXMLValue(
             switch( nMemberId )
             {
                 case MID_BACK_COLOR:
-                    if ( rBrush.GetColor().GetTransparency() )
+                    if ( rBrush.GetColor().IsTransparent() )
                         aOut.append( GetXMLToken(XML_TRANSPARENT) );
                     else
                     {
diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx
index 08da777e3cc5..18978f779f4a 100644
--- a/vcl/source/bitmap/BitmapEx.cxx
+++ b/vcl/source/bitmap/BitmapEx.cxx
@@ -572,7 +572,7 @@ bool BitmapEx::Erase( const Color& rFillColor )
         if( bRet && ( meTransparent == TransparentType::Bitmap ) && !!maMask )
         {
             // Respect transparency on fill color
-            if( rFillColor.GetTransparency() )
+            if( rFillColor.IsTransparent() )
             {
                 const Color aFill( rFillColor.GetTransparency(), rFillColor.GetTransparency(), rFillColor.GetTransparency() );
                 maMask.Erase( aFill );
diff --git a/vcl/source/font/font.cxx b/vcl/source/font/font.cxx
index fdd9ef68413e..21334ecba1cf 100644
--- a/vcl/source/font/font.cxx
+++ b/vcl/source/font/font.cxx
@@ -89,7 +89,7 @@ void Font::SetColor( const Color& rColor )
 void Font::SetFillColor( const Color& rColor )
 {
     mpImplFont->maFillColor = rColor;
-    if ( rColor.GetTransparency() )
+    if ( rColor.IsTransparent() )
         mpImplFont->mbTransparent = true;
 }
 
diff --git a/vcl/source/outdev/wallpaper.cxx b/vcl/source/outdev/wallpaper.cxx
index 34d5d0c81e11..62258420ef5e 100644
--- a/vcl/source/outdev/wallpaper.cxx
+++ b/vcl/source/outdev/wallpaper.cxx
@@ -165,7 +165,7 @@ void OutputDevice::DrawBitmapWallpaper( tools::Long nX, tools::Long nY,
             bDrawGradientBackground = true;
         else
         {
-            if( !pCached && !rWallpaper.GetColor().GetTransparency() )
+            if( !pCached && !rWallpaper.GetColor().IsTransparent() )
             {
                 ScopedVclPtrInstance< VirtualDevice > aVDev(  *this  );
                 aVDev->SetBackground( rWallpaper.GetColor() );
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index dc3dcdc93db0..babf85198949 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -466,7 +466,7 @@ void Window::SetControlForeground()
 
 void Window::SetControlForeground(const Color& rColor)
 {
-    if (rColor.GetTransparency())
+    if (rColor.IsTransparent())
     {
         if (mpWindowImpl->mbControlForeground)
         {
@@ -506,7 +506,7 @@ void Window::SetControlBackground()
 
 void Window::SetControlBackground(const Color& rColor)
 {
-    if (rColor.GetTransparency())
+    if (rColor.IsTransparent())
     {
         if (mpWindowImpl->mbControlBackground)
         {


More information about the Libreoffice-commits mailing list