core.git: Branch 'distro/collabora/co-23.05' - chart2/source sc/source

2024-01-05 Thread codewithvk (via logerrit)
 chart2/source/controller/main/ChartController_Window.cxx |4 
 sc/source/ui/view/cellsh1.cxx|  149 ---
 2 files changed, 88 insertions(+), 65 deletions(-)

New commits:
commit ea07fd4bfccb9297a6956e0d8e2e1d6f1b4aa41f
Author: codewithvk 
AuthorDate: Sun Dec 10 23:30:47 2023 +0530
Commit: Caolán McNamara 
CommitDate: Fri Jan 5 20:31:12 2024 +0100

Make format condition, chart delete and pivot table error async

todo:
Make executeDlg_ObjectProperties_withoutUndoGuard dialogs to async.

Signed-off-by: codewithvk 
Change-Id: I9927c1008d34370b9394aaf653afb575f69f2d45
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160557
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Caolán McNamara 

diff --git a/chart2/source/controller/main/ChartController_Window.cxx 
b/chart2/source/controller/main/ChartController_Window.cxx
index 25910034175a..6875ee702b81 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1601,10 +1601,10 @@ bool ChartController::execute_KeyInput( const KeyEvent& 
rKEvt )
 bReturn = executeDispatch_Delete();
 if( ! bReturn )
 {
-std::unique_ptr 
xInfoBox(Application::CreateMessageDialog(pChartWindow->GetFrameWeld(),
+std::shared_ptr 
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 aaeb5d8e644e..a4bc6dba15d5 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().Put(aDlgItem);
+
+sal_uInt16 nId = ScCondFormatDlgWrapper::GetChildWindowId();
+SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame();
+SfxChildWindow* pWnd = pViewFrm->GetChildWindow(nId);
+
+SC_MOD()->SetRefDialog(nId, pWnd == nullptr);
+}
+}
+
 void InsertCells(ScTabViewShell* pTabViewShell, SfxRequest , InsCellCmd 
eCmd)
 {
 if (eCmd!=INS_NONE)
@@ -2345,78 +2388,58 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
 // or should create a new overlapping conditional format
 if(bContainsCondFormat && !bCondFormatDlg && 
bContainsExistingCondFormat)
 {
-std::unique_ptr 
xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
+std::shared_ptr 
xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),

VclMessageType::Question, VclButtonsType::YesNo,

ScResId(STR_EDIT_EXISTING_COND_FORMATS), pTabViewShell));
 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() == 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - chart2/source sc/source vcl/jsdialog

2023-03-07 Thread Szymon Kłos (via logerrit)
 chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx |   12 +++-
 sc/source/ui/drawfunc/fuins2.cxx|5 -
 vcl/jsdialog/enabled.cxx|7 +++
 3 files changed, 22 insertions(+), 2 deletions(-)

New commits:
commit f74cf38f9da1f01c26717fe75708466e08c79b26
Author: Szymon Kłos 
AuthorDate: Thu Mar 2 16:11:14 2023 +0100
Commit: Szymon Kłos 
CommitDate: Tue Mar 7 09:17:06 2023 +

jsdialog: enable chart wizard

Change-Id: I7d6f4b4e6022507a57224ad40785f5f4f4537ea8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148133
Tested-by: Szymon Kłos 
Reviewed-by: Szymon Kłos 

diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx 
b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
index 288f097c6038..3a1fa1386f7a 100644
--- a/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
+++ b/chart2/source/controller/dialogs/dlg_CreationWizard_UNO.cxx
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -32,6 +33,7 @@
 #include 
 #include 
 
+
 namespace chart
 {
 using namespace ::com::sun::star;
@@ -167,10 +169,18 @@ void CreationWizardUnoDlg::createDialogOnDemand()
 m_xParentWindow = xFrame->getContainerWindow();
 }
 }
+
+weld::Window* pParent(Application::GetFrameWeld(m_xParentWindow));
+if (!pParent)
+{
+if (weld::TransportAsXWindow* pTunnel = 
dynamic_cast(m_xParentWindow.get()))
+pParent = dynamic_cast(pTunnel->getWidget());
+}
+
 uno::Reference< XComponent > xKeepAlive( this );
 if( m_xChartModel.is() )
 {
-m_xDialog = 
std::make_shared(Application::GetFrameWeld(m_xParentWindow), 
m_xChartModel, m_xCC);
+m_xDialog = std::make_shared(pParent, m_xChartModel, 
m_xCC);
 }
 }
 
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index ba7c2cba3573..f35b77e82fce 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -631,9 +632,11 @@ FuInsertChart::FuInsertChart(ScTabViewShell& rViewSh, 
vcl::Window* pWin, ScDrawV
 uno::Reference< lang::XInitialization > xInit( xDialog, 
uno::UNO_QUERY );
 if( xChartModel.is() && xInit.is() )
 {
+css::uno::Reference< css::awt::XWindow > xParent
+= new weld::TransportAsXWindow(pWin->GetFrameWeld());
 uno::Sequence 
aSeq(comphelper::InitAnyPropertySequence(
 {
-{"ParentWindow", uno::Any(uno::Reference< awt::XWindow 
>())},
+{"ParentWindow", uno::Any(xParent)},
 {"ChartModel", uno::Any(xChartModel)}
 }));
 xInit->initialize( aSeq );
diff --git a/vcl/jsdialog/enabled.cxx b/vcl/jsdialog/enabled.cxx
index 42a22b70efa0..70674c5523b1 100644
--- a/vcl/jsdialog/enabled.cxx
+++ b/vcl/jsdialog/enabled.cxx
@@ -82,6 +82,11 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"modules/scalc/ui/ttestdialog.ui"
 || rUIFile == u"modules/scalc/ui/ungroupdialog.ui"
 || rUIFile == u"modules/scalc/ui/ztestdialog.ui"
+// schart
+|| rUIFile == u"modules/schart/ui/tp_ChartType.ui"
+|| rUIFile == u"modules/schart/ui/tp_RangeChooser.ui"
+|| rUIFile == u"modules/schart/ui/tp_DataSource.ui"
+|| rUIFile == u"modules/schart/ui/wizelementspage.ui"
 // swriter
 || rUIFile == u"modules/swriter/ui/captionoptions.ui"
 || rUIFile == u"modules/swriter/ui/characterproperties.ui"
@@ -110,6 +115,8 @@ bool isBuilderEnabled(std::u16string_view rUIFile, bool 
bMobile)
 || rUIFile == u"svx/ui/fontworkgallerydialog.ui"
 // uui
 || rUIFile == u"uui/ui/macrowarnmedium.ui"
+// vcl
+|| rUIFile == u"vcl/ui/wizard.ui"
 // xmlsec
 || rUIFile == u"filter/ui/pdfgeneralpage.ui"
 || rUIFile == u"filter/ui/pdflinkspage.ui"