sc/source/ui/docshell/dbdocfun.cxx |    3 ++-
 sc/source/ui/drawfunc/drawsh2.cxx  |   26 +++++++++++++++++++++++---
 sc/source/ui/view/tabvwsh4.cxx     |    2 +-
 3 files changed, 26 insertions(+), 5 deletions(-)

New commits:
commit 958b0db51468dfe8aeacc0086df04075b990337e
Author:     Balazs Varga <[email protected]>
AuthorDate: Sun Nov 9 21:01:02 2025 +0100
Commit:     Balazs Varga <[email protected]>
CommitDate: Wed Jan 7 17:15:14 2026 +0100

    Table style: fix wrong sidebar context after selecting
    
    table style area. After we selected a draw object and then
    we clicked inside a table style area the context was not updated
    and only the cell context UI elements appeared.
    Also need force the update in case of we set the cursor position
    from one table cell area to another one, otherwise the sidebar
    will not update the different Table area properties on the panel.
    
    Change-Id: I70a25e30071779ad4053b967a3fb15ec0328d6cb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193690
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Andras Timar <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196758
    Reviewed-by: Balazs Varga <[email protected]>
    Tested-by: Balazs Varga <[email protected]>

diff --git a/sc/source/ui/drawfunc/drawsh2.cxx 
b/sc/source/ui/drawfunc/drawsh2.cxx
index a82741dbb51f..aba1d9797fc3 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -47,6 +47,7 @@
 #include <gridwin.hxx>
 #include <scmod.hxx>
 #include <appoptio.hxx>
+#include <dbdata.hxx>
 #include <svx/svdoole2.hxx>
 #include <svx/xflgrit.hxx>
 #include <comphelper/lok.hxx>
@@ -573,9 +574,28 @@ void ScDrawShell::Activate (const bool)
 
 const OUString & ScDrawShell::GetSidebarContextName()
 {
-    return vcl::EnumContext::GetContextName(
-        svx::sidebar::SelectionAnalyzer::GetContextForSelection_SC(
-            GetDrawView()->GetMarkedObjectList()));
+    vcl::EnumContext::Context eContext = 
svx::sidebar::SelectionAnalyzer::GetContextForSelection_SC(
+            GetDrawView()->GetMarkedObjectList());
+
+    // If no special context detected, check for table context
+    if (eContext == vcl::EnumContext::Context::Unknown)
+    {
+        ScDocument& rDocument = rViewData.GetDocument();
+        if (!rDocument.HasDataPilotAtPosition(rViewData.GetCurPos()))
+        {
+            const ScAddress aAddr = rViewData.GetCurPos();
+            if (!rDocument.HasSparkline(aAddr))
+            {
+                const ScDBData* pDbData = rDocument.GetDBAtCursor(
+                    aAddr.Col(), aAddr.Row(), aAddr.Tab(), 
ScDBDataPortion::AREA);
+                if (pDbData && pDbData->GetTableStyleInfo())
+                {
+                    eContext = vcl::EnumContext::Context::Table;
+                }
+            }
+        }
+    }
+    return vcl::EnumContext::GetContextName(eContext);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 8ecdd362a01e..54000d4112f0 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -731,7 +731,7 @@ void ScTabViewShell::SetTableShell(bool bActive)
         bActiveMediaSh=false;
         bActiveOleObjectSh=false;
         bActiveChartSh=false;
-        SetCurSubShell(OST_Table);
+        SetCurSubShell(OST_Table, true);
     }
     else
         SetCurSubShell(OST_Cell);
commit 0f9545264cb7945493e4e5bc298941493c16ba3c
Author:     Balazs Varga <[email protected]>
AuthorDate: Fri Nov 7 19:00:26 2025 +0100
Commit:     Balazs Varga <[email protected]>
CommitDate: Wed Jan 7 17:15:03 2026 +0100

    Table style: fix horizontal auto fill update on table area
    
    In case of horizontal auto fill of the table area require
    an update on the selected area otherwise the area will stay
    selected.
    
    Change-Id: Id41b929e49262b61a7af4cac4b7af05649b18a37
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/193689
    Reviewed-by: Andras Timar <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196757
    Reviewed-by: Balazs Varga <[email protected]>
    Tested-by: Balazs Varga <[email protected]>

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 435f4b0979c8..b87e214b3d03 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -259,7 +259,8 @@ void ScDBDocFunc::ModifyDBData( const ScDBData& rNewData )
         }
     }
 
-    rDocShell.PostPaint(aOldRange, PaintPartFlags::Grid);
+    rDocShell.PostPaint(aOldRange, PaintPartFlags::Grid | PaintPartFlags::Left 
| PaintPartFlags::Top
+        | PaintPartFlags::Size);
 
     if (bUndo)
     {

Reply via email to