summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@gmail.com>2016-01-03 20:00:21 +0100
committerMatúš Kukan <matus.kukan@gmail.com>2016-01-05 20:41:11 +0100
commit5b22663e373f2137c93adcdd2c31c54da2fba663 (patch)
tree0f6935e54a9ff498bdaea06eb91b2d7a61d9bbe1 /sot
parent62b274fd7f8abf71300607f43d68acc694c9295b (diff)
Make SotFactory private to sot/ and clean a bit
Change-Id: Ia683280a3e95eee995e036db6bde5d28852f92ff
Diffstat (limited to 'sot')
-rw-r--r--sot/inc/factory.hxx57
-rw-r--r--sot/inc/sotdata.hxx53
-rw-r--r--sot/source/base/exchange.cxx8
-rw-r--r--sot/source/base/factory.cxx5
-rw-r--r--sot/source/base/object.cxx5
-rw-r--r--sot/source/sdstor/storage.cxx12
6 files changed, 127 insertions, 13 deletions
diff --git a/sot/inc/factory.hxx b/sot/inc/factory.hxx
new file mode 100644
index 000000000000..ab22cc08cadb
--- /dev/null
+++ b/sot/inc/factory.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SOT_FACTORY_HXX
+#define INCLUDED_SOT_FACTORY_HXX
+
+#include <sal/config.h>
+
+#include <tools/globname.hxx>
+
+class SotObject;
+
+class SotFactory : public SvGlobalName
+{
+ sal_uInt16 nSuperCount; // Anzahl der Superklassen
+ const SotFactory ** pSuperClasses; // Superklassen
+
+protected:
+ virtual ~SotFactory();
+public:
+ static void IncSvObjectCount( SotObject * = nullptr );
+ static void DecSvObjectCount( SotObject * = nullptr );
+
+#ifdef DBG_UTIL
+ static const SotFactory * Find( const SvGlobalName & );
+#endif
+
+ SotFactory( const SvGlobalName & );
+
+ void PutSuperClass( const SotFactory * );
+
+ bool Is( const SotFactory * pSuperClass ) const;
+
+private:
+ SotFactory( const SotFactory & ) = delete;
+ SotFactory & operator = ( const SotFactory & ) = delete;
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/inc/sotdata.hxx b/sot/inc/sotdata.hxx
new file mode 100644
index 000000000000..f2d3c260bf84
--- /dev/null
+++ b/sot/inc/sotdata.hxx
@@ -0,0 +1,53 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_SOT_SOTDATA_HXX
+#define INCLUDED_SOT_SOTDATA_HXX
+
+#include <sal/config.h>
+
+#include <com/sun/star/datatransfer/DataFlavor.hpp>
+#include <vector>
+#include <list>
+
+
+class SotFactory;
+class SotObject;
+
+typedef ::std::vector< SotFactory* > SotFactoryList;
+typedef ::std::vector< css::datatransfer::DataFlavor* > tDataFlavorList;
+
+struct SotData_Impl
+{
+ sal_uInt32 nSvObjCount;
+ std::list<SotObject*> aObjectList;
+ SotFactoryList * pFactoryList;
+ SotFactory * pSotObjectFactory;
+ SotFactory * pSotStorageStreamFactory;
+ SotFactory * pSotStorageFactory;
+ tDataFlavorList* pDataFlavorList;
+ SotData_Impl();
+ ~SotData_Impl();
+};
+
+SotData_Impl* SOTDATA();
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sot/source/base/exchange.cxx b/sot/source/base/exchange.cxx
index 13ca02f52cc2..c50a6b77e46c 100644
--- a/sot/source/base/exchange.cxx
+++ b/sot/source/base/exchange.cxx
@@ -17,10 +17,12 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sal/config.h>
+
#include <tools/debug.hxx>
#include <tools/solar.h>
#include <tools/globname.hxx>
-#include <sot/sotdata.hxx>
+#include <sotdata.hxx>
#include <sot/exchange.hxx>
#include <sot/formats.hxx>
#include <sysformats.hxx>
@@ -29,10 +31,6 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <comphelper/documentconstants.hxx>
-#ifdef GetObject
-#undef GetObject
-#endif
-
using namespace::com::sun::star::uno;
using namespace::com::sun::star::datatransfer;
diff --git a/sot/source/base/factory.cxx b/sot/source/base/factory.cxx
index 8111c2bc3f38..74946ad68821 100644
--- a/sot/source/base/factory.cxx
+++ b/sot/source/base/factory.cxx
@@ -17,10 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <sot/factory.hxx>
+#include <factory.hxx>
+
#include <tools/debug.hxx>
#include <sot/object.hxx>
-#include <sot/sotdata.hxx>
+#include <sotdata.hxx>
#include <comphelper/classids.hxx>
#include <osl/diagnose.h>
#include <rtl/instance.hxx>
diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx
index 11802528f2c2..25b198d0a2c4 100644
--- a/sot/source/base/object.cxx
+++ b/sot/source/base/object.cxx
@@ -18,7 +18,8 @@
*/
#include <sot/object.hxx>
-#include <sot/factory.hxx>
+#include <factory.hxx>
+#include <sotdata.hxx>
/************** class SotObject ******************************************/
class SotObjectFactory : public SotFactory
@@ -32,7 +33,7 @@ public:
SotFactory * SotObject::ClassFactory()
{
- SotFactory **ppFactory = GetFactoryAdress();
+ SotFactory **ppFactory = &(SOTDATA()->pSotObjectFactory);
if( !*ppFactory )
{
*ppFactory = new SotObjectFactory(
diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index df13786b3158..63c8cbdb5463 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <sal/config.h>
+
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -35,6 +35,10 @@
#include <tools/urlobj.hxx>
#include <unotools/ucbhelper.hxx>
#include <comphelper/processfactory.hxx>
+
+#include <factory.hxx>
+#include <sotdata.hxx>
+
#include <memory>
using namespace ::com::sun::star;
@@ -51,7 +55,7 @@ public:
SotFactory * SotStorageStream::ClassFactory()
{
- SotFactory **ppFactory = GetFactoryAdress();
+ SotFactory **ppFactory = &(SOTDATA()->pSotStorageStreamFactory);
if( !*ppFactory )
{
*ppFactory = new SotStorageStreamFactory(
@@ -300,7 +304,7 @@ public:
SotFactory * SotStorage::ClassFactory()
{
- SotFactory **ppFactory = GetFactoryAdress();
+ SotFactory **ppFactory = &(SOTDATA()->pSotStorageFactory);
if( !*ppFactory )
{
*ppFactory = new SotStorageFactory(