[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/sfx2 sfx2/source sw/qa sw/source

2020-06-17 Thread Miklos Vajna (via logerrit)
 include/sfx2/docfile.hxx   |3 ++
 include/sfx2/objsh.hxx |   12 ---
 sfx2/source/doc/docfile.cxx|8 +++
 sfx2/source/doc/objserv.cxx|5 ++--
 sfx2/source/doc/objstor.cxx|   12 ---
 sfx2/source/doc/sfxbasemodel.cxx   |2 -
 sw/qa/extras/htmlexport/htmlexport.cxx |   35 +
 sw/source/filter/html/htmlplug.cxx |   14 +++--
 sw/source/filter/html/wrthtml.cxx  |   10 +
 sw/source/filter/html/wrthtml.hxx  |2 +
 10 files changed, 92 insertions(+), 11 deletions(-)

New commits:
commit 4001186a00cf0cf7f17048818ccbc6fd10a2fcf6
Author: Miklos Vajna 
AuthorDate: Tue Dec 17 17:54:21 2019 +0100
Commit: Gülşah Köse 
CommitDate: Wed Jun 17 10:53:20 2020 +0200

sw reqif-xhtml export: add a new RTFOLEMimeType parameter

This is similar to commit e0f20211a8048a87b078aa4cf0f28c0c847487ad (sw
reqif-xhtml import: add a new AllowedRTFOLEMimeTypes parameter,
2019-12-16), except that was for the import and this is for the import.

The situation was similar, SfxBaseModel::impl_store() still had the
custom store parameters, but later functions lost it, so at the end
OutHTML_FrameFormatOLENodeGrf() in the sw HTML export could not respect
it.

Fix the problem in a similar way, so the SfxMedium instance created for
the duration of the export provides the custom options via
SfxMedium::GetArgs().

Change-Id: I71d2c7920f42d98133f345703cfdfd50f0e8550c
Reviewed-on: https://gerrit.libreoffice.org/85321
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96481
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Gülşah Köse 

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 482c1e4ba3ce..bfed0361c1f6 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -123,6 +123,9 @@ public:
 const std::shared_ptr& GetFilter() const;
 const OUString& GetOrigURL() const;
 
+void SetArgs(const css::uno::Sequence& rArgs);
+css::uno::Sequence GetArgs() const;
+
 SfxItemSet  *   GetItemSet() const;
 voidClose();
 voidCloseAndRelease();
diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx
index c6e9b017a967..4b1e73fd759b 100644
--- a/include/sfx2/objsh.hxx
+++ b/include/sfx2/objsh.hxx
@@ -737,9 +737,15 @@ public:
 SAL_DLLPRIVATE void SetNamedVisibility_Impl();
 SAL_DLLPRIVATE bool DoSave_Impl( const SfxItemSet* pSet );
 SAL_DLLPRIVATE bool Save_Impl( const SfxItemSet* pSet );
-SAL_DLLPRIVATE bool PreDoSaveAs_Impl(const OUString& rFileName, const 
OUString& rFiltName, SfxItemSet const & rItemSet);
-SAL_DLLPRIVATE bool APISaveAs_Impl(const OUString& aFileName, SfxItemSet& 
rItemSet);
-SAL_DLLPRIVATE bool CommonSaveAs_Impl(const INetURLObject& aURL, const 
OUString& aFilterName, SfxItemSet& rItemSet);
+SAL_DLLPRIVATE bool
+PreDoSaveAs_Impl(const OUString& rFileName, const OUString& rFiltName,
+ SfxItemSet const& rItemSet,
+ const css::uno::Sequence& 
rArgs);
+SAL_DLLPRIVATE bool APISaveAs_Impl(const OUString& aFileName, SfxItemSet& 
rItemSet,
+   const 
css::uno::Sequence& rArgs);
+SAL_DLLPRIVATE bool
+CommonSaveAs_Impl(const INetURLObject& aURL, const OUString& aFilterName, 
SfxItemSet& rItemSet,
+  const css::uno::Sequence& 
rArgs);
 SAL_DLLPRIVATE bool GeneralInit_Impl(
 const css::uno::Reference< 
css::embed::XStorage >& xStorage,
 bool bTypeMustBeSetAlready );
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index a7981fedb142..3fc85e6020aa 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -316,6 +316,8 @@ public:
 
 util::DateTime m_aDateTime;
 
+uno::Sequence m_aArgs;
+
 explicit SfxMedium_Impl();
 ~SfxMedium_Impl();
 SfxMedium_Impl(const SfxMedium_Impl&) = delete;
@@ -3281,6 +3283,12 @@ SfxMedium::SfxMedium( const 
uno::Sequence& aArgs ) :
 Init_Impl();
 }
 
+void SfxMedium::SetArgs(const uno::Sequence& rArgs)
+{
+pImpl->m_aArgs = rArgs;
+}
+
+uno::Sequence SfxMedium::GetArgs() const { return 
pImpl->m_aArgs; }
 
 SfxMedium::SfxMedium( const uno::Reference < embed::XStorage >& rStor, const 
OUString& rBaseURL, const SfxItemSet* p ) :
 pImpl(new SfxMedium_Impl)
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 4064c070ff05..beaaa95c263a 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -277,7 +277,8 @@ void SfxObjectShell::PrintState_Impl(SfxItemSet )
 rSet.Put( SfxBoolItem( SID_PRINTOUT, bPrinting ) );
 }
 
-bool SfxObjectShell::APISaveAs_Impl(const OUString& aFileName, SfxItemSet& 
rItemSet)

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/sfx2 sfx2/source

2020-01-09 Thread Michael Meeks (via logerrit)
 include/sfx2/sidebar/Deck.hxx |2 ++
 sfx2/source/sidebar/Deck.cxx  |   37 +
 2 files changed, 39 insertions(+)

New commits:
commit c6c92d01e6f6d8a962c9f452e8fb32cb3e3a41b1
Author: Michael Meeks 
AuthorDate: Thu Jan 9 16:43:11 2020 +
Commit: Michael Meeks 
CommitDate: Thu Jan 9 23:30:43 2020 +0100

lok: simplify jsdialog creation for sidebar panels.

Remove some layers of nested and/or un-necessary content, also
simplifies client-side JS.

Change-Id: I67347035ceb9dbee9c62c99624b5084883d4e61a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86498
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index 4c9558a1966b..23540f017172 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -68,6 +68,8 @@ public:
 virtual bool EventNotify(NotifyEvent& rEvent) override;
 virtual void Resize() override;
 
+virtual boost::property_tree::ptree DumpAsPropertyTree() override;
+
 static void PrintWindowSubTree (vcl::Window* pRoot, int nIndentation);
 
 sal_Int32 GetMinimalWidth() const { return mnMinimalWidth; }
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 60ea6b71ebba..6def9683727e 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -36,6 +36,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -180,6 +181,42 @@ void Deck::Resize()
 Window::Resize();
 }
 
+/*
+ * Get the ordering as is shown in the layout, and our type as 'deck'
+ * also elide nested panel windows.
+ */
+boost::property_tree::ptree Deck::DumpAsPropertyTree()
+{
+boost::property_tree::ptree aTree;
+aTree.put("id", get_id());  // TODO could be missing - sort out
+aTree.put("type", "deck");
+aTree.put("text", GetText());
+aTree.put("enabled", IsEnabled());
+
+boost::property_tree::ptree aChildren;
+for (auto  : maPanels)
+{
+if (it->IsLurking())
+continue;
+
+// collapse the panel itself out
+auto xContent = it->GetElementWindow();
+if (!xContent.is())
+continue;
+VclPtr pWindow = VCLUnoHelper::GetWindow(xContent);
+if (!pWindow)
+continue;
+
+boost::property_tree::ptree aChild = pWindow->DumpAsPropertyTree();
+aChild.put("text", it->GetText());
+aChild.put("type", "panel");
+aChildren.push_back(std::make_pair("", aChild));
+}
+
+aTree.add_child("children", aChildren);
+return aTree;
+}
+
 bool Deck::ProcessWheelEvent(CommandEvent const * pCommandEvent)
 {
 if ( ! mpVerticalScrollBar)
___
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.2' - include/sfx2 sfx2/source

2019-11-25 Thread Ashod Nakashian (via logerrit)
 include/sfx2/sidebar/SidebarChildWindow.hxx   |5 --
 include/sfx2/sidebar/SidebarDockingWindow.hxx |9 ++--
 sfx2/source/sidebar/SidebarChildWindow.cxx|1 
 sfx2/source/sidebar/SidebarDockingWindow.cxx  |   56 +++---
 4 files changed, 30 insertions(+), 41 deletions(-)

New commits:
commit 98a7e776decd1082d3946fc3e00960be458242be
Author: Ashod Nakashian 
AuthorDate: Fri Nov 22 21:07:21 2019 -0500
Commit: Ashod Nakashian 
CommitDate: Mon Nov 25 13:33:59 2019 +0100

sidebar: reset the LOKNotifier when the ViewShell changes

The ViewShell (which implements the LOKNotifier interface)
changes during the lifetime of the SidebarDockingWindow.
This is extremely problematic, because we assign the
LOKNotifier to a window, and use it to emit notifications
to the LOKit clients. When the ViewShell changes, a window
(the SidebarDockingWindow in this case) may end up using
an old ViewShell instance, which may have just been destroyed.

Now we properly reset the LOKNotifier to make sure we are
using the current ViewShell at all times. This is still
not ideal, since we may use the wrong ViewShell to send
out notifications, but we can't control that as we are at
the mercy of the mechanism that changes the current ViewShell.

This also removes obsolete flags to control which
document-types supported sidebar, as well as other misc
cleanups.

Change-Id: Ic208f64596a39feb7354958cf4d5e1e033d87b5b
Reviewed-on: https://gerrit.libreoffice.org/83627
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/include/sfx2/sidebar/SidebarChildWindow.hxx 
b/include/sfx2/sidebar/SidebarChildWindow.hxx
index e37cf443ec86..1fcb25431d94 100644
--- a/include/sfx2/sidebar/SidebarChildWindow.hxx
+++ b/include/sfx2/sidebar/SidebarChildWindow.hxx
@@ -39,11 +39,6 @@ public:
 SFX_DECL_CHILDWINDOW_WITHID(SidebarChildWindow);
 
 static sal_Int32 GetDefaultWidth(vcl::Window const * pWindow);
-
-bool IsSidebarVisibleInLOK() const { return mbSidebarVisibleInLOK; }
-
-private:
-const bool mbSidebarVisibleInLOK;
 };
 
 
diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx 
b/include/sfx2/sidebar/SidebarDockingWindow.hxx
index 5706b8a4ddea..a3297eb3afa8 100644
--- a/include/sfx2/sidebar/SidebarDockingWindow.hxx
+++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx
@@ -62,14 +62,15 @@ protected:
 SfxChildAlignment eRequestedAlignment) override;
 
 private:
+
+/// Notify LOKit that we closed and release the LOKNotifier.
+void LOKClose();
+
+private:
 ::rtl::Reference mpSidebarController;
 bool mbIsReadyToDrag;
 std::unique_ptr mpAccel;
 
-void DoDispose();
-
-const bool mbSidebarVisibleInLOK;
-const SfxViewShell* mpOldViewShell;
 std::unique_ptr mpIdleNotify;
 };
 
diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx 
b/sfx2/source/sidebar/SidebarChildWindow.cxx
index 0690061a634b..99f30bed1fef 100644
--- a/sfx2/source/sidebar/SidebarChildWindow.cxx
+++ b/sfx2/source/sidebar/SidebarChildWindow.cxx
@@ -33,7 +33,6 @@ SFX_IMPL_DOCKINGWINDOW_WITHID(SidebarChildWindow, 
SID_SIDEBAR);
 SidebarChildWindow::SidebarChildWindow(vcl::Window* pParentWindow, sal_uInt16 
nId,
SfxBindings* pBindings, 
SfxChildWinInfo* pInfo)
 : SfxChildWindow(pParentWindow, nId)
-, mbSidebarVisibleInLOK(pInfo && (pInfo->aModule == "scalc" || 
pInfo->aModule == "simpress" || pInfo->aModule == "swriter"))
 {
 auto pDockWin = VclPtr::Create(
 pBindings, *this, pParentWindow, WB_STDDOCKWIN | 
WB_OWNERDRAWDECORATION | WB_CLIPCHILDREN
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx 
b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index a0ed9440180d..b40f47eb4bad 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -88,8 +88,6 @@ SidebarDockingWindow::SidebarDockingWindow(SfxBindings* 
pSfxBindings, SidebarChi
 : SfxDockingWindow(pSfxBindings, , pParentWindow, nBits)
 , mpSidebarController()
 , mbIsReadyToDrag(false)
-, mbSidebarVisibleInLOK(rChildWindow.IsSidebarVisibleInLOK())
-, mpOldViewShell(SfxViewShell::Current())
 , mpIdleNotify(new SidebarNotifyIdle(*this))
 {
 // Get the XFrame from the bindings.
@@ -112,23 +110,26 @@ SidebarDockingWindow::~SidebarDockingWindow()
 
 void SidebarDockingWindow::dispose()
 {
-DoDispose();
-SfxDockingWindow::dispose();
-}
-
-void SidebarDockingWindow::DoDispose()
-{
 if (comphelper::LibreOfficeKit::isActive())
-{
-if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
-pNotifier->notifyWindow(GetLOKWindowId(), "close");
-}
+LOKClose();
 
 Reference xComponent 
(static_cast(mpSidebarController.get()), UNO_QUERY);
 mpSidebarController.clear();
 if (xComponent.is())
-{
 xComponent->dispose();
+
+   

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/sfx2 sfx2/source sw/source

2019-10-31 Thread Grzegorz Araminowicz (via logerrit)
 include/sfx2/lokhelper.hxx |2 +-
 sfx2/source/view/lokhelper.cxx |7 +--
 sw/source/core/crsr/viscrs.cxx |   17 +++--
 3 files changed, 21 insertions(+), 5 deletions(-)

New commits:
commit da7d8464b19b7bcda08bdee2db5d2a2b7e8bde07
Author: Grzegorz Araminowicz 
AuthorDate: Mon Oct 21 12:59:12 2019 +0200
Commit: Jan Holesovsky 
CommitDate: Thu Oct 31 12:38:55 2019 +0100

lok: send hyperlink text and address under cursor

Change-Id: I827c51ae859b3d3649ec9d293b5ae8eaf4cbd630
Reviewed-on: https://gerrit.libreoffice.org/81219
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Jan Holesovsky 

diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx
index ae796e0c7120..57ff680cfdb0 100644
--- a/include/sfx2/lokhelper.hxx
+++ b/include/sfx2/lokhelper.hxx
@@ -55,7 +55,7 @@ public:
 /// Emits a LOK_CALLBACK_INVALIDATE_TILES, but tweaks it according to 
setOptionalFeatures() if needed.
 static void notifyInvalidation(SfxViewShell const* pThisView, const 
OString& rPayload);
 /// Emits a LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR, but tweaks it 
according to setOptionalFeatures() if needed.
-static void notifyVisCursorInvalidation(OutlinerViewShell const* 
pThisView, const OString& rRectangle, bool bMispelledWord = false);
+static void notifyVisCursorInvalidation(OutlinerViewShell const* 
pThisView, const OString& rRectangle, bool bMispelledWord = false, const 
OString& rHyperlink = "");
 /// Notifies all views with the given type and payload.
 static void notifyAllViews(int nType, const OString& rPayload);
 
diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index e1c1b42a0e53..035c4c7fff06 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -254,13 +254,16 @@ void 
SfxLokHelper::notifyDocumentSizeChangedAllViews(vcl::ITiledRenderable* pDoc
 }
 }
 
-void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* 
pThisView, const OString& rRectangle, bool bMispelledWord)
+void SfxLokHelper::notifyVisCursorInvalidation(OutlinerViewShell const* 
pThisView, const OString& rRectangle, bool bMispelledWord, const OString& 
rHyperlink)
 {
 OString sPayload;
 if (comphelper::LibreOfficeKit::isViewIdForVisCursorInvalidation())
 {
+OString sHyperlink = rHyperlink.isEmpty() ? "{}" : rHyperlink;
 sPayload = OString("{ \"viewId\": \"") + 
OString::number(SfxLokHelper::getView()) +
-"\", \"rectangle\": \"" + rRectangle + "\", \"mispelledWord\": \"" 
+  OString::number(bMispelledWord) + "\" }";
+"\", \"rectangle\": \"" + rRectangle +
+"\", \"mispelledWord\": \"" + OString::number(bMispelledWord) +
+"\", \"hyperlink\": " + sHyperlink + " }";
 }
 else
 {
diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx
index 2b14ffa27093..a1c1555858aa 100644
--- a/sw/source/core/crsr/viscrs.cxx
+++ b/sw/source/core/crsr/viscrs.cxx
@@ -241,18 +241,31 @@ void SwVisibleCursor::SetPosAndShow(SfxViewShell const * 
pViewShell)
 }
 }
 
+OString sHyperlink;
+SwContentAtPos aContentAtPos(IsAttrAtPos::InetAttr);
+if 
(const_cast(m_pCursorShell)->GetContentAtPos(aRect.Pos(), 
aContentAtPos))
+{
+const SwFormatINetFormat* pItem = static_cast(aContentAtPos.aFnd.pAttr);
+boost::property_tree::ptree aTree;
+aTree.put("text", aContentAtPos.sStr);
+aTree.put("link", pItem->GetValue());
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, aTree, false);
+sHyperlink = OString(aStream.str().c_str()).trim();
+}
+
 if (pViewShell)
 {
 if (pViewShell == m_pCursorShell->GetSfxViewShell())
 {
-SfxLokHelper::notifyVisCursorInvalidation(pViewShell, sRect, 
bIsWrong);
+SfxLokHelper::notifyVisCursorInvalidation(pViewShell, sRect, 
bIsWrong, sHyperlink);
 }
 else
 
SfxLokHelper::notifyOtherView(m_pCursorShell->GetSfxViewShell(), pViewShell, 
LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
 }
 else
 {
-
SfxLokHelper::notifyVisCursorInvalidation(m_pCursorShell->GetSfxViewShell(), 
sRect, bIsWrong);
+
SfxLokHelper::notifyVisCursorInvalidation(m_pCursorShell->GetSfxViewShell(), 
sRect, bIsWrong, sHyperlink);
 SfxLokHelper::notifyOtherViews(m_pCursorShell->GetSfxViewShell(), 
LOK_CALLBACK_INVALIDATE_VIEW_CURSOR, "rectangle", sRect);
 }
 }
___
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.2' - include/sfx2 sfx2/source

2019-10-31 Thread Ashod Nakashian (via logerrit)
 include/sfx2/sidebar/SidebarDockingWindow.hxx |3 +
 sfx2/source/sidebar/SidebarDockingWindow.cxx  |   58 +++---
 2 files changed, 55 insertions(+), 6 deletions(-)

New commits:
commit a7dd46575d10dfdfdfa8b51976de1d67210e81e7
Author: Ashod Nakashian 
AuthorDate: Wed Oct 30 06:12:26 2019 -0400
Commit: Ashod Nakashian 
CommitDate: Thu Oct 31 11:56:54 2019 +0100

sidebars: add JSDialog support to sidebars

Currently the JSDialog path is only for mobile
and we use the passive notifications for desktop
Online.

Change-Id: I5d26fee9475ede665f269ca1f7b582455be08e50
Reviewed-on: https://gerrit.libreoffice.org/81754
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Ashod Nakashian 

diff --git a/include/sfx2/sidebar/SidebarDockingWindow.hxx 
b/include/sfx2/sidebar/SidebarDockingWindow.hxx
index e54d55f2b791..5706b8a4ddea 100644
--- a/include/sfx2/sidebar/SidebarDockingWindow.hxx
+++ b/include/sfx2/sidebar/SidebarDockingWindow.hxx
@@ -33,6 +33,8 @@ class SidebarChildWindow;
 
 class SidebarController;
 
+class SidebarNotifyIdle;
+
 class SidebarDockingWindow : public SfxDockingWindow
 {
 public:
@@ -68,6 +70,7 @@ private:
 
 const bool mbSidebarVisibleInLOK;
 const SfxViewShell* mpOldViewShell;
+std::unique_ptr mpIdleNotify;
 };
 
 } } // end of namespace sfx2::sidebar
diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx 
b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index 799c0ec712e6..a0ed9440180d 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -28,12 +28,61 @@
 #include 
 #include 
 #include 
+#include 
+
+#include 
 
 using namespace css;
 using namespace css::uno;
 
 namespace sfx2 { namespace sidebar {
 
+class SidebarNotifyIdle : public Idle
+{
+SidebarDockingWindow 
+
+public:
+SidebarNotifyIdle(SidebarDockingWindow ) :
+Idle("Sidebar notify"),
+mrSidebarDockingWin(rSidebarDockingWin)
+{
+SetPriority(TaskPriority::POST_PAINT);
+}
+
+void Invoke() override
+{
+auto pNotifier = mrSidebarDockingWin.GetLOKNotifier();
+if (!pNotifier || !comphelper::LibreOfficeKit::isActive())
+return;
+
+try
+{
+if (comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()))
+{
+// Mobile.
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, 
mrSidebarDockingWin.DumpAsPropertyTree());
+pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, 
aStream.str().c_str());
+}
+else
+{
+// On desktop use the classic notifications.
+std::vector aItems;
+aItems.emplace_back("type", "deck");
+const Point pos = Point(mrSidebarDockingWin.GetOutOffXPixel(),
+mrSidebarDockingWin.GetOutOffYPixel());
+aItems.emplace_back("position", pos.toString());
+aItems.emplace_back("size", 
mrSidebarDockingWin.GetSizePixel().toString());
+pNotifier->notifyWindow(mrSidebarDockingWin.GetLOKWindowId(), 
"created", aItems);
+}
+}
+catch (boost::property_tree::json_parser::json_parser_error& rError)
+{
+SAL_WARN("sfx.sidebar", rError.message());
+}
+}
+};
+
 SidebarDockingWindow::SidebarDockingWindow(SfxBindings* pSfxBindings, 
SidebarChildWindow& rChildWindow,
vcl::Window* pParentWindow, WinBits 
nBits)
 : SfxDockingWindow(pSfxBindings, , pParentWindow, nBits)
@@ -41,6 +90,7 @@ SidebarDockingWindow::SidebarDockingWindow(SfxBindings* 
pSfxBindings, SidebarChi
 , mbIsReadyToDrag(false)
 , mbSidebarVisibleInLOK(rChildWindow.IsSidebarVisibleInLOK())
 , mpOldViewShell(SfxViewShell::Current())
+, mpIdleNotify(new SidebarNotifyIdle(*this))
 {
 // Get the XFrame from the bindings.
 if (pSfxBindings==nullptr || pSfxBindings->GetDispatcher()==nullptr)
@@ -125,13 +175,9 @@ void SidebarDockingWindow::NotifyResize()
 if (mpSidebarController.is() && !GetLOKNotifier())
 SetLOKNotifier(SfxViewShell::Current());
 
-if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+if (GetLOKNotifier())
 {
-std::vector aItems;
-aItems.emplace_back("type", "deck");
-aItems.emplace_back(std::make_pair("position", 
Point(GetOutOffXPixel(), GetOutOffYPixel()).toString()));
-aItems.emplace_back(std::make_pair("size", 
GetSizePixel().toString()));
-pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
+mpIdleNotify->Start();
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/sfx2 sfx2/source

2019-10-10 Thread Michael Meeks (via logerrit)
 include/sfx2/sidebar/Deck.hxx |2 ++
 sfx2/source/sidebar/Deck.cxx  |   42 ++
 2 files changed, 32 insertions(+), 12 deletions(-)

New commits:
commit 520dc93ef80e641b7e838122ec7424f030a57859
Author: Michael Meeks 
AuthorDate: Thu Oct 10 14:35:22 2019 +0100
Commit: Michael Meeks 
CommitDate: Thu Oct 10 16:24:46 2019 +0200

jsdialogs: emit JSON at idle to avoid repeated emission.

Change-Id: If8ddfaf9097f706d82117e102a56b4a8b2a41cdd
Reviewed-on: https://gerrit.libreoffice.org/80609
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/include/sfx2/sidebar/Deck.hxx b/include/sfx2/sidebar/Deck.hxx
index 4c9558a1966b..d631c6f26438 100644
--- a/include/sfx2/sidebar/Deck.hxx
+++ b/include/sfx2/sidebar/Deck.hxx
@@ -31,6 +31,7 @@ namespace sfx2 { namespace sidebar {
 
 class DeckDescriptor;
 class DeckTitleBar;
+class DeckNotifyIdle;
 
 /** This is the parent window of the panels.
 It displays the deck title.
@@ -91,6 +92,7 @@ private:
 sal_Int32 mnMinimalWidth;
 sal_Int32 mnMinimalHeight;
 SharedPanelContainer maPanels;
+std::unique_ptr mpIdleNotify;
 VclPtr mpTitleBar;
 VclPtr mpScrollClipWindow;
 VclPtr mpScrollContainer;
diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index b38525bf7e4d..db47c0bd3ba2 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -44,8 +44,35 @@
 using namespace css;
 using namespace css::uno;
 
+
 namespace sfx2 { namespace sidebar {
 
+class DeckNotifyIdle : public Idle
+{
+Deck 
+public:
+DeckNotifyIdle(Deck ) :
+Idle("Deck notify"),
+mrDeck(rDeck)
+{
+SetPriority(TaskPriority::POST_PAINT);
+}
+void Invoke() override
+{
+auto pNotifier = mrDeck.GetLOKNotifier();
+try
+{
+std::stringstream aStream;
+boost::property_tree::write_json(aStream, 
mrDeck.DumpAsPropertyTree());
+pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, 
aStream.str().c_str());
+}
+catch(boost::property_tree::json_parser::json_parser_error& rError)
+{
+SAL_WARN("sfx.sidebar", rError.message());
+}
+}
+};
+
 Deck::Deck(const DeckDescriptor& rDeckDescriptor, vcl::Window* pParentWindow,
const std::function& rCloserAction)
 : Window(pParentWindow, 0)
@@ -53,6 +80,7 @@ Deck::Deck(const DeckDescriptor& rDeckDescriptor, 
vcl::Window* pParentWindow,
 , mnMinimalWidth(0)
 , mnMinimalHeight(0)
 , maPanels()
+, mpIdleNotify(new DeckNotifyIdle(*this))
 , mpTitleBar(VclPtr::Create(rDeckDescriptor.msTitle, this, 
rCloserAction))
 , mpScrollClipWindow(VclPtr::Create(this))
 , 
mpScrollContainer(VclPtr::Create(mpScrollClipWindow.get()))
@@ -187,21 +215,11 @@ void Deck::Resize()
 {
 Window::Resize();
 
-const vcl::ILibreOfficeKitNotifier *pNotifier;
 if (comphelper::LibreOfficeKit::isActive() &&
 comphelper::LibreOfficeKit::isMobile(SfxLokHelper::getView()) &&
-(pNotifier = GetLOKNotifier()))
+GetLOKNotifier())
 {
-try
-{
-std::stringstream aStream;
-boost::property_tree::write_json(aStream, DumpAsPropertyTree());
-pNotifier->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, 
aStream.str().c_str());
-}
-catch(boost::property_tree::json_parser::json_parser_error& rError)
-{
-SAL_WARN("sfx.sidebar", rError.message());
-}
+mpIdleNotify->Start();
 }
 }
 
___
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.2' - include/sfx2 sfx2/source

2019-08-28 Thread Muhammet Kara (via logerrit)
 include/sfx2/strings.hrc |   29 +
 sfx2/source/doc/autoredactdialog.cxx |   73 +++
 2 files changed, 69 insertions(+), 33 deletions(-)

New commits:
commit 1f97392db369df7914c3ff2b94b0d80f1673211d
Author: Muhammet Kara 
AuthorDate: Mon Aug 26 17:51:19 2019 +0300
Commit: Muhammet Kara 
CommitDate: Thu Aug 29 00:05:17 2019 +0200

Make temp strings localizable in AutoRedactDialog

Change-Id: Ic7136408b5b66ba437df92fe96d2852ae512cda0
Reviewed-on: https://gerrit.libreoffice.org/78154
Tested-by: Jenkins
Reviewed-by: Muhammet Kara 
Reviewed-on: https://gerrit.libreoffice.org/78159
Tested-by: Jenkins CollaboraOffice 

diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index 373ca649fa48..3c7a9da9a5a0 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -183,6 +183,35 @@
 #define STR_WELCOME_LINE1   NC_("STR_WELCOME_LINE1", 
"Welcome to %PRODUCTNAME.")
 #define STR_WELCOME_LINE2   NC_("STR_WELCOME_LINE2", "Drop 
a document here or pick an app from the left side to create one.")
 
+// Translators: Target types in Auto-redaction dialog
+#define STR_REDACTION_TARGET_TYPE_TEXT  
NC_("STR_REDACTION_TARGET_TYPE_TEXT", "Text")
+#define STR_REDACTION_TARGET_TYPE_REGEX 
NC_("STR_REDACTION_TARGET_TYPE_REGEX", "Regex")
+#define STR_REDACTION_TARGET_TYPE_PREDEF
NC_("STR_REDACTION_TARGET_TYPE_PREDEF", "Predefined")
+#define STR_REDACTION_TARGET_TYPE_UNKNOWN   
NC_("STR_REDACTION_TARGET_TYPE_UNKNOWN", "Unknown")
+
+// Translators: Column headers in Auto-redaction dialog's targets list
+#define STR_REDACTION_TARGET_NAME   
NC_("STR_REDACTION_TARGET_NAME", "Target Name")
+#define STR_REDACTION_TYPE  NC_("STR_REDACTION_TYPE", 
"Type")
+#define STR_REDACTION_CONTENT   NC_("STR_REDACTION_CONTENT", 
"Content")
+#define STR_REDACTION_CASE_SENSITIVE
NC_("STR_REDACTION_CASE_SENSITIVE", "Case Sensitive")
+#define STR_REDACTION_WHOLE_WORDS   
NC_("STR_REDACTION_WHOLE_WORDS", "Whole Words")
+
+// Translators: Values for the Case Sensitive and the Whole Words columns in 
Auto-redaction dialog
+#define STR_REDACTION_YES   NC_("STR_REDACTION_YES", "Yes")
+#define STR_REDACTION_NONC_("STR_REDACTION_NO", "No")
+
+// Translators: Misc strings of the Auto Redaction dialog
+#define STR_REDACTION_TARGETNC_("STR_REDACTION_TARGET", 
"Target")
+#define STR_REDACTION_LOAD_TARGETS  
NC_("STR_REDACTION_LOAD_TARGETS", "Load Targets")
+#define STR_REDACTION_SAVE_TARGETS  
NC_("STR_REDACTION_SAVE_TARGETS", "Save Targets")
+#define STR_REDACTION_FIELDS_REQUIRED   
NC_("STR_REDACTION_FIELDS_REQUIRED", "All fields are required")
+#define STR_REDACTION_TARGET_NAME_CLASH 
NC_("STR_REDACTION_TARGET_NAME_CLASH", "There is already a target with this 
name")
+#define STR_REDACTION_MULTI_EDIT
NC_("STR_REDACTION_MULTI_EDIT", "You have selected multiple targets, but only 
one target can be edited at once.")
+#define STR_REDACTION_MULTI_DELETE  
NC_("STR_REDACTION_MULTI_DELETE", "Are you sure you would like to delete 
$(TARGETSCOUNT) targets at once?")
+#define STR_REDACTION_JSON_FILE_FILTER  
NC_("STR_REDACTION_JSON_FILE_FILTER", "Target Set (*.json)")
+#define STR_REDACTION_EDIT_TARGET   
NC_("STR_REDACTION_EDIT_TARGET", "Edit Target")
+#define STR_REDACTION_TARGET_ADD_ERROR  
NC_("STR_REDACTION_TARGET_ADD_ERROR", "An error occurred while adding new 
target. Please report this incident.")
+
 #define STR_SFX_FILEDLG_ACTUALVERSION   
NC_("STR_SFX_FILEDLG_ACTUALVERSION", "Current version")
 #define STR_SFX_EXPLORERFILE_EXPORT 
NC_("STR_SFX_EXPLORERFILE_EXPORT", "Export")
 #define STR_SFX_EXPLORERFILE_INSERT 
NC_("STR_SFX_EXPLORERFILE_INSERT", "Insert")
diff --git a/sfx2/source/doc/autoredactdialog.cxx 
b/sfx2/source/doc/autoredactdialog.cxx
index b7cd1ce67f56..3fb9d6e03c7d 100644
--- a/sfx2/source/doc/autoredactdialog.cxx
+++ b/sfx2/source/doc/autoredactdialog.cxx
@@ -36,6 +36,8 @@
 
 #include 
 
+#define FILEDIALOG_FILTER_JSON "*.json"
+
 int TargetsTable::GetRowByTargetName(const OUString& sName)
 {
 for (int i = 0, nCount = m_xControl->n_children(); i < nCount; ++i)
@@ -68,21 +70,21 @@ namespace
 {
 OUString getTypeName(RedactionTargetType nType)
 {
-OUString sTypeName("Unknown");
+OUString sTypeName(SfxResId(STR_REDACTION_TARGET_TYPE_UNKNOWN));
 
 switch (nType)
 {
 case RedactionTargetType::REDACTION_TARGET_TEXT:
-sTypeName = "Text";
+sTypeName = SfxResId(STR_REDACTION_TARGET_TYPE_TEXT);
 break;
 case RedactionTargetType::REDACTION_TARGET_REGEX:
-sTypeName = "Regex";
+sTypeName = 

[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - include/sfx2 sfx2/source

2019-07-07 Thread Mike Kaganski (via logerrit)
 include/sfx2/docfile.hxx |3 +
 include/sfx2/strings.hrc |3 +
 sfx2/source/doc/docfile.cxx  |   73 ++-
 sfx2/source/view/viewfrm.cxx |   43 +
 4 files changed, 86 insertions(+), 36 deletions(-)

New commits:
commit 7943a3b4b7ab5891e0be61bcfedd7c55a1ef8bf4
Author: Mike Kaganski 
AuthorDate: Fri Jul 5 17:56:38 2019 +1000
Commit: Mike Kaganski 
CommitDate: Mon Jul 8 04:47:48 2019 +0200

Show who has locked the document when reopening a read-only document

Pass the locking data from SfxMedium::LockOrigFileOnDemand, to allow
clients to show it themselves when required.

Change-Id: I6afe46a1896e1b60771c080efa2f58794dbed8a6
Reviewed-on: https://gerrit.libreoffice.org/75113
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-on: https://gerrit.libreoffice.org/75137
Tested-by: Mike Kaganski 

diff --git a/include/sfx2/docfile.hxx b/include/sfx2/docfile.hxx
index 2f7d9454c1e5..482c1e4ba3ce 100644
--- a/include/sfx2/docfile.hxx
+++ b/include/sfx2/docfile.hxx
@@ -169,7 +169,8 @@ public:
 FailedLockFile, // there was only lock file that prevented success - 
no syslock or IO error
 Succeeded,
 };
-LockFileResult  LockOrigFileOnDemand( bool bLoading, bool bNoUI, bool 
bTryIgnoreLockFile = false );
+LockFileResult LockOrigFileOnDemand(bool bLoading, bool bNoUI, bool 
bTryIgnoreLockFile = false,
+LockFileEntry* pLockData = nullptr);
 voidDisableUnlockWebDAV( bool bDisableUnlockWebDAV = true 
);
 voidUnlockFile( bool bReleaseLockStream );
 /// Lets Transfer_Impl() not fsync the output file.
diff --git a/include/sfx2/strings.hrc b/include/sfx2/strings.hrc
index a77dbc86d77d..373ca649fa48 100644
--- a/include/sfx2/strings.hrc
+++ b/include/sfx2/strings.hrc
@@ -239,7 +239,8 @@
 #define STR_ERROR_SEND_MAIL_CODE
NC_("STR_ERROR_SEND_MAIL_CODE", "An error occurred in sending the message. 
Possible errors could be a missing user account or a defective setup.\n\nError 
code is $1")
 #define STR_ERROR_SEND_MAIL_HEADER  
NC_("STR_ERROR_SEND_MAIL_HEADER", "Error sending mail")
 #define STR_QUERY_OPENASTEMPLATE
NC_("STR_QUERY_OPENASTEMPLATE", "This document cannot be edited, possibly due 
to missing access rights. Do you want to edit a copy of the document?")
-#define STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE   
NC_("STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE", "This document cannot be edited, 
because it is locked in another session. Do you want to edit a copy of the 
document?\n\nYou can also try to ignore the lock and open the file for 
editing.")
+#define STR_QUERY_OPENASTEMPLATE_LOCKED 
NC_("STR_QUERY_OPENASTEMPLATE_LOCKED", "This document cannot be edited, because 
it is locked in another session.%LOCKINFO\nDo you want to edit a copy of the 
document?")
+#define STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE   
NC_("STR_QUERY_OPENASTEMPLATE_ALLOW_IGNORE", "You can also try to ignore the 
lock and open the file for editing.")
 #define STR_QUERY_OPENASTEMPLATE_OPENCOPY_BTN   
NC_("STR_QUERY_OPENASTEMPLATE_OPENCOPY_BTN", "Open ~Copy")
 #define STR_QUERY_OPENASTEMPLATE_OPEN_BTN   
NC_("STR_QUERY_OPENASTEMPLATE_OPEN_BTN", "~Open")
 #define STR_REPAIREDDOCUMENTNC_("STR_REPAIREDDOCUMENT", " 
(repaired document)")
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index bb153e5badb5..789f3b8b8dae 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -1117,7 +1117,9 @@ namespace
 
 // sets SID_DOC_READONLY if the document cannot be opened for editing
 // if user cancel the loading the ERROR_ABORT is set
-SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand( bool bLoading, bool 
bNoUI, bool bTryIgnoreLockFile )
+SfxMedium::LockFileResult SfxMedium::LockOrigFileOnDemand(bool bLoading, bool 
bNoUI,
+  bool 
bTryIgnoreLockFile,
+  LockFileEntry* 
pLockData)
 {
 #if !HAVE_FEATURE_MULTIUSER_ENVIRONMENT
 (void) bLoading;
@@ -1168,37 +1170,47 @@ SfxMedium::LockFileResult 
SfxMedium::LockOrigFileOnDemand( bool bLoading, bool b
 catch ( ucb::InteractiveLockingLockedException& )
 {
 // received when the resource is already locked
-// get the lock owner, using a special ucb.webdav 
property
-// the owner property retrieved here is  what the 
other principal send the server
-// when activating the lock.
-// See 
http://tools.ietf.org/html/rfc4918#section-14.17 for details
-LockFileEntry aLockData;
-aLockData[LockFileComponent::OOOUSERNAME] =