basctl/source/basicide/baside2.cxx | 2 basic/source/classes/sbxmod.cxx | 2 basic/source/runtime/methods1.cxx | 2 cui/source/customize/cfgutil.cxx | 18 +---- cui/source/factory/dlgfact.cxx | 7 +- cui/source/factory/dlgfact.hxx | 5 - cui/source/inc/cfgutil.hxx | 2 cui/uiconfig/ui/macroselectordialog.ui | 4 - desktop/source/lib/init.cxx | 5 - fpicker/source/win32/asyncrequests.cxx | 2 framework/source/loadenv/loadenv.cxx | 2 include/vcl/svapp.hxx | 4 + include/vcl/toolkit/dialog.hxx | 1 sc/sdi/drawsh.sdi | 2 sc/source/core/tool/chgtrack.cxx | 4 - sc/source/filter/oox/workbookfragment.cxx | 2 sc/source/ui/drawfunc/drawsh.cxx | 17 +++++ sfx2/source/appl/appserv.cxx | 39 ++++++------ sfx2/source/doc/docfile.cxx | 2 sfx2/source/doc/printhelper.cxx | 4 - svx/source/dialog/docrecovery.cxx | 2 svx/source/svdraw/svdmrkv.cxx | 95 ++++++++++++++++++++++++++---- svx/source/svdraw/svdoedge.cxx | 6 + sw/sdi/_viewsh.sdi | 5 + sw/sdi/drawsh.sdi | 5 + sw/source/uibase/dbui/dbmgr.cxx | 2 sw/source/uibase/shells/drawsh.cxx | 16 ++++- sw/source/uibase/uiview/view2.cxx | 18 +++++ sw/source/uibase/uno/unotxdoc.cxx | 4 - vbahelper/source/vbahelper/vbahelper.cxx | 2 vcl/inc/salvtables.hxx | 2 vcl/jsdialog/executor.cxx | 33 ++++++---- vcl/source/app/salvtables.cxx | 7 ++ vcl/source/app/svapp.cxx | 5 + vcl/source/control/notebookbar.cxx | 3 vcl/source/control/prgsbar.cxx | 2 vcl/source/window/dialog.cxx | 10 ++- vcl/source/window/menufloatingwindow.cxx | 2 vcl/source/window/syswin.cxx | 2 39 files changed, 260 insertions(+), 87 deletions(-)
New commits: commit 91b6b67cfb41fd661bc0417a0fbe9595774deddd Author: mert <mert.tu...@collabora.com> AuthorDate: Thu Feb 25 11:41:24 2021 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 16:20:49 2021 +0100 Init Notebookbar for Online Draw Signed-off-by: mert <mert.tu...@collabora.com> Change-Id: I85a25820d3968070dd8a05156b4bb4a1ebe59f99 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111517 diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 153be8911426..7b455cf7b348 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -6380,6 +6380,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char activateNotebookbar("Writer"); activateNotebookbar("Calc"); activateNotebookbar("Impress"); + activateNotebookbar("Draw"); } return bInitialized; diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 64686e1729b5..1c2a7c9d3252 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -71,7 +71,8 @@ NotebookBar::NotebookBar(Window* pParent, const OString& rID, const OUString& rU bool bIsWelded = comphelper::LibreOfficeKit::isActive() && (rUIXMLDescription == "modules/swriter/ui/notebookbar.ui" || rUIXMLDescription == "modules/scalc/ui/notebookbar.ui" - || rUIXMLDescription == "modules/simpress/ui/notebookbar.ui"); + || rUIXMLDescription == "modules/simpress/ui/notebookbar.ui" + || rUIXMLDescription == "modules/sdraw/ui/notebookbar.ui"); if (bIsWelded) { m_bIsWelded = true; commit c0f897e54f70cc066a436d6b6e9aca2071b1cbcf Author: mert <mert.tu...@collabora.com> AuthorDate: Wed Feb 24 06:22:49 2021 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 16:20:49 2021 +0100 Fix chart sub element rectangle and handle positions Change-Id: I486b542ae0bb4a987c98d92c1866895eafcf620c Signed-off-by: mert <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111440 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111516 Tested-by: Jenkins diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 1ccb5de7e6a0..f75bb22f3dda 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -689,7 +689,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S tools::Rectangle aSelection(rRect); bool bIsChart = false; - + Point addLogicOffset(0, 0); if (!rRect.IsEmpty()) { sal_uInt32 nTotalPaintWindows = this->PaintWindowCount(); @@ -704,6 +704,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S { Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow); Point aLogicOffset = pWin->PixelToLogic(aOffsetPx); + addLogicOffset = aLogicOffset; aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY()); } } @@ -863,8 +864,6 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S } sPolygonElem += R"elem(\" style=\"stroke: none; fill: rgb(114,159,207); fill-opacity: 0.8\"/>)elem"; - aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM)); - OString sSVGElem = R"elem(<svg version=\"1.2\" width=\")elem" + OString::number(aSelection.GetWidth() / 100.0) + R"elem(mm\" height=\")elem" + @@ -908,6 +907,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S child.put("kind", kind); child.put("pointer", static_cast<sal_Int32>(pHdl->GetPointer())); Point pHdlPos = pHdl->GetPos(); + pHdlPos.Move(addLogicOffset.getX(), addLogicOffset.getY()); if (convertMapMode) pHdlPos = OutputDevice::LogicToLogic(pHdlPos, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); point.put("x", pHdlPos.getX()); commit 3e9453664f4b1ddec8170dbc709f85d730f94537 Author: mert <mert.tu...@collabora.com> AuthorDate: Fri Feb 19 11:15:02 2021 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 16:20:49 2021 +0100 Implemented MoveShapeHandle uno command for sc Change-Id: I5f81348cd778d7fbcb3b4e721fbf0412c4f5753d Signed-off-by: mert <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111195 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111514 Tested-by: Jenkins diff --git a/sc/sdi/drawsh.sdi b/sc/sdi/drawsh.sdi index 21e25f35623c..b1d5ecec44a8 100644 --- a/sc/sdi/drawsh.sdi +++ b/sc/sdi/drawsh.sdi @@ -230,7 +230,7 @@ interface TableDraw SID_ATTR_GLOW_TRANSPARENCY [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ] SID_ATTR_SOFTEDGE_RADIUS [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawAttrState; ] - + SID_MOVE_SHAPE_HANDLE [ ExecMethod = ExecDrawAttr; ] } diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 76470eb90caa..f8cc7c5d2a2c 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -59,6 +59,7 @@ #include <svx/xflclit.hxx> #include <svx/xflgrit.hxx> #include <editeng/colritem.hxx> +#include <tools/UnitConversion.hxx> SFX_IMPL_INTERFACE(ScDrawShell, SfxShell) @@ -202,6 +203,22 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq ) pView->SetAttributes(aEmptyAttr, true); } break; + case SID_MOVE_SHAPE_HANDLE: + { + const SfxItemSet *pArgs = rReq.GetArgs (); + if (pArgs && pArgs->Count () == 3) + { + const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1); + const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2); + const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3); + + const sal_uLong handleNum = handleNumItem->GetValue(); + const sal_uLong newPosX = convertTwipToMm100(newPosXTwips->GetValue()); + const sal_uLong newPosY = convertTwipToMm100(newPosYTwips->GetValue()); + pView->MoveShapeHandle(handleNum, Point(newPosX, newPosY)); + } + } + break; case SID_ATTR_LINE_STYLE: case SID_ATTR_LINEEND_STYLE: commit 80629c5d96fbdce042fe96e75a381841ad2561ce Author: mert <mert.tu...@collabora.com> AuthorDate: Fri Feb 19 09:55:12 2021 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 16:20:49 2021 +0100 Convert MapModeUnits If necessary. Connecting to a glue point or handle callback messages contain points which may need a unit conversion depending on the module Change-Id: Icc0b2bc5981bb7d135efd38e60ac06fe12a70480 Signed-off-by: mert <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111193 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111513 Tested-by: Jenkins diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 59159fb3d65e..1ccb5de7e6a0 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -897,6 +897,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S boost::property_tree::ptree poly; boost::property_tree::ptree custom; boost::property_tree::ptree nodes; + const bool convertMapMode = mpMarkedPV->GetView().GetFirstOutputDevice()->GetMapMode().GetMapUnit() == MapUnit::Map100thMM; for (size_t i = 0; i < maHdlList.GetHdlCount(); i++) { SdrHdl *pHdl = maHdlList.GetHdl(i); @@ -906,8 +907,11 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S child.put("id", pHdl->GetObjHdlNum()); child.put("kind", kind); child.put("pointer", static_cast<sal_Int32>(pHdl->GetPointer())); - point.put("x", convertMm100ToTwip(pHdl->GetPos().getX())); - point.put("y", convertMm100ToTwip(pHdl->GetPos().getY())); + Point pHdlPos = pHdl->GetPos(); + if (convertMapMode) + pHdlPos = OutputDevice::LogicToLogic(pHdlPos, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); + point.put("x", pHdlPos.getX()); + point.put("y", pHdlPos.getY()); child.add_child("point", point); const auto node = std::make_pair("", child); boost::property_tree::ptree* selectedNode = nullptr; @@ -937,7 +941,6 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S } else kindNode.get().push_back(node); - } nodes.add_child("rectangle", rectangle); nodes.add_child("poly", poly); diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index d9f2046be95d..804543fe0d5a 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -2135,7 +2135,7 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO // sensitive area of connectors is twice as large as the one of the handles sal_uInt16 nMarkHdSiz=rPV.GetView().GetMarkHdlSizePixel(); Size aHalfConSiz(nMarkHdSiz,nMarkHdSiz); - if (comphelper::LibreOfficeKit::isActive()) + if (comphelper::LibreOfficeKit::isActive() && pOut->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) aHalfConSiz=pOut->PixelToLogic(aHalfConSiz, MapMode(MapUnit::Map100thMM)); else aHalfConSiz=pOut->PixelToLogic(aHalfConSiz); commit 09dbd5872fd2b1c1f54635c2e19cab13550fcd77 Author: mert <mert.tu...@collabora.com> AuthorDate: Fri Feb 19 09:37:19 2021 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 16:20:49 2021 +0100 Implemented MoveShapeHandle uno command for sw Change-Id: I9feccc4fa1a4d7426609afa474f87ab12c769090 Signed-off-by: mert <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111192 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111512 Tested-by: Jenkins diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index 61bd43768cf0..0661e4cd7b7a 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -974,5 +974,10 @@ interface BaseTextEditView MenuConfig , AccelConfig , ToolBoxConfig ; ] + SID_MOVE_SHAPE_HANDLE + [ + ExecMethod = Execute ; + ] + } diff --git a/sw/sdi/drawsh.sdi b/sw/sdi/drawsh.sdi index 5ea1f46d1ecc..a4e999872e48 100644 --- a/sw/sdi/drawsh.sdi +++ b/sw/sdi/drawsh.sdi @@ -537,5 +537,10 @@ shell SwDrawShell : SwDrawBaseShell StateMethod = GetState ; DisableFlags="SfxDisableFlags::SwOnProtectedCursor"; ] + + SID_MOVE_SHAPE_HANDLE + [ + ExecMethod = Execute ; + ] } diff --git a/sw/source/uibase/shells/drawsh.cxx b/sw/source/uibase/shells/drawsh.cxx index 080f3221dd4e..59fe518a77de 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -200,7 +200,21 @@ void SwDrawShell::Execute(SfxRequest &rReq) GetView().FlipDrawRotate(); } break; - + case SID_MOVE_SHAPE_HANDLE: + { + if (pArgs && pArgs->Count() == 3) + { + const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1); + const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2); + const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3); + + const sal_uLong handleNum = handleNumItem->GetValue(); + const sal_uLong newPosX = newPosXTwips->GetValue(); + const sal_uLong newPosY = newPosYTwips->GetValue(); + pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY)); + } + } + break; case SID_BEZIER_EDIT: if (GetView().IsDrawRotate()) { diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index da05a1cd6794..dbc9fbd26c0a 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1343,6 +1343,24 @@ void SwView::Execute(SfxRequest &rReq) rReq.SetReturnValue(SfxBoolItem(nSlot, InsertGraphicDlg( rReq ))); } break; + case SID_MOVE_SHAPE_HANDLE: + { + if (pArgs && pArgs->Count() == 3) + { + SdrView *pSdrView = m_pWrtShell->HasDrawView() ? m_pWrtShell->GetDrawView() : nullptr; + if (pSdrView == nullptr) + break; + const SfxUInt32Item* handleNumItem = rReq.GetArg<SfxUInt32Item>(FN_PARAM_1); + const SfxUInt32Item* newPosXTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_2); + const SfxUInt32Item* newPosYTwips = rReq.GetArg<SfxUInt32Item>(FN_PARAM_3); + + const sal_uLong handleNum = handleNumItem->GetValue(); + const sal_uLong newPosX = newPosXTwips->GetValue(); + const sal_uLong newPosY = newPosYTwips->GetValue(); + pSdrView->MoveShapeHandle(handleNum, Point(newPosX, newPosY)); + } + break; + } default: OSL_ENSURE(false, "wrong dispatcher"); commit 0094f64fdf3adaa6897b124fe128cdb46f72dab9 Author: mert <mert.tu...@collabora.com> AuthorDate: Wed Feb 17 09:12:25 2021 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 16:20:48 2021 +0100 Fix connectors cannot select a glue point Change-Id: I6b6d2dad27910ac6d5de43e9d0992e3565f5be5e Signed-off-by: mert <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111024 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111511 Tested-by: Jenkins diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index f1395767cd29..d9f2046be95d 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -43,6 +43,7 @@ #include <svx/sxenditm.hxx> #include <svx/xpoly.hxx> #include <vcl/ptrstyle.hxx> +#include <comphelper/lok.hxx> void SdrObjConnection::ResetVars() { @@ -2134,7 +2135,10 @@ bool SdrEdgeObj::ImpFindConnector(const Point& rPt, const SdrPageView& rPV, SdrO // sensitive area of connectors is twice as large as the one of the handles sal_uInt16 nMarkHdSiz=rPV.GetView().GetMarkHdlSizePixel(); Size aHalfConSiz(nMarkHdSiz,nMarkHdSiz); - aHalfConSiz=pOut->PixelToLogic(aHalfConSiz); + if (comphelper::LibreOfficeKit::isActive()) + aHalfConSiz=pOut->PixelToLogic(aHalfConSiz, MapMode(MapUnit::Map100thMM)); + else + aHalfConSiz=pOut->PixelToLogic(aHalfConSiz); tools::Rectangle aMouseRect(rPt,rPt); aMouseRect.AdjustLeft( -(aHalfConSiz.Width()) ); aMouseRect.AdjustTop( -(aHalfConSiz.Height()) ); commit 52509a5f2779902a2bd447e7f21c81c9a6c920a8 Author: mert <mert.tu...@collabora.com> AuthorDate: Mon Feb 8 10:31:38 2021 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 16:20:48 2021 +0100 Exclude table selection from handle message Change-Id: Ic079c2d59040c8b6d714af3932d5294c2060edc0 Signed-off-by: mert <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110548 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111510 Tested-by: Jenkins diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index f8d491503e0a..59159fb3d65e 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -889,7 +889,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S } } } - if (!pOtherShell && maHdlList.GetHdlCount()) + if (!bTableSelection && !pOtherShell && maHdlList.GetHdlCount()) { boost::property_tree::ptree responseJSON; boost::property_tree::ptree others; commit 986127eaa5c4a443c4dd84d7efe6509afed4d489 Author: mert <mert.tu...@collabora.com> AuthorDate: Mon Jan 4 22:39:56 2021 +0300 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 16:20:48 2021 +0100 Send handle information of selected shapes to LOK Include the handle information to the callback for the new uno command for interactive dragging/resizing operations. Change-Id: I57c03abc22d3831606da2b698f1de080e9b4da78 Signed-off-by: mert <mert.tu...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108686 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111506 Tested-by: Jenkins diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 5e528e5947db..f8d491503e0a 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -62,6 +62,8 @@ #include <com/sun/star/view/XSelectionSupplier.hpp> #include <boost/property_tree/json_parser.hpp> +#include <boost/optional/optional.hpp> +#include <tools/UnitConversion.hxx> using namespace com::sun::star; @@ -726,6 +728,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S { OString sSelectionText; + OString sSelectionTextView; boost::property_tree::ptree aTableJsonTree; bool bTableSelection = false; @@ -749,6 +752,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S } OStringBuffer aExtraInfo; + OString handleArrayStr; aExtraInfo.append("{\"id\":\""); aExtraInfo.append(OString::number(reinterpret_cast<sal_IntPtr>(pO))); @@ -885,18 +889,82 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S } } } - aExtraInfo.append("}"); + if (!pOtherShell && maHdlList.GetHdlCount()) + { + boost::property_tree::ptree responseJSON; + boost::property_tree::ptree others; + boost::property_tree::ptree rectangle; + boost::property_tree::ptree poly; + boost::property_tree::ptree custom; + boost::property_tree::ptree nodes; + for (size_t i = 0; i < maHdlList.GetHdlCount(); i++) + { + SdrHdl *pHdl = maHdlList.GetHdl(i); + boost::property_tree::ptree child; + boost::property_tree::ptree point; + sal_Int32 kind = static_cast<sal_Int32>(pHdl->GetKind()); + child.put("id", pHdl->GetObjHdlNum()); + child.put("kind", kind); + child.put("pointer", static_cast<sal_Int32>(pHdl->GetPointer())); + point.put("x", convertMm100ToTwip(pHdl->GetPos().getX())); + point.put("y", convertMm100ToTwip(pHdl->GetPos().getY())); + child.add_child("point", point); + const auto node = std::make_pair("", child); + boost::property_tree::ptree* selectedNode = nullptr; + if (kind >= static_cast<sal_Int32>(SdrHdlKind::UpperLeft) && kind <= static_cast<sal_Int32>(SdrHdlKind::LowerRight)) + { + selectedNode = &rectangle; + } + else if (kind == static_cast<sal_Int32>(SdrHdlKind::Poly)) + { + selectedNode = &poly; + } + else if (kind == static_cast<sal_Int32>(SdrHdlKind::CustomShape1)) + { + selectedNode = &custom; + } + else + { + selectedNode = &others; + } + std::string sKind = std::to_string(kind); + boost::optional< boost::property_tree::ptree& > kindNode = selectedNode->get_child_optional(sKind.c_str()); + if (!kindNode) + { + boost::property_tree::ptree newChild; + newChild.push_back(node); + selectedNode->add_child(sKind.c_str(), newChild); + } + else + kindNode.get().push_back(node); + } + nodes.add_child("rectangle", rectangle); + nodes.add_child("poly", poly); + nodes.add_child("custom", custom); + nodes.add_child("others", others); + responseJSON.add_child("kinds", nodes); + std::stringstream aStream; + boost::property_tree::write_json(aStream, responseJSON, /*pretty=*/ false); + handleArrayStr = ", \"handles\":"; + handleArrayStr = handleArrayStr + aStream.str().c_str(); + } sSelectionText = aSelection.toString() + ", " + OString::number(nRotAngle); if (!aExtraInfo.isEmpty()) { + sSelectionTextView = sSelectionText + ", " + aExtraInfo.toString() + "}"; + aExtraInfo.append(handleArrayStr); + aExtraInfo.append("}"); sSelectionText += ", " + aExtraInfo.makeStringAndClear(); } } if (sSelectionText.isEmpty()) + { sSelectionText = "EMPTY"; + sSelectionTextView = "EMPTY"; + } if (bTableSelection) { @@ -921,14 +989,14 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S // Another shell wants to know about our existing // selection. if (pViewShell != pOtherShell) - SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionText); + SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionTextView); } else { // We have a new selection, so both pViewShell and the // other views want to know about it. pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_GRAPHIC_SELECTION, sSelectionText.getStr()); - SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionText); + SfxLokHelper::notifyOtherViews(pViewShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionTextView); } } } @@ -1047,11 +1115,6 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell) tools::Rectangle aRect(GetMarkedObjRect()); - if (bTiledRendering && pViewShell) - { - SetMarkHandlesForLOKit(aRect, pOtherShell); - } - if (bFrmHdl) { if(!aRect.IsEmpty()) @@ -1233,6 +1296,11 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell) } } + // moved it here to access all the handles for callback. + if (bTiledRendering && pViewShell) + { + SetMarkHandlesForLOKit(aRect, pOtherShell); + } // rotation point/axis of reflection if(!bLimitedRotation) { commit 3564336713317fb60a4166ee92133504d22b1ac6 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Mon Feb 15 19:43:17 2021 -0400 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 16:20:48 2021 +0100 lok: fix treeview action "select" Unfortunately the Macros dialog has a treeview control that fill on demand and the position is absolute and it has a side effect to deselect the item since the relative entry position is nullptr. Change-Id: Ie442f6d634437a293cde65da0764d3f433a70155 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110963 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113677 Tested-by: Jenkins Reviewed-by: Henry Castro <hcas...@collabora.com> diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 910dc5f60580..066512b2abf1 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -230,11 +230,14 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat { OString nRowString = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US); - int nRow = std::atoi(nRowString.getStr()); - pTreeView->unselect(pTreeView->get_selected_index()); - pTreeView->select(nRow); - pTreeView->set_cursor(nRow); + + int nAbsPos = std::atoi(nRowString.getStr()); + + std::unique_ptr<weld::TreeIter> itEntry(pTreeView->make_iterator()); + pTreeView->get_iter_abs_pos(*itEntry, nAbsPos); + pTreeView->select(*itEntry); + pTreeView->set_cursor(*itEntry); LOKTrigger::trigger_changed(*pTreeView); //LOKTrigger::trigger_row_activated(*pTreeView); return true; commit 1c52873c7128cf69e67859c90807f38237fd774d Author: Noel Grandin <n...@peralex.com> AuthorDate: Wed Jan 6 12:59:29 2021 +0200 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 15:58:52 2021 +0100 fix location of change tracking boxes in Online Change-Id: I65fcb52e224dce7df2a5a7baed2b8f23d0d49397 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108849 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.me...@collabora.com> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index c3214a771657..153be8911426 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -4835,12 +4835,12 @@ static char* getTrackedChanges(LibreOfficeKitDocument* pThis) // construct the tracked changes JSON from inside the sw/, not here using UNO if (doc_getDocumentType(pThis) != LOK_DOCTYPE_TEXT && xRedlinesSupplier.is()) { - auto redlinesNode = aJson.startNode("redlines"); + auto redlinesNode = aJson.startArray("redlines"); uno::Reference<container::XEnumeration> xRedlines = xRedlinesSupplier->getRedlines()->createEnumeration(); for (size_t nIndex = 0; xRedlines->hasMoreElements(); ++nIndex) { uno::Reference<beans::XPropertySet> xRedline(xRedlines->nextElement(), uno::UNO_QUERY); - auto redlineNode = aJson.startNode(""); + auto redlineNode = aJson.startStruct(); aJson.put("index", static_cast<sal_Int32>(nIndex)); OUString sAuthor; diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx index bd40a24b3eb5..2cf34856228b 100644 --- a/sc/source/core/tool/chgtrack.cxx +++ b/sc/source/core/tool/chgtrack.cxx @@ -4690,7 +4690,7 @@ static void lcl_getTrackedChange(ScDocument& rDoc, int nIndex, const ScChangeAct if (pAction->GetType() != SC_CAT_CONTENT) return; - auto redlinesNode = rRedlines.startNode(""); + auto redlinesNode = rRedlines.startStruct(); rRedlines.put("index", static_cast<sal_Int64>(nIndex)); rRedlines.put("author", pAction->GetUser()); @@ -4709,7 +4709,7 @@ static void lcl_getTrackedChange(ScDocument& rDoc, int nIndex, const ScChangeAct void ScChangeTrack::GetChangeTrackInfo(tools::JsonWriter& aRedlines) { - auto redlinesNode = aRedlines.startNode("redlines"); + auto redlinesNode = aRedlines.startArray("redlines"); ScChangeAction* pAction = GetFirst(); if (pAction) diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 0cc2856c4200..fce0ff7ceb74 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3269,7 +3269,7 @@ PointerStyle SwXTextDocument::getPointer() void SwXTextDocument::getTrackedChanges(tools::JsonWriter& rJson) { - auto redlinesNode = rJson.startNode("redlines"); + auto redlinesNode = rJson.startArray("redlines"); // Disable since usability is very low beyond some small number of changes. static bool bDisableRedlineComments = getenv("DISABLE_REDLINE") != nullptr; @@ -3280,7 +3280,7 @@ void SwXTextDocument::getTrackedChanges(tools::JsonWriter& rJson) = m_pDocShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable(); for (SwRedlineTable::size_type i = 0; i < rRedlineTable.size(); ++i) { - auto redlineNode = rJson.startNode(""); + auto redlineNode = rJson.startStruct(); rJson.put("index", rRedlineTable[i]->GetId()); rJson.put("author", rRedlineTable[i]->GetAuthorString(1)); rJson.put("type", SwRedlineTypeToOUString( commit b92faccec7add73472a6260cc91a73d4809887b2 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Fri Dec 18 08:05:12 2020 -0400 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 15:58:29 2021 +0100 jsdialog: disable row activated on "select" action Unfortunately, when the "Macro Selector Dialog" is shown and issue the "select" action, it closes the dialog because the row activated trigger double click the macro selected. for moment comment the unexpected side effect Change-Id: Ibdfa09c444ee79376a9e2251e919f5f06dba577d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107964 Tested-by: Jenkins Reviewed-by: Henry Castro <hcas...@collabora.com> diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index 9d8238c4833a..910dc5f60580 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -236,7 +236,7 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat pTreeView->select(nRow); pTreeView->set_cursor(nRow); LOKTrigger::trigger_changed(*pTreeView); - LOKTrigger::trigger_row_activated(*pTreeView); + //LOKTrigger::trigger_row_activated(*pTreeView); return true; } else if (sAction == "expand") commit 83c38ed47dc95d21656c196d7f5c489c45300d2d Author: Henry Castro <hcas...@collabora.com> AuthorDate: Thu Dec 17 11:02:40 2020 -0400 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 15:58:13 2021 +0100 jsdialog: add the "expand" action to the tree list view control Change-Id: I69f1b06748053fdfe9164c52e889629e51f91409 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107914 Tested-by: Jenkins Reviewed-by: Henry Castro <hcas...@collabora.com> diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 5622a89be760..3c43c95c5cd9 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -1561,6 +1561,8 @@ public: virtual bool get_iter_first(weld::TreeIter& rIter) const override; + virtual bool get_iter_abs_pos(weld::TreeIter& rIter, int nPos) const; + virtual bool iter_next_sibling(weld::TreeIter& rIter) const override; virtual bool iter_previous_sibling(weld::TreeIter& rIter) const override; diff --git a/vcl/jsdialog/executor.cxx b/vcl/jsdialog/executor.cxx index f338cb6830b2..9d8238c4833a 100644 --- a/vcl/jsdialog/executor.cxx +++ b/vcl/jsdialog/executor.cxx @@ -207,7 +207,7 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat } else if (sControlType == "treeview") { - auto pTreeView = dynamic_cast<weld::TreeView*>(pWidget); + auto pTreeView = dynamic_cast<JSTreeView*>(pWidget); if (pTreeView) { if (sAction == "change") @@ -239,6 +239,16 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat LOKTrigger::trigger_row_activated(*pTreeView); return true; } + else if (sAction == "expand") + { + OString nRowString + = OUStringToOString(rData["data"], RTL_TEXTENCODING_ASCII_US); + int nAbsPos = std::atoi(nRowString.getStr()); + std::unique_ptr<weld::TreeIter> itEntry(pTreeView->make_iterator()); + pTreeView->get_iter_abs_pos(*itEntry, nAbsPos); + pTreeView->expand_row(*itEntry); + return true; + } else if (sAction == "dragstart") { OString nRowString @@ -246,17 +256,13 @@ bool ExecuteAction(sal_uInt64 nWindowId, const OString& rWidget, StringMap& rDat int nRow = std::atoi(nRowString.getStr()); pTreeView->select(nRow); + pTreeView->drag_start(); - JSTreeView* pJSTreeView = dynamic_cast<JSTreeView*>(pTreeView); - if (pJSTreeView) - pJSTreeView->drag_start(); return true; } else if (sAction == "dragend") { - JSTreeView* pJSTreeView = dynamic_cast<JSTreeView*>(pTreeView); - if (pJSTreeView) - pJSTreeView->drag_end(); + pTreeView->drag_end(); return true; } } diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index c8e8167c4757..56c0f9dd3e40 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -4306,6 +4306,13 @@ bool SalInstanceTreeView::get_iter_first(weld::TreeIter& rIter) const return rVclIter.iter != nullptr; } +bool SalInstanceTreeView::get_iter_abs_pos(weld::TreeIter& rIter, int nAbsPos) const +{ + SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter); + rVclIter.iter = m_xTreeView->GetEntryAtAbsPos(nAbsPos); + return rVclIter.iter != nullptr; +} + bool SalInstanceTreeView::iter_next_sibling(weld::TreeIter& rIter) const { SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rIter); commit bf2aef82683811ce5d728894629e087c2208585e Author: Henry Castro <hcas...@collabora.com> AuthorDate: Fri Dec 4 15:38:35 2020 -0400 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 15:57:45 2021 +0100 lok: jsbuilder: fix disable dialog tunneling When a client side issue command to show the Macro Selector Dialog to the server side, it is not necessary the dialog sends window invalidate. I guess the dialog tunneling progressively will be deprecated in favor of JSDialog, that it will send JSON data to client side, then it will be constructed to html element using a javascript dialog builder. (I am wondering why sending JSON?, the server side can just send the HTML string, and no need for javascript dialog builder). Change-Id: Ia88f431ed9a860bb9bb30caaaf0f7f889d765115 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107240 Tested-by: Jenkins Reviewed-by: Henry Castro <hcas...@collabora.com> diff --git a/include/vcl/toolkit/dialog.hxx b/include/vcl/toolkit/dialog.hxx index efd2d2f0f6c0..bab25f2d15f3 100644 --- a/include/vcl/toolkit/dialog.hxx +++ b/include/vcl/toolkit/dialog.hxx @@ -107,6 +107,7 @@ public: virtual void StateChanged( StateChangedType nStateChange ) override; virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; virtual void Command( const CommandEvent& rCEvt ) override; + virtual void PixelInvalidate(const tools::Rectangle* pRectangle) override; virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override; virtual bool set_property(const OString &rKey, const OUString &rValue) override; diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 21f875fd7fc2..f1e3fe30cf06 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -396,6 +396,14 @@ void Dialog::ImplInitDialogData() mpDialogImpl.reset(new DialogImpl); } +void Dialog::PixelInvalidate(const tools::Rectangle* pRectangle) +{ + if (!mpDialogImpl->m_bLOKTunneling) + return; + + Window::PixelInvalidate(pRectangle); +} + vcl::Window* Dialog::GetDefaultParent(WinBits nStyle) { vcl::Window* pParent = Application::GetDefDialogParent(); commit 8f1d63dddddaa9e5dd16b77fce4193fa971c93fd Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Sat Mar 13 09:36:46 2021 +0200 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 15:53:36 2021 +0100 check for quit when calling Yield in loop so we don't get stuck threads when the main application quits Change-Id: Id36e99267ceb4154873b6ef8ef494622fff6c19a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112409 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.me...@collabora.com> diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 41c0ff4413f3..a7bf5b2edeb8 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -679,7 +679,7 @@ BasicDebugFlags ModulWindow::BasicBreakHdl() InvalidateDebuggerSlots(); - while( m_aStatus.bIsRunning ) + while( m_aStatus.bIsRunning && !Application::IsQuit()) Application::Yield(); m_aStatus.bIsInReschedule = false; diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 5e9647e955a7..a9caaccc9758 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1048,7 +1048,7 @@ namespace if (m_bDelInst) { // Compare here with 1 instead of 0, because before nCallLvl-- - while (m_pSbData->pInst->nCallLvl != 1) + while (m_pSbData->pInst->nCallLvl != 1 && !Application::IsQuit()) Application::Yield(); } diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index c847df8d26e6..2f9b6ff7b655 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -581,7 +581,7 @@ void Wait_Impl( bool bDurationBased, SbxArray& rPar ) Timer aTimer; aTimer.SetTimeout( nWait ); aTimer.Start(); - while ( aTimer.IsActive() ) + while ( aTimer.IsActive() && !Application::IsQuit()) { Application::Yield(); } diff --git a/fpicker/source/win32/asyncrequests.cxx b/fpicker/source/win32/asyncrequests.cxx index 86b71cf51540..bfecc42125a3 100644 --- a/fpicker/source/win32/asyncrequests.cxx +++ b/fpicker/source/win32/asyncrequests.cxx @@ -50,7 +50,7 @@ void Request::wait( ::sal_Int32 nMilliSeconds ) void Request::waitProcessMessages() { SolarMutexGuard aGuard; - while ( !m_aJoiner.check() ) + while ( !m_aJoiner.check() && !Application::IsQuit()) Application::Yield(); } diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 59687abbeefb..e41c6db1d142 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -413,7 +413,7 @@ bool LoadEnv::waitWhileLoading(sal_uInt32 nTimeout) // in an intelligent manner :-) sal_Int32 nTime = nTimeout; - while(true) + while(!Application::IsQuit()) { // SAFE -> ------------------------------ { diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index bfa92cf88321..1f4dff193024 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -455,6 +455,10 @@ public: */ static void Quit(); + /** Has Quit() been called? + */ + static bool IsQuit(); + /** Attempt to process current pending event(s) It doesn't sleep if no events are available for processing. diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index ac92e96d6e41..33605a09fc3f 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -328,7 +328,7 @@ void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVect } // coverity[loop_top] - this isn't an infinite loop where nSheetsLeft gets decremented by the above threads - while( nSheetsLeft > 0) + while( nSheetsLeft > 0 && !Application::IsQuit()) { // This is a much more controlled re-enterancy hazard than // allowing a yield deeper inside the filter code for progress diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx index 59865fb2b8eb..631c06bd0713 100644 --- a/sfx2/source/doc/docfile.cxx +++ b/sfx2/source/doc/docfile.cxx @@ -2731,7 +2731,7 @@ void SfxMedium::Download( const Link<void*,void>& aLink ) GetInStream(); if ( pImpl->m_pInStream && !aLink.IsSet() ) { - while( !pImpl->bDownloadDone ) + while( !pImpl->bDownloadDone && !Application::IsQuit()) Application::Yield(); } } diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index 09d1c506522c..729aab620f11 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -429,7 +429,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > //wait until printing is done SfxPrinter* pDocPrinter = pViewSh->GetPrinter(); - while ( pDocPrinter->IsPrinting() ) + while ( pDocPrinter->IsPrinting() && !Application::IsQuit()) Application::Yield(); } @@ -485,7 +485,7 @@ class ImplUCBPrintWatcher : public ::osl::Thread /* SAFE { */ { SolarMutexGuard aGuard; - while( m_pPrinter->IsPrinting() ) + while( m_pPrinter->IsPrinting() && !Application::IsQuit()) Application::Yield(); m_pPrinter.clear(); // don't delete it! It's borrowed only :-) } diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index f8f7c61fc2d1..7ba2d0c9dcfa 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -713,7 +713,7 @@ short RecoveryDialog::execute() m_pCore->doRecovery(); m_bWaitForCore = true; - while(m_bWaitForCore) + while(m_bWaitForCore && !Application::IsQuit()) Application::Yield(); m_pCore->setUpdateListener(nullptr); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index fb6706b0ba82..d88ea837aa6b 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -1612,7 +1612,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, "sw::SwDBManager aEmailDispatcherPollTimer" ); aEmailDispatcherPollTimer.SetTimeout( 500 ); aEmailDispatcherPollTimer.Start(); - while( IsMergeOk() && m_pImpl->m_xLastMessage.is() ) + while( IsMergeOk() && m_pImpl->m_xLastMessage.is() && !Application::IsQuit()) Application::Yield(); aEmailDispatcherPollTimer.Stop(); } diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index d47dbb01bdd6..73e7b0b5ac52 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -437,7 +437,7 @@ void PrintPreviewHelper( const css::uno::Any& /*EnableChanges*/, SfxViewShell co void WaitUntilPreviewIsClosed( SfxViewFrame* pViewFrame ) { - while ( pViewFrame && isInPrintPreview( pViewFrame ) ) + while ( pViewFrame && isInPrintPreview( pViewFrame ) && !Application::IsQuit()) Application::Yield(); } diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 332075cccd93..2494bfcaf92e 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -577,6 +577,11 @@ bool Application::IsInExecute() return ImplGetSVData()->maAppData.mbInAppExecute; } +bool Application::IsQuit() +{ + return ImplGetSVData()->maAppData.mbAppQuit; +} + bool Application::IsInModalMode() { return (ImplGetSVData()->maAppData.mnModalMode != 0); diff --git a/vcl/source/control/prgsbar.cxx b/vcl/source/control/prgsbar.cxx index e861d66bcb03..ef8d2867018a 100644 --- a/vcl/source/control/prgsbar.cxx +++ b/vcl/source/control/prgsbar.cxx @@ -182,7 +182,7 @@ void ProgressBar::SetValue( sal_uInt16 nNewPercent ) Idle aIdle("ProgressBar::SetValue aIdle"); aIdle.SetPriority(TaskPriority::POST_PAINT); aIdle.Start(); - while (aIdle.IsActive()) + while (aIdle.IsActive() && !Application::IsQuit()) { Application::Yield(); } diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 92528597e476..21f875fd7fc2 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1041,7 +1041,7 @@ short Dialog::Execute() // Yield util EndDialog is called or dialog gets destroyed // (the latter should not happen, but better safe than sorry - while ( !xWindow->IsDisposed() && mbInExecute ) + while ( !xWindow->IsDisposed() && mbInExecute && !Application::IsQuit() ) Application::Yield(); ImplEndExecuteModal(); diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index cfcb58b8f63e..dd1e2c6ea557 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -455,7 +455,7 @@ void MenuFloatingWindow::Execute() Start(); - while (bInExecute) + while (bInExecute && !Application::IsQuit()) Application::Yield(); pSVData->maAppData.mpActivePopupMenu = nullptr; diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 04139f454881..2d5ce380dca0 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -1197,7 +1197,7 @@ void SystemWindow::ensureRepaint() Invalidate(); mbPaintComplete = false; - while (!mbPaintComplete) + while (!mbPaintComplete && !Application::IsQuit()) { Application::Yield(); } commit 636aeaea41de1f494e0741b3d4e72bb5464edf26 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Wed Mar 17 07:35:39 2021 -0400 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 15:52:32 2021 +0100 lok: fix the empty script node type container without "+" symbol expander According to description in https://bz.apache.org/ooo/show_bug.cgi?id=30923 "In this case I think it's an acceptable solution to display a '+' symbol for all library nodes, and if a library has no children and the user clicks on the '+' symbol, the '+' will disappear". Unfortunately this behaviour is not well driven for final users' client side, so they misinterpret as a bug. After tracing the method hasChildNodes(), the log result indicates that this method does not load the libraries, but it is necessary to iterate applying the method getChildNodes(), which will cause to load all libraries and determine if the child has a script CONTAINER node type to assign the '+' symbol. Also, I have traced the loading libraries when the Macro Selector dialog pops up and the result it load once, so I do not think it is a problem loading a small finite number of libraries today. Change-Id: I4ae5395b6afa7b7d6ff2b2ec692771e93c46c529 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112636 Reviewed-by: Pedro Silva <pedro.si...@collabora.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113693 Tested-by: Jenkins Reviewed-by: Henry Castro <hcas...@collabora.com> diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index 82e9f32a988d..2c53feab0c30 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -505,7 +505,7 @@ void CuiConfigGroupListBox::InitModule() } void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode, - const weld::TreeIter* pParentEntry, bool bCheapChildrenOnDemand) + const weld::TreeIter* pParentEntry) { try { if ( xRootNode->hasChildNodes() ) @@ -567,7 +567,8 @@ void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::scrip theChild->acquire(); bool bChildOnDemand = false; - if ( !bCheapChildrenOnDemand && theChild->hasChildNodes() ) + + if ( theChild->hasChildNodes() ) { const Sequence< Reference< browse::XBrowseNode > > grandchildren = theChild->getChildNodes(); @@ -581,14 +582,6 @@ void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::scrip } } } - else - { - /* i30923 - Would be nice if there was a better - * way to determine if a basic lib had children - * without having to ask for them (which forces - * the library to be loaded */ - bChildOnDemand = true; - } OUString aImage = GetImage(theChild, m_xContext, bIsRootNode); @@ -678,7 +671,7 @@ void CuiConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent { //We are only showing scripts not slot APIs so skip //Root node and show location nodes - FillScriptList(rootNode, nullptr, false); + FillScriptList(rootNode, nullptr); } } @@ -965,7 +958,7 @@ IMPL_LINK(CuiConfigGroupListBox, ExpandingHdl, const weld::TreeIter&, rIter, boo { Reference< browse::XBrowseNode > rootNode( static_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ; - FillScriptList(rootNode, &rIter, true /* i30923 */ ); + FillScriptList(rootNode, &rIter); } break; } diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx index c4d50e2aeb12..5959658e84a5 100644 --- a/cui/source/inc/cfgutil.hxx +++ b/cui/source/inc/cfgutil.hxx @@ -200,7 +200,7 @@ class CuiConfigGroupListBox void InitModule(); void FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode, - const weld::TreeIter* pParentEntry, bool bCheapChildrenOnDemand); + const weld::TreeIter* pParentEntry); void FillFunctionsList(const css::uno::Sequence< css::frame::DispatchInformation >& xCommands); OUString MapCommand2UIName(const OUString& sCommand); commit dd068dd910c8ca78e9145304ae240861eab95928 Author: Pedro Pinto Silva <pedro.si...@collabora.com> AuthorDate: Tue Mar 9 13:50:42 2021 +0100 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 15:51:52 2021 +0100 Macro Selector dialog: Remove extra padding and shadow + Remove extra left padding so everything is properly aligned - No need for extra padding to convey hierarchy we already have headings and vertical space to convey grouping + Description: Remove extra shadow from the scrolledwindow - To avoid giving the fall sense of interactivity since it's meant to be solely an element to display text and an outline around can suggest waiting for some input/selection Signed-off-by: Pedro Pinto Silva <pedro.si...@collabora.com> Change-Id: Ibbfac39cc46da9c9e91cdaca1a97c84d8a3cd8fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112203 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/cui/uiconfig/ui/macroselectordialog.ui b/cui/uiconfig/ui/macroselectordialog.ui index 8dc73a8c7755..ec3f0014ef2a 100644 --- a/cui/uiconfig/ui/macroselectordialog.ui +++ b/cui/uiconfig/ui/macroselectordialog.ui @@ -179,7 +179,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="top_padding">6</property> - <property name="left_padding">12</property> <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> @@ -281,7 +280,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="top_padding">6</property> - <property name="left_padding">12</property> <child> <object class="GtkScrolledWindow"> <property name="visible">True</property> @@ -384,7 +382,6 @@ <property name="visible">True</property> <property name="can_focus">False</property> <property name="top_padding">6</property> - <property name="left_padding">12</property> <child> <object class="GtkScrolledWindow" id="scrolledwindow1"> <property name="height_request">100</property> @@ -392,7 +389,6 @@ <property name="can_focus">True</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="shadow_type">in</property> <child> <object class="GtkTextView" id="description"> <property name="visible">True</property> commit c00215413afb9f3ba99e5aedff08269d8434728d Author: Henry Castro <hcas...@collabora.com> AuthorDate: Fri Dec 4 17:34:48 2020 -0400 Commit: Michael Meeks <michael.me...@collabora.com> CommitDate: Sat Apr 10 15:51:14 2021 +0100 lok: run async the Macro Selector Dialog Required to be called by the client side Change-Id: I9c9d22dd249839009bdc6a701553f3b9d776347a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107246 Tested-by: Jenkins Reviewed-by: Henry Castro <hcas...@collabora.com> diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx index f1c5ccef7221..82e9f32a988d 100644 --- a/cui/source/customize/cfgutil.cxx +++ b/cui/source/customize/cfgutil.cxx @@ -42,6 +42,7 @@ #include <sfx2/minfitem.hxx> #include <comphelper/SetFlagContextHelper.hxx> #include <comphelper/documentinfo.hxx> +#include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/sequenceashashmap.hxx> #include <svtools/imagemgr.hxx> diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index e43b027602c4..d10914440db5 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -145,6 +145,11 @@ short AbstractTitleDialog_Impl::Execute() return m_xDlg->run(); } +bool AbstractScriptSelectorDialog_Impl::StartExecuteAsync(AsyncContext &rCtx) +{ + return SfxDialogController::runAsync(m_xDlg, rCtx.maEndDialogFn); +} + short AbstractScriptSelectorDialog_Impl::Execute() { return m_xDlg->run(); @@ -1113,7 +1118,7 @@ void AbstractDialogFactory_Impl::ShowAsyncScriptErrorDialog(weld::Window* pParen VclPtr<AbstractScriptSelectorDialog> AbstractDialogFactory_Impl::CreateScriptSelectorDialog(weld::Window* pParent, const Reference<frame::XFrame>& rxFrame) { - return VclPtr<AbstractScriptSelectorDialog_Impl>::Create(std::make_unique<SvxScriptSelectorDialog>(pParent, rxFrame)); + return VclPtr<AbstractScriptSelectorDialog_Impl>::Create(std::make_shared<SvxScriptSelectorDialog>(pParent, rxFrame)); } OUString AbstractScriptSelectorDialog_Impl::GetScriptURL() const diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index a9d521708f5d..87ad9730b307 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -283,13 +283,14 @@ public: class SvxScriptSelectorDialog; class AbstractScriptSelectorDialog_Impl : public AbstractScriptSelectorDialog { - std::unique_ptr<SvxScriptSelectorDialog> m_xDlg; + std::shared_ptr<SvxScriptSelectorDialog> m_xDlg; public: - explicit AbstractScriptSelectorDialog_Impl(std::unique_ptr<SvxScriptSelectorDialog> p) + explicit AbstractScriptSelectorDialog_Impl(std::shared_ptr<SvxScriptSelectorDialog> p) : m_xDlg(std::move(p)) { } virtual short Execute() override; + virtual bool StartExecuteAsync(AsyncContext &rCtx) override; virtual OUString GetScriptURL() const override; virtual void SetRunLabel() override; }; diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 061c7608f7c0..78e23aeb372a 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -1481,32 +1481,37 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) do // artificial loop for flow control { - ScopedVclPtr<AbstractScriptSelectorDialog> pDlg(pFact->CreateScriptSelectorDialog(lcl_getDialogParent(xFrame), xFrame)); + VclPtr<AbstractScriptSelectorDialog> pDlg(pFact->CreateScriptSelectorDialog(lcl_getDialogParent(xFrame), xFrame)); OSL_ENSURE( pDlg, "SfxApplication::OfaExec_Impl( SID_RUNMACRO ): no dialog!" ); if ( !pDlg ) break; pDlg->SetRunLabel(); - short nDialogResult = pDlg->Execute(); - if ( !nDialogResult ) - break; + pDlg->StartExecuteAsync([pDlg, xFrame](sal_Int32 nDialogResult) { + if ( !nDialogResult ) + { + pDlg->disposeOnce(); + return; + } - Sequence< Any > args; - Sequence< sal_Int16 > outIndex; - Sequence< Any > outArgs; - Any ret; + Sequence< Any > args; + Sequence< sal_Int16 > outIndex; + Sequence< Any > outArgs; + Any ret; - Reference< XInterface > xScriptContext; + Reference< XInterface > xScriptContext; - Reference< XController > xController; - if ( xFrame.is() ) - xController = xFrame->getController(); - if ( xController.is() ) - xScriptContext = xController->getModel(); - if ( !xScriptContext.is() ) - xScriptContext = xController; + Reference< XController > xController; + if ( xFrame.is() ) + xController = xFrame->getController(); + if ( xController.is() ) + xScriptContext = xController->getModel(); + if ( !xScriptContext.is() ) + xScriptContext = xController; - SfxObjectShell::CallXScript( xScriptContext, pDlg->GetScriptURL(), args, ret, outIndex, outArgs ); + SfxObjectShell::CallXScript( xScriptContext, pDlg->GetScriptURL(), args, ret, outIndex, outArgs ); + pDlg->disposeOnce(); + }); } while ( false ); rReq.Done(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits