include/svx/svdedxv.hxx       |    2 +-
 svx/source/svdraw/svdedxv.cxx |    8 ++++++--
 svx/source/svdraw/svdpntv.cxx |    4 ++--
 3 files changed, 9 insertions(+), 5 deletions(-)

New commits:
commit 97babe6565a21f4af930fa8a3bd1cfab98b8bb47
Author:     Pranam Lashkari <[email protected]>
AuthorDate: Tue Feb 24 15:39:46 2026 +0530
Commit:     Caolán McNamara <[email protected]>
CommitDate: Wed Feb 25 09:20:51 2026 +0100

    sd: fix invisible text during collaborative edit in dark/light mode mix
    
    now draw the text based on the current view data instread of relying on the 
data
    from the editor's view
    
    problem:
    during Collaborative Editing on Impress, when a user is using Dark Mode
    and enters edit mode in text box on a slide, the text inside that text box
    becomes invisible to other users currently viewing or editing the same slide
    in light theme
    
    Change-Id: If68dbeaff71ff9ee8c8f824f8e1f9a561b746445
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200156
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>

diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index b76db7fb9309..0191e178dacc 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -174,7 +174,7 @@ public:
 
     // used to call the old ImpPaintOutlinerView. Will be replaced when the
     // outliner will be displayed on the overlay in edit mode.
-    void TextEditDrawing(SdrPaintWindow& rPaintWindow);
+    void TextEditDrawing(SdrPaintWindow& rPaintWindow, SdrPageView* 
pPaintingPageView = nullptr);
 
     // Actionhandling for macromode
     virtual bool IsAction() const override;
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index de6c2db55a55..d07907a7b011 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -918,7 +918,7 @@ void SdrObjEditView::EditViewCursorRect(const 
tools::Rectangle& rRect, int nExtT
     mpTextEditWin->SetCursorRect(&rRect, nExtTextInputWidth);
 }
 
-void SdrObjEditView::TextEditDrawing(SdrPaintWindow& rPaintWindow)
+void SdrObjEditView::TextEditDrawing(SdrPaintWindow& rPaintWindow, 
SdrPageView* pPaintingPageView)
 {
     if (!comphelper::LibreOfficeKit::isActive())
     {
@@ -946,7 +946,11 @@ void SdrObjEditView::TextEditDrawing(SdrPaintWindow& 
rPaintWindow)
 
     OutlinerView* pOLV = pActiveOutliner->GetView(0);
     SdrPage* pPage = GetSdrPageView()->GetPage();
-    pOLV->SetBackgroundColor(pPage->GetPageBackgroundColor(GetSdrPageView(), 
true));
+    // Use the painting view's SdrPageView for background color resolution when
+    // rendering another view's text edit, so auto-color text is resolved 
against
+    // the painting view's dark/light mode, not the editing view's.
+    SdrPageView* pBgPageView = pPaintingPageView ? pPaintingPageView : 
GetSdrPageView();
+    pOLV->SetBackgroundColor(pPage->GetPageBackgroundColor(pBgPageView, true));
     ImpPaintOutlinerView(*pOLV, aCheckRect, 
rPaintWindow.GetTargetOutputDevice());
 }
 
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 53373de6acee..d67c0510cbf2 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -669,7 +669,7 @@ void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& 
rPaintWindow, bool bPaintFo
             // and show them as well. Show only if Page/MasterPage mode is 
matching.
             bool bRequireMasterPage = pPageView->GetPage() ? 
pPageView->GetPage()->IsMasterPage() : false;
             SdrViewIter::ForAllViews(pPageView->GetPage(),
-                [this, &bRequireMasterPage, &rPaintWindow] (SdrView* pView)
+                [this, &bRequireMasterPage, &rPaintWindow, &pPageView] 
(SdrView* pView)
                 {
                     SdrPageView* pCurrentPageView = pView->GetSdrPageView();
                     bool bIsCurrentMasterPage = (pCurrentPageView && 
pCurrentPageView->GetPage()) ?
@@ -680,7 +680,7 @@ void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& 
rPaintWindow, bool bPaintFo
 
                     if (pView->IsTextEdit() && pView->GetSdrPageView())
                     {
-                        pView->TextEditDrawing(rPaintWindow);
+                        pView->TextEditDrawing(rPaintWindow, pPageView);
                     }
                     return false;
                 });

Reply via email to