sw/CppunitTest_sw_core_text.mk            |    1 
 sw/Library_msword.mk                      |    1 
 sw/inc/viewsh.hxx                         |    4 +--
 sw/qa/core/text/itrpaint.cxx              |   37 +++++++++++++++++----------
 sw/source/core/inc/drawfont.hxx           |    4 +++
 sw/source/core/text/inftxt.cxx            |    5 +++
 sw/source/core/text/inftxt.hxx            |    2 +
 sw/source/core/text/itrpaint.cxx          |   40 ++++++++++++++++++++++++++++++
 sw/source/core/txtnode/fntcache.cxx       |   19 ++++++++++++++
 sw/source/filter/ww8/docxexportfilter.cxx |    4 +++
 sw/source/filter/ww8/docxsdrexport.cxx    |   18 ++++---------
 sw/source/uibase/app/swmodul1.cxx         |   31 +++++------------------
 sw/source/uibase/inc/wrtsh.hxx            |    4 +--
 vcl/source/bitmap/BitmapDuoToneFilter.cxx |    4 ++-
 14 files changed, 119 insertions(+), 55 deletions(-)

New commits:
commit ea12cda737ffb52da70351c93ab990ba072ccde2
Author:     Aron Budea <[email protected]>
AuthorDate: Thu Jan 15 16:01:53 2026 +1030
Commit:     Andras Timar <[email protected]>
CommitDate: Fri Jan 16 11:43:17 2026 +0100

    sw: fix order of attributes in wp:anchor on export
    
    To match original DOCX in eg. tdf#169802 bugdoc.
    
    Change-Id: Ife68c293508bfed4f2a2b1d130e310390513981e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197312
    Tested-by: Jenkins
    Reviewed-by: Aron Budea <[email protected]>
    (cherry picked from commit b2dd08c6af51996f9fd2988f060d5c0f08e247c6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197412
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/sw/source/filter/ww8/docxsdrexport.cxx 
b/sw/source/filter/ww8/docxsdrexport.cxx
index 4c84b825cb26..a6af45eec32f 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -847,7 +847,6 @@ void DocxSdrExport::startDMLAnchorInline(const 
SwFrameFormat* pFrameFormat, cons
                       && pObj->GetLayer() != 
iDocumentDrawModelAccess.GetHeaderFooterHellId()
                       && pObj->GetLayer() != 
iDocumentDrawModelAccess.GetInvisibleHellId();
         }
-        attrList->add(XML_behindDoc, bOpaque ? "0" : "1");
 
         attrList->add(XML_distT, OString::number(TwipsToEMU(nDistT)));
         attrList->add(XML_distB, OString::number(TwipsToEMU(nDistB)));
@@ -855,6 +854,11 @@ void DocxSdrExport::startDMLAnchorInline(const 
SwFrameFormat* pFrameFormat, cons
         attrList->add(XML_distR, OString::number(TwipsToEMU(nDistR)));
 
         attrList->add(XML_simplePos, "0");
+
+        // It seems 0 and 1 have special meaning: just start counting from 2 
to avoid issues with that.
+        // Mandatory attribute, write 0 if pObj is null.
+        attrList->add(XML_relativeHeight, pObj ? 
OString::number(pObj->GetOrdNum() + 2) : "0"_ostr);
+        attrList->add(XML_behindDoc, bOpaque ? "0" : "1");
         attrList->add(XML_locked, "0");
 
         bool bLclInTabCell = true;
@@ -876,21 +880,11 @@ void DocxSdrExport::startDMLAnchorInline(const 
SwFrameFormat* pFrameFormat, cons
             bLclInTabCell = true;
         }
 
-        if (bLclInTabCell)
-            attrList->add(XML_layoutInCell, "1");
-        else
-            attrList->add(XML_layoutInCell, "0");
+        attrList->add(XML_layoutInCell, bLclInTabCell ? "1" : "0");
 
         bool bAllowOverlap = 
pFrameFormat->GetWrapInfluenceOnObjPos().GetAllowOverlap();
         attrList->add(XML_allowOverlap, bAllowOverlap ? "1" : "0");
 
-        if (pObj)
-            // It seems 0 and 1 have special meaning: just start counting from 
2 to avoid issues with that.
-            attrList->add(XML_relativeHeight, 
OString::number(pObj->GetOrdNum() + 2));
-        else
-            // relativeHeight is mandatory attribute, if value is not present, 
we must write default value
-            attrList->add(XML_relativeHeight, "0");
-
         if (pObj)
         {
             OUString sAnchorId = lclGetAnchorIdFromGrabBag(pObj);
commit 3ae99ea3ce3c8268e34fe78f527d4a38676dbd5b
Author:     Jim Raykowski <[email protected]>
AuthorDate: Sat Jan 3 15:40:11 2026 -0900
Commit:     Andras Timar <[email protected]>
CommitDate: Fri Jan 16 11:43:17 2026 +0100

    tdf#169964 Fix folded OLE objects are not saved in docx
    
    Examining DocxAttributeOutput::WriteFlyFrame case ww8::Frame::eOle,
    it seems that OLE objects need to have their frames visible in
    the document for them to be saved. This patch makes all folded
    outline content visible during execution of the
    DocxExportFilter:exportDocument function. SW_DLLPUBLIC's are added to
    make linking succeed with clang.
    
    Change-Id: I8fcaa98402ebd9a7a6135f65467a82bbca8731f9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196516
    Tested-by: Jenkins
    Reviewed-by: Jim Raykowski <[email protected]>
    (cherry picked from commit 9cdb58822849805ca939e1079b01262e75a96bf2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197316
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/sw/Library_msword.mk b/sw/Library_msword.mk
index 7d9d0c7f80f8..ba5ec835d642 100644
--- a/sw/Library_msword.mk
+++ b/sw/Library_msword.mk
@@ -32,6 +32,7 @@ $(eval $(call gb_Library_set_include,msword,\
     -I$(SRCDIR)/sw/source/core/inc \
     -I$(SRCDIR)/sw/source/filter/inc \
     -I$(SRCDIR)/sw/inc \
+    -I$(SRCDIR)/sw/source/uibase/inc \
     $$(INCLUDE) \
 ))
 
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index cece0d0dfdfc..8da56ee9b75b 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -523,9 +523,9 @@ public:
     void LockView( bool b )   { mbViewLocked = b;    }
 
     inline void LockPaint(LockPaintReason eReason);
-           void ImplLockPaint();
+    SW_DLLPUBLIC void ImplLockPaint();
     inline void UnlockPaint(bool bVirDev = false );
-           void ImplUnlockPaint( std::vector<LockPaintReason>& rReasons, bool 
bVirDev );
+    SW_DLLPUBLIC void ImplUnlockPaint(std::vector<LockPaintReason>& rReasons, 
bool bVirDev);
            bool IsPaintLocked() const { return mnLockPaint != 0; }
 
     // Get/set DrawView and PageView.
diff --git a/sw/source/filter/ww8/docxexportfilter.cxx 
b/sw/source/filter/ww8/docxexportfilter.cxx
index 8ea56f2f3661..258461dd0565 100644
--- a/sw/source/filter/ww8/docxexportfilter.cxx
+++ b/sw/source/filter/ww8/docxexportfilter.cxx
@@ -30,6 +30,8 @@
 
 #include <unotools/mediadescriptor.hxx>
 
+#include <wrtsh.hxx>
+
 using namespace ::comphelper;
 using namespace ::com::sun::star;
 
@@ -50,6 +52,8 @@ bool DocxExportFilter::exportDocument()
     if ( !pDoc )
         return false;
 
+    MakeAllOutlineContentTemporarilyVisible a(pDoc);
+
     // update layout (if present), for SwWriteTable
     SwViewShell* pViewShell = 
pDoc->getIDocumentLayoutAccess().GetCurrentViewShell();
     if (pViewShell != nullptr)
diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx
index f623299e3ac6..24e9c2a62131 100644
--- a/sw/source/uibase/inc/wrtsh.hxx
+++ b/sw/source/uibase/inc/wrtsh.hxx
@@ -524,7 +524,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)();
 
     bool IsOutlineContentVisible(const size_t nPos);
     void MakeOutlineContentVisible(const size_t nPos, bool bMakeVisible = 
true, bool bSetAttrOutlineVisibility = true);
-    void MakeAllFoldedOutlineContentVisible(bool bMakeVisible = true);
+    SW_DLLPUBLIC void MakeAllFoldedOutlineContentVisible(bool bMakeVisible = 
true);
     void InvalidateOutlineContentVisibility();
     bool GetAttrOutlineContentVisible(const size_t nPos) const;
 
@@ -702,7 +702,7 @@ inline bool SwWrtShell::Is_FnDragEQBeginDrag() const
 #endif
 }
 
-class MakeAllOutlineContentTemporarilyVisible
+class SW_DLLPUBLIC MakeAllOutlineContentTemporarilyVisible
 {
 private:
     SwWrtShell* m_pWrtSh = nullptr;
commit 9298451ab317706f82f5979701db685c95f152f0
Author:     Miklos Vajna <[email protected]>
AuthorDate: Thu Jan 15 09:27:37 2026 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Fri Jan 16 11:43:17 2026 +0100

    cool#13574 sw redline render mode: avoid coloring, set lightness
    
    User A managed to format a piece of text as red, formatted with
    underline and then user B is now confused why rejecting this tracked
    change doesn't work.
    
    This is working as intended for the normal redline render mode, but we
    can try something different for the 'omit insert/delete' redline render
    mode: when showing the old version, we can render deletes unchanged and
    when showing the new version, we can render inserts unchanged. The rest
    of the redlines can be semi-hidden.
    
    That semi-hidden is a bit tricky to provide. Now that we don't add
    layout-level colors in SwModule::GetInsertAuthorAttr(), we go with
    automatic color, which gets resolved quite late. So first figure out if
    we need to "omit" (semi-hide) the current redline portion in
    SwTextPainter::DrawTextLine(), and then pass around a flag, so that once
    SwFntObj::DrawText() is past ApplyAutoColor(), we can set lightness to a
    medium value.
    
    This is needed, because a typical auto color resolves to either white or
    black, and changing saturation has no effect for those colors. And this
    way we still get readable text in both light and dark mode.
    
    Change-Id: I0ff57cd996fda80fadc315ad0c6c85e5af1ff3e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197350
    Reviewed-by: Miklos Vajna <[email protected]>
    Tested-by: Jenkins
    (cherry picked from commit a24dd7b1d742ccd59768db8b6b6a522588952108)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197390
    Reviewed-by: Adolfo Jayme Barrientos <[email protected]>

diff --git a/sw/CppunitTest_sw_core_text.mk b/sw/CppunitTest_sw_core_text.mk
index bb6fba294df4..42be7e727b0c 100644
--- a/sw/CppunitTest_sw_core_text.mk
+++ b/sw/CppunitTest_sw_core_text.mk
@@ -34,6 +34,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_core_text, \
     sfx \
     subsequenttest \
     svl \
+    svt \
     sw \
        swqahelper \
     test \
diff --git a/sw/qa/core/text/itrpaint.cxx b/sw/qa/core/text/itrpaint.cxx
index 7eaed14187c8..a59960616d68 100644
--- a/sw/qa/core/text/itrpaint.cxx
+++ b/sw/qa/core/text/itrpaint.cxx
@@ -12,10 +12,13 @@
 #include <memory>
 
 #include <o3tl/string_view.hxx>
+#include <svtools/colorcfg.hxx>
 
 #include <docsh.hxx>
 #include <wrtsh.hxx>
 #include <ndtxt.hxx>
+#include <swmodule.hxx>
+#include <swdll.hxx>
 
 namespace
 {
@@ -29,8 +32,8 @@ public:
     }
 };
 
-/// #RRGGBB -> HSL saturation.
-sal_Int16 GetColorSaturation(std::u16string_view rRGB)
+/// #RRGGBB -> HSL lightness.
+sal_Int16 GetColorLightness(std::u16string_view rRGB)
 {
     Color aColor(o3tl::toInt32(rRGB.substr(1, 2), 16), 
o3tl::toInt32(rRGB.substr(3, 2), 16),
                  o3tl::toInt32(rRGB.substr(5, 2), 16));
@@ -38,12 +41,16 @@ sal_Int16 GetColorSaturation(std::u16string_view rRGB)
     sal_uInt16 nSaturation;
     sal_uInt16 nBrightness;
     aColor.RGBtoHSB(nHue, nSaturation, nBrightness);
-    return nSaturation;
+    return nBrightness;
 }
 
 CPPUNIT_TEST_FIXTURE(Test, testRedlineRenderModeOmitInsertDelete)
 {
-    // Default rendering: default, normal saturation, normal saturation.
+    // Reset redline author IDs to a predictable default.
+    SwGlobals::ensure();
+    SwModule::get()->ClearRedlineAuthors();
+
+    // Default rendering: default, normal lightness, normal lightness.
     createSwDoc("redline.docx");
 
     SwDocShell* pDocShell = getSwDocShell();
@@ -64,15 +71,17 @@ CPPUNIT_TEST_FIXTURE(Test, 
testRedlineRenderModeOmitInsertDelete)
     CPPUNIT_ASSERT_EQUAL(u"oldcontent"_ustr, aContent.copy(nIndex2, nLength2));
     OUString aColor2
         = getXPath(pXmlDoc, 
"(//textarray)[2]/preceding-sibling::textcolor[1]", "color");
-    CPPUNIT_ASSERT_GREATER(static_cast<sal_Int16>(50), 
GetColorSaturation(aColor2));
+    Color aRedlineColor = 
SwModule::get()->GetColorConfig().GetColorValue(svtools::AUTHOR1).nColor;
+    OUString aRedlineColorString = u"#"_ustr + aRedlineColor.AsRGBHexString();
+    CPPUNIT_ASSERT_EQUAL(aRedlineColorString, aColor2);
     sal_Int32 nIndex3 = getXPath(pXmlDoc, "(//textarray)[3]", 
"index").toInt32();
     sal_Int32 nLength3 = getXPath(pXmlDoc, "(//textarray)[3]", 
"length").toInt32();
     CPPUNIT_ASSERT_EQUAL(u"newcontent"_ustr, aContent.copy(nIndex3, nLength3));
     OUString aColor3
         = getXPath(pXmlDoc, 
"(//textarray)[3]/preceding-sibling::textcolor[1]", "color");
-    CPPUNIT_ASSERT_GREATER(static_cast<sal_Int16>(50), 
GetColorSaturation(aColor3));
+    CPPUNIT_ASSERT_EQUAL(aRedlineColorString, aColor3);
 
-    // Omit inserts: default, normal saturation, de-saturated.
+    // Omit inserts: default, normal lightness, increased lightness.
     SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
     SwViewOption aOpt(*pWrtShell->GetViewOptions());
     aOpt.SetRedlineRenderMode(SwRedlineRenderMode::OmitInserts);
@@ -91,16 +100,16 @@ CPPUNIT_TEST_FIXTURE(Test, 
testRedlineRenderModeOmitInsertDelete)
     nLength2 = getXPath(pXmlDoc, "(//textarray)[2]", "length").toInt32();
     CPPUNIT_ASSERT_EQUAL(u"oldcontent"_ustr, aContent.copy(nIndex2, nLength2));
     aColor2 = getXPath(pXmlDoc, 
"(//textarray)[2]/preceding-sibling::textcolor[1]", "color");
-    CPPUNIT_ASSERT_GREATER(static_cast<sal_Int16>(50), 
GetColorSaturation(aColor2));
+    CPPUNIT_ASSERT_EQUAL(u"#000000"_ustr, aColor2);
     nIndex3 = getXPath(pXmlDoc, "(//textarray)[3]", "index").toInt32();
     nLength3 = getXPath(pXmlDoc, "(//textarray)[3]", "length").toInt32();
     CPPUNIT_ASSERT_EQUAL(u"newcontent"_ustr, aContent.copy(nIndex3, nLength3));
     aColor3 = getXPath(pXmlDoc, 
"(//textarray)[3]/preceding-sibling::textcolor[1]", "color");
     // Without the accompanying fix in place, this test would have failed with:
-    // - Expected less or equal than: 50
-    // - Actual  : 100
-    // i.e. the 3rd text portion was not de-saturated.
-    CPPUNIT_ASSERT_LESSEQUAL(static_cast<sal_Int16>(50), 
GetColorSaturation(aColor3));
+    // - Expected greater or equal than: 49
+    // - Actual  : 0
+    // i.e. the 3rd text portion had no increased lightness from black.
+    CPPUNIT_ASSERT_GREATEREQUAL(static_cast<sal_Int16>(49), 
GetColorLightness(aColor3));
 
     // Omit deletes: default, de-saturated, normal saturation.
     aOpt.SetRedlineRenderMode(SwRedlineRenderMode::OmitDeletes);
@@ -119,12 +128,12 @@ CPPUNIT_TEST_FIXTURE(Test, 
testRedlineRenderModeOmitInsertDelete)
     nLength2 = getXPath(pXmlDoc, "(//textarray)[2]", "length").toInt32();
     CPPUNIT_ASSERT_EQUAL(u"oldcontent"_ustr, aContent.copy(nIndex2, nLength2));
     aColor2 = getXPath(pXmlDoc, 
"(//textarray)[2]/preceding-sibling::textcolor[1]", "color");
-    CPPUNIT_ASSERT_LESSEQUAL(static_cast<sal_Int16>(50), 
GetColorSaturation(aColor2));
+    CPPUNIT_ASSERT_GREATEREQUAL(static_cast<sal_Int16>(49), 
GetColorLightness(aColor2));
     nIndex3 = getXPath(pXmlDoc, "(//textarray)[3]", "index").toInt32();
     nLength3 = getXPath(pXmlDoc, "(//textarray)[3]", "length").toInt32();
     CPPUNIT_ASSERT_EQUAL(u"newcontent"_ustr, aContent.copy(nIndex3, nLength3));
     aColor3 = getXPath(pXmlDoc, 
"(//textarray)[3]/preceding-sibling::textcolor[1]", "color");
-    CPPUNIT_ASSERT_GREATER(static_cast<sal_Int16>(50), 
GetColorSaturation(aColor3));
+    CPPUNIT_ASSERT_EQUAL(u"#000000"_ustr, aColor3);
 }
 }
 
diff --git a/sw/source/core/inc/drawfont.hxx b/sw/source/core/inc/drawfont.hxx
index 443f47635353..18c7913abf00 100644
--- a/sw/source/core/inc/drawfont.hxx
+++ b/sw/source/core/inc/drawfont.hxx
@@ -91,6 +91,7 @@ class SW_DLLPUBLIC SwDrawTextInfo
     // GetModelPositionForViewPoint should not return the next position if 
screen position is
     // inside second half of bound rect, used for Accessibility
     bool m_bPosMatchesBounds : 1 = false;
+    bool m_bOmitPaint = false;
 
 #ifdef DBG_UTIL
     // These flags should control that the appropriate Set-function has been
@@ -658,6 +659,9 @@ public:
     // as argument, the change if made to the font otherwise the font at the
     // output device is changed returns if the font has been changed
     bool ApplyAutoColor( vcl::Font* pFnt = nullptr );
+
+    void SetOmitPaint(bool bOmitPaint) { m_bOmitPaint = bOmitPaint; }
+    bool GetOmitPaint() const { return m_bOmitPaint; }
 };
 
 #endif
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 8110a64b95e0..d63102bc4f07 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -725,6 +725,11 @@ void SwTextPaintInfo::DrawText_( const OUString &rText, 
const SwLinePortion &rPo
                              rPor.GetNextPortion()->InFixMargGrp() ||
                              rPor.GetNextPortion()->IsHolePortion() );
 
+    if (m_bOmitPaint)
+    {
+        aDrawInf.SetOmitPaint(m_bOmitPaint);
+    }
+
     // Draw text next to the left border
     Point aFontPos(m_aPos);
     if( m_pFnt->GetLeftBorder() && rPor.InTextGrp() && !static_cast<const 
SwTextPortion&>(rPor).GetJoinBorderWithPrev() )
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index d99d93dc248a..1ff88448610d 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -370,6 +370,7 @@ class SwTextPaintInfo : public SwTextSizeInfo
 
     sal_uInt16 m_nSpaceIdx;
     SwLineInfo const* m_pLineInfo{nullptr}; // hack: need this to get line 
props
+    bool m_bOmitPaint = false;
 
     void DrawText_(const OUString &rText, const SwLinePortion &rPor,
                    const TextFrameIndex nIdx, const TextFrameIndex nLen,
@@ -494,6 +495,7 @@ public:
     void SetSmartTags(sw::WrongListIterator *const pNew) { m_pSmartTags = 
pNew; }
     sw::WrongListIterator* GetSmartTags() const { return m_pSmartTags; }
     void SetLineInfo(SwLineInfo const*const pLineInfo) { m_pLineInfo = 
pLineInfo; }
+    void SetOmitPaint(bool bOmitPaint) { m_bOmitPaint = bOmitPaint; }
 };
 
 class SwTextFormatInfo : public SwTextPaintInfo
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index 14693858cda8..cfbbcd5b62b8 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -42,6 +42,8 @@
 #include "pormulti.hxx"
 #include <doc.hxx>
 #include <fmturl.hxx>
+#include <IDocumentRedlineAccess.hxx>
+#include <redline.hxx>
 
 // Returns, if we have an underline breaking situation
 // Adding some more conditions here means you also have to change them
@@ -305,6 +307,9 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, 
SwSaveClip &rClip,
     // Reference portion for the paragraph end portion
     SwLinePortion* pEndTempl = m_pCurr->GetFirstPortion();
 
+    const SwDoc& rDoc = GetInfo().GetTextFrame()->GetDoc();
+    const IDocumentRedlineAccess& rIDRA = rDoc.getIDocumentRedlineAccess();
+    const SwRedlineTable& rRedlineTable = rIDRA.GetRedlineTable();
     while( pPor )
     {
         bool bSeeked = true;
@@ -422,6 +427,36 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, 
SwSaveClip &rClip,
             roTaggedLabel.emplace(nullptr, nullptr, &aPorInfo, *pOut);
         }
 
+        // See if the redline render mode requires to omit the paint of the 
text portion.
+        SwRedlineTable::size_type nRedline = SwRedlineTable::npos;
+        SwRedlineRenderMode eRedlineRenderMode = SwRedlineRenderMode::Standard;
+        if (GetRedln() && GetRedln()->IsOn())
+        {
+            nRedline = GetRedln()->GetAct();
+            eRedlineRenderMode = GetInfo().GetOpt().GetRedlineRenderMode();
+        }
+        bool bOmitPaint = false;
+        if (nRedline != SwRedlineTable::npos)
+        {
+            const SwRangeRedline* pRedline = rRedlineTable[nRedline];
+            RedlineType eType = pRedline->GetType();
+            if (eRedlineRenderMode == SwRedlineRenderMode::OmitInserts
+                && eType == RedlineType::Insert)
+            {
+                bOmitPaint = true;
+            }
+            else if (eRedlineRenderMode == SwRedlineRenderMode::OmitDeletes
+                     && eType == RedlineType::Delete)
+            {
+                bOmitPaint = true;
+            }
+        }
+
+        if (bOmitPaint)
+        {
+            GetInfo().SetOmitPaint(true);
+        }
+
         {
             // #i16816# tagged pdf support
             Por_Info aPorInfo(*pPor, *this, 0);
@@ -444,6 +479,11 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, 
SwSaveClip &rClip,
             }
         }
 
+        if (bOmitPaint)
+        {
+            GetInfo().SetOmitPaint(false);
+        }
+
         // lazy open LBody and paragraph tag after num portions have been 
painted to Lbl
         if (pPor->InNumberGrp() // also footnote label
             // note: numbering portion may be split if it has multiple scripts
diff --git a/sw/source/core/txtnode/fntcache.cxx 
b/sw/source/core/txtnode/fntcache.cxx
index 30114327effa..bc270a72d139 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1048,6 +1048,25 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
 
     Color aOldColor( pTmpFont->GetColor() );
     bool bChgColor = rInf.ApplyAutoColor( pTmpFont );
+
+    if (rInf.GetOmitPaint())
+    {
+        Color aColor = pTmpFont->GetColor();
+        sal_uInt16 nHue;
+        sal_uInt16 nSaturation;
+        sal_uInt16 nBrightness;
+        aColor.RGBtoHSB(nHue, nSaturation, nBrightness);
+        // 50% lightness: balance between completely omitting the paint and 
hard-to-notice small
+        // difference.
+        nBrightness = 50;
+        aColor = Color::HSBtoRGB(nHue, nSaturation, nBrightness);
+        if (aColor != pTmpFont->GetColor())
+        {
+            bChgColor = true;
+            pTmpFont->SetColor(aColor);
+        }
+    }
+
     if( !pTmpFont->IsSameInstance( rInf.GetOut().GetFont() ) )
         rInf.GetOut().SetFont( *pTmpFont );
     if ( bChgColor )
diff --git a/sw/source/uibase/app/swmodul1.cxx 
b/sw/source/uibase/app/swmodul1.cxx
index 75d8909559b3..2b6391f8b142 100644
--- a/sw/source/uibase/app/swmodul1.cxx
+++ b/sw/source/uibase/app/swmodul1.cxx
@@ -484,23 +484,16 @@ std::size_t SwModule::InsertRedlineAuthor(const OUString& 
rAuthor)
 static void lcl_FillAuthorAttr( std::size_t nAuthor, SfxItemSet &rSet,
                         const AuthorCharAttr &rAttr, SwRedlineRenderMode 
eRenderMode = SwRedlineRenderMode::Standard )
 {
+    if (eRenderMode != SwRedlineRenderMode::Standard)
+    {
+        return;
+    }
+
     Color aCol( rAttr.m_nColor );
 
     if( rAttr.m_nColor == COL_TRANSPARENT )
     {
         aCol = lcl_GetAuthorColor(nAuthor);
-
-        // See if the redline render mode requires to de-saturize the color of 
the text portion.
-        if (eRenderMode != SwRedlineRenderMode::Standard)
-        {
-            sal_uInt16 nHue;
-            sal_uInt16 nSaturation;
-            sal_uInt16 nBrightness;
-            aCol.RGBtoHSB(nHue, nSaturation, nBrightness);
-            // 25% saturation: balance between complete gray and 
hard-to-notice small difference.
-            nSaturation = nSaturation / 4;
-            aCol = Color::HSBtoRGB(nHue, nSaturation, nBrightness);
-        }
     }
 
     bool bBackGr = rAttr.m_nColor == COL_NONE_COLOR;
@@ -556,22 +549,12 @@ static void lcl_FillAuthorAttr( std::size_t nAuthor, 
SfxItemSet &rSet,
 
 void SwModule::GetInsertAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet, 
SwRedlineRenderMode eRenderMode)
 {
-    SwRedlineRenderMode eMode = SwRedlineRenderMode::Standard;
-    if (eRenderMode == SwRedlineRenderMode::OmitInserts)
-    {
-        eMode = eRenderMode;
-    }
-    lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetInsertAuthorAttr(), 
eMode);
+    lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetInsertAuthorAttr(), 
eRenderMode);
 }
 
 void SwModule::GetDeletedAuthorAttr(std::size_t nAuthor, SfxItemSet &rSet, 
SwRedlineRenderMode eRenderMode)
 {
-    SwRedlineRenderMode eMode = SwRedlineRenderMode::Standard;
-    if (eRenderMode == SwRedlineRenderMode::OmitDeletes)
-    {
-        eMode = eRenderMode;
-    }
-    lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetDeletedAuthorAttr(), 
eMode);
+    lcl_FillAuthorAttr(nAuthor, rSet, m_pModuleConfig->GetDeletedAuthorAttr(), 
eRenderMode);
 }
 
 // For future extension:
commit ce5fc652dcecae7b201a19f20bf1316d191ce390
Author:     Noel Grandin <[email protected]>
AuthorDate: Wed Jan 14 21:32:03 2026 +0200
Commit:     Andras Timar <[email protected]>
CommitDate: Fri Jan 16 11:43:17 2026 +0100

    tdf#169934 Transparency is lost when applying a duotone filter
    
    regression from
      commit df4873973ed6951ab63c59129226d18055f771fc
      Author: Noel Grandin <[email protected]>
      Date:   Wed Aug 27 20:25:54 2025 +0200
      simplify Graphic::applyDuotone
    
    Change-Id: I69a3da35b53355488c2d6a1f1288048d4096bc6c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197298
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>
    (cherry picked from commit 0c1df806d965609b46a0c7cec08752c0234b2538)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197313
    Reviewed-by: Xisco Fauli <[email protected]>

diff --git a/vcl/source/bitmap/BitmapDuoToneFilter.cxx 
b/vcl/source/bitmap/BitmapDuoToneFilter.cxx
index 2dd10459e242..66a4e9ba1037 100644
--- a/vcl/source/bitmap/BitmapDuoToneFilter.cxx
+++ b/vcl/source/bitmap/BitmapDuoToneFilter.cxx
@@ -41,10 +41,12 @@ Bitmap BitmapDuoToneFilter::execute(Bitmap const& rBitmap) 
const
             BitmapColor aColor = pReadAcc->GetColor(y, x);
             sal_uInt8 nLuminance = aColor.GetLuminance();
             BitmapColor aResultColor(
+                ColorAlpha,
                 lcl_getDuotoneColorComponent(nLuminance, aColorOne.GetRed(), 
aColorTwo.GetRed()),
                 lcl_getDuotoneColorComponent(nLuminance, aColorOne.GetGreen(),
                                              aColorTwo.GetGreen()),
-                lcl_getDuotoneColorComponent(nLuminance, aColorOne.GetBlue(), 
aColorTwo.GetBlue()));
+                lcl_getDuotoneColorComponent(nLuminance, aColorOne.GetBlue(), 
aColorTwo.GetBlue()),
+                aColor.GetAlpha());
             pWriteAcc->SetPixel(y, x, aResultColor);
         }
     }

Reply via email to