[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 17 commits - basctl/source basic/source cui/source cui/uiconfig desktop/source fpicker/source framework/source include/vcl sc/sdi sc
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 AuthorDate: Thu Feb 25 11:41:24 2021 +0300 Commit: Michael Meeks CommitDate: Sat Apr 10 16:20:49 2021 +0100 Init Notebookbar for Online Draw Signed-off-by: mert 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 AuthorDate: Wed Feb 24 06:22:49 2021 +0300 Commit: Michael Meeks CommitDate: Sat Apr 10 16:20:49 2021 +0100 Fix chart sub element rectangle and handle positions Change-Id: I486b542ae0bb4a987c98d92c1866895eafcf620c Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111440 Tested-by: Jenkins CollaboraOffice 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 =
[Libreoffice-commits] core.git: include/svx sd/source svx/source
include/svx/svdedtv.hxx|6 +- sd/source/ui/func/futransf.cxx | 13 - svx/source/svdraw/svdedtv1.cxx |8 +++- 3 files changed, 20 insertions(+), 7 deletions(-) New commits: commit 2246b6a2887b90efc712c4479b19609cf9307a3d Author: mert AuthorDate: Thu Mar 4 12:17:27 2021 +0300 Commit: Mert Tumer CommitDate: Fri Mar 12 04:36:28 2021 +0100 Fix wrong position on move when page has margin Change-Id: I9ac2d9914b86210ca2148b44488c2c70cc5870d4 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111949 Reviewed-by: Miklos Vajna Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111929 Tested-by: Jenkins diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index 916fdaeb186b..eb815b728cb3 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -304,7 +304,11 @@ public: // geometrical attribute (position, size, rotation angle) // A PageOrigin set at a position is taken into account. SfxItemSet GetGeoAttrFromMarked() const; -void SetGeoAttrToMarked(const SfxItemSet& rAttr); +// In LOK, interactive shape movement uses this function +// in that case, margin is not taken into account +// and the final position of the shape becomes incorrect +// However, "Position and Size" dialog and other cases already add the margins. +void SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin = false); // Returns NULL if: // - nothing is marked, diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx index fa7398e48b43..6c07e0e70be6 100644 --- a/sd/source/ui/func/futransf.cxx +++ b/sd/source/ui/func/futransf.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -48,14 +49,13 @@ rtl::Reference FuTransform::Create( ViewShell* pViewSh, ::sd::Window* pW namespace { -void setUndo(::sd::View* pView, const SfxItemSet* pArgs) +void setUndo(::sd::View* pView, const SfxItemSet* pArgs, bool addPageMargin) { // Undo OUString aString = pView->GetDescriptionOfMarkedObjects() + " " + SdResId(STR_TRANSFORM); pView->BegUndo(aString); - -pView->SetGeoAttrToMarked(*pArgs); +pView->SetGeoAttrToMarked(*pArgs, addPageMargin); pView->SetAttributes(*pArgs); pView->EndUndo(); } @@ -71,7 +71,9 @@ void FuTransform::DoExecute( SfxRequest& rReq ) if (pArgs) { -setUndo(mpView, pArgs); +// If this comes from LOK, that means the shape is moved by mouse +// only then pArgs is pre-set. +setUndo(mpView, pArgs, comphelper::LibreOfficeKit::isActive()); return; } @@ -115,7 +117,8 @@ void FuTransform::DoExecute( SfxRequest& rReq ) if (nResult == RET_OK) { pRequest->Done(*(pDlg->GetOutputItemSet())); -setUndo(mpView, pRequest->GetArgs()); +// Page margin is already calculated at this point. +setUndo(mpView, pRequest->GetArgs(), false); } // deferred until the dialog ends diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index f2128824b6fa..5b17b8852462 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1512,7 +1512,7 @@ static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP) return Point(); // Should not happen! } -void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) +void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin) { const bool bTiledRendering = comphelper::LibreOfficeKit::isActive(); @@ -1520,6 +1520,12 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) if(GetSdrPageView()) { +if (addPageMargin) +{ +SdrPage * pPage = GetSdrPageView()->GetPage(); +Point upperLeft(pPage->GetLeftBorder(), pPage->GetUpperBorder()); +aRect.Move(upperLeft.getX(), upperLeft.getY()); +} GetSdrPageView()->LogicToPagePos(aRect); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sd/source
sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 3d3e0e5941641757defc8df5e110387b8efbb0e5 Author: mert AuthorDate: Wed Mar 3 06:13:21 2021 +0300 Commit: Mert Tumer CommitDate: Wed Mar 10 09:24:52 2021 +0100 Draw: Fix crash on multiple page selection on slidesorter Change-Id: Id7461b811d3445df895cf751153bd0dd81f09efc Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111864 Reviewed-by: Jan Holesovsky Tested-by: Jenkins CollaboraOffice (cherry picked from commit 505965dd5d05e4711bf5b433b8af06e88e030962) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111917 Tested-by: Jenkins diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 60bc5fadec77..1780554f74e9 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -218,6 +218,7 @@ SlideSorterViewShell* SlideSorterViewShell::GetSlideSorter (ViewShellBase& rBase FrameworkHelper::msCenterPaneURL, FrameworkHelper::msFullScreenPaneURL, FrameworkHelper::msLeftImpressPaneURL, +FrameworkHelper::msLeftDrawPaneURL, OUString()}; try ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/svx sd/source svx/source
include/svx/svdedtv.hxx|6 +- sd/source/ui/func/futransf.cxx | 13 - svx/source/svdraw/svdedtv1.cxx |8 +++- 3 files changed, 20 insertions(+), 7 deletions(-) New commits: commit 206c5b374eb56ef1674bb0dbd0d199d2761ea469 Author: mert AuthorDate: Thu Mar 4 12:17:27 2021 +0300 Commit: Mert Tumer CommitDate: Tue Mar 9 09:37:31 2021 +0100 Fix wrong position on move when page has margin Change-Id: I9ac2d9914b86210ca2148b44488c2c70cc5870d4 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111949 Reviewed-by: Miklos Vajna Tested-by: Jenkins CollaboraOffice diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index 973a28cd1b9e..4351ccee2764 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -305,7 +305,11 @@ public: // geometrical attribute (position, size, rotation angle) // A PageOrigin set at a position is taken into account. SfxItemSet GetGeoAttrFromMarked() const; -void SetGeoAttrToMarked(const SfxItemSet& rAttr); +// In LOK, interactive shape movement uses this function +// in that case, margin is not taken into account +// and the final position of the shape becomes incorrect +// However, "Position and Size" dialog and other cases already add the margins. +void SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin = false); // Returns NULL if: // - nothing is marked, diff --git a/sd/source/ui/func/futransf.cxx b/sd/source/ui/func/futransf.cxx index 96a805040cb9..a0dc99664c3f 100644 --- a/sd/source/ui/func/futransf.cxx +++ b/sd/source/ui/func/futransf.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -48,14 +49,13 @@ rtl::Reference FuTransform::Create( ViewShell* pViewSh, ::sd::Window* pW namespace { -void setUndo(::sd::View* pView, const SfxItemSet* pArgs) +void setUndo(::sd::View* pView, const SfxItemSet* pArgs, bool addPageMargin) { // Undo OUString aString = pView->GetDescriptionOfMarkedObjects() + " " + SdResId(STR_TRANSFORM); pView->BegUndo(aString); - -pView->SetGeoAttrToMarked(*pArgs); +pView->SetGeoAttrToMarked(*pArgs, addPageMargin); pView->SetAttributes(*pArgs); pView->EndUndo(); } @@ -71,7 +71,9 @@ void FuTransform::DoExecute( SfxRequest& rReq ) if (pArgs) { -setUndo(mpView, pArgs); +// If this comes from LOK, that means the shape is moved by mouse +// only then pArgs is pre-set. +setUndo(mpView, pArgs, comphelper::LibreOfficeKit::isActive()); return; } @@ -116,7 +118,8 @@ void FuTransform::DoExecute( SfxRequest& rReq ) if (nResult == RET_OK) { pRequest->Done(*(pDlg->GetOutputItemSet())); -setUndo(mpView, pRequest->GetArgs()); +// Page margin is already calculated at this point. +setUndo(mpView, pRequest->GetArgs(), false); } // deferred until the dialog ends diff --git a/svx/source/svdraw/svdedtv1.cxx b/svx/source/svdraw/svdedtv1.cxx index cf29f4a268df..830ef238c590 100644 --- a/svx/source/svdraw/svdedtv1.cxx +++ b/svx/source/svdraw/svdedtv1.cxx @@ -1534,7 +1534,7 @@ static Point ImpGetPoint(const tools::Rectangle& rRect, RectPoint eRP) return Point(); // Should not happen! } -void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) +void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr, bool addPageMargin) { const bool bTiledRendering = comphelper::LibreOfficeKit::isActive(); @@ -1542,6 +1542,12 @@ void SdrEditView::SetGeoAttrToMarked(const SfxItemSet& rAttr) if(GetSdrPageView()) { +if (addPageMargin) +{ +SdrPage * pPage = GetSdrPageView()->GetPage(); +Point upperLeft(pPage->GetLeftBorder(), pPage->GetUpperBorder()); +aRect.Move(upperLeft.getX(), upperLeft.getY()); +} GetSdrPageView()->LogicToPagePos(aRect); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdview.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit c10955a4617c3ce3c329083109ac7c7be514da8f Author: mert AuthorDate: Mon Mar 1 06:00:11 2021 +0300 Commit: Mert Tumer CommitDate: Thu Mar 4 04:35:55 2021 +0100 Fix crash while moving handle when shape text is active Change-Id: Ie21398917bc204245837215f1eade78e11c61890 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111726 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111740 Tested-by: Jenkins diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 6e26091a8e43..f2d36bbf5f4e 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1409,6 +1409,9 @@ bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark) bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint) { +if (GetHdlList().IsMoveOutside()) +return false; + if (!GetMarkedObjectList().GetMarkCount()) return false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: desktop/source vcl/source
desktop/source/lib/init.cxx|1 + vcl/source/control/notebookbar.cxx |3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit 94958cc478d9f97b33bc0da654b7bd19c3c99eea Author: mert AuthorDate: Thu Feb 25 11:41:24 2021 +0300 Commit: Mert Tumer CommitDate: Thu Mar 4 04:35:30 2021 +0100 Init Notebookbar for Online Draw Signed-off-by: mert 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 2b56bdb2112d..5701f5965ce2 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -6382,6 +6382,7 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char activateNotebookbar(u"Writer"); activateNotebookbar(u"Calc"); activateNotebookbar(u"Impress"); +activateNotebookbar(u"Draw"); } return bInitialized; diff --git a/vcl/source/control/notebookbar.cxx b/vcl/source/control/notebookbar.cxx index 8506ce965273..f7b58dfc3416 100644 --- a/vcl/source/control/notebookbar.cxx +++ b/vcl/source/control/notebookbar.cxx @@ -75,7 +75,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; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 505965dd5d05e4711bf5b433b8af06e88e030962 Author: mert AuthorDate: Wed Mar 3 06:13:21 2021 +0300 Commit: Mert Tumer CommitDate: Wed Mar 3 13:58:48 2021 +0100 Draw: Fix crash on multiple page selection on slidesorter Change-Id: Id7461b811d3445df895cf751153bd0dd81f09efc Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111864 Reviewed-by: Jan Holesovsky Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx index 82d3e50371eb..3edf068e9adb 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterViewShell.cxx @@ -215,6 +215,7 @@ SlideSorterViewShell* SlideSorterViewShell::GetSlideSorter (ViewShellBase& rBase FrameworkHelper::msCenterPaneURL, FrameworkHelper::msFullScreenPaneURL, FrameworkHelper::msLeftImpressPaneURL, +FrameworkHelper::msLeftDrawPaneURL, OUString()}; try ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdmrkv.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit b4adac8edd0f89a83905a567ba6c13e3ba18838b Author: mert AuthorDate: Wed Feb 24 06:22:49 2021 +0300 Commit: Mert Tumer CommitDate: Wed Mar 3 08:42:38 2021 +0100 Fix chart sub element rectangle and handle positions Change-Id: I486b542ae0bb4a987c98d92c1866895eafcf620c Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111440 Tested-by: Jenkins CollaboraOffice 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 8c1ec40dce92..216d2c043709 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()); } } @@ -858,8 +859,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((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()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sfx2/source
sfx2/source/view/lokhelper.cxx | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) New commits: commit a434f5d2d4ff4991937b57e521782ad3594aa370 Author: mert AuthorDate: Mon Feb 22 11:17:27 2021 +0300 Commit: Mert Tumer CommitDate: Wed Mar 3 08:42:09 2021 +0100 Fix non-valid json generation on NotifyOtherViews Change-Id: I82aa0aefcd1de14b4c1bb2bbe3f087b60d691beb Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111299 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111515 Tested-by: Jenkins diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index cdd6030a7c8f..2a5ea882d92d 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -308,7 +308,11 @@ void SfxLokHelper::setDeviceFormFactor(std::u16string_view rDeviceFormFactor) g_deviceFormFactor = LOKDeviceFormFactor::UNKNOWN; } -static OString lcl_escapeQuotes(const OString ) +/* +* Used for putting a whole JSON string into a string value +* e.g { key: "{JSON}" } +*/ +static OString lcl_sanitizeJSONAsValue(const OString ) { if (rStr.getLength() < 1) return rStr; @@ -318,7 +322,9 @@ static OString lcl_escapeQuotes(const OString ) { if (rStr[i] == '"' || rStr[i] == '\\') aBuf.append('\\'); -aBuf.append(rStr[i]); + +if (rStr[i] != '\n') +aBuf.append(rStr[i]); } return aBuf.makeStringAndClear(); } @@ -341,7 +347,7 @@ static inline OString lcl_generateJSON(const SfxViewShell* pView, std::string_vi assert(pView != nullptr && "pView must be valid"); return OStringLiteral("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView(pView)) + "\", \"part\": \"" + OString::number(pView->getPart()) + "\", \"" + rKey + "\": \"" - + lcl_escapeQuotes(rPayload) + "\" }"; + + lcl_sanitizeJSONAsValue(rPayload) + "\" }"; } void SfxLokHelper::notifyOtherView(const SfxViewShell* pThisView, SfxViewShell const* pOtherView, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sc/sdi sc/source
sc/sdi/drawsh.sdi|2 +- sc/source/ui/drawfunc/drawsh.cxx | 17 + 2 files changed, 18 insertions(+), 1 deletion(-) New commits: commit 62c2e238fba7d926f4a05f52c185f9e727dd903f Author: mert AuthorDate: Fri Feb 19 11:15:02 2021 +0300 Commit: Mert Tumer CommitDate: Tue Mar 2 08:28:12 2021 +0100 Implemented MoveShapeHandle uno command for sc Change-Id: I5f81348cd778d7fbcb3b4e721fbf0412c4f5753d Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95 Tested-by: Jenkins CollaboraOffice 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 60d3b2114e29..90bf9f8e51cd 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -58,6 +58,7 @@ #include #include #include +#include SFX_IMPL_INTERFACE(ScDrawShell, SfxShell) @@ -201,6 +202,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(FN_PARAM_1); +const SfxUInt32Item* newPosXTwips = rReq.GetArg(FN_PARAM_2); +const SfxUInt32Item* newPosYTwips = rReq.GetArg(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: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdmrkv.cxx |9 ++--- svx/source/svdraw/svdoedge.cxx |2 +- 2 files changed, 7 insertions(+), 4 deletions(-) New commits: commit 275377505f474ef54c50ec86b06c9b9435756913 Author: mert AuthorDate: Fri Feb 19 09:55:12 2021 +0300 Commit: Mert Tumer CommitDate: Tue Mar 2 08:27:48 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 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93 Tested-by: Jenkins CollaboraOffice 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 fbeeb8fda859..8c1ec40dce92 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -892,6 +892,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); @@ -901,8 +902,11 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S child.put("id", pHdl->GetObjHdlNum()); child.put("kind", kind); child.put("pointer", static_cast(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; @@ -932,7 +936,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 de697372d120..2eafff7605fc 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -2141,7 +2141,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); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sw/sdi sw/source
sw/sdi/_viewsh.sdi |5 + sw/sdi/drawsh.sdi |5 + sw/source/uibase/shells/drawsh.cxx | 16 +++- sw/source/uibase/uiview/view2.cxx | 18 ++ 4 files changed, 43 insertions(+), 1 deletion(-) New commits: commit 9e7e616a9c3363cf06801a1974711c4dcef97476 Author: mert AuthorDate: Fri Feb 19 09:37:19 2021 +0300 Commit: Mert Tumer CommitDate: Tue Mar 2 08:27:34 2021 +0100 Implemented MoveShapeHandle uno command for sw Change-Id: I9feccc4fa1a4d7426609afa474f87ab12c769090 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92 Tested-by: Jenkins CollaboraOffice 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 7b11d4064d1f..f55496ee26a4 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -976,5 +976,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 09b6bdbb3a0d..7589507511a9 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -197,7 +197,21 @@ void SwDrawShell::Execute(SfxRequest ) GetView().FlipDrawRotate(); } break; - +case SID_MOVE_SHAPE_HANDLE: +{ +if (pArgs && pArgs->Count() == 3) +{ +const SfxUInt32Item* handleNumItem = rReq.GetArg(FN_PARAM_1); +const SfxUInt32Item* newPosXTwips = rReq.GetArg(FN_PARAM_2); +const SfxUInt32Item* newPosYTwips = rReq.GetArg(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 e76fc2f30e41..1946f6a3a02d 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1348,6 +1348,24 @@ void SwView::Execute(SfxRequest ) 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(FN_PARAM_1); +const SfxUInt32Item* newPosXTwips = rReq.GetArg(FN_PARAM_2); +const SfxUInt32Item* newPosYTwips = rReq.GetArg(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"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdoedge.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit dd5fe1b7602e0b772b3ddc188eb4d1fdfcd519cb Author: mert AuthorDate: Wed Feb 17 09:12:25 2021 +0300 Commit: Mert Tumer CommitDate: Mon Mar 1 14:20:06 2021 +0100 Fix connectors cannot select a glue point Change-Id: I6b6d2dad27910ac6d5de43e9d0992e3565f5be5e Signed-off-by: mert 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 47c012c7c36e..de697372d120 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -43,6 +43,7 @@ #include #include #include +#include void SdrObjConnection::ResetVars() { @@ -2140,7 +2141,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()) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdmrkv.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a889bca4a1912da1e402181d8acd6ef7683e2f53 Author: mert AuthorDate: Mon Feb 8 10:31:38 2021 +0300 Commit: Mert Tumer CommitDate: Mon Mar 1 13:30:41 2021 +0100 Exclude table selection from handle message Change-Id: Ic079c2d59040c8b6d714af3932d5294c2060edc0 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110548 Tested-by: Jenkins CollaboraOffice 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 fb8fbc0ec4db..fbeeb8fda859 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -884,7 +884,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; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: sd/source
sd/source/ui/func/fuconstr.cxx |6 -- sd/source/ui/func/fusel.cxx|1 + 2 files changed, 5 insertions(+), 2 deletions(-) New commits: commit 5a42461bff290d19309e0109b54a7f63cd06c40d Author: mert AuthorDate: Thu Feb 4 10:37:03 2021 +0300 Commit: Mert Tumer CommitDate: Mon Mar 1 13:30:22 2021 +0100 LOK: disable rotation mode on selection of shape Change-Id: Iff0ed673ae1c61ff0d753cf3a1f871213f8b3a7d Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110399 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111509 Tested-by: Jenkins diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index 7bf915055b4b..ca248d808840 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -39,6 +39,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -187,9 +188,10 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); } -if (mpView->GetDragMode() == SdrDragMode::Move && mpView->IsRotateAllowed() && +const bool bTiledRendering = comphelper::LibreOfficeKit::isActive(); +if (!bTiledRendering && (mpView->GetDragMode() == SdrDragMode::Move && mpView->IsRotateAllowed() && (mpViewShell->GetFrameView()->IsClickChangeRotation() || - (pSingleObj && pSingleObj->GetObjInventor()==SdrInventor::E3d))) + (pSingleObj && pSingleObj->GetObjInventor()==SdrInventor::E3d { mpView->SetDragMode(SdrDragMode::Rotate); } diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index fbcd7ada5c53..138978339afb 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -707,6 +707,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) } if (nSlotId == SID_OBJECT_SELECT +&& !comphelper::LibreOfficeKit::isActive() && mpView->IsRotateAllowed() && (rMEvt.GetClicks() != 2) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx sd/sdi sd/source svx/sdi
include/svx/svxids.hrc |5 - sd/sdi/_drvwsh.sdi |5 - sd/source/ui/view/drviews2.cxx | 17 + svx/sdi/svx.sdi| 17 + 4 files changed, 42 insertions(+), 2 deletions(-) New commits: commit 66f18f543316ee718d5ab454b51fae9f301673f5 Author: mert AuthorDate: Thu Jan 28 07:19:07 2021 +0300 Commit: Mert Tumer CommitDate: Mon Mar 1 13:05:52 2021 +0100 Added .uno:MoveShapeHandle uno command This is now only available for Draw/Presentation It will allow interactive dragging/resizing operations via the command. Later it will be implemented for other modules too. Change-Id: Iaed7d25cf4035591083e779c13a6f0227a3b564f Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110041 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111508 Tested-by: Jenkins diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 844b23db5cf3..7b2b802bf8f1 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -1027,8 +1027,11 @@ class SdrAngleItem; #define SID_ULINE_VAL_DOUBLE(SID_SVX_START + 1197) /* double underline */ #define SID_ULINE_VAL_DOTTED(SID_SVX_START + 1198) /* dotted underline */ +#define SID_MOVE_SHAPE_HANDLE ( SID_SVX_START + 1199 ) + // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id -#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1198 + 1 ) +#define SID_SVX_FIRSTFREE ( SID_SVX_START + 1199 + 1 ) + // Overflow check for slot IDs #if SID_SVX_FIRSTFREE > SID_SVX_END diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index 683e52888635..90e37f7f52fe 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -2918,5 +2918,8 @@ interface DrawView ExecMethod = FuTemporary; StateMethod = GetAttrState; ] - +SID_MOVE_SHAPE_HANDLE +[ +ExecMethod = FuTemporary ; +] } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index d60ebb701298..85feaa826954 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -88,6 +88,7 @@ #include #include +#include #include @@ -1489,7 +1490,23 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } } break; +case SID_MOVE_SHAPE_HANDLE: +{ +const SfxItemSet *pArgs = rReq.GetArgs (); +if (pArgs && pArgs->Count () == 3) +{ +const SfxUInt32Item* handleNumItem = rReq.GetArg(FN_PARAM_1); +const SfxUInt32Item* newPosXTwips = rReq.GetArg(FN_PARAM_2); +const SfxUInt32Item* newPosYTwips = rReq.GetArg(FN_PARAM_3); +const sal_uLong handleNum = handleNumItem->GetValue(); +const sal_uLong newPosX = convertTwipToMm100(newPosXTwips->GetValue()); +const sal_uLong newPosY = convertTwipToMm100(newPosYTwips->GetValue()); +mpDrawView->MoveShapeHandle(handleNum, Point(newPosX, newPosY)); +Cancel(); +} +break; +} case SID_CHAR_DLG_EFFECT: case SID_CHAR_DLG: // BASIC { diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index f66c0a193c13..028e9bdee170 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -12513,3 +12513,20 @@ SdrMetricItem SoftEdgeRadius SID_ATTR_SOFTEDGE_RADIUS ToolBoxConfig = FALSE, GroupId = SfxGroupId::Document; ] + +SfxVoidItem MoveShapeHandle SID_MOVE_SHAPE_HANDLE +(SfxUInt32Item HandleNum FN_PARAM_1 SfxUInt32Item NewPosX FN_PARAM_2 SfxUInt32Item NewPosY FN_PARAM_3) +[ +AutoUpdate = FALSE, +FastCall = TRUE, +ReadOnlyDoc = FALSE, +Toggle = FALSE, +Container = FALSE, +RecordAbsolute = FALSE, +RecordPerSet; + +AccelConfig = FALSE, +MenuConfig = FALSE, +ToolBoxConfig = FALSE, +GroupId = SfxGroupId::Format; +] ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - svx/source
svx/source/svdraw/svdview.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 7ca91edcb5e6f2fd744d15cdb67800eb99b19504 Author: mert AuthorDate: Mon Mar 1 06:00:11 2021 +0300 Commit: Mert Tumer CommitDate: Mon Mar 1 11:28:28 2021 +0100 Fix crash while moving handle when shape text is active Change-Id: Ie21398917bc204245837215f1eade78e11c61890 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111726 Tested-by: Jenkins CollaboraOffice diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 27b1c67c6551..394b3af6bd06 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1428,6 +1428,9 @@ bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark) bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint) { +if (GetHdlList().IsMoveOutside()) +return false; + if (!GetMarkedObjectList().GetMarkCount()) return false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - desktop/source vcl/source
desktop/source/lib/init.cxx|1 + vcl/source/control/notebookbar.cxx |3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) New commits: commit a3ac2bdfa475fa34172e08d1ec30114d4cd63da1 Author: mert AuthorDate: Thu Feb 25 11:41:24 2021 +0300 Commit: Szymon Kłos CommitDate: Fri Feb 26 10:05:43 2021 +0100 Init Notebookbar for Online Draw Change-Id: I85a25820d3968070dd8a05156b4bb4a1ebe59f99 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111518 Tested-by: Jenkins CollaboraOffice Reviewed-by: Szymon Kłos diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 621e2f3455f8..8cd4503ed189 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -6404,6 +6404,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 78e99e00c660..451c2c9a59f8 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; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: include/svx svx/source
include/svx/svdview.hxx |2 ++ svx/source/svdraw/svdview.cxx | 35 +++ 2 files changed, 37 insertions(+) New commits: commit 958928086652c6a1c48663aa45e97f387fcf0b31 Author: mert AuthorDate: Tue Feb 23 10:45:51 2021 +0300 Commit: Mert Tumer CommitDate: Fri Feb 26 04:37:56 2021 +0100 Implemented MoveShapeHandle method This method will be shared among 3 modules via uno:MoveShapeHandle uno command Change-Id: I921a1f7f004e2004e142954b40b4b93282eb8fed Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111373 Tested-by: Jenkins CollaboraOffice Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111507 Tested-by: Jenkins diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx index f37cf109811d..149b17f9ece9 100644 --- a/include/svx/svdview.hxx +++ b/include/svx/svdview.hxx @@ -241,6 +241,8 @@ public: virtual sdr::contact::ObjectContact* createViewSpecificObjectContact( SdrPageWindow& rPageWindow, const char* pDebugName) const; + +bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint); }; // First of all the app creates a SdrModel. diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index f591334dea08..6e26091a8e43 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1407,6 +1407,41 @@ bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark) } } +bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint) +{ +if (!GetMarkedObjectList().GetMarkCount()) +return false; + +SdrHdl * pHdl = GetHdlList().GetHdl(handleNum); +if (pHdl == nullptr) +return false; + +const SdrDragStat& rDragStat = GetDragStat(); +// start dragging +BegDragObj(pHdl->GetPos(), nullptr, pHdl, 0); +if (!IsDragObj()) +return false; + +bool bWasNoSnap = rDragStat.IsNoSnap(); +bool bWasSnapEnabled = IsSnapEnabled(); + +// switch snapping off +if(!bWasNoSnap) +const_cast(rDragStat).SetNoSnap(); +if(bWasSnapEnabled) +SetSnapEnabled(false); + +MovAction(aEndPoint); +EndDragObj(); + +if (!bWasNoSnap) +const_cast(rDragStat).SetNoSnap(bWasNoSnap); +if (bWasSnapEnabled) +SetSnapEnabled(bWasSnapEnabled); + +return true; +} + void SdrView::ConfigurationChanged( ::utl::ConfigurationBroadcaster*p, ConfigurationHints nHint) { onAccessibilityOptionsChanged(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: svx/source
svx/source/svdraw/svdmrkv.cxx | 84 ++ 1 file changed, 76 insertions(+), 8 deletions(-) New commits: commit 389cfb583f3a18d9921f2ca9e4dfae22c01c754e Author: mert AuthorDate: Mon Jan 4 22:39:56 2021 +0300 Commit: Mert Tumer CommitDate: Fri Feb 26 03:26:19 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 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108686 Tested-by: Jenkins CollaboraOffice 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 446020ef48d5..fb8fbc0ec4db 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -62,6 +62,8 @@ #include #include +#include +#include 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; @@ -744,6 +747,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S bool bWriterGraphic = pO->HasLimitedRotation(); OStringBuffer aExtraInfo; +OString handleArrayStr; aExtraInfo.append("{\"id\":\""); aExtraInfo.append(OString::number(reinterpret_cast(pO))); @@ -880,18 +884,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(pHdl->GetKind()); +child.put("id", pHdl->GetObjHdlNum()); +child.put("kind", kind); +child.put("pointer", static_cast(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(SdrHdlKind::UpperLeft) && kind <= static_cast(SdrHdlKind::LowerRight)) +{ +selectedNode = +} +else if (kind == static_cast(SdrHdlKind::Poly)) +{ +selectedNode = +} +else if (kind == static_cast(SdrHdlKind::CustomShape1)) +{ +selectedNode = +} +else +{ +selectedNode = +} +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() + ", "
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - svx/source
svx/source/svdraw/svdmrkv.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 3e885c29ff1a295a20fdb8688d2875dd2a5fccd8 Author: mert AuthorDate: Wed Feb 24 06:22:49 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 09:59:50 2021 +0100 Fix chart sub element rectangle and handle positions Change-Id: I486b542ae0bb4a987c98d92c1866895eafcf620c Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111440 Tested-by: Jenkins CollaboraOffice diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index beda9a2c3621..db05163b1ec4 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -709,7 +709,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView tools::Rectangle aSelection(rRect); bool bIsChart = false; - +Point addLogicOffset = Point(0,0); if (!rRect.IsEmpty()) { sal_uInt32 nTotalPaintWindows = this->PaintWindowCount(); @@ -724,6 +724,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView { Point aOffsetPx = pWin->GetOffsetPixelFrom(*pViewShellWindow); Point aLogicOffset = pWin->PixelToLogic(aOffsetPx); +addLogicOffset = aLogicOffset; aSelection.Move(aLogicOffset.getX(), aLogicOffset.getY()); } } @@ -883,8 +884,6 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView } 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((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()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sfx2/source
sfx2/source/view/lokhelper.cxx | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) New commits: commit d4aaf8f699233d4e63a9293d0ac7ffbe2cface14 Author: mert AuthorDate: Mon Feb 22 11:17:27 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:39:37 2021 +0100 Fix non-valid json generation on NotifyOtherViews Change-Id: I82aa0aefcd1de14b4c1bb2bbe3f087b60d691beb Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111299 Tested-by: Jenkins CollaboraOffice diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx index 3c1ecd207159..9208c6e35476 100644 --- a/sfx2/source/view/lokhelper.cxx +++ b/sfx2/source/view/lokhelper.cxx @@ -303,7 +303,11 @@ void SfxLokHelper::setDeviceFormFactor(const OUString& rDeviceFormFactor) g_deviceFormFactor = LOKDeviceFormFactor::UNKNOWN; } -static OString lcl_escapeQuotes(const OString ) +/* +* Used for putting a whole JSON string into a string value +* e.g { key: "{JSON}" } +*/ +static OString lcl_sanitizeJSONAsValue(const OString ) { if (rStr.getLength() < 1) return rStr; @@ -313,7 +317,9 @@ static OString lcl_escapeQuotes(const OString ) { if (rStr[i] == '"' || rStr[i] == '\\') aBuf.append('\\'); -aBuf.append(rStr[i]); + +if (rStr[i] != '\n') +aBuf.append(rStr[i]); } return aBuf.makeStringAndClear(); } @@ -336,7 +342,7 @@ static inline OString lcl_generateJSON(const SfxViewShell* pView, const OString& assert(pView != nullptr && "pView must be valid"); return OStringLiteral("{ \"viewId\": \"") + OString::number(SfxLokHelper::getView(pView)) + "\", \"part\": \"" + OString::number(pView->getPart()) + "\", \"" + rKey + "\": \"" - + lcl_escapeQuotes(rPayload) + "\" }"; + + lcl_sanitizeJSONAsValue(rPayload) + "\" }"; } void SfxLokHelper::notifyOtherView(const SfxViewShell* pThisView, SfxViewShell const* pOtherView, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sc/sdi sc/source
sc/sdi/drawsh.sdi|1 + sc/source/ui/drawfunc/drawsh.cxx | 16 2 files changed, 17 insertions(+) New commits: commit 8c7a1b06e445f6e61b5127b6ba8a80fb3cfba454 Author: mert AuthorDate: Fri Feb 19 11:15:02 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:39:05 2021 +0100 Implemented MoveShapeHandle uno command for sc Change-Id: I5f81348cd778d7fbcb3b4e721fbf0412c4f5753d Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95 Tested-by: Jenkins CollaboraOffice diff --git a/sc/sdi/drawsh.sdi b/sc/sdi/drawsh.sdi index 6b28aea9dfbe..da0def0bafc9 100644 --- a/sc/sdi/drawsh.sdi +++ b/sc/sdi/drawsh.sdi @@ -224,6 +224,7 @@ interface TableDraw SID_DRAW_HLINK_EDIT [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] SID_DRAW_HLINK_DELETE [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] SID_OPEN_HYPERLINK [ ExecMethod = ExecDrawAttr; StateMethod = GetDrawFuncState; Export = FALSE; ] +SID_MOVE_SHAPE_HANDLE [ ExecMethod = ExecDrawAttr; ] } diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 36d18b69ba43..57afdd6da65a 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -203,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(FN_PARAM_1); +const SfxUInt32Item* newPosXTwips = rReq.GetArg(FN_PARAM_2); +const SfxUInt32Item* newPosYTwips = rReq.GetArg(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: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - svx/source
svx/source/svdraw/svdmrkv.cxx |9 ++--- svx/source/svdraw/svdoedge.cxx |2 +- 2 files changed, 7 insertions(+), 4 deletions(-) New commits: commit 82e6ded597e5f448cac213b1c8b72a5ff2660392 Author: mert AuthorDate: Fri Feb 19 09:55:12 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:37:57 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 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93 Tested-by: Jenkins CollaboraOffice diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index e3b122d11938..beda9a2c3621 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -917,6 +917,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView 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); @@ -926,8 +927,11 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView child.put("id", pHdl->GetObjHdlNum()); child.put("kind", kind); child.put("pointer", static_cast(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; @@ -957,7 +961,6 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView } 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 5946ecadc4c4..99dee49aa2d2 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -2140,7 +2140,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); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/sdi sw/source
sw/sdi/_viewsh.sdi |5 + sw/sdi/drawsh.sdi |5 + sw/source/uibase/shells/drawsh.cxx | 16 +++- sw/source/uibase/uiview/view2.cxx | 18 ++ 4 files changed, 43 insertions(+), 1 deletion(-) New commits: commit e9908474d66d71d8186dd0c21c5bb756ab4b72d2 Author: mert AuthorDate: Fri Feb 19 09:37:19 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:37:31 2021 +0100 Implemented MoveShapeHandle uno command for sw Change-Id: I9feccc4fa1a4d7426609afa474f87ab12c769090 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92 Tested-by: Jenkins CollaboraOffice diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index c84e6f5434eb..b74eb76c3e8f 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -955,5 +955,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 a50df1289a61..45850f6a7ae3 100644 --- a/sw/sdi/drawsh.sdi +++ b/sw/sdi/drawsh.sdi @@ -529,5 +529,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 3bfaf25b958d..e5169e229041 100644 --- a/sw/source/uibase/shells/drawsh.cxx +++ b/sw/source/uibase/shells/drawsh.cxx @@ -219,7 +219,21 @@ void SwDrawShell::Execute(SfxRequest ) GetView().FlipDrawRotate(); } break; - +case SID_MOVE_SHAPE_HANDLE: +{ +if (pArgs && pArgs->Count() == 3) +{ +const SfxUInt32Item* handleNumItem = rReq.GetArg(FN_PARAM_1); +const SfxUInt32Item* newPosXTwips = rReq.GetArg(FN_PARAM_2); +const SfxUInt32Item* newPosYTwips = rReq.GetArg(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 ce3ea308cedf..760f18fc56df 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -1292,6 +1292,24 @@ void SwView::Execute(SfxRequest ) 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(FN_PARAM_1); +const SfxUInt32Item* newPosXTwips = rReq.GetArg(FN_PARAM_2); +const SfxUInt32Item* newPosYTwips = rReq.GetArg(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"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - svx/source
svx/source/svdraw/svdoedge.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 4f12603d84b46eaae30a67274983d3a49ecc2ece Author: mert AuthorDate: Wed Feb 17 09:12:25 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:37:11 2021 +0100 Fix connectors cannot select a glue point Change-Id: I6b6d2dad27910ac6d5de43e9d0992e3565f5be5e Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111024 diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 8b84492dd48f..5946ecadc4c4 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -49,6 +49,7 @@ #include #include #include +#include void SdrObjConnection::ResetVars() { @@ -2139,7 +2140,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()) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - svx/source
svx/source/svdraw/svdmrkv.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3b43ecb2ca5a2dde5c7864002f7aa5a23a4fcafd Author: mert AuthorDate: Mon Feb 8 10:31:38 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:36:12 2021 +0100 Exclude table selection from handle message Change-Id: Ic079c2d59040c8b6d714af3932d5294c2060edc0 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110548 Tested-by: Jenkins CollaboraOffice diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index ecaa8f622edd..e3b122d11938 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -909,7 +909,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView } } } -if (!pOtherShell && maHdlList.GetHdlCount()) +if (!bTableSelection && !pOtherShell && maHdlList.GetHdlCount()) { boost::property_tree::ptree responseJSON; boost::property_tree::ptree others; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sd/source
sd/source/ui/func/fuconstr.cxx |6 -- sd/source/ui/func/fusel.cxx|1 + 2 files changed, 5 insertions(+), 2 deletions(-) New commits: commit 08b25904e81a1b532fe889f53fc1f1909f4b1f06 Author: mert AuthorDate: Thu Feb 4 10:37:03 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:33:18 2021 +0100 LOK: disable rotation mode on selection of shape Change-Id: Iff0ed673ae1c61ff0d753cf3a1f871213f8b3a7d Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110399 Tested-by: Jenkins CollaboraOffice diff --git a/sd/source/ui/func/fuconstr.cxx b/sd/source/ui/func/fuconstr.cxx index e4eb8b3eda5f..23cbd65c00f1 100644 --- a/sd/source/ui/func/fuconstr.cxx +++ b/sd/source/ui/func/fuconstr.cxx @@ -39,6 +39,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -187,9 +188,10 @@ bool FuConstruct::MouseButtonUp(const MouseEvent& rMEvt) pSingleObj = mpView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj(); } -if (mpView->GetDragMode() == SdrDragMode::Move && mpView->IsRotateAllowed() && +const bool bTiledRendering = comphelper::LibreOfficeKit::isActive(); +if (!bTiledRendering && (mpView->GetDragMode() == SdrDragMode::Move && mpView->IsRotateAllowed() && (mpViewShell->GetFrameView()->IsClickChangeRotation() || - (pSingleObj && pSingleObj->GetObjInventor()==SdrInventor::E3d))) + (pSingleObj && pSingleObj->GetObjInventor()==SdrInventor::E3d { mpView->SetDragMode(SdrDragMode::Rotate); } diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx index baa6c6b9e3ad..0cb6e6c36c22 100644 --- a/sd/source/ui/func/fusel.cxx +++ b/sd/source/ui/func/fusel.cxx @@ -707,6 +707,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) } if (nSlotId == SID_OBJECT_SELECT +&& !comphelper::LibreOfficeKit::isActive() && mpView->IsRotateAllowed() && (rMEvt.GetClicks() != 2) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/svx sd/sdi sd/source svx/sdi
include/svx/svxids.hrc |2 ++ sd/sdi/_drvwsh.sdi |5 - sd/source/ui/view/drviews2.cxx | 16 svx/sdi/svx.sdi| 17 + 4 files changed, 39 insertions(+), 1 deletion(-) New commits: commit 3c4a9d6d31829bd826d96126554e60687a3e36c2 Author: mert AuthorDate: Thu Jan 28 07:19:07 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:32:53 2021 +0100 Added .uno:MoveShapeHandle uno command This is now only available for Draw/Presentation It will allow interactive dragging/resizing operations via the command. Later it will be implemented for other modules too. Change-Id: Iaed7d25cf4035591083e779c13a6f0227a3b564f Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110041 Tested-by: Jenkins CollaboraOffice diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index 6b15d0087926..c13420125655 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -1020,6 +1020,8 @@ class SvxSetItem; // IMPORTANT NOTE: adjust SID_SVX_FIRSTFREE, when adding new slot id #define SID_SVX_FIRSTFREE ( SID_HIDE_SIDEBAR + 1 ) +#define SID_MOVE_SHAPE_HANDLE ( SID_SVX_START + 1203 ) + // Overflow check for slot IDs #if SID_SVX_FIRSTFREE > SID_SVX_END #error Resource-overflow in #line, #file diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index efcfe0f51492..440515544003 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -2872,5 +2872,8 @@ interface DrawView ExecMethod = FuTemporary ; StateMethod = GetMenuState ; ] - +SID_MOVE_SHAPE_HANDLE +[ +ExecMethod = FuTemporary ; +] } diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index 85587bbde585..b530b0bd1658 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -1498,7 +1498,23 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } } break; +case SID_MOVE_SHAPE_HANDLE: +{ +const SfxItemSet *pArgs = rReq.GetArgs (); +if (pArgs && pArgs->Count () == 3) +{ +const SfxUInt32Item* handleNumItem = rReq.GetArg(FN_PARAM_1); +const SfxUInt32Item* newPosXTwips = rReq.GetArg(FN_PARAM_2); +const SfxUInt32Item* newPosYTwips = rReq.GetArg(FN_PARAM_3); +const sal_uLong handleNum = handleNumItem->GetValue(); +const sal_uLong newPosX = convertTwipToMm100(newPosXTwips->GetValue()); +const sal_uLong newPosY = convertTwipToMm100(newPosYTwips->GetValue()); +mpDrawView->MoveShapeHandle(handleNum, Point(newPosX, newPosY)); +Cancel(); +} +break; +} case SID_CHAR_DLG_EFFECT: case SID_CHAR_DLG: // BASIC { diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 04e6a3279bdb..e5107db90048 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -12277,3 +12277,20 @@ SfxVoidItem SpellCheckApplySuggestion SID_SPELLCHECK_APPLY_SUGGESTION ToolBoxConfig = FALSE, GroupId = SfxGroupId::Format; ] + +SfxVoidItem MoveShapeHandle SID_MOVE_SHAPE_HANDLE +(SfxUInt32Item HandleNum FN_PARAM_1 SfxUInt32Item NewPosX FN_PARAM_2 SfxUInt32Item NewPosY FN_PARAM_3) +[ +AutoUpdate = FALSE, +FastCall = TRUE, +ReadOnlyDoc = FALSE, +Toggle = FALSE, +Container = FALSE, +RecordAbsolute = FALSE, +RecordPerSet; + +AccelConfig = FALSE, +MenuConfig = FALSE, +ToolBoxConfig = FALSE, +GroupId = SfxGroupId::Format; +] ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/svx svx/source
include/svx/svdview.hxx |3 +++ svx/source/svdraw/svdview.cxx | 35 +++ 2 files changed, 38 insertions(+) New commits: commit a277cfaf3c24c8ae79da85a5e2b578af2fb62d83 Author: mert AuthorDate: Tue Feb 23 10:45:51 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:32:32 2021 +0100 Implemented MoveShapeHandle method This method will be shared among 3 modules via uno:MoveShapeHandle uno command Change-Id: I921a1f7f004e2004e142954b40b4b93282eb8fed Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111373 Tested-by: Jenkins CollaboraOffice diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx index 6712c79fafc0..e4a6168ef425 100644 --- a/include/svx/svdview.hxx +++ b/include/svx/svdview.hxx @@ -241,6 +241,9 @@ public: virtual sdr::contact::ObjectContact* createViewSpecificObjectContact( SdrPageWindow& rPageWindow, const sal_Char* pDebugName) const; + +// Interactive Move Action programmaticaly +bool MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint); }; // First of all the app creates a SdrModel. diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 76222cd30158..27b1c67c6551 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1426,6 +1426,41 @@ bool SdrView::BegMark(const Point& rPnt, bool bAddMark, bool bUnmark) } } +bool SdrView::MoveShapeHandle(const sal_uInt32 handleNum, const Point& aEndPoint) +{ +if (!GetMarkedObjectList().GetMarkCount()) +return false; + +SdrHdl * pHdl = GetHdlList().GetHdl(handleNum); +if (pHdl == nullptr) +return false; + +const SdrDragStat& rDragStat = GetDragStat(); +// start dragging +BegDragObj(pHdl->GetPos(), nullptr, pHdl, 0); +if (!IsDragObj()) +return false; + +bool bWasNoSnap = rDragStat.IsNoSnap(); +bool bWasSnapEnabled = IsSnapEnabled(); + +// switch snapping off +if(!bWasNoSnap) +const_cast(rDragStat).SetNoSnap(); +if(bWasSnapEnabled) +SetSnapEnabled(false); + +MovAction(aEndPoint); +EndDragObj(); + +if (!bWasNoSnap) +const_cast(rDragStat).SetNoSnap(bWasNoSnap); +if (bWasSnapEnabled) +SetSnapEnabled(bWasSnapEnabled); + +return true; +} + void SdrView::ConfigurationChanged( ::utl::ConfigurationBroadcaster*p, ConfigurationHints nHint) { onAccessibilityOptionsChanged(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - svx/source
svx/source/svdraw/svdmrkv.cxx | 83 +- 1 file changed, 75 insertions(+), 8 deletions(-) New commits: commit e6c31a24dd9555b06e9492bfc2d755ba677ee7b6 Author: mert AuthorDate: Mon Jan 4 22:39:56 2021 +0300 Commit: Mert Tumer CommitDate: Wed Feb 24 08:32:10 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 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108686 Tested-by: Jenkins CollaboraOffice diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 5b3a77e3e5a8..ecaa8f622edd 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -71,6 +71,7 @@ #include #include +#include using namespace com::sun::star; @@ -747,6 +748,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView { OString sSelectionText; +OString sSelectionTextView; boost::property_tree::ptree aTableJsonTree; bool bTableSelection = false; @@ -770,6 +772,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView } OStringBuffer aExtraInfo; +OString handleArrayStr; aExtraInfo.append("{\"id\":\""); aExtraInfo.append(OString::number(reinterpret_cast(pO))); @@ -906,18 +909,82 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, SfxView } } } -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(pHdl->GetKind()); +child.put("id", pHdl->GetObjHdlNum()); +child.put("kind", kind); +child.put("pointer", static_cast(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(SdrHdlKind::UpperLeft) && kind <= static_cast(SdrHdlKind::LowerRight)) +{ +selectedNode = +} +else if (kind == static_cast(SdrHdlKind::Poly)) +{ +selectedNode = +} +else if (kind == static_cast(SdrHdlKind::CustomShape1)) +{ +selectedNode = +} +else +{ +selectedNode = +} +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 += aStream.str().c_str(); +} sSelectionText = aSelection.toString() + ", " + OString::number(nRotAngle); if (!aExtraInfo.isEmpty()) { +sSelectionTextView = sSelectionText + ", " +
[Libreoffice-commits] online.git: android/app
android/app/build.gradle |2 android/app/src/main/AndroidManifest.xml |2 android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java | 70 +- android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java | 14 +- android/app/src/main/res/drawable/ic_folder_black_24dp.xml |3 android/app/src/main/res/layout/activity_document_browser.xml | 21 +-- android/app/src/main/res/layout/file_explorer_grid_item.xml |3 android/app/src/main/res/layout/file_list_item.xml |4 android/app/src/main/res/layout/theme_selection.xml | 44 ++ android/app/src/main/res/values/strings.xml |7 + android/app/src/main/res/values/themes.xml |7 - android/app/src/main/res/xml/libreoffice_preferences.xml | 13 + 12 files changed, 167 insertions(+), 23 deletions(-) New commits: commit 5c023938a366f44bbe922214fb8727146d18e127 Author: mert AuthorDate: Wed May 6 15:15:32 2020 +0300 Commit: Mert Tumer CommitDate: Mon Sep 28 14:12:41 2020 +0200 android: enable Dark Theme for Dark Mode changes Change-Id: I631d31558ae9afac9585d12d66237bc04a761555 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93563 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tumer diff --git a/android/app/build.gradle b/android/app/build.gradle index 627ac6ca9..aa8f5ca16 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -67,7 +67,7 @@ android { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) -implementation 'androidx.appcompat:appcompat:1.0.2' +implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core:1.0.2' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.recyclerview:recyclerview:1.0.0' diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 4e8723706..a3262 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -32,7 +32,7 @@ diff --git a/android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java index c51d098af..701ae8350 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java @@ -11,29 +11,97 @@ package org.libreoffice.androidapp; import android.content.SharedPreferences; import android.os.Bundle; - +import android.view.View; +import android.widget.RadioGroup; +import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; +import androidx.appcompat.app.AppCompatDelegate; +import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; +import org.libreoffice.androidapp.ui.LibreOfficeUIActivity; public class SettingsActivity extends AppCompatActivity { + +private static SharedPreferences prefs; + @Override protected void onCreate(Bundle savedInstanceState) { +setTheme(R.style.LibreOfficeTheme_Base); super.onCreate(savedInstanceState); // Display the fragment as the main content. getSupportFragmentManager().beginTransaction() .replace(android.R.id.content, new SettingsFragment()) .commit(); +prefs = getSharedPreferences(LibreOfficeUIActivity.EXPLORER_PREFS_KEY, MODE_PRIVATE); } public static class SettingsFragment extends PreferenceFragmentCompat implements SharedPreferences.OnSharedPreferenceChangeListener { +int dayNightMode; +int selectedThemeBtnId; @Override public void onCreatePreferences(Bundle savedInstanceState, String rootKey) { addPreferencesFromResource(R.xml.libreoffice_preferences); if (!BuildConfig.DEBUG) { findPreference("ENABLE_SHOW_DEBUG_INFO").setVisible(false); } +Preference themePreference = findPreference("THEME_SELECTION"); + +dayNightMode = AppCompatDelegate.getDefaultNightMode(); +selectedThemeBtnId = R.id.radioBtn_default; +switch (dayNightMode) { +case AppCompatDelegate.MODE_NIGHT_YES: +themePreference.setSummary(R.string.theme_dark); +selectedThemeBtnId = R.id.radioBtn_dark; +break; +case AppCompatDelegate.MODE_NIGHT_NO: +
[Libreoffice-commits] online.git: 2 commits - loleaflet/html loleaflet/src Makefile.am test/Makefile.am test/WhiteBoxTests.cpp wsd/FileServer.cpp wsd/FileServer.hpp wsd/FileServerUtil.cpp wsd/referenc
Makefile.am|1 loleaflet/html/loleaflet.html.m4 |6 + loleaflet/src/control/Control.Menubar.js | 13 +++ loleaflet/src/control/Control.StatusBar.js | 12 +++ loleaflet/src/control/Control.UIManager.js | 39 ++ loleaflet/src/control/Ruler.js |9 ++ test/Makefile.am |1 test/WhiteBoxTests.cpp | 15 wsd/FileServer.cpp |3 wsd/FileServer.hpp |8 ++ wsd/FileServerUtil.cpp | 104 + wsd/reference.md | 21 + 12 files changed, 226 insertions(+), 6 deletions(-) New commits: commit 2e28b9bb655ac7ebc5b580fabb5636b629dd7f85 Author: mert AuthorDate: Wed Jun 3 21:16:31 2020 +0300 Commit: Mert Tumer CommitDate: Mon Sep 28 11:53:23 2020 +0200 Change Show/Hide Ruler & Statusbar by default on first load Change-Id: If0bcf08f005b8461ed559d197b49dc11448344d3 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96489 Tested-by: Jenkins CollaboraOffice diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index e53958f14..d3e3988a7 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -64,6 +64,7 @@ L.Control.Menubar = L.Control.extend({ {name: _UNO('.uno:ZoomMinus', 'text'), id: 'zoomout', type: 'action',}, {name: _('Reset zoom'), id: 'zoomreset', type: 'action'}, {name: _('Show Ruler'), id: 'showruler', type: 'action'}, + {name: _('Show Status Bar'), id: 'showstatusbar', type: 'action'}, {type: 'separator'}, ]).concat([ {uno: '.uno:ControlCodes'}, @@ -294,7 +295,8 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:CustomAnimation', drawing: false}, {uno: '.uno:MasterSlidesPanel', drawing: false}, {type: 'separator', drawing: false}, - {uno: '.uno:Sidebar', drawing: false}] + {uno: '.uno:Sidebar', drawing: false}, + {name: _('Show Status Bar'), id: 'showstatusbar', type: 'action'}] }, {name: _UNO('.uno:InsertMenu', 'presentation'), id: 'insert', type: 'menu', menu: [ {name: _('Local Image...'), id: 'insertgraphic', type: 'action'}, @@ -1082,6 +1084,13 @@ L.Control.Menubar = L.Control.extend({ $(aItem).removeClass(constChecked); } + } else if (id === 'showstatusbar') { + if (self._map.uiManager.isStatusBarVisible()) { + $(aItem).addClass(constChecked); + } else { + $(aItem).removeClass(constChecked); + } + } else if (self._map.getDocType() === 'presentation' && (id === 'deletepage' || id === 'insertpage' || id === 'duplicatepage')) { if (id === 'deletepage') { itemState = self._map['stateChangeHandler'].getItemValue('.uno:DeletePage'); @@ -1215,6 +1224,8 @@ L.Control.Menubar = L.Control.extend({ L.toggleFullScreen(); } else if (id === 'showruler') { this._map.uiManager.toggleRuler(); + } else if (id === 'showstatusbar') { + this._map.uiManager.toggleStatusBar(); } else if (id === 'fullscreen-presentation' && this._map.getDocType() === 'presentation') { this._map.fire('fullscreen'); } else if (id === 'presentation-currentslide' && this._map.getDocType() === 'presentation') { diff --git a/loleaflet/src/control/Control.StatusBar.js b/loleaflet/src/control/Control.StatusBar.js index 29a844e9f..62f368403 100644 --- a/loleaflet/src/control/Control.StatusBar.js +++ b/loleaflet/src/control/Control.StatusBar.js @@ -240,7 +240,6 @@ L.Control.StatusBar = L.Control.extend({ }); if (window.mode.isDesktop()) toolbar.tooltip(); - toolbar.show(); } toolbar.bind('touchstart', function() { @@ -397,6 +396,17 @@
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.LokDialog.js |7 + loleaflet/src/control/Control.Menubar.js |6 loleaflet/src/control/Control.StatusBar.js |7 - loleaflet/src/control/Control.Toolbar.js |4 +++ loleaflet/src/control/Control.UIManager.js | 38 +++-- loleaflet/src/map/Map.js |7 +++-- 6 files changed, 54 insertions(+), 15 deletions(-) New commits: commit f7f4464b3c835ccaacf5519ad7ef9ef0bc98d668 Author: mert AuthorDate: Tue Jun 9 20:23:48 2020 +0300 Commit: Mert Tumer CommitDate: Mon Sep 28 11:53:34 2020 +0200 Save and restore UI element states via localStorage Also handle Show/Hide sidebar with localstorage Change-Id: I2e6f8b7480d7d55173a3324b819f6e4e829e512f Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96511 Tested-by: Jenkins CollaboraOffice diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 23fe890cd..87b97e9cf 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -1092,6 +1092,9 @@ L.Control.LokDialog = L.Control.extend({ else $(panel).parent().hide(); + if (window.initSidebarState) + this._map.uiManager.setSavedState('ShowSidebar', width > 1); + // Render window. this._sendPaintWindowRect(id); } else { @@ -1141,6 +1144,8 @@ L.Control.LokDialog = L.Control.extend({ this._createDialogCursor(strId); this._postLaunch(id, panelContainer, panelCanvas); + if (window.initSidebarState) + this._map.uiManager.setSavedState('ShowSidebar', true); }, _postLaunch: function(id, panelContainer, panelCanvas) { @@ -1409,6 +1414,8 @@ L.Control.LokDialog = L.Control.extend({ this._map.focus(); } $('#document-container').addClass('sidebar-closed'); + if (window.initSidebarState) + this._map.uiManager.setSavedState('ShowSidebar', false); }, _onCalcInputBarClose: function(dialogId) { diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index d3e3988a7..2dd0a6979 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -1309,6 +1309,12 @@ L.Control.Menubar = L.Control.extend({ return; } + if (unoCommand.startsWith('.uno:Sidebar') || unoCommand.startsWith('.uno:SlideMasterPage') || + unoCommand.startsWith('.uno:ModifyPage') || unoCommand.startsWith('.uno:SlideChangeWindow') || + unoCommand.startsWith('.uno:CustomAnimation') || unoCommand.startsWith('.uno:MasterSlidesPanel')) { + window.initSidebarState = true; + } + this._map.sendUnoCommand(unoCommand); }, diff --git a/loleaflet/src/control/Control.StatusBar.js b/loleaflet/src/control/Control.StatusBar.js index 62f368403..0a82d5c6f 100644 --- a/loleaflet/src/control/Control.StatusBar.js +++ b/loleaflet/src/control/Control.StatusBar.js @@ -397,12 +397,7 @@ L.Control.StatusBar = L.Control.extend({ if (statusbar) statusbar.refresh(); - var showStatusbar = true; - if (window.uiDefaults) { - if (window.uiDefaults[docType]) { - showStatusbar = window.uiDefaults[docType].ShowStatusbar !== false; - } - } + var showStatusbar = this.map.uiManager.getSavedStateOrDefault('ShowStatusbar'); if (showStatusbar) $('#toolbar-down').show(); else diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 7fa110194..97767962d 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -70,6 +70,10 @@ function onClick(e, id, item) { throw new Error('unknown id: ' + id); } + if (id === 'sidebar' || id === 'modifypage' || id === 'slidechangewindow' || id === 'customanimation' || id === 'masterslidespanel') { + window.initSidebarState = true; + } + // In the iOS app we don't want clicking on the toolbar to pop up the keyboard. if (!window.ThisIsTheiOSApp && id !== 'zoomin' && id !== 'zoomout' && id !== 'mobile_wizard' && id !== 'insertion_mobile_wizard') { map.focus(map.canAcceptKeyboardInput()); // Maintain same keyboard state. diff --git a/loleaflet/src/control/Control.UIManager.js
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/map/handler/Map.TouchGesture.js | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) New commits: commit 49447ec08c5d3904028e77a0f8f596571ab8a05b Author: mert AuthorDate: Wed Sep 16 17:31:46 2020 +0300 Commit: Andras Timar CommitDate: Mon Sep 21 20:29:08 2020 +0200 Fix pinch gesture causes hammer to stuck on Mobile Change-Id: If0ae311346ae9c9935ebacde3bc5ea874833 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102873 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit c43aeb3e35a99c2f35bb817037d2451dc8731ae5) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/103057 diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 677d15dec..cd22175a5 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -53,9 +53,20 @@ L.Map.TouchGesture = L.Handler.extend({ var tripleTap = new Hammer.Tap({event: 'tripletap', taps: 3, posThreshold: posThreshold }); this._hammer.add(tripleTap); tripleTap.recognizeWith([doubleTap, singleTap]); - + var hammer = this._hammer; if (L.Browser.touch) { - L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchend touchcancel', L.DomEvent.preventDefault); + L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchcancel', L.DomEvent.preventDefault); + L.DomEvent.on(this._map._mapPane, 'touchend', function(e) { + // sometimes inputs get stuck in hammer and further events get mixed with the old ones + // this causes to a failure to use all the gestures properly. + // This is a workaround until it is fixed by hammer.js + if (hammer.input) { + if (hammer.input.store) { + hammer.input.store = []; + } + } + L.DomEvent.preventDefault(e); + }); } if (Hammer.prefixed(window, 'PointerEvent') !== undefined) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/map/handler/Map.TouchGesture.js | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) New commits: commit c43aeb3e35a99c2f35bb817037d2451dc8731ae5 Author: mert AuthorDate: Wed Sep 16 17:31:46 2020 +0300 Commit: Andras Timar CommitDate: Mon Sep 21 17:20:06 2020 +0200 Fix pinch gesture causes hammer to stuck on Mobile Change-Id: If0ae311346ae9c9935ebacde3bc5ea874833 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102873 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 689e9104f..ce3ca184e 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -53,9 +53,20 @@ L.Map.TouchGesture = L.Handler.extend({ var tripleTap = new Hammer.Tap({event: 'tripletap', taps: 3, posThreshold: posThreshold }); this._hammer.add(tripleTap); tripleTap.recognizeWith([doubleTap, singleTap]); - + var hammer = this._hammer; if (L.Browser.touch) { - L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchend touchcancel', L.DomEvent.preventDefault); + L.DomEvent.on(this._map._mapPane, 'touchstart touchmove touchcancel', L.DomEvent.preventDefault); + L.DomEvent.on(this._map._mapPane, 'touchend', function(e) { + // sometimes inputs get stuck in hammer and further events get mixed with the old ones + // this causes to a failure to use all the gestures properly. + // This is a workaround until it is fixed by hammer.js + if (hammer.input) { + if (hammer.input.store) { + hammer.input.store = []; + } + } + L.DomEvent.preventDefault(e); + }); } if (Hammer.prefixed(window, 'PointerEvent') !== undefined) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - wsd/ClientSession.cpp
wsd/ClientSession.cpp |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e4c65866cccbbd87a68f52d791cd0e2973580928 Author: mert AuthorDate: Thu Sep 17 11:51:16 2020 +0300 Commit: Andras Timar CommitDate: Thu Sep 17 11:40:36 2020 +0200 fix loadwithpassword parsing password token on mobile Change-Id: Ia3ca58f9fb08b9d1568feb2655cd03e17bf92b5a Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102905 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp index c00c7dbea..9b5ed4998 100644 --- a/wsd/ClientSession.cpp +++ b/wsd/ClientSession.cpp @@ -400,7 +400,7 @@ bool ClientSession::_handleInput(const char *buffer, int length) if (!docPassword.empty()) { setHaveDocPassword(true); -setDocPassword(tokens[1]); +setDocPassword(docPassword); } } return loadDocument(buffer, length, tokens, docBroker); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/layer/marker/Annotation.js |6 +-- loleaflet/src/map/handler/Map.TouchGesture.js | 45 -- 2 files changed, 38 insertions(+), 13 deletions(-) New commits: commit 94e461f8248341f9a24de2b2dc7cc48a755a Author: mert AuthorDate: Fri Sep 11 17:05:30 2020 +0300 Commit: Andras Timar CommitDate: Wed Sep 16 09:51:44 2020 +0200 Fix annotation kebab menu brings up keyboard on mobile Also fixed other weirdnesses on touch event with annotation box. It was sending click events to LOK even if we click on annotation box, which is not wanted. Change-Id: Ia43a879c72c22276c482e463fa725ce1c76df911 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102468 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/marker/Annotation.js b/loleaflet/src/layer/marker/Annotation.js index b5c7f3069..bcf3ab74d 100644 --- a/loleaflet/src/layer/marker/Annotation.js +++ b/loleaflet/src/layer/marker/Annotation.js @@ -203,7 +203,7 @@ L.Annotation = L.Layer.extend({ var tr = L.DomUtil.create('tr', empty, tbody); var tdImg = L.DomUtil.create(tagTd, 'loleaflet-annotation-img', tr); var tdAuthor = L.DomUtil.create(tagTd, 'loleaflet-annotation-author', tr); - var imgAuthor = L.DomUtil.create('img', 'avatar-img', tdImg); + var imgAuthor = L.DomUtil.create('img', 'avatar-img loleaflet-annotation-avatar-img', tdImg); imgAuthor.setAttribute('src', L.LOUtil.getImageURL('user.svg')); imgAuthor.setAttribute('width', this.options.imgSize.x); imgAuthor.setAttribute('height', this.options.imgSize.y); @@ -238,12 +238,12 @@ L.Annotation = L.Layer.extend({ } if (this._data.trackchange) { this._captionNode = L.DomUtil.create(tagDiv, 'loleaflet-annotation-caption', wrapper); - this._captionText = L.DomUtil.create(tagDiv, empty, this._captionNode); + this._captionText = L.DomUtil.create(tagDiv, 'loleaflet-annotation-caption-text', this._captionNode); } this._contentNode = L.DomUtil.create(tagDiv, 'loleaflet-annotation-content loleaflet-dont-break', wrapper); this._nodeModify = L.DomUtil.create(tagDiv, classEdit, wrapper); this._nodeModifyText = L.DomUtil.create(tagTextArea, classTextArea, this._nodeModify); - this._contentText = L.DomUtil.create(tagDiv, empty, this._contentNode); + this._contentText = L.DomUtil.create(tagDiv, 'loleaflet-annotation-content-text', this._contentNode); this._nodeReply = L.DomUtil.create(tagDiv, classEdit, wrapper); this._nodeReplyText = L.DomUtil.create(tagTextArea, classTextArea, this._nodeReply); diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 4257c0212..677d15dec 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -320,20 +320,27 @@ L.Map.TouchGesture = L.Handler.extend({ } this._map.fire('closepopups'); - this._map.fire('editorgotfocus'); var docLayer = this._map._docLayer; - // unselect if anything is selected already - if (docLayer && docLayer._annotations && docLayer._annotations.unselect) { - docLayer._annotations.unselect(); - var pointPx = docLayer._twipsToPixels(mousePos); - var bounds = docLayer._annotations.getBounds(); - if (bounds && bounds.contains(pointPx)) { - // not forward mouse events to core if the user tap on a comment box - // for instance on Writer that causes the text cursor to be moved - return; + if (docLayer && docLayer._annotations) { + var annotationClicked = false; + if (e.target) { + var className = e.target.className; + if (className && typeof className === 'string') { + if (className.indexOf('annotation') >= 0) { + annotationClicked = true; + return; + } + } + } + // unselect if anything is selected already + if (!annotationClicked && docLayer._annotations.unselect) { + docLayer._annotations.unselect(); } } + +
[Libreoffice-commits] online.git: android/lib common/Session.hpp loleaflet/src wsd/ClientSession.cpp
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 +++ common/Session.hpp |4 +++ loleaflet/src/core/Socket.js |3 ++ wsd/ClientSession.cpp| 13 ++ 4 files changed, 24 insertions(+) New commits: commit 115bb1b652dc931344c4a19f0bafd7363115914b Author: mert AuthorDate: Thu Sep 10 17:04:36 2020 +0300 Commit: Mert Tumer CommitDate: Tue Sep 15 15:14:40 2020 +0200 Fix unable to open password protected documents on mobile Change-Id: Ifd67cb6f3640784176abfe483f0364c1dfe4b5d9 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102388 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102729 diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 88b1fdafd..2066a1fd6 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -943,6 +943,10 @@ public class LOActivity extends AppCompatActivity { } return false; } +case "loadwithpassword": { +mProgressDialog.determinate(R.string.loading); +return true; +} } return true; } diff --git a/common/Session.hpp b/common/Session.hpp index e88a59d89..61e35ff42 100644 --- a/common/Session.hpp +++ b/common/Session.hpp @@ -193,6 +193,10 @@ public: bool getHaveDocPassword() const { return _haveDocPassword; } +void setHaveDocPassword(const bool val) { _haveDocPassword = val; } + +void setDocPassword(const std::string& password) { _docPassword = password; } + const std::string& getDocPassword() const { return _docPassword; } const std::string& getUserExtraInfo() const { return _userExtraInfo; } diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 8a22e0c8d..750e98bd6 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -696,6 +696,9 @@ L.Socket = L.Class.extend({ callback: L.bind(function(data) { if (data) { this._map._docPassword = data.password; + if (window.ThisIsAMobileApp) { + window.postMobileMessage('loadwithpassword password=' + data.password); + } this._map.loadDocument(); } else if (passwordType === 'to-modify') { this._map._docPassword = ''; diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp index 60733a0c5..44b3f0271 100644 --- a/wsd/ClientSession.cpp +++ b/wsd/ClientSession.cpp @@ -395,6 +395,19 @@ bool ClientSession::_handleInput(const char *buffer, int length) return loadDocument(buffer, length, tokens, docBroker); } +else if (tokens.equals(0, "loadwithpassword")) +{ +std::string docPassword; +if (tokens.size() > 1 && getTokenString(tokens[1], "password", docPassword)) +{ +if (!docPassword.empty()) +{ +setHaveDocPassword(true); +setDocPassword(docPassword); +} +} +return loadDocument(buffer, length, tokens, docBroker); +} else if (getDocURL().empty()) { sendTextFrameAndLogError("error: cmd=" + tokens[0] + " kind=nodocloaded"); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: android/lib loleaflet/css loleaflet/src
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java | 15 +++ loleaflet/css/toolbar.css|1 loleaflet/src/control/Control.MobileTopBar.js|2 loleaflet/src/control/Control.Toolbar.js |8 +++ loleaflet/src/control/Control.UIManager.js | 21 +- loleaflet/src/control/Permission.js |7 +++ loleaflet/src/map/Map.js |5 ++ 7 files changed, 56 insertions(+), 3 deletions(-) New commits: commit 4cd1baa02d0b36e68a7194c77fdeb68c5af59f8a Author: mert AuthorDate: Wed Feb 12 20:53:34 2020 +0300 Commit: Mert Tumer CommitDate: Tue Sep 15 12:22:10 2020 +0200 android: back button switches to readonly mode instead of closing Currently pressing back button on edit mode closes the document, this patch may prevent unintentional touches Change-Id: Ic7061186fa8794203fd4614c07a11b219d3a10d9 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100666 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tumer Reviewed-by: Jan Holesovsky Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88555 diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 77f9e0e68..88b1fdafd 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -122,6 +122,7 @@ public class LOActivity extends AppCompatActivity { /** In case the mobile-wizard is visible, we have to intercept the Android's Back button. */ private boolean mMobileWizardVisible = false; +private boolean mIsEditModeActive = false; private ValueCallback valueCallback; @@ -697,6 +698,9 @@ public class LOActivity extends AppCompatActivity { // just return one level up in the mobile-wizard (or close it) callFakeWebsocketOnMessage("'mobile: mobilewizardback'"); return; +} else if (mIsEditModeActive) { +callFakeWebsocketOnMessage("'mobile: readonlymode'"); +return; } finishWithProgress(); @@ -928,6 +932,17 @@ public class LOActivity extends AppCompatActivity { startActivity(intent); return false; } +case "EDITMODE": { +switch (messageAndParam[1]) { +case "on": +mIsEditModeActive = true; +break; +case "off": +mIsEditModeActive = false; +break; +} +return false; +} } return true; } diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css index 343ebd8d6..a994cd4b2 100644 --- a/loleaflet/css/toolbar.css +++ b/loleaflet/css/toolbar.css @@ -753,6 +753,7 @@ button.leaflet-control-search-next .w2ui-icon.users{ background: url('images/contacts-dark.svg') no-repeat center; } .w2ui-icon.fullscreen{ background: url('images/lc_fullscreen.svg') no-repeat center !important; } .w2ui-icon.closemobile{ background: url('images/lc_closedocmobile.svg') no-repeat center !important; } +.w2ui-icon.editmode { background: url('images/lc_listitem-selected.svg') no-repeat center / 28px !important; } .w2ui-icon.closetoolbar{ background: url('images/close_toolbar.svg') no-repeat center !important; } .w2ui-icon.sidebar_modify_page{ background: url('images/lc_formproperties.svg') no-repeat center !important; } .w2ui-icon.sidebar_slide_change{ background: url('images/sidebar-transition-large.svg') no-repeat center !important; } diff --git a/loleaflet/src/control/Control.MobileTopBar.js b/loleaflet/src/control/Control.MobileTopBar.js index 05fd7c7ed..b562c0153 100644 --- a/loleaflet/src/control/Control.MobileTopBar.js +++ b/loleaflet/src/control/Control.MobileTopBar.js @@ -193,6 +193,7 @@ L.Control.MobileTopBar = L.Control.extend({ toolbarDownButtons.forEach(function(id) { toolbar.enable(id); }); + toolbar.set('closemobile', {img: 'editmode'}); } } else { toolbar = w2ui['actionbar']; @@ -200,6 +201,7 @@ L.Control.MobileTopBar = L.Control.extend({ toolbarDownButtons.forEach(function(id) { toolbar.disable(id); }); + toolbar.set('closemobile', {img: 'closemobile'}); } } }, diff --git a/loleaflet/src/control/Control.Toolbar.js
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - android/lib common/Session.hpp loleaflet/src wsd/ClientSession.cpp
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 +++ common/Session.hpp |4 +++ loleaflet/src/core/Socket.js |3 ++ wsd/ClientSession.cpp| 13 ++ 4 files changed, 24 insertions(+) New commits: commit 2500b10564bc37140b45ffc7abe641841fc6ec72 Author: mert AuthorDate: Thu Sep 10 17:04:36 2020 +0300 Commit: Andras Timar CommitDate: Thu Sep 10 21:57:55 2020 +0200 Fix unable to open password protected documents on mobile Change-Id: Ifd67cb6f3640784176abfe483f0364c1dfe4b5d9 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/102388 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 88b1fdafd..2066a1fd6 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -943,6 +943,10 @@ public class LOActivity extends AppCompatActivity { } return false; } +case "loadwithpassword": { +mProgressDialog.determinate(R.string.loading); +return true; +} } return true; } diff --git a/common/Session.hpp b/common/Session.hpp index 34a566b3c..523b45b12 100644 --- a/common/Session.hpp +++ b/common/Session.hpp @@ -180,6 +180,10 @@ public: bool getHaveDocPassword() const { return _haveDocPassword; } +void setHaveDocPassword(const bool val) { _haveDocPassword = val; } + +void setDocPassword(const std::string& password) { _docPassword = password; } + const std::string& getDocPassword() const { return _docPassword; } const std::string& getUserExtraInfo() const { return _userExtraInfo; } diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js index 32a601aca..ce834a21f 100644 --- a/loleaflet/src/core/Socket.js +++ b/loleaflet/src/core/Socket.js @@ -683,6 +683,9 @@ L.Socket = L.Class.extend({ callback: L.bind(function(data) { if (data) { this._map._docPassword = data.password; + if (window.ThisIsAMobileApp) { + window.postMobileMessage('loadwithpassword password=' + data.password); + } this._map.loadDocument(); } else if (passwordType === 'to-modify') { this._map._docPassword = ''; diff --git a/wsd/ClientSession.cpp b/wsd/ClientSession.cpp index b24f9b655..c00c7dbea 100644 --- a/wsd/ClientSession.cpp +++ b/wsd/ClientSession.cpp @@ -392,6 +392,19 @@ bool ClientSession::_handleInput(const char *buffer, int length) return loadDocument(buffer, length, tokens, docBroker); } +else if (tokens.equals(0, "loadwithpassword")) +{ +std::string docPassword; +if (tokens.size() > 1 && getTokenString(tokens[1], "password", docPassword)) +{ +if (!docPassword.empty()) +{ +setHaveDocPassword(true); +setDocPassword(tokens[1]); +} +} +return loadDocument(buffer, length, tokens, docBroker); +} else if (tokens[0] != "canceltiles" && tokens[0] != "tileprocessed" && tokens[0] != "clientzoom" && ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - android/lib
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 1 file changed, 4 insertions(+) New commits: commit e527603c3b863294babec82a9098768d54375cac Author: mert AuthorDate: Tue Aug 25 22:44:12 2020 +0300 Commit: Andras Timar CommitDate: Wed Aug 26 09:19:45 2020 +0200 Fix insert image dialog only opens once Change-Id: I5a184feadcf25e22829f80ad4da20d25e04d3f27 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101348 Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit 851bdeb949d28dd5ee5d451b85b121eecb160a6f) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101355 Tested-by: Andras Timar diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index c131a983f..88b1fdafd 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -578,6 +578,10 @@ public class LOActivity extends AppCompatActivity { @Override public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (resultCode != RESULT_OK) { +if (requestCode == REQUEST_SELECT_IMAGE_FILE) { +valueCallback.onReceiveValue(null); +valueCallback = null; +} return; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: android/lib
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |4 1 file changed, 4 insertions(+) New commits: commit 851bdeb949d28dd5ee5d451b85b121eecb160a6f Author: mert AuthorDate: Tue Aug 25 22:44:12 2020 +0300 Commit: Andras Timar CommitDate: Wed Aug 26 09:19:04 2020 +0200 Fix insert image dialog only opens once Change-Id: I5a184feadcf25e22829f80ad4da20d25e04d3f27 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101348 Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 24319e215..77f9e0e68 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -577,6 +577,10 @@ public class LOActivity extends AppCompatActivity { @Override public void onActivityResult(int requestCode, int resultCode, Intent intent) { if (resultCode != RESULT_OK) { +if (requestCode == REQUEST_SELECT_IMAGE_FILE) { +valueCallback.onReceiveValue(null); +valueCallback = null; +} return; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - android/lib loleaflet/css loleaflet/src
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java | 15 +++ loleaflet/css/toolbar.css|1 loleaflet/src/control/Control.MobileTopBar.js|2 loleaflet/src/control/Control.Toolbar.js |8 +++ loleaflet/src/control/Control.UIManager.js | 21 +- loleaflet/src/control/Permission.js |6 ++ loleaflet/src/map/Map.js |5 ++ 7 files changed, 55 insertions(+), 3 deletions(-) New commits: commit 2e591af0322535e08bd4c2f3ad459e4e471f772a Author: mert AuthorDate: Wed Feb 12 20:53:34 2020 +0300 Commit: Jan Holesovsky CommitDate: Fri Aug 14 21:53:46 2020 +0200 android: back button switches to readonly mode instead of closing Currently pressing back button on edit mode closes the document, this patch may prevent unintentional touches Change-Id: Ic7061186fa8794203fd4614c07a11b219d3a10d9 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100666 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tumer Reviewed-by: Jan Holesovsky diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 24319e215..c131a983f 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -122,6 +122,7 @@ public class LOActivity extends AppCompatActivity { /** In case the mobile-wizard is visible, we have to intercept the Android's Back button. */ private boolean mMobileWizardVisible = false; +private boolean mIsEditModeActive = false; private ValueCallback valueCallback; @@ -693,6 +694,9 @@ public class LOActivity extends AppCompatActivity { // just return one level up in the mobile-wizard (or close it) callFakeWebsocketOnMessage("'mobile: mobilewizardback'"); return; +} else if (mIsEditModeActive) { +callFakeWebsocketOnMessage("'mobile: readonlymode'"); +return; } finishWithProgress(); @@ -924,6 +928,17 @@ public class LOActivity extends AppCompatActivity { startActivity(intent); return false; } +case "EDITMODE": { +switch (messageAndParam[1]) { +case "on": +mIsEditModeActive = true; +break; +case "off": +mIsEditModeActive = false; +break; +} +return false; +} } return true; } diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css index 604120e54..aed7e7e2b 100644 --- a/loleaflet/css/toolbar.css +++ b/loleaflet/css/toolbar.css @@ -710,6 +710,7 @@ button.leaflet-control-search-next .w2ui-icon.users{ background: url('images/contacts-dark.svg') no-repeat center; } .w2ui-icon.fullscreen{ background: url('images/lc_fullscreen.svg') no-repeat center !important; } .w2ui-icon.closemobile{ background: url('images/lc_closedocmobile.svg') no-repeat center !important; } +.w2ui-icon.editmode { background: url("images/lc_listitem-selected.svg") no-repeat center / 28px !important; } .w2ui-icon.closetoolbar{ background: url('images/close_toolbar.svg') no-repeat center !important; } .w2ui-icon.sidebar_modify_page{ background: url('images/lc_formproperties.svg') no-repeat center !important; } .w2ui-icon.sidebar_slide_change{ background: url('images/sidebar-transition-large.svg') no-repeat center !important; } diff --git a/loleaflet/src/control/Control.MobileTopBar.js b/loleaflet/src/control/Control.MobileTopBar.js index d754f0a19..d7f259893 100644 --- a/loleaflet/src/control/Control.MobileTopBar.js +++ b/loleaflet/src/control/Control.MobileTopBar.js @@ -193,6 +193,7 @@ L.Control.MobileTopBar = L.Control.extend({ toolbarDownButtons.forEach(function(id) { toolbar.enable(id); }); + toolbar.set('closemobile', {img: 'editmode'}); } } else { toolbar = w2ui['actionbar']; @@ -200,6 +201,7 @@ L.Control.MobileTopBar = L.Control.extend({ toolbarDownButtons.forEach(function(id) { toolbar.disable(id); }); + toolbar.set('closemobile', {img: 'closemobile'}); } } }, diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index
[Libreoffice-commits] online.git: loleaflet/js
loleaflet/js/global.js | 35 +++ 1 file changed, 23 insertions(+), 12 deletions(-) New commits: commit f8f6189bdd0c75b86d12268cfa97a7090ddbbe4d Author: mert AuthorDate: Wed Jun 24 19:39:32 2020 +0300 Commit: Andras Timar CommitDate: Mon Jun 29 08:33:27 2020 +0200 Fix url errors on backgroundImage in css files for proxy Current replacing url strings method works fine, however, it does not cover all the rules for cases like when @media or @import are used. They have a subset of their own rules which must be covered as well. Change-Id: Ib10f7cc361aea5cd3b855f64e3a64566a6c51a12 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97071 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index 3420b9c13..0ed660e69 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -571,20 +571,16 @@ { // re-write relative URLs in CSS - somewhat grim. window.addEventListener('load', function() { - var sheets = document.styleSheets; - for (var i = 0; i < sheets.length; ++i) { - var relBases = sheets[i].href.split('/'); - relBases.pop(); // bin last - css name. - var replaceBase = 'url("' + relBases.join('/') + '/images/'; + var replaceUrls = function(rules, replaceBase) { + if (!rules) + return; - var rules; - try { - rules = sheets[i].cssRules || sheets[i].rules; - } catch (err) { - console.log('Missing CSS from ' + sheets[i].href); - continue; - } for (var r = 0; r < rules.length; ++r) { + // check subset of rules like @media or @import + if (rules[r] && rules[r].type != 1) { + replaceUrls(rules[r].cssRules || rules[r].rules, replaceBase); + continue; + } if (!rules[r] || !rules[r].style) continue; var img = rules[r].style.backgroundImage; @@ -596,6 +592,21 @@ img.replace('url("images/', replaceBase); } } + }; + var sheets = document.styleSheets; + for (var i = 0; i < sheets.length; ++i) { + var relBases = sheets[i].href.split('/'); + relBases.pop(); // bin last - css name. + var replaceBase = 'url("' + relBases.join('/') + '/images/'; + + var rules; + try { + rules = sheets[i].cssRules || sheets[i].rules; + } catch (err) { + console.log('Missing CSS from ' + sheets[i].href); + continue; + } + replaceUrls(rules, replaceBase); } }, false); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
loleaflet/src/control/Toolbar.js |9 + 1 file changed, 9 insertions(+) New commits: commit 2440b6209ed4934ee6af71ef8f5a87b1af71fd30 Author: mert AuthorDate: Thu Jun 25 18:53:39 2020 +0300 Commit: Andras Timar CommitDate: Fri Jun 26 10:28:09 2020 +0200 Fix images are not shown in online help page on proxy Relative urls must be replaced for proxy Change-Id: Ia1d888941c33736c4eb19070aec73c5bdd6fa197 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97166 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit 29c92b5c8db5b470facf09b19811805a9ea69192) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97138 diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 1ce90a3ba..6f76e0540 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -254,6 +254,15 @@ L.Map.include({ } } else /* id === 'online-help' */ { document.getElementById('keyboard-shortcuts').style.display='none'; + if (window.socketProxy) { + var helpdiv = document.getElementById('online-help'); + var imgList = helpdiv.querySelectorAll('img'); + for (var p = 0; p < imgList.length; p++) { + var imgSrc = imgList[p].src; + imgSrc = imgSrc.substring(imgSrc.indexOf('/images')); + imgList[p].src = window.host + window.serviceRoot + '/loleaflet/dist'+ imgSrc; + } + } // Display help according to document opened if (map.getDocType() === 'text') { var x = document.getElementsByClassName('text'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Toolbar.js |9 + 1 file changed, 9 insertions(+) New commits: commit 94402959af480b2026c3f785e48f236e44bb0830 Author: mert AuthorDate: Thu Jun 25 18:53:39 2020 +0300 Commit: Andras Timar CommitDate: Thu Jun 25 22:37:01 2020 +0200 Fix images are not shown in online help page on proxy Relative urls must be replaced for proxy Change-Id: Ia1d888941c33736c4eb19070aec73c5bdd6fa197 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97166 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 89c191294..7f24d3a55 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -254,6 +254,15 @@ L.Map.include({ } } else /* id === 'online-help' */ { document.getElementById('keyboard-shortcuts').style.display='none'; + if (window.socketProxy) { + var helpdiv = document.getElementById('online-help'); + var imgList = helpdiv.querySelectorAll('img'); + for (var p = 0; p < imgList.length; p++) { + var imgSrc = imgList[p].src; + imgSrc = imgSrc.substring(imgSrc.indexOf('/images')); + imgList[p].src = window.host + window.serviceRoot + '/loleaflet/dist'+ imgSrc; + } + } // Display help according to document opened if (map.getDocType() === 'text') { var x = document.getElementsByClassName('text'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/js
loleaflet/js/global.js | 35 +++ 1 file changed, 23 insertions(+), 12 deletions(-) New commits: commit d49e05cde9a057712ad469e82079ce9ffb45e988 Author: mert AuthorDate: Wed Jun 24 19:39:32 2020 +0300 Commit: Andras Timar CommitDate: Thu Jun 25 15:36:57 2020 +0200 Fix url errors on backgroundImage in css files for proxy Current replacing url strings method works fine, however, it does not cover all the rules for cases like when @media or @import are used. They have a subset of their own rules which must be covered as well. Change-Id: Ib10f7cc361aea5cd3b855f64e3a64566a6c51a12 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/97060 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index 6a0bd23df..5e0007d43 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -571,20 +571,16 @@ { // re-write relative URLs in CSS - somewhat grim. window.addEventListener('load', function() { - var sheets = document.styleSheets; - for (var i = 0; i < sheets.length; ++i) { - var relBases = sheets[i].href.split('/'); - relBases.pop(); // bin last - css name. - var replaceBase = 'url("' + relBases.join('/') + '/images/'; + var replaceUrls = function(rules, replaceBase) { + if (!rules) + return; - var rules; - try { - rules = sheets[i].cssRules || sheets[i].rules; - } catch (err) { - console.log('Missing CSS from ' + sheets[i].href); - continue; - } for (var r = 0; r < rules.length; ++r) { + // check subset of rules like @media or @import + if (rules[r] && rules[r].type != 1) { + replaceUrls(rules[r].cssRules || rules[r].rules, replaceBase); + continue; + } if (!rules[r] || !rules[r].style) continue; var img = rules[r].style.backgroundImage; @@ -596,6 +592,21 @@ img.replace('url("images/', replaceBase); } } + }; + var sheets = document.styleSheets; + for (var i = 0; i < sheets.length; ++i) { + var relBases = sheets[i].href.split('/'); + relBases.pop(); // bin last - css name. + var replaceBase = 'url("' + relBases.join('/') + '/images/'; + + var rules; + try { + rules = sheets[i].cssRules || sheets[i].rules; + } catch (err) { + console.log('Missing CSS from ' + sheets[i].href); + continue; + } + replaceUrls(rules, replaceBase); } }, false); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - kit/ChildSession.cpp
kit/ChildSession.cpp | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) New commits: commit a733718ac40a090ea77d8cfd48a6514b6c16b527 Author: mert AuthorDate: Thu Jun 18 20:30:56 2020 +0300 Commit: Andras Timar CommitDate: Thu Jun 18 23:06:53 2020 +0200 Fix insert local image for online Change-Id: I4edde45cb6c36c5f52b34ac23692c10ef7a5148f Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96623 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Andras Timar (cherry picked from commit d29c986e6ad8f30abc1975c945bad62bc75d89f7) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96635 diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 7e2a84e0d..4b27da4c8 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -1194,7 +1194,15 @@ bool ChildSession::insertFile(const char* /*buffer*/, int /*length*/, const Stri #if !MOBILEAPP if (type == "graphic" || type == "selectbackground") -url = "file://" + std::string(JAILED_DOCUMENT_ROOT) + "insertfile/" + name; +{ +std::string jailDoc = JAILED_DOCUMENT_ROOT; +if (NoCapsForKit) +{ +jailDoc = Poco::URI(getJailedFilePath()).getPath(); +jailDoc = jailDoc.substr(0, jailDoc.find(JAILED_DOCUMENT_ROOT)) + JAILED_DOCUMENT_ROOT; +} +url = "file://" + jailDoc + "insertfile/" + name; +} else if (type == "graphicurl") URI::decode(name, url); #else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: kit/ChildSession.cpp
kit/ChildSession.cpp | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) New commits: commit d29c986e6ad8f30abc1975c945bad62bc75d89f7 Author: mert AuthorDate: Thu Jun 18 20:30:56 2020 +0300 Commit: Andras Timar CommitDate: Thu Jun 18 21:16:57 2020 +0200 Fix insert local image for online Change-Id: I4edde45cb6c36c5f52b34ac23692c10ef7a5148f Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96623 Tested-by: Jenkins CollaboraOffice Tested-by: Jenkins Reviewed-by: Andras Timar diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index 7e2a84e0d..4b27da4c8 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -1194,7 +1194,15 @@ bool ChildSession::insertFile(const char* /*buffer*/, int /*length*/, const Stri #if !MOBILEAPP if (type == "graphic" || type == "selectbackground") -url = "file://" + std::string(JAILED_DOCUMENT_ROOT) + "insertfile/" + name; +{ +std::string jailDoc = JAILED_DOCUMENT_ROOT; +if (NoCapsForKit) +{ +jailDoc = Poco::URI(getJailedFilePath()).getPath(); +jailDoc = jailDoc.substr(0, jailDoc.find(JAILED_DOCUMENT_ROOT)) + JAILED_DOCUMENT_ROOT; +} +url = "file://" + jailDoc + "insertfile/" + name; +} else if (type == "graphicurl") URI::decode(name, url); #else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: kit/ChildSession.cpp
kit/ChildSession.cpp | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) New commits: commit 2231f1c568f3ca4a24c03791880392a9665e19e1 Author: mert AuthorDate: Wed Jun 17 18:13:22 2020 +0300 Commit: Andras Timar CommitDate: Thu Jun 18 16:32:14 2020 +0200 online: fix io error on saveas Change-Id: Icd91eacf2945c803660aaacb1d46d169b1f9bd86 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96546 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index d9bf41631..7e2a84e0d 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2022,8 +2022,16 @@ bool ChildSession::saveAs(const char* /*buffer*/, int /*length*/, const StringVe return false; } -// TODO do we need a tempdir here? -url = std::string("file://") + JAILED_DOCUMENT_ROOT + pathSegments[pathSegments.size() - 1]; +std::string jailDoc = JAILED_DOCUMENT_ROOT; +if (NoCapsForKit) +{ +jailDoc = Poco::URI(getJailedFilePath()).getPath(); +jailDoc = jailDoc.substr(0, jailDoc.find(JAILED_DOCUMENT_ROOT)) + JAILED_DOCUMENT_ROOT; +} + +const std::string tmpDir = FileUtil::createRandomDir(jailDoc); +const Poco::Path filenameParam(pathSegments[pathSegments.size() - 1]); +url = std::string("file://") + jailDoc + tmpDir + "/" + filenameParam.getFileName(); wopiFilename = wopiURL.getPath(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - kit/ChildSession.cpp
kit/ChildSession.cpp | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) New commits: commit 1efdc09c628a37da4ac1c3c03a449922622d8baf Author: mert AuthorDate: Wed Jun 17 18:13:22 2020 +0300 Commit: Andras Timar CommitDate: Thu Jun 18 14:12:41 2020 +0200 online: fix io error on saveas Change-Id: Icd91eacf2945c803660aaacb1d46d169b1f9bd86 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/96570 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/kit/ChildSession.cpp b/kit/ChildSession.cpp index d9bf41631..7e2a84e0d 100644 --- a/kit/ChildSession.cpp +++ b/kit/ChildSession.cpp @@ -2022,8 +2022,16 @@ bool ChildSession::saveAs(const char* /*buffer*/, int /*length*/, const StringVe return false; } -// TODO do we need a tempdir here? -url = std::string("file://") + JAILED_DOCUMENT_ROOT + pathSegments[pathSegments.size() - 1]; +std::string jailDoc = JAILED_DOCUMENT_ROOT; +if (NoCapsForKit) +{ +jailDoc = Poco::URI(getJailedFilePath()).getPath(); +jailDoc = jailDoc.substr(0, jailDoc.find(JAILED_DOCUMENT_ROOT)) + JAILED_DOCUMENT_ROOT; +} + +const std::string tmpDir = FileUtil::createRandomDir(jailDoc); +const Poco::Path filenameParam(pathSegments[pathSegments.size() - 1]); +url = std::string("file://") + jailDoc + tmpDir + "/" + filenameParam.getFileName(); wopiFilename = wopiURL.getPath(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Toolbar.js | 20 1 file changed, 16 insertions(+), 4 deletions(-) New commits: commit 642c7598a7e5c937c08d03323c299b83e84e1b5e Author: mert AuthorDate: Fri May 29 17:00:25 2020 +0300 Commit: Andras Timar CommitDate: Mon Jun 1 21:38:07 2020 +0200 Fix proxy related welcome msg and help dialog problems Fixed cookie problem with proxy too for welcome message Change-Id: I8e3e6ccb7673bddd5c26e3d2aadd2da4ed03a2e4 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95152 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 0409c9d1c..11f07f8f6 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -215,7 +215,11 @@ L.Map.include({ w = iw / 5 + 590; } var map = this; - $.get('loleaflet-help.html', function(data) { + var helpLocation = 'loleaflet-help.html'; + if (window.socketProxy) + helpLocation = window.host + window.serviceRoot + '/loleaflet/dist/' + helpLocation; + + $.get(helpLocation, function(data) { var productName; if (window.ThisIsAMobileApp) { productName = window.MobileAppName; @@ -403,7 +407,10 @@ L.Map.include({ if (!calledFromMenu) { var WSDVerCookie = 'WSDWelcomeVersion=' + map._socket.WSDServer.Version; // Cookie will not expire for a year, and it will not be sent to other domains - WSDVerCookie += '; max-age=31536000; SameSite=Strict; path=/loleaflet'; + var cookiePath = '/loleaflet'; + if (window.socketProxy) + cookiePath = window.host + window.serviceRoot + cookiePath; + WSDVerCookie += '; max-age=31536000; SameSite=Strict; path=' + cookiePath; document.cookie = WSDVerCookie; } map.focus(); @@ -414,7 +421,9 @@ L.Map.include({ showWelcomeDialog: function(calledFromMenu) { console.log('showWelcomeDialog, calledFromMenu: ' + calledFromMenu); - var welcomeLocation = window.location.origin + window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/')) + '/welcome/welcome-' + String.locale + '.html'; + var welcomeLocation = 'welcome/welcome-' + String.locale + '.html'; + if (window.socketProxy) + welcomeLocation = window.host + window.serviceRoot + '/loleaflet/dist/' + welcomeLocation; var map = this; @@ -432,7 +441,10 @@ L.Map.include({ .fail(function() { // Welcome dialog disabled in loolwsd.xml or nonexistant for some other reason // Let's check back in a day (60 x 60 x 24 = 86400 seconds) - var welcomeDisabledCookie = 'WSDWelcomeDisabled=true; max-age=86400; SameSite=Strict; path=/loleaflet'; + var cookiePath = '/loleaflet'; + if (window.socketProxy) + cookiePath = window.host + window.serviceRoot + cookiePath; + var welcomeDisabledCookie = 'WSDWelcomeDisabled=true; max-age=86400; SameSite=Strict; path=' + cookiePath; document.cookie = welcomeDisabledCookie; if (calledFromMenu) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-4' - loleaflet/src
loleaflet/src/control/Toolbar.js | 20 1 file changed, 16 insertions(+), 4 deletions(-) New commits: commit ac61b2e7de7fa29b9c00977313b03519e5e909a8 Author: mert AuthorDate: Fri May 29 17:00:25 2020 +0300 Commit: Andras Timar CommitDate: Fri May 29 17:20:58 2020 +0200 Fix proxy related welcome msg and help dialog problems Fixed cookie problem with proxy too for welcome message Change-Id: I8e3e6ccb7673bddd5c26e3d2aadd2da4ed03a2e4 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95113 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 0409c9d1c..11f07f8f6 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -215,7 +215,11 @@ L.Map.include({ w = iw / 5 + 590; } var map = this; - $.get('loleaflet-help.html', function(data) { + var helpLocation = 'loleaflet-help.html'; + if (window.socketProxy) + helpLocation = window.host + window.serviceRoot + '/loleaflet/dist/' + helpLocation; + + $.get(helpLocation, function(data) { var productName; if (window.ThisIsAMobileApp) { productName = window.MobileAppName; @@ -403,7 +407,10 @@ L.Map.include({ if (!calledFromMenu) { var WSDVerCookie = 'WSDWelcomeVersion=' + map._socket.WSDServer.Version; // Cookie will not expire for a year, and it will not be sent to other domains - WSDVerCookie += '; max-age=31536000; SameSite=Strict; path=/loleaflet'; + var cookiePath = '/loleaflet'; + if (window.socketProxy) + cookiePath = window.host + window.serviceRoot + cookiePath; + WSDVerCookie += '; max-age=31536000; SameSite=Strict; path=' + cookiePath; document.cookie = WSDVerCookie; } map.focus(); @@ -414,7 +421,9 @@ L.Map.include({ showWelcomeDialog: function(calledFromMenu) { console.log('showWelcomeDialog, calledFromMenu: ' + calledFromMenu); - var welcomeLocation = window.location.origin + window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/')) + '/welcome/welcome-' + String.locale + '.html'; + var welcomeLocation = 'welcome/welcome-' + String.locale + '.html'; + if (window.socketProxy) + welcomeLocation = window.host + window.serviceRoot + '/loleaflet/dist/' + welcomeLocation; var map = this; @@ -432,7 +441,10 @@ L.Map.include({ .fail(function() { // Welcome dialog disabled in loolwsd.xml or nonexistant for some other reason // Let's check back in a day (60 x 60 x 24 = 86400 seconds) - var welcomeDisabledCookie = 'WSDWelcomeDisabled=true; max-age=86400; SameSite=Strict; path=/loleaflet'; + var cookiePath = '/loleaflet'; + if (window.socketProxy) + cookiePath = window.host + window.serviceRoot + cookiePath; + var welcomeDisabledCookie = 'WSDWelcomeDisabled=true; max-age=86400; SameSite=Strict; path=' + cookiePath; document.cookie = welcomeDisabledCookie; if (calledFromMenu) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Toolbar.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit dd6ce865faf57cf02244710b27c5f18dc27427b4 Author: mert AuthorDate: Thu May 28 14:54:14 2020 +0300 Commit: Andras Timar CommitDate: Thu May 28 14:29:36 2020 +0200 Fix welcomedialog does not show-up Change-Id: I38c2af5489b5557ef0cd8b944ba3b9cde316d693 Signed-off-by: mert Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95029 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 6798c620a..0409c9d1c 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -414,7 +414,7 @@ L.Map.include({ showWelcomeDialog: function(calledFromMenu) { console.log('showWelcomeDialog, calledFromMenu: ' + calledFromMenu); - var welcomeLocation = window.host + window.serviceRoot + '/welcome/welcome-' + String.locale + '.html'; + var welcomeLocation = window.location.origin + window.location.pathname.substr(0, window.location.pathname.lastIndexOf('/')) + '/welcome/welcome-' + String.locale + '.html'; var map = this; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/html loleaflet/js loleaflet/src
loleaflet/html/loleaflet.html.m4 |1 + loleaflet/js/global.js |1 + loleaflet/src/control/Toolbar.js |3 +++ 3 files changed, 5 insertions(+) New commits: commit 8fa5d48a360ceddc09754a508866a91b85c63e9c Author: mert AuthorDate: Wed May 20 17:17:44 2020 +0300 Commit: Andras Timar CommitDate: Wed May 20 16:40:12 2020 +0200 Add "Slow Proxy" string in About Change-Id: I1c04ef295bdecf782e41d8e299adc67df4f87390 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94581 Tested-by: Jenkins Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/html/loleaflet.html.m4 b/loleaflet/html/loleaflet.html.m4 index 3b63c87ff..547c603c5 100644 --- a/loleaflet/html/loleaflet.html.m4 +++ b/loleaflet/html/loleaflet.html.m4 @@ -223,6 +223,7 @@ m4_ifelse(MOBILEAPP,[true], LOKit m4_ifelse(MOBILEAPP,[],[]) + Copyright © _YEAR_, VENDOR. diff --git a/loleaflet/js/global.js b/loleaflet/js/global.js index 279f2b7c9..c867d28ff 100644 --- a/loleaflet/js/global.js +++ b/loleaflet/js/global.js @@ -426,6 +426,7 @@ global.createWebSocket = function(uri) { if (global.socketProxy) { + window.socketProxy = true; return new global.ProxySocket(uri); } else { return new WebSocket(uri); diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 8736ed0af..e01cef418 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -489,6 +489,9 @@ L.Map.include({ productNameWithURL = productName; content.find('#product-string').html(productString.replace('%productName', productNameWithURL)); + if (window.socketProxy) + content.find('#slow-proxy').text(_('"Slow Proxy"')); + var w; var iw = window.innerWidth; if (iw < 768) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Changes to 'refs/tags/CODE-4.2.3-1'
Tag 'CODE-4.2.3-1' created by Andras Timar at 2020-05-07 05:27 + CODE-4.2.3-1 Changes since co-4-2-0-branch-point-1498: --- 0 files changed --- ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Changes to 'refs/tags/cp-4.2.3-1'
Tag 'cp-4.2.3-1' created by Andras Timar at 2020-05-07 05:26 + cp-4.2.3-1 Changes since co-4-2-0-branch-point-1498: --- 0 files changed --- ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-3' - loleaflet/images loleaflet/src
loleaflet/images/lc_pageheight.svg | 13 + loleaflet/images/lc_pagewidth.svg|1 + loleaflet/images/lc_paperheight.svg | 13 + loleaflet/images/lc_paperwidth.svg |1 + loleaflet/src/control/Control.JSDialogBuilder.js | 16 +++- loleaflet/src/control/Control.Menubar.js | 16 ++-- loleaflet/src/control/Control.MobileWizard.js|4 loleaflet/src/layer/tile/TileLayer.js|2 +- 8 files changed, 54 insertions(+), 12 deletions(-) New commits: commit a5d14f2f72bee5c8ff5918ca1f6385a5655d2d25 Author: mert AuthorDate: Wed Apr 29 17:30:35 2020 +0300 Commit: Andras Timar CommitDate: Thu May 7 07:26:25 2020 +0200 mobile: sidebar page deck for Page Settings as mobilewizard Change-Id: I67cc40cb4fca4b9607e2c42d83ce66cc9bdd1eb8 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93170 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit 89526f85e3768a30f7d8f3c5050e64cd05c018af) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93536 diff --git a/loleaflet/images/lc_pageheight.svg b/loleaflet/images/lc_pageheight.svg new file mode 100644 index 0..9441c1bc3 --- /dev/null +++ b/loleaflet/images/lc_pageheight.svg @@ -0,0 +1,13 @@ +http://www.w3.org/2000/svg;> + + + + + + + + + + + + diff --git a/loleaflet/images/lc_pagewidth.svg b/loleaflet/images/lc_pagewidth.svg new file mode 100644 index 0..606f02d19 --- /dev/null +++ b/loleaflet/images/lc_pagewidth.svg @@ -0,0 +1 @@ +http://www.w3.org/2000/svg;> \ No newline at end of file diff --git a/loleaflet/images/lc_paperheight.svg b/loleaflet/images/lc_paperheight.svg new file mode 100644 index 0..9441c1bc3 --- /dev/null +++ b/loleaflet/images/lc_paperheight.svg @@ -0,0 +1,13 @@ +http://www.w3.org/2000/svg;> + + + + + + + + + + + + diff --git a/loleaflet/images/lc_paperwidth.svg b/loleaflet/images/lc_paperwidth.svg new file mode 100644 index 0..606f02d19 --- /dev/null +++ b/loleaflet/images/lc_paperwidth.svg @@ -0,0 +1 @@ +http://www.w3.org/2000/svg;> \ No newline at end of file diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 2390d11e1..b4179fa60 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -141,6 +141,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._controlHandlers['calcfuncpanel'] = this._calcFuncListPanelHandler; this._controlHandlers['tabcontrol'] = this._tabsControlHandler; this._controlHandlers['paneltabs'] = this._panelTabsHandler; + this._controlHandlers['singlepanel'] = this._singlePanelHandler; this._controlHandlers['container'] = this._containerHandler; this._controlHandlers['window'] = this._containerHandler; this._controlHandlers['borderwindow'] = this._containerHandler; @@ -739,6 +740,15 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, + _singlePanelHandler: function(parentContainer, data, builder) { + var item = data[0]; + if (item.children) { + var child = item.children[0]; + builder.build(parentContainer, [child]); + } + return false; + }, + _radiobuttonControl: function(parentContainer, data, builder) { var radiobutton = L.DomUtil.createWithId('input', data.id, parentContainer); radiobutton.type = 'radio'; @@ -2068,7 +2078,11 @@ L.Control.JSDialogBuilder = L.Control.extend({ && childData.children[0] && childData.children[0].type == 'panel' && childData.children[1] && childData.children[1].type == 'panel'; - if (twoPanelsAsChildren) { + if (childData.children && childData.children.length == 1 + && childData.children[0] && childData.children[0].type == 'panel') { + handler = this._controlHandlers['singlepanel']; + processChildren = handler(childObject, childData.children, this); + } else if (twoPanelsAsChildren) { handler = this._controlHandlers['paneltabs']; processChildren = handler(childObject, childData.children, this); } else { diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 9649055af..d2ef6b36d 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -514,10 +514,7 @@ L.Control.Menubar =
[Libreoffice-commits] online.git: loleaflet/images loleaflet/src
loleaflet/images/lc_pageheight.svg | 13 + loleaflet/images/lc_pagewidth.svg|1 + loleaflet/images/lc_paperheight.svg | 13 + loleaflet/images/lc_paperwidth.svg |1 + loleaflet/src/control/Control.JSDialogBuilder.js | 16 +++- loleaflet/src/control/Control.Menubar.js | 16 ++-- loleaflet/src/control/Control.MobileWizard.js|4 loleaflet/src/layer/tile/TileLayer.js|2 +- 8 files changed, 54 insertions(+), 12 deletions(-) New commits: commit 89526f85e3768a30f7d8f3c5050e64cd05c018af Author: mert AuthorDate: Wed Apr 29 17:30:35 2020 +0300 Commit: Andras Timar CommitDate: Thu May 7 07:06:58 2020 +0200 mobile: sidebar page deck for Page Settings as mobilewizard Change-Id: I67cc40cb4fca4b9607e2c42d83ce66cc9bdd1eb8 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93170 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/images/lc_pageheight.svg b/loleaflet/images/lc_pageheight.svg new file mode 100644 index 0..9441c1bc3 --- /dev/null +++ b/loleaflet/images/lc_pageheight.svg @@ -0,0 +1,13 @@ +http://www.w3.org/2000/svg;> + + + + + + + + + + + + diff --git a/loleaflet/images/lc_pagewidth.svg b/loleaflet/images/lc_pagewidth.svg new file mode 100644 index 0..606f02d19 --- /dev/null +++ b/loleaflet/images/lc_pagewidth.svg @@ -0,0 +1 @@ +http://www.w3.org/2000/svg;> \ No newline at end of file diff --git a/loleaflet/images/lc_paperheight.svg b/loleaflet/images/lc_paperheight.svg new file mode 100644 index 0..9441c1bc3 --- /dev/null +++ b/loleaflet/images/lc_paperheight.svg @@ -0,0 +1,13 @@ +http://www.w3.org/2000/svg;> + + + + + + + + + + + + diff --git a/loleaflet/images/lc_paperwidth.svg b/loleaflet/images/lc_paperwidth.svg new file mode 100644 index 0..606f02d19 --- /dev/null +++ b/loleaflet/images/lc_paperwidth.svg @@ -0,0 +1 @@ +http://www.w3.org/2000/svg;> \ No newline at end of file diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 2390d11e1..b4179fa60 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -141,6 +141,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._controlHandlers['calcfuncpanel'] = this._calcFuncListPanelHandler; this._controlHandlers['tabcontrol'] = this._tabsControlHandler; this._controlHandlers['paneltabs'] = this._panelTabsHandler; + this._controlHandlers['singlepanel'] = this._singlePanelHandler; this._controlHandlers['container'] = this._containerHandler; this._controlHandlers['window'] = this._containerHandler; this._controlHandlers['borderwindow'] = this._containerHandler; @@ -739,6 +740,15 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, + _singlePanelHandler: function(parentContainer, data, builder) { + var item = data[0]; + if (item.children) { + var child = item.children[0]; + builder.build(parentContainer, [child]); + } + return false; + }, + _radiobuttonControl: function(parentContainer, data, builder) { var radiobutton = L.DomUtil.createWithId('input', data.id, parentContainer); radiobutton.type = 'radio'; @@ -2068,7 +2078,11 @@ L.Control.JSDialogBuilder = L.Control.extend({ && childData.children[0] && childData.children[0].type == 'panel' && childData.children[1] && childData.children[1].type == 'panel'; - if (twoPanelsAsChildren) { + if (childData.children && childData.children.length == 1 + && childData.children[0] && childData.children[0].type == 'panel') { + handler = this._controlHandlers['singlepanel']; + processChildren = handler(childObject, childData.children, this); + } else if (twoPanelsAsChildren) { handler = this._controlHandlers['paneltabs']; processChildren = handler(childObject, childData.children, this); } else { diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 9649055af..d2ef6b36d 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -514,10 +514,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:PreviousTrackedChange'}, {uno:
[Libreoffice-commits] online.git: android/app
android/app/appSettings.gradle.in |3 +++ android/app/build.gradle |4 android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java |9 ++--- android/app/src/main/res/values/strings.xml |2 +- 4 files changed, 14 insertions(+), 4 deletions(-) New commits: commit 30a01c0b215209a0fc8bef7fc4c102e17b6754f0 Author: mert AuthorDate: Thu Apr 9 11:19:10 2020 +0300 Commit: Andras Timar CommitDate: Sun May 3 08:49:33 2020 +0200 tdf#131567 android: added version number in about dialog also included git-hashes Change-Id: Ia1d7f7f14b4c560ad7e47fd7a2f459e0da60e3d1 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91951 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/android/app/appSettings.gradle.in b/android/app/appSettings.gradle.in index cbef6f786..611a9e48a 100644 --- a/android/app/appSettings.gradle.in +++ b/android/app/appSettings.gradle.in @@ -8,6 +8,9 @@ ext { liboHasBranding = '@APP_HAS_BRANDING@' liboBrandingDir = '@APP_BRANDING_DIR@' liboAndroidAbi = '@ANDROID_ABI@' +liboOVersionHash= '@LOOLWSD_VERSION_HASH@' +liboCoreVersionHash = '@CORE_VERSION_HASH@' + } android.defaultConfig { applicationId '@ANDROID_PACKAGE_NAME@' diff --git a/android/app/build.gradle b/android/app/build.gradle index 9d45689bb..1b4848bd0 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -22,6 +22,8 @@ android { resValue "string", "app_name", "${liboAppName} Debug" resValue "string", "vendor", "${liboVendor}" resValue "string", "info_url", "${liboInfoURL}" +resValue "string", "online_version_hash", "${liboOVersionHash}" +resValue "string", "core_version_hash", "${liboCoreVersionHash}" resValue "string", "image_draw_header", "@drawable/drawer_header" manifestPlaceholders = [ appIcon: "${liboLauncherIcon}" ] buildConfigField "boolean", "APP_HAS_BRANDING", "${liboHasBranding}" @@ -37,6 +39,8 @@ android { resValue "string", "app_name", "${liboAppName}" resValue "string", "vendor", "${liboVendor}" resValue "string", "info_url", "${liboInfoURL}" +resValue "string", "online_version_hash", "${liboOVersionHash}" +resValue "string", "core_version_hash", "${liboCoreVersionHash}" if (file("src/main/res/drawable/drawer_header_brand.png").exists()) { resValue "string", "image_draw_header", "@drawable/drawer_header_brand" } else { diff --git a/android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java b/android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java index 0afad916a..b348cd58d 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/AboutDialogFragment.java @@ -52,11 +52,14 @@ public class AboutDialogFragment extends DialogFragment { { String versionName = getActivity().getPackageManager() .getPackageInfo(getActivity().getPackageName(), 0).versionName; -String[] tokens = versionName.split("/"); -if (tokens.length >= 2) +String onlineVersionHash = getString(R.string.online_version_hash); +String coreVersionHash = getString(R.string.core_version_hash); + +if (!onlineVersionHash.isEmpty() && !coreVersionHash.isEmpty() && !versionName.isEmpty()) { String version = String.format(versionView.getText().toString().replace("\n", ""), -tokens[0], "https://hub.libreoffice.org/git-online/; + tokens[1] + "\">" + tokens[1] + ""); +versionName, "https://hub.libreoffice.org/git-online/; + onlineVersionHash + "\">" + onlineVersionHash + "", +"https://hub.libreoffice.org/git-core/; + coreVersionHash + "\">" + coreVersionHash + ""); @SuppressWarnings("deprecation") // since 24 with additional option parameter Spanned versionString = Html.fromHtml(version); versionView.setText(versionString); diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 8368c33fc..d9db90079 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -2,7 +2,7 @@ Settings -Version: %1$s, Build ID: %2$s +Version: %1$s\nonline git-hash: %2$s\ncore git-hash: %3$s $APP_NAME is a modern, easy-to-use, open source productivity suite for word processing, spreadsheets, presentations and more. This release was supplied by $VENDOR.
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 89 +++ loleaflet/src/control/Control.MobileWizard.js| 23 - 2 files changed, 62 insertions(+), 50 deletions(-) New commits: commit d9cbd9d6f673dc70bcaa873a51dd30a9e4f5be4e Author: mert AuthorDate: Thu Apr 23 14:56:26 2020 +0300 Commit: Andras Timar CommitDate: Thu Apr 23 19:35:06 2020 +0200 mobilewizard: fix number format doesn't update properly Change-Id: I852dd79d9658f676e86b22cb1cb145264c9de2fe Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92762 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 4deb8e296..97f416d25 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -252,33 +252,20 @@ L.Control.JSDialogBuilder = L.Control.extend({ return false; }, - _updateListBox: function(builder, contentDiv, contentNode, sectionTitle, data, state) { - if ($(sectionTitle).find('.entry-value')[0]) - sectionTitle = $($(sectionTitle).find('.entry-value')).get(0); - else - sectionTitle = $(sectionTitle).find('.ui-header-left').find('span')[0]; - + _updateListBox: function(builder, sectionTitle, data, state) { if (!sectionTitle) return; - $(contentDiv).find('.selected').removeClass('selected'); - - var hasChildren = $(contentDiv).children().length > 0 && contentNode.children && contentNode.children.length > 0; var updateBy = builder._getListBoxUpdateType(data.id); - if (updateBy === 'index') { + + if (updateBy === 'index') sectionTitle.innerHTML = data.entries[state]; - data.selectedEntries[0] = state; - contentDiv.title = data.entries[state]; - if (hasChildren) { - $($(contentDiv).children().get(state)).addClass('selected'); - } - } else if (updateBy === 'value') { + else if (updateBy === 'value') sectionTitle.innerHTML = state; - if (hasChildren) { - $(contentDiv).find('p').filter(function() { - return $(this).text() === state; - }).addClass('selected'); - } + + if (builder.refreshSidebar) { + builder.wizard._refreshSidebar(0); + builder.refreshSidebar = false; } }, @@ -301,6 +288,13 @@ L.Control.JSDialogBuilder = L.Control.extend({ } var titleSpan = L.DomUtil.create('span', titleClass, leftDiv); + if (!valueNode && data.command) { + var items = builder.map['stateChangeHandler']; + var val = items.getItemValue(data.command); + if (val) + valueNode = L.DomUtil.create('div', '', null); + } + var rightDiv = L.DomUtil.create('div', 'ui-header-right', sectionTitle); if (valueNode) { var valueDiv = L.DomUtil.create('div', 'entry-value', rightDiv); @@ -310,36 +304,14 @@ L.Control.JSDialogBuilder = L.Control.extend({ var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', rightDiv); arrowSpan.innerHTML = '>'; - var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer); - contentDiv.title = data.text; - - builder._currentDepth++; - builder.build(contentDiv, [contentNode]); - builder._currentDepth--; - - if (!data.nosubmenu) - { - $(contentDiv).hide(); - if (builder.wizard) { - $(sectionTitle).click(function(event, data) { - builder.wizard.goLevelDown(contentDiv, data); - if (contentNode.onshow) - contentNode.onshow(); - }); - } else { - console.debug('Builder used outside of mobile wizard: please implement the click handler'); - } - } - else - $(sectionTitle).hide(); - var updateFunction = function(titleSpan) { var state = null; if (data.id)
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-2' - android/app
android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit 9dd6cb3983090148aa28b401d29b435384a6827e Author: mert AuthorDate: Tue Apr 14 20:01:05 2020 +0300 Commit: Mert Tümer CommitDate: Fri Apr 17 14:19:06 2020 +0200 Android: fix tapping on file name doesn't open files anymore. Change-Id: Ic5e34a1ee484fedc888d8fae58354241a3cd7beb Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92212 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tümer (cherry picked from commit 6c1f49d404663dcd305503083f6f4c5500a77800) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92305 diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java index cf69e690e..f7a1b9151 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java @@ -115,12 +115,16 @@ class RecentFilesAdapter extends RecyclerView.Adapterhttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: android/app
android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit 6c1f49d404663dcd305503083f6f4c5500a77800 Author: mert AuthorDate: Tue Apr 14 20:01:05 2020 +0300 Commit: Mert Tümer CommitDate: Fri Apr 17 07:56:23 2020 +0200 Android: fix tapping on file name doesn't open files anymore. Change-Id: Ic5e34a1ee484fedc888d8fae58354241a3cd7beb Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92212 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tümer diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java index cf69e690e..f7a1b9151 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java @@ -115,12 +115,16 @@ class RecentFilesAdapter extends RecyclerView.Adapterhttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-2' - loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 113 ++- 1 file changed, 89 insertions(+), 24 deletions(-) New commits: commit a87c98688f173b12b6259a756e2bb4028cfb4a77 Author: mert AuthorDate: Tue Apr 14 18:10:47 2020 +0300 Commit: Andras Timar CommitDate: Thu Apr 16 06:52:47 2020 +0200 mobilewizard: fix inconsistent state of items on Number Format implemented listbox updates for numberformatcombobox and fontsizecombobox to apply changes without reopening the mobile wizard. This patch also fixes the update problem of the checkbox items on number format page Change-Id: Ib330531f766e5d1ff0744585f324a235f5ae3121 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92204 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit db26ae326c0ba5c2cddcb1585ff7af1b139be842) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92295 diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 8727e065c..8162c5283 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -242,6 +242,46 @@ L.Control.JSDialogBuilder = L.Control.extend({ return true; }, + _getListBoxUpdateType: function(id) { + if (id) { + if (id === 'numberformatcombobox') + return 'index'; + else if (id === 'fontsizecombobox') + return 'value'; + } + return false; + }, + + _updateListBox: function(builder, contentDiv, contentNode, sectionTitle, data, state) { + if ($(sectionTitle).find('.entry-value')[0]) + sectionTitle = $($(sectionTitle).find('.entry-value')).get(0); + else + sectionTitle = $(sectionTitle).find('.ui-header-left').find('span')[0]; + + if (!sectionTitle) + return; + + $(contentDiv).find('.selected').removeClass('selected'); + + var hasChildren = $(contentDiv).children().length > 0 && contentNode.children && contentNode.children.length > 0; + var updateBy = builder._getListBoxUpdateType(data.id); + if (updateBy === 'index') { + sectionTitle.innerHTML = data.entries[state]; + data.selectedEntries[0] = state; + contentDiv.title = data.entries[state]; + if (hasChildren) { + $($(contentDiv).children().get(state)).addClass('selected'); + } + } else if (updateBy === 'value') { + sectionTitle.innerHTML = state; + if (hasChildren) { + $(contentDiv).find('p').filter(function() { + return $(this).text() === state; + }).addClass('selected'); + } + } + }, + _explorableEntry: function(parentContainer, data, contentNode, builder, valueNode, iconPath, updateCallback) { var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer); $(sectionTitle).css('justify-content', 'space-between'); @@ -270,28 +310,6 @@ L.Control.JSDialogBuilder = L.Control.extend({ var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', rightDiv); arrowSpan.innerHTML = '>'; - var updateFunction = function(titleSpan) { - var state = null; - if (data.id) - state = builder._getUnoStateForItemId(data.id, builder); - - if (state) { - titleSpan.innerHTML = state; - } else { - titleSpan.innerHTML = data.text; - } - }; - - updateCallback ? updateCallback(titleSpan) : updateFunction(titleSpan); - - builder.map.on('commandstatechanged', function(e) { - if (e.commandName === data.command || e.commandName === builder._mapWindowIdToUnoCommand(data.id)) - if (updateCallback) - updateCallback(titleSpan); - else - updateFunction(titleSpan); - }, this); - var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer); contentDiv.title = data.text; @@ -314,6 +332,33 @@ L.Control.JSDialogBuilder =
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js | 113 ++- 1 file changed, 89 insertions(+), 24 deletions(-) New commits: commit db26ae326c0ba5c2cddcb1585ff7af1b139be842 Author: mert AuthorDate: Tue Apr 14 18:10:47 2020 +0300 Commit: Andras Timar CommitDate: Wed Apr 15 23:38:22 2020 +0200 mobilewizard: fix inconsistent state of items on Number Format implemented listbox updates for numberformatcombobox and fontsizecombobox to apply changes without reopening the mobile wizard. This patch also fixes the update problem of the checkbox items on number format page Change-Id: Ib330531f766e5d1ff0744585f324a235f5ae3121 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92204 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 7ff08ce86..6d54c071f 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -242,6 +242,46 @@ L.Control.JSDialogBuilder = L.Control.extend({ return true; }, + _getListBoxUpdateType: function(id) { + if (id) { + if (id === 'numberformatcombobox') + return 'index'; + else if (id === 'fontsizecombobox') + return 'value'; + } + return false; + }, + + _updateListBox: function(builder, contentDiv, contentNode, sectionTitle, data, state) { + if ($(sectionTitle).find('.entry-value')[0]) + sectionTitle = $($(sectionTitle).find('.entry-value')).get(0); + else + sectionTitle = $(sectionTitle).find('.ui-header-left').find('span')[0]; + + if (!sectionTitle) + return; + + $(contentDiv).find('.selected').removeClass('selected'); + + var hasChildren = $(contentDiv).children().length > 0 && contentNode.children && contentNode.children.length > 0; + var updateBy = builder._getListBoxUpdateType(data.id); + if (updateBy === 'index') { + sectionTitle.innerHTML = data.entries[state]; + data.selectedEntries[0] = state; + contentDiv.title = data.entries[state]; + if (hasChildren) { + $($(contentDiv).children().get(state)).addClass('selected'); + } + } else if (updateBy === 'value') { + sectionTitle.innerHTML = state; + if (hasChildren) { + $(contentDiv).find('p').filter(function() { + return $(this).text() === state; + }).addClass('selected'); + } + } + }, + _explorableEntry: function(parentContainer, data, contentNode, builder, valueNode, iconPath, updateCallback) { var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer); $(sectionTitle).css('justify-content', 'space-between'); @@ -270,28 +310,6 @@ L.Control.JSDialogBuilder = L.Control.extend({ var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', rightDiv); arrowSpan.innerHTML = '>'; - var updateFunction = function(titleSpan) { - var state = null; - if (data.id) - state = builder._getUnoStateForItemId(data.id, builder); - - if (state) { - titleSpan.innerHTML = state; - } else { - titleSpan.innerHTML = data.text; - } - }; - - updateCallback ? updateCallback(titleSpan) : updateFunction(titleSpan); - - builder.map.on('commandstatechanged', function(e) { - if (e.commandName === data.command || e.commandName === builder._mapWindowIdToUnoCommand(data.id)) - if (updateCallback) - updateCallback(titleSpan); - else - updateFunction(titleSpan); - }, this); - var contentDiv = L.DomUtil.create('div', 'ui-content level-' + builder._currentDepth + ' mobile-wizard', parentContainer); contentDiv.title = data.text; @@ -314,6 +332,33 @@ L.Control.JSDialogBuilder = L.Control.extend({ } else $(sectionTitle).hide(); + + var updateFunction =
[Libreoffice-commits] online.git: cypress_test/integration_tests
cypress_test/integration_tests/mobile/calc/number_format_spec.js | 16 +- 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit 744b1ced2a90d319474d198a9a4eed5e821be912 Author: mert AuthorDate: Wed Apr 15 15:08:30 2020 +0300 Commit: Tamás Zolnai CommitDate: Wed Apr 15 14:32:51 2020 +0200 fix cypress failure due to id change of element Change-Id: I1df07e10c4b3c5bdc88417eb785dc711fc6dd0e2 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92265 Tested-by: Tamás Zolnai Reviewed-by: Tamás Zolnai diff --git a/cypress_test/integration_tests/mobile/calc/number_format_spec.js b/cypress_test/integration_tests/mobile/calc/number_format_spec.js index 79cb17cc0..dbf8f7ddc 100644 --- a/cypress_test/integration_tests/mobile/calc/number_format_spec.js +++ b/cypress_test/integration_tests/mobile/calc/number_format_spec.js @@ -22,7 +22,7 @@ describe('Apply number formatting.', function() { cy.get('#ScNumberFormatPropertyPanel') .click(); - cy.get('#category') + cy.get('#numberformatcombobox') .should('be.visible'); }); @@ -32,14 +32,14 @@ describe('Apply number formatting.', function() { function selectFormatting(formattingString) { // Select formatting list - cy.get('#category') + cy.get('#numberformatcombobox') .click(); cy.contains('.mobile-wizard.ui-combobox-text', formattingString) .click(); // Combobox entry contains the selected format - cy.get('#category .ui-header-left') + cy.get('#numberformatcombobox .ui-header-left') .should('have.text', formattingString); } @@ -82,7 +82,7 @@ describe('Apply number formatting.', function() { .should('have.class', 'selected'); // TODO: combobox entry is not updated - //cy.get('#category .ui-header-left') + //cy.get('#numberformatcombobox .ui-header-left') // .should('have.text', 'Percent'); // Decimal and leading zeros are changed. @@ -140,7 +140,7 @@ describe('Apply number formatting.', function() { .should('have.class', 'selected'); // TODO: combobox entry is not updated - //cy.get('#category .ui-header-left') + //cy.get('#numberformatcombobox .ui-header-left') // .should('have.text', 'Currency'); // Decimal and leading zeros are changed. @@ -207,7 +207,7 @@ describe('Apply number formatting.', function() { // .should('have.class', 'selected'); // TODO: combobox entry is not updated - //cy.get('#category .ui-header-left') + //cy.get('#numberformatcombobox .ui-header-left') // .should('have.text', 'Number'); calcHelper.copyContentToClipboard(); @@ -218,14 +218,14 @@ describe('Apply number formatting.', function() { it('Select date format from list.', function() { // Change to date - cy.get('#category') + cy.get('#numberformatcombobox') .click(); cy.contains('.mobile-wizard.ui-combobox-text', 'Date') .click(); // Combobox entry contains the selected format - cy.get('#category .ui-header-left') + cy.get('#numberformatcombobox .ui-header-left') .should('have.text', 'Date '); // Decimal and leading zeros are changed. ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-2' - android/app
android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java |4 1 file changed, 4 insertions(+) New commits: commit 0ccfa0ecc98b38fef59ce733842844246e54c77e Author: mert AuthorDate: Fri Apr 10 12:39:35 2020 +0300 Commit: Jan Holesovsky CommitDate: Fri Apr 10 13:45:51 2020 +0200 android: Blind fix for an exception of getContentResolver Change-Id: Iec24f014a2c82b8f4d4c134b9817651f558ecedb Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92005 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky (cherry picked from commit 93bf06a2078ade47db7c8a45ba448c3cc66aa96c) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92011 diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java index 380b4a64f..cf69e690e 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java @@ -76,6 +76,8 @@ class RecentFilesAdapter extends RecyclerView.Adapterhttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: android/app
android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java |4 1 file changed, 4 insertions(+) New commits: commit 93bf06a2078ade47db7c8a45ba448c3cc66aa96c Author: mert AuthorDate: Fri Apr 10 12:39:35 2020 +0300 Commit: Jan Holesovsky CommitDate: Fri Apr 10 12:59:11 2020 +0200 android: Blind fix for an exception of getContentResolver Change-Id: Iec24f014a2c82b8f4d4c134b9817651f558ecedb Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92005 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java index 380b4a64f..cf69e690e 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java @@ -76,6 +76,8 @@ class RecentFilesAdapter extends RecyclerView.Adapterhttps://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-2' - loleaflet/src
loleaflet/src/control/Control.Menubar.js |8 loleaflet/src/control/Control.Toolbar.js |8 +--- loleaflet/src/main.js|2 +- 3 files changed, 14 insertions(+), 4 deletions(-) New commits: commit b7de8a91dc79afd999411e491cb5dead19a83ec3 Author: mert AuthorDate: Wed Mar 25 23:15:10 2020 +0300 Commit: Jan Holesovsky CommitDate: Tue Apr 7 21:20:38 2020 +0200 mobile: Add search in the readonly mode Change-Id: I059b0337096f9eed21031724dbec22f29807a979 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91072 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky (cherry picked from commit f634264d89896be25f2853952241afe4e9d4c45c) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91722 Tested-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index e2396faf5..f7aa69111 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -489,6 +489,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:Paste'}, {uno: '.uno:SelectAll'} ]}, + {name: _('Search'), id: 'searchdialog', type: 'action'}, {name: _UNO('.uno:ChangesMenu', 'text'), id: 'changesmenu', type: 'menu', menu: [ {uno: '.uno:TrackChanges'}, {uno: '.uno:ShowTrackedChanges'}, @@ -535,6 +536,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:Paste'}, {uno: '.uno:SelectAll'} ]}, + {name: _('Search'), id: 'searchdialog', type: 'action'}, {name: _UNO('.uno:TableMenu', 'text'/*HACK should be 'presentation', but not in xcu*/), id: 'tablemenu', type: 'menu', menu: [ {uno: '.uno:InsertRowsBefore'}, {uno: '.uno:InsertRowsAfter'}, @@ -580,6 +582,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:Paste'}, {uno: '.uno:SelectAll'} ]}, + {name: _('Search'), id: 'searchdialog', type: 'action'}, {name: _UNO('.uno:SheetMenu', 'spreadsheet'), id: 'sheetmenu', type: 'menu', menu: [ {name: _UNO('.uno:InsertRowsMenu', 'spreadsheet'), id: 'insertrowsmenu', type: 'menu', menu: [ {uno: '.uno:InsertRowsBefore'}, @@ -1194,6 +1197,11 @@ L.Control.Menubar = L.Control.extend({ } } else if (id === 'repair') { this._map._socket.sendMessage('commandvalues command=.uno:DocumentRepair'); + } else if (id === 'searchdialog') { + $('#toolbar-down').hide(); + $('#toolbar-search').show(); + $('#mobile-edit-button').hide(); + L.DomUtil.get('search-input').focus(); } // Inform the host if asked if (postmessage) diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 6a61894df..21a434d56 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -186,7 +186,11 @@ function onClick(e, id, item, subItem) { } else if (id === 'hidesearchbar') { $('#toolbar-search').hide(); - $('#toolbar-down').show(); + if (map._permission === 'edit') + $('#toolbar-down').show(); + /** show edit button if only we are able to edit but in readonly mode */ + if (window.docPermission === 'edit' && map._permission === 'readonly') + $('#mobile-edit-button').show(); } else if (id === 'searchprev') { map.search(L.DomUtil.get('search-input').value, true); @@ -2304,7 +2308,6 @@ function onUpdatePermission(e) { toolbar.enable(id); }); } - $('#search-input').prop('disabled', false); if (window.mode.isMobile()) { $('#toolbar-down').show(); @@ -2347,7 +2350,6 @@ function onUpdatePermission(e) { toolbar.disable(id); }); } - $('#search-input').prop('disabled', true); if (window.mode.isMobile()) { $('#toolbar-down').hide(); diff --git a/loleaflet/src/main.js b/loleaflet/src/main.js index 7fdbee43d..5b2799df6 100644 --- a/loleaflet/src/main.js +++ b/loleaflet/src/main.js @@ -49,7 +49,6 @@ if
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Menubar.js |8 loleaflet/src/control/Control.Toolbar.js |8 +--- loleaflet/src/main.js|2 +- 3 files changed, 14 insertions(+), 4 deletions(-) New commits: commit f634264d89896be25f2853952241afe4e9d4c45c Author: mert AuthorDate: Wed Mar 25 23:15:10 2020 +0300 Commit: Jan Holesovsky CommitDate: Tue Apr 7 20:28:40 2020 +0200 mobile: Add search in the readonly mode Change-Id: I059b0337096f9eed21031724dbec22f29807a979 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91072 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index e2396faf5..f7aa69111 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -489,6 +489,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:Paste'}, {uno: '.uno:SelectAll'} ]}, + {name: _('Search'), id: 'searchdialog', type: 'action'}, {name: _UNO('.uno:ChangesMenu', 'text'), id: 'changesmenu', type: 'menu', menu: [ {uno: '.uno:TrackChanges'}, {uno: '.uno:ShowTrackedChanges'}, @@ -535,6 +536,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:Paste'}, {uno: '.uno:SelectAll'} ]}, + {name: _('Search'), id: 'searchdialog', type: 'action'}, {name: _UNO('.uno:TableMenu', 'text'/*HACK should be 'presentation', but not in xcu*/), id: 'tablemenu', type: 'menu', menu: [ {uno: '.uno:InsertRowsBefore'}, {uno: '.uno:InsertRowsAfter'}, @@ -580,6 +582,7 @@ L.Control.Menubar = L.Control.extend({ {uno: '.uno:Paste'}, {uno: '.uno:SelectAll'} ]}, + {name: _('Search'), id: 'searchdialog', type: 'action'}, {name: _UNO('.uno:SheetMenu', 'spreadsheet'), id: 'sheetmenu', type: 'menu', menu: [ {name: _UNO('.uno:InsertRowsMenu', 'spreadsheet'), id: 'insertrowsmenu', type: 'menu', menu: [ {uno: '.uno:InsertRowsBefore'}, @@ -1194,6 +1197,11 @@ L.Control.Menubar = L.Control.extend({ } } else if (id === 'repair') { this._map._socket.sendMessage('commandvalues command=.uno:DocumentRepair'); + } else if (id === 'searchdialog') { + $('#toolbar-down').hide(); + $('#toolbar-search').show(); + $('#mobile-edit-button').hide(); + L.DomUtil.get('search-input').focus(); } // Inform the host if asked if (postmessage) diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 6a61894df..21a434d56 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -186,7 +186,11 @@ function onClick(e, id, item, subItem) { } else if (id === 'hidesearchbar') { $('#toolbar-search').hide(); - $('#toolbar-down').show(); + if (map._permission === 'edit') + $('#toolbar-down').show(); + /** show edit button if only we are able to edit but in readonly mode */ + if (window.docPermission === 'edit' && map._permission === 'readonly') + $('#mobile-edit-button').show(); } else if (id === 'searchprev') { map.search(L.DomUtil.get('search-input').value, true); @@ -2304,7 +2308,6 @@ function onUpdatePermission(e) { toolbar.enable(id); }); } - $('#search-input').prop('disabled', false); if (window.mode.isMobile()) { $('#toolbar-down').show(); @@ -2347,7 +2350,6 @@ function onUpdatePermission(e) { toolbar.disable(id); }); } - $('#search-input').prop('disabled', true); if (window.mode.isMobile()) { $('#toolbar-down').hide(); diff --git a/loleaflet/src/main.js b/loleaflet/src/main.js index 7fdbee43d..5b2799df6 100644 --- a/loleaflet/src/main.js +++ b/loleaflet/src/main.js @@ -49,7 +49,6 @@ if (wopiSrc != '') { } var notWopiButIframe = getParameterByName('NotWOPIButIframe') != ''; - var map = L.map('map', { server: host, doc: docURL, @@ -90,6
[Libreoffice-commits] online.git: loleaflet/css loleaflet/src
loleaflet/css/mobilewizard.css | 13 ++ loleaflet/src/control/Control.JSDialogBuilder.js | 29 ++- 2 files changed, 41 insertions(+), 1 deletion(-) New commits: commit 4dad970c01ef85b4874bf753e5c6c3169fd256d8 Author: mert AuthorDate: Mon Mar 30 17:39:23 2020 +0300 Commit: Andras Timar CommitDate: Tue Mar 31 17:51:39 2020 +0200 mobilewizard: style clear direct formatting button Change-Id: If34aad5035270d542b49d07c3aa7fe100184ce19 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91418 Reviewed-by: Andras Timar Tested-by: Jenkins CollaboraOffice diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css index 0110d5cef..eb1933445 100644 --- a/loleaflet/css/mobilewizard.css +++ b/loleaflet/css/mobilewizard.css @@ -317,6 +317,19 @@ background-color: #eee; } + .ui-header.mobile-wizard-widebutton { + width: 100%; + height: 56px !important; + font-size: 11pt !important; + margin: 0px; + padding: 0px; + border: solid 1px #fff; + display: flex; + flex-direction: row; + align-items: center; + background-color: #fff; + } + .ui-content .unobutton { width: 32px; height: 32px; diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index a7394813f..08d5552fb 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -4,7 +4,7 @@ * from the JSON description provided by the server. */ -/* global $ _ */ +/* global $ _ _UNO */ L.Control.JSDialogBuilder = L.Control.extend({ @@ -71,6 +71,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ this._toolitemHandlers['.uno:FrameLineColor'] = this._colorControl; this._toolitemHandlers['.uno:Color'] = this._colorControl; this._toolitemHandlers['.uno:FillColor'] = this._colorControl; + this._toolitemHandlers['.uno:ResetAttributes'] = this._clearFormattingControl; this._currentDepth = 0; }, @@ -1389,6 +1390,32 @@ L.Control.JSDialogBuilder = L.Control.extend({ return selectedColor; }, + _clearFormattingControl: function(parentContainer, data, builder) { + var iconPath = builder._createIconPath(data.command); + var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard-widebutton ui-widget', parentContainer); + $(sectionTitle).css('justify-content', 'space-between'); + + if (data && data.id) + sectionTitle.id = data.id; + + var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle); + var titleClass = ''; + if (iconPath) { + var icon = L.DomUtil.create('img', 'menu-entry-icon', leftDiv); + icon.src = iconPath; + icon.alt = ''; + titleClass = 'menu-entry-with-icon'; + } + var titleSpan = L.DomUtil.create('span', titleClass, leftDiv); + titleSpan.innerHTML = builder._cleanText(_UNO(data.command)); + + $(sectionTitle).click(function () { + builder.callback('toolbutton', 'click', sectionTitle, data.command, builder); + }); + + return false; + }, + _colorControl: function(parentContainer, data, builder) { var titleOverride = builder._getTitleForControlWithId(data.id); if (titleOverride) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Toolbar.js |2 ++ loleaflet/src/layer/tile/TileLayer.js |7 +++ loleaflet/src/map/handler/Map.TouchGesture.js |6 +- 3 files changed, 14 insertions(+), 1 deletion(-) New commits: commit c4f9e4bda711489548d8d7610f9dfea61d84ce47 Author: mert AuthorDate: Mon Mar 30 12:03:12 2020 +0300 Commit: Andras Timar CommitDate: Mon Mar 30 21:51:48 2020 +0200 mobile: fix hyperlink on selected text Insert hyperlink dialog does not have the selected text in the Text field. So when you select something and want to make it a hyperlink, you have to type the text again. Also fixed tapping on hyperlink popup changes cursor position making editing the link unable to edit Change-Id: I0d00c4cf001de0f297cc2ed7e5b0f8576e1dab01 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91349 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index e6316188a..d1e4bdafd 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -442,6 +442,8 @@ L.Map.include({ link = this.hyperlinkUnderCursor.link; } else if (this._clip && this._clip._selectionType == 'text') { text = this.extractContent(this._clip._selectionContent); + } else if (this._docLayer._selectedTextContent) { + text = this.extractContent(this._docLayer._selectedTextContent); } vex.dialog.open({ diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 6ce377988..5245d085f 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -194,6 +194,7 @@ L.TileLayer = L.GridLayer.extend({ this._editorId = -1; this._followUser = false; this._followEditor = false; + this._selectedTextContent = ''; }, onAdd: function (map) { @@ -619,6 +620,9 @@ L.TileLayer = L.GridLayer.extend({ else if (textMsg.startsWith('textselectioncontent:')) { if (this._map._clip) this._map._clip.setTextSelectionHTML(textMsg.substr(22)); + else + // hack for ios and android to get selected text into hyperlink insertion dialog + this._selectedTextContent = textMsg.substr(22); } else if (textMsg.startsWith('textselectionend:')) { this._onTextSelectionEndMsg(textMsg); @@ -1991,6 +1995,8 @@ L.TileLayer = L.GridLayer.extend({ this._onUpdateCellCursor(); if (this._map._clip) this._map._clip.clearSelection(); + else + this._selectedTextContent = ''; }, containsSelection: function (latlng) { @@ -3081,6 +3087,7 @@ L.TileLayer = L.GridLayer.extend({ else { this._textSelectionStart = null; this._textSelectionEnd = null; + this._selectedTextContent = ''; for (key in this._selectionHandles) { this._map.removeLayer(this._selectionHandles[key]); this._selectionHandles[key].isDragged = false; diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index cf0041d53..95c2eb25e 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -302,8 +302,12 @@ L.Map.TouchGesture = L.Handler.extend({ // clicked a hyperlink popup - not really designed for this. if (this._map.hyperlinkPopup && e.target && - this._map.hyperlinkPopup._contentNode == e.target.parentNode) + this._map.hyperlinkPopup._contentNode == e.target.parentNode) { this._map.fire('hyperlinkclicked', {url: e.target.href}); + // not forward mouse events to core if the user tap on a hyperlink popup box + // for instance on Writer that causes the text cursor to be moved + return; + } this._map.fire('closepopups'); this._map.fire('closemobilewizard'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Changes to 'refs/tags/CODE-4.2.1-2'
Tag 'CODE-4.2.1-2' created by Andras Timar at 2020-03-27 18:38 + CODE-4.2.1-2 Changes since CP-Android-4.2.1-fix1-23: --- 0 files changed --- ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Changes to 'refs/tags/cp-4.2.1-2'
Tag 'cp-4.2.1-2' created by Andras Timar at 2020-03-27 18:37 + cp-4.2.1-2 Changes since CP-Android-4.2.1-fix1-23: --- 0 files changed --- ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-1' - loleaflet/src
loleaflet/src/layer/tile/TileLayer.js |2 +- loleaflet/src/map/handler/Map.TouchGesture.js |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 8228a56544160f34d876aa4d4b1a56691226bd9a Author: mert AuthorDate: Fri Mar 27 19:24:17 2020 +0300 Commit: Andras Timar CommitDate: Fri Mar 27 19:36:20 2020 +0100 Fix url popups can't be clicked on browsers Change-Id: I3c2008e06370b4b48a93b68e58ad1e45a4f75d27 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91230 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit 272715a96d5f9b040a9f2e87414dfcef2c4972d6) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91180 Tested-by: Andras Timar diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 2e560233e..17521d449 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1119,7 +1119,7 @@ L.TileLayer = L.GridLayer.extend({ // # for internal links if (!url.startsWith('#')) { this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false}) - .setContent(''+url+'') + .setContent('' + url + '') .setLatLng(position) .openOn(this._map); } diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 20143958f..470851455 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -326,9 +326,9 @@ L.Map.TouchGesture = L.Handler.extend({ this._toolbar.remove(); // clicked a hyperlink popup - not really designed for this. - if (this._map.hyperlinkPopup && e.target && e.target.id === 'hyperlinkpopup' && + if (this._map.hyperlinkPopup && e.target && this._map.hyperlinkPopup._contentNode == e.target.parentNode) - this._map.fire('hyperlinkclicked', {url: e.target.innerHTML}); + this._map.fire('hyperlinkclicked', {url: e.target.href}); this._map.fire('closepopups'); this._map.fire('closemobilewizard'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/layer/tile/TileLayer.js |2 +- loleaflet/src/map/handler/Map.TouchGesture.js |4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) New commits: commit 272715a96d5f9b040a9f2e87414dfcef2c4972d6 Author: mert AuthorDate: Fri Mar 27 19:24:17 2020 +0300 Commit: Andras Timar CommitDate: Fri Mar 27 18:01:27 2020 +0100 Fix url popups can't be clicked on browsers Change-Id: I3c2008e06370b4b48a93b68e58ad1e45a4f75d27 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91230 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index dfe755b64..6ce377988 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1119,7 +1119,7 @@ L.TileLayer = L.GridLayer.extend({ // # for internal links if (!url.startsWith('#')) { this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false}) - .setContent(''+url+'') + .setContent('' + url + '') .setLatLng(position) .openOn(this._map); } diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js index 004d423ba..cf0041d53 100644 --- a/loleaflet/src/map/handler/Map.TouchGesture.js +++ b/loleaflet/src/map/handler/Map.TouchGesture.js @@ -301,9 +301,9 @@ L.Map.TouchGesture = L.Handler.extend({ mousePos = this._map._docLayer._latLngToTwips(latlng); // clicked a hyperlink popup - not really designed for this. - if (this._map.hyperlinkPopup && e.target && e.target.id === 'hyperlinkpopup' && + if (this._map.hyperlinkPopup && e.target && this._map.hyperlinkPopup._contentNode == e.target.parentNode) - this._map.fire('hyperlinkclicked', {url: e.target.innerHTML}); + this._map.fire('hyperlinkclicked', {url: e.target.href}); this._map.fire('closepopups'); this._map.fire('closemobilewizard'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: android/app
android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java | 93 +- android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java | 12 + android/app/src/main/res/drawable/ic_more_vert_black_24dp.xml |9 android/app/src/main/res/layout/file_explorer_grid_item.xml | 49 +++-- android/app/src/main/res/layout/file_list_item.xml |9 android/app/src/main/res/menu/context_menu.xml |2 android/app/src/main/res/values/strings.xml |2 7 files changed, 119 insertions(+), 57 deletions(-) New commits: commit c07f4fb97492a5b833d44e2750c4fc5ca6879c7a Author: mert AuthorDate: Tue Mar 24 01:31:32 2020 +0300 Commit: Andras Timar CommitDate: Fri Mar 27 15:32:59 2020 +0100 android: added context menu for the files Change-Id: Iab18379797917ce2e8ab25ed428f6a806f5f4e7e Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90944 Reviewed-by: Jan Holesovsky Tested-by: Jenkins CollaboraOffice diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java index bd9116c94..c1d9df818 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java @@ -10,7 +10,6 @@ package org.libreoffice.androidapp.ui; import android.Manifest; -import android.app.AlertDialog; import android.content.ActivityNotFoundException; import android.content.BroadcastReceiver; import android.content.ComponentName; @@ -22,6 +21,7 @@ import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.content.pm.ShortcutInfo; import android.content.pm.ShortcutManager; +import android.database.Cursor; import android.graphics.drawable.Icon; import android.hardware.usb.UsbManager; import android.net.Uri; @@ -29,6 +29,8 @@ import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.provider.DocumentsContract; +import android.provider.MediaStore; +import android.provider.OpenableColumns; import android.provider.Settings; import android.text.Editable; import android.text.TextUtils; @@ -77,6 +79,7 @@ import java.util.List; import androidx.annotation.NonNull; import androidx.appcompat.app.ActionBar; import androidx.appcompat.app.ActionBarDrawerToggle; +import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.widget.Toolbar; import androidx.core.app.ActivityCompat; @@ -102,7 +105,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings FileFilter fileFilter; FilenameFilter filenameFilter; -private int currentlySelectedFile; +private Uri currentlySelectedFile; /** The document that is being edited - to know what to save back to cloud. */ //private IFile mCurrentDocument; @@ -386,8 +389,8 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings updateRecentFiles(); -// TODO allow context menu for the various files - for Open and Share -//registerForContextMenu(fileRecyclerView); +// allow context menu for the various files - for Open and Share +registerForContextMenu(recentRecyclerView); setupNavigationDrawer(); } @@ -510,11 +513,25 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings case R.id.context_menu_share: share(currentlySelectedFile); return true; +case R.id.context_menu_remove_from_list: +removeFromList(currentlySelectedFile); +return true; default: return super.onContextItemSelected(item); } } +public void openContextMenu(View view, Uri uri) { + +this.currentlySelectedFile = uri; + +if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { +view.showContextMenu(view.getPivotX(), view.getPivotY()); +} +else +view.showContextMenu(); +} + public boolean isViewModeList() { return prefs.getString(EXPLORER_VIEW_TYPE_KEY, GRID_VIEW).equals(LIST_VIEW); } @@ -614,44 +631,42 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings } /** Context menu item handling. */ -private void share(int position) { -/* -new AsyncTask() { -@Override -protected File doInBackground(IFile... document) { -// this operation may imply network access and must be run in -// a different thread -
[Libreoffice-commits] online.git: android/lib configure.ac
android/lib/build.gradle| 2 android/lib/libSettings.gradle.in | 1 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java| 57 ++ android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java | 86 ++ android/lib/src/main/res/layout/rate_app_layout.xml | 28 +++ android/lib/src/main/res/values/strings.xml | 3 configure.ac| 10 + 7 files changed, 186 insertions(+), 1 deletion(-) New commits: commit 76f4c6de3be7c8e70c29afcadd9a1b10ab6a34bd Author: mert AuthorDate: Fri Mar 13 21:21:14 2020 +0300 Commit: Jan Holesovsky CommitDate: Wed Mar 18 00:36:05 2020 +0100 android: added a rating dialog Change-Id: If1fed5bff1f7b607027d01a69d09de997fae8473 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90479 Tested-by: Jan Holesovsky Reviewed-by: Jan Holesovsky diff --git a/android/lib/build.gradle b/android/lib/build.gradle index 8af6e8a2a..ceac6b811 100644 --- a/android/lib/build.gradle +++ b/android/lib/build.gradle @@ -25,6 +25,7 @@ android { buildTypes { debug { buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\"" +buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", "${liboGooglePlay}" ndk { abiFilters = [] abiFilters.addAll("${liboAndroidAbi}".split(' ').collect{it as String}) @@ -33,6 +34,7 @@ android { } release { buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\"" +buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", "${liboGooglePlay}" ndk { abiFilters = [] abiFilters.addAll("${liboAndroidAbi}".split(' ').collect{it as String}) diff --git a/android/lib/libSettings.gradle.in b/android/lib/libSettings.gradle.in index d492e0389..3b6208fb7 100644 --- a/android/lib/libSettings.gradle.in +++ b/android/lib/libSettings.gradle.in @@ -10,4 +10,5 @@ ext { liboGitFullCommit = '@LOOLWSD_VERSION_HASH@' liboApplicationId = '@ANDROID_PACKAGE_NAME@' liboAndroidAbi = '@ANDROID_ABI@' +liboGooglePlay = '@APP_GOOGLE_PLAY@' } diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 0459b8db2..de3f5da3b 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -10,11 +10,13 @@ package org.libreoffice.androidlib; import android.Manifest; +import android.app.AlertDialog; import android.content.ClipData; import android.content.ClipDescription; import android.content.ClipboardManager; import android.content.ActivityNotFoundException; import android.content.ContentResolver; +import android.content.DialogInterface; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; @@ -43,6 +45,7 @@ import android.webkit.ValueCallback; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; +import android.widget.RatingBar; import android.widget.TextView; import android.widget.Toast; @@ -65,7 +68,6 @@ import java.util.Map; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AppCompatActivity; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; @@ -101,6 +103,7 @@ public class LOActivity extends AppCompatActivity { private WebView mWebView; private SharedPreferences sPrefs; private Handler mMainHandler = null; +private RateAppController rateAppController; private boolean isDocEditable = false; private boolean isDocDebuggable = BuildConfig.DEBUG; @@ -263,6 +266,10 @@ public class LOActivity extends AppCompatActivity { setContentView(R.layout.lolib_activity_main); mProgressDialog = new ProgressDialog(this); +if (BuildConfig.GOOGLE_PLAY_ENABLED) +this.rateAppController = new RateAppController(this); +else +this.rateAppController = null; init(); } @@ -403,6 +410,25 @@ public class LOActivity extends AppCompatActivity { } } +/** opens up the app page on Google Play */ +private void openInGooglePlay() { +String marketUri = String.format("market://details?id=%1$s", getPackageName()); +String webUri = String.format("https://play.google.com/store/apps/details?id=%1$s;, getPackageName()); + +Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(marketUri)); +if
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/layer/tile/TileLayer.js |3 +++ 1 file changed, 3 insertions(+) New commits: commit c34ca443b2037b4cf200a17013481c1cc75090a4 Author: mert AuthorDate: Mon Mar 16 12:34:00 2020 +0300 Commit: Andras Timar CommitDate: Mon Mar 16 18:09:20 2020 +0100 mobile: fix hyperlink popup does not disappear. popups dont disapper on impress also other types of documents when tapping on graphics Change-Id: I3b6c64f3347e6ea6aa52c9568bec3233b748d932 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90555 Tested-by: Andras Timar Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index d302dccc4..4937e7c31 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -919,6 +919,9 @@ L.TileLayer = L.GridLayer.extend({ }, _onGraphicSelectionMsg: function (textMsg) { + if (this._map.hyperlinkPopup !== null) { + this._closeURLPopUp(); + } if (textMsg.match('EMPTY')) { this._resetSelectionRanges(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Toolbar.js |6 +--- loleaflet/src/layer/tile/TileLayer.js | 33 +++--- loleaflet/src/map/handler/Map.TouchGesture.js |6 ++-- 3 files changed, 25 insertions(+), 20 deletions(-) New commits: commit 2462bf7a19daa56fe2fea9681587c22e6503c360 Author: mert AuthorDate: Wed Feb 26 16:58:30 2020 +0300 Commit: Andras Timar CommitDate: Mon Mar 16 15:57:57 2020 +0100 hyperlink popup clean up hyperlink popups shouldnt contain href for links also we shouldnt show popup for internal links core must handle it Change-Id: Ice5535890a6c45cea7a3d9f70b21ad5f9e66f2eb Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89550 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index 9e8d87d8c..79d392563 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -2626,10 +2626,8 @@ function setupToolbar(e) { map._docLayer._twipsToLatLng(bottomRightTwips, map.getZoom())); //click pos tweak cellCursor._northEast.lng = cellCursor._southWest.lng; - map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false}) - .setContent('' + e.url + '') - .setLatLng(cellCursor._northEast) - .openOn(map); + map._docLayer._closeURLPopUp(); + map._docLayer._showURLPopUp(cellCursor._northEast, e.url); } else { map.fire('warn', {url: e.url, map: map, cmd: 'openlink'}); } diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 52660885a..d302dccc4 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1112,6 +1112,21 @@ L.TileLayer = L.GridLayer.extend({ } }, + _showURLPopUp: function(position, url) { + // # for internal links + if (!url.startsWith('#')) { + this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false}) + .setContent(''+url+'') + .setLatLng(position) + .openOn(this._map); + } + }, + + _closeURLPopUp: function() { + this._map.closePopup(this._map.hyperlinkPopup); + this._map.hyperlinkPopup = null; + }, + _onHyperlinkClickedMsg: function (textMsg) { var link = null; var coords = null; @@ -1148,13 +1163,9 @@ L.TileLayer = L.GridLayer.extend({ this._map.lastActionByUser = false; this._map.hyperlinkUnderCursor = obj.hyperlink; - this._map.closePopup(this._map.hyperlinkPopup); - this._map.hyperlinkPopup = null; + this._closeURLPopUp(); if (obj.hyperlink && obj.hyperlink.link) { - this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false}) - .setContent('' + obj.hyperlink.link + '') - .setLatLng(cursorPos) - .openOn(this._map); + this._showURLPopUp(cursorPos, obj.hyperlink.link); } if (!this._map.editorHasFocus() && (modifierViewId === this._viewId) && (this._map._permission === 'edit')) { @@ -2915,19 +2926,15 @@ L.TileLayer = L.GridLayer.extend({ targetURL = targetURL.split('"').join(''); targetURL = this._map.makeURLFromStr(targetURL); - this._map.closePopup(this._map.hyperlinkPopup); - this._map.hyperlinkPopup = null; + this._closeURLPopUp(); if (targetURL) { - this._map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false}) - .setContent('' + targetURL + '') - .setLatLng(this._cellCursorMarker._bounds._northEast) - .openOn(this._map); + this._showURLPopUp(this._cellCursorMarker._bounds._northEast, targetURL); } } else if (this._map.hyperlinkPopup) { - this._map.closePopup(this._map.hyperlinkPopup); +
[Libreoffice-commits] online.git: android/app
android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java | 11 + android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java | 57 +++--- 2 files changed, 54 insertions(+), 14 deletions(-) New commits: commit 10c695cfbbb8a9072388f5f0a03f557aa51955cf Author: mert AuthorDate: Tue Mar 10 19:08:11 2020 +0300 Commit: Andras Timar CommitDate: Mon Mar 16 15:50:05 2020 +0100 android: fix crash on removed/renamed file on recent files Change-Id: Iedeaba896ecca17c0c7e5c038b1c370b72484c68 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90290 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mert Tümer diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java index 1ef2acc45..bd9116c94 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/LibreOfficeUIActivity.java @@ -113,7 +113,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings public static final String EXPLORER_VIEW_TYPE_KEY = "EXPLORER_VIEW_TYPE"; public static final String EXPLORER_PREFS_KEY = "EXPLORER_PREFS"; public static final String SORT_MODE_KEY = "SORT_MODE"; -private static final String RECENT_DOCUMENTS_KEY = "RECENT_DOCUMENTS_LIST"; +public static final String RECENT_DOCUMENTS_KEY = "RECENT_DOCUMENTS_LIST"; private static final String ENABLE_SHOW_HIDDEN_FILES_KEY = "ENABLE_SHOW_HIDDEN_FILES"; public static final String NEW_FILE_PATH_KEY = "NEW_FILE_PATH_KEY"; @@ -208,6 +208,12 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings recentRecyclerView.setAdapter(new RecentFilesAdapter(this, recentUris)); } +/** access shared preferences from the activity instance */ +public SharedPreferences getPrefs() +{ +return prefs; +} + /** Create the Navigation menu and set up the actions and everything there. */ public void setupNavigationDrawer() { drawerLayout = findViewById(R.id.drawer_layout); @@ -986,6 +992,9 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings Uri shortcutUri = Uri.parse(pathString); String filename = RecentFilesAdapter.getUriFilename(this, shortcutUri); +if (filename == null) +continue; + Intent intent = getIntentToEdit(shortcutUri); ShortcutInfo.Builder builder = new ShortcutInfo.Builder(this, filename) .setShortLabel(filename) diff --git a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java index 4a06899a9..371b7ab03 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/ui/RecentFilesAdapter.java @@ -22,6 +22,7 @@ import android.widget.TextView; import org.libreoffice.androidapp.R; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -34,11 +35,11 @@ class RecentFilesAdapter extends RecyclerView.Adapter recentUris; +private ArrayList recentFiles; RecentFilesAdapter(LibreOfficeUIActivity activity, List recentUris) { this.mActivity = activity; -this.recentUris = recentUris; +initRecentFiles(recentUris); } @Override @@ -47,6 +48,26 @@ class RecentFilesAdapter extends RecyclerView.Adapter recentUris) { +this.recentFiles = new ArrayList<>(); +boolean invalidUriFound = false; +String joined = ""; +for (Uri u: recentUris) { +String filename = getUriFilename(mActivity, u); +if (null != filename) { +long length = getUriFileLength(mActivity, u); +recentFiles.add(new RecentFile(u, filename, length)); +joined = joined.concat(u.toString()+"\n"); +} +else +invalidUriFound = true; +} +if (invalidUriFound) { + mActivity.getPrefs().edit().putString(mActivity.RECENT_DOCUMENTS_KEY, joined).apply(); +} +} + /** Return the filename of the given Uri. */ public static String getUriFilename(Activity activity, Uri uri) { String filename = ""; @@ -60,11 +81,8 @@ class RecentFilesAdapter extends RecyclerView.Adapter segments = uri.getPathSegments(); -if (segments.size() > 0) -filename = segments.get(segments.size() - 1); -} +if (filename.isEmpty()) +return null; return filename; } @@ -91,17 +109,18 @@ class
[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2-0' - loleaflet/src
loleaflet/src/layer/tile/TileLayer.js | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit d2c1d60c34adab0ea50443cd5ef54c5f4571d640 Author: mert AuthorDate: Mon Mar 2 16:48:50 2020 +0300 Commit: Andras Timar CommitDate: Mon Mar 2 21:28:34 2020 +0100 Fix hyperlinkclicked message is not properly parsed $.inArray does not work because the parsed msg is not an array Change-Id: I68a8312da17b0832b09a88afeaf05ad75a2c6e2d Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89833 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit 41d065af2a8e58d76f53c9b57ff55093e0210531) Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89804 diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index e9b5ed12b..9de7db98d 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1095,13 +1095,15 @@ L.TileLayer = L.GridLayer.extend({ _onHyperlinkClickedMsg: function (textMsg) { var link = null; var coords = null; + var hyperlinkMsgStart = 'hyperlinkclicked: '; + var coordinatesMsgStart = ' coordinates: '; - if ($.inArray('coordinates', textMsg) !== -1) { - var coordpos = textMsg.indexOf(' coordinates'); - link = textMsg.substring(18, coordpos); - coords = textMsg.substring(coordpos+12); + if (textMsg.indexOf(coordinatesMsgStart) !== -1) { + var coordpos = textMsg.indexOf(coordinatesMsgStart); + link = textMsg.substring(hyperlinkMsgStart.length, coordpos); + coords = textMsg.substring(coordpos+coordinatesMsgStart.length); } else - link = textMsg.substring(18); + link = textMsg.substring(hyperlinkMsgStart.length); this._map.fire('hyperlinkclicked', {url: link, coordinates: coords}); }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/layer/tile/TileLayer.js | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit 41d065af2a8e58d76f53c9b57ff55093e0210531 Author: mert AuthorDate: Mon Mar 2 16:48:50 2020 +0300 Commit: Andras Timar CommitDate: Mon Mar 2 20:50:59 2020 +0100 Fix hyperlinkclicked message is not properly parsed $.inArray does not work because the parsed msg is not an array Change-Id: I68a8312da17b0832b09a88afeaf05ad75a2c6e2d Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89833 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index e9b5ed12b..9de7db98d 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1095,13 +1095,15 @@ L.TileLayer = L.GridLayer.extend({ _onHyperlinkClickedMsg: function (textMsg) { var link = null; var coords = null; + var hyperlinkMsgStart = 'hyperlinkclicked: '; + var coordinatesMsgStart = ' coordinates: '; - if ($.inArray('coordinates', textMsg) !== -1) { - var coordpos = textMsg.indexOf(' coordinates'); - link = textMsg.substring(18, coordpos); - coords = textMsg.substring(coordpos+12); + if (textMsg.indexOf(coordinatesMsgStart) !== -1) { + var coordpos = textMsg.indexOf(coordinatesMsgStart); + link = textMsg.substring(hyperlinkMsgStart.length, coordpos); + coords = textMsg.substring(coordpos+coordinatesMsgStart.length); } else - link = textMsg.substring(18); + link = textMsg.substring(hyperlinkMsgStart.length); this._map.fire('hyperlinkclicked', {url: link, coordinates: coords}); }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: android/lib
android/lib/build.gradle | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) New commits: commit 04dc25bfe09c52424d4a58073886353ecea14f08 Author: mert AuthorDate: Tue Feb 25 00:14:13 2020 +0300 Commit: Jan Holesovsky CommitDate: Tue Feb 25 00:16:51 2020 +0100 android: reduce the dictionary files we copy dictionary files more than necessary only the required ones are included Change-Id: I200a95b2593109ff10e7214476fe6ddd2e792ae5 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89384 Tested-by: Jan Holesovsky Reviewed-by: Jan Holesovsky diff --git a/android/lib/build.gradle b/android/lib/build.gradle index 46771f320..3f8a61d79 100644 --- a/android/lib/build.gradle +++ b/android/lib/build.gradle @@ -127,9 +127,21 @@ task copyUnpackAssets(type: Copy) { } into('share') { from "${liboInstdir}/share" -// extensions - for the dictionaries for hunspell // liblangtag data is needed for locales like en-CH -includes = ['extensions/dict-de/**', 'extensions/dict-en/**', 'extensions/dict-es/**', 'extensions/dict-pt-BR/**', 'liblangtag/**'] +include 'liblangtag/**' +} + +into('share') { +from "${liboInstdir}/share" +// extensions - for the dictionaries for hunspell +includes = ['extensions/dict-de/**', 'extensions/dict-en/**', 'extensions/dict-es/**', 'extensions/dict-pt-BR/**'] +exclude { FileTreeElement details -> +!(details.file.isDirectory() || +details.file.name.endsWith('.xcu') || +details.file.name.endsWith('.dic') || +details.file.name.endsWith('.aff') || +details.file.name.endsWith('.xml')) +} } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Toolbar.js | 20 +++- loleaflet/src/layer/tile/TileLayer.js| 13 +++-- 2 files changed, 30 insertions(+), 3 deletions(-) New commits: commit 864749bb1681e352f3c6e63548f31d3ede63422a Author: mert AuthorDate: Thu Feb 20 18:36:09 2020 +0300 Commit: Michael Meeks CommitDate: Fri Feb 21 18:07:02 2020 +0100 mobile: implemented popup for hyperlinks on calc Change-Id: I6d22cc1d6b7da8afbb9cce70c3445634455b34d8 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89122 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index c627e49cd..6c47153f2 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -2609,7 +2609,25 @@ function setupToolbar(e) { }); map.on('hyperlinkclicked', function (e) { - map.fire('warn', {url: e.url, map: map, cmd: 'openlink'}); + if (e.url) { + if (e.coordinates) { + var strTwips = e.coordinates.match(/\d+/g); + var topLeftTwips = new L.Point(parseInt(strTwips[6]), parseInt(strTwips[1])); + var offset = new L.Point(parseInt(strTwips[2]), parseInt(strTwips[3])); + var bottomRightTwips = topLeftTwips.add(offset); + var cellCursor = new L.LatLngBounds( + map._docLayer._twipsToLatLng(topLeftTwips, map.getZoom()), + map._docLayer._twipsToLatLng(bottomRightTwips, map.getZoom())); + //click pos tweak + cellCursor._northEast.lng = cellCursor._southWest.lng; + map.hyperlinkPopup = new L.Popup({className: 'hyperlink-popup', closeButton: false, closeOnClick: false}) + .setContent('' + e.url + '') + .setLatLng(cellCursor._northEast) + .openOn(map); + } else { + map.fire('warn', {url: e.url, map: map, cmd: 'openlink'}); + } + } }); map.on('zoomend', function () { diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js index 0939570e3..a0fff8280 100644 --- a/loleaflet/src/layer/tile/TileLayer.js +++ b/loleaflet/src/layer/tile/TileLayer.js @@ -1093,8 +1093,17 @@ L.TileLayer = L.GridLayer.extend({ }, _onHyperlinkClickedMsg: function (textMsg) { - var link = textMsg.substring(18); - this._map.fire('hyperlinkclicked', {url: link}); + var link = null; + var coords = null; + + if (textMsg.includes('coordinates')) { + var coordpos = textMsg.indexOf(' coordinates'); + link = textMsg.substring(18, coordpos); + coords = textMsg.substring(coordpos+12); + } else + link = textMsg.substring(18); + + this._map.fire('hyperlinkclicked', {url: link, coordinates: coords}); }, _onInvalidateCursorMsg: function (textMsg) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |9 - 1 file changed, 8 insertions(+), 1 deletion(-) New commits: commit e1338035ce1653e7fb7f2ba8360e5c4b51969804 Author: mert AuthorDate: Fri Feb 21 14:45:55 2020 +0300 Commit: Pedro Pinto da Silva CommitDate: Fri Feb 21 13:19:30 2020 +0100 mobilewizard: iconPath for panelHandler Change-Id: I8ddcb18570cdd5b92a09dced2a219abf110ecbcf Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89201 Tested-by: Pedro Pinto da Silva Reviewed-by: Pedro Pinto da Silva diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 93297e126..809de4333 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -403,7 +403,14 @@ L.Control.JSDialogBuilder = L.Control.extend({ _panelHandler: function(parentContainer, data, builder) { var contentNode = data.children[0]; - builder._explorableEntry(parentContainer, data, contentNode, builder); + var entryId = contentNode.id; + var iconPath = null; + + if (entryId && entryId.length) { + iconPath = builder._createIconPath(entryId); + } + + builder._explorableEntry(parentContainer, data, contentNode, builder, null, iconPath); return false; }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/css
loleaflet/css/partsPreviewControl.css |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit d21a13e76e33d3c585e4929c5632796f689af2a2 Author: mert AuthorDate: Thu Feb 6 14:27:49 2020 +0300 Commit: Henry Castro CommitDate: Wed Feb 19 18:11:22 2020 +0100 Fix slide-sorter behaves like desktop on larger screen phones Change-Id: Ief2a5278b901970378a84dc4a2f528f885e1cd06 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88093 Tested-by: Henry Castro Reviewed-by: Henry Castro diff --git a/loleaflet/css/partsPreviewControl.css b/loleaflet/css/partsPreviewControl.css index 0d5227f0e..c4bb13b41 100644 --- a/loleaflet/css/partsPreviewControl.css +++ b/loleaflet/css/partsPreviewControl.css @@ -32,7 +32,8 @@ border: 2px solid #dfdfdf; margin-left: 20px; } -@media (max-width: 767px) and (orientation: potrait),(max-device-height: 767px) and (orientation: portrait), screen (max-width: 900px) and (orientation: potrait) and (any-pointer: coarse) and (hover: none), (max-height: 900px) and (orientation: portrait) and (any-pointer: coarse) and (hover: none){ + +@media (max-width: 767px) and (orientation: potrait),(max-device-height: 900px) and (orientation: portrait) { #slide-sorter { max-height: 60px; } @@ -49,7 +50,8 @@ padding-right: 1em; } } -@media (max-width: 767px) and (orientation: landscape),(max-device-height: 767px) and (orientation: landscape), screen (max-width: 900px) and (orientation: landscape) and (any-pointer: coarse) and (hover: none), (max-height: 900px) and (orientation: landscape) and (any-pointer: coarse) and (hover: none){ + +@media (max-width: 767px) and (orientation: landscape),(max-device-height: 900px) and (orientation: landscape) { #slide-sorter { max-width: 120px; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.MobileWizard.js |9 + loleaflet/src/map/Map.js | 16 ++-- 2 files changed, 23 insertions(+), 2 deletions(-) New commits: commit b783cb30e866b84a75b3ae7c3d08a39c42528b01 Author: mert AuthorDate: Fri Feb 7 15:48:58 2020 +0300 Commit: Michael Meeks CommitDate: Mon Feb 17 22:27:04 2020 +0100 mobilewizard: pan the document area to top on presentation WHen opening the wizard on presentation, the document is chopped in half and there are a lot of grey area on the top. Change-Id: I46bd329adcf551c94734998b240a251e1cec4e8d Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88190 Reviewed-by: Michael Meeks Reviewed-by: Henry Castro Tested-by: Jenkins CollaboraOffice diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index 8c90f86f7..1dcf8a31b 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -109,6 +109,8 @@ L.Control.MobileWizard = L.Control.extend({ if (!this.map.hasFocus()) { this.map.focus(); } + + this._updateMapSize(); }, _hideKeyboard: function() { @@ -268,6 +270,11 @@ L.Control.MobileWizard = L.Control.extend({ }, 400); }, + _updateMapSize: function() { + window.updateMapSizeForWizard = this._map.getDocType() === 'presentation' && this._isActive; + this._map.invalidateSize(); + }, + _onMobileWizard: function(data) { if (data) { var isSidebar = (data.children && data.children.length >= 1 && @@ -333,6 +340,8 @@ L.Control.MobileWizard = L.Control.extend({ this._goToPath(currentPath); this._scrollToPosition(lastScrollPosition); } + + this._updateMapSize(); } }, diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js index ba848c2b2..cd2c8aad1 100644 --- a/loleaflet/src/map/Map.js +++ b/loleaflet/src/map/Map.js @@ -775,10 +775,22 @@ L.Map = L.Evented.extend({ }, getSize: function () { + var clientWidth = this._container.clientWidth; + var clientHeight = this._container.clientHeight; + + if (window.updateMapSizeForWizard) + { + var wizardHeight = $('#mobile-wizard').height(); + // the container has a bottom pixel set, it does not contain all the height + // we need it for calculating how much pixels the wizard covers on the map + var containerBottomPixels = parseInt($('#document-container').css('bottom')); + clientHeight -= wizardHeight - containerBottomPixels; + } + if (!this._size || this._sizeChanged) { this._size = new L.Point( - this._container.clientWidth, - this._container.clientHeight); + clientWidth, + clientHeight); this._sizeChanged = false; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: android/lib
android/lib/build.gradle |2 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java | 32 -- android/lib/src/main/res/layout/lolib_activity_main.xml | 19 + android/lib/src/main/res/values/strings.xml |1 4 files changed, 50 insertions(+), 4 deletions(-) New commits: commit 1f04f155324989429eed3478825dbebd67fc3f75 Author: mert AuthorDate: Wed Feb 12 19:39:50 2020 +0300 Commit: Jan Holesovsky CommitDate: Fri Feb 14 18:19:14 2020 +0100 android: show progressbar at first start of the document Copying the assets takes some time at first install so showing progressbar is a good idea for user to wait Edit: ConstraintLayout implementation added in build.gradle Change-Id: Ia38259cb3ae1b25983a4067fce500f2700c2c79f Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88548 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/android/lib/build.gradle b/android/lib/build.gradle index ea92be07f..480c4dcd7 100644 --- a/android/lib/build.gradle +++ b/android/lib/build.gradle @@ -63,6 +63,8 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.0.2' implementation 'com.google.android.material:material:1.1.0-alpha04' +implementation 'androidx.constraintlayout:constraintlayout:1.1.2' + } task copyUnpackAssets(type: Copy) { diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 7033707e5..9af5eb267 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -22,6 +22,7 @@ import android.content.pm.PackageManager; import android.content.res.AssetFileDescriptor; import android.content.res.AssetManager; import android.net.Uri; +import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.os.Environment; @@ -42,6 +43,7 @@ import android.webkit.ValueCallback; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; +import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; @@ -110,6 +112,7 @@ public class LOActivity extends AppCompatActivity { private Thread nativeMsgThread; private Handler nativeHandler; private Looper nativeLooper; +private Bundle savedInstanceState; /** In case the mobile-wizard is visible, we have to intercept the Android's Back button. */ private boolean mMobileWizardVisible = false; @@ -142,7 +145,6 @@ public class LOActivity extends AppCompatActivity { String fromAssetPath, String targetDir) { try { String[] files = assetManager.list(fromAssetPath); - boolean res = true; for (String file : files) { String[] dirOrFile = assetManager.list(fromAssetPath + "/" + file); @@ -255,12 +257,33 @@ public class LOActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); +this.savedInstanceState = savedInstanceState; getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); sPrefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); -updatePreferences(); - setContentView(R.layout.lolib_activity_main); +init(); +} + +private void init() { +new AsyncTask() { +@Override +protected Void doInBackground(Void... voids) { +updatePreferences(); +return null; +} +@Override +protected void onPostExecute(Void aVoid) { +initUI(); +} +}.execute(); +} + +private void initUI() { +TextView assetsTextView = findViewById(R.id.assetsTextView); +ProgressBar assetsProgressbar = findViewById(R.id.assetsProgressbar); +assetsProgressbar.setVisibility(View.GONE); +assetsTextView.setVisibility(View.GONE); isDocDebuggable = sPrefs.getBoolean(KEY_ENABLE_SHOW_DEBUG_INFO, false) && BuildConfig.DEBUG; if (getIntent().getData() != null) { @@ -482,7 +505,8 @@ public class LOActivity extends AppCompatActivity { Log.i(TAG, "onResume.."); // check for config change -updatePreferences(); +if (documentLoaded) +updatePreferences(); } @Override diff --git a/android/lib/src/main/res/layout/lolib_activity_main.xml b/android/lib/src/main/res/layout/lolib_activity_main.xml index 2810a9af9..9d9524dc5 100644 --- a/android/lib/src/main/res/layout/lolib_activity_main.xml +++
[Libreoffice-commits] online.git: android/lib
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java | 49 -- android/lib/src/main/res/layout/lolib_dialog_loading.xml |3 android/lib/src/main/res/values/strings.xml |1 3 files changed, 46 insertions(+), 7 deletions(-) New commits: commit 475c7cd42e37efab6c8e48e03efc32a3cf315171 Author: mert AuthorDate: Thu Feb 6 16:27:01 2020 +0300 Commit: Jan Holesovsky CommitDate: Tue Feb 11 23:29:27 2020 +0100 android: Notify the user about saving the document on close Change-Id: Ie96bd1918d2d166df096bec5e2c6489f819b6f13 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88102 Tested-by: Jan Holesovsky Reviewed-by: Jan Holesovsky diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index e3e479a4c..a964ad392 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -33,12 +33,15 @@ import android.print.PrintDocumentAdapter; import android.print.PrintManager; import android.provider.DocumentsContract; import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; import android.view.WindowManager; import android.webkit.JavascriptInterface; import android.webkit.ValueCallback; import android.webkit.WebChromeClient; import android.webkit.WebSettings; import android.webkit.WebView; +import android.widget.TextView; import android.widget.Toast; import java.io.File; @@ -458,6 +461,10 @@ public class LOActivity extends AppCompatActivity { Log.i(TAG, "onDestroy() - we know we are leaving the document"); nativeLooper.quit(); mWebView.destroy(); + +// Most probably the native part has already got a 'BYE' from +// finishWithProgress(), but it is actually better to send it twice +// than never, so let's call it from here too anyway postMobileMessageNative("BYE"); } @@ -528,6 +535,38 @@ public class LOActivity extends AppCompatActivity { return null; } +/** Show the Saving progress and finish the app. */ +private void finishWithProgress() { +LayoutInflater inflater = this.getLayoutInflater(); +View loadingView = inflater.inflate(R.layout.lolib_dialog_loading, null); +TextView loadingText = loadingView.findViewById(R.id.lolib_loading_dialog_text); +loadingText.setText(getText(R.string.saving)); +final AlertDialog savingProgress = new AlertDialog.Builder(LOActivity.this) +.setView(loadingView) +.setCancelable(true) +.create(); + +savingProgress.show(); + +// The 'BYE' takes a considerable amount of time, we need to post it +// so that it starts after the saving progress is actually shown +mainHandler.post(new Runnable() { +@Override +public void run() { +postMobileMessageNative("BYE"); + +runOnUiThread(new Runnable() { +@Override +public void run() { +savingProgress.dismiss(); +} +}); + +finish(); +} +}); +} + @Override public void onBackPressed() { if (mMobileWizardVisible) @@ -537,8 +576,7 @@ public class LOActivity extends AppCompatActivity { return; } -postMobileMessageNative("BYE"); -super.onBackPressed(); +finishWithProgress(); } private void loadDocument() { @@ -600,10 +638,6 @@ public class LOActivity extends AppCompatActivity { postMobileMessageNative(message); afterMessageFromWebView(messageAndParameterArray); } - -// Going back to document browser on BYE (called when pressing the top left exit button) -if (message.equals("BYE")) -finish(); } /** @@ -647,6 +681,9 @@ public class LOActivity extends AppCompatActivity { */ private boolean beforeMessageFromWebView(String[] messageAndParam) { switch (messageAndParam[0]) { +case "BYE": +finishWithProgress(); +return false; case "PRINT": mainHandler.post(new Runnable() { @Override diff --git a/android/lib/src/main/res/layout/lolib_dialog_loading.xml b/android/lib/src/main/res/layout/lolib_dialog_loading.xml index f4dc98443..db4825bb7 100644 --- a/android/lib/src/main/res/layout/lolib_dialog_loading.xml +++ b/android/lib/src/main/res/layout/lolib_dialog_loading.xml @@ -10,9 +10,10 @@ android:layout_weight="1" /> - \ No newline at end of file + diff --git a/android/lib/src/main/res/values/strings.xml b/android/lib/src/main/res/values/strings.xml index
[Libreoffice-commits] online.git: android/lib
android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java |1 + 1 file changed, 1 insertion(+) New commits: commit 176be0101210721204826aff1da6b58e2124 Author: mert AuthorDate: Thu Feb 6 11:58:46 2020 +0300 Commit: Jan Holesovsky CommitDate: Thu Feb 6 10:06:37 2020 +0100 Destroy webview when LOActivity is destroyed Chrome://inspect shows that webviews are not destroyed even after closing the activity. Change-Id: Ib0fb2f0b75b06ae349a37a11fb0c9cb35faf3ff5 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88074 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 34fd8b1b2..acbd9cdf5 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -441,6 +441,7 @@ public class LOActivity extends AppCompatActivity { super.onDestroy(); Log.i(TAG, "onDestroy() - we know we are leaving the document"); nativeLooper.quit(); +mWebView.destroy(); postMobileMessageNative("BYE"); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: android/app android/lib
android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java | 3 +++ android/app/src/main/res/values/strings.xml | 2 ++ android/app/src/main/res/xml/libreoffice_preferences.xml| 8 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java| 3 ++- android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java | 7 ++- 5 files changed, 21 insertions(+), 2 deletions(-) New commits: commit 4122634c9b8ef217877b168f529e1147ea4a00db Author: mert AuthorDate: Wed Jan 29 17:13:24 2020 +0300 Commit: Jan Holesovsky CommitDate: Mon Feb 3 23:07:41 2020 +0100 Added the chrome debugging enablement into the settings Change-Id: I24c97018b499517637f460ba663737ca781ee975 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87687 Tested-by: Jenkins CollaboraOffice Reviewed-by: Jan Holesovsky diff --git a/android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java b/android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java index c51d098af..510979a7a 100644 --- a/android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java +++ b/android/app/src/main/java/org/libreoffice/androidapp/SettingsActivity.java @@ -34,6 +34,9 @@ public class SettingsActivity extends AppCompatActivity { if (!BuildConfig.DEBUG) { findPreference("ENABLE_SHOW_DEBUG_INFO").setVisible(false); } +else { +findPreference("ENABLE_CHROME_DEBUGGING").setVisible(false); +} } @Override diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 12f65fc11..390ec274b 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -27,6 +27,8 @@ Set which file filter should be used by default. Show Debug Info Enable to show debug information in document viewer +Chrome Debugging +Enable to use Chrome\'s debugging tool in the document Show License Show Notice diff --git a/android/app/src/main/res/xml/libreoffice_preferences.xml b/android/app/src/main/res/xml/libreoffice_preferences.xml index 5f8389d45..a6da9e4ef 100644 --- a/android/app/src/main/res/xml/libreoffice_preferences.xml +++ b/android/app/src/main/res/xml/libreoffice_preferences.xml @@ -43,6 +43,14 @@ android:summary="@string/pref_show_debug_info_summary" android:defaultValue="false" app:iconSpaceReserved="false" /> + diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java index 9c7729ef9..34fd8b1b2 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java @@ -292,10 +292,11 @@ public class LOActivity extends AppCompatActivity { webSettings.setJavaScriptEnabled(true); mWebView.addJavascriptInterface(this, "LOOLMessageHandler"); +boolean isChromeDebugEnabled = sPrefs.getBoolean("ENABLE_CHROME_DEBUGGING", false); // allow debugging (when building the debug version); see details in // https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { -if ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) { +if ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0 || isChromeDebugEnabled) { WebView.setWebContentsDebuggingEnabled(true); } } diff --git a/android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java b/android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java index 21b9f..761d73c07 100644 --- a/android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java +++ b/android/lib/src/main/java/org/libreoffice/androidlib/SlideShowActivity.java @@ -12,9 +12,11 @@ package org.libreoffice.androidlib; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; +import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; import android.graphics.Color; import android.os.Bundle; +import android.preference.PreferenceManager; import android.util.Log; import android.view.View; import android.webkit.WebSettings; @@ -39,7 +41,10 @@ public class SlideShowActivity extends AppCompatActivity { slidesSvgUri = savedInstanceState.getString(SVG_URI_KEY); } Log.d(TAG, "SlideShow Svg Uri "+slidesSvgUri); -if ((getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0) { +SharedPreferences sPrefs =
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.MobileWizard.js |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit 0c91e668186fa40b41c823c90cd53b467051495f Author: mert AuthorDate: Tue Jan 28 15:19:03 2020 +0300 Commit: Michael Meeks CommitDate: Tue Jan 28 22:38:42 2020 +0100 mobilewizard: Fix character properties This patch fixes non-showing character properties on calc, also a bit improved the related function in terms of performance. Change-Id: Iba3f32ec535dd0d34bb56173151c52156564 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87610 Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index f455ad2ea..02b90407b 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -344,10 +344,9 @@ L.Control.MobileWizard = L.Control.extend({ var textIdx = this._findIdxInParentById(deck, textName); if (stylesIdx >= 0 && textIdx >= 0) { - var moveContent = deck.children[stylesIdx].children; - deck.children.splice(stylesIdx, 1); // remove - textIdx = this._findIdxInParentById(deck, textName); // re-lookup - deck.children[textIdx].children = moveContent.concat(deck.children[textIdx].children); + var moveContent = deck.children[stylesIdx].children[0].children; + deck.children[textIdx].children[0].children = moveContent.concat(deck.children[textIdx].children[0].children); + deck.children.splice(stylesIdx, 1); //remove the styles property } this._removeItems(deck, ['cellbordertype', 'borderlinestyle', 'borderlinecolor']); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.MobileWizard.js |7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) New commits: commit 227b11488ac2c2b00ea1f10f2008d28126114ed4 Author: mert AuthorDate: Thu Jan 23 20:19:52 2020 +0300 Commit: Michael Meeks CommitDate: Tue Jan 28 22:36:48 2020 +0100 mobilewizard: remove some problematic items Under Cell Appearance properties, cellbordertype, borderlinestyle, borderlinecolor items are removed due to not working properly. Change-Id: I56fd71355051a0b1dc20f6dc86090e2f35520b3a Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87608 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index ea7a7c557..f455ad2ea 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -349,6 +349,7 @@ L.Control.MobileWizard = L.Control.extend({ textIdx = this._findIdxInParentById(deck, textName); // re-lookup deck.children[textIdx].children = moveContent.concat(deck.children[textIdx].children); } + this._removeItems(deck, ['cellbordertype', 'borderlinestyle', 'borderlinecolor']); } this._removeItems(data, ['editcontour']); @@ -384,14 +385,12 @@ L.Control.MobileWizard = L.Control.extend({ if (data.children[i].id === items[j]) { data.children.splice(i, 1); childRemoved = true; - continue; } } - if (childRemoved === true) { + if (childRemoved && i > 0) i = i - 1; - } else { + if (data.children[i]) this._removeItems(data.children[i], items); - } } } }, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit abac1fa536a0bd052a071f8f699c2867f83cb07d Author: mert AuthorDate: Tue Jan 28 12:58:38 2020 +0300 Commit: Michael Meeks CommitDate: Tue Jan 28 15:21:05 2020 +0100 mobilewizard: Changed hit area for unoToolButton only the image button was clickable which was confusing where to tap on mobile. This patch changes the hit area to surrounding div instead Change-Id: Idfa2533b5daaa9df8f288eab5f9bb4b9e861d822 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87609 Reviewed-by: Michael Meeks Tested-by: Jenkins CollaboraOffice diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 71c074103..a3dcdb844 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1201,7 +1201,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ button.innerHTML = builder._cleanText(data.text); } - $(button).click(function () { + $(div).click(function () { builder.callback('toolbutton', 'click', button, data.command, builder); }); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Toolbar.js |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 78f3db04b52732732a381608dce5bcebee2967e7 Author: mert AuthorDate: Wed Jan 8 16:46:09 2020 +0300 Commit: Jan Holesovsky CommitDate: Tue Jan 28 10:43:58 2020 +0100 Fix quickbar colorpicker display problem Change-Id: I274ac457e58f9f109a46583a5e174a16d8eab766 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86432 Reviewed-by: Jan Holesovsky Tested-by: Jan Holesovsky diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js index c9bd08a6e..6af48dbad 100644 --- a/loleaflet/src/control/Control.Toolbar.js +++ b/loleaflet/src/control/Control.Toolbar.js @@ -738,7 +738,7 @@ function getColorPickerData(type) { uno = '.uno:BackColor'; } var data = { - id: 'box', + id: 'colorpicker', type: 'window', text: type, enabled: 'true', ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.Menubar.js |1 - 1 file changed, 1 deletion(-) New commits: commit 0cc4977abdbb0225c8c1a5f59b5bc00891463775 Author: mert AuthorDate: Mon Dec 23 15:25:29 2019 +0300 Commit: Michael Meeks CommitDate: Thu Jan 16 19:34:47 2020 +0100 Disable insert comment on spreadsheet for mobile Change-Id: Iff7cedd989452b44ad1eee3bc0fc4cb55f84a3ba Reviewed-on: https://gerrit.libreoffice.org/c/online/+/85752 Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js index 78caff051..89f6328b7 100644 --- a/loleaflet/src/control/Control.Menubar.js +++ b/loleaflet/src/control/Control.Menubar.js @@ -659,7 +659,6 @@ L.Control.Menubar = L.Control.extend({ {name: _('Local Image...'), id: 'insertgraphic', type: 'action'}, {name: _UNO('.uno:InsertGraphic', 'spreadsheet'), id: 'insertgraphicremote', type: 'action'}, {uno: '.uno:InsertObjectChart'}, - {name: _UNO('.uno:InsertAnnotation', 'spreadsheet'), id: 'insertcomment', type: 'action'}, {type: 'separator'}, {name: _UNO('.uno:HyperlinkDialog'), id: 'inserthyperlink', type: 'action'}, {name: _UNO('.uno:ShapesMenu'), id: 'insertshape', type: 'action'}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/css
loleaflet/css/toolbar.css |1 + 1 file changed, 1 insertion(+) New commits: commit 026500b3a5d60e90e2d34c10fb82ffeef0eeb68c Author: mert AuthorDate: Mon Dec 23 13:09:17 2019 +0300 Commit: Tor Lillqvist CommitDate: Wed Jan 8 17:49:19 2020 +0100 Fix insertshapes display problem Insert Shapes dialog opens on the right side of the screen and can be too narrow on desktop Change-Id: I8f9fe8f00989b504d05282fcd5332bf1a1b94ad0 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/85747 Reviewed-by: Tor Lillqvist Tested-by: Tor Lillqvist diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css index 95d7eae00..47ad32e4e 100644 --- a/loleaflet/css/toolbar.css +++ b/loleaflet/css/toolbar.css @@ -764,6 +764,7 @@ button.leaflet-control-search-next position: relative; padding: 2px; display: inline-block; + min-width: 350px; width: 100%; height: 100%; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] online.git: loleaflet/src
loleaflet/src/control/Control.JSDialogBuilder.js |2 +- loleaflet/src/map/Clipboard.js |3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) New commits: commit fc04ba5502d331bde58d796000a787f98b6c87aa Author: mert AuthorDate: Wed Dec 18 19:51:48 2019 +0300 Commit: Michael Meeks CommitDate: Wed Dec 18 19:29:18 2019 +0100 Clipboard improvements for online mobile This patch allows me to copy content to clipboard and paste it into another apps also it works with images/shapes too. They are able to be copied into clipboard. Change-Id: If6660e1f0ee5821fccbb257d2baab45305b4c3fb Reviewed-on: https://gerrit.libreoffice.org/85408 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks Tested-by: Michael Meeks diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index f031a13d8..617a8d9d0 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1444,7 +1444,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ // before close the wizard then execute the action if (data.executionType === 'action') { builder.map.menubar._executeAction(undefined, data.id); - } else { + } else if (!builder.map._clip.filterExecCopyPaste(data.command)) { builder.map.sendUnoCommand(data.command) } }); diff --git a/loleaflet/src/map/Clipboard.js b/loleaflet/src/map/Clipboard.js index 2808f2690..65ab6d1ab 100644 --- a/loleaflet/src/map/Clipboard.js +++ b/loleaflet/src/map/Clipboard.js @@ -469,7 +469,8 @@ L.Clipboard = L.Class.extend({ var plainText = this.stripHTML(text); if (ev.clipboardData) { // Standard - ev.clipboardData.setData('text/plain', plainText); + // if copied content is graphical then plainText is null and it does not work on mobile. + ev.clipboardData.setData('text/plain', plainText ? plainText: ' '); ev.clipboardData.setData('text/html', text); console.log('Put "' + text + '" on the clipboard'); this._clipboardSerial++; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits