[Libreoffice-commits] online.git: loolwsd/Admin.hpp loolwsd/ChildProcessSession.cpp loolwsd/LOOLKit.cpp loolwsd/LOOLSession.cpp loolwsd/LOOLWSD.cpp loolwsd/MasterProcessSession.cpp loolwsd/TileCache.hpp

Tor Lillqvist tml at collabora.com
Mon Feb 22 09:38:34 UTC 2016


 loolwsd/Admin.hpp                |   24 +-----------------------
 loolwsd/ChildProcessSession.cpp  |    8 ++++----
 loolwsd/LOOLKit.cpp              |    8 +-------
 loolwsd/LOOLSession.cpp          |   26 --------------------------
 loolwsd/LOOLWSD.cpp              |    5 -----
 loolwsd/MasterProcessSession.cpp |    5 -----
 loolwsd/TileCache.hpp            |    2 --
 7 files changed, 6 insertions(+), 72 deletions(-)

New commits:
commit b4387a535a4f3b3abe91a567a8565a1258a12521
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Feb 22 11:22:14 2016 +0200

    Bin some superfluous using declarations and includes, and actually use others
    
    Sorry, could not resist. Obviously not very important.
    
    In retrospect, maybe it would have been better to have as policy to
    *not* use any 'using Poco::Foo'. Now there is an inconsistent mix of
    writing out the complete type and using a 'using'. Plus copy-pasted
    long lists of 'usings'. And of course, one should never have 'using'
    in an include file. Oh well.

diff --git a/loolwsd/Admin.hpp b/loolwsd/Admin.hpp
index f4ff11f..20ab8a9 100644
--- a/loolwsd/Admin.hpp
+++ b/loolwsd/Admin.hpp
@@ -21,8 +21,6 @@
 #include <Poco/Net/WebSocket.h>
 #include <Poco/Buffer.h>
 #include <Poco/Path.h>
-#include <Poco/Process.h>
-#include <Poco/Random.h>
 #include <Poco/StringTokenizer.h>
 #include <Poco/Types.h>
 #include <Poco/Net/HTTPServer.h>
@@ -39,8 +37,6 @@ using namespace LOOLProtocol;
 
 using Poco::Exception;
 using Poco::File;
-using Poco::IOException;
-using Poco::Net::HTTPClientSession;
 using Poco::Net::HTTPRequest;
 using Poco::Net::HTTPRequestHandler;
 using Poco::Net::HTTPRequestHandlerFactory;
@@ -50,30 +46,12 @@ using Poco::Net::HTTPServerParams;
 using Poco::Net::HTTPServerRequest;
 using Poco::Net::HTTPServerResponse;
 using Poco::Net::ServerSocket;
-using Poco::Net::SocketAddress;
 using Poco::Net::WebSocket;
 using Poco::Net::WebSocketException;
 using Poco::Path;
-using Poco::Process;
 using Poco::Runnable;
 using Poco::StringTokenizer;
-using Poco::Thread;
-using Poco::ThreadPool;
-using Poco::Util::Application;
-using Poco::Util::HelpFormatter;
-using Poco::Util::IncompatibleOptionsException;
-using Poco::Util::MissingOptionException;
-using Poco::Util::Option;
-using Poco::Util::OptionSet;
-using Poco::Util::ServerApplication;
-using Poco::Net::DialogSocket;
-using Poco::FastMutex;
 using Poco::Net::Socket;
-using Poco::ThreadLocal;
-using Poco::Random;
-using Poco::NamedMutex;
-using Poco::ProcessHandle;
-using Poco::URI;
 
 /// Handle admin requests.
 class AdminRequestHandler: public HTTPRequestHandler
@@ -224,7 +202,7 @@ public:
 };
 
 /// An admin command processor.
-class Admin : public Poco::Runnable
+class Admin : public Runnable
 {
 public:
     Admin(const int brokerPipe) :
diff --git a/loolwsd/ChildProcessSession.cpp b/loolwsd/ChildProcessSession.cpp
index d503695..bef7a1a 100644
--- a/loolwsd/ChildProcessSession.cpp
+++ b/loolwsd/ChildProcessSession.cpp
@@ -235,9 +235,9 @@ public:
             break;
         case LOK_CALLBACK_ERROR:
             {
-                Poco::JSON::Parser parser;
+                Parser parser;
                 Poco::Dynamic::Var var = parser.parse(rPayload);
-                Poco::JSON::Object::Ptr object = var.extract<Poco::JSON::Object::Ptr>();
+                Object::Ptr object = var.extract<Object::Ptr>();
 
                 _session.sendTextFrame("error: cmd=" + object->get("cmd").toString() +
                         " kind=" + object->get("kind").toString() + " code=" + object->get("code").toString());
@@ -583,9 +583,9 @@ bool ChildProcessSession::loadDocument(const char * /*buffer*/, int /*length*/,
     std::string renderingOptions;
     if (!_docOptions.empty())
     {
-        Poco::JSON::Parser parser;
+        Parser parser;
         Poco::Dynamic::Var var = parser.parse(_docOptions);
-        Poco::JSON::Object::Ptr object = var.extract<Poco::JSON::Object::Ptr>();
+        Object::Ptr object = var.extract<Object::Ptr>();
         renderingOptions = object->get("rendering").toString();
     }
 
diff --git a/loolwsd/LOOLKit.cpp b/loolwsd/LOOLKit.cpp
index 552a48c..340f101 100644
--- a/loolwsd/LOOLKit.cpp
+++ b/loolwsd/LOOLKit.cpp
@@ -29,18 +29,15 @@
 #include <Poco/Net/HTTPRequest.h>
 #include <Poco/Net/HTTPResponse.h>
 #include <Poco/Thread.h>
-#include <Poco/ThreadPool.h>
 #include <Poco/ThreadLocal.h>
 #include <Poco/Runnable.h>
 #include <Poco/StringTokenizer.h>
 #include <Poco/Exception.h>
 #include <Poco/Process.h>
 #include <Poco/Environment.h>
-#include <Poco/NotificationQueue.h>
-#include <Poco/Notification.h>
 #include <Poco/Mutex.h>
-#include <Poco/Util/ServerApplication.h>
 #include <Poco/Net/NetException.h>
+#include <Poco/Util/Application.h>
 
 #define LOK_USE_UNSTABLE_API
 #include <LibreOfficeKit/LibreOfficeKitInit.h>
@@ -63,9 +60,6 @@ using Poco::Runnable;
 using Poco::StringTokenizer;
 using Poco::Exception;
 using Poco::Process;
-using Poco::Notification;
-using Poco::NotificationQueue;
-using Poco::FastMutex;
 using Poco::Util::Application;
 using Poco::File;
 using Poco::Path;
diff --git a/loolwsd/LOOLSession.cpp b/loolwsd/LOOLSession.cpp
index 65eb0ea..70be4d6 100644
--- a/loolwsd/LOOLSession.cpp
+++ b/loolwsd/LOOLSession.cpp
@@ -28,26 +28,15 @@
 #include <LibreOfficeKit/LibreOfficeKit.h>
 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
 
-#include <Poco/Dynamic/Var.h>
 #include <Poco/Exception.h>
 #include <Poco/File.h>
-#include <Poco/JSON/Object.h>
-#include <Poco/JSON/Parser.h>
-#include <Poco/Net/HTTPStreamFactory.h>
 #include <Poco/Net/WebSocket.h>
 #include <Poco/Path.h>
-#include <Poco/Process.h>
-#include <Poco/Random.h>
-#include <Poco/StreamCopier.h>
 #include <Poco/String.h>
 #include <Poco/StringTokenizer.h>
-#include <Poco/ThreadLocal.h>
 #include <Poco/URI.h>
-#include <Poco/URIStreamOpener.h>
 #include <Poco/Exception.h>
 #include <Poco/Net/NetException.h>
-#include <Poco/Net/DialogSocket.h>
-#include <Poco/Net/SocketAddress.h>
 #include <Poco/FileStream.h>
 
 #include "Common.hpp"
@@ -58,28 +47,13 @@
 
 using namespace LOOLProtocol;
 
-using Poco::Dynamic::Var;
 using Poco::File;
-using Poco::IOException;
-using Poco::JSON::Object;
-using Poco::JSON::Parser;
-using Poco::Net::HTTPStreamFactory;
 using Poco::Net::WebSocket;
 using Poco::Path;
-using Poco::Process;
-using Poco::ProcessHandle;
-using Poco::Random;
-using Poco::StreamCopier;
 using Poco::StringTokenizer;
 using Poco::Thread;
-using Poco::ThreadLocal;
-using Poco::UInt64;
 using Poco::URI;
-using Poco::URIStreamOpener;
 using Poco::Exception;
-using Poco::Net::DialogSocket;
-using Poco::Net::SocketAddress;
-using Poco::Net::WebSocketException;
 
 LOOLSession::LOOLSession(const std::string& id, const Kind kind,
                          std::shared_ptr<Poco::Net::WebSocket> ws) :
diff --git a/loolwsd/LOOLWSD.cpp b/loolwsd/LOOLWSD.cpp
index b242df9..1be9a5d 100644
--- a/loolwsd/LOOLWSD.cpp
+++ b/loolwsd/LOOLWSD.cpp
@@ -91,10 +91,8 @@ DEALINGS IN THE SOFTWARE.
 #include <Poco/Util/OptionSet.h>
 #include <Poco/Util/ServerApplication.h>
 #include <Poco/Mutex.h>
-#include <Poco/Net/DialogSocket.h>
 #include <Poco/Net/Net.h>
 #include <Poco/ThreadLocal.h>
-#include <Poco/NamedMutex.h>
 #include <Poco/FileStream.h>
 #include <Poco/TemporaryFile.h>
 #include <Poco/StreamCopier.h>
@@ -145,12 +143,9 @@ using Poco::Util::MissingOptionException;
 using Poco::Util::Option;
 using Poco::Util::OptionSet;
 using Poco::Util::ServerApplication;
-using Poco::Net::DialogSocket;
-using Poco::FastMutex;
 using Poco::Net::Socket;
 using Poco::ThreadLocal;
 using Poco::Random;
-using Poco::NamedMutex;
 using Poco::ProcessHandle;
 using Poco::URI;
 
diff --git a/loolwsd/MasterProcessSession.cpp b/loolwsd/MasterProcessSession.cpp
index 19d780a..04eea14 100644
--- a/loolwsd/MasterProcessSession.cpp
+++ b/loolwsd/MasterProcessSession.cpp
@@ -10,7 +10,6 @@
 #include <Poco/FileStream.h>
 #include <Poco/JSON/Object.h>
 #include <Poco/JSON/Parser.h>
-#include <Poco/Process.h>
 #include <Poco/URI.h>
 #include <Poco/URIStreamOpener.h>
 
@@ -24,12 +23,8 @@
 
 using namespace LOOLProtocol;
 
-using Poco::Net::SocketAddress;
-using Poco::Net::WebSocket;
 using Poco::Path;
-using Poco::Process;
 using Poco::StringTokenizer;
-using Poco::UInt64;
 
 std::map<std::string, std::shared_ptr<MasterProcessSession>> MasterProcessSession::AvailableChildSessions;
 std::mutex MasterProcessSession::AvailableChildSessionMutex;
diff --git a/loolwsd/TileCache.hpp b/loolwsd/TileCache.hpp
index 4118ff0..500978b 100644
--- a/loolwsd/TileCache.hpp
+++ b/loolwsd/TileCache.hpp
@@ -19,8 +19,6 @@
 #include <Poco/Timestamp.h>
 #include <Poco/Mutex.h>
 
-using Poco::FastMutex;
-
 /** Handles the cache for tiles of one document.
 
 The cache consists of 2 cache directories:


More information about the Libreoffice-commits mailing list