include/vcl/outdev.hxx                   |    2 ++
 sw/source/core/crsr/FormFieldButton.cxx  |    5 ++++-
 sw/source/core/layout/paintfrm.cxx       |    7 ++++++-
 sw/source/core/text/inftxt.cxx           |    7 +++++--
 sw/source/core/view/viewsh.cxx           |   10 ++++++++--
 sw/source/ui/table/autoformatpreview.cxx |    5 ++++-
 sw/source/uibase/wrtsh/wrtsh1.cxx        |    4 ++++
 7 files changed, 33 insertions(+), 7 deletions(-)

New commits:
commit 564dc936cdc3014304db88426a97d8253f28665f
Author:     Noel Grandin <[email protected]>
AuthorDate: Mon Jun 30 12:00:42 2025 +0200
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Sep 29 16:57:46 2025 +0200

    tdf#166842 do not use FillColor==COL_TRANSPARENT...
    
    .. on OutputDevice if that OutputDevice does not support alpha
    
    Change-Id: I52f8a496127462deecba9cf6fd19f827466d16cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187181
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    (cherry picked from commit 878dd795378776253e6c49d58805a219e0b8c33e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191174
    Reviewed-by: Michael Weghorn <[email protected]>
    Reviewed-by: Ilmari Lauhakangas <[email protected]>
    Tested-by: Xisco Fauli <[email protected]>
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 76b9480d90c8..5d6381b2e63a 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1366,6 +1366,8 @@ public:
 
     virtual Bitmap              GetBitmap( const Point& rSrcPt, const Size& 
rSize ) const;
 
+    bool HasAlpha() const { return bool(mpAlphaVDev); }
+
     /** Query extended bitmap (with alpha channel, if available).
      */
     BitmapEx                    GetBitmapEx( const Point& rSrcPt, const Size& 
rSize ) const;
diff --git a/sw/source/core/crsr/FormFieldButton.cxx 
b/sw/source/core/crsr/FormFieldButton.cxx
index 319dcdb9c0dd..a3edb345ce68 100644
--- a/sw/source/core/crsr/FormFieldButton.cxx
+++ b/sw/source/core/crsr/FormFieldButton.cxx
@@ -114,7 +114,10 @@ void FormFieldButton::Paint(vcl::RenderContext& 
rRenderContext, const tools::Rec
                m_aFieldFramePixel.GetSize().Height() - nPadding);
     const tools::Rectangle aFrameRect(tools::Rectangle(aPos, aSize));
     rRenderContext.SetLineColor(aLineColor);
-    rRenderContext.SetFillColor(COL_TRANSPARENT);
+    if (rRenderContext.HasAlpha())
+        rRenderContext.SetFillColor(COL_TRANSPARENT);
+    else
+        rRenderContext.SetFillColor(COL_WHITE);
     rRenderContext.DrawRect(aFrameRect);
 
     // Draw the button next to the frame
diff --git a/sw/source/core/layout/paintfrm.cxx 
b/sw/source/core/layout/paintfrm.cxx
index 1a2114610ac9..a5c64a5af91b 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -2040,7 +2040,12 @@ void DrawGraphic(
             default:
             {
                 if( rOutDev.GetFillColor() != aColor )
-                    rOutDev.SetFillColor( aColor );
+                {
+                    if (aColor.IsTransparent() && !rOutDev.HasAlpha())
+                        rOutDev.SetFillColor();
+                    else
+                        rOutDev.SetFillColor( aColor );
+                }
                 break;
             }
         }
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 3cb5a8226d7a..7c85cc95a8a8 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -565,7 +565,7 @@ namespace
  */
 class SwTransparentTextGuard
 {
-    ScopedVclPtrInstance<VirtualDevice> m_aContentVDev;
+    ScopedVclPtrInstance<VirtualDevice> m_aContentVDev { 
DeviceFormat::WITH_ALPHA };
     GDIMetaFile m_aContentMetafile;
     MapMode m_aNewMapMode;
     SwRect m_aPorRect;
@@ -1273,7 +1273,10 @@ void SwTextPaintInfo::DrawBackBrush( const SwLinePortion 
&rPor ) const
 
     pTmpOut->Push( vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR );
 
-    pTmpOut->SetFillColor(aFillColor);
+    if (aFillColor == COL_TRANSPARENT)
+        pTmpOut->SetFillColor();
+    else
+        pTmpOut->SetFillColor(aFillColor);
     pTmpOut->SetLineColor();
 
     DrawRect( aIntersect, false );
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index d92a31c84708..3822fc7fc3eb 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -490,8 +490,14 @@ void 
SwViewShell::ImplUnlockPaint(std::vector<LockPaintReason>& rReasons, bool b
                 GetWin()->Validate();
 
                 Imp()->UnlockPaint();
-                pVout->SetLineColor( mpOut->GetLineColor() );
-                pVout->SetFillColor( mpOut->GetFillColor() );
+                if (mpOut->IsLineColor())
+                    pVout->SetLineColor( mpOut->GetLineColor() );
+                else
+                    pVout->SetLineColor();
+                if (mpOut->IsFillColor())
+                    pVout->SetFillColor( mpOut->GetFillColor() );
+                else
+                    pVout->SetFillColor();
 
                 // #i72754# start Pre/PostPaint encapsulation before mpOut is 
changed to the buffering VDev
                 const vcl::Region aRepaintRegion(VisArea().SVRect());
diff --git a/sw/source/ui/table/autoformatpreview.cxx 
b/sw/source/ui/table/autoformatpreview.cxx
index 193d289793d1..fe41318798a5 100644
--- a/sw/source/ui/table/autoformatpreview.cxx
+++ b/sw/source/ui/table/autoformatpreview.cxx
@@ -329,7 +329,10 @@ void AutoFormatPreview::DrawBackground(vcl::RenderContext& 
rRenderContext)
 
             rRenderContext.Push(vcl::PushFlags::LINECOLOR | 
vcl::PushFlags::FILLCOLOR);
             rRenderContext.SetLineColor();
-            rRenderContext.SetFillColor(aBrushItem.GetColor());
+            if (aBrushItem.GetColor() == COL_TRANSPARENT)
+                rRenderContext.SetFillColor();
+            else
+                rRenderContext.SetFillColor(aBrushItem.GetColor());
             const basegfx::B2DRange aCellRange(maArray.GetCellRange(nCol, 
nRow));
             rRenderContext.DrawRect(
                 
tools::Rectangle(basegfx::fround<tools::Long>(aCellRange.getMinX()),
commit a334dba3957bdebbfcf940a3746bdb9db8b61805
Author:     Jim Raykowski <[email protected]>
AuthorDate: Wed Sep 24 17:09:25 2025 -0800
Commit:     Xisco Fauli <[email protected]>
CommitDate: Mon Sep 29 16:57:36 2025 +0200

    tdf#166713 Fix crash in lcl_FoldedOutlineNodeEndOfParaSplit
    
    by handling the case of a paragraph outline level set by direct
    formatting.
    
    Change-Id: Ida0c8f91f0fb0584b39c16b3ddf2201429c6943f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191471
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <[email protected]>
    (cherry picked from commit fd9ae53e39f3219474461d1e8e3220d8efdfcecb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191482
    Reviewed-by: Xisco Fauli <[email protected]>
    (cherry picked from commit 5b9e275838ec1cd08f1c1755de545b4f7f34c7d1)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191501
    Reviewed-by: Ilmari Lauhakangas <[email protected]>
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Xisco Fauli <[email protected]>

diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx 
b/sw/source/uibase/wrtsh/wrtsh1.cxx
index bf055e729c4e..0b2044c90def 100644
--- a/sw/source/uibase/wrtsh/wrtsh1.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh1.cxx
@@ -1396,6 +1396,10 @@ static bool 
lcl_FoldedOutlineNodeEndOfParaSplit(SwWrtShell *pThis)
 
             SwTextNode* pNd = pDoc->GetNodes().MakeTextNode(*pEndNd, 
pTextNode->GetTextColl(), true);
 
+            // if the outline level is not set in style then it is set in 
direct formatting
+            if (!pTextNode->GetTextColl()->GetAttrOutlineLevel())
+                pNd->SetAttrOutlineLevel(pTextNode->GetAttrOutlineLevel());
+
             (void) rOutlineNodes.Seek_Entry(pNd, &nPos);
             pThis->GotoOutline(nPos);
 

Reply via email to