helpcontent2                       |    2 +-
 sc/source/ui/app/inputhdl.cxx      |    3 +++
 sc/source/ui/inc/viewdata.hxx      |    4 ++++
 sc/source/ui/view/gridwin4.cxx     |   21 +++++++++++++++------
 sc/source/ui/view/tabvwsh4.cxx     |    1 +
 sc/source/ui/view/viewdata.cxx     |    1 +
 sc/uiconfig/scalc/ui/tpviewpage.ui |    4 ++--
 7 files changed, 27 insertions(+), 9 deletions(-)

New commits:
commit 3eb427b31e624af9b2fe2bd68fee859d3d76a661
Author:     Printf Debugging <printfdebugg...@gmail.com>
AuthorDate: Fri May 3 22:18:13 2024 +0530
Commit:     Heiko Tietze <heiko.tie...@documentfoundation.org>
CommitDate: Mon May 13 13:24:19 2024 +0200

    Resolves tdf#63374 and tdf#160908
    
    Show edit highlight only when arrow keys won't commit.
    Use shorter UI label.
    
    Edit mode can be activated in two major ways, in which arrow keys
    behave differently.
    
    a) F2 | double_click | edit > Cell Edit Mode, in which case, the
       arrow keys either move the caret "|" or "reference cell frame".
    b) just start typing on the cell, in which case, pressing arrow
       keys commit the change.
    
    Edit highlight should be shown in case "a" to differentiate between
    the two. If the cell has some background color, or multiselection,
    then highlight is not shown.
    
    Change-Id: I710aa641cd47e8ca279dd8bd0e3b4e857d1b0c40
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167092
    Tested-by: Jenkins
    Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org>

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 1c1aaf06963d..85ecd8fe4cea 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2870,6 +2870,7 @@ void ScInputHandler::UpdateFormulaMode()
     {
         if (!bFormulaMode)
         {
+            pActiveViewSh->GetViewData().SetEditHighlight(true);
             bFormulaMode = true;
             pRefViewSh = pActiveViewSh;
             pSfxApp->Broadcast( SfxHint( SfxHintId::ScRefModeChanged ) );
@@ -2891,6 +2892,7 @@ void ScInputHandler::UpdateFormulaMode()
     {
         if (bFormulaMode)
         {
+            pActiveViewSh->GetViewData().SetEditHighlight(false);
             ShowRefFrame();
             bFormulaMode = false;
             pRefViewSh = nullptr;
@@ -3054,6 +3056,7 @@ void ScInputHandler::SetMode( ScInputMode eNewMode, const 
OUString* pInitText, S
     {
         if (pTableView)
             pTableView->SetEditEngineUpdateLayout(true);
+        pActiveViewSh->GetViewData().SetEditHighlight(true);
     }
     else
     {
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 673ab2407bb9..7c79bb91d65f 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -329,6 +329,7 @@ private:
     bool                bPagebreak:1;               // Page break preview mode
     bool                bSelCtrlMouseClick:1;       // special selection 
handling for ctrl-mouse-click
     bool                bMoveArea:1;
+    bool                bEditHighlight:1;
 
     bool                bGrowing;
     sal_Int16           nFormulaBarLines;           // Visible lines in the 
formula bar
@@ -569,6 +570,9 @@ public:
     bool    IsOutlineMode   () const            { return 
maOptions.GetOption(VOPT_OUTLINER); }
     bool    IsThemedCursor  () const            { return 
maOptions.GetOption(VOPT_THEMEDCURSOR); }
 
+    bool    GetEditHighlight() const            { return bEditHighlight; }
+    void    SetEditHighlight(bool bNewHighlight) { bEditHighlight = 
bNewHighlight; }
+
     /// Force page size for PgUp/PgDown to overwrite the computation based on 
m_aVisArea.
     void ForcePageUpDownOffset(tools::Long nTwips) { m_nLOKPageUpDownOffset = 
nTwips; }
     tools::Long GetPageUpDownOffset() const { return m_nLOKPageUpDownOffset; }
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 4b03921e1287..a9492df22f5d 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -758,13 +758,22 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
         SCCOL nEditEndCol = mrViewData.GetEditEndCol();
         SCROW nEditEndRow = mrViewData.GetEditEndRow();
 
-        if 
(officecfg::Office::Calc::Content::Display::EditCellBackgroundHighlighting::get()
-                && !getViewData().GetMarkData().IsMarked())
+
+        if 
(officecfg::Office::Calc::Content::Display::EditCellBackgroundHighlighting::get())
         {
-            const Color aBackgroundColor = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
-            Color aHighlightColor = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCCELLFOCUS).nColor;
-            aHighlightColor.Merge(aBackgroundColor, 100);
-            pEditView->SetBackgroundColor(aHighlightColor);
+            Color aDocColor = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
+            if (!getViewData().GetMarkData().IsMarked() && 
mrViewData.GetEditHighlight())
+            {
+                Color aHighlightColor = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::CALCCELLFOCUS).nColor;
+                aHighlightColor.Merge(aDocColor, 100);
+                aDocColor = aHighlightColor;
+            }
+
+            Color aBackColor = rDoc.GetPattern(nEditCol, nEditRow, 
getViewData().GetTabNo())->GetItem(ATTR_BACKGROUND).GetColor();
+            if (!aBackColor.IsTransparent())
+                aDocColor = aBackColor;
+
+            pEditView->SetBackgroundColor(aDocColor);
         }
 
         if ( nEditEndCol >= nX1 && nEditCol <= nX2 && nEditEndRow >= nY1 && 
nEditRow <= nY2 )
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 55bb2f889845..aafc46a2fa32 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -785,6 +785,7 @@ void ScTabViewShell::SetEditShell(EditView* pView, bool 
bActive )
     else if(bActiveEditSh)
     {
         SetCurSubShell(OST_Cell);
+        GetViewData().SetEditHighlight(false);
     }
     bActiveEditSh = bActive;
 }
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 3bed82b1dbf6..1c0ad55c3d2a 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -816,6 +816,7 @@ ScViewData::ScViewData(ScDocument* pDoc, ScDocShell* 
pDocSh, ScTabViewShell* pVi
         bPagebreak  ( false ),
         bSelCtrlMouseClick( false ),
         bMoveArea ( false ),
+        bEditHighlight ( false ),
         bGrowing (false),
         nFormulaBarLines(1),
         m_nLOKPageUpDownOffset( 0 )
diff --git a/sc/uiconfig/scalc/ui/tpviewpage.ui 
b/sc/uiconfig/scalc/ui/tpviewpage.ui
index fb19f01ba4ec..4fd40a3fed0b 100644
--- a/sc/uiconfig/scalc/ui/tpviewpage.ui
+++ b/sc/uiconfig/scalc/ui/tpviewpage.ui
@@ -274,7 +274,7 @@
                 </child>
                 <child>
                   <object class="GtkCheckButton" id="editcellbg">
-                    <property name="label" translatable="yes" 
context="tpviewpage|value">Edit cell background highlighting</property>
+                    <property name="label" translatable="yes" 
context="tpviewpage|value">Edit cell highlighting</property>
                     <property name="visible">True</property>
                     <property name="can-focus">True</property>
                     <property name="receives-default">False</property>
@@ -282,7 +282,7 @@
                     <property name="draw-indicator">True</property>
                     <child internal-child="accessible">
                       <object class="AtkObject" id="editcellbg-atkobject">
-                        <property name="AtkObject::accessible-description" 
translatable="yes" context="extended_tip|value">Mark the Edit cell background 
highlighting checkbox to show cell frame background color as the edit cell 
background.</property>
+                        <property name="AtkObject::accessible-description" 
translatable="yes" context="extended_tip|value">Mark this box to show 
highlighted background when the cell is in edit mode.</property>
                       </object>
                     </child>
                   </object>
commit 0ce15b8a86f950b0ee84a51c901f4261b64e7cf9
Author:     Olivier Hallot <olivier.hal...@libreoffice.org>
AuthorDate: Mon May 13 08:24:16 2024 -0300
Commit:     Gerrit Code Review <ger...@gerrit.libreoffice.org>
CommitDate: Mon May 13 13:24:16 2024 +0200

    Update git submodules
    
    * Update helpcontent2 from branch 'master'
      to 71a04be1be73ec7cd27e14e152c01521b3c4b33e
      - tdf#160057 Help update for first and rest page style in Calc
    
        Change-Id: I728452dac691507e0aa2651dac8bcc9908eca70e
        Reviewed-on: https://gerrit.libreoffice.org/c/help/+/167482
        Tested-by: Jenkins
        Reviewed-by: Olivier Hallot <olivier.hal...@libreoffice.org>

diff --git a/helpcontent2 b/helpcontent2
index 761a64f3ca3e..71a04be1be73 160000
--- a/helpcontent2
+++ b/helpcontent2
@@ -1 +1 @@
-Subproject commit 761a64f3ca3e8f66c711bcadaa8c5ced105a99cd
+Subproject commit 71a04be1be73ec7cd27e14e152c01521b3c4b33e

Reply via email to