[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - desktop/source

2019-01-11 Thread Libreoffice Gerrit user
 desktop/source/app/officeipcthread.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 5467821e44bc31eeff617580e7c6d6649fdb9bed
Author: Noel Grandin 
AuthorDate: Sat Sep 8 09:26:12 2018 +0200
Commit: Noel Grandin 
CommitDate: Fri Jan 11 20:42:21 2019 +0100

clang-tidy bugprone-unused-raii in RequestHandler

The message from clang-tidy is:
warning: object destroyed immediately after creation; did you mean
to name the object?

The guard in
RequestHandler::ExecuteCmdLineRequests
comes from
commit cf333a878ceed18d0343520a2c65be69fc433b1f
Date:   Sun Jan 21 22:10:09 2018 +0300
tdf#38915: set cProcessed condition on any process outcome
and I'm sure it's intention was to set the flag on exit from the
function, not immediately.

Reviewed-on: https://gerrit.libreoffice.org/60183
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins
(cherry picked from commit 867ee21fe4c0c9216aea57850efec4de3c3fc554)

Change-Id: Ibf874a5774770df00b9db7f673554e7ffda55072
Reviewed-on: https://gerrit.libreoffice.org/66168
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/desktop/source/app/officeipcthread.cxx 
b/desktop/source/app/officeipcthread.cxx
index a0fabc9bdaf6..2e5596c259ff 100644
--- a/desktop/source/app/officeipcthread.cxx
+++ b/desktop/source/app/officeipcthread.cxx
@@ -1319,7 +1319,7 @@ bool RequestHandler::ExecuteCmdLineRequests(
 osl::ClearableMutexGuard aGuard( GetMutex() );
 
 // ensure that Processed flag (if exists) is signaled in any outcome
-ConditionSetGuard(aRequest.pcProcessed);
+ConditionSetGuard aSetGuard(aRequest.pcProcessed);
 
 static std::vector aDispatchList;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - desktop/source filter/source include/sfx2 include/vcl sfx2/source vcl/source

2019-01-11 Thread Libreoffice Gerrit user
 desktop/source/deployment/gui/dp_gui_dialog2.cxx |   29 -
 desktop/source/deployment/gui/dp_gui_dialog2.hxx |   13 +++---
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx |   26 
 filter/source/xsltdialog/xmlfiltersettingsdialog.hxx |6 +-
 include/sfx2/sfxhelp.hxx |2 
 include/vcl/waitobj.hxx  |   15 +++
 sfx2/source/appl/sfxhelp.cxx |   40 ---
 vcl/source/window/dialog.cxx |   25 +++
 8 files changed, 61 insertions(+), 95 deletions(-)

New commits:
commit 71fad56863301f47f19fdd47ab93099ad098474e
Author: Caolán McNamara 
AuthorDate: Thu Jan 10 10:44:31 2019 +
Commit: Caolán McNamara 
CommitDate: Fri Jan 11 14:09:25 2019 +0100

Resolves: tdf#122404 unlock just the toplevels that were locked

push what toplevels got locked to just unlock those ones. otherwise the just
dismissed toplevel may still be present in the Application toplevel list.

merge all the similar examples of this.

Change-Id: I77c0d55d1e4b3bcc3b8d88fef00ba289edd1e831
Reviewed-on: https://gerrit.libreoffice.org/66080
Tested-by: Jenkins
Tested-by: Xisco Faulí 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx 
b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index fc0f955f2afd..4fa481a6272b 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -339,7 +339,6 @@ DialogHelper::DialogHelper(const uno::Reference< 
uno::XComponentContext > 
Dialog *pWindow)
 : m_xVCLWindow(pWindow)
 , m_nEventID(nullptr)
-, m_nBusy(0)
 {
 m_xContext = xContext;
 }
@@ -461,34 +460,6 @@ void DialogHelper::PostUserEvent( const Link& 
rLink, void* pCaller )
 m_nEventID = Application::PostUserEvent( rLink, pCaller, 
true/*bReferenceLink*/ );
 }
 
-void DialogHelper::incBusy()
-{
-++m_nBusy;
-// lock any toplevel windows from being closed until busy is over
-// ensure any dialogs are reset before entering
-vcl::Window *xTopWin = Application::GetFirstTopLevelWindow();
-while (xTopWin)
-{
-if (xTopWin != m_xVCLWindow)
-xTopWin->IncModalCount();
-xTopWin = Application::GetNextTopLevelWindow(xTopWin);
-}
-}
-
-void DialogHelper::decBusy()
-{
---m_nBusy;
-// unlock any toplevel windows from being closed until busy is over
-// ensure any dialogs are reset before entering
-vcl::Window *xTopWin = Application::GetFirstTopLevelWindow();
-while (xTopWin)
-{
-if (xTopWin != m_xVCLWindow)
-xTopWin->DecModalCount();
-xTopWin = Application::GetNextTopLevelWindow(xTopWin);
-}
-}
-
 // ExtMgrDialog
 ExtMgrDialog::ExtMgrDialog(vcl::Window *pParent, TheExtensionManager 
*pManager, Dialog::InitFlag eFlag)
 : ModelessDialog(pParent, "ExtensionManagerDialog", 
"desktop/ui/extensionmanager.ui", eFlag)
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx 
b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index dd0dc8bb8160..a2d88c0f458e 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -29,6 +29,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -47,6 +48,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 namespace dp_gui {
 
 
@@ -60,7 +64,7 @@ class DialogHelper
 css::uno::Reference< css::uno::XComponentContext > m_xContext;
 VclPtr  m_xVCLWindow;
 ImplSVEvent *   m_nEventID;
-int m_nBusy;
+TopLevelWindowLocker m_aBusy;
 
 public:
 DialogHelper( const css::uno::Reference< 
css::uno::XComponentContext > &,
@@ -91,14 +95,13 @@ public:
const char* pResID,
bool  );
 
-voidincBusy();
-voiddecBusy();
-boolisBusy() const { return m_nBusy > 0; }
+voidincBusy() { m_aBusy.incBusy(m_xVCLWindow); }
+voiddecBusy() { m_aBusy.decBusy(); }
+boolisBusy() const { return m_aBusy.isBusy(); }
 boolinstallExtensionWarn(const OUString );
 boolinstallForAllUsers(bool );
 };
 
-
 class ExtMgrDialog : public ModelessDialog,
  public DialogHelper
 {
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx 
b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 3af2023f67c5..a62ab176 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -131,32 +131,6 @@ void XMLFilterSettingsDialog::dispose()
 ModelessDialog::dispose();
 }
 
-void XMLFilterSettingsDialog::incBusy()

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - desktop/source

2018-12-27 Thread Libreoffice Gerrit user
 desktop/source/deployment/gui/dp_gui_theextmgr.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit a93713359265a9a1403c744e467eb5faa09cc747
Author: Caolán McNamara 
AuthorDate: Sun Dec 23 20:05:14 2018 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Dec 28 07:36:47 2018 +0100

tdf#122269 don't prompt to restart if we're exiting the application anyway

Change-Id: I6272ae92b7e948680fb7241c387eb205adbbea01
Reviewed-on: https://gerrit.libreoffice.org/65596
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx 
b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index 94a8dd09df6c..f50687e11934 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -445,6 +445,7 @@ void TheExtensionManager::queryTermination( 
::lang::EventObject const & )
 }
 else
 {
+clearModified();
 if ( m_pExtMgrDialog )
 m_pExtMgrDialog->Close();
 if ( m_pUpdReqDialog )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - desktop/source

2018-11-29 Thread Libreoffice Gerrit user
 desktop/source/deployment/gui/dp_gui_dialog2.cxx |   84 ++-
 desktop/source/deployment/gui/dp_gui_dialog2.hxx |   23 +++---
 2 files changed, 78 insertions(+), 29 deletions(-)

New commits:
commit d559d7085f8c160c9946ef3eb49250aa12358968
Author: Caolán McNamara 
AuthorDate: Wed Nov 28 11:12:55 2018 +
Commit: Xisco Faulí 
CommitDate: Thu Nov 29 16:47:09 2018 +0100

Resolves: tdf#121746 block toplevels from closing...

while the extension manager is querying via a dialog. Reuse
the isBusy for this.

Change-Id: I97572404ae296e87fd44711bf1e978bd5bad6280
Reviewed-on: https://gerrit.libreoffice.org/64162
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx 
b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 9330789548e4..fc0f955f2afd 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -335,16 +335,15 @@ void ExtBoxWithBtns_Impl::enableButtons( bool bEnable )
 
 // DialogHelper
 
-DialogHelper::DialogHelper( const uno::Reference< uno::XComponentContext > 
,
-Dialog *pWindow ) :
-m_pVCLWindow( pWindow ),
-m_nEventID(   nullptr ),
-m_bIsBusy(false )
+DialogHelper::DialogHelper(const uno::Reference< uno::XComponentContext > 
,
+   Dialog *pWindow)
+: m_xVCLWindow(pWindow)
+, m_nEventID(nullptr)
+, m_nBusy(0)
 {
 m_xContext = xContext;
 }
 
-
 DialogHelper::~DialogHelper()
 {
 if ( m_nEventID )
@@ -365,17 +364,21 @@ bool DialogHelper::continueOnSharedExtension( const 
uno::Reference< deployment::
 if ( !bHadWarning && IsSharedPkgMgr( xPackage ) )
 {
 const SolarMutexGuard guard;
+incBusy();
 std::unique_ptr 
xBox(Application::CreateMessageDialog(pParent,
   VclMessageType::Warning, 
VclButtonsType::OkCancel, DpResId(pResID)));
 bHadWarning = true;
 
-return RET_OK == xBox->run();
+bool bRet = RET_OK == xBox->run();
+xBox.reset();
+decBusy();
+return bRet;
 }
 else
 return true;
 }
 
-void DialogHelper::openWebBrowser( const OUString & sURL, const OUString 
 ) const
+void DialogHelper::openWebBrowser(const OUString& sURL, const OUString& sTitle)
 {
 if ( sURL.isEmpty() ) // Nothing to do, when the URL is empty
 return;
@@ -392,29 +395,35 @@ void DialogHelper::openWebBrowser( const OUString & sURL, 
const OUString 
 uno::Any exc( ::cppu::getCaughtException() );
 OUString msg( ::comphelper::anyToString( exc ) );
 const SolarMutexGuard guard;
+incBusy();
 std::unique_ptr 
xErrorBox(Application::CreateMessageDialog(getFrameWeld(),

VclMessageType::Warning, VclButtonsType::Ok, msg));
 xErrorBox->set_title(sTitle);
 xErrorBox->run();
+xErrorBox.reset();
+decBusy();
 }
 }
 
-
-bool DialogHelper::installExtensionWarn( const OUString  ) const
+bool DialogHelper::installExtensionWarn(const OUString )
 {
 const SolarMutexGuard guard;
 
 // Check if extension installation is disabled in the expert configurations
 if 
(officecfg::Office::ExtensionManager::ExtensionSecurity::DisableExtensionInstallation::get())
 {
+incBusy();
 std::unique_ptr 
xWarnBox(Application::CreateMessageDialog(getFrameWeld(),
   VclMessageType::Warning, 
VclButtonsType::Ok,
   
DpResId(RID_STR_WARNING_INSTALL_EXTENSION_DISABLED)));
 xWarnBox->run();
+xWarnBox.reset();
+decBusy();
 
 return false;
 }
 
+incBusy();
 std::unique_ptr 
xInfoBox(Application::CreateMessageDialog(getFrameWeld(),
   VclMessageType::Warning, 
VclButtonsType::OkCancel,
   
DpResId(RID_STR_WARNING_INSTALL_EXTENSION)));
@@ -422,15 +431,21 @@ bool DialogHelper::installExtensionWarn( const OUString 
 ) const
 sText = sText.replaceAll("%NAME", rExtensionName);
 xInfoBox->set_primary_text(sText);
 
-return (RET_OK == xInfoBox->run());
+bool bRet = RET_OK == xInfoBox->run();
+xInfoBox.reset();
+decBusy();
+return bRet;
 }
 
-bool DialogHelper::installForAllUsers( bool  ) const
+bool DialogHelper::installForAllUsers(bool )
 {
 const SolarMutexGuard guard;
+incBusy();
 std::unique_ptr 
xBuilder(Application::CreateBuilder(getFrameWeld(), 
"desktop/ui/installforalldialog.ui"));
 std::unique_ptr 
xQuery(xBuilder->weld_message_dialog("InstallForAllDialog"));
 short nRet = xQuery->run();
+xQuery.reset();
+decBusy();
 if (nRet == RET_CANCEL)
 return false;
 
@@ -446,6 

[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - desktop/source

2018-08-14 Thread Libreoffice Gerrit user
 desktop/source/app/cmdlineargs.cxx |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit 0bf6e4fdfdb109dcfd75ddd9ced0c04b2ac987a9
Author: Mike Kaganski 
AuthorDate: Fri Aug 10 11:50:52 2018 +0300
Commit: Christian Lohmaier 
CommitDate: Tue Aug 14 14:05:54 2018 +0200

tdf#119194: save deprecated argument early

Change-Id: I4b5001e1f71ac536ac0c3bda4b8c1955020ab40d
Reviewed-on: https://gerrit.libreoffice.org/58815
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 5ccf82642b19728e1cfe8fa11f654e90712c5757)
Reviewed-on: https://gerrit.libreoffice.org/58819
Reviewed-by: Christian Lohmaier 

diff --git a/desktop/source/app/cmdlineargs.cxx 
b/desktop/source/app/cmdlineargs.cxx
index e67f204866e9..490bf183de33 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -287,9 +287,12 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& 
supplier )
 {
 m_bEmpty = false;
 OUString oArg;
-bool bDeprecated = !aArg.startsWith("--", )
-&& aArg.startsWith("-", ) && aArg.getLength() > 2;
-// -h, -?, -n, -o, -p are still valid
+OUString oDeprecatedArg;
+if (!aArg.startsWith("--", ) && aArg.startsWith("-", )
+&& aArg.getLength() > 2) // -h, -?, -n, -o, -p are still valid
+{
+oDeprecatedArg = aArg; // save here, since aArg can change 
later
+}
 
 OUString rest;
 if ( oArg == "minimized" )
@@ -423,7 +426,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& 
supplier )
 */
 else if ( aArg.startsWith("-psn") )
 {
-bDeprecated = false;
+oDeprecatedArg.clear();
 }
 #endif
 #if HAVE_FEATURE_MACOSX_SANDBOX
@@ -439,7 +442,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& 
supplier )
 */
 else if ( oArg == "Embedding" )
 {
-bDeprecated = false;
+oDeprecatedArg.clear();
 }
 #endif
 else if ( oArg.startsWith("infilter=", ))
@@ -622,7 +625,7 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& 
supplier )
 {
 m_unknown = aArg;
 }
-bDeprecated = false;
+oDeprecatedArg.clear();
 }
 else
 {
@@ -673,9 +676,9 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& 
supplier )
 }
 }
 
-if (bDeprecated)
+if (!oDeprecatedArg.isEmpty())
 {
-OString sArg(OUStringToOString(aArg, 
osl_getThreadTextEncoding()));
+OString sArg(OUStringToOString(oDeprecatedArg, 
osl_getThreadTextEncoding()));
 fprintf(stderr, "Warning: %s is deprecated.  Use -%s 
instead.\n", sArg.getStr(), sArg.getStr());
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - desktop/source

2018-08-11 Thread Libreoffice Gerrit user
 desktop/source/app/app.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8a24b1ebaba46edb99a96bb558317cebe8946dfb
Author: Tor Lillqvist 
AuthorDate: Sat Aug 11 10:41:42 2018 +0300
Commit: Caolán McNamara 
CommitDate: Sat Aug 11 17:46:06 2018 +0200

Fix fallout from 6a4c464b49dbfa2801818ead1b50bc9580824d00

Change-Id: I72e4008a0aacf7e35006be685462168874954631
Reviewed-on: https://gerrit.libreoffice.org/58872
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index cb67abaa8fd9..c83d424f8a30 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1054,7 +1054,7 @@ void restartOnMac(bool passArguments) {
 
 std::unique_ptr 
xRestartBox(Application::CreateMessageDialog(nullptr,
  VclMessageType::Warning, 
VclButtonsType::Ok, aMessage));
-xRestartBox->Execute();
+xRestartBox->run();
 #else
 OUString execUrl;
 OSL_VERIFY(osl_getExecutableFile() == osl_Process_E_None);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits