[Libreoffice-commits] core.git: 6 commits - android/experimental codemaker/source framework/inc framework/source framework/util qadevOOo/objdsc sax/source sfx2/source stoc/source svtools/source svx/source
Matúš Kukan
matus.kukan at collabora.com
Sat Jan 18 08:05:30 PST 2014
android/experimental/DocumentLoader/Makefile | 1
android/experimental/LibreOffice4Android/Makefile | 1
android/experimental/desktop/Makefile | 1
codemaker/source/cppumaker/cpputype.cxx | 19
framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx | 203 ------
framework/source/accelerators/documentacceleratorconfiguration.cxx | 140 ++--
framework/source/accelerators/moduleacceleratorconfiguration.cxx | 125 ++-
framework/source/inc/accelerators/documentacceleratorconfiguration.hxx | 111 ---
framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx | 105 ---
framework/source/register/registerservices.cxx | 6
framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx | 322 +++++++---
framework/util/fwk.component | 9
qadevOOo/objdsc/fwk/com.sun.star.comp.framework.ModuleUIConfigurationManager.csv | 1
sax/source/expatwrap/sax_expat.cxx | 8
sax/source/expatwrap/saxwriter.cxx | 11
sax/source/fastparser/fastparser.cxx | 7
sfx2/source/appl/appbaslib.cxx | 6
sfx2/source/notify/globalevents.cxx | 5
stoc/source/defaultregistry/defaultregistry.cxx | 6
stoc/source/implementationregistration/implreg.cxx | 8
stoc/source/loader/dllcomponentloader.cxx | 6
stoc/source/security/access_controller.cxx | 7
stoc/source/security/file_policy.cxx | 10
stoc/source/servicemanager/servicemanager.cxx | 16
stoc/source/simpleregistry/simpleregistry.cxx | 5
svtools/source/graphic/provider.cxx | 10
svtools/source/graphic/renderer.cxx | 10
svtools/source/hatchwindow/hatchwindowfactory.cxx | 10
svtools/source/inc/renderer.hxx | 6
svx/source/customshapes/EnhancedCustomShapeEngine.cxx | 8
svx/source/sdr/primitive2d/primitivefactory2d.cxx | 8
svx/source/sidebar/PanelFactory.cxx | 7
svx/source/tbxctrls/tbunocontroller.cxx | 6
svx/source/tbxctrls/tbunosearchcontrollers.cxx | 40 -
svx/source/unodraw/UnoGraphicExporter.cxx | 7
svx/source/unodraw/recoveryui.cxx | 6
svx/source/unodraw/unoctabl.cxx | 8
svx/source/unodraw/unoshcol.cxx | 8
svx/source/unogallery/unogalthemeprovider.cxx | 8
svx/source/xml/xmlgrhlp.cxx | 20
40 files changed, 551 insertions(+), 750 deletions(-)
New commits:
commit 13964ddb618066ad0920869c1d063584138be5b6
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Sat Jan 18 16:58:47 2014 +0100
sc/qa/unit/data/xls/border.xls was removed
..in commit a96b6f4708d587ddddd93101e51e52dec4e87b7e
Change-Id: I94ea246df8fabee9b0bda579be7698c964958e16
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 74c497a..c928664 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -37,7 +37,6 @@ copy-stuff:
sed -e 's!uri="vnd.sun.star.expand:$$LO_LIB_DIR/!uri="file://$(APP_DATA_PATH)/lib/!g' <$(INSTDIR)/$$F.rdb >assets/$$F.rdb; \
done
cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt \
- $(SRC_ROOT)/sc/qa/unit/data/xls/border.xls \
$(SRC_ROOT)/sw/qa/core/data/odt/test.odt \
$(SRC_ROOT)/sw/qa/core/data/doc/testVba.doc \
assets
diff --git a/android/experimental/LibreOffice4Android/Makefile b/android/experimental/LibreOffice4Android/Makefile
index 33a7e55..3a66f71 100644
--- a/android/experimental/LibreOffice4Android/Makefile
+++ b/android/experimental/LibreOffice4Android/Makefile
@@ -37,7 +37,6 @@ copy-stuff:
sed -e 's!uri="vnd.sun.star.expand:$$LO_LIB_DIR/!uri="file://$$APP_DATA_DIR/lib/!g' <$(INSTDIR)/$$F.rdb >assets/$$F.rdb; \
done
cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt \
- $(SRC_ROOT)/sc/qa/unit/data/xls/border.xls \
$(SRC_ROOT)/sw/qa/core/data/odt/test.odt \
$(SRC_ROOT)/sw/qa/core/data/doc/testVba.doc \
assets
diff --git a/android/experimental/desktop/Makefile b/android/experimental/desktop/Makefile
index b2d55f9..d75b8f7 100644
--- a/android/experimental/desktop/Makefile
+++ b/android/experimental/desktop/Makefile
@@ -38,7 +38,6 @@ copy-stuff:
sed -e 's!uri="vnd.sun.star.expand:$$LO_LIB_DIR/!uri="file://$(APP_DATA_PATH)/lib/!g' <$(INSTDIR)/$$F.rdb >assets/$$F.rdb; \
done
cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt \
- $(SRC_ROOT)/sc/qa/unit/data/xls/border.xls \
$(SRC_ROOT)/sw/qa/core/data/odt/test.odt \
$(SRC_ROOT)/sw/qa/core/data/doc/testVba.doc \
assets
commit 73eca35b0a8e01a7be2ce1775d1937154b5efb9e
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Sat Jan 18 10:51:50 2014 +0100
Unify ctor functions for component implementations.
There is no need to use different styles for writing the same thing.
It also makes it easier in future to use search & replace.
But of course, there are also some more complicated functions.
Change-Id: I773da20378af0e0d5a27689d3903df7063fb8ac0
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index 456aca2..12066dc 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -34,6 +34,7 @@
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <rtl/ref.hxx>
#include <expat.h>
@@ -1021,13 +1022,12 @@ void SaxExpatParser_Impl::callbackEndCDATA( void *pvThis )
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_extensions_xml_sax_ParserExpat_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new SaxExpatParser));
+ rtl::Reference<SaxExpatParser> x(new SaxExpatParser);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 7f0d498..be86b61 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -36,11 +36,9 @@
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/supportsservice.hxx>
-#include <rtl/strbuf.hxx>
-#include <rtl/byteseq.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
-using namespace ::rtl;
using namespace ::std;
using namespace ::osl;
using namespace ::cppu;
@@ -1374,13 +1372,12 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_extensions_xml_sax_Writer_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new SAXWriter));
+ rtl::Reference<SAXWriter> x(new SAXWriter);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 5f86b88..57bff21 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -1428,13 +1428,12 @@ bool FastSaxParser::hasNamespaceURL( const OUString& rPrefix ) const
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_extensions_xml_sax_FastParser_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new FastSaxParser));
+ rtl::Reference<FastSaxParser> x(new FastSaxParser);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/appl/appbaslib.cxx b/sfx2/source/appl/appbaslib.cxx
index a980606..4b96cc2 100644
--- a/sfx2/source/appl/appbaslib.cxx
+++ b/sfx2/source/appl/appbaslib.cxx
@@ -161,8 +161,7 @@ com_sun_star_comp_sfx2_ApplicationDialogLibraryContainer_get_implementation(
css::uno::Sequence<css::uno::Any> const &)
{
SFX_APP()->GetBasicManager();
- Reference< XInterface > xRet =
- Reference< XInterface >( SFX_APP()->GetDialogContainer(), UNO_QUERY );
+ Reference< XInterface > xRet( SFX_APP()->GetDialogContainer(), UNO_QUERY );
xRet->acquire();
return xRet.get();
}
@@ -176,8 +175,7 @@ com_sun_star_comp_sfx2_ApplicationScriptLibraryContainer_get_implementation(
css::uno::Sequence<css::uno::Any> const &)
{
SFX_APP()->GetBasicManager();
- Reference< XInterface > xRet =
- Reference< XInterface >( SFX_APP()->GetBasicContainer(), UNO_QUERY );
+ Reference< XInterface > xRet( SFX_APP()->GetBasicContainer(), UNO_QUERY );
xRet->acquire();
return xRet.get();
}
diff --git a/sfx2/source/notify/globalevents.cxx b/sfx2/source/notify/globalevents.cxx
index 173e0b1..5c86052 100644
--- a/sfx2/source/notify/globalevents.cxx
+++ b/sfx2/source/notify/globalevents.cxx
@@ -534,7 +534,7 @@ struct Instance {
static_cast<cppu::OWeakObject *>(new SfxGlobalEvents_Impl(context)))
{}
- css::uno::Reference<css::uno::XInterface> instance;
+ rtl::Reference<css::uno::XInterface> instance;
};
struct Singleton:
@@ -549,8 +549,7 @@ com_sun_star_comp_sfx2_GlobalEventBroadcaster_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- Singleton::get(context).instance);
+ rtl::Reference<css::uno::XInterface> x(Singleton::get(context).instance);
x->acquire();
return x.get();
}
diff --git a/stoc/source/defaultregistry/defaultregistry.cxx b/stoc/source/defaultregistry/defaultregistry.cxx
index ca66017..c1c07e1 100644
--- a/stoc/source/defaultregistry/defaultregistry.cxx
+++ b/stoc/source/defaultregistry/defaultregistry.cxx
@@ -27,6 +27,7 @@
#include <cppuhelper/implementationentry.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <registry/registry.hxx>
+#include <rtl/ref.hxx>
#include <com/sun/star/registry/XSimpleRegistry.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -1354,10 +1355,9 @@ com_sun_star_comp_stoc_NestedRegistry_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new NestedRegistryImpl));
+ rtl::Reference<NestedRegistryImpl> x(new NestedRegistryImpl);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx
index 7b7a13c..e5daf98 100644
--- a/stoc/source/implementationregistration/implreg.cxx
+++ b/stoc/source/implementationregistration/implreg.cxx
@@ -30,9 +30,9 @@
#include <uno/mapping.hxx>
#include <osl/thread.h>
+#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
-#include <rtl/strbuf.hxx>
#include <osl/process.h>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -1821,11 +1821,9 @@ com_sun_star_comp_stoc_ImplementationRegistration_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(
- new ImplementationRegistration(context)));
+ rtl::Reference<ImplementationRegistration> x(new ImplementationRegistration(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/loader/dllcomponentloader.cxx b/stoc/source/loader/dllcomponentloader.cxx
index b8e196a..14fc172 100644
--- a/stoc/source/loader/dllcomponentloader.cxx
+++ b/stoc/source/loader/dllcomponentloader.cxx
@@ -24,6 +24,7 @@
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
#include <osl/module.h>
+#include <rtl/ref.hxx>
#include <rtl/ustring.hxx>
#include <uno/environment.h>
#include <uno/mapping.hxx>
@@ -169,10 +170,9 @@ com_sun_star_comp_stoc_DLLComponentLoader_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new DllComponentLoader(context)));
+ rtl::Reference<DllComponentLoader> x(new DllComponentLoader(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/security/access_controller.cxx b/stoc/source/security/access_controller.cxx
index 9edb8c4..2e6c84b 100644
--- a/stoc/source/security/access_controller.cxx
+++ b/stoc/source/security/access_controller.cxx
@@ -26,8 +26,8 @@
#include <osl/mutex.hxx>
#include <osl/thread.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
-#include <rtl/string.hxx>
#include <uno/current_context.h>
#include <uno/lbnames.h>
@@ -984,10 +984,9 @@ com_sun_star_security_comp_stoc_AccessController_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new AccessController(context)));
+ rtl::Reference<AccessController> x(new AccessController(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/security/file_policy.cxx b/stoc/source/security/file_policy.cxx
index 47d1ae6..4cd5e8c 100644
--- a/stoc/source/security/file_policy.cxx
+++ b/stoc/source/security/file_policy.cxx
@@ -23,7 +23,7 @@
#include <osl/diagnose.h>
#include <osl/file.h>
#include <rtl/byteseq.hxx>
-#include <rtl/string.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <cppuhelper/access_control.hxx>
@@ -42,7 +42,6 @@
#define IMPL_NAME "com.sun.star.security.comp.stoc.FilePolicy"
using namespace ::osl;
-using namespace ::rtl;
using namespace ::cppu;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -157,7 +156,7 @@ class PolicyReader
oslFileHandle m_file;
sal_Int32 m_linepos;
- ByteSequence m_line;
+ rtl::ByteSequence m_line;
sal_Int32 m_pos;
sal_Unicode m_back;
@@ -546,10 +545,9 @@ com_sun_star_security_comp_stoc_FilePolicy_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new FilePolicy(context)));
+ rtl::Reference<FilePolicy> x(new FilePolicy(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/servicemanager/servicemanager.cxx b/stoc/source/servicemanager/servicemanager.cxx
index 4253105..1dd406e 100644
--- a/stoc/source/servicemanager/servicemanager.cxx
+++ b/stoc/source/servicemanager/servicemanager.cxx
@@ -19,6 +19,7 @@
#include <osl/mutex.hxx>
#include <osl/diagnose.h>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <boost/unordered_map.hpp>
@@ -1675,10 +1676,9 @@ com_sun_star_comp_stoc_OServiceManager_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new OServiceManager(context)));
+ rtl::Reference<OServiceManager> x(new OServiceManager(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1686,10 +1686,9 @@ com_sun_star_comp_stoc_ORegistryServiceManager_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new ORegistryServiceManager(context)));
+ rtl::Reference<ORegistryServiceManager> x(new ORegistryServiceManager(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1697,10 +1696,9 @@ com_sun_star_comp_stoc_OServiceManagerWrapper_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new OServiceManagerWrapper(context)));
+ rtl::Reference<OServiceManagerWrapper> x(new OServiceManagerWrapper(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index 97fe443..96230e1 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -1128,10 +1128,9 @@ com_sun_star_comp_stoc_SimpleRegistry_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new SimpleRegistry));
+ rtl::Reference<SimpleRegistry> x(new SimpleRegistry);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index 00250e8..b2ea034 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -38,6 +38,7 @@
#include "descriptor.hxx"
#include "graphic.hxx"
+#include <rtl/ref.hxx>
#include <svtools/grfmgr.hxx>
#include "provider.hxx"
#include <vcl/dibtools.hxx>
@@ -857,13 +858,12 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_graphic_GraphicProvider_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
- css::uno::Sequence<css::uno::Any> const &)
+ css::uno::XComponentContext *,
+ css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new GraphicProvider));
+ rtl::Reference<GraphicProvider> x(new GraphicProvider);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/graphic/renderer.cxx b/svtools/source/graphic/renderer.cxx
index 2b3fc31..0621e57 100644
--- a/svtools/source/graphic/renderer.cxx
+++ b/svtools/source/graphic/renderer.cxx
@@ -26,6 +26,7 @@
#include <toolkit/helper/vclunohelper.hxx>
#include <comphelper/propertysetinfo.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <rtl/ref.hxx>
#include <svl/itemprop.hxx>
#include <svtools/grfmgr.hxx>
#include <comphelper/servicehelper.hxx>
@@ -293,13 +294,12 @@ void SAL_CALL GraphicRendererVCL::render( const uno::Reference< graphic::XGraphi
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
- css::uno::Sequence<css::uno::Any> const &)
+ css::uno::XComponentContext *,
+ css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new GraphicRendererVCL));
+ rtl::Reference<GraphicRendererVCL> x(new GraphicRendererVCL);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/hatchwindow/hatchwindowfactory.cxx b/svtools/source/hatchwindow/hatchwindowfactory.cxx
index 17c0584..afa3f33 100644
--- a/svtools/source/hatchwindow/hatchwindowfactory.cxx
+++ b/svtools/source/hatchwindow/hatchwindowfactory.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <rtl/ref.hxx>
#include <vcl/svapp.hxx>
#include <hatchwindow.hxx>
@@ -85,13 +86,12 @@ uno::Sequence< OUString > SAL_CALL OHatchWindowFactory::getSupportedServiceNames
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_embed_HatchWindowFactory_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
- css::uno::Sequence<css::uno::Any> const &)
+ css::uno::XComponentContext *,
+ css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new OHatchWindowFactory));
+ rtl::Reference<OHatchWindowFactory> x(new OHatchWindowFactory);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/inc/renderer.hxx b/svtools/source/inc/renderer.hxx
index a69bac7..397ba03 100644
--- a/svtools/source/inc/renderer.hxx
+++ b/svtools/source/inc/renderer.hxx
@@ -37,15 +37,13 @@ class GraphicRendererVCL : public ::cppu::OWeakAggObject,
public ::comphelper::PropertySetHelper,
public ::com::sun::star::graphic::XGraphicRenderer
{
+ static ::comphelper::PropertySetInfo* createPropertySetInfo();
+
public:
GraphicRendererVCL();
~GraphicRendererVCL() throw();
-protected:
-
- static ::comphelper::PropertySetInfo* createPropertySetInfo();
-
// XInterface
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 861c42a..2c3cd3e 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -25,6 +25,7 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/drawing/XCustomShapeEngine.hpp>
+#include <rtl/ref.hxx>
#include "svx/EnhancedCustomShape2d.hxx"
#include "EnhancedCustomShape3d.hxx"
#include "EnhancedCustomShapeFontWork.hxx"
@@ -490,13 +491,12 @@ Sequence< Reference< drawing::XCustomShapeHandle > > SAL_CALL EnhancedCustomShap
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_drawing_EnhancedCustomShapeEngine_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new EnhancedCustomShapeEngine));
+ rtl::Reference<EnhancedCustomShapeEngine> x(new EnhancedCustomShapeEngine);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sdr/primitive2d/primitivefactory2d.cxx b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
index abcdd91..ded21f9 100644
--- a/svx/source/sdr/primitive2d/primitivefactory2d.cxx
+++ b/svx/source/sdr/primitive2d/primitivefactory2d.cxx
@@ -19,6 +19,7 @@
#include <com/sun/star/graphic/XPrimitiveFactory2D.hpp>
#include <drawinglayer/primitive2d/baseprimitive2d.hxx>
+#include <rtl/ref.hxx>
#include <svx/svdobj.hxx>
#include <svx/svdpage.hxx>
#include <svx/unoapi.hxx>
@@ -89,13 +90,12 @@ Primitive2DSequence SAL_CALL PrimitiveFactory2D::createPrimitivesFromXDrawPage(
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_graphic_PrimitiveFactory2D_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new PrimitiveFactory2D));
+ rtl::Reference<PrimitiveFactory2D> x(new PrimitiveFactory2D);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index dbf9c08..26352c0 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -206,11 +206,10 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new PanelFactory));
+ rtl::Reference<PanelFactory> x(new PanelFactory);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index b20337f..d93065e 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <rtl/ref.hxx>
#include <vcl/svapp.hxx>
#include <vcl/window.hxx>
#include <toolkit/helper/vclunohelper.hxx>
@@ -443,10 +444,9 @@ com_sun_star_svx_FontHeightToolBoxController_get_implementation(
css::uno::XComponentContext *rxContext,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new FontHeightToolBoxControl(rxContext)));
+ rtl::Reference<FontHeightToolBoxControl> x(new FontHeightToolBoxControl(rxContext));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/tbxctrls/tbunosearchcontrollers.cxx b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
index b3fdbfb..05c6bfe 100644
--- a/svx/source/tbxctrls/tbunosearchcontrollers.cxx
+++ b/svx/source/tbxctrls/tbunosearchcontrollers.cxx
@@ -39,6 +39,7 @@
#include <vcl/toolbox.hxx>
#include <vcl/svapp.hxx>
#include <osl/mutex.hxx>
+#include <rtl/ref.hxx>
#include <rtl/instance.hxx>
using namespace css;
@@ -1054,10 +1055,9 @@ com_sun_star_svx_FindTextToolboxController_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new FindTextToolbarController(context)));
+ rtl::Reference<FindTextToolbarController> x(new FindTextToolbarController(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1065,10 +1065,9 @@ com_sun_star_svx_ExitFindbarToolboxController_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new ExitSearchToolboxController(context)));
+ rtl::Reference<ExitSearchToolboxController> x(new ExitSearchToolboxController(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1076,11 +1075,10 @@ com_sun_star_svx_UpSearchToolboxController_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(
- context, UpDownSearchToolboxController::UP )));
+ rtl::Reference<UpDownSearchToolboxController> x(new UpDownSearchToolboxController(
+ context, UpDownSearchToolboxController::UP));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1088,11 +1086,10 @@ com_sun_star_svx_DownSearchToolboxController_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new UpDownSearchToolboxController(
- context, UpDownSearchToolboxController::DOWN )));
+ rtl::Reference<UpDownSearchToolboxController> x(new UpDownSearchToolboxController(
+ context, UpDownSearchToolboxController::DOWN));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1100,10 +1097,9 @@ com_sun_star_svx_MatchCaseToolboxController_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new MatchCaseToolboxController(context)));
+ rtl::Reference<MatchCaseToolboxController> x(new MatchCaseToolboxController(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1111,10 +1107,9 @@ com_sun_star_svx_FindAllToolboxController_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new FindAllToolboxController(context)));
+ rtl::Reference<FindAllToolboxController> x(new FindAllToolboxController(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
@@ -1122,10 +1117,9 @@ com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation(
SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new FindbarDispatcher));
+ rtl::Reference<FindbarDispatcher> x(new FindbarDispatcher);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 9a21919..7a611be 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -1282,13 +1282,12 @@ Graphic SvxGetGraphicForShape( SdrObject& rShape, bool bVector )
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_Draw_GraphicExporter_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new GraphicExporter));
+ rtl::Reference<GraphicExporter> x(new GraphicExporter);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/recoveryui.cxx b/svx/source/unodraw/recoveryui.cxx
index 1644601..5fdb5f2 100644
--- a/svx/source/unodraw/recoveryui.cxx
+++ b/svx/source/unodraw/recoveryui.cxx
@@ -29,6 +29,7 @@
#include <cppuhelper/implbase2.hxx>
#include <osl/file.hxx>
#include <rtl/bootstrap.hxx>
+#include <rtl/ref.hxx>
#include <comphelper/processfactory.hxx>
#include <cppuhelper/supportsservice.hxx>
@@ -424,10 +425,9 @@ com_sun_star_comp_svx_RecoveryUI_get_implementation(
css::uno::XComponentContext *context,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new RecoveryUI(context)));
+ rtl::Reference<RecoveryUI> x(new RecoveryUI(context));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoctabl.cxx b/svx/source/unodraw/unoctabl.cxx
index 019654c..b707904 100644
--- a/svx/source/unodraw/unoctabl.cxx
+++ b/svx/source/unodraw/unoctabl.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <cppuhelper/implbase2.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <rtl/ref.hxx>
#include <svx/xtable.hxx>
using namespace ::com::sun::star;
@@ -186,13 +187,12 @@ sal_Bool SAL_CALL SvxUnoColorTable::hasElements()
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_drawing_SvxUnoColorTable_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new SvxUnoColorTable));
+ rtl::Reference<SvxUnoColorTable> x(new SvxUnoColorTable);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unodraw/unoshcol.cxx b/svx/source/unodraw/unoshcol.cxx
index 916d1f0..8b873ac 100644
--- a/svx/source/unodraw/unoshcol.cxx
+++ b/svx/source/unodraw/unoshcol.cxx
@@ -27,6 +27,7 @@
#include <cppuhelper/interfacecontainer.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/mutex.hxx>
+#include <rtl/ref.hxx>
#include <svx/unoprov.hxx>
using namespace ::com::sun::star;
@@ -270,13 +271,12 @@ uno::Sequence< OUString > SAL_CALL SvxShapeCollection::getSupportedServiceNames(
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_drawing_SvxShapeCollection_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new SvxShapeCollection));
+ rtl::Reference<SvxShapeCollection> x(new SvxShapeCollection);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/unogallery/unogalthemeprovider.cxx b/svx/source/unogallery/unogalthemeprovider.cxx
index 7878e90..2fcaec8 100644
--- a/svx/source/unogallery/unogalthemeprovider.cxx
+++ b/svx/source/unogallery/unogalthemeprovider.cxx
@@ -22,6 +22,7 @@
#include "unogaltheme.hxx"
#include "svx/gallery1.hxx"
#include <osl/mutex.hxx>
+#include <rtl/ref.hxx>
#include <vcl/svapp.hxx>
#include <unotools/pathoptions.hxx>
#include <comphelper/servicehelper.hxx>
@@ -232,13 +233,12 @@ void SAL_CALL GalleryThemeProvider::removeByName( const OUString& rName )
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_gallery_GalleryThemeProvider_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new GalleryThemeProvider));
+ rtl::Reference<GalleryThemeProvider> x(new GalleryThemeProvider);
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx
index b95d38f..f9bad05 100644
--- a/svx/source/xml/xmlgrhlp.cxx
+++ b/svx/source/xml/xmlgrhlp.cxx
@@ -19,7 +19,6 @@
#include <comphelper/string.hxx>
#include <sal/macros.h>
-#include <rtl/strbuf.hxx>
#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
@@ -29,6 +28,7 @@
#include <cppuhelper/compbase4.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <rtl/ref.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <unotools/streamwrap.hxx>
#include <unotools/tempfile.hxx>
@@ -1052,14 +1052,13 @@ Sequence< OUString > SAL_CALL SvXMLGraphicImportExportHelper::getSupportedServic
*/
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_Svx_GraphicImportHelper_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper(
- GRAPHICHELPER_MODE_READ)));
+ rtl::Reference<SvXMLGraphicImportExportHelper> x(
+ new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_READ));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/** Create this with createInstanceWithArguments. service name
@@ -1076,14 +1075,13 @@ com_sun_star_comp_Svx_GraphicImportHelper_get_implementation(
*/
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_Svx_GraphicExportHelper_get_implementation(
- SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
+ css::uno::XComponentContext *,
css::uno::Sequence<css::uno::Any> const &)
{
- css::uno::Reference<css::uno::XInterface> x(
- static_cast<cppu::OWeakObject *>(new SvXMLGraphicImportExportHelper(
- GRAPHICHELPER_MODE_WRITE )));
+ rtl::Reference<SvXMLGraphicImportExportHelper> x(
+ new SvXMLGraphicImportExportHelper(GRAPHICHELPER_MODE_WRITE));
x->acquire();
- return x.get();
+ return static_cast<cppu::OWeakObject *>(x.get());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 42fc427d047a263185d89528953f980019ef815f
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Thu Jan 9 20:33:11 2014 +0100
fwk: Use constructor feature for ModuleAcceleratorConfiguration.
And avoid css::uno::XInitialization protocol.
Change-Id: If4a7987778e2880502bdc7ef2c30792de9377364
diff --git a/framework/source/accelerators/moduleacceleratorconfiguration.cxx b/framework/source/accelerators/moduleacceleratorconfiguration.cxx
index 4138155..f19b91c 100644
--- a/framework/source/accelerators/moduleacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/moduleacceleratorconfiguration.cxx
@@ -17,65 +17,99 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <accelerators/moduleacceleratorconfiguration.hxx>
-
+#include <accelerators/acceleratorconfiguration.hxx>
+#include <accelerators/presethandler.hxx>
#include <threadhelp/readguard.hxx>
#include <threadhelp/writeguard.hxx>
#include "helper/mischelper.hxx"
#include <acceleratorconst.h>
-#include <services.h>
#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <cppuhelper/supportsservice.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <vcl/svapp.hxx>
#include <com/sun/star/util/XChangesNotifier.hpp>
-
+#include <cppuhelper/implbase1.hxx>
+#include <rtl/ref.hxx>
#include <rtl/logfile.h>
-namespace framework
-{
+using namespace framework;
-//-----------------------------------------------
-// XInterface, XTypeProvider, XServiceInfo
-
-DEFINE_XSERVICEINFO_MULTISERVICE_2(ModuleAcceleratorConfiguration ,
- ::cppu::OWeakObject ,
- "com.sun.star.ui.ModuleAcceleratorConfiguration" ,
- OUString("com.sun.star.comp.framework.ModuleAcceleratorConfiguration"))
-
-DEFINE_INIT_SERVICE(ModuleAcceleratorConfiguration,
- {
- /*Attention
- I think we don't need any mutex or lock here ... because we are called by our own static method impl_createInstance()
- to create a new instance of this class by our own supported service factory.
- see macro DEFINE_XSERVICEINFO_MULTISERVICE and "impl_initService()" for further information!
- */
- }
- )
+namespace {
-//-----------------------------------------------
-ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext)
- : ModuleAcceleratorConfiguration_BASE(xContext)
-{
-}
+/**
+ implements a read/write access to a module
+ dependend accelerator configuration.
+ */
+typedef ::cppu::ImplInheritanceHelper1<
+ XCUBasedAcceleratorConfiguration,
+ css::lang::XServiceInfo > ModuleAcceleratorConfiguration_BASE;
-//-----------------------------------------------
-ModuleAcceleratorConfiguration::~ModuleAcceleratorConfiguration()
+class ModuleAcceleratorConfiguration : public ModuleAcceleratorConfiguration_BASE
{
-}
+private:
+ /** identify the application module, where this accelerator
+ configuration cache should work on. */
+ OUString m_sModule;
+ OUString m_sLocale;
-//-----------------------------------------------
-void SAL_CALL ModuleAcceleratorConfiguration::initialize(const css::uno::Sequence< css::uno::Any >& lArguments)
- throw(css::uno::Exception ,
- css::uno::RuntimeException)
+public:
+
+ /** initialize this instance and fill the internal cache.
+
+ @param xSMGR
+ reference to an uno service manager, which is used internaly.
+ */
+ ModuleAcceleratorConfiguration(
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Sequence< css::uno::Any >& lArguments);
+
+ /** TODO */
+ virtual ~ModuleAcceleratorConfiguration();
+
+ virtual OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ {
+ return OUString("com.sun.star.comp.framework.ModuleAcceleratorConfiguration");
+ }
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
+
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > aSeq(1);
+ aSeq[0] = OUString("com.sun.star.ui.ModuleAcceleratorConfiguration");
+ return aSeq;
+ }
+
+ // XComponent
+ virtual void SAL_CALL dispose() throw (css::uno::RuntimeException);
+
+ /** read all data into the cache. */
+ void impl_ts_fillCache();
+
+private:
+ /** helper to listen for configuration changes without ownership cycle problems */
+ css::uno::Reference< css::util::XChangesListener > m_xCfgListener;
+};
+
+ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration(
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Sequence< css::uno::Any >& lArguments)
+ : ModuleAcceleratorConfiguration_BASE(xContext)
{
- // SAFE -> ----------------------------------
WriteGuard aWriteLock(m_aLock);
OUString sModule;
@@ -95,12 +129,12 @@ void SAL_CALL ModuleAcceleratorConfiguration::initialize(const css::uno::Sequenc
static_cast< ::cppu::OWeakObject* >(this));
aWriteLock.unlock();
- // <- SAFE ----------------------------------
+}
- impl_ts_fillCache();
+ModuleAcceleratorConfiguration::~ModuleAcceleratorConfiguration()
+{
}
-//-----------------------------------------------
void ModuleAcceleratorConfiguration::impl_ts_fillCache()
{
// SAFE -> ----------------------------------
@@ -153,6 +187,17 @@ void SAL_CALL ModuleAcceleratorConfiguration::dispose()
{}
}
-} // namespace framework
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_framework_ModuleAcceleratorConfiguration_get_implementation(
+ css::uno::XComponentContext *context,
+ css::uno::Sequence<css::uno::Any> const &arguments)
+{
+ rtl::Reference<ModuleAcceleratorConfiguration> x(new ModuleAcceleratorConfiguration(context, arguments));
+ x->impl_ts_fillCache();
+ x->acquire();
+ return static_cast<cppu::OWeakObject *>(x.get());
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx b/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx
deleted file mode 100644
index c85d826..0000000
--- a/framework/source/inc/accelerators/moduleacceleratorconfiguration.hxx
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- 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_FRAMEWORK_SOURCE_INC_ACCELERATORS_MODULEACCELERATORCONFIGURATION_HXX
-#define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_MODULEACCELERATORCONFIGURATION_HXX
-
-#include <accelerators/acceleratorconfiguration.hxx>
-#include <accelerators/presethandler.hxx>
-
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
-#include <macros/xserviceinfo.hxx>
-
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-// definition
-
-namespace framework
-{
-
-//__________________________________________
-/**
- implements a read/write access to a module
- dependend accelerator configuration.
- */
-typedef ::cppu::ImplInheritanceHelper2<
- XCUBasedAcceleratorConfiguration,
- css::lang::XServiceInfo,
- css::lang::XInitialization > ModuleAcceleratorConfiguration_BASE;
-
-class ModuleAcceleratorConfiguration : ModuleAcceleratorConfiguration_BASE
-{
- //______________________________________
- // member
-
- private:
-
- //----------------------------------
- /** identify the application module, where this accelerator
- configuration cache should work on. */
- OUString m_sModule;
- OUString m_sLocale;
-
- //______________________________________
- // interface
-
- public:
-
- //----------------------------------
- /** initialize this instance and fill the internal cache.
-
- @param xSMGR
- reference to an uno service manager, which is used internaly.
- */
- ModuleAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext);
-
- //----------------------------------
- /** TODO */
- virtual ~ModuleAcceleratorConfiguration();
-
- // XInterface, XTypeProvider, XServiceInfo
- DECLARE_XSERVICEINFO
-
- // XInitialization
- virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any >& lArguments)
- throw(css::uno::Exception ,
- css::uno::RuntimeException);
-
- // XComponent
- virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
-
- //______________________________________
- // helper
-
- private:
- /** helper to listen for configuration changes without ownership cycle problems */
- css::uno::Reference< css::util::XChangesListener > m_xCfgListener;
-
- //----------------------------------
- /** read all data into the cache. */
- void impl_ts_fillCache();
-};
-
-} // namespace framework
-
-#endif // INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_MODULEACCELERATORCONFIGURATION_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index c86390a..032a5ad 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -40,7 +40,6 @@
#include <uielement/uicommanddescription.hxx>
#include <uiconfiguration/moduleuicfgsupplier.hxx>
#include <uifactory/menubarfactory.hxx>
-#include <accelerators/moduleacceleratorconfiguration.hxx>
#include <uifactory/toolboxfactory.hxx>
#include "uiconfiguration/windowstateconfiguration.hxx"
#include <services/autorecovery.hxx>
@@ -62,7 +61,6 @@ COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::UICommandDescription ) else
IFFACTORY( ::framework::ModuleUIConfigurationManagerSupplier ) else
IFFACTORY( ::framework::MenuBarFactory ) else
- IFFACTORY( ::framework::ModuleAcceleratorConfiguration ) else
IFFACTORY( ::framework::ToolBoxFactory ) else
IFFACTORY( ::framework::WindowStateConfiguration ) else
IFFACTORY( ::framework::ToolbarControllerFactory ) else
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 765583a..4a8b468 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -69,7 +69,8 @@
<implementation name="com.sun.star.comp.framework.MenuBarFactory">
<service name="com.sun.star.ui.UIElementFactory"/>
</implementation>
- <implementation name="com.sun.star.comp.framework.ModuleAcceleratorConfiguration">
+ <implementation name="com.sun.star.comp.framework.ModuleAcceleratorConfiguration"
+ constructor="com_sun_star_comp_framework_ModuleAcceleratorConfiguration_get_implementation">
<service name="com.sun.star.ui.ModuleAcceleratorConfiguration"/>
</implementation>
<implementation name="com.sun.star.comp.framework.ModuleManager"
commit 7dca32d575ab974e5f42f579bdeda21d2e445efe
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Thu Jan 9 20:58:27 2014 +0100
fwk: Use constructor feature for DocumentAcceleratorConfiguration.
And avoid css::uno::XInitialization protocol.
Change-Id: I14daf6409bf0d651d7b23246ba3855f647b3d1ef
diff --git a/framework/source/accelerators/documentacceleratorconfiguration.cxx b/framework/source/accelerators/documentacceleratorconfiguration.cxx
index d9e8689..be029dd 100644
--- a/framework/source/accelerators/documentacceleratorconfiguration.cxx
+++ b/framework/source/accelerators/documentacceleratorconfiguration.cxx
@@ -17,74 +17,105 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <accelerators/documentacceleratorconfiguration.hxx>
+#include <accelerators/acceleratorconfiguration.hxx>
+#include <accelerators/istoragelistener.hxx>
+#include <accelerators/presethandler.hxx>
#include <xml/acceleratorconfigurationreader.hxx>
-
#include <xml/acceleratorconfigurationwriter.hxx>
-
#include <xml/saxnamespacefilter.hxx>
#include <threadhelp/readguard.hxx>
#include <threadhelp/writeguard.hxx>
-
#include <acceleratorconst.h>
-#include <services.h>
-#include <com/sun/star/io/XActiveDataSource.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
-#include <com/sun/star/io/XSeekable.hpp>
-
-#include <com/sun/star/io/XTruncate.hpp>
+#include <cppuhelper/implbase1.hxx>
+#include <cppuhelper/supportsservice.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <i18nlangtag/languagetag.hxx>
+#include <rtl/ref.hxx>
-#include <com/sun/star/embed/ElementModes.hpp>
+using namespace framework;
-#include <com/sun/star/xml/sax/InputSource.hpp>
+namespace {
-#include <com/sun/star/xml/sax/XParser.hpp>
+/**
+ implements a read/write access to a document
+ based accelerator configuration.
+ */
-#include <comphelper/sequenceashashmap.hxx>
-#include <i18nlangtag/languagetag.hxx>
+typedef ::cppu::ImplInheritanceHelper1<
+ XMLBasedAcceleratorConfiguration,
+ css::lang::XServiceInfo> DocumentAcceleratorConfiguration_BASE;
-namespace framework
+class DocumentAcceleratorConfiguration : public DocumentAcceleratorConfiguration_BASE
{
+private:
-//-----------------------------------------------
-// XInterface, XTypeProvider, XServiceInfo
-
-DEFINE_XSERVICEINFO_MULTISERVICE_2(DocumentAcceleratorConfiguration ,
- ::cppu::OWeakObject ,
- "com.sun.star.ui.DocumentAcceleratorConfiguration" ,
- OUString("com.sun.star.comp.framework.DocumentAcceleratorConfiguration"))
-
-DEFINE_INIT_SERVICE(DocumentAcceleratorConfiguration,
- {
- /*Attention
- I think we don't need any mutex or lock here ... because we are called by our own static method impl_createInstance()
- to create a new instance of this class by our own supported service factory.
- see macro DEFINE_XSERVICEINFO_MULTISERVICE and "impl_initService()" for further information!
- */
- }
- )
+ //----------------------------------
+ /** points to the root storage of the outside document,
+ where we can read/save our configuration data. */
+ css::uno::Reference< css::embed::XStorage > m_xDocumentRoot;
-//-----------------------------------------------
-DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext)
- : DocumentAcceleratorConfiguration_BASE(xContext)
-{
-}
+public:
-//-----------------------------------------------
-DocumentAcceleratorConfiguration::~DocumentAcceleratorConfiguration()
-{
- m_aPresetHandler.removeStorageListener(this);
-}
+ /** initialize this instance and fill the internal cache.
+
+ @param xSMGR
+ reference to an uno service manager, which is used internaly.
+ */
+ DocumentAcceleratorConfiguration(
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Sequence< css::uno::Any >& lArguments);
+
+ virtual ~DocumentAcceleratorConfiguration();
+
+ virtual OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ {
+ return OUString("com.sun.star.comp.framework.DocumentAcceleratorConfiguration");
+ }
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
+
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > aSeq(1);
+ aSeq[0] = OUString("com.sun.star.ui.DocumentAcceleratorConfiguration");
+ return aSeq;
+ }
+
+ // XUIConfigurationStorage
+ virtual void SAL_CALL setStorage(const css::uno::Reference< css::embed::XStorage >& xStorage)
+ throw(css::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL hasStorage()
+ throw(css::uno::RuntimeException);
+
+private:
+
+ /** read all data into the cache. */
+ void impl_ts_fillCache();
+
+ /** forget all currently cached data AND(!)
+ forget all currently used storages. */
+ void impl_ts_clearCache();
+};
//-----------------------------------------------
-void SAL_CALL DocumentAcceleratorConfiguration::initialize(const css::uno::Sequence< css::uno::Any >& lArguments)
- throw(css::uno::Exception ,
- css::uno::RuntimeException)
+DocumentAcceleratorConfiguration::DocumentAcceleratorConfiguration(
+ const css::uno::Reference< css::uno::XComponentContext >& xContext,
+ const css::uno::Sequence< css::uno::Any >& lArguments)
+ : DocumentAcceleratorConfiguration_BASE(xContext)
{
- // SAFE -> ----------------------------------
WriteGuard aWriteLock(m_aLock);
css::uno::Reference<css::embed::XStorage> xRoot;
@@ -101,12 +132,17 @@ void SAL_CALL DocumentAcceleratorConfiguration::initialize(const css::uno::Seque
}
aWriteLock.unlock();
- // <- SAFE ----------------------------------
impl_ts_fillCache();
}
//-----------------------------------------------
+DocumentAcceleratorConfiguration::~DocumentAcceleratorConfiguration()
+{
+ m_aPresetHandler.removeStorageListener(this);
+}
+
+//-----------------------------------------------
void SAL_CALL DocumentAcceleratorConfiguration::setStorage(const css::uno::Reference< css::embed::XStorage >& xStorage)
throw(css::uno::RuntimeException)
{
@@ -185,4 +221,14 @@ void DocumentAcceleratorConfiguration::impl_ts_clearCache()
} // namespace framework
+extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
+com_sun_star_comp_framework_DocumentAcceleratorConfiguration_get_implementation(
+ css::uno::XComponentContext *context,
+ css::uno::Sequence<css::uno::Any> const &arguments)
+{
+ rtl::Reference<DocumentAcceleratorConfiguration> x(new DocumentAcceleratorConfiguration(context, arguments));
+ x->acquire();
+ return static_cast<cppu::OWeakObject *>(x.get());
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/inc/accelerators/documentacceleratorconfiguration.hxx b/framework/source/inc/accelerators/documentacceleratorconfiguration.hxx
deleted file mode 100644
index fdf4045..0000000
--- a/framework/source/inc/accelerators/documentacceleratorconfiguration.hxx
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- 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_FRAMEWORK_SOURCE_INC_ACCELERATORS_DOCUMENTACCELERATORCONFIGURATION_HXX
-#define INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_DOCUMENTACCELERATORCONFIGURATION_HXX
-
-#include <accelerators/acceleratorconfiguration.hxx>
-#include <accelerators/istoragelistener.hxx>
-#include <accelerators/presethandler.hxx>
-
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
-#include <macros/xserviceinfo.hxx>
-
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/ui/XUIConfigurationStorage.hpp>
-
-#include <cppuhelper/implbase2.hxx>
-// definition
-
-namespace framework
-{
-
-//__________________________________________
-/**
- implements a read/write access to a document
- based accelerator configuration.
- */
-
-typedef ::cppu::ImplInheritanceHelper2<
- XMLBasedAcceleratorConfiguration,
- css::lang::XServiceInfo,
- css::lang::XInitialization > DocumentAcceleratorConfiguration_BASE;
-
-class DocumentAcceleratorConfiguration : public DocumentAcceleratorConfiguration_BASE
-{
- //______________________________________
- // member
-
- private:
-
- //----------------------------------
- /** points to the root storage of the outside document,
- where we can read/save our configuration data. */
- css::uno::Reference< css::embed::XStorage > m_xDocumentRoot;
-
- //______________________________________
- // interface
-
- public:
-
- //----------------------------------
- /** initialize this instance and fill the internal cache.
-
- @param xSMGR
- reference to an uno service manager, which is used internaly.
- */
- DocumentAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext);
- virtual ~DocumentAcceleratorConfiguration();
-
- // XInterface, XTypeProvider, XServiceInfo
- DECLARE_XSERVICEINFO
-
- // XInitialization
- virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any >& lArguments)
- throw(css::uno::Exception ,
- css::uno::RuntimeException);
-
- // XUIConfigurationStorage
- virtual void SAL_CALL setStorage(const css::uno::Reference< css::embed::XStorage >& xStorage)
- throw(css::uno::RuntimeException);
-
- virtual sal_Bool SAL_CALL hasStorage()
- throw(css::uno::RuntimeException);
-
- //______________________________________
- // helper
-
- private:
-
- //----------------------------------
- /** read all data into the cache. */
- void impl_ts_fillCache();
-
- //----------------------------------
- /** forget all currently cached data AND(!)
- forget all currently used storages. */
- void impl_ts_clearCache();
-};
-
-} // namespace framework
-
-#endif // INCLUDED_FRAMEWORK_SOURCE_INC_ACCELERATORS_DOCUMENTACCELERATORCONFIGURATION_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index 69583ac..c86390a 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -41,7 +41,6 @@
#include <uiconfiguration/moduleuicfgsupplier.hxx>
#include <uifactory/menubarfactory.hxx>
#include <accelerators/moduleacceleratorconfiguration.hxx>
-#include <accelerators/documentacceleratorconfiguration.hxx>
#include <uifactory/toolboxfactory.hxx>
#include "uiconfiguration/windowstateconfiguration.hxx"
#include <services/autorecovery.hxx>
@@ -64,7 +63,6 @@ COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::ModuleUIConfigurationManagerSupplier ) else
IFFACTORY( ::framework::MenuBarFactory ) else
IFFACTORY( ::framework::ModuleAcceleratorConfiguration ) else
- IFFACTORY( ::framework::DocumentAcceleratorConfiguration ) else
IFFACTORY( ::framework::ToolBoxFactory ) else
IFFACTORY( ::framework::WindowStateConfiguration ) else
IFFACTORY( ::framework::ToolbarControllerFactory ) else
diff --git a/framework/util/fwk.component b/framework/util/fwk.component
index 388b2e39..765583a 100644
--- a/framework/util/fwk.component
+++ b/framework/util/fwk.component
@@ -36,7 +36,8 @@
<implementation name="com.sun.star.comp.framework.Desktop">
<service name="com.sun.star.frame.Desktop"/>
</implementation>
- <implementation name="com.sun.star.comp.framework.DocumentAcceleratorConfiguration">
+ <implementation name="com.sun.star.comp.framework.DocumentAcceleratorConfiguration"
+ constructor="com_sun_star_comp_framework_DocumentAcceleratorConfiguration_get_implementation">
<service name="com.sun.star.ui.DocumentAcceleratorConfiguration"/>
</implementation>
<implementation name="org.apache.openoffice.comp.framework.ContextChangeEventMultiplexer">
commit 72b5343bd16deec540d8cd148cd7aebd74e92c16
Author: Matúš Kukan <matus.kukan at collabora.com>
Date: Thu Jan 9 20:18:49 2014 +0100
fwk: Use constructor feature for ModuleUIConfigurationManager.
And avoid css::uno::XInitialization protocol.
diff --git a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx b/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
deleted file mode 100644
index aa17474..0000000
--- a/framework/inc/uiconfiguration/moduleuiconfigurationmanager.hxx
+++ /dev/null
@@ -1,203 +0,0 @@
-/* -*- 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_FRAMEWORK_INC_UICONFIGURATION_MODULEUICONFIGURATIONMANAGER_HXX
-#define INCLUDED_FRAMEWORK_INC_UICONFIGURATION_MODULEUICONFIGURATIONMANAGER_HXX
-
-
-/** Attention: stl headers must(!) be included at first. Otherwise it can make trouble
- with solaris headers ...
-*/
-#include <vector>
-#include <list>
-#include <boost/unordered_map.hpp>
-
-#include <accelerators/presethandler.hxx>
-#include <threadhelp/threadhelpbase.hxx>
-#include <macros/generic.hxx>
-#include <macros/xinterface.hxx>
-#include <macros/xtypeprovider.hxx>
-#include <macros/xserviceinfo.hxx>
-#include <stdtypes.h>
-#include <uiconfiguration/moduleimagemanager.hxx>
-
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/lang/XTypeProvider.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
-#include <com/sun/star/ui/XModuleUIConfigurationManager2.hpp>
-#include <com/sun/star/ui/UIElementType.hpp>
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/ui/ConfigurationEvent.hpp>
-#include <com/sun/star/embed/XTransactedObject.hpp>
-#include <com/sun/star/container/XIndexContainer.hpp>
-
-#include <cppuhelper/implbase4.hxx>
-#include <cppuhelper/interfacecontainer.hxx>
-#include <rtl/ustring.hxx>
-
-
-namespace framework
-{
- class ModuleUIConfigurationManager : private ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
- cppu::WeakImplHelper4<
- com::sun::star::lang::XServiceInfo,
- com::sun::star::lang::XComponent,
- com::sun::star::lang::XInitialization,
- com::sun::star::ui::XModuleUIConfigurationManager2 >
- {
- public:
- // XInterface, XTypeProvider, XServiceInfo
- DECLARE_XSERVICEINFO
-
- ModuleUIConfigurationManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xServiceManager );
- virtual ~ModuleUIConfigurationManager();
-
- // XComponent
- virtual void SAL_CALL dispose() throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw (::com::sun::star::uno::RuntimeException);
-
- // XInitialization
- virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
-
- // XUIConfiguration
- virtual void SAL_CALL addConfigurationListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeConfigurationListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener >& Listener ) throw (::com::sun::star::uno::RuntimeException);
-
- // XUIConfigurationManager
- virtual void SAL_CALL reset() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > > SAL_CALL getUIElementsInfo( sal_Int16 ElementType ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer > SAL_CALL createSettings( ) throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL hasSettings( const OUString& ResourceURL ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getSettings( const OUString& ResourceURL, sal_Bool bWriteable ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL replaceSettings( const OUString& ResourceURL, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& aNewData ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removeSettings( const OUString& ResourceURL ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL insertSettings( const OUString& NewResourceURL, const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess >& aNewData ) throw (::com::sun::star::container::ElementExistException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IllegalAccessException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getImageManager() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::ui::XAcceleratorConfiguration > SAL_CALL getShortCutManager() throw (::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getEventsManager() throw (::com::sun::star::uno::RuntimeException);
-
- // XModuleUIConfigurationManager
- virtual sal_Bool SAL_CALL isDefaultSettings( const OUString& ResourceURL ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getDefaultSettings( const OUString& ResourceURL ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
-
- // XUIConfigurationPersistence
- virtual void SAL_CALL reload() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL store() throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL storeToStorage( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& Storage ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isModified() throw (::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL isReadOnly() throw (::com::sun::star::uno::RuntimeException);
-
- private:
- // private data types
- enum Layer
- {
- LAYER_DEFAULT,
- LAYER_USERDEFINED,
- LAYER_COUNT
- };
-
- enum NotifyOp
- {
- NotifyOp_Remove,
- NotifyOp_Insert,
- NotifyOp_Replace
- };
-
- struct UIElementInfo
- {
- UIElementInfo( const OUString& rResourceURL, const OUString& rUIName ) :
- aResourceURL( rResourceURL), aUIName( rUIName ) {}
- OUString aResourceURL;
- OUString aUIName;
- };
-
- struct UIElementData
- {
- UIElementData() : bModified( false ), bDefault( true ), bDefaultNode( true ) {};
-
- OUString aResourceURL;
- OUString aName;
- bool bModified; // has been changed since last storing
- bool bDefault; // default settings
- bool bDefaultNode; // this is a default layer element data
- com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > xSettings;
- };
-
- struct UIElementType;
- friend struct UIElementType;
- typedef ::boost::unordered_map< OUString, UIElementData, OUStringHash, ::std::equal_to< OUString > > UIElementDataHashMap;
-
- struct UIElementType
- {
- UIElementType() : bModified( false ),
- bLoaded( false ),
- bDefaultLayer( false ),
- nElementType( ::com::sun::star::ui::UIElementType::UNKNOWN ) {}
-
-
- bool bModified;
- bool bLoaded;
- bool bDefaultLayer;
- sal_Int16 nElementType;
- UIElementDataHashMap aElementsHashMap;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage;
- };
-
- typedef ::std::vector< UIElementType > UIElementTypesVector;
- typedef ::std::vector< ::com::sun::star::ui::ConfigurationEvent > ConfigEventNotifyContainer;
- typedef ::boost::unordered_map< OUString, UIElementInfo, OUStringHash, ::std::equal_to< OUString > > UIElementInfoHashMap;
-
- // private methods
- void impl_Initialize();
- void implts_notifyContainerListener( const ::com::sun::star::ui::ConfigurationEvent& aEvent, NotifyOp eOp );
- void impl_fillSequenceWithElementTypeInfo( UIElementInfoHashMap& aUIElementInfoCollection, sal_Int16 nElementType );
- void impl_preloadUIElementTypeList( Layer eLayer, sal_Int16 nElementType );
- UIElementData* impl_findUIElementData( const OUString& aResourceURL, sal_Int16 nElementType, bool bLoad = true );
- void impl_requestUIElementData( sal_Int16 nElementType, Layer eLayer, UIElementData& aUIElementData );
- void impl_storeElementTypeData( com::sun::star::uno::Reference< com::sun::star::embed::XStorage > xStorage, UIElementType& rElementType, bool bResetModifyState = true );
- void impl_resetElementTypeData( UIElementType& rUserElementType, UIElementType& rDefaultElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer, ConfigEventNotifyContainer& rReplaceNotifyContainer );
- void impl_reloadElementTypeData( UIElementType& rUserElementType, UIElementType& rDefaultElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer, ConfigEventNotifyContainer& rReplaceNotifyContainer );
-
- UIElementTypesVector m_aUIElements[LAYER_COUNT];
- PresetHandler* m_pStorageHandler[::com::sun::star::ui::UIElementType::COUNT];
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xDefaultConfigStorage;
- com::sun::star::uno::Reference< com::sun::star::embed::XStorage > m_xUserConfigStorage;
- bool m_bReadOnly;
- bool m_bInitialized;
- bool m_bModified;
- bool m_bConfigRead;
- bool m_bDisposed;
- OUString m_aXMLPostfix;
- OUString m_aPropUIName;
- OUString m_aPropResourceURL;
- OUString m_aModuleIdentifier;
- OUString m_aModuleShortName;
- com::sun::star::uno::Reference< com::sun::star::embed::XTransactedObject > m_xUserRootCommit;
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
- ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
- com::sun::star::uno::Reference< com::sun::star::lang::XComponent > m_xModuleImageManager;
- com::sun::star::uno::Reference< com::sun::star::ui::XAcceleratorConfiguration > m_xModuleAcceleratorManager;
- };
-}
-
-#endif // INCLUDED_FRAMEWORK_INC_UICONFIGURATION_MODULEUICONFIGURATIONMANAGER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx
index 53efb71..69583ac 100644
--- a/framework/source/register/registerservices.cxx
+++ b/framework/source/register/registerservices.cxx
@@ -39,7 +39,6 @@
#include <uifactory/uicontrollerfactory.hxx>
#include <uielement/uicommanddescription.hxx>
#include <uiconfiguration/moduleuicfgsupplier.hxx>
-#include <uiconfiguration/moduleuiconfigurationmanager.hxx>
#include <uifactory/menubarfactory.hxx>
#include <accelerators/moduleacceleratorconfiguration.hxx>
#include <accelerators/documentacceleratorconfiguration.hxx>
@@ -63,7 +62,6 @@ COMPONENTGETFACTORY ( fwk,
IFFACTORY( ::framework::PopupMenuControllerFactory ) else
IFFACTORY( ::framework::UICommandDescription ) else
IFFACTORY( ::framework::ModuleUIConfigurationManagerSupplier ) else
- IFFACTORY( ::framework::ModuleUIConfigurationManager ) else
IFFACTORY( ::framework::MenuBarFactory ) else
IFFACTORY( ::framework::ModuleAcceleratorConfiguration ) else
IFFACTORY( ::framework::DocumentAcceleratorConfiguration ) else
diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
index f67b5c4..033085b 100644
--- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx
@@ -17,9 +17,11 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <uiconfiguration/moduleuiconfigurationmanager.hxx>
+#include <accelerators/presethandler.hxx>
+#include <uiconfiguration/moduleimagemanager.hxx>
+#include <threadhelp/threadhelpbase.hxx>
#include <threadhelp/resetableguard.hxx>
-#include <services.h>
+#include <stdtypes.h>
#include <uielement/constitemcontainer.hxx>
#include <uielement/rootitemcontainer.hxx>
#include <uielement/uielementtypenames.hxx>
@@ -31,20 +33,26 @@
#include <com/sun/star/ui/UIElementType.hpp>
#include <com/sun/star/ui/ConfigurationEvent.hpp>
#include <com/sun/star/ui/ModuleAcceleratorConfiguration.hpp>
+#include <com/sun/star/ui/XUIConfigurationPersistence.hpp>
+#include <com/sun/star/ui/XModuleUIConfigurationManager2.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/embed/ElementModes.hpp>
+#include <com/sun/star/embed/XTransactedObject.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/io/XStream.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/interfacecontainer.hxx>
+#include <cppuhelper/supportsservice.hxx>
#include <vcl/svapp.hxx>
+#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
#include <comphelper/sequenceashashmap.hxx>
-//_________________________________________________________________________________________________________________
-// namespaces
-//_________________________________________________________________________________________________________________
-
using namespace com::sun::star::uno;
using namespace com::sun::star::io;
using namespace com::sun::star::embed;
@@ -52,22 +60,166 @@ using namespace com::sun::star::lang;
using namespace com::sun::star::container;
using namespace com::sun::star::beans;
using namespace ::com::sun::star::ui;
+using namespace framework;
+
+namespace {
-namespace framework
+class ModuleUIConfigurationManager : private ThreadHelpBase, // Struct for right initalization of mutex member! Must be first of baseclasses.
+ public cppu::WeakImplHelper3<
+ css::lang::XServiceInfo,
+ css::lang::XComponent,
+ css::ui::XModuleUIConfigurationManager2 >
{
+public:
+ ModuleUIConfigurationManager(
+ const css::uno::Reference< css::uno::XComponentContext >& xServiceManager,
+ const css::uno::Sequence< css::uno::Any >& aArguments );
+
+ virtual ~ModuleUIConfigurationManager();
+
+ virtual OUString SAL_CALL getImplementationName()
+ throw (css::uno::RuntimeException)
+ {
+ return OUString("com.sun.star.comp.framework.ModuleUIConfigurationManager");
+ }
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName)
+ throw (css::uno::RuntimeException)
+ {
+ return cppu::supportsService(this, ServiceName);
+ }
-//*****************************************************************************************************************
-// XInterface, XTypeProvider, XServiceInfo
-//*****************************************************************************************************************
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames()
+ throw (css::uno::RuntimeException)
+ {
+ css::uno::Sequence< OUString > aSeq(1);
+ aSeq[0] = OUString("com.sun.star.ui.ModuleUIConfigurationManager");
+ return aSeq;
+ }
-DEFINE_XSERVICEINFO_MULTISERVICE_2 ( ModuleUIConfigurationManager ,
- ::cppu::OWeakObject ,
- "com.sun.star.ui.ModuleUIConfigurationManager" ,
- OUString("com.sun.star.comp.framework.ModuleUIConfigurationManager")
- )
+ // XComponent
+ virtual void SAL_CALL dispose() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL addEventListener( const css::uno::Reference< css::lang::XEventListener >& xListener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeEventListener( const css::uno::Reference< css::lang::XEventListener >& aListener ) throw (css::uno::RuntimeException);
+
+ // XUIConfiguration
+ virtual void SAL_CALL addConfigurationListener( const css::uno::Reference< css::ui::XUIConfigurationListener >& Listener ) throw (css::uno::RuntimeException);
+ virtual void SAL_CALL removeConfigurationListener( const css::uno::Reference< css::ui::XUIConfigurationListener >& Listener ) throw (css::uno::RuntimeException);
+
+ // XUIConfigurationManager
+ virtual void SAL_CALL reset() throw (css::uno::RuntimeException);
+ virtual css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > > SAL_CALL getUIElementsInfo( sal_Int16 ElementType ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XIndexContainer > SAL_CALL createSettings( ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasSettings( const OUString& ResourceURL ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getSettings( const OUString& ResourceURL, sal_Bool bWriteable ) throw (css::container::NoSuchElementException, css::lang::IllegalArgumentException, css::uno::RuntimeException);
+ virtual void SAL_CALL replaceSettings( const OUString& ResourceURL, const css::uno::Reference< css::container::XIndexAccess >& aNewData ) throw (css::container::NoSuchElementException, css::lang::IllegalArgumentException, css::lang::IllegalAccessException, css::uno::RuntimeException);
+ virtual void SAL_CALL removeSettings( const OUString& ResourceURL ) throw (css::container::NoSuchElementException, css::lang::IllegalArgumentException, css::lang::IllegalAccessException, css::uno::RuntimeException);
+ virtual void SAL_CALL insertSettings( const OUString& NewResourceURL, const css::uno::Reference< css::container::XIndexAccess >& aNewData ) throw (css::container::ElementExistException, css::lang::IllegalArgumentException, css::lang::IllegalAccessException, css::uno::RuntimeException);
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getImageManager() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::ui::XAcceleratorConfiguration > SAL_CALL getShortCutManager() throw (css::uno::RuntimeException);
+ virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getEventsManager() throw (css::uno::RuntimeException);
+
+ // XModuleUIConfigurationManager
+ virtual sal_Bool SAL_CALL isDefaultSettings( const OUString& ResourceURL ) throw (css::lang::IllegalArgumentException, css::uno::RuntimeException);
+ virtual css::uno::Reference< css::container::XIndexAccess > SAL_CALL getDefaultSettings( const OUString& ResourceURL ) throw (css::container::NoSuchElementException, css::lang::IllegalArgumentException, css::uno::RuntimeException);
+
+ // XUIConfigurationPersistence
+ virtual void SAL_CALL reload() throw (css::uno::Exception, css::uno::RuntimeException);
+ virtual void SAL_CALL store() throw (css::uno::Exception, css::uno::RuntimeException);
+ virtual void SAL_CALL storeToStorage( const css::uno::Reference< css::embed::XStorage >& Storage ) throw (css::uno::Exception, css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isModified() throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isReadOnly() throw (css::uno::RuntimeException);
+
+private:
+ // private data types
+ enum Layer
+ {
+ LAYER_DEFAULT,
+ LAYER_USERDEFINED,
+ LAYER_COUNT
+ };
+
+ enum NotifyOp
+ {
+ NotifyOp_Remove,
+ NotifyOp_Insert,
+ NotifyOp_Replace
+ };
+
+ struct UIElementInfo
+ {
+ UIElementInfo( const OUString& rResourceURL, const OUString& rUIName ) :
+ aResourceURL( rResourceURL), aUIName( rUIName ) {}
+ OUString aResourceURL;
+ OUString aUIName;
+ };
+
+ struct UIElementData
+ {
+ UIElementData() : bModified( false ), bDefault( true ), bDefaultNode( true ) {};
-DEFINE_INIT_SERVICE ( ModuleUIConfigurationManager, {} )
+ OUString aResourceURL;
+ OUString aName;
+ bool bModified; // has been changed since last storing
+ bool bDefault; // default settings
+ bool bDefaultNode; // this is a default layer element data
+ css::uno::Reference< css::container::XIndexAccess > xSettings;
+ };
+ struct UIElementType;
+ friend struct UIElementType;
+ typedef ::boost::unordered_map< OUString, UIElementData, OUStringHash, ::std::equal_to< OUString > > UIElementDataHashMap;
+
+ struct UIElementType
+ {
+ UIElementType() : bModified( false ),
+ bLoaded( false ),
+ bDefaultLayer( false ),
+ nElementType( css::ui::UIElementType::UNKNOWN ) {}
+
+
+ bool bModified;
+ bool bLoaded;
+ bool bDefaultLayer;
+ sal_Int16 nElementType;
+ UIElementDataHashMap aElementsHashMap;
+ css::uno::Reference< css::embed::XStorage > xStorage;
+ };
+
+ typedef ::std::vector< UIElementType > UIElementTypesVector;
+ typedef ::std::vector< css::ui::ConfigurationEvent > ConfigEventNotifyContainer;
+ typedef ::boost::unordered_map< OUString, UIElementInfo, OUStringHash, ::std::equal_to< OUString > > UIElementInfoHashMap;
+
+ // private methods
+ void impl_Initialize();
+ void implts_notifyContainerListener( const css::ui::ConfigurationEvent& aEvent, NotifyOp eOp );
+ void impl_fillSequenceWithElementTypeInfo( UIElementInfoHashMap& aUIElementInfoCollection, sal_Int16 nElementType );
+ void impl_preloadUIElementTypeList( Layer eLayer, sal_Int16 nElementType );
+ UIElementData* impl_findUIElementData( const OUString& aResourceURL, sal_Int16 nElementType, bool bLoad = true );
+ void impl_requestUIElementData( sal_Int16 nElementType, Layer eLayer, UIElementData& aUIElementData );
+ void impl_storeElementTypeData( css::uno::Reference< css::embed::XStorage > xStorage, UIElementType& rElementType, bool bResetModifyState = true );
+ void impl_resetElementTypeData( UIElementType& rUserElementType, UIElementType& rDefaultElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer, ConfigEventNotifyContainer& rReplaceNotifyContainer );
+ void impl_reloadElementTypeData( UIElementType& rUserElementType, UIElementType& rDefaultElementType, ConfigEventNotifyContainer& rRemoveNotifyContainer, ConfigEventNotifyContainer& rReplaceNotifyContainer );
+
+ UIElementTypesVector m_aUIElements[LAYER_COUNT];
+ PresetHandler* m_pStorageHandler[css::ui::UIElementType::COUNT];
+ css::uno::Reference< css::embed::XStorage > m_xDefaultConfigStorage;
+ css::uno::Reference< css::embed::XStorage > m_xUserConfigStorage;
+ bool m_bReadOnly;
+ bool m_bModified;
+ bool m_bConfigRead;
+ bool m_bDisposed;
+ OUString m_aXMLPostfix;
+ OUString m_aPropUIName;
+ OUString m_aPropResourceURL;
+ OUString m_aModuleIdentifier;
+ OUString m_aModuleShortName;
+ css::uno::Reference< css::embed::XTransactedObject > m_xUserRootCommit;
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; /// container for ALL Listener
+ css::uno::Reference< css::lang::XComponent > m_xModuleImageManager;
+ css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModuleAcceleratorManager;
+};
// important: The order and position of the elements must match the constant
// definition of "::com::sun::star::ui::UIElementType"
@@ -694,12 +846,13 @@ void ModuleUIConfigurationManager::impl_Initialize()
}
}
-ModuleUIConfigurationManager::ModuleUIConfigurationManager( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& xContext ) :
- ThreadHelpBase( &Application::GetSolarMutex() )
+ModuleUIConfigurationManager::ModuleUIConfigurationManager(
+ const Reference< XComponentContext >& xContext,
+ const Sequence< Any >& aArguments )
+ : ThreadHelpBase( &Application::GetSolarMutex() )
, m_xDefaultConfigStorage( 0 )
, m_xUserConfigStorage( 0 )
, m_bReadOnly( true )
- , m_bInitialized( false )
, m_bModified( false )
, m_bConfigRead( false )
, m_bDisposed( false )
@@ -716,6 +869,60 @@ ModuleUIConfigurationManager::ModuleUIConfigurationManager( const com::sun::star
// The following code depends on this!
m_aUIElements[LAYER_DEFAULT].resize( ::com::sun::star::ui::UIElementType::COUNT );
m_aUIElements[LAYER_USERDEFINED].resize( ::com::sun::star::ui::UIElementType::COUNT );
+
+ ResetableGuard aLock( m_aLock );
+
+ if( aArguments.getLength() == 2 && (aArguments[0] >>= m_aModuleShortName) && (aArguments[1] >>= m_aModuleIdentifier))
+ {
+ }
+ else
+ {
+ ::comphelper::SequenceAsHashMap lArgs(aArguments);
+ m_aModuleShortName = lArgs.getUnpackedValueOrDefault("ModuleShortName", OUString());
+ m_aModuleIdentifier = lArgs.getUnpackedValueOrDefault("ModuleIdentifier", OUString());
+ }
+
+ for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
+ {
+ OUString aResourceType;
+ if ( i == ::com::sun::star::ui::UIElementType::MENUBAR )
+ aResourceType = PresetHandler::RESOURCETYPE_MENUBAR();
+ else if ( i == ::com::sun::star::ui::UIElementType::TOOLBAR )
+ aResourceType = PresetHandler::RESOURCETYPE_TOOLBAR();
+ else if ( i == ::com::sun::star::ui::UIElementType::STATUSBAR )
+ aResourceType = PresetHandler::RESOURCETYPE_STATUSBAR();
+
+ if ( !aResourceType.isEmpty() )
+ {
+ m_pStorageHandler[i] = new PresetHandler( m_xContext );
+ m_pStorageHandler[i]->connectToResource( PresetHandler::E_MODULES,
+ aResourceType, // this path wont be used later ... seee next lines!
+ m_aModuleShortName,
+ css::uno::Reference< css::embed::XStorage >()); // no document root used here!
+ }
+ }
+
+ // initialize root storages for all resource types
+ m_xUserRootCommit = css::uno::Reference< css::embed::XTransactedObject >(
+ m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getOrCreateRootStorageUser(), css::uno::UNO_QUERY); // can be empty
+ m_xDefaultConfigStorage = m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getParentStorageShare(
+ m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getWorkingStorageShare());
+ m_xUserConfigStorage = m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getParentStorageUser(
+ m_pStorageHandler[::com::sun::star::ui::UIElementType::MENUBAR]->getWorkingStorageUser());
+
+ if ( m_xUserConfigStorage.is() )
+ {
+ Reference< XPropertySet > xPropSet( m_xUserConfigStorage, UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ long nOpenMode = 0;
+ Any a = xPropSet->getPropertyValue("OpenMode");
+ if ( a >>= nOpenMode )
+ m_bReadOnly = !( nOpenMode & ElementModes::WRITE );
+ }
+ }
+
+ impl_Initialize();
}
ModuleUIConfigurationManager::~ModuleUIConfigurationManager()
@@ -780,71 +987,6 @@ void SAL_CALL ModuleUIConfigurationManager::removeEventListener( const Reference
m_aListenerContainer.removeInterface( ::getCppuType( ( const Reference< XEventListener >* ) NULL ), xListener );
}
-// XInitialization
-void SAL_CALL ModuleUIConfigurationManager::initialize( const Sequence< Any >& aArguments ) throw ( Exception, RuntimeException )
-{
- ResetableGuard aLock( m_aLock );
-
- if( m_bInitialized )
- {
- return;
- }
-
- if( aArguments.getLength() == 2 && (aArguments[0] >>= m_aModuleShortName) && (aArguments[1] >>= m_aModuleIdentifier))
- {
- }
- else
- {
- ::comphelper::SequenceAsHashMap lArgs(aArguments);
- m_aModuleShortName = lArgs.getUnpackedValueOrDefault("ModuleShortName", OUString());
- m_aModuleIdentifier = lArgs.getUnpackedValueOrDefault("ModuleIdentifier", OUString());
- }
-
- for ( int i = 1; i < ::com::sun::star::ui::UIElementType::COUNT; i++ )
- {
- OUString aResourceType;
- if ( i == ::com::sun::star::ui::UIElementType::MENUBAR )
- aResourceType = PresetHandler::RESOURCETYPE_MENUBAR();
- else if ( i == ::com::sun::star::ui::UIElementType::TOOLBAR )
- aResourceType = PresetHandler::RESOURCETYPE_TOOLBAR();
- else if ( i == ::com::sun::star::ui::UIElementType::STATUSBAR )
- aResourceType = PresetHandler::RESOURCETYPE_STATUSBAR();
-
- if ( !aResourceType.isEmpty() )
- {
- m_pStorageHandler[i] = new PresetHandler( m_xContext );
- m_pStorageHandler[i]->connectToResource( PresetHandler::E_MODULES,
- aResourceType, // this path wont be used later ... seee next lines!
- m_aModuleShortName,
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list