chart2/source/controller/main/ChartController_Window.cxx |    4 
 include/svx/svdpntv.hxx                                  |   72 ++++++-
 sc/inc/viewopti.hxx                                      |   30 +-
 sc/source/core/data/document.cxx                         |    5 
 sc/source/core/data/patattr.cxx                          |    5 
 sc/source/core/tool/viewopti.cxx                         |   15 +
 sc/source/core/tool/webservicelink.cxx                   |    8 
 sc/source/ui/app/scmod.cxx                               |   15 -
 sc/source/ui/cctrl/checklistmenu.cxx                     |    7 
 sc/source/ui/docshell/externalrefmgr.cxx                 |    6 
 sc/source/ui/inc/tabview.hxx                             |    4 
 sc/source/ui/unoobj/docuno.cxx                           |   19 -
 sc/source/ui/view/cellsh1.cxx                            |  151 ++++++++-------
 sc/source/ui/view/gridwin4.cxx                           |    5 
 sc/source/ui/view/tabview.cxx                            |    7 
 sc/source/ui/view/tabvwshc.cxx                           |    5 
 vcl/jsdialog/enabled.cxx                                 |    2 
 vcl/source/treelist/svtabbx.cxx                          |   17 +
 vcl/source/window/dockwin.cxx                            |    2 
 19 files changed, 260 insertions(+), 119 deletions(-)

New commits:
commit 4cbbd8d6261dfebbe0808168a3ab745e52825492
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Jan 8 15:04:07 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:40 2024 +0100

    Related: cool#7951 don't invalidate when creating a new view
    
    In writer the ViewOptions are in the ViewShell and are copied when a new
    ViewShell is created from that ViewShell so the dark/light-mode and doc
    color are the same in a new view as the old view.
    
    But in calc the ViewOptions exist in both the ViewShell and Document and
    a new ViewShell copies from the document not the old ViewShell. Setting
    the ViewOptions of a ViewShell in calc doesn't have an effect of having
    the same setting in a new view in calc.
    
    So if you create a new view from an old view you got the ViewOptions of
    the document, whose light/dark mode remained as "Default" when the old
    view dark/light more was set. So the mismatch triggered an invalidate.
    
    These additions to ViewOptions are relatively new in calc, and the
    desire is to get the same behaviour in calc as in writer, so move the
    new additions to a separate class that belongs to the ViewShell and
    copy them from the current ViewShell when creating a new ViewShell.
    
    Change-Id: Ie4b1dbb0437763ec4c8d067179c1fbef520161e6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161791
    Reviewed-by: Michael Meeks <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161880
    Tested-by: Jenkins

diff --git a/sc/inc/viewopti.hxx b/sc/inc/viewopti.hxx
index beb0530e88a5..25f7db7d8527 100644
--- a/sc/inc/viewopti.hxx
+++ b/sc/inc/viewopti.hxx
@@ -73,6 +73,26 @@ public:
     bool                    operator!= ( const ScGridOptions& rOpt ) const { 
return !(operator==(rOpt)); }
 };
 
+class SC_DLLPUBLIC ScViewRenderingOptions
+{
+public:
+    ScViewRenderingOptions();
+
+    const OUString& GetColorSchemeName() const { return sColorSchemeName; }
+    void SetColorSchemeName( const OUString& rName ) { sColorSchemeName = 
rName; }
+
+    const Color& GetDocColor() const { return aDocCol; }
+    void SetDocColor(const Color& rDocColor) { aDocCol = rDocColor; }
+
+    bool operator==(const ScViewRenderingOptions& rOther) const;
+
+private:
+    // The name of the color scheme
+    OUString sColorSchemeName;
+    // The background color of the document
+    Color aDocCol;
+};
+
 // Options - View
 
 class SC_DLLPUBLIC ScViewOptions
@@ -97,12 +117,6 @@ public:
     void                    SetGridOptions( const ScGridOptions& rNew ) { 
aGridOpt = rNew; }
     std::unique_ptr<SvxGridItem> CreateGridItem() const;
 
-    const OUString& GetColorSchemeName() const { return sColorSchemeName; }
-    void SetColorSchemeName( const OUString& rName ) { sColorSchemeName = 
rName; }
-
-    const Color& GetDocColor() const { return aDocCol; }
-    void SetDocColor(const Color& rDocColor) { aDocCol = rDocColor; }
-
     ScViewOptions&          operator=  ( const ScViewOptions& rCpy );
     bool                    operator== ( const ScViewOptions& rOpt ) const;
     bool                    operator!= ( const ScViewOptions& rOpt ) const { 
return !(operator==(rOpt)); }
@@ -113,10 +127,6 @@ private:
     Color           aGridCol;
     OUString        aGridColName;
     ScGridOptions   aGridOpt;
-    // The name of the color scheme
-    OUString sColorSchemeName = "Default";
-    // The background color of the document
-    Color aDocCol;
 };
 
 // Item for the options dialog - View
diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index 4bb79828da13..b25f6bda27ec 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -512,9 +512,8 @@ void ScPatternAttr::fillColor(model::ComplexColor& 
rComplexColor, const SfxItemS
                 ScTabViewShell* pViewShell = 
dynamic_cast<ScTabViewShell*>(pSfxViewShell);
                 if (pViewShell)
                 {
-                    const ScViewData& pViewData = pViewShell->GetViewData();
-                    const ScViewOptions& aViewOptions = pViewData.GetOptions();
-                    aBackColor = aViewOptions.GetDocColor();
+                    const ScViewRenderingOptions& rViewRenderingOptions = 
pViewShell->GetViewRenderingData();
+                    aBackColor = rViewRenderingOptions.GetDocColor();
                 }
             }
         }
diff --git a/sc/source/core/tool/viewopti.cxx b/sc/source/core/tool/viewopti.cxx
index 39e2e6e0e762..0a505408e6bf 100644
--- a/sc/source/core/tool/viewopti.cxx
+++ b/sc/source/core/tool/viewopti.cxx
@@ -68,6 +68,17 @@ bool ScGridOptions::operator==( const ScGridOptions& rCpy ) 
const
             && bEqualGrid       == rCpy.bEqualGrid );
 }
 
+ScViewRenderingOptions::ScViewRenderingOptions()
+    : sColorSchemeName("Default")
+    , 
aDocCol(SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor)
+{
+}
+
+bool ScViewRenderingOptions::operator==(const ScViewRenderingOptions& rOther) 
const
+{
+    return sColorSchemeName == rOther.sColorSchemeName &&
+           aDocCol == rOther.aDocCol;
+}
 
 ScViewOptions::ScViewOptions()
 {
@@ -110,8 +121,6 @@ void ScViewOptions::SetDefaults()
 
     aGridCol = svtools::ColorConfig().GetColorValue( svtools::CALCGRID 
).nColor;
 
-    aDocCol = 
SC_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor;
-
     aGridOpt.SetDefaults();
 }
 
@@ -136,8 +145,6 @@ bool ScViewOptions::operator==( const ScViewOptions& rOpt ) 
const
     bEqual = bEqual && (aGridCol       == rOpt.aGridCol);
     bEqual = bEqual && (aGridColName   == rOpt.aGridColName);
     bEqual = bEqual && (aGridOpt       == rOpt.aGridOpt);
-    bEqual = bEqual && (sColorSchemeName == rOpt.sColorSchemeName);
-    bEqual = bEqual && (aDocCol        == rOpt.aDocCol);
 
     return bEqual;
 }
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 3fa3a7849b22..f0c62df04d00 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -218,14 +218,13 @@ void 
ScModule::ConfigurationChanged(utl::ConfigurationBroadcaster* p, Configurat
 
             if (pViewShell)
             {
-                ScViewData& pViewData = pViewShell->GetViewData();
-                ScViewOptions aViewOptions = pViewData.GetOptions();
+                ScViewRenderingOptions 
aViewRenderingOptions(pViewShell->GetViewRenderingData());
                 Color 
aFillColor(m_pColorConfig->GetColorValue(svtools::DOCCOLOR).nColor);
-                aViewOptions.SetDocColor(aFillColor);
-                
aViewOptions.SetColorSchemeName(svtools::ColorConfig::GetCurrentSchemeName());
-                const bool bChanged(aViewOptions != pViewData.GetOptions());
-                if (bChanged)
-                    pViewData.SetOptions(aViewOptions);
+                aViewRenderingOptions.SetDocColor(aFillColor);
+                
aViewRenderingOptions.SetColorSchemeName(svtools::ColorConfig::GetCurrentSchemeName());
+                const bool bUnchanged(aViewRenderingOptions == 
pViewShell->GetViewRenderingData());
+                if (!bUnchanged)
+                    pViewShell->SetViewRenderingData(aViewRenderingOptions);
                 ScModelObj* pScModelObj = 
comphelper::getFromUnoTunnel<ScModelObj>(SfxObjectShell::Current()->GetModel());
                 SfxLokHelper::notifyViewRenderState(SfxViewShell::Current(), 
pScModelObj);
                 // In Online, the document color is the one used for the 
background, contrary to
@@ -234,7 +233,7 @@ void 
ScModule::ConfigurationChanged(utl::ConfigurationBroadcaster* p, Configurat
                         aFillColor.AsRGBHexString().toUtf8());
 
                 // if nothing changed, and the hint was 
OnlyCurrentDocumentColorScheme we can skip invalidate
-                bSkipInvalidate = !bChanged && eHints == 
ConfigurationHints::OnlyCurrentDocumentColorScheme;
+                bSkipInvalidate = bUnchanged && eHints == 
ConfigurationHints::OnlyCurrentDocumentColorScheme;
             }
         }
 
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 66bbc010eae1..d825eca1f1d8 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -120,6 +120,7 @@ private:
 
     VclPtr<vcl::Window>             pFrameWin;              // First !!!
     ScViewData          aViewData;              // must be at the front !
+    ScViewRenderingOptions aViewRenderingData;
 
     std::unique_ptr<ScViewSelectionEngine> pSelEngine;
     ScViewFunctionSet       aFunctionSet;
@@ -349,6 +350,9 @@ public:
     ScViewData&         GetViewData()       { return aViewData; }
     const ScViewData&   GetViewData() const { return aViewData; }
 
+    const ScViewRenderingOptions& GetViewRenderingData() const { return 
aViewRenderingData; }
+    void SetViewRenderingData(const ScViewRenderingOptions& 
rViewRenderingData) { aViewRenderingData = rViewRenderingData; }
+
     ScViewFunctionSet&      GetFunctionSet()    { return aFunctionSet; }
     ScViewSelectionEngine*  GetSelEngine()      { return pSelEngine.get(); }
 
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 7d6d59fc1352..c1943486e53c 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1263,25 +1263,20 @@ void ScModelObj::completeFunction(const OUString& 
rFunctionName)
 OString ScModelObj::getViewRenderState(SfxViewShell* pViewShell)
 {
     OStringBuffer aState;
-    ScViewData* pViewData = nullptr;
 
-    if (pViewShell)
+    ScTabViewShell* pTabViewShell = dynamic_cast<ScTabViewShell*>(pViewShell);
+    if (!pTabViewShell)
     {
-        ScTabViewShell* pTabViewShell = dynamic_cast< 
ScTabViewShell*>(pViewShell);
-        if (pTabViewShell)
-            pViewData = &pTabViewShell->GetViewData();
-    }
-    else
-    {
-        pViewData = ScDocShell::GetViewData();
+        ScViewData* pViewData = ScDocShell::GetViewData();
+        pTabViewShell = pViewData ? pViewData->GetViewShell() : nullptr;
     }
 
-    if (pViewData)
+    if (pTabViewShell)
     {
         aState.append(';');
 
-        const ScViewOptions& aViewOptions = pViewData->GetOptions();
-        OString aThemeName = 
OUStringToOString(aViewOptions.GetColorSchemeName(), RTL_TEXTENCODING_UTF8);
+        const ScViewRenderingOptions& rViewRenderingOptions = 
pTabViewShell->GetViewRenderingData();
+        OString aThemeName = 
OUStringToOString(rViewRenderingOptions.GetColorSchemeName(), 
RTL_TEXTENCODING_UTF8);
         aState.append(aThemeName);
     }
 
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 3639e8287698..ea59babd3a14 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1128,13 +1128,12 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, 
const ScTableInfo& rTableI
                             ScTabViewShell* pCurrentViewShell = 
dynamic_cast<ScTabViewShell*>(pSfxViewShell);
                             if (pCurrentViewShell)
                             {
-                                const ScViewData& pViewData = 
pCurrentViewShell->GetViewData();
-                                const ScViewOptions& aViewOptions = 
pViewData.GetOptions();
                                 const ScPatternAttr* pPattern = 
rDoc.GetPattern( nCol1, nRow1, nTab );
                                 Color aCellColor = 
pPattern->GetItem(ATTR_BACKGROUND).GetColor();
                                 if (aCellColor.IsTransparent())
                                 {
-                                    aCellColor = aViewOptions.GetDocColor();
+                                    const ScViewRenderingOptions& 
rViewRenderingOptions = pCurrentViewShell->GetViewRenderingData();
+                                    aCellColor = 
rViewRenderingOptions.GetDocColor();
                                 }
                                 rDevice.SetFillColor(aCellColor);
                                 pOtherEditView->SetBackgroundColor(aCellColor);
diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx
index 9eff50195e84..71a37ddce9da 100644
--- a/sc/source/ui/view/tabview.cxx
+++ b/sc/source/ui/view/tabview.cxx
@@ -169,11 +169,18 @@ bool lcl_HasRowOutline( const ScViewData& rViewData )
     return false;
 }
 
+ScViewRenderingOptions getViewRenderingOptions(ScDocShell& rDocShell)
+{
+    ScTabViewShell* pViewShell = rDocShell.GetBestViewShell();
+    return pViewShell ? pViewShell->GetViewRenderingData() : 
ScViewRenderingOptions();
+}
+
 } // anonymous namespace
 
 ScTabView::ScTabView( vcl::Window* pParent, ScDocShell& rDocSh, 
ScTabViewShell* pViewShell ) :
     pFrameWin( pParent ),
     aViewData( rDocSh, pViewShell ),
+    aViewRenderingData(getViewRenderingOptions(rDocSh)),
     aFunctionSet( &aViewData ),
     aHdrFunc( &aViewData ),
     aVScrollTop( VclPtr<ScrollAdaptor>::Create( pFrameWin, false ) ),
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index 8e2e74e8e4fb..147bf68c4968 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -505,13 +505,12 @@ void ScTabViewShell::NotifyCursor(SfxViewShell* 
pOtherShell) const
 
 ::Color ScTabViewShell::GetColorConfigColor(svtools::ColorConfigEntry 
nColorType) const
 {
-    const ScViewOptions& rViewOptions = GetViewData().GetOptions();
-
     switch (nColorType)
     {
         case svtools::ColorConfigEntry::DOCCOLOR:
         {
-            return rViewOptions.GetDocColor();
+            const ScViewRenderingOptions& rViewRenderingOptions = 
GetViewRenderingData();
+            return rViewRenderingOptions.GetDocColor();
         }
         // Should never be called for an unimplemented color type
         default:
commit 197fcfe3aa0251c14ea5ff44238ba346aad74214
Author:     Caolán McNamara <[email protected]>
AuthorDate: Mon Jan 8 10:15:39 2024 +0000
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:40 2024 +0100

    Related: cool#7951 only invalidate Window if the setting really changed
    
    cut down on some of these invalidations when the setting didn't change
    and we don't need the expensive invalidation
    
    Change-Id: Id84a79636fcd7f21c7a8dbe86218b75d32b26487
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161784
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index bce1bd8bb881..8665262f0508 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -399,14 +399,70 @@ public:
     bool IsHlplFront() const { return mbHlplFront  ; }
 
     const Color& GetGridColor() const { return maGridColor;}
-    void SetPageVisible(bool bOn = true) { mbPageVisible=bOn; 
InvalidateAllWin(); }
-    void SetPageShadowVisible(bool bOn) { mbPageShadowVisible=bOn; 
InvalidateAllWin(); }
-    void SetPageBorderVisible(bool bOn = true) { mbPageBorderVisible=bOn; 
InvalidateAllWin(); }
-    void SetBordVisible(bool bOn = true) { mbBordVisible=bOn; 
InvalidateAllWin(); }
-    void SetGridVisible(bool bOn) { mbGridVisible=bOn; InvalidateAllWin(); }
-    void SetGridFront(bool bOn) { mbGridFront  =bOn; InvalidateAllWin(); }
-    void SetHlplVisible(bool bOn = true) { mbHlplVisible=bOn; 
InvalidateAllWin(); }
-    void SetHlplFront(bool bOn) { mbHlplFront  =bOn; InvalidateAllWin(); }
+    void SetPageVisible(bool bOn = true)
+    {
+        if (mbPageVisible != bOn)
+        {
+            mbPageVisible = bOn;
+            InvalidateAllWin();
+        }
+    }
+    void SetPageShadowVisible(bool bOn)
+    {
+        if (mbPageShadowVisible != bOn)
+        {
+            mbPageShadowVisible = bOn;
+            InvalidateAllWin();
+        }
+    }
+    void SetPageBorderVisible(bool bOn = true)
+    {
+        if (mbPageBorderVisible != bOn)
+        {
+            mbPageBorderVisible = bOn;
+            InvalidateAllWin();
+        }
+    }
+    void SetBordVisible(bool bOn = true)
+    {
+        if (mbBordVisible != bOn)
+        {
+            mbBordVisible = bOn;
+            InvalidateAllWin();
+        }
+    }
+    void SetGridVisible(bool bOn)
+    {
+        if (mbGridVisible != bOn)
+        {
+            mbGridVisible = bOn;
+            InvalidateAllWin();
+        }
+    }
+    void SetGridFront(bool bOn)
+    {
+        if (mbGridFront != bOn)
+        {
+            mbGridFront = bOn;
+            InvalidateAllWin();
+        }
+    }
+    void SetHlplVisible(bool bOn = true)
+    {
+        if (mbHlplVisible != bOn)
+        {
+            mbHlplVisible = bOn;
+            InvalidateAllWin();
+        }
+    }
+    void SetHlplFront(bool bOn)
+    {
+        if (mbHlplFront != bOn)
+        {
+            mbHlplFront = bOn;
+            InvalidateAllWin();
+        }
+    }
     void SetGlueVisible(bool bOn = true) { if (mbGlueVisible!=bOn) { 
mbGlueVisible=bOn; if (!mbGlueVisible2 && !mbGlueVisible3 && !mbGlueVisible4) 
GlueInvalidate(); } }
 
     bool IsPreviewRenderer() const { return mbPreviewRenderer; }
commit f4a6549c225a3b2b22f4071f6d0cb0b0553e0050
Author:     codewithvk <[email protected]>
AuthorDate: Sun Dec 10 23:30:47 2023 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:40 2024 +0100

    Make format condition, chart delete and pivot table error async
    
    todo:
    Make executeDlg_ObjectProperties_withoutUndoGuard dialogs to async.
    
    Signed-off-by: codewithvk <[email protected]>
    Change-Id: I9927c1008d34370b9394aaf653afb575f69f2d45
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160557
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161703
    Tested-by: Caolán McNamara <[email protected]>

diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index 1bdb1f2ed48a..1b2b3654c201 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1602,10 +1602,10 @@ bool ChartController::execute_KeyInput( const KeyEvent& 
rKEvt )
         bReturn = executeDispatch_Delete();
         if( ! bReturn )
         {
-            std::unique_ptr<weld::MessageDialog> 
xInfoBox(Application::CreateMessageDialog(pChartWindow->GetFrameWeld(),
+            std::shared_ptr<weld::MessageDialog> 
xInfoBox(Application::CreateMessageDialog(pChartWindow->GetFrameWeld(),
                                                           
VclMessageType::Info, VclButtonsType::Ok,
                                                           
SchResId(STR_ACTION_NOTPOSSIBLE)));
-            xInfoBox->run();
+            xInfoBox->runAsync(xInfoBox, [] (int) {});
         }
     }
 
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 558d5a816615..cd6aafe975bd 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -170,6 +170,49 @@ void SetTabNoAndCursor( const ScViewData& rViewData, 
std::u16string_view rCellId
     }
 }
 
+void HandleConditionalFormat(sal_uInt32 nIndex, bool bCondFormatDlg, bool 
bContainsCondFormat,
+                             const sal_uInt16 nSlot, SfxViewShell* 
pTabViewShell)
+{
+    condformat::dialog::ScCondFormatDialogType eType = 
condformat::dialog::NONE;
+    switch (nSlot)
+    {
+        case SID_OPENDLG_CONDFRMT:
+        case SID_OPENDLG_CURRENTCONDFRMT:
+            eType = condformat::dialog::CONDITION;
+            break;
+        case SID_OPENDLG_COLORSCALE:
+            eType = condformat::dialog::COLORSCALE;
+            break;
+        case SID_OPENDLG_DATABAR:
+            eType = condformat::dialog::DATABAR;
+            break;
+        case SID_OPENDLG_ICONSET:
+            eType = condformat::dialog::ICONSET;
+            break;
+        case SID_OPENDLG_CONDDATE:
+            eType = condformat::dialog::DATE;
+            break;
+        default:
+            assert(false);
+            break;
+    }
+
+    if (bCondFormatDlg || !bContainsCondFormat)
+    {
+        // Put the xml string parameter to initialize the
+        // Conditional Format Dialog.
+        ScCondFormatDlgItem aDlgItem(nullptr, nIndex, false); // Change here
+        aDlgItem.SetDialogType(eType);
+        pTabViewShell->GetPool().DirectPutItemInPool(aDlgItem);
+
+        sal_uInt16 nId = ScCondFormatDlgWrapper::GetChildWindowId();
+        SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
+        SfxChildWindow* pWnd = rViewFrm.GetChildWindow(nId);
+
+        SC_MOD()->SetRefDialog(nId, pWnd == nullptr);
+    }
+}
+
 void InsertCells(ScTabViewShell* pTabViewShell, SfxRequest &rReq, InsCellCmd 
eCmd)
 {
     if (eCmd!=INS_NONE)
@@ -2156,7 +2199,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 }
 
                 // try to find an existing conditional format
-                const ScConditionalFormat* pCondFormat = nullptr;
                 const ScPatternAttr* pPattern = rDoc.GetPattern(aPos.Col(), 
aPos.Row(), aPos.Tab());
                 ScConditionalFormatList* pList = 
rDoc.GetCondFormList(aPos.Tab());
                 const ScCondFormatIndexes& rCondFormats = 
pPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData();
@@ -2168,7 +2210,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                     for (const auto& rCondFormat : rCondFormats)
                     {
                         // check if at least one existing conditional format 
has the same range
-                        pCondFormat = pList->GetFormat(rCondFormat);
+                        const ScConditionalFormat* pCondFormat = 
pList->GetFormat(rCondFormat);
                         if(!pCondFormat)
                             continue;
 
@@ -2345,78 +2387,57 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 // or should create a new overlapping conditional format
                 if(bContainsCondFormat && !bCondFormatDlg && 
bContainsExistingCondFormat)
                 {
-                    std::unique_ptr<weld::MessageDialog> 
xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
+                    std::shared_ptr<weld::MessageDialog> 
xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
                                                                    
VclMessageType::Question, VclButtonsType::YesNo,
                                                                    
ScResId(STR_EDIT_EXISTING_COND_FORMATS)));
                     xQueryBox->set_default_response(RET_YES);
-                    bool bEditExisting = xQueryBox->run() == RET_YES;
-                    if (bEditExisting)
-                    {
-                        // differentiate between ranges where one conditional 
format is defined
-                        // and several formats are defined
-                        // if we have only one => open the cond format dlg to 
edit it
-                        // otherwise open the manage cond format dlg
-                        if (rCondFormats.size() == 1)
+                    xQueryBox->runAsync(xQueryBox, [this, nIndex, nSlot, aPos, 
pTabViewShell] (int nResult) {
+                        sal_uInt32 nNewIndex = nIndex;
+                        bool bNewCondFormatDlg = false;
+
+                        // use fresh data
+                        ScDocument& rInnerDoc = GetViewData().GetDocument();
+                        const ScPatternAttr* pInnerPattern = 
rInnerDoc.GetPattern(aPos.Col(), aPos.Row(), aPos.Tab());
+                        ScConditionalFormatList* pInnerList = 
rInnerDoc.GetCondFormList(aPos.Tab());
+                        const ScCondFormatIndexes& rInnerCondFormats = 
pInnerPattern->GetItem(ATTR_CONDITIONAL).GetCondFormatData();
+                        bool bInnerContainsCondFormat = 
!rInnerCondFormats.empty();
+
+                        bool bEditExisting = nResult == RET_YES;
+                        if (bEditExisting)
                         {
-                            pCondFormat = pList->GetFormat(rCondFormats[0]);
-                            assert(pCondFormat);
-                            nIndex = pCondFormat->GetKey();
-                            bCondFormatDlg = true;
+                            // differentiate between ranges where one 
conditional format is defined
+                            // and several formats are defined
+                            // if we have only one => open the cond format dlg 
to edit it
+                            // otherwise open the manage cond format dlg
+                            if (rInnerCondFormats.size() == 1)
+                            {
+                                const ScConditionalFormat* pCondFormat = 
pInnerList->GetFormat(rInnerCondFormats[0]);
+                                assert(pCondFormat);
+                                nNewIndex = pCondFormat->GetKey();
+                                bNewCondFormatDlg = true;
+                            }
+                            else
+                            {
+                                // Queue message to open Conditional Format 
Manager Dialog.
+                                GetViewData().GetDispatcher().Execute(
+                                    SID_OPENDLG_CONDFRMT_MANAGER, 
SfxCallMode::ASYNCHRON);
+                                return;
+                            }
                         }
                         else
                         {
-                            // Queue message to open Conditional Format 
Manager Dialog.
-                            GetViewData().GetDispatcher().Execute( 
SID_OPENDLG_CONDFRMT_MANAGER, SfxCallMode::ASYNCHRON );
-                            break;
+                            // define an overlapping conditional format
+                            
assert(pInnerList->GetFormat(rInnerCondFormats[0]));
+                            bNewCondFormatDlg = true;
                         }
-                    }
-                    else
-                    {
-                        // define an overlapping conditional format
-                        pCondFormat = pList->GetFormat(rCondFormats[0]);
-                        assert(pCondFormat);
-                        bCondFormatDlg = true;
-                    }
-                }
 
-                condformat::dialog::ScCondFormatDialogType eType = 
condformat::dialog::NONE;
-                switch(nSlot)
-                {
-                    case SID_OPENDLG_CONDFRMT:
-                    case SID_OPENDLG_CURRENTCONDFRMT:
-                        eType = condformat::dialog::CONDITION;
-                        break;
-                    case SID_OPENDLG_COLORSCALE:
-                        eType = condformat::dialog::COLORSCALE;
-                        break;
-                    case SID_OPENDLG_DATABAR:
-                        eType = condformat::dialog::DATABAR;
-                        break;
-                    case SID_OPENDLG_ICONSET:
-                        eType = condformat::dialog::ICONSET;
-                        break;
-                    case SID_OPENDLG_CONDDATE:
-                        eType = condformat::dialog::DATE;
-                        break;
-                    default:
-                        assert(false);
-                        break;
+                        HandleConditionalFormat(nNewIndex, bNewCondFormatDlg, 
bInnerContainsCondFormat,
+                            nSlot, pTabViewShell);
+                    });
                 }
-
-
-                if(bCondFormatDlg || !bContainsCondFormat)
+                else
                 {
-                    // Put the xml string parameter to initialize the
-                    // Conditional Format Dialog.
-                    ScCondFormatDlgItem aDlgItem(nullptr, nIndex, false);
-                    aDlgItem.SetDialogType(eType);
-                    pTabViewShell->GetPool().DirectPutItemInPool(aDlgItem);
-
-                    sal_uInt16      nId      = 
ScCondFormatDlgWrapper::GetChildWindowId();
-                    SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
-                    SfxChildWindow* pWnd     = rViewFrm.GetChildWindow( nId );
-
-                    pScMod->SetRefDialog( nId, pWnd == nullptr );
+                    HandleConditionalFormat(nIndex, bCondFormatDlg, 
bContainsCondFormat, nSlot, pTabViewShell);
                 }
             }
             break;
@@ -3275,10 +3296,10 @@ void ErrorOrRunPivotLayoutDialog(TranslateId 
pSrcErrorId,
     if (pSrcErrorId)
     {
         // Error occurred during data creation.  Launch an error and bail out.
-        std::unique_ptr<weld::MessageDialog> 
xInfoBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
+        std::shared_ptr<weld::MessageDialog> 
xInfoBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
                                                     VclMessageType::Info, 
VclButtonsType::Ok,
                                                     ScResId(pSrcErrorId)));
-        xInfoBox->run();
+        xInfoBox->runAsync(xInfoBox, [] (int) {});
         return;
     }
 
commit c90e3e388e86a582e763f0cb3bff25dcd623b675
Author:     codewithvk <[email protected]>
AuthorDate: Wed Jan 3 22:25:10 2024 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:40 2024 +0100

    jsdialog: enable calc formula error dialog
    
    Signed-off-by: codewithvk <[email protected]>
    Change-Id: Ib4d1b3d4d869b5be194c90e50c60cc89d8257b53
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161592
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Szymon Kłos <[email protected]>
    (cherry picked from commit 56ae4e455d6a8ac2116700c7b8913d64c665f362)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161681
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index cbeaf3335cbf..d5997c9c6a9f 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -145,6 +145,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
         || rUIFile == u"modules/scalc/ui/validationcriteriapage.ui"
         || rUIFile == u"modules/scalc/ui/validationdialog.ui"
         || rUIFile == u"modules/scalc/ui/validationhelptabpage.ui"
+        || rUIFile == u"modules/scalc/ui/warnautocorrect.ui"
         || rUIFile == u"modules/scalc/ui/ztestdialog.ui"
         // schart
         || rUIFile == u"modules/schart/ui/attributedialog.ui"
commit 7ee15948e056bf685d708e637482210a2fb1a3e5
Author:     Gülşah Köse <[email protected]>
AuthorDate: Thu Dec 14 12:07:48 2023 +0300
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:40 2024 +0100

    ONLINE: Exit cell edit mode before add a new sheet
    
    Prevents to move last edited cell to new sheet.
    
    Signed-off-by: Gülşah Köse <[email protected]>
    Change-Id: If4a4533d81ce244ae50bbdde1fae89da14f6b53a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160758
    Tested-by: Jenkins
    Reviewed-by: Szymon Kłos <[email protected]>

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index ff6d77b432f7..9b5feb687cb0 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -485,6 +485,11 @@ void ScDocument::InvalidateStreamOnSave()
 bool ScDocument::InsertTab(
     SCTAB nPos, const OUString& rName, bool bExternalDocument, bool 
bUndoDeleteTab )
 {
+    // auto-accept any in-process input to prevent move the cell into next 
sheet in online.
+    if (comphelper::LibreOfficeKit::isActive())
+        if (!SC_MOD()->IsFormulaMode())
+            SC_MOD()->InputEnterHandler();
+
     SCTAB nTabCount = GetTableCount();
     bool bValid = ValidTab(nTabCount);
     if ( !bExternalDocument )   // else test rName == "'Doc'!Tab" first
commit 4703340ed0f42fa75a9245349c202e315fe313c7
Author:     Darshan11 <[email protected]>
AuthorDate: Wed Jan 3 16:19:39 2024 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:40 2024 +0100

    jsdialog: enabled objectdialog (Writer -> Chart -> properties jsdialog)
    
    - before this patch we were getting tunneled dialog in chart `properties` 
options
    - which causes to have multiple dialogs appear on screen
    - objectdialog is not enabled
    Change-Id: I083c3d05ded528412c36d917bc500e55778a01c4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161582
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Szymon Kłos <[email protected]>
    (cherry picked from commit e03b03128a4cfe853258f649f8ff6f96a2c8b851)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161567
    Tested-by: Jenkins

diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 993a6f45685e..cbeaf3335cbf 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -197,6 +197,7 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
         || rUIFile == u"modules/swriter/ui/linenumbering.ui"
         || rUIFile == u"modules/swriter/ui/newuserindexdialog.ui"
         || rUIFile == u"modules/swriter/ui/numparapage.ui"
+        || rUIFile == u"modules/swriter/ui/objectdialog.ui"
         || rUIFile == u"modules/swriter/ui/pagenumberdlg.ui"
         || rUIFile == u"modules/swriter/ui/paradialog.ui"
         || rUIFile == u"modules/swriter/ui/picturedialog.ui"
commit 0652a662b7dc670818622b360458c5e086c32c7f
Author:     Darshan11 <[email protected]>
AuthorDate: Wed Dec 20 11:35:46 2023 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:39 2024 +0100

    Send checkboxtype property to online for webtreeview widget
    
    - webtreeview widget does not have any property that define that element is 
a checkbox or radio button
    - added `checboxtype` property
    - will help to identify the element type (radio/checbox)
    Change-Id: Ic8aa0c3eeb6373566f3507ebf01cee3427a57704
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161043
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Szymon Kłos <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161655
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index 81f0f4e8b078..6f309bb9a85f 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -142,6 +142,23 @@ void SvTabListBox::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 
     bool bCheckButtons = static_cast<int>(nTreeFlags & SvTreeFlags::CHKBTN);
 
+    bool isRadioButton = false;
+    if (pCheckButtonData)
+    {
+        isRadioButton = pCheckButtonData -> IsRadio();
+    }
+
+    OUString checkboxtype;
+    if (bCheckButtons)
+    {
+        checkboxtype = "checkbox";
+        if(isRadioButton)
+        {
+            checkboxtype = "radio";
+        }
+    }
+
+    rJsonWriter.put("checkboxtype", checkboxtype);
     auto entriesNode = rJsonWriter.startArray("entries");
     lcl_DumpEntryAndSiblings(rJsonWriter, First(), this, bCheckButtons);
 }
commit 3a63faf973692fde8eba5d37994217dd95c3c902
Author:     Darshan11 <[email protected]>
AuthorDate: Fri Dec 1 18:49:32 2023 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:39 2024 +0100

    Fix posx and posy for Filter by color in autofilter jsDialog
    
    Change-Id: I2d4cd198197250495cc87eb1ee68407baf8e6a1a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160216
    Reviewed-by: Szymon Kłos <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit 8b08a9927bc4ee66a9575c658934dd27f06be702)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160698
    Tested-by: Jenkins

diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx
index 3f8853877b08..2bced4d8047b 100644
--- a/vcl/source/window/dockwin.cxx
+++ b/vcl/source/window/dockwin.cxx
@@ -927,7 +927,7 @@ Point DockingWindow::GetFloatingPos() const
             pWrapper->mpFloatWin->GetWindowState( aData );
             AbsoluteScreenPixelPoint aPos(aData.x(), aData.y());
             // LOK needs logic coordinates not absolute screen position for 
autofilter menu
-            if (!comphelper::LibreOfficeKit::isActive() || get_id() != 
"check_list_menu")
+            if (!comphelper::LibreOfficeKit::isActive())
                 return 
pWrapper->mpFloatWin->GetParent()->ImplGetFrameWindow()->AbsoluteScreenToOutputPixel(
 aPos );
             return Point(aPos);
         }
commit 3d7beb1085827a7166f6892b829fa521b2a1162a
Author:     Darshan11 <[email protected]>
AuthorDate: Wed Nov 29 17:02:44 2023 +0530
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:39 2024 +0100

    Disable Select/Unselect-current Filter Checkboxes in Calc
    
    Change-Id: I99a3d78bfbb65e751328452d7405d7844f810dd9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160082
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Szymon Kłos <[email protected]>
    (cherry picked from commit 5788f736578dc22bc9bcd46a6e75233237b82af2)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160697
    Tested-by: Jenkins

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 92e7096fc25a..ecee4dab0600 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -623,6 +623,13 @@ 
ScCheckListMenuControl::ScCheckListMenuControl(weld::Widget* pParent, ScViewData
 
     maSearchEditTimer.SetTimeout(EDIT_UPDATEDATA_TIMEOUT);
     maSearchEditTimer.SetInvokeHandler(LINK(this, ScCheckListMenuControl, 
SearchEditTimeoutHdl));
+
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        mxBtnSelectSingle->hide();
+        mxBtnUnselectSingle->hide();
+    }
+
 }
 
 void ScCheckListMenuControl::GrabFocus()
commit c7d35f65b45a2969c6bb98d7fee8265bcfef0c59
Author:     Szymon Kłos <[email protected]>
AuthorDate: Mon Nov 27 09:56:27 2023 +0100
Commit:     Andras Timar <[email protected]>
CommitDate: Mon Jan 15 19:41:39 2024 +0100

    lok: Block requests to load external references
    
    - currently in LOK case we don't open multiple files in
      one "environment"
    - currently it opens import dialog which is synchronous - and that
      blocks whole app
    
    Change-Id: I11c2c7f602ecf1e29b3d6fb2930ce873749bc2ef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159984
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    Reviewed-by: Szymon Kłos <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161058
    Tested-by: Jenkins

diff --git a/sc/source/core/tool/webservicelink.cxx 
b/sc/source/core/tool/webservicelink.cxx
index b61907471e54..156048430636 100644
--- a/sc/source/core/tool/webservicelink.cxx
+++ b/sc/source/core/tool/webservicelink.cxx
@@ -7,6 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include <comphelper/lok.hxx>
 #include <comphelper/processfactory.hxx>
 #include <sfx2/linkmgr.hxx>
 #include <sfx2/bindings.hxx>
@@ -36,6 +37,13 @@ sfx2::SvBaseLink::UpdateResult 
ScWebServiceLink::DataChanged(const OUString&, co
     aResult.clear();
     bHasResult = false;
 
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        SAL_WARN("sc.ui", "ScWebServiceLink::DataChanged: blocked access to 
external file: \""
+                              << aURL << "\"");
+        return ERROR_GENERAL;
+    }
+
     css::uno::Reference<css::ucb::XSimpleFileAccess3> xFileAccess
         = 
css::ucb::SimpleFileAccess::create(comphelper::getProcessComponentContext());
     if (!xFileAccess.is())
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index 24fb7a808e6d..01476aababe0 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2542,6 +2542,12 @@ SfxObjectShellRef 
ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
     if (!isFileLoadable(aFile))
         return nullptr;
 
+    if (comphelper::LibreOfficeKit::isActive())
+    {
+        SAL_WARN( "sc.ui", "ScExternalRefManager::loadSrcDocument: blocked 
access to external file: \"" << aFile << "\"");
+        return nullptr;
+    }
+
     OUString aOptions = pFileData->maFilterOptions;
     if ( !pFileData->maFilterName.isEmpty() )
         rFilter = pFileData->maFilterName;      // don't overwrite stored 
filter with guessed filter

Reply via email to