[Libreoffice-commits] core.git: 2 commits - codemaker/source include/codemaker unodevtools/source unoidl/source

Stephan Bergmann sbergman at redhat.com
Mon Sep 16 04:30:15 PDT 2013


 codemaker/source/codemaker/typemanager.cxx         |    8 +-----
 codemaker/source/cppumaker/cppumaker.cxx           |    6 +----
 codemaker/source/cppumaker/cppuoptions.cxx         |   25 +--------------------
 codemaker/source/javamaker/javamaker.cxx           |    4 +--
 include/codemaker/typemanager.hxx                  |    2 -
 unodevtools/source/skeletonmaker/skeletonmaker.cxx |    2 -
 unoidl/source/unoidl.cxx                           |   12 ++++++++++
 7 files changed, 22 insertions(+), 37 deletions(-)

New commits:
commit a80fb45fe4a260aea0876de86237e53b954fab20
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Sep 13 15:26:58 2013 +0200

    Revert "WIP: add cppumaker -U to directly read from .idl files"
    
    This reverts commit c4113906d7f15f8aa0eb385a4caf474b3505ede1, which is not
    necessary after all with recent "Hook SourceProvider into unoidl::loadProvider."

diff --git a/codemaker/source/codemaker/typemanager.cxx b/codemaker/source/codemaker/typemanager.cxx
index 13da4d3..ff0e6f9 100644
--- a/codemaker/source/codemaker/typemanager.cxx
+++ b/codemaker/source/codemaker/typemanager.cxx
@@ -27,19 +27,15 @@
 #include "codemaker/typemanager.hxx"
 #include "rtl/ref.hxx"
 #include "rtl/ustring.hxx"
-#include "unoidl/sourceprovider.hxx"
 #include "unoidl/unoidl.hxx"
 
 TypeManager::TypeManager(): manager_(new unoidl::Manager) {}
 
 TypeManager::~TypeManager() {}
 
-void TypeManager::loadProvider(OUString const & uri, bool source, bool primary)
-{
+void TypeManager::loadProvider(OUString const & uri, bool primary) {
     rtl::Reference< unoidl::Provider > prov(
-        source
-        ? new unoidl::SourceProvider(manager_, uri)
-        : unoidl::loadProvider(manager_, uri));
+        unoidl::loadProvider(manager_, uri));
     manager_->addProvider(prov);
     if (primary) {
         primaryProviders_.push_back(prov);
diff --git a/codemaker/source/cppumaker/cppumaker.cxx b/codemaker/source/cppumaker/cppumaker.cxx
index 733eb85..2a698f4 100644
--- a/codemaker/source/cppumaker/cppumaker.cxx
+++ b/codemaker/source/cppumaker/cppumaker.cxx
@@ -52,15 +52,13 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
                  options.getExtraInputFiles().begin());
              i != options.getExtraInputFiles().end(); ++i)
         {
-            typeMgr->loadProvider(
-                convertToFileUrl(*i), options.isValid("-U"), false);
+            typeMgr->loadProvider(convertToFileUrl(*i), false);
         }
         for (std::vector< OString >::const_iterator i(
                  options.getInputFiles().begin());
              i != options.getInputFiles().end(); ++i)
         {
-            typeMgr->loadProvider(
-                convertToFileUrl(*i), options.isValid("-U"), true);
+            typeMgr->loadProvider(convertToFileUrl(*i), true);
         }
         codemaker::GeneratedTypeSet generated;
         if (options.isValid("-T")) {
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx
index 3643954..3e70b68 100644
--- a/codemaker/source/cppumaker/cppuoptions.cxx
+++ b/codemaker/source/cppumaker/cppuoptions.cxx
@@ -139,19 +139,6 @@ sal_Bool CppuOptions::initOptions(int ac, char* av[], sal_Bool bCmdFile)
                         m_options["-T"] = OString(s);
                     }
                     break;
-                case 'U':
-                    if (av[i][2] != '\0')
-                    {
-                        OString tmp("'-U', please check");
-                        if (i <= ac - 1)
-                        {
-                            tmp += " your input '" + OString(av[i]) + "'";
-                        }
-
-                        throw IllegalArgument(tmp);
-                    }
-                    m_options["-U"] = "";
-                    break;
                 case 'L':
                     if (av[i][2] != '\0')
                     {
@@ -334,17 +321,9 @@ OString CppuOptions::prepareHelp()
     help += "    -O<path>   = path describes the root directory for the generated output.\n";
     help += "                 The output directory tree is generated under this directory.\n";
     help += "    -T<name>   = name specifies a type or a list of types. The output for this\n";
-    help += "      [t1;...]   type and all dependent types are generated. If no '-T' option is\n";
-    help += "                 specified, then output for all types is generated.\n";
+    help += "      [t1;...]   type is generated. If no '-T' option is specified,\n";
+    help += "                 then output for all types is generated.\n";
     help += "                 Example: 'com.sun.star.uno.XInterface' is a valid type.\n";
-    help += "    -U         = instead of interpreting file_1 ... file_n as type rdb files,\n";
-    help += "                 interpret them as (directories of) UNOIDL source files.  If no\n";
-    help += "                 '-T' option is given, each file_i must denote a UNOIDL file, and\n";
-    help += "                 headers are generated for all entities defined in those files.";
-    help += "                 Otherwise, each file_i must denote a directory, and an entity\n";
-    help += "                 com.sun.star.uno.XInterface specified with '-T' would be searched\n";
-    help += "                 for as com/sun/star/uno/XInterface.idl under each of those\n";
-    help += "                 directories in turn.";
     help += "    -L         = UNO type functions are generated lightweight, that means only\n";
     help += "                 the name and typeclass are given and everything else is retrieved\n";
     help += "                 from the type library dynamically. The default is that UNO type\n";
diff --git a/codemaker/source/javamaker/javamaker.cxx b/codemaker/source/javamaker/javamaker.cxx
index 4f5730c..d74aafa 100644
--- a/codemaker/source/javamaker/javamaker.cxx
+++ b/codemaker/source/javamaker/javamaker.cxx
@@ -52,13 +52,13 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
                  options.getExtraInputFiles().begin());
              i != options.getExtraInputFiles().end(); ++i)
         {
-            typeMgr->loadProvider(convertToFileUrl(*i), false, false);
+            typeMgr->loadProvider(convertToFileUrl(*i), false);
         }
         for (std::vector< rtl::OString >::const_iterator i(
                  options.getInputFiles().begin());
              i != options.getInputFiles().end(); ++i)
         {
-            typeMgr->loadProvider(convertToFileUrl(*i), false, true);
+            typeMgr->loadProvider(convertToFileUrl(*i), true);
         }
         codemaker::GeneratedTypeSet generated;
         if (options.isValid("-T")) {
diff --git a/include/codemaker/typemanager.hxx b/include/codemaker/typemanager.hxx
index a268b11..fc6aba6 100644
--- a/include/codemaker/typemanager.hxx
+++ b/include/codemaker/typemanager.hxx
@@ -42,7 +42,7 @@ class TypeManager: public salhelper::SimpleReferenceObject {
 public:
     TypeManager();
 
-    void loadProvider(OUString const & uri, bool source, bool primary);
+    void loadProvider(OUString const & uri, bool primary);
 
     bool foundAtPrimaryProvider(OUString const & name) const;
 
diff --git a/unodevtools/source/skeletonmaker/skeletonmaker.cxx b/unodevtools/source/skeletonmaker/skeletonmaker.cxx
index f884f88..b2d5461 100644
--- a/unodevtools/source/skeletonmaker/skeletonmaker.cxx
+++ b/unodevtools/source/skeletonmaker/skeletonmaker.cxx
@@ -268,7 +268,7 @@ SAL_IMPLEMENT_MAIN()
     for (std::vector< OString >::const_iterator i(registries.begin());
          i != registries.end(); ++i)
     {
-        manager->loadProvider(convertToFileUrl(*i), false, true);
+        manager->loadProvider(convertToFileUrl(*i), true);
     }
 
     if ( options.dump ) {
commit 348a03f3e47b89609ca3843b52da129df15e68f8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Sep 13 15:25:45 2013 +0200

    Hook SourceProvider into unoidl::loadProvider
    
    Change-Id: I0a499fd98a1008ced0efdeec3b10bff30df57c0e

diff --git a/unoidl/source/unoidl.cxx b/unoidl/source/unoidl.cxx
index a9939e4..bdc7b98 100644
--- a/unoidl/source/unoidl.cxx
+++ b/unoidl/source/unoidl.cxx
@@ -12,10 +12,13 @@
 #include <set>
 #include <vector>
 
+#include "osl/file.h"
+#include "osl/file.hxx"
 #include "osl/mutex.hxx"
 #include "rtl/ref.hxx"
 #include "rtl/ustring.hxx"
 #include "unoidl/legacyprovider.hxx"
+#include "unoidl/sourceprovider.hxx"
 #include "unoidl/unoidl.hxx"
 #include "unoidl/unoidlprovider.hxx"
 
@@ -104,6 +107,15 @@ Provider::~Provider() throw () {}
 rtl::Reference< Provider > loadProvider(
     rtl::Reference< Manager > const & manager, OUString const & uri)
 {
+    osl::DirectoryItem item;
+    if (osl::DirectoryItem::get(uri, item) == osl::FileBase::E_None) {
+        osl::FileStatus status(osl_FileStatus_Mask_Type);
+        if (item.getFileStatus(status) == osl::FileBase::E_None
+            && status.getFileType() == osl::FileStatus::Directory)
+        {
+            return new SourceProvider(manager, uri);
+        }
+    }
     try {
         return new UnoidlProvider(uri);
     } catch (FileFormatException & e) {


More information about the Libreoffice-commits mailing list