[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2023-05-24 Thread Caolán McNamara (via logerrit)
 sfx2/source/doc/iframe.cxx |   21 ++---
 1 file changed, 14 insertions(+), 7 deletions(-)

New commits:
commit ad8ccdad7f77b91c2b39b567b43da7dfc5947a02
Author: Caolán McNamara 
AuthorDate: Tue Apr 11 10:13:37 2023 +0100
Commit: Caolán McNamara 
CommitDate: Wed May 24 11:39:42 2023 +0200

set Referer on loading IFrames

so tools, options, security, options,
"block any links from document not..."
applies to their contents.

Change-Id: I04839aea6b07a4a76ac147a85045939ccd9c3c79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150221
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150751
Reviewed-by: Stephan Bergmann 
(cherry picked from commit acff9ca0579333b45d10ae5f8cd48172f563)
(cherry picked from commit 04c8176fb40d2eb983aa0bd0a6ce65804d3f6ecd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152110
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index 96502ce60726..b9495b8fd311 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -33,10 +33,12 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -164,14 +166,19 @@ sal_Bool SAL_CALL IFrameObject::load(
 uno::Reference < util::XURLTransformer > xTrans( 
util::URLTransformer::create( mxContext ) );
 xTrans->parseStrict( aTargetURL );
 
+uno::Reference xParentFrame = 
xFrame->getCreator();
+SfxObjectShell* pDoc = SfxMacroLoader::GetObjectShell(xParentFrame);
+
 if (INetURLObject(aTargetURL.Complete).GetProtocol() == 
INetProtocol::Macro)
 {
-uno::Reference xParentFrame = 
xFrame->getCreator();
-SfxObjectShell* pDoc = 
SfxMacroLoader::GetObjectShell(xParentFrame);
 if (pDoc && !pDoc->AdjustMacroMode())
 return false;
 }
 
+OUString sReferer;
+if (pDoc && pDoc->HasName())
+sReferer = pDoc->GetMedium()->GetName();
+
 DBG_ASSERT( !mxFrame.is(), "Frame already existing!" );
 VclPtr pParent = VCLUnoHelper::GetWindow( 
xFrame->getContainerWindow() );
 VclPtr pWin = VclPtr::Create( 
pParent, maFrmDescr.IsFrameBorderOn() );
@@ -194,11 +201,11 @@ sal_Bool SAL_CALL IFrameObject::load(
 if ( xFramesSupplier.is() )
 mxFrame->setCreator( xFramesSupplier );
 
-uno::Sequence < beans::PropertyValue > aProps(2);
-aProps[0].Name = "PluginMode";
-aProps[0].Value <<= sal_Int16(2);
-aProps[1].Name = "ReadOnly";
-aProps[1].Value <<= true;
+uno::Sequence < beans::PropertyValue > aProps{
+comphelper::makePropertyValue("PluginMode", sal_Int16(2)),
+comphelper::makePropertyValue("ReadOnly", true),
+comphelper::makePropertyValue("Referer", sReferer)
+};
 uno::Reference < frame::XDispatch > xDisp = mxFrame->queryDispatch( 
aTargetURL, "_self", 0 );
 if ( xDisp.is() )
 xDisp->dispatch( aTargetURL, aProps );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2022-11-03 Thread Henry Castro (via logerrit)
 sfx2/source/doc/objstor.cxx |   15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 17bf69ba9d8168106162d1a4ddef7cb34d50fe73
Author: Henry Castro 
AuthorDate: Thu Nov 3 10:52:16 2022 -0400
Commit: Aron Budea 
CommitDate: Thu Nov 3 19:47:05 2022 +0100

sfx2: add log information to catch the exception

Add log information for data analysis if the ExportTo
fails due to an exception.

Signed-off-by: Henry Castro 
Change-Id: I888545da14f413a970faf50b3ce60d12966f3f9e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142202
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Aron Budea 

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index cee35fc3443c..e657ca6dad1c 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2486,8 +2486,19 @@ bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
 }
 
 return xFilter->filter( aArgs );
-}catch(...)
-{}
+}
+catch (const css::uno::RuntimeException & e)
+{
+SAL_INFO("sfx.doc", "ExportTo: " << e);
+}
+catch (const std::exception & e)
+{
+SAL_INFO("sfx.doc", "ExportTo: " << e.what());
+}
+catch(...)
+{
+SAL_INFO("sfx.doc", "ExportTo: Unknown exception!");
+}
 }
 
 return false;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source sw/source

2022-09-07 Thread Caolán McNamara (via logerrit)
 sfx2/source/appl/macroloader.cxx   |9 +++--
 sfx2/source/doc/iframe.cxx |   20 +++-
 sfx2/source/inc/macroloader.hxx|2 ++
 sw/source/filter/html/htmlplug.cxx |7 ++-
 sw/source/filter/xml/xmltexti.cxx  |9 +++--
 5 files changed, 37 insertions(+), 10 deletions(-)

New commits:
commit d15617845b4801475827d80e9a9239786459856c
Author: Caolán McNamara 
AuthorDate: Tue Aug 30 17:01:08 2022 +0100
Commit: Andras Timar 
CommitDate: Wed Sep 7 08:24:34 2022 +0200

check IFrame "FrameURL" target

similiar to

commit b3edf85e0fe6ca03dc26e1bf531be82193bc9627
Date:   Wed Aug 7 17:37:11 2019 +0100

warn on load when a document binds an event to a macro

Change-Id: Iea888b1c083d2dc69ec322309ac9ae8c5e5eb315
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139059
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit c7450d0b9d02c64ae3da467d329040787039767e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139117
Reviewed-by: Christian Lohmaier 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139527
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Andras Timar 

diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx
index 46090f712665..ad70ef5fa0f6 100644
--- a/sfx2/source/appl/macroloader.cxx
+++ b/sfx2/source/appl/macroloader.cxx
@@ -68,10 +68,10 @@ css::uno::Sequence SAL_CALL 
SfxMacroLoader::getSupportedServiceNames()
 return { "com.sun.star.frame.ProtocolHandler" };
 }
 
-SfxObjectShell* SfxMacroLoader::GetObjectShell_Impl()
+SfxObjectShell* SfxMacroLoader::GetObjectShell(const Reference & 
xFrame)
 {
 SfxObjectShell* pDocShell = nullptr;
-Reference < XFrame > xFrame( m_xFrame.get(), UNO_QUERY );
+
 if ( xFrame.is() )
 {
 SfxFrame* pFrame=nullptr;
@@ -88,6 +88,11 @@ SfxObjectShell* SfxMacroLoader::GetObjectShell_Impl()
 return pDocShell;
 }
 
+SfxObjectShell* SfxMacroLoader::GetObjectShell_Impl()
+{
+Reference < XFrame > xFrame( m_xFrame.get(), UNO_QUERY );
+return SfxMacroLoader::GetObjectShell(xFrame);
+}
 
 uno::Reference SAL_CALL SfxMacroLoader::queryDispatch(
 const util::URL&   aURL,
diff --git a/sfx2/source/doc/iframe.cxx b/sfx2/source/doc/iframe.cxx
index e37607c91a46..96502ce60726 100644
--- a/sfx2/source/doc/iframe.cxx
+++ b/sfx2/source/doc/iframe.cxx
@@ -38,10 +38,12 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 
@@ -157,6 +159,19 @@ sal_Bool SAL_CALL IFrameObject::load(
 {
 if ( officecfg::Office::Common::Misc::PluginsEnabled::get() )
 {
+util::URL aTargetURL;
+aTargetURL.Complete = maFrmDescr.GetURL().GetMainURL( 
INetURLObject::DecodeMechanism::NONE );
+uno::Reference < util::XURLTransformer > xTrans( 
util::URLTransformer::create( mxContext ) );
+xTrans->parseStrict( aTargetURL );
+
+if (INetURLObject(aTargetURL.Complete).GetProtocol() == 
INetProtocol::Macro)
+{
+uno::Reference xParentFrame = 
xFrame->getCreator();
+SfxObjectShell* pDoc = 
SfxMacroLoader::GetObjectShell(xParentFrame);
+if (pDoc && !pDoc->AdjustMacroMode())
+return false;
+}
+
 DBG_ASSERT( !mxFrame.is(), "Frame already existing!" );
 VclPtr pParent = VCLUnoHelper::GetWindow( 
xFrame->getContainerWindow() );
 VclPtr pWin = VclPtr::Create( 
pParent, maFrmDescr.IsFrameBorderOn() );
@@ -179,11 +194,6 @@ sal_Bool SAL_CALL IFrameObject::load(
 if ( xFramesSupplier.is() )
 mxFrame->setCreator( xFramesSupplier );
 
-util::URL aTargetURL;
-aTargetURL.Complete = maFrmDescr.GetURL().GetMainURL( 
INetURLObject::DecodeMechanism::NONE );
-uno::Reference < util::XURLTransformer > xTrans( 
util::URLTransformer::create( mxContext ) );
-xTrans->parseStrict( aTargetURL );
-
 uno::Sequence < beans::PropertyValue > aProps(2);
 aProps[0].Name = "PluginMode";
 aProps[0].Value <<= sal_Int16(2);
diff --git a/sfx2/source/inc/macroloader.hxx b/sfx2/source/inc/macroloader.hxx
index 051486c09adf..62a6555ff877 100644
--- a/sfx2/source/inc/macroloader.hxx
+++ b/sfx2/source/inc/macroloader.hxx
@@ -79,6 +79,8 @@ public:
 virtual void SAL_CALL addStatusListener( const css::uno::Reference< 
css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override;
 
 virtual void SAL_CALL removeStatusListener( const css::uno::Reference< 
css::frame::XStatusListener >& xControl, const css::util::URL& aURL ) override;
+
+static SfxObjectShell* GetObjectShell(const 
css::uno::Reference& xFrame);
 };
 
 #endif
diff --git a/sw/source/filter/html/htmlplug.cxx 
b/sw/source/filter/html/htmlplug.cxx
index 65e0419f4ed9..90036cfac67a 100644
--- a/sw/source/filter/html/htmlplug.cxx
+++ 

[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2022-05-23 Thread Szymon Kłos (via logerrit)
 sfx2/source/sidebar/SidebarController.cxx |9 ++---
 1 file changed, 2 insertions(+), 7 deletions(-)

New commits:
commit 89ceb3504c74e6f7875785d436a378a991ba2f8a
Author: Szymon Kłos 
AuthorDate: Mon May 23 14:51:07 2022 +0200
Commit: Michael Meeks 
CommitDate: Mon May 23 15:41:37 2022 +0200

Revert "lok: sidebar: avoid async call to switch context"

Async call was introduced so we will not switch panels multiple times
in a row, but only one time. That patch was bad for performance.

This reverts commit 55f65c4d6cf7d1f68fe9c39c42431e6a15d903e6.

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

diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index ba1c968d022f..db4f9679e34a 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -332,9 +332,8 @@ void SAL_CALL SidebarController::notifyContextChangeEvent 
(const css::ui::Contex
 maContextChangeUpdate.RequestCall(); // async call, not a prob
  // calling with held
  // solarmutex
-if (comphelper::LibreOfficeKit::isActive())
-maContextChangeUpdate.Sync();
-else // TODO: this call is redundant but mandatory for unit test to 
update context on document loading
+// TODO: this call is redundant but mandatory for unit test to update 
context on document loading
+if (!comphelper::LibreOfficeKit::isActive())
 UpdateConfigurations();
 }
 }
@@ -374,8 +373,6 @@ void SAL_CALL SidebarController::statusChanged (const 
css::frame::FeatureStateEv
 mnRequestedForceFlags |= SwitchFlag_ForceSwitch;
 maContextChangeUpdate.RequestCall(); // async call, ok to call
  // with held solarmutex
-if (comphelper::LibreOfficeKit::isActive())
-maContextChangeUpdate.Sync();
 }
 }
 
@@ -1031,8 +1028,6 @@ IMPL_LINK(SidebarController, WindowEventHandler, 
VclWindowEvent&, rEvent, void)
 mpParentWindow->Invalidate();
 mnRequestedForceFlags |= SwitchFlag_ForceNewDeck | 
SwitchFlag_ForceNewPanels;
 maContextChangeUpdate.RequestCall();
-if (comphelper::LibreOfficeKit::isActive())
-maContextChangeUpdate.Sync();
 break;
 
 case VclEventId::ObjectDying:


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2022-05-20 Thread Szymon Kłos (via logerrit)
 sfx2/source/appl/appserv.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 08891ae798b1e59719684d1b0343767c9d136a11
Author: Szymon Kłos 
AuthorDate: Fri May 20 19:18:11 2022 +0200
Commit: Michael Meeks 
CommitDate: Fri May 20 22:27:11 2022 +0200

lok: sidebar: notebookbar: don't change view mode for other views

We should change view mode (notebookbar/toolbars) only for current view.
This prevents the closed sidebar from showing when other view joins the 
session.

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

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 2e41b999cf70..6dec63520128 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -813,6 +813,14 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
 pViewFrame = SfxViewFrame::GetFirst();
 while( pViewFrame )
 {
+// in LOK case we want to apply changes only to the current 
view
+if (comphelper::LibreOfficeKit::isActive() &&
+pViewFrame != SfxViewShell::Current()->GetViewFrame())
+{
+pViewFrame = SfxViewFrame::GetNext( *pViewFrame );
+continue;
+}
+
 Reference xFrame = 
pViewFrame->GetFrame().GetFrameInterface();
 
 // We want to change mode only for a current app module, 
ignore other apps


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2022-05-20 Thread Szymon Kłos (via logerrit)
 sfx2/source/sidebar/SidebarController.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 55f65c4d6cf7d1f68fe9c39c42431e6a15d903e6
Author: Szymon Kłos 
AuthorDate: Fri May 20 19:16:03 2022 +0200
Commit: Michael Meeks 
CommitDate: Fri May 20 22:26:15 2022 +0200

lok: sidebar: avoid async call to switch context

This makes us sure we don't trigger actions for other views
in LOK case.

We need to call Sync() after RequestCall() so it will be executed
synchronously.

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

diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index db4f9679e34a..ba1c968d022f 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -332,8 +332,9 @@ void SAL_CALL SidebarController::notifyContextChangeEvent 
(const css::ui::Contex
 maContextChangeUpdate.RequestCall(); // async call, not a prob
  // calling with held
  // solarmutex
-// TODO: this call is redundant but mandatory for unit test to update 
context on document loading
-if (!comphelper::LibreOfficeKit::isActive())
+if (comphelper::LibreOfficeKit::isActive())
+maContextChangeUpdate.Sync();
+else // TODO: this call is redundant but mandatory for unit test to 
update context on document loading
 UpdateConfigurations();
 }
 }
@@ -373,6 +374,8 @@ void SAL_CALL SidebarController::statusChanged (const 
css::frame::FeatureStateEv
 mnRequestedForceFlags |= SwitchFlag_ForceSwitch;
 maContextChangeUpdate.RequestCall(); // async call, ok to call
  // with held solarmutex
+if (comphelper::LibreOfficeKit::isActive())
+maContextChangeUpdate.Sync();
 }
 }
 
@@ -1028,6 +1031,8 @@ IMPL_LINK(SidebarController, WindowEventHandler, 
VclWindowEvent&, rEvent, void)
 mpParentWindow->Invalidate();
 mnRequestedForceFlags |= SwitchFlag_ForceNewDeck | 
SwitchFlag_ForceNewPanels;
 maContextChangeUpdate.RequestCall();
+if (comphelper::LibreOfficeKit::isActive())
+maContextChangeUpdate.Sync();
 break;
 
 case VclEventId::ObjectDying:


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2022-05-18 Thread Andras Timar (via logerrit)
 sfx2/source/doc/objstor.cxx |   31 ---
 1 file changed, 31 deletions(-)

New commits:
commit 900891c3b42e80e8d3970fd5fc02b67022ae3795
Author: Andras Timar 
AuthorDate: Mon May 16 15:55:35 2022 +0200
Commit: Andras Timar 
CommitDate: Wed May 18 10:38:31 2022 +0200

Revert "sw: restore UI language to en while saving"

This reverts commit f4ef1e3e580f7a590496d62aaa3dc7e092510a9c.
Reason: T35383 Writer: Page breaks saved in German UI/locale turn into line 
breaks

Change-Id: Iea7c41b361beb0bc6f455e72ab48cef3604305d6

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 238369b746e6..7ccee4f3a970 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -91,7 +91,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -3169,11 +3168,6 @@ bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
 return false;
 }
 
-namespace
-{
-static LanguageTag g_defaultLanguageTag("en-US", true);
-}
-
 bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
 {
 uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
@@ -3196,31 +3190,6 @@ bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium 
)
 pImpl->aBasicManager.storeLibrariesToStorage( xStorage );
 }
 #endif
-
-// Because XMLTextFieldExport::ExportFieldDeclarations (called from 
SwXMLExport)
-// calls SwXTextFieldMasters::getByName, which in turn maps property 
names by
-// calling SwStyleNameMapper::GetTextUINameArray, which uses
-// SvtSysLocale().GetUILanguageTag() to do the mapping, saving 
indirectly depends
-// on the UI language. This is an unfortunate depenency.
-// Here we restore to English
-const auto viewLanguage = comphelper::LibreOfficeKit::getLanguageTag();
-
-// Use the default language for saving and restore later if necessary.
-bool restoreLanguage = false;
-if (comphelper::LibreOfficeKit::isActive() && viewLanguage != 
g_defaultLanguageTag)
-{
-restoreLanguage = true;
-comphelper::LibreOfficeKit::setLanguageTag(g_defaultLanguageTag);
-}
-
-// Restore the view's original language automatically and as necessary.
-const ::comphelper::ScopeGuard aGuard(
-[, restoreLanguage]()
-{
-if (restoreLanguage && viewLanguage != 
comphelper::LibreOfficeKit::getLanguageTag())
-comphelper::LibreOfficeKit::setLanguageTag(viewLanguage);
-});
-
 return SaveAs( rMedium );
 }
 else return false;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2022-05-02 Thread Ashod Nakashian (via logerrit)
 sfx2/source/doc/objstor.cxx |   31 +++
 1 file changed, 31 insertions(+)

New commits:
commit f4ef1e3e580f7a590496d62aaa3dc7e092510a9c
Author: Ashod Nakashian 
AuthorDate: Sun May 1 16:52:30 2022 -0400
Commit: Michael Meeks 
CommitDate: Mon May 2 10:43:13 2022 +0200

sw: restore UI language to en while saving

Because the XML writer used in sw invokes the
translation logic, which uses the UI language,
saving can fail in case there are multiple
views with different langauges. This restores
the default language before saving to avoid
such issues and to make sure the document
xml is generated in the default language.

Signed-off-by: Ashod Nakashian 
Change-Id: Ibc0813de33cf7cf3528b0ff1d95560e799903fb0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133676
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 7ccee4f3a970..238369b746e6 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -91,6 +91,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -3168,6 +3169,11 @@ bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
 return false;
 }
 
+namespace
+{
+static LanguageTag g_defaultLanguageTag("en-US", true);
+}
+
 bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
 {
 uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
@@ -3190,6 +3196,31 @@ bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium 
)
 pImpl->aBasicManager.storeLibrariesToStorage( xStorage );
 }
 #endif
+
+// Because XMLTextFieldExport::ExportFieldDeclarations (called from 
SwXMLExport)
+// calls SwXTextFieldMasters::getByName, which in turn maps property 
names by
+// calling SwStyleNameMapper::GetTextUINameArray, which uses
+// SvtSysLocale().GetUILanguageTag() to do the mapping, saving 
indirectly depends
+// on the UI language. This is an unfortunate depenency.
+// Here we restore to English
+const auto viewLanguage = comphelper::LibreOfficeKit::getLanguageTag();
+
+// Use the default language for saving and restore later if necessary.
+bool restoreLanguage = false;
+if (comphelper::LibreOfficeKit::isActive() && viewLanguage != 
g_defaultLanguageTag)
+{
+restoreLanguage = true;
+comphelper::LibreOfficeKit::setLanguageTag(g_defaultLanguageTag);
+}
+
+// Restore the view's original language automatically and as necessary.
+const ::comphelper::ScopeGuard aGuard(
+[, restoreLanguage]()
+{
+if (restoreLanguage && viewLanguage != 
comphelper::LibreOfficeKit::getLanguageTag())
+comphelper::LibreOfficeKit::setLanguageTag(viewLanguage);
+});
+
 return SaveAs( rMedium );
 }
 else return false;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2022-01-14 Thread Szymon Kłos (via logerrit)
 sfx2/source/view/ipclient.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit af168ae749dfd816fe029bbca5967fc3d5a1aa81
Author: Szymon Kłos 
AuthorDate: Thu Jan 13 16:09:24 2022 +0100
Commit: Mike Kaganski 
CommitDate: Fri Jan 14 09:49:51 2022 +0100

Fix ambiguous error in VS

Change-Id: If18ef06f5a27a4266b21df4ba07bd5bc01255f55
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128381
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Mike Kaganski 

diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 141e7f954e19..cde5249f0461 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -93,9 +93,9 @@ public:
 tools::Rectangle lcl_negateRectX(const tools::Rectangle& rRect)
 {
 return tools::Rectangle(
-std::max(0l, -rRect.Right()),
+std::max(static_cast(0l), -rRect.Right()),
 rRect.Top(),
-std::max(0l, -rRect.Left()),
+std::max(static_cast(0l), -rRect.Left()),
 rRect.Bottom());
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source vcl/source

2022-01-04 Thread Michael Meeks (via logerrit)
 sfx2/source/view/lokhelper.cxx |   13 -
 vcl/source/window/window2.cxx  |6 +++---
 2 files changed, 11 insertions(+), 8 deletions(-)

New commits:
commit f64fd5abf2a9cd7dd2cba9a57a4c8013cd634472
Author: Michael Meeks 
AuthorDate: Mon Jan 3 14:15:49 2022 +
Commit: Michael Meeks 
CommitDate: Tue Jan 4 14:39:14 2022 +0100

lokit: double check for disposed windows & fix leak.

it seems we can get windows disposed before we get to the emission.


vcl::Window::IsTracking() const vcl/source/window/window2.cxx:341
(anonymous namespace)::LOKPostAsyncEvent(void*, void*) 
sfx2/source/view/lokhelper.cxx:725
LokChartHelper::postMouseEvent(int, int, int, int, int, int, double, 
double) include/rtl/ref.hxx:112
SwXTextDocument::postMouseEvent(int, int, int, int, int, int) 
sw/source/uibase/uno/unotxdoc.cxx:3561

Change-Id: I93aea931dad1e7f43d3d610568424c53d2b22fbc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127898
Reviewed-by: Jan Holesovsky 
Tested-by: Jenkins CollaboraOffice 

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index d8766225fcbe..a8dc5b5bf3b7 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -673,7 +673,7 @@ namespace
 
 void LOKPostAsyncEvent(void* pEv, void*)
 {
-LOKAsyncEventData* pLOKEv = static_cast(pEv);
+std::unique_ptr 
pLOKEv(static_cast(pEv));
 if (pLOKEv->mpWindow->IsDisposed())
 return;
 
@@ -694,6 +694,9 @@ namespace
 if (!pFocusWindow)
 pFocusWindow = pLOKEv->mpWindow;
 
+if (pLOKEv->mpWindow->IsDisposed())
+return;
+
 switch (pLOKEv->mnEvent)
 {
 case VclEventId::WindowKeyInput:
@@ -702,11 +705,13 @@ namespace
 KeyEvent singlePress(pLOKEv->maKeyEvent.GetCharCode(),
  pLOKEv->maKeyEvent.GetKeyCode());
 for (sal_uInt16 i = 0; i <= nRepeat; ++i)
-pFocusWindow->KeyInput(singlePress);
+if (!pFocusWindow->IsDisposed())
+pFocusWindow->KeyInput(singlePress);
 break;
 }
 case VclEventId::WindowKeyUp:
-pFocusWindow->KeyUp(pLOKEv->maKeyEvent);
+if (!pFocusWindow->IsDisposed())
+pFocusWindow->KeyUp(pLOKEv->maKeyEvent);
 break;
 case VclEventId::WindowMouseButtonDown:
 pLOKEv->mpWindow->LogicMouseButtonDown(pLOKEv->maMouseEvent);
@@ -737,8 +742,6 @@ namespace
 assert(false);
 break;
 }
-
-delete pLOKEv;
 }
 
 void postEventAsync(LOKAsyncEventData *pEvent)
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 8b2e145d0aae..811371b2396f 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -338,9 +338,9 @@ void Window::EndTracking( TrackingEventFlags nFlags )
 
 bool Window::IsTracking() const
 {
-return (mpWindowImpl->mbUseFrameData ?
-mpWindowImpl->mpFrameData->mpTrackWin == this :
-ImplGetSVData()->mpWinData->mpTrackWin == this);
+return mpWindowImpl && (mpWindowImpl->mbUseFrameData ?
+mpWindowImpl->mpFrameData->mpTrackWin == this :
+ImplGetSVData()->mpWinData->mpTrackWin == this);
 }
 
 void Window::StartAutoScroll( StartAutoScrollFlags nFlags )


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-12-09 Thread Luboš Luňák (via logerrit)
 sfx2/source/notebookbar/SfxNotebookBar.cxx |8 
 1 file changed, 8 deletions(-)

New commits:
commit 1d641165a9f632708da33d7853f88d335315dbf3
Author: Luboš Luňák 
AuthorDate: Tue Dec 7 15:47:37 2021 +0100
Commit: Andras Timar 
CommitDate: Thu Dec 9 13:23:20 2021 +0100

do not unnecessarily lock XLayoutManager for menubar changes

The XLayoutManager documentation says that lock() prohibits layout
updates until unlock() is called, so it's not any kind of mutex
or anything, it just allows grouping updates. Which means it's
useless to put around a single call to change menubar visibility.
To make things worse, unlock() will always trigger a layout,
so even if nothing changes, it still does an unnecessary layout
update. And since this gets called from SfxLokHelper::setView(),
it may get called often and it's rather costly.

Change-Id: I3e3e37b6763b15d454e76b4bef0b22f84cf479d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126445
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx 
b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index dd6781ae66c3..e991ac9e6877 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -479,8 +479,6 @@ void SfxNotebookBar::ShowMenubar(bool bShow)
 
 if (xLayoutManager.is())
 {
-xLayoutManager->lock();
-
 if (xLayoutManager->getElement(MENUBAR_STR).is())
 {
 if (xLayoutManager->isElementVisible(MENUBAR_STR) && 
!bShow)
@@ -488,8 +486,6 @@ void SfxNotebookBar::ShowMenubar(bool bShow)
 else if(!xLayoutManager->isElementVisible(MENUBAR_STR) 
&& bShow)
 xLayoutManager->showElement(MENUBAR_STR);
 }
-
-xLayoutManager->unlock();
 }
 }
 }
@@ -512,8 +508,6 @@ void SfxNotebookBar::ShowMenubar(SfxViewFrame const * 
pViewFrame, bool bShow)
 const Reference& xLayoutManager = 
lcl_getLayoutManager(xFrame);
 if (xLayoutManager.is())
 {
-xLayoutManager->lock();
-
 if (xLayoutManager->getElement(MENUBAR_STR).is())
 {
 if (xLayoutManager->isElementVisible(MENUBAR_STR) && !bShow)
@@ -521,8 +515,6 @@ void SfxNotebookBar::ShowMenubar(SfxViewFrame const * 
pViewFrame, bool bShow)
 else if (!xLayoutManager->isElementVisible(MENUBAR_STR) && 
bShow)
 xLayoutManager->showElement(MENUBAR_STR);
 }
-
-xLayoutManager->unlock();
 }
 }
 m_bLock = false;


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-10-27 Thread Luboš Luňák (via logerrit)
 sfx2/source/view/viewsh.cxx |   36 +++-
 1 file changed, 11 insertions(+), 25 deletions(-)

New commits:
commit c0138475cdbd378832c69b3592c21c84f7eaa2c0
Author: Luboš Luňák 
AuthorDate: Tue Oct 26 12:41:34 2021 +0200
Commit: Luboš Luňák 
CommitDate: Wed Oct 27 08:23:16 2021 +0200

remove useless check from SfxViewShell::GetFirst()/GetNext()

This comes from https://bz.apache.org/ooo/show_bug.cgi?id=62084 ,
but it's unclear to me what the steps to reproduce actually mean.
If it's print preview, then I can't reproduce, and all tests work
fine too. This code is called very often from LOK code in a loop,
and this check makes it O(n^2), so remove it under the assumption
that the problem no longer exists, only keep an assert just in case.

Change-Id: I0e7ed03ef370aa32f2064c587b242e1ffaff73b2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124208
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Luboš Luňák 

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index fab9d5af2b13..325c9ffa71cc 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1332,24 +1332,20 @@ SfxViewShell* SfxViewShell::GetFirst
 {
 // search for a SfxViewShell of the specified type
 SfxViewShellArr_Impl  = SfxGetpApp()->GetViewShells_Impl();
-SfxViewFrameArr_Impl  = SfxGetpApp()->GetViewFrames_Impl();
 for (SfxViewShell* pShell : rShells)
 {
 if ( pShell )
 {
+// This code used to check that the frame exists in the other list,
+// because of https://bz.apache.org/ooo/show_bug.cgi?id=62084, 
with the explanation:
 // sometimes dangling SfxViewShells exist that point to a dead 
SfxViewFrame
 // these ViewShells shouldn't be accessible anymore
 // a destroyed ViewFrame is not in the ViewFrame array anymore, so 
checking this array helps
-for (SfxViewFrame* pFrame : rFrames)
-{
-if ( pFrame == pShell->GetViewFrame() )
-{
-// only ViewShells with a valid ViewFrame will be returned
-if ( ( !bOnlyVisible || pFrame->IsVisible() ) && 
(!isViewShell || isViewShell(pShell)))
-return pShell;
-break;
-}
-}
+// That doesn't seem to be needed anymore, but keep an assert, 
just in case.
+assert(std::find(SfxGetpApp()->GetViewFrames_Impl().begin(), 
SfxGetpApp()->GetViewFrames_Impl().end(),
+pShell->GetViewFrame()) != 
SfxGetpApp()->GetViewFrames_Impl().end());
+if ( ( !bOnlyVisible || pShell->GetViewFrame()->IsVisible() ) && 
(!isViewShell || isViewShell(pShell)))
+return pShell;
 }
 }
 
@@ -1367,7 +1363,6 @@ SfxViewShell* SfxViewShell::GetNext
 )
 {
 SfxViewShellArr_Impl  = SfxGetpApp()->GetViewShells_Impl();
-SfxViewFrameArr_Impl  = SfxGetpApp()->GetViewFrames_Impl();
 size_t nPos;
 for ( nPos = 0; nPos < rShells.size(); ++nPos )
 if ( rShells[nPos] ==  )
@@ -1378,19 +1373,10 @@ SfxViewShell* SfxViewShell::GetNext
 SfxViewShell *pShell = rShells[nPos];
 if ( pShell )
 {
-// sometimes dangling SfxViewShells exist that point to a dead 
SfxViewFrame
-// these ViewShells shouldn't be accessible anymore
-// a destroyed ViewFrame is not in the ViewFrame array anymore, so 
checking this array helps
-for (SfxViewFrame* pFrame : rFrames)
-{
-if ( pFrame == pShell->GetViewFrame() )
-{
-// only ViewShells with a valid ViewFrame will be returned
-if ( ( !bOnlyVisible || pFrame->IsVisible() ) && 
(!isViewShell || isViewShell(pShell)) )
-return pShell;
-break;
-}
-}
+assert(std::find(SfxGetpApp()->GetViewFrames_Impl().begin(), 
SfxGetpApp()->GetViewFrames_Impl().end(),
+pShell->GetViewFrame()) != 
SfxGetpApp()->GetViewFrames_Impl().end());
+if ( ( !bOnlyVisible || pShell->GetViewFrame()->IsVisible() ) && 
(!isViewShell || isViewShell(pShell)) )
+return pShell;
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-10-12 Thread Luboš Luňák (via logerrit)
 sfx2/source/appl/workwin.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 7a3d26a5fc2537546b448eff5d797274225fcc99
Author: Luboš Luňák 
AuthorDate: Tue Oct 5 15:11:43 2021 +0200
Commit: Luboš Luňák 
CommitDate: Tue Oct 12 16:57:42 2021 +0200

avoid repeated calls to SfxNotebookBar::IsActive()

The call reads configuration, and so is a bit expensive when
called in a loop.

Change-Id: I62398bcfdc856f02f6e2d928bac2f144bc47424d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123103
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
(cherry picked from commit e304383b88d271b0e140946af201099c8314dd0a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123410
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Luboš Luňák 

diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx
index 217ae75436bf..a466a01ea041 100644
--- a/sfx2/source/appl/workwin.cxx
+++ b/sfx2/source/appl/workwin.cxx
@@ -1198,6 +1198,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl2()
 
 // Iterate over all Toolboxes
 xLayoutManager->lock();
+const bool isNotebookBarActive = sfx2::SfxNotebookBar::IsActive();
 for ( auto const & n: aObjBarList )
 {
 ToolbarId eId = n.eId;
@@ -1211,7 +1212,7 @@ void SfxWorkWindow::UpdateObjectBars_Impl2()
 
 // Is a ToolBox required in this context ?
 bool bModesMatching = (nUpdateMode != SfxVisibilityFlags::Invisible) 
&& ((nTbxMode & nUpdateMode) == nUpdateMode);
-if ( bDestroy || sfx2::SfxNotebookBar::IsActive())
+if ( bDestroy || isNotebookBarActive)
 {
 OUString aTbxId = g_aTbxTypeName + 
GetResourceURLFromToolbarId(eId);
 xLayoutManager->destroyElement( aTbxId );


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-08-06 Thread Mert Tumer (via logerrit)
 sfx2/source/sidebar/SidebarController.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit b606764ce2a042f2a38c98820d7236661149d20c
Author: Mert Tumer 
AuthorDate: Fri Aug 6 12:42:16 2021 +0300
Commit: Michael Meeks 
CommitDate: Fri Aug 6 15:26:03 2021 +0200

lok: Avoid redundant call to UpdateConfigurations

We call doc_setView each time we send an event to LOK such as keystroke
and SidebarController::notifyContextChange event is triggered after that
UpdateConfigurations() call causes layout reallocating for whole sidebar
and we end up keep doing it. It takes significant amount of cpu time for
lok case for no reason.

Signed-off-by: Mert Tumer 
Change-Id: I8f456156af841fdeaba1934498863a07a7d4554e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120112
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Michael Meeks 

diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 266a69f5dcbe..db4f9679e34a 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -333,7 +333,8 @@ void SAL_CALL SidebarController::notifyContextChangeEvent 
(const css::ui::Contex
  // calling with held
  // solarmutex
 // TODO: this call is redundant but mandatory for unit test to update 
context on document loading
-UpdateConfigurations();
+if (!comphelper::LibreOfficeKit::isActive())
+UpdateConfigurations();
 }
 }
 


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-07-19 Thread Szymon Kłos (via logerrit)
 sfx2/source/notebookbar/SfxNotebookBar.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 303c8bd00283dbaf3ca172d0245b9f9bf7bfafaa
Author: Szymon Kłos 
AuthorDate: Mon Jul 12 12:24:09 2021 +0200
Commit: Szymon Kłos 
CommitDate: Mon Jul 19 09:00:44 2021 +0200

Revert "Notebookbar: skip early init in all apps"

This reverts commit 6af0a488a059982a8b5d72fe399c7e8841a2e9b4.

Delayed notebookbar init in Calc causes "number format" combobox
to not work. (it works after some number is typed into document only).
Original problem fixed by reverted change doesn't exist anymore
because new shortcuts for paste special and paste unformatted text were
introduced

Change-Id: Ie112ae0df7b6d3782916b98c96f1a17b15396115
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118771
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pranam Lashkari 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119100
Reviewed-by: Szymon Kłos 

diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx 
b/sfx2/source/notebookbar/SfxNotebookBar.cxx
index 6fe050e5d4b5..dd6781ae66c3 100644
--- a/sfx2/source/notebookbar/SfxNotebookBar.cxx
+++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx
@@ -365,7 +365,8 @@ bool SfxNotebookBar::StateMethod(SystemWindow* pSysWindow,
 //   * in LOK: Paste Special feature was incorrectly initialized
 // Skip first request so Notebookbar will be initialized after 
document was loaded
 static std::map bSkippedFirstInit;
-if (comphelper::LibreOfficeKit::isActive() && 
bSkippedFirstInit.find(pViewShell) == bSkippedFirstInit.end())
+if (comphelper::LibreOfficeKit::isActive() && eApp == 
vcl::EnumContext::Application::Writer
+&& bSkippedFirstInit.find(pViewShell) == 
bSkippedFirstInit.end())
 {
 bSkippedFirstInit[pViewShell] = true;
 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/co-2021' - sfx2/source

2021-07-09 Thread Szymon Kłos (via logerrit)
 sfx2/source/control/unoctitm.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 5229bfbc73f9051f59d50502921709006a14d7ea
Author: Szymon Kłos 
AuthorDate: Fri Jul 9 17:33:31 2021 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 9 17:55:11 2021 +0200

jsdialog: send GlowColor state updates

Change-Id: I27e14610d7df231f05bd27ad3ce121361e198c2d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118693
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index f8039ca9d4b7..256ed9f744b3 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -1071,7 +1071,8 @@ static void InterceptLOKStateChangeEvent(sal_uInt16 nSID, 
SfxViewFrame* pViewFra
  aEvent.FeatureURL.Path == "CharBackColor" ||
  aEvent.FeatureURL.Path == "Color" ||
  aEvent.FeatureURL.Path == "FontColor" ||
- aEvent.FeatureURL.Path == "FrameLineColor")
+ aEvent.FeatureURL.Path == "FrameLineColor" ||
+ aEvent.FeatureURL.Path == "GlowColor")
 {
 sal_Int32 nColor = -1;
 aEvent.State >>= nColor;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-07-08 Thread Miklos Vajna (via logerrit)
 sfx2/source/view/viewsh.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit d6811bd47a255d40aeb4509c7011fa7d9e75e3f3
Author: Miklos Vajna 
AuthorDate: Thu Jul 8 11:49:13 2021 +0200
Commit: Pranam Lashkari 
CommitDate: Thu Jul 8 13:29:37 2021 +0200

sfx2: fix uninitialized SfxViewShell::mbLOKIsFreemiumView

Introduced in commit 1b9fe58acb7b5bbbc83ecca30e17663fff7f0db4 (LOK:
introduced Freemium LOK API, 2021-06-02).

Change-Id: Ifdd6c13a64a167fa00b0305441c52340167f3809
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118632
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Pranam Lashkari 

diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 2da4bc1e81bd..1119af3dc23d 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1076,6 +1076,7 @@ SfxViewShell::SfxViewShell
 ,   maLOKLanguageTag(LANGUAGE_NONE)
 ,   maLOKLocale(LANGUAGE_NONE)
 ,   maLOKDeviceFormFactor(LOKDeviceFormFactor::UNKNOWN)
+,   mbLOKIsFreemiumView(false)
 {
 SetMargin( pViewFrame->GetMargin_Impl() );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-07-06 Thread Szymon Kłos (via logerrit)
 sfx2/source/sidebar/SidebarController.cxx |   26 ++
 1 file changed, 26 insertions(+)

New commits:
commit 74e69e555cc2b93df6b2be166aa1c70a99afa177
Author: Szymon Kłos 
AuthorDate: Tue Jul 6 14:15:17 2021 +0200
Commit: Szymon Kłos 
CommitDate: Tue Jul 6 14:50:59 2021 +0200

jsdialog: sidebar: send message on sidebar close

Revert needed code removed in 64bd4dd

Change-Id: If45facbd68ea8f3af433b78e127fbb0745e62c25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118483
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sfx2/source/sidebar/SidebarController.cxx 
b/sfx2/source/sidebar/SidebarController.cxx
index 0f46d910d2cc..64dbe4343b14 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -44,6 +44,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -1209,6 +1210,31 @@ IMPL_LINK(SidebarController, OnSubMenuItemSelected, 
const OString&, rCurItemId,
 
 void SidebarController::RequestCloseDeck()
 {
+if (comphelper::LibreOfficeKit::isActive() && mpCurrentDeck)
+{
+const SfxViewShell* pViewShell = SfxViewShell::Current();
+if (pViewShell && pViewShell->isLOKMobilePhone())
+{
+// Mobile phone - TODO: unify with desktop
+tools::JsonWriter aJsonWriter;
+aJsonWriter.put("id", mpParentWindow->get_id());
+aJsonWriter.put("type", "dockingwindow");
+aJsonWriter.put("text", mpParentWindow->GetText());
+aJsonWriter.put("enabled", false);
+const std::string message = aJsonWriter.extractAsStdString();
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, 
message.c_str());
+}
+else if (pViewShell)
+{
+tools::JsonWriter aJsonWriter;
+aJsonWriter.put("id", mpParentWindow->get_id());
+aJsonWriter.put("action", "close");
+aJsonWriter.put("jsontype", "sidebar");
+const std::string message = aJsonWriter.extractAsStdString();
+pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_JSDIALOG, 
message.c_str());
+}
+}
+
 mbIsDeckRequestedOpen = false;
 UpdateDeckOpenState();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-07-02 Thread Szymon Kłos (via logerrit)
 sfx2/source/sidebar/Deck.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ab1220d2a8ff35a8be595250542cf13efdc7e1c4
Author: Szymon Kłos 
AuthorDate: Fri Jul 2 09:15:49 2021 +0200
Commit: Szymon Kłos 
CommitDate: Fri Jul 2 09:48:19 2021 +0200

jsdialog: sidebar: dump expanded state for panel

Change-Id: Iffd4570a512d20229c20c0c7bbb113eaf456bcba
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118250
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 35203a18c4cd..9b266acb4e9b 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -157,6 +157,7 @@ void Deck::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 rJsonWriter.put("text", it->GetTitle());
 rJsonWriter.put("enabled", true);
 rJsonWriter.put("hidden", it->IsLurking());
+rJsonWriter.put("expanded", it->IsExpanded());
 
 {
 auto children2Node = rJsonWriter.startArray("children");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-06-13 Thread Szymon Kłos (via logerrit)
 sfx2/source/sidebar/SidebarDockingWindow.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d68dff90d5f94489bb8405eadfb90bfbb4783a4d
Author: Szymon Kłos 
AuthorDate: Sun Jun 13 11:58:31 2021 +0200
Commit: Szymon Kłos 
CommitDate: Sun Jun 13 14:13:39 2021 +0200

Fix warning abo: unused pNotifier in SidebarDockingWindow

Change-Id: Ic3880cfbebe67a4e8256dc868eeb176617333a31
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117094
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sfx2/source/sidebar/SidebarDockingWindow.cxx 
b/sfx2/source/sidebar/SidebarDockingWindow.cxx
index c40cc06a952b..f536165255d8 100644
--- a/sfx2/source/sidebar/SidebarDockingWindow.cxx
+++ b/sfx2/source/sidebar/SidebarDockingWindow.cxx
@@ -81,7 +81,7 @@ void SidebarDockingWindow::dispose()
 void SidebarDockingWindow::LOKClose()
 {
 assert(comphelper::LibreOfficeKit::isActive());
-if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
+if (GetLOKNotifier())
 ReleaseLOKNotifier();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-04-29 Thread Szymon Kłos (via logerrit)
 sfx2/source/sidebar/Deck.cxx |9 +++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 46b7d1d707b47e03163c5bcbbaa54ca49980f64a
Author: Szymon Kłos 
AuthorDate: Wed Dec 30 15:04:05 2020 +0100
Commit: Szymon Kłos 
CommitDate: Thu Apr 29 09:53:47 2021 +0200

Fix json structure for decks

Change-Id: I7f203c29a03af917f50192946ee794f6e01b16e0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109029
Tested-by: Jenkins
Reviewed-by: Szymon Kłos 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114803
Tested-by: Jenkins CollaboraOffice 

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index e20ef9be1794..f8bb54a8ef73 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -220,8 +220,13 @@ void Deck::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 rJsonWriter.put("text", it->GetText());
 rJsonWriter.put("enabled", it->IsEnabled());
 
-auto children2Node = rJsonWriter.startArray("children");
-pWindow->DumpAsPropertyTree(rJsonWriter);
+{
+auto children2Node = rJsonWriter.startArray("children");
+{
+auto child2Node = rJsonWriter.startStruct();
+pWindow->DumpAsPropertyTree(rJsonWriter);
+}
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-04-29 Thread Henry Castro (via logerrit)
 sfx2/source/sidebar/Deck.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 4fde580fc3d30723220a90853eea5c564bc825a5
Author: Henry Castro 
AuthorDate: Tue Dec 8 09:06:45 2020 -0400
Commit: Szymon Kłos 
CommitDate: Thu Apr 29 09:53:02 2021 +0200

lok: fix "children" node type

In order to build the dialog on the client side,
the "children" object should be constructed with array type.

Change-Id: Iccde39aa9ff2f423fd4a67072ca0bf25e406d220
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107413
Tested-by: Jenkins
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114802
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Szymon Kłos 

diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx
index 9c0c37041f58..e20ef9be1794 100644
--- a/sfx2/source/sidebar/Deck.cxx
+++ b/sfx2/source/sidebar/Deck.cxx
@@ -200,7 +200,7 @@ void Deck::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 rJsonWriter.put("text", GetText());
 rJsonWriter.put("enabled", IsEnabled());
 
-auto childrenNode = rJsonWriter.startNode("children");
+auto childrenNode = rJsonWriter.startArray("children");
 for (auto  : maPanels)
 {
 if (it->IsLurking())
@@ -214,13 +214,13 @@ void Deck::DumpAsPropertyTree(tools::JsonWriter& 
rJsonWriter)
 if (!pWindow)
 continue;
 
-auto childNode = rJsonWriter.startNode("");
+auto childNode = rJsonWriter.startStruct();
 rJsonWriter.put("id", it->GetId());
 rJsonWriter.put("type", "panel");
 rJsonWriter.put("text", it->GetText());
 rJsonWriter.put("enabled", it->IsEnabled());
 
-auto children2Node = rJsonWriter.startNode("children");
+auto children2Node = rJsonWriter.startArray("children");
 pWindow->DumpAsPropertyTree(rJsonWriter);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - sfx2/source

2021-04-21 Thread Tor Lillqvist (via logerrit)
 sfx2/source/doc/docfile.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit a73011dfce4790d7648836b31ec7ec60b63fc7eb
Author: Tor Lillqvist 
AuthorDate: Tue Apr 20 10:07:19 2021 +0300
Commit: Tor Lillqvist 
CommitDate: Wed Apr 21 13:02:34 2021 +0200

Avoid unused parameter warning in the HAVE_FEATURE_MACOSX_SANDBOX case

Change-Id: I7cc2f8f373440ca79694220818558ee092c895a9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114317
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114390
Tested-by: Tor Lillqvist 

diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 631c06bd0713..c4751dc52be9 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -3628,6 +3628,7 @@ OUString GetLogicBase(const INetURLObject& rURL, 
std::unique_ptr
 // In a sandboxed environment we don't want to attempt to create temporary 
files in the same
 // directory where the user has selected an output file to be stored. The 
sandboxed process has
 // permission only to create the specifically named output file in that 
directory.
+(void) rURL;
 (void) pImpl;
 #else
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits