sc/source/ui/drawfunc/fuins2.cxx |   30 +++++++++++++++++-------------
 svx/source/tbxctrls/tbcontrl.cxx |   14 ++++++++++----
 2 files changed, 27 insertions(+), 17 deletions(-)

New commits:
commit 629f1571bdbcaa1129d2b7dd11724399b72d5d0a
Author:     Jaume Pujantell <[email protected]>
AuthorDate: Tue Dec 9 17:01:25 2025 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Jan 7 14:04:05 2026 +0100

    lok: sc: do not send selection callback on insert chart
    
    A LOK_CALLBACK_CELL_SELECTION_AREA is sent when inserting a chart
    without any data selected. This does not correspond to an actual
    selection and can produce view jumps.
    
    This change avoids sending the callback by calculating the data area
    instead of marking it.
    
    Change-Id: I2ef0db4c717a6d67ca2a6bd14f9a6b3653c5aee6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195310
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>
    (cherry picked from commit 359846431a6eac5e8d2fa26efdac3359f8f1c9f6)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195448
    Tested-by: Jenkins
    Reviewed-by: Jaume Pujantell <[email protected]>

diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 262334be9ad1..649333162796 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -449,18 +449,25 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, 
vcl::Window* pWin, ScDrawV
         }
         else
         {
-            bool bAutomaticMark = false;
-            if ( !aMark.IsMarked() && !aMark.IsMultiMarked() )
+            ScRangeList aRanges;
+            if (aMark.IsMarked() || aMark.IsMultiMarked())
             {
-                rViewSh.GetViewData().GetView()->MarkDataArea();
-                bAutomaticMark = true;
+                ScMarkData aMultiMark(std::move(aMark));
+                aMultiMark.MarkToMulti();
+                aMultiMark.FillRangeListWithMarks(&aRanges, false);
+            }
+            else
+            {
+                ScViewData& rViewData = rViewSh.GetViewData();
+                SCTAB nTab = rViewData.CurrentTabForData();
+                SCCOL nStartCol = rViewData.GetCurX();
+                SCROW nStartRow = rViewData.GetCurY();
+                SCCOL nEndCol = nStartCol;
+                SCROW nEndRow = nStartRow;
+                rViewData.GetDocument().GetDataArea(nTab, nStartCol, 
nStartRow, nEndCol, nEndRow,
+                                                    true, false);
+                aRanges = ScRange(nStartCol, nStartRow, nTab, nEndCol, 
nEndRow, nTab);
             }
-
-            ScMarkData aMultiMark(std::move(aMark));
-            aMultiMark.MarkToMulti();
-
-            ScRangeList aRanges;
-            aMultiMark.FillRangeListWithMarks( &aRanges, false );
             OUString aStr;
             aRanges.Format( aStr, ScRefFlags::RANGE_ABS_3D, rDocument, 
rDocument.GetAddressConvention() );
             aRangeString = aStr;
@@ -474,9 +481,6 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, 
vcl::Window* pWin, ScDrawV
                     aPositionRange.ExtendTo( aRanges[ i ] );
                 }
             }
-
-            if(bAutomaticMark)
-                rViewSh.GetViewData().GetView()->Unmark();
         }
     }
 
commit 06f0d83ea31a7bbc18902ed6f09f5c62a8be502d
Author:     Jaume Pujantell <[email protected]>
AuthorDate: Tue Dec 9 16:09:36 2025 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Wed Jan 7 14:03:51 2026 +0100

    svx: force default style on stylebox clear format
    
    SvxStyleBox_Base::SetupEntry returns early on entries that do not
    correspond to actual styles, assuming that the default style will be
    used. This is not always the case, sometimes the text is rendered in
    other formats.
    
    This change forces the setup of the default style on those entries.
    
    Change-Id: I06f8a10c8d7da38f90ee84788430817e421965c6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195305
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>
    (cherry picked from commit 2cf9f6e57529fdb1858d3219352174f8dd1b1fde)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195387
    Tested-by: Jenkins
    Reviewed-by: Jaume Pujantell <[email protected]>

diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 4f95332a86c4..019ff54a38e8 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1378,9 +1378,6 @@ void SvxStyleBox_Base::SetupEntry(vcl::RenderContext& 
rRenderContext, sal_Int32
         }
     }
 
-    if (nItem <= 0 || nItem >= m_xWidget->get_count() - 1)
-        return;
-
     SfxObjectShell *pShell = SfxObjectShell::Current();
     if (!pShell)
         return;
@@ -1390,9 +1387,18 @@ void SvxStyleBox_Base::SetupEntry(vcl::RenderContext& 
rRenderContext, sal_Int32
         return;
 
     SfxStyleSheetBase* pStyle = pPool->First(eStyleFamily);
-    while (pStyle && pStyle->GetName() != rStyleName)
+    SfxStyleSheetBase* pDefaultStyle = nullptr;
+    while (pStyle)
+    {
+        if (pStyle->GetName() == rStyleName)
+            break;
+        if (pStyle->GetName() == sDefaultStyle)
+            pDefaultStyle = pStyle;
         pStyle = pPool->Next();
+    }
 
+    if (!pStyle)
+        pStyle = pDefaultStyle;
     if (!pStyle )
         return;
 

Reply via email to