summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2013-04-02 23:52:27 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-04-05 08:35:33 +0000
commit55664c9bd2469d3e493e6f1b67fbb2f96500d492 (patch)
tree43e97768980a42c01a9483f2382d9d7e6c302c7a
parentaeb7683ae745717fe5e283b6ada065183aa730f4 (diff)
unotools: remove some unused items
Change-Id: I95bcac6a3ff8cf4644c9d1596c75cac2d9cd94fe Reviewed-on: https://gerrit.libreoffice.org/3191 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Notes
API CHANGE.
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/Common.xcs15
-rw-r--r--sfx2/source/appl/app.cxx1
-rw-r--r--unotools/Library_utl.mk2
-rw-r--r--unotools/Package_inc.mk2
-rw-r--r--unotools/inc/unotools/accelcfg.hxx65
-rw-r--r--unotools/inc/unotools/itemholderbase.hxx9
-rw-r--r--unotools/inc/unotools/workingsetoptions.hxx122
-rw-r--r--unotools/inc/unotools/xmlaccelcfg.hxx11
-rw-r--r--unotools/source/config/accelcfg.cxx202
-rw-r--r--unotools/source/config/itemholder1.cxx18
-rw-r--r--unotools/source/config/workingsetoptions.cxx304
11 files changed, 11 insertions, 740 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
index 66e353c91dcc..f819ebee90c3 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs
@@ -3694,21 +3694,6 @@
3694 </group> 3694 </group>
3695 </group> 3695 </group>
3696 </group> 3696 </group>
3697 <group oor:name="WorkingSet">
3698 <info>
3699 <deprecated/>
3700 <desc>Lists open documents or windows.</desc>
3701 </info>
3702 <prop oor:name="WindowList" oor:type="oor:string-list">
3703 <!-- OldPath: SavedWorkingSet -->
3704 <!-- OldLocation: soffice.ini -->
3705 <!-- UIHints: Tools Options - General Save -->
3706 <info>
3707 <deprecated/>
3708 <desc>Lists open documents or windows.</desc>
3709 </info>
3710 </prop>
3711 </group>
3712 <group oor:name="AddXMLToStorage"> 3697 <group oor:name="AddXMLToStorage">
3713 <info> 3698 <info>
3714 <desc>Contains settings specifying if a XML package is added to the 3699 <desc>Contains settings specifying if a XML package is added to the
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 479f9d4479a3..3b31dbdad56f 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -113,7 +113,6 @@
113#include <unotools/securityoptions.hxx> 113#include <unotools/securityoptions.hxx>
114#include <unotools/localisationoptions.hxx> 114#include <unotools/localisationoptions.hxx>
115#include <unotools/fontoptions.hxx> 115#include <unotools/fontoptions.hxx>
116#include <unotools/workingsetoptions.hxx>
117#include <unotools/syslocaleoptions.hxx> 116#include <unotools/syslocaleoptions.hxx>
118#include <unotools/syslocale.hxx> 117#include <unotools/syslocale.hxx>
119#include <framework/addonsoptions.hxx> 118#include <framework/addonsoptions.hxx>
diff --git a/unotools/Library_utl.mk b/unotools/Library_utl.mk
index d99c18bc562b..dcef7a82155a 100644
--- a/unotools/Library_utl.mk
+++ b/unotools/Library_utl.mk
@@ -71,7 +71,6 @@ $(eval $(call gb_Library_use_libraries,utl,\
71$(eval $(call gb_Library_add_exception_objects,utl,\ 71$(eval $(call gb_Library_add_exception_objects,utl,\
72 unotools/source/accessibility/accessiblerelationsethelper \ 72 unotools/source/accessibility/accessiblerelationsethelper \
73 unotools/source/accessibility/accessiblestatesethelper \ 73 unotools/source/accessibility/accessiblestatesethelper \
74 unotools/source/config/accelcfg \
75 unotools/source/config/bootstrap \ 74 unotools/source/config/bootstrap \
76 unotools/source/config/cmdoptions \ 75 unotools/source/config/cmdoptions \
77 unotools/source/config/compatibility \ 76 unotools/source/config/compatibility \
@@ -104,7 +103,6 @@ $(eval $(call gb_Library_add_exception_objects,utl,\
104 unotools/source/config/syslocaleoptions \ 103 unotools/source/config/syslocaleoptions \
105 unotools/source/config/useroptions \ 104 unotools/source/config/useroptions \
106 unotools/source/config/viewoptions \ 105 unotools/source/config/viewoptions \
107 unotools/source/config/workingsetoptions \
108 unotools/source/config/xmlaccelcfg \ 106 unotools/source/config/xmlaccelcfg \
109 unotools/source/i18n/calendarwrapper \ 107 unotools/source/i18n/calendarwrapper \
110 unotools/source/i18n/caserotate \ 108 unotools/source/i18n/caserotate \
diff --git a/unotools/Package_inc.mk b/unotools/Package_inc.mk
index 92ec12ea1cd3..1a47ec10f902 100644
--- a/unotools/Package_inc.mk
+++ b/unotools/Package_inc.mk
@@ -27,7 +27,6 @@
27 27
28$(eval $(call gb_Package_Package,unotools_inc,$(SRCDIR)/unotools/inc)) 28$(eval $(call gb_Package_Package,unotools_inc,$(SRCDIR)/unotools/inc))
29 29
30$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accelcfg.hxx,unotools/accelcfg.hxx))
31$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accessiblerelationsethelper.hxx,unotools/accessiblerelationsethelper.hxx)) 30$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accessiblerelationsethelper.hxx,unotools/accessiblerelationsethelper.hxx))
32$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accessiblestatesethelper.hxx,unotools/accessiblestatesethelper.hxx)) 31$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accessiblestatesethelper.hxx,unotools/accessiblestatesethelper.hxx))
33$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/atom.hxx,unotools/atom.hxx)) 32$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/atom.hxx,unotools/atom.hxx))
@@ -96,7 +95,6 @@ $(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/ucbstreamhelper.hxx,
96$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/unotoolsdllapi.h,unotools/unotoolsdllapi.h)) 95$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/unotoolsdllapi.h,unotools/unotoolsdllapi.h))
97$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/useroptions.hxx,unotools/useroptions.hxx)) 96$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/useroptions.hxx,unotools/useroptions.hxx))
98$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/viewoptions.hxx,unotools/viewoptions.hxx)) 97$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/viewoptions.hxx,unotools/viewoptions.hxx))
99$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/workingsetoptions.hxx,unotools/workingsetoptions.hxx))
100$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/xmlaccelcfg.hxx,unotools/xmlaccelcfg.hxx)) 98$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/xmlaccelcfg.hxx,unotools/xmlaccelcfg.hxx))
101 99
102# vim: set noet sw=4 ts=4: 100# vim: set noet sw=4 ts=4:
diff --git a/unotools/inc/unotools/accelcfg.hxx b/unotools/inc/unotools/accelcfg.hxx
deleted file mode 100644
index c60a4f09de83..000000000000
--- a/unotools/inc/unotools/accelcfg.hxx
+++ /dev/null
@@ -1,65 +0,0 @@
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_unotools_ACCELCFG_HXX
20#define INCLUDED_unotools_ACCELCFG_HXX
21
22#include <com/sun/star/awt/KeyEvent.hpp>
23#include <unotools/options.hxx>
24
25#include <rtl/ustring.hxx>
26#include <tools/stream.hxx>
27
28struct SvtAcceleratorConfigItem
29{
30 sal_uInt16 nCode;
31 sal_uInt16 nModifier;
32 OUString aCommand;
33};
34
35#include <list>
36typedef ::std::list < SvtAcceleratorConfigItem > SvtAcceleratorItemList;
37
38class SvStream;
39class KeyEvent;
40class String;
41class SvtAcceleratorConfig_Impl;
42
43class SvtAcceleratorConfiguration: public utl::detail::Options
44{
45 SvtAcceleratorConfig_Impl* pImp;
46
47private:
48
49public:
50 // get the global accelerators
51 SvtAcceleratorConfiguration();
52
53 // get special accelerators
54 static String GetStreamName();
55 static SvStream* GetDefaultStream( StreamMode );
56
57 virtual ~SvtAcceleratorConfiguration();
58
59 // save the configuration to a stream, f.e. into a document
60 bool Commit( SvStream& rStream );
61};
62
63#endif
64
65/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/itemholderbase.hxx b/unotools/inc/unotools/itemholderbase.hxx
index 2efc282284f4..831cba4a4a72 100644
--- a/unotools/inc/unotools/itemholderbase.hxx
+++ b/unotools/inc/unotools/itemholderbase.hxx
@@ -33,7 +33,6 @@ struct ItemHolderMutexBase
33 33
34enum EItem 34enum EItem
35{ 35{
36 E_ACCELCFG , //
37 E_ACCESSIBILITYOPTIONS , // 2 36 E_ACCESSIBILITYOPTIONS , // 2
38 E_ADDXMLTOSTORAGEOPTIONS , // 37 E_ADDXMLTOSTORAGEOPTIONS , //
39 E_APEARCFG , // 2 38 E_APEARCFG , // 2
@@ -57,8 +56,6 @@ enum EItem
57 E_HELPOPTIONS , // 2 56 E_HELPOPTIONS , // 2
58 E_HISTORYOPTIONS , // 57 E_HISTORYOPTIONS , //
59 58
60 E_JAVAOPTIONS , //
61
62 E_LANGUAGEOPTIONS , // 2 59 E_LANGUAGEOPTIONS , // 2
63 E_LINGUCFG , // 60 E_LINGUCFG , //
64 E_LOCALISATIONOPTIONS , // 61 E_LOCALISATIONOPTIONS , //
@@ -87,11 +84,7 @@ enum EItem
87 E_VIEWOPTIONS_DIALOG , // 84 E_VIEWOPTIONS_DIALOG , //
88 E_VIEWOPTIONS_TABDIALOG , // 85 E_VIEWOPTIONS_TABDIALOG , //
89 E_VIEWOPTIONS_TABPAGE , // 86 E_VIEWOPTIONS_TABPAGE , //
90 E_VIEWOPTIONS_WINDOW , // 87 E_VIEWOPTIONS_WINDOW //
91
92 E_WORKINGSETOPTIONS , //
93
94 E_XMLACCELCFG //
95}; 88};
96 89
97struct TItemInfo 90struct TItemInfo
diff --git a/unotools/inc/unotools/workingsetoptions.hxx b/unotools/inc/unotools/workingsetoptions.hxx
deleted file mode 100644
index c351da83f3ec..000000000000
--- a/unotools/inc/unotools/workingsetoptions.hxx
+++ /dev/null
@@ -1,122 +0,0 @@
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_unotools_WORKINGSETOPTIONS_HXX
20#define INCLUDED_unotools_WORKINGSETOPTIONS_HXX
21
22#include <sal/types.h>
23#include <osl/mutex.hxx>
24#include <com/sun/star/uno/Sequence.h>
25#include <rtl/ustring.hxx>
26#include <unotools/options.hxx>
27
28//_________________________________________________________________________________________________________________
29// forward declarations
30//_________________________________________________________________________________________________________________
31
32/*-************************************************************************************************************//**
33 @short forward declaration to our private date container implementation
34 @descr We use these class as internal member to support small memory requirements.
35 You can create the container if it is neccessary. The class which use these mechanism
36 is faster and smaller then a complete implementation!
37*//*-*************************************************************************************************************/
38
39class SvtWorkingSetOptions_Impl;
40
41/*-************************************************************************************************************//**
42 @short collect information about security features
43 @descr -
44
45 @implements -
46 @base -
47
48 @devstatus ready to use
49*//*-*************************************************************************************************************/
50
51class SAL_WARN_UNUSED SvtWorkingSetOptions : public utl::detail::Options
52{
53 //-------------------------------------------------------------------------------------------------------------
54 // public methods
55 //-------------------------------------------------------------------------------------------------------------
56
57 public:
58
59 //---------------------------------------------------------------------------------------------------------
60 // constructor / destructor
61 //---------------------------------------------------------------------------------------------------------
62
63 /*-****************************************************************************************************//**
64 @short standard constructor and destructor
65 @descr This will initialize an instance with default values.
66 We implement these class with a refcount mechanism! Every instance of this class increase it
67 at create and decrease it at delete time - but all instances use the same data container!
68 He is implemented as a static member ...
69
70 @seealso member m_nRefCount
71 @seealso member m_pDataContainer
72
73 @param -
74 @return -
75
76 @onerror -
77 *//*-*****************************************************************************************************/
78
79 SvtWorkingSetOptions();
80 virtual ~SvtWorkingSetOptions();
81
82 //-------------------------------------------------------------------------------------------------------------
83 // private methods
84 //-------------------------------------------------------------------------------------------------------------
85
86 /*-****************************************************************************************************//**
87 @short return a reference to a static mutex
88 @descr These class use his own static mutex to be threadsafe.
89 We create a static mutex only for one ime and use at different times.
90
91 @seealso -
92
93 @param -
94 @return A reference to a static mutex member.
95
96 @onerror -
97 *//*-*****************************************************************************************************/
98
99 static ::osl::Mutex& GetOwnStaticMutex();
100
101 //-------------------------------------------------------------------------------------------------------------
102 // private member
103 //-------------------------------------------------------------------------------------------------------------
104
105 private:
106
107 /*Attention
108
109 Don't initialize these static member in these header!
110 a) Double dfined symbols will be detected ...
111 b) and unresolved externals exist at linking time.
112 Do it in your source only.
113 */
114
115 static SvtWorkingSetOptions_Impl* m_pDataContainer ; /// impl. data container as dynamic pointer for smaller memory requirements!
116 static sal_Int32 m_nRefCount ; /// internal ref count mechanism
117
118}; // class SvtWorkingSetOptions
119
120#endif // #ifndef INCLUDED_unotools_WORKINGSETOPTIONS_HXX
121
122/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/xmlaccelcfg.hxx b/unotools/inc/unotools/xmlaccelcfg.hxx
index 8e2c6982e705..48417b2a229a 100644
--- a/unotools/inc/unotools/xmlaccelcfg.hxx
+++ b/unotools/inc/unotools/xmlaccelcfg.hxx
@@ -23,7 +23,16 @@
23#include <com/sun/star/xml/sax/XDocumentHandler.hpp> 23#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
24#include <cppuhelper/weak.hxx> 24#include <cppuhelper/weak.hxx>
25 25
26#include <unotools/accelcfg.hxx> 26struct SvtAcceleratorConfigItem
27{
28 sal_uInt16 nCode;
29 sal_uInt16 nModifier;
30 OUString aCommand;
31};
32
33#include <list>
34typedef ::std::list < SvtAcceleratorConfigItem > SvtAcceleratorItemList;
35
27 36
28class OReadAccelatorDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler, 37class OReadAccelatorDocumentHandler : public ::com::sun::star::xml::sax::XDocumentHandler,
29 public ::cppu::OWeakObject 38 public ::cppu::OWeakObject
diff --git a/unotools/source/config/accelcfg.cxx b/unotools/source/config/accelcfg.cxx
deleted file mode 100644
index 9c48b7f5e06e..000000000000
--- a/unotools/source/config/accelcfg.cxx
+++ /dev/null
@@ -1,202 +0,0 @@
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21#include "rtl/instance.hxx"
22#include <com/sun/star/uno/Any.hxx>
23#include <com/sun/star/uno/Sequence.hxx>
24#include <com/sun/star/io/XActiveDataSource.hpp>
25#include <com/sun/star/io/XInputStream.hpp>
26#include <com/sun/star/io/XOutputStream.hpp>
27#include <com/sun/star/xml/sax/Parser.hpp>
28#include <com/sun/star/xml/sax/Writer.hpp>
29#include <unotools/configmgr.hxx>
30#include <unotools/configitem.hxx>
31
32#include <osl/mutex.hxx>
33#include <tools/string.hxx>
34#include <tools/urlobj.hxx>
35#include <unotools/streamwrap.hxx>
36#include <unotools/ucbstreamhelper.hxx>
37#include <comphelper/processfactory.hxx>
38
39#include <unotools/accelcfg.hxx>
40#include <unotools/xmlaccelcfg.hxx>
41#include <unotools/pathoptions.hxx>
42#include "itemholder1.hxx"
43
44
45using namespace utl;
46using namespace com::sun::star::uno;
47using namespace com::sun::star::io;
48using namespace com::sun::star::xml::sax;
49
50using ::rtl::OUString;
51
52
53static SvtAcceleratorConfig_Impl* pOptions = NULL;
54static sal_Int32 nRefCount = 0;
55
56class SvtAcceleratorConfig_Impl
57{
58public:
59
60 SvtAcceleratorItemList aList;
61 bool bModified;
62
63 SvtAcceleratorConfig_Impl()
64 : bModified( sal_False )
65 {}
66
67 SvtAcceleratorConfig_Impl( Reference< XInputStream >& xInputStream );
68 bool Commit( Reference< XOutputStream >& xOutputStream );
69};
70
71// -----------------------------------------------------------------------
72
73SvtAcceleratorConfig_Impl::SvtAcceleratorConfig_Impl( Reference< XInputStream >& rInputStream )
74 : bModified( false )
75{
76 Reference< XParser > xParser = Parser::create( ::comphelper::getProcessComponentContext() );
77
78 // connect stream to input stream to the parser
79 InputSource aInputSource;
80 aInputSource.aInputStream = rInputStream;
81
82 // get filter
83 Reference< XDocumentHandler > xFilter( new OReadAccelatorDocumentHandler( aList ));
84
85 // connect parser and filter
86 xParser->setDocumentHandler( xFilter );
87 xParser->parseStream( aInputSource );
88}
89
90bool SvtAcceleratorConfig_Impl::Commit( Reference< XOutputStream >& rOutputStream )
91{
92 Reference< XWriter > xWriter = Writer::create( ::comphelper::getProcessComponentContext() );
93
94 xWriter->setOutputStream( rOutputStream );
95 try
96 {
97 OWriteAccelatorDocumentHandler aWriteHandler( aList, Reference<XDocumentHandler>(xWriter, UNO_QUERY_THROW) );
98 aWriteHandler.WriteAcceleratorDocument();
99 rOutputStream->flush();
100 return true;
101 }
102 catch ( RuntimeException& )
103 {
104 }
105 catch ( SAXException& )
106 {
107 }
108 catch ( ::com::sun::star::io::IOException& )
109 {
110 }
111
112 return false;
113}
114
115namespace
116{
117 class LocalSingleton : public rtl::Static< osl::Mutex, LocalSingleton >
118 {
119 };
120}
121
122SvtAcceleratorConfiguration::SvtAcceleratorConfiguration()
123{
124 // Global access, must be guarded (multithreading)
125 ::osl::MutexGuard aGuard( LocalSingleton::get() );
126 if ( !pOptions )
127 {
128 SvStream* pStream = GetDefaultStream( STREAM_STD_READ );
129 ::utl::OInputStreamWrapper aHelper( *pStream );
130 com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xOut( &aHelper );
131
132 try
133 {
134 pOptions = new SvtAcceleratorConfig_Impl( xOut );
135 }
136 catch ( RuntimeException& )
137 {
138 pOptions = new SvtAcceleratorConfig_Impl();
139 }
140 catch( SAXException& )
141 {
142 pOptions = new SvtAcceleratorConfig_Impl();
143 }
144 catch( ::com::sun::star::io::IOException& )
145 {
146 pOptions = new SvtAcceleratorConfig_Impl();
147 }
148
149 if (pOptions)
150 ItemHolder1::holdConfigItem(E_ACCELCFG);
151
152 delete pStream;
153 }
154
155 ++nRefCount;
156 pImp = pOptions;
157}
158
159// -----------------------------------------------------------------------
160
161SvtAcceleratorConfiguration::~SvtAcceleratorConfiguration()
162{
163 if ( pImp == pOptions )
164 {
165 // Global access, must be guarded (multithreading)
166 ::osl::MutexGuard aGuard( LocalSingleton::get() );
167 if ( !--nRefCount )
168 {
169 if ( pImp->bModified )
170 {
171 String aUserConfig = SvtPathOptions().GetUserConfigPath();
172 INetURLObject aObj( aUserConfig );
173 aObj.insertName( rtl::OUString("GlobalKeyBindings.xml") );
174 SvStream* pStream = ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), STREAM_STD_READWRITE|STREAM_TRUNC );
175 com::sun::star::uno::Reference < ::com::sun::star::io::XOutputStream > xOut( new utl::OOutputStreamWrapper( *pStream ) );
176 pImp->Commit( xOut );
177 delete pStream;
178 }
179
180 DELETEZ( pOptions );
181 }
182 }
183 else
184 {
185 delete pImp;
186 }
187}
188
189String SvtAcceleratorConfiguration::GetStreamName()
190{
191 return rtl::OUString("KeyBindings.xml");
192}
193
194SvStream* SvtAcceleratorConfiguration::GetDefaultStream( StreamMode nMode )
195{
196 String aUserConfig = SvtPathOptions().GetUserConfigPath();
197 INetURLObject aObj( aUserConfig );
198 aObj.insertName( GetStreamName() );
199 return ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), nMode );
200}
201
202/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/itemholder1.cxx b/unotools/source/config/itemholder1.cxx
index 8d042453a6c0..8220c48ed28e 100644
--- a/unotools/source/config/itemholder1.cxx
+++ b/unotools/source/config/itemholder1.cxx
@@ -26,7 +26,6 @@
26 26
27#include <unotools/misccfg.hxx> 27#include <unotools/misccfg.hxx>
28#include <unotools/useroptions.hxx> 28#include <unotools/useroptions.hxx>
29#include <unotools/accelcfg.hxx>
30#include <unotools/cmdoptions.hxx> 29#include <unotools/cmdoptions.hxx>
31#include <unotools/compatibility.hxx> 30#include <unotools/compatibility.hxx>
32#include <unotools/defaultoptions.hxx> 31#include <unotools/defaultoptions.hxx>
@@ -46,7 +45,6 @@
46#include <unotools/searchopt.hxx> 45#include <unotools/searchopt.hxx>
47#include <unotools/securityoptions.hxx> 46#include <unotools/securityoptions.hxx>
48#include <unotools/viewoptions.hxx> 47#include <unotools/viewoptions.hxx>
49#include <unotools/workingsetoptions.hxx>
50#include <unotools/xmlaccelcfg.hxx> 48#include <unotools/xmlaccelcfg.hxx>
51#include <unotools/options.hxx> 49#include <unotools/options.hxx>
52#include <unotools/syslocaleoptions.hxx> 50#include <unotools/syslocaleoptions.hxx>
@@ -146,10 +144,6 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
146{ 144{
147 switch(rItem.eItem) 145 switch(rItem.eItem)
148 { 146 {
149 case E_ACCELCFG :
150 rItem.pItem = new SvtAcceleratorConfiguration();
151 break;
152
153 case E_CMDOPTIONS : 147 case E_CMDOPTIONS :
154 rItem.pItem = new SvtCommandOptions(); 148 rItem.pItem = new SvtCommandOptions();
155 break; 149 break;
@@ -186,10 +180,6 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
186 rItem.pItem = new SvtHistoryOptions(); 180 rItem.pItem = new SvtHistoryOptions();
187 break; 181 break;
188 182
189 case E_JAVAOPTIONS :
190// no ref count rItem.pItem = new SvtJavaOptions();
191 break;
192
193 case E_LINGUCFG : 183 case E_LINGUCFG :
194 rItem.pItem = new SvtLinguConfig(); 184 rItem.pItem = new SvtLinguConfig();
195 break; 185 break;
@@ -246,14 +236,6 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
246 rItem.pItem = new SvtViewOptions(E_WINDOW, ::rtl::OUString()); 236 rItem.pItem = new SvtViewOptions(E_WINDOW, ::rtl::OUString());
247 break; 237 break;
248 238
249 case E_WORKINGSETOPTIONS :
250 rItem.pItem = new SvtWorkingSetOptions();
251 break;
252
253 case E_XMLACCELCFG :
254 // ??? TODO
255 break;
256
257 case E_USEROPTIONS : 239 case E_USEROPTIONS :
258 rItem.pItem = new SvtUserOptions(); 240 rItem.pItem = new SvtUserOptions();
259 break; 241 break;
diff --git a/unotools/source/config/workingsetoptions.cxx b/unotools/source/config/workingsetoptions.cxx
deleted file mode 100644
index 0ea5c47bbcb5..000000000000
--- a/unotools/source/config/workingsetoptions.cxx
+++ /dev/null
@@ -1,304 +0,0 @@
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20
21#include <unotools/workingsetoptions.hxx>
22#include <unotools/configmgr.hxx>
23#include <unotools/configitem.hxx>
24#include <tools/debug.hxx>
25#include <com/sun/star/uno/Any.hxx>
26#include <com/sun/star/uno/Sequence.hxx>
27
28#include <itemholder1.hxx>
29
30//_________________________________________________________________________________________________________________
31// namespaces
32//_________________________________________________________________________________________________________________
33
34using namespace ::utl ;
35using namespace ::rtl ;
36using namespace ::osl ;
37using namespace ::com::sun::star::uno ;
38
39#define ROOTNODE_WORKINGSET OUString("Office.Common/WorkingSet")
40#define DEFAULT_WINDOWLIST Sequence< OUString >()
41
42#define PROPERTYNAME_WINDOWLIST OUString("WindowList")
43
44#define PROPERTYHANDLE_WINDOWLIST 0
45
46#define PROPERTYCOUNT 1
47
48//_________________________________________________________________________________________________________________
49// private declarations!
50//_________________________________________________________________________________________________________________
51
52class SvtWorkingSetOptions_Impl : public ConfigItem
53{
54 //-------------------------------------------------------------------------------------------------------------
55 // public methods
56 //-------------------------------------------------------------------------------------------------------------
57
58 public:
59
60 //---------------------------------------------------------------------------------------------------------
61 // constructor / destructor
62 //---------------------------------------------------------------------------------------------------------
63
64 SvtWorkingSetOptions_Impl();
65 ~SvtWorkingSetOptions_Impl();
66
67 //---------------------------------------------------------------------------------------------------------
68 // overloaded methods of baseclass
69 //---------------------------------------------------------------------------------------------------------
70
71 /*-****************************************************************************************************//**
72 @short called for notify of configmanager
73 @descr These method is called from the ConfigManager before application ends or from the
74 PropertyChangeListener if the sub tree broadcasts changes. You must update your
75 internal values.
76
77 @seealso baseclass ConfigItem
78
79 @param "seqPropertyNames" is the list of properties which should be updated.
80 @return -
81
82 @onerror -
83 *//*-*****************************************************************************************************/
84
85 virtual void Notify( const Sequence< OUString >& seqPropertyNames );
86
87 /*-****************************************************************************************************//**
88 @short write changes to configuration
89 @descr These method writes the changed values into the sub tree
90 and should always called in our destructor to guarantee consistency of config data.
91
92 @seealso baseclass ConfigItem
93
94 @param -
95 @return -
96
97 @onerror -
98 *//*-*****************************************************************************************************/
99
100 virtual void Commit();
101
102 //-------------------------------------------------------------------------------------------------------------
103 // private methods
104 //-------------------------------------------------------------------------------------------------------------
105
106 private:
107
108 /*-****************************************************************************************************//**
109 @short return list of key names of ouer configuration management which represent oue module tree
110 @descr These methods return a static const list of key names. We need it to get needed values from our
111 configuration management.
112
113 @seealso -
114
115 @param -
116 @return A list of needed configuration keys is returned.
117
118 @onerror -
119 *//*-*****************************************************************************************************/
120
121 static Sequence< OUString > GetPropertyNames();
122
123 //-------------------------------------------------------------------------------------------------------------
124 // private member
125 //-------------------------------------------------------------------------------------------------------------
126
127 private:
128
129 Sequence< OUString > m_seqWindowList ;
130};
131
132//*****************************************************************************************************************
133// constructor
134//*****************************************************************************************************************
135SvtWorkingSetOptions_Impl::SvtWorkingSetOptions_Impl()
136 // Init baseclasses first
137 : ConfigItem ( ROOTNODE_WORKINGSET )
138 // Init member then.
139 , m_seqWindowList ( DEFAULT_WINDOWLIST )
140{
141 // Use our static list of configuration keys to get his values.
142 Sequence< OUString > seqNames = GetPropertyNames ( );
143 Sequence< Any > seqValues = GetProperties ( seqNames );
144
145 // Safe impossible cases.
146 // We need values from ALL configuration keys.
147 // Follow assignment use order of values in relation to our list of key names!
148 DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtWorkingSetOptions_Impl::SvtWorkingSetOptions_Impl()\nI miss some values of configuration keys!\n" );
149
150 // Copy values from list in right order to ouer internal member.
151 sal_Int32 nPropertyCount = seqValues.getLength();
152 for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
153 {
154 // Safe impossible cases.
155 // Check any for valid value.
156 DBG_ASSERT( !(seqValues[nProperty].hasValue()==sal_False), "SvtWorkingSetOptions_Impl::SvtWorkingSetOptions_Impl()\nInvalid property value detected!\n" );
157 switch( nProperty )
158 {
159 case PROPERTYHANDLE_WINDOWLIST : {
160 DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SEQUENCE), "SvtWorkingSetOptions_Impl::SvtWorkingSetOptions_Impl()\nWho has changed the value type of \"Office.Common\\WorkingSet\\WindowList\"?" );
161 seqValues[nProperty] >>= m_seqWindowList;
162 }
163 break;
164 }
165 }
166
167 // Enable notification mechanism of ouer baseclass.
168 // We need it to get information about changes outside these class on ouer used configuration keys!
169 EnableNotification( seqNames );
170}
171
172//*****************************************************************************************************************
173// destructor
174//*****************************************************************************************************************
175SvtWorkingSetOptions_Impl::~SvtWorkingSetOptions_Impl()
176{
177 // We must save our current values .. if user forget it!
178 if( IsModified() == sal_True )
179 {
180 Commit();
181 }
182}
183
184//*****************************************************************************************************************
185// public method
186//*****************************************************************************************************************
187void SvtWorkingSetOptions_Impl::Notify( const Sequence< OUString >& seqPropertyNames )
188{
189 // Use given list of updated properties to get his values from configuration directly!
190 Sequence< Any > seqValues = GetProperties( seqPropertyNames );
191 // Safe impossible cases.
192 // We need values from ALL notified configuration keys.
193 DBG_ASSERT( !(seqPropertyNames.getLength()!=seqValues.getLength()), "SvtWorkingSetOptions_Impl::Notify()\nI miss some values of configuration keys!\n" );
194 // Step over list of property names and get right value from coreesponding value list to set it on internal members!
195 sal_Int32 nCount = seqPropertyNames.getLength();
196 for( sal_Int32 nProperty=0; nProperty<nCount; ++nProperty )
197 {
198 if( seqPropertyNames[nProperty] == PROPERTYNAME_WINDOWLIST )
199 {
200 DBG_ASSERT(!(seqValues[nProperty].getValueTypeClass()!=TypeClass_SEQUENCE), "SvtWorkingSetOptions_Impl::Notify()\nWho has changed the value type of \"Office.Common\\WorkingSet\\WindowList\"?" );
201 seqValues[nProperty] >>= m_seqWindowList;
202 }
203 #if OSL_DEBUG_LEVEL > 1
204 else DBG_ASSERT( sal_False, "SvtWorkingSetOptions_Impl::Notify()\nUnknown property detected ... I can't handle these!\n" );
205 #endif
206 }
207}
208
209//*****************************************************************************************************************
210// public method
211//*****************************************************************************************************************
212void SvtWorkingSetOptions_Impl::Commit()
213{
214 // Get names of supported properties, create a list for values and copy current values to it.
215 Sequence< OUString > seqNames = GetPropertyNames ();
216 sal_Int32 nCount = seqNames.getLength();
217 Sequence< Any > seqValues ( nCount );
218 for( sal_Int32 nProperty=0; nProperty<nCount; ++nProperty )
219 {
220 switch( nProperty )
221 {
222 case PROPERTYHANDLE_WINDOWLIST : {
223 seqValues[nProperty] <<= m_seqWindowList;
224 }
225 break;
226 }
227 }
228 // Set properties in configuration.
229 PutProperties( seqNames, seqValues );
230}
231
232//*****************************************************************************************************************
233// private method
234//*****************************************************************************************************************
235Sequence< OUString > SvtWorkingSetOptions_Impl::GetPropertyNames()
236{
237 // Build list of configuration key names.
238 const OUString pProperties[] =
239 {
240 PROPERTYNAME_WINDOWLIST ,
241 };
242 // Initialize return sequence with these list ...
243 const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
244 // ... and return it.
245 return seqPropertyNames;
246}
247
248//*****************************************************************************************************************
249// initialize static member
250// DON'T DO IT IN YOUR HEADER!
251// see definition for further informations
252//*****************************************************************************************************************
253SvtWorkingSetOptions_Impl* SvtWorkingSetOptions::m_pDataContainer = NULL ;
254sal_Int32 SvtWorkingSetOptions::m_nRefCount = 0 ;
255
256//*****************************************************************************************************************
257// constructor
258//*****************************************************************************************************************
259SvtWorkingSetOptions::SvtWorkingSetOptions()
260{
261 // Global access, must be guarded (multithreading!).
262 MutexGuard aGuard( GetOwnStaticMutex() );
263 // Increase ouer refcount ...
264 ++m_nRefCount;
265 // ... and initialize ouer data container only if it not already exist!
266 if( m_pDataContainer == NULL )
267 {
268 m_pDataContainer = new SvtWorkingSetOptions_Impl;
269 ItemHolder1::holdConfigItem(E_WORKINGSETOPTIONS);
270 }
271}
272
273//*****************************************************************************************************************
274// destructor
275//*****************************************************************************************************************
276SvtWorkingSetOptions::~SvtWorkingSetOptions()
277{
278 // Global access, must be guarded (multithreading!)
279 MutexGuard aGuard( GetOwnStaticMutex() );
280 // Decrease ouer refcount.
281 --m_nRefCount;
282 // If last instance was deleted ...
283 // we must destroy ouer static data container!
284 if( m_nRefCount <= 0 )
285 {
286 delete m_pDataContainer;
287 m_pDataContainer = NULL;
288 }
289}
290
291namespace
292{
293 class theWorkingSetOptionsMutex : public rtl::Static<osl::Mutex, theWorkingSetOptionsMutex>{};
294}
295
296//*****************************************************************************************************************
297// private method
298//*****************************************************************************************************************
299Mutex& SvtWorkingSetOptions::GetOwnStaticMutex()
300{
301 return theWorkingSetOptionsMutex::get();
302}
303
304/* vim:set shiftwidth=4 softtabstop=4 expandtab: */