[Libreoffice-commits] .: desktop/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Wed Jan 5 02:02:22 PST 2011


 desktop/source/pkgchk/unopkg/unopkg_app.cxx    |    2 +-
 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx |   21 ++++++++++++++++-----
 desktop/source/pkgchk/unopkg/unopkg_shared.h   |    3 ++-
 3 files changed, 19 insertions(+), 7 deletions(-)

New commits:
commit 886f83999b5077e5299f31886937959f78da0b8c
Author: Cédric Bosdonnat <cedricbosdo at openoffice.org>
Date:   Wed Jan 5 10:52:49 2011 +0100

    fdo#32840: make unopkg --suppress-license skip license in all cases

diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index e08b427..8143f03 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -412,7 +412,7 @@ extern "C" int unopkg_main()
 
         Reference< ::com::sun::star::ucb::XCommandEnvironment > xCmdEnv(
             createCmdEnv( xComponentContext, logFile,
-                          option_force, option_verbose) );
+                          option_force, option_verbose, option_suppressLicense) );
         
         //synchronize bundled/shared extensions
         //Do not synchronize when command is "reinstall". This could add types and services to UNO and
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 73c9de6..c6d26b1 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -86,6 +86,7 @@ class CommandEnvironmentImpl
     sal_Int32 m_logLevel;
     bool m_option_force_overwrite;
     bool m_option_verbose;
+    bool m_option_suppress_license;
     Reference< XComponentContext > m_xComponentContext;
     Reference< XProgressHandler > m_xLogFile;
 
@@ -99,7 +100,8 @@ public:
         Reference<XComponentContext> const & xComponentContext,
         OUString const & log_file,
         bool option_force_overwrite,
-        bool option_verbose);
+        bool option_verbose,
+        bool option_suppress_license);
     
     // XCommandEnvironment
     virtual Reference< task::XInteractionHandler > SAL_CALL
@@ -124,10 +126,12 @@ CommandEnvironmentImpl::CommandEnvironmentImpl(
     Reference<XComponentContext> const & xComponentContext,
     OUString const & log_file,
     bool option_force_overwrite,
-    bool option_verbose)
+    bool option_verbose,
+    bool option_suppressLicense)
     : m_logLevel(0),
       m_option_force_overwrite( option_force_overwrite ),
       m_option_verbose( option_verbose ),
+      m_option_suppress_license( option_suppressLicense ),
       m_xComponentContext(xComponentContext)
 {
     if (log_file.getLength() > 0) {
@@ -280,7 +284,13 @@ void CommandEnvironmentImpl::handle(
     }
     else if (request >>= licExc)
     {
-        printLicense(licExc.ExtensionName, licExc.Text, approve, abort);
+        if ( !m_option_suppress_license )
+            printLicense(licExc.ExtensionName, licExc.Text, approve, abort);
+        else
+        {
+            approve = true;
+            abort = false;
+        }
     }
        else if (request >>= instExc)
     {
@@ -425,10 +435,11 @@ Reference< XCommandEnvironment > createCmdEnv(
     Reference< XComponentContext > const & xContext,
     OUString const & logFile,
     bool option_force_overwrite,
-    bool option_verbose)
+    bool option_verbose,
+    bool option_suppress_license)
 {
     return new CommandEnvironmentImpl(
-        xContext, logFile, option_force_overwrite, option_verbose);
+        xContext, logFile, option_force_overwrite, option_verbose, option_suppress_license);
 }
 } // unopkg
 
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 58c9619..232fbf8 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -169,7 +169,8 @@ css::uno::Reference<css::ucb::XCommandEnvironment> createCmdEnv(
     css::uno::Reference<css::uno::XComponentContext> const & xContext,
     ::rtl::OUString const & logFile,
     bool option_force_overwrite,
-    bool option_verbose);
+    bool option_verbose,
+    bool option_suppressLicense);
 //==============================================================================
 void printf_packages(
     ::std::vector<


More information about the Libreoffice-commits mailing list