summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:47:44 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-06-19 12:47:44 +0200
commit941020379b1ea1ec7c564c21e68ea1674cda7683 (patch)
tree40fcaf109d6d585bcdc0faf7ea6c0812b3cc9a39 /unotools
parent0692507dcc62e94c7af88388961db1d7d12d6dbd (diff)
parent0d2916e03ea51529e15995830a1a8c36bd72e442 (diff)
Merge branch 'master' into feature/gnumake4
Conflicts: basebmp/prj/d.lst basebmp/test/basictest.cxx basebmp/test/makefile.mk basegfx/inc/basegfx/basegfxdllapi.h basegfx/inc/basegfx/tools/debugplotter.hxx basegfx/inc/basegfx/tuple/b2ituple.hxx basegfx/prj/d.lst basegfx/source/numeric/makefile.mk basegfx/source/polygon/makefile.mk basegfx/source/range/makefile.mk basegfx/source/raster/makefile.mk basegfx/source/tuple/makefile.mk basegfx/source/vector/makefile.mk basegfx/test/basegfx1d.cxx basegfx/test/makefile.mk basegfx/util/makefile.mk canvas/Library_canvasfactory.mk canvas/Module_canvas.mk canvas/prj/build.lst canvas/prj/d.lst canvas/source/cairo/cairo_canvashelper_texturefill.cxx canvas/source/cairo/makefile.mk canvas/source/tools/makefile.mk comphelper/qa/string/makefile.mk cppcanvas/Module_cppcanvas.mk cppcanvas/inc/cppcanvas/cppcanvasdllapi.h cppcanvas/prj/build.lst cppcanvas/prj/d.lst cppcanvas/source/mtfrenderer/makefile.mk cppcanvas/util/makefile.mk i18npool/source/search/makefile.mk regexp/Library_regexp.mk regexp/prj/d.lst sax/CppunitTest_sax.mk sax/Library_sax.mk sax/prj/d.lst sax/qa/cppunit/test_converter.cxx sax/source/expatwrap/attrlistimpl.hxx sax/util/makefile.mk svtools/Library_svt.mk tools/Executable_sspretty.mk ucbhelper/prj/d.lst ucbhelper/source/provider/configureucb.cxx ucbhelper/source/provider/provconf.cxx ucbhelper/util/makefile.mk unotools/Library_utl.mk unotools/Module_unotools.mk unotools/Package_inc.mk unotools/prj/build.lst vcl/Library_desktop_detector.mk vcl/Library_vcl.mk vcl/Library_vclplug_gtk.mk vcl/aqua/source/gdi/salprn.cxx vcl/inc/aqua/saldata.hxx vcl/unx/generic/gdi/salgdi3.cxx
Diffstat (limited to 'unotools')
-rw-r--r--unotools/Library_utl.mk223
-rw-r--r--unotools/Makefile2
-rw-r--r--unotools/Module_unotools.mk43
-rw-r--r--unotools/Package_inc.mk184
-rw-r--r--unotools/inc/pch/precompiled_unotools.cxx2
-rw-r--r--unotools/inc/pch/precompiled_unotools.hxx2
-rw-r--r--unotools/inc/unotools/accelcfg.hxx3
-rw-r--r--unotools/inc/unotools/accessiblerelationsethelper.hxx9
-rw-r--r--unotools/inc/unotools/accessiblestatesethelper.hxx9
-rw-r--r--unotools/inc/unotools/atom.hxx13
-rw-r--r--unotools/inc/unotools/bootstrap.hxx8
-rw-r--r--unotools/inc/unotools/cacheoptions.hxx3
-rw-r--r--unotools/inc/unotools/calendarwrapper.hxx3
-rw-r--r--unotools/inc/unotools/caserotate.hxx50
-rw-r--r--unotools/inc/unotools/charclass.hxx3
-rw-r--r--unotools/inc/unotools/cmdoptions.hxx3
-rw-r--r--unotools/inc/unotools/collatorwrapper.hxx5
-rw-r--r--unotools/inc/unotools/compatibility.hxx4
-rw-r--r--unotools/inc/unotools/componentresmodule.hxx16
-rw-r--r--unotools/inc/unotools/configitem.hxx5
-rw-r--r--unotools/inc/unotools/configmgr.hxx7
-rw-r--r--unotools/inc/unotools/confignode.hxx2
-rw-r--r--unotools/inc/unotools/configpathes.hxx2
-rw-r--r--unotools/inc/unotools/configvaluecontainer.hxx2
-rw-r--r--unotools/inc/unotools/datetime.hxx2
-rw-r--r--unotools/inc/unotools/defaultoptions.hxx2
-rw-r--r--unotools/inc/unotools/desktopterminationobserver.hxx2
-rw-r--r--unotools/inc/unotools/digitgroupingiterator.hxx3
-rw-r--r--unotools/inc/unotools/docinfohelper.hxx2
-rw-r--r--unotools/inc/unotools/dynamicmenuoptions.hxx3
-rw-r--r--unotools/inc/unotools/eventcfg.hxx7
-rw-r--r--unotools/inc/unotools/eventlisteneradapter.hxx2
-rw-r--r--unotools/inc/unotools/extendedsecurityoptions.hxx3
-rw-r--r--unotools/inc/unotools/fltrcfg.hxx4
-rw-r--r--unotools/inc/unotools/fontcfg.hxx21
-rw-r--r--unotools/inc/unotools/fontcvt.hxx3
-rw-r--r--unotools/inc/unotools/fontdefs.hxx3
-rw-r--r--unotools/inc/unotools/fontoptions.hxx3
-rw-r--r--unotools/inc/unotools/historyoptions.hxx3
-rw-r--r--unotools/inc/unotools/historyoptions_const.hxx33
-rw-r--r--unotools/inc/unotools/idhelper.hxx2
-rw-r--r--unotools/inc/unotools/inetoptions.hxx9
-rw-r--r--unotools/inc/unotools/internaloptions.hxx3
-rw-r--r--unotools/inc/unotools/intlwrapper.hxx3
-rw-r--r--unotools/inc/unotools/itemholderbase.hxx3
-rw-r--r--unotools/inc/unotools/javaoptions.hxx2
-rw-r--r--[-rwxr-xr-x]unotools/inc/unotools/lingucfg.hxx12
-rw-r--r--unotools/inc/unotools/linguprops.hxx2
-rw-r--r--unotools/inc/unotools/localedatawrapper.hxx5
-rw-r--r--unotools/inc/unotools/localfilehelper.hxx3
-rw-r--r--unotools/inc/unotools/localisationoptions.hxx3
-rw-r--r--unotools/inc/unotools/loghelper.hxx4
-rw-r--r--unotools/inc/unotools/misccfg.hxx5
-rw-r--r--unotools/inc/unotools/moduleoptions.hxx3
-rw-r--r--unotools/inc/unotools/nativenumberwrapper.hxx3
-rw-r--r--unotools/inc/unotools/numberformatcodewrapper.hxx3
-rw-r--r--unotools/inc/unotools/options.hxx6
-rw-r--r--unotools/inc/unotools/optionsdlg.hxx4
-rw-r--r--unotools/inc/unotools/pathoptions.hxx2
-rw-r--r--unotools/inc/unotools/printwarningoptions.hxx3
-rw-r--r--unotools/inc/unotools/processfactory.hxx2
-rw-r--r--unotools/inc/unotools/progresshandlerwrap.hxx2
-rw-r--r--unotools/inc/unotools/propertysethelper.hxx2
-rw-r--r--unotools/inc/unotools/propertysetinfo.hxx2
-rw-r--r--unotools/inc/unotools/querydeep.hxx2
-rw-r--r--unotools/inc/unotools/readwritemutexguard.hxx2
-rw-r--r--unotools/inc/unotools/regoptions.hxx2
-rw-r--r--unotools/inc/unotools/regpathhelper.hxx2
-rw-r--r--unotools/inc/unotools/saveopt.hxx2
-rw-r--r--unotools/inc/unotools/searchopt.hxx2
-rw-r--r--unotools/inc/unotools/securityoptions.hxx3
-rw-r--r--unotools/inc/unotools/sharedunocomponent.hxx3
-rw-r--r--unotools/inc/unotools/sourceviewconfig.hxx5
-rw-r--r--unotools/inc/unotools/startoptions.hxx3
-rw-r--r--unotools/inc/unotools/streamhelper.hxx2
-rw-r--r--unotools/inc/unotools/streamsection.hxx2
-rw-r--r--unotools/inc/unotools/streamwrap.hxx10
-rw-r--r--unotools/inc/unotools/syslocale.hxx3
-rw-r--r--[-rwxr-xr-x]unotools/inc/unotools/syslocaleoptions.hxx3
-rw-r--r--unotools/inc/unotools/tempfile.hxx3
-rw-r--r--unotools/inc/unotools/textsearch.hxx2
-rw-r--r--unotools/inc/unotools/transliterationwrapper.hxx3
-rw-r--r--unotools/inc/unotools/ucbhelper.hxx2
-rw-r--r--unotools/inc/unotools/ucblockbytes.hxx23
-rw-r--r--unotools/inc/unotools/ucbstreamhelper.hxx3
-rw-r--r--unotools/inc/unotools/undoopt.hxx2
-rw-r--r--unotools/inc/unotools/unotoolsdllapi.h2
-rw-r--r--unotools/inc/unotools/unotunnelhelper.hxx193
-rw-r--r--unotools/inc/unotools/useroptions.hxx3
-rw-r--r--unotools/inc/unotools/useroptions_const.hxx41
-rw-r--r--unotools/inc/unotools/viewoptions.hxx3
-rw-r--r--unotools/inc/unotools/workingsetoptions.hxx3
-rw-r--r--unotools/inc/unotools/xmlaccelcfg.hxx5
-rw-r--r--unotools/prj/build.lst4
-rwxr-xr-x[-rw-r--r--]unotools/prj/makefile.mk2
-rw-r--r--unotools/source/accessibility/accessiblerelationsethelper.cxx31
-rw-r--r--unotools/source/accessibility/accessiblestatesethelper.cxx71
-rw-r--r--unotools/source/config/accelcfg.cxx19
-rw-r--r--unotools/source/config/bootstrap.cxx92
-rw-r--r--unotools/source/config/cacheoptions.cxx43
-rw-r--r--unotools/source/config/cmdoptions.cxx44
-rw-r--r--unotools/source/config/compatibility.cxx71
-rw-r--r--unotools/source/config/configitem.cxx108
-rw-r--r--unotools/source/config/configmgr.cxx183
-rw-r--r--unotools/source/config/confignode.cxx38
-rw-r--r--unotools/source/config/configpathes.cxx5
-rw-r--r--unotools/source/config/configvaluecontainer.cxx69
-rw-r--r--unotools/source/config/defaultoptions.cxx8
-rw-r--r--unotools/source/config/docinfohelper.cxx54
-rw-r--r--unotools/source/config/dynamicmenuoptions.cxx37
-rw-r--r--unotools/source/config/eventcfg.cxx42
-rw-r--r--unotools/source/config/extendedsecurityoptions.cxx45
-rw-r--r--unotools/source/config/fltrcfg.cxx103
-rw-r--r--unotools/source/config/fontcfg.cxx86
-rw-r--r--unotools/source/config/fontoptions.cxx40
-rw-r--r--unotools/source/config/historyoptions.cxx60
-rw-r--r--unotools/source/config/inetoptions.cxx13
-rw-r--r--unotools/source/config/internaloptions.cxx124
-rw-r--r--unotools/source/config/itemholder1.cxx8
-rw-r--r--unotools/source/config/itemholder1.hxx3
-rw-r--r--unotools/source/config/javaoptions.cxx43
-rw-r--r--[-rwxr-xr-x]unotools/source/config/lingucfg.cxx173
-rw-r--r--unotools/source/config/localisationoptions.cxx47
-rw-r--r--unotools/source/config/misccfg.cxx83
-rw-r--r--unotools/source/config/moduleoptions.cxx155
-rw-r--r--unotools/source/config/options.cxx31
-rw-r--r--unotools/source/config/optionsdlg.cxx27
-rw-r--r--unotools/source/config/pathoptions.cxx135
-rw-r--r--unotools/source/config/printwarningoptions.cxx39
-rw-r--r--unotools/source/config/regoptions.cxx26
-rw-r--r--unotools/source/config/saveopt.cxx39
-rw-r--r--unotools/source/config/searchopt.cxx16
-rw-r--r--unotools/source/config/securityoptions.cxx36
-rw-r--r--unotools/source/config/sourceviewconfig.cxx38
-rw-r--r--unotools/source/config/startoptions.cxx39
-rw-r--r--[-rwxr-xr-x]unotools/source/config/syslocaleoptions.cxx41
-rw-r--r--unotools/source/config/undoopt.cxx14
-rw-r--r--unotools/source/config/useroptions.cxx153
-rw-r--r--unotools/source/config/viewoptions.cxx34
-rw-r--r--unotools/source/config/workingsetoptions.cxx39
-rw-r--r--unotools/source/config/xmlaccelcfg.cxx8
-rw-r--r--unotools/source/i18n/calendarwrapper.cxx4
-rw-r--r--unotools/source/i18n/caserotate.cxx65
-rw-r--r--unotools/source/i18n/charclass.cxx48
-rw-r--r--unotools/source/i18n/collatorwrapper.cxx5
-rw-r--r--unotools/source/i18n/intlwrapper.cxx3
-rw-r--r--unotools/source/i18n/localedatawrapper.cxx21
-rw-r--r--unotools/source/i18n/nativenumberwrapper.cxx4
-rw-r--r--unotools/source/i18n/numberformatcodewrapper.cxx5
-rw-r--r--unotools/source/i18n/readwritemutexguard.cxx3
-rw-r--r--unotools/source/i18n/textsearch.cxx7
-rw-r--r--unotools/source/i18n/transliterationwrapper.cxx3
-rw-r--r--unotools/source/misc/atom.cxx29
-rw-r--r--unotools/source/misc/componentresmodule.cxx3
-rw-r--r--unotools/source/misc/datetime.cxx2
-rw-r--r--unotools/source/misc/desktopterminationobserver.cxx4
-rw-r--r--unotools/source/misc/eventlisteneradapter.cxx5
-rw-r--r--unotools/source/misc/fontcvt.cxx11
-rw-r--r--unotools/source/misc/fontdefs.cxx16
-rw-r--r--unotools/source/misc/sharedunocomponent.cxx13
-rw-r--r--unotools/source/misc/syslocale.cxx4
-rw-r--r--unotools/source/processfactory/processfactory.cxx2
-rw-r--r--unotools/source/property/propertysethelper.cxx9
-rw-r--r--unotools/source/property/propertysetinfo.cxx11
-rw-r--r--unotools/source/streaming/streamhelper.cxx2
-rw-r--r--unotools/source/streaming/streamwrap.cxx10
-rw-r--r--unotools/source/ucbhelper/XTempFile.hxx5
-rw-r--r--unotools/source/ucbhelper/localfilehelper.cxx17
-rw-r--r--unotools/source/ucbhelper/progresshandlerwrap.cxx2
-rw-r--r--unotools/source/ucbhelper/tempfile.cxx30
-rw-r--r--unotools/source/ucbhelper/ucbhelper.cxx50
-rw-r--r--unotools/source/ucbhelper/ucblockbytes.cxx81
-rw-r--r--unotools/source/ucbhelper/ucbstreamhelper.cxx27
-rw-r--r--unotools/source/ucbhelper/xtempfile.cxx3
174 files changed, 1892 insertions, 2352 deletions
diff --git a/unotools/Library_utl.mk b/unotools/Library_utl.mk
index 19909abc82af..70647da701ca 100644
--- a/unotools/Library_utl.mk
+++ b/unotools/Library_utl.mk
@@ -1,31 +1,29 @@
-#*************************************************************************
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2011 Oracle and/or its affiliates.
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
#
-# OpenOffice.org - a multi-platform office productivity suite
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
#
-# This file is part of OpenOffice.org.
+# The Initial Developer of the Original Code is
+# David Tardon, Red Hat Inc. <dtardon@redhat.com>
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
+# Major Contributor(s):
#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
+# For minor contributions see the git repository.
#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
-
-# unotools is the name of the module the makefile is located in
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
# declare a library
# utl is the name of the library as it is found in Repository.mk
@@ -44,113 +42,112 @@ $(eval $(call gb_Library_set_componentfile,utl,unotools/util/utl))
# add any additional include paths for this library here
$(eval $(call gb_Library_set_include,utl,\
- $$(INCLUDE) \
- -I$(SRCDIR)/unotools/inc \
- -I$(SRCDIR)/unotools/inc/pch \
- -I$(OUTDIR)/inc/offuh \
+ $$(INCLUDE) \
+ -I$(realpath $(SRCDIR)/unotools/inc/pch) \
+ -I$(OUTDIR)/inc \
+ -I$(OUTDIR)/inc/offuh \
))
# add any additional definitions to be set for compilation here
# (e.g. -DLIB_DLLIMPLEMENTATION)
$(eval $(call gb_Library_add_defs,utl,\
- -DUNOTOOLS_DLLIMPLEMENTATION \
+ -DUNOTOOLS_DLLIMPLEMENTATION \
))
# add libraries to be linked to utl; again these names need to be given as
# specified in Repository.mk
$(eval $(call gb_Library_add_linked_libs,utl,\
- sal \
- salhelper \
- stl \
- comphelper \
- ucbhelper \
- cppu \
- cppuhelper \
- i18nisolang1 \
- tl \
- vos3 \
+ comphelper \
+ cppu \
+ cppuhelper \
+ i18nisolang1 \
+ sal \
+ salhelper \
+ tl \
+ ucbhelper \
$(gb_STDLIBS) \
))
# add all source files that shall be compiled with exceptions enabled
# the name is relative to $(SRCROOT) and must not contain an extension
$(eval $(call gb_Library_add_exception_objects,utl,\
- unotools/source/streaming/streamhelper \
- unotools/source/streaming/streamwrap \
- unotools/source/accessibility/accessiblestatesethelper \
- unotools/source/accessibility/accessiblerelationsethelper \
- unotools/source/property/propertysethelper \
- unotools/source/property/propertysetinfo \
- unotools/source/misc/sharedunocomponent \
- unotools/source/misc/componentresmodule \
- unotools/source/misc/eventlisteneradapter \
- unotools/source/misc/fontcvt \
- unotools/source/misc/syslocale \
- unotools/source/misc/fontdefs \
- unotools/source/misc/datetime \
- unotools/source/misc/atom \
- unotools/source/misc/desktopterminationobserver \
- unotools/source/processfactory/processfactory \
- unotools/source/ucbhelper/localfilehelper \
- unotools/source/ucbhelper/ucbstreamhelper \
- unotools/source/ucbhelper/xtempfile \
- unotools/source/ucbhelper/ucblockbytes \
- unotools/source/ucbhelper/tempfile \
- unotools/source/ucbhelper/ucbhelper \
- unotools/source/ucbhelper/progresshandlerwrap \
- unotools/source/config/historyoptions \
- unotools/source/config/optionsdlg \
- unotools/source/config/regoptions \
- unotools/source/config/bootstrap \
- unotools/source/config/configpathes \
- unotools/source/config/javaoptions \
- unotools/source/config/lingucfg \
- unotools/source/config/fontoptions \
- unotools/source/config/useroptions \
- unotools/source/config/internaloptions \
- unotools/source/config/viewoptions \
- unotools/source/config/workingsetoptions \
- unotools/source/config/fltrcfg \
- unotools/source/config/localisationoptions \
- unotools/source/config/itemholder1 \
- unotools/source/config/cmdoptions \
- unotools/source/config/cacheoptions \
- unotools/source/config/docinfohelper \
- unotools/source/config/inetoptions \
- unotools/source/config/misccfg \
- unotools/source/config/options \
- unotools/source/config/xmlaccelcfg \
- unotools/source/config/fontcfg \
- unotools/source/config/startoptions \
- unotools/source/config/extendedsecurityoptions \
- unotools/source/config/printwarningoptions \
- unotools/source/config/configmgr \
- unotools/source/config/eventcfg \
- unotools/source/config/configitem \
- unotools/source/config/defaultoptions \
- unotools/source/config/searchopt \
- unotools/source/config/confignode \
- unotools/source/config/sourceviewconfig \
- unotools/source/config/compatibility \
- unotools/source/config/pathoptions \
- unotools/source/config/dynamicmenuoptions \
- unotools/source/config/moduleoptions \
- unotools/source/config/undoopt \
- unotools/source/config/configvaluecontainer \
- unotools/source/config/syslocaleoptions \
- unotools/source/config/accelcfg \
- unotools/source/config/saveopt \
- unotools/source/config/securityoptions \
- unotools/source/i18n/charclass \
- unotools/source/i18n/textsearch \
- unotools/source/i18n/readwritemutexguard \
- unotools/source/i18n/intlwrapper \
- unotools/source/i18n/transliterationwrapper \
- unotools/source/i18n/calendarwrapper \
- unotools/source/i18n/localedatawrapper \
- unotools/source/i18n/collatorwrapper \
- unotools/source/i18n/numberformatcodewrapper \
- unotools/source/i18n/nativenumberwrapper \
+ unotools/source/accessibility/accessiblerelationsethelper \
+ unotools/source/accessibility/accessiblestatesethelper \
+ unotools/source/config/accelcfg \
+ unotools/source/config/bootstrap \
+ unotools/source/config/cacheoptions \
+ unotools/source/config/cmdoptions \
+ unotools/source/config/compatibility \
+ unotools/source/config/configitem \
+ unotools/source/config/configmgr \
+ unotools/source/config/confignode \
+ unotools/source/config/configpathes \
+ unotools/source/config/configvaluecontainer \
+ unotools/source/config/defaultoptions \
+ unotools/source/config/docinfohelper \
+ unotools/source/config/dynamicmenuoptions \
+ unotools/source/config/eventcfg \
+ unotools/source/config/extendedsecurityoptions \
+ unotools/source/config/fltrcfg \
+ unotools/source/config/fontcfg \
+ unotools/source/config/fontoptions \
+ unotools/source/config/historyoptions \
+ unotools/source/config/inetoptions \
+ unotools/source/config/internaloptions \
+ unotools/source/config/itemholder1 \
+ unotools/source/config/javaoptions \
+ unotools/source/config/lingucfg \
+ unotools/source/config/localisationoptions \
+ unotools/source/config/misccfg \
+ unotools/source/config/moduleoptions \
+ unotools/source/config/options \
+ unotools/source/config/optionsdlg \
+ unotools/source/config/pathoptions \
+ unotools/source/config/printwarningoptions \
+ unotools/source/config/regoptions \
+ unotools/source/config/saveopt \
+ unotools/source/config/searchopt \
+ unotools/source/config/securityoptions \
+ unotools/source/config/sourceviewconfig \
+ unotools/source/config/startoptions \
+ unotools/source/config/syslocaleoptions \
+ unotools/source/config/undoopt \
+ unotools/source/config/useroptions \
+ unotools/source/config/viewoptions \
+ unotools/source/config/workingsetoptions \
+ unotools/source/config/xmlaccelcfg \
+ unotools/source/i18n/calendarwrapper \
+ unotools/source/i18n/caserotate \
+ unotools/source/i18n/charclass \
+ unotools/source/i18n/collatorwrapper \
+ unotools/source/i18n/intlwrapper \
+ unotools/source/i18n/localedatawrapper \
+ unotools/source/i18n/nativenumberwrapper \
+ unotools/source/i18n/numberformatcodewrapper \
+ unotools/source/i18n/readwritemutexguard \
+ unotools/source/i18n/textsearch \
+ unotools/source/i18n/transliterationwrapper \
+ unotools/source/misc/atom \
+ unotools/source/misc/componentresmodule \
+ unotools/source/misc/datetime \
+ unotools/source/misc/desktopterminationobserver \
+ unotools/source/misc/eventlisteneradapter \
+ unotools/source/misc/fontcvt \
+ unotools/source/misc/fontdefs \
+ unotools/source/misc/sharedunocomponent \
+ unotools/source/misc/syslocale \
+ unotools/source/processfactory/processfactory \
+ unotools/source/property/propertysethelper \
+ unotools/source/property/propertysetinfo \
+ unotools/source/streaming/streamhelper \
+ unotools/source/streaming/streamwrap \
+ unotools/source/ucbhelper/localfilehelper \
+ unotools/source/ucbhelper/progresshandlerwrap \
+ unotools/source/ucbhelper/tempfile \
+ unotools/source/ucbhelper/ucbhelper \
+ unotools/source/ucbhelper/ucblockbytes \
+ unotools/source/ucbhelper/ucbstreamhelper \
+ unotools/source/ucbhelper/xtempfile \
))
# vim: set noet sw=4 ts=4:
diff --git a/unotools/Makefile b/unotools/Makefile
index 90947b2e5f48..a79aff831024 100644
--- a/unotools/Makefile
+++ b/unotools/Makefile
@@ -2,7 +2,7 @@
#
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
-# Copyright 2000, 2011 Oracle and/or its affiliates.
+# Copyright 2000, 2010 Oracle and/or its affiliates.
#
# OpenOffice.org - a multi-platform office productivity suite
#
diff --git a/unotools/Module_unotools.mk b/unotools/Module_unotools.mk
index 3f474fc12692..948b5b1f624c 100644
--- a/unotools/Module_unotools.mk
+++ b/unotools/Module_unotools.mk
@@ -1,39 +1,36 @@
-#*************************************************************************
-#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2011 Oracle and/or its affiliates.
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# OpenOffice.org - a multi-platform office productivity suite
#
-# This file is part of OpenOffice.org.
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
+# The Initial Developer of the Original Code is
+# Bjoern Michaelsen, Canonical Ltd. <bjoern.michaelsen@canonical.com>
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
+# Major Contributor(s):
#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
+# For minor contributions see the git repository.
#
-#*************************************************************************
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
$(eval $(call gb_Module_Module,unotools))
$(eval $(call gb_Module_add_targets,unotools,\
- Library_utl \
- Package_inc \
+ Library_utl \
+ Package_inc \
))
$(eval $(call gb_Module_add_subsequentcheck_targets,unotools,\
- JunitTest_unotools_complex \
+ JunitTest_unotools_complex \
))
-# vim: set noet sw=4 ts=4:
+# vim: set noet ts=4 sw=4:
diff --git a/unotools/Package_inc.mk b/unotools/Package_inc.mk
index 146891db1bca..a4830616e9d1 100644
--- a/unotools/Package_inc.mk
+++ b/unotools/Package_inc.mk
@@ -1,115 +1,117 @@
-#*************************************************************************
+# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
-# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
-#
-# Copyright 2000, 2011 Oracle and/or its affiliates.
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License or as specified alternatively below. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
#
-# OpenOffice.org - a multi-platform office productivity suite
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
#
-# This file is part of OpenOffice.org.
+# The Initial Developer of the Original Code is
+# David Tardon, Red Hat Inc. <dtardon@redhat.com>
+# Portions created by the Initial Developer are Copyright (C) 2010 the
+# Initial Developer. All Rights Reserved.
#
-# OpenOffice.org is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License version 3
-# only, as published by the Free Software Foundation.
+# Major Contributor(s):
#
-# OpenOffice.org is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License version 3 for more details
-# (a copy is included in the LICENSE file that accompanied this code).
+# For minor contributions see the git repository.
#
-# You should have received a copy of the GNU Lesser General Public License
-# version 3 along with OpenOffice.org. If not, see
-# <http://www.openoffice.org/license.html>
-# for a copy of the LGPLv3 License.
-#
-#*************************************************************************
+# Alternatively, the contents of this file may be used under the terms of
+# either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+# instead of those above.
$(eval $(call gb_Package_Package,unotools_inc,$(SRCDIR)/unotools/inc))
+
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accelcfg.hxx,unotools/accelcfg.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accessiblerelationsethelper.hxx,unotools/accessiblerelationsethelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accessiblestatesethelper.hxx,unotools/accessiblestatesethelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/atom.hxx,unotools/atom.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/bootstrap.hxx,unotools/bootstrap.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/cacheoptions.hxx,unotools/cacheoptions.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/calendarwrapper.hxx,unotools/calendarwrapper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/syslocale.hxx,unotools/syslocale.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/localedatawrapper.hxx,unotools/localedatawrapper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/searchopt.hxx,unotools/searchopt.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/digitgroupingiterator.hxx,unotools/digitgroupingiterator.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/streamsection.hxx,unotools/streamsection.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/streamhelper.hxx,unotools/streamhelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontcfg.hxx,unotools/fontcfg.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/caserotate.hxx,unotools/caserotate.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/charclass.hxx,unotools/charclass.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/cmdoptions.hxx,unotools/cmdoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/collatorwrapper.hxx,unotools/collatorwrapper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/compatibility.hxx,unotools/compatibility.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/componentresmodule.hxx,unotools/componentresmodule.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/configitem.hxx,unotools/configitem.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/configmgr.hxx,unotools/configmgr.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/confignode.hxx,unotools/confignode.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/configpathes.hxx,unotools/configpathes.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/configvaluecontainer.hxx,unotools/configvaluecontainer.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/datetime.hxx,unotools/datetime.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/defaultoptions.hxx,unotools/defaultoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/desktopterminationobserver.hxx,unotools/desktopterminationobserver.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/digitgroupingiterator.hxx,unotools/digitgroupingiterator.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/docinfohelper.hxx,unotools/docinfohelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/historyoptions_const.hxx,unotools/historyoptions_const.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/querydeep.hxx,unotools/querydeep.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/internaloptions.hxx,unotools/internaloptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/componentresmodule.hxx,unotools/componentresmodule.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/cmdoptions.hxx,unotools/cmdoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/workingsetoptions.hxx,unotools/workingsetoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/dynamicmenuoptions.hxx,unotools/dynamicmenuoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/eventcfg.hxx,unotools/eventcfg.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/eventlisteneradapter.hxx,unotools/eventlisteneradapter.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/extendedsecurityoptions.hxx,unotools/extendedsecurityoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/defaultoptions.hxx,unotools/defaultoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/charclass.hxx,unotools/charclass.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/itemholderbase.hxx,unotools/itemholderbase.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accelcfg.hxx,unotools/accelcfg.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/readwritemutexguard.hxx,unotools/readwritemutexguard.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/syslocaleoptions.hxx,unotools/syslocaleoptions.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fltrcfg.hxx,unotools/fltrcfg.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/useroptions_const.hxx,unotools/useroptions_const.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/propertysetinfo.hxx,unotools/propertysetinfo.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/ucblockbytes.hxx,unotools/ucblockbytes.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/viewoptions.hxx,unotools/viewoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/ucbstreamhelper.hxx,unotools/ucbstreamhelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/idhelper.hxx,unotools/idhelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/numberformatcodewrapper.hxx,unotools/numberformatcodewrapper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/misccfg.hxx,unotools/misccfg.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/configpathes.hxx,unotools/configpathes.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/regpathhelper.hxx,unotools/regpathhelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontcfg.hxx,unotools/fontcfg.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontcvt.hxx,unotools/fontcvt.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontdefs.hxx,unotools/fontdefs.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontoptions.hxx,unotools/fontoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/pathoptions.hxx,unotools/pathoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/confignode.hxx,unotools/confignode.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/datetime.hxx,unotools/datetime.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/historyoptions_const.hxx,unotools/historyoptions_const.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/historyoptions.hxx,unotools/historyoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/idhelper.hxx,unotools/idhelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/inetoptions.hxx,unotools/inetoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/internaloptions.hxx,unotools/internaloptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/intlwrapper.hxx,unotools/intlwrapper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/itemholderbase.hxx,unotools/itemholderbase.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/javaoptions.hxx,unotools/javaoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/ucbhelper.hxx,unotools/ucbhelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/textsearch.hxx,unotools/textsearch.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/configitem.hxx,unotools/configitem.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/eventcfg.hxx,unotools/eventcfg.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/saveopt.hxx,unotools/saveopt.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/nativenumberwrapper.hxx,unotools/nativenumberwrapper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/processfactory.hxx,unotools/processfactory.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/sourceviewconfig.hxx,unotools/sourceviewconfig.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/dynamicmenuoptions.hxx,unotools/dynamicmenuoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/loghelper.hxx,unotools/loghelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/progresshandlerwrap.hxx,unotools/progresshandlerwrap.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/startoptions.hxx,unotools/startoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/collatorwrapper.hxx,unotools/collatorwrapper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/cacheoptions.hxx,unotools/cacheoptions.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/lingucfg.hxx,unotools/lingucfg.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/unotunnelhelper.hxx,unotools/unotunnelhelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontcvt.hxx,unotools/fontcvt.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/atom.hxx,unotools/atom.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/linguprops.hxx,unotools/linguprops.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/localedatawrapper.hxx,unotools/localedatawrapper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/localfilehelper.hxx,unotools/localfilehelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/localisationoptions.hxx,unotools/localisationoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/loghelper.hxx,unotools/loghelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/misccfg.hxx,unotools/misccfg.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/moduleoptions.hxx,unotools/moduleoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/nativenumberwrapper.hxx,unotools/nativenumberwrapper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/numberformatcodewrapper.hxx,unotools/numberformatcodewrapper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/optionsdlg.hxx,unotools/optionsdlg.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/options.hxx,unotools/options.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/pathoptions.hxx,unotools/pathoptions.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/printwarningoptions.hxx,unotools/printwarningoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/compatibility.hxx,unotools/compatibility.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/configmgr.hxx,unotools/configmgr.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/bootstrap.hxx,unotools/bootstrap.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/intlwrapper.hxx,unotools/intlwrapper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/processfactory.hxx,unotools/processfactory.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/progresshandlerwrap.hxx,unotools/progresshandlerwrap.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/propertysethelper.hxx,unotools/propertysethelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/propertysetinfo.hxx,unotools/propertysetinfo.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/querydeep.hxx,unotools/querydeep.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/readwritemutexguard.hxx,unotools/readwritemutexguard.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/regoptions.hxx,unotools/regoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/regpathhelper.hxx,unotools/regpathhelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/saveopt.hxx,unotools/saveopt.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/searchopt.hxx,unotools/searchopt.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/securityoptions.hxx,unotools/securityoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/eventlisteneradapter.hxx,unotools/eventlisteneradapter.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/sharedunocomponent.hxx,unotools/sharedunocomponent.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/sourceviewconfig.hxx,unotools/sourceviewconfig.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/startoptions.hxx,unotools/startoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/streamhelper.hxx,unotools/streamhelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/streamsection.hxx,unotools/streamsection.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/streamwrap.hxx,unotools/streamwrap.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/syslocale.hxx,unotools/syslocale.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/syslocaleoptions.hxx,unotools/syslocaleoptions.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/tempfile.hxx,unotools/tempfile.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/optionsdlg.hxx,unotools/optionsdlg.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/textsearch.hxx,unotools/textsearch.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/transliterationwrapper.hxx,unotools/transliterationwrapper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/xmlaccelcfg.hxx,unotools/xmlaccelcfg.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/ucbhelper.hxx,unotools/ucbhelper.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/ucblockbytes.hxx,unotools/ucblockbytes.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/ucbstreamhelper.hxx,unotools/ucbstreamhelper.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/undoopt.hxx,unotools/undoopt.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accessiblerelationsethelper.hxx,unotools/accessiblerelationsethelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/useroptions.hxx,unotools/useroptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/regoptions.hxx,unotools/regoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/desktopterminationobserver.hxx,unotools/desktopterminationobserver.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/options.hxx,unotools/options.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/streamwrap.hxx,unotools/streamwrap.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/propertysethelper.hxx,unotools/propertysethelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/historyoptions.hxx,unotools/historyoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/fontdefs.hxx,unotools/fontdefs.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/sharedunocomponent.hxx,unotools/sharedunocomponent.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/accessiblestatesethelper.hxx,unotools/accessiblestatesethelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/moduleoptions.hxx,unotools/moduleoptions.hxx))
$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/unotoolsdllapi.h,unotools/unotoolsdllapi.h))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/localfilehelper.hxx,unotools/localfilehelper.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/inetoptions.hxx,unotools/inetoptions.hxx))
-$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/localisationoptions.hxx,unotools/localisationoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/useroptions_const.hxx,unotools/useroptions_const.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/useroptions.hxx,unotools/useroptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/viewoptions.hxx,unotools/viewoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/workingsetoptions.hxx,unotools/workingsetoptions.hxx))
+$(eval $(call gb_Package_add_file,unotools_inc,inc/unotools/xmlaccelcfg.hxx,unotools/xmlaccelcfg.hxx))
+
# vim: set noet sw=4 ts=4:
diff --git a/unotools/inc/pch/precompiled_unotools.cxx b/unotools/inc/pch/precompiled_unotools.cxx
index 56609a47e969..4f69205b57fb 100644
--- a/unotools/inc/pch/precompiled_unotools.cxx
+++ b/unotools/inc/pch/precompiled_unotools.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,3 +28,4 @@
#include "precompiled_unotools.hxx"
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/pch/precompiled_unotools.hxx b/unotools/inc/pch/precompiled_unotools.hxx
index dec72c148da6..8a46e8e2ded7 100644
--- a/unotools/inc/pch/precompiled_unotools.hxx
+++ b/unotools/inc/pch/precompiled_unotools.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,3 +31,4 @@
#ifdef PRECOMPILED_HEADERS
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/accelcfg.hxx b/unotools/inc/unotools/accelcfg.hxx
index 5f0fcc61f9c4..9bc3f2178e34 100644
--- a/unotools/inc/unotools/accelcfg.hxx
+++ b/unotools/inc/unotools/accelcfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,5 @@ public:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/accessiblerelationsethelper.hxx b/unotools/inc/unotools/accessiblerelationsethelper.hxx
index ba853381329f..7c20ed7a8281 100644
--- a/unotools/inc/unotools/accessiblerelationsethelper.hxx
+++ b/unotools/inc/unotools/accessiblerelationsethelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,15 +31,13 @@
#include "unotools/unotoolsdllapi.h"
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESSTATESET_HPP_
#include <com/sun/star/accessibility/XAccessibleRelationSet.hpp>
-#endif
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weak.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/servicehelper.hxx>
@@ -148,7 +147,7 @@ public:
protected:
/// Mutex guarding this object.
- ::vos::OMutex maMutex;
+ ::osl::Mutex maMutex;
private:
/// The implementation of this helper interface.
@@ -159,3 +158,5 @@ private:
}
//... namespace utl .......................................................
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/accessiblestatesethelper.hxx b/unotools/inc/unotools/accessiblestatesethelper.hxx
index 3847beeee146..5ef72a89f7eb 100644
--- a/unotools/inc/unotools/accessiblestatesethelper.hxx
+++ b/unotools/inc/unotools/accessiblestatesethelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,15 +30,13 @@
#include "unotools/unotoolsdllapi.h"
-#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLESSTATESET_HPP_
#include <com/sun/star/accessibility/XAccessibleStateSet.hpp>
-#endif
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weak.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XServiceName.hpp>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <cppuhelper/implbase1.hxx>
#include <comphelper/servicehelper.hxx>
@@ -170,7 +169,7 @@ public:
protected:
/// Mutex guarding this object.
- ::vos::OMutex maMutex;
+ ::osl::Mutex maMutex;
private:
/// The implementation of this helper interface.
@@ -181,3 +180,5 @@ private:
}
//... namespace utl .......................................................
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/atom.hxx b/unotools/inc/unotools/atom.hxx
index 8576b31f6970..c6cff2529343 100644
--- a/unotools/inc/unotools/atom.hxx
+++ b/unotools/inc/unotools/atom.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,10 +33,8 @@
#include <osl/mutex.hxx>
#include <cppuhelper/implbase1.hxx>
-#include <hash_map>
-#ifndef __SGI_STL_LIST
+#include <boost/unordered_map.hpp>
#include <list>
-#endif
#include <com/sun/star/util/XAtomServer.hpp>
#define INVALID_ATOM 0
@@ -51,8 +50,8 @@ namespace utl {
class AtomProvider
{
int m_nAtoms;
- ::std::hash_map< int, ::rtl::OUString, ::std::hash< int > > m_aStringMap;
- ::std::hash_map< ::rtl::OUString, int, ::rtl::OUStringHash > m_aAtomMap;
+ ::boost::unordered_map< int, ::rtl::OUString, ::boost::hash< int > > m_aStringMap;
+ ::boost::unordered_map< ::rtl::OUString, int, ::rtl::OUStringHash > m_aAtomMap;
public:
AtomProvider();
~AtomProvider();
@@ -73,7 +72,7 @@ namespace utl {
class UNOTOOLS_DLLPUBLIC MultiAtomProvider
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > > m_aAtomLists;
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > > m_aAtomLists;
public:
MultiAtomProvider();
~MultiAtomProvider();
@@ -130,3 +129,5 @@ namespace utl {
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/bootstrap.hxx b/unotools/inc/unotools/bootstrap.hxx
index bbb476fdaf9e..81135c43fab9 100644
--- a/unotools/inc/unotools/bootstrap.hxx
+++ b/unotools/inc/unotools/bootstrap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,6 +55,9 @@ namespace utl
/// retrieve the product key; uses the given default, if not found
static rtl::OUString getProductKey(rtl::OUString const& _sDefault);
+ /// retrieve the product version
+ static rtl::OUString getProductVersion();
+
/// retrieve the product source (MWS name)
static ::rtl::OUString getProductSource(rtl::OUString const& _sDefault);
@@ -130,9 +134,11 @@ namespace utl
public:
// singleton impl-class
class Impl;
- static Impl const& data(); // the data related to the bootstrap.ini file
+ static const Impl& data(); // the data related to the bootstrap.ini file
};
//-----------------------------------------------------------------------------
} // namespace utl
#endif // _UTL_BOOTSTRAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/cacheoptions.hxx b/unotools/inc/unotools/cacheoptions.hxx
index 432a91e67070..698a297fffe7 100644
--- a/unotools/inc/unotools/cacheoptions.hxx
+++ b/unotools/inc/unotools/cacheoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -171,3 +172,5 @@ class UNOTOOLS_DLLPUBLIC SvtCacheOptions
};
#endif // #ifndef INCLUDED_unotools_CACHEOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/calendarwrapper.hxx b/unotools/inc/unotools/calendarwrapper.hxx
index f5a8a06b1f6c..ee240d0a858c 100644
--- a/unotools/inc/unotools/calendarwrapper.hxx
+++ b/unotools/inc/unotools/calendarwrapper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -131,3 +132,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/caserotate.hxx b/unotools/inc/unotools/caserotate.hxx
new file mode 100644
index 000000000000..c88285788266
--- /dev/null
+++ b/unotools/inc/unotools/caserotate.hxx
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Caolán McNamara <caolanm@redhat.com>
+ *
+ * Contributor(s):
+ * Caolán McNamara <caolanm@redhat.com>
+ * Dózsa Bálint <dozsa@linux-dugf.site>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+#ifndef INCLUDED_UNOTOOLS_CASEROTATE_HXX
+#define INCLUDED_UNOTOOLS_CASEROTATE_HXX
+
+#include <sal/config.h>
+
+#include "unotools/unotoolsdllapi.h"
+
+//TODO Use XCharacterClassification::getStringType to determine the current
+//(possibly mixed) case type and rotate to the next one
+
+class UNOTOOLS_DLLPUBLIC RotateTransliteration
+{
+private:
+ int nF3ShiftCounter;
+public:
+ RotateTransliteration() : nF3ShiftCounter(0)
+ {
+ }
+ sal_uInt32 getNextMode();
+};
+
+#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/charclass.hxx b/unotools/inc/unotools/charclass.hxx
index 4469ed8ffc3d..8cd379f678dd 100644
--- a/unotools/inc/unotools/charclass.hxx
+++ b/unotools/inc/unotools/charclass.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -234,3 +235,5 @@ public:
#endif // _UNOTOOLS_CHARCLASS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/cmdoptions.hxx b/unotools/inc/unotools/cmdoptions.hxx
index c2454d9582ee..719d99db4461 100644
--- a/unotools/inc/unotools/cmdoptions.hxx
+++ b/unotools/inc/unotools/cmdoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -253,3 +254,5 @@ class UNOTOOLS_DLLPUBLIC SvtCommandOptions: public utl::detail::Options
}; // class SvtCmdOptions
#endif // #ifndef INCLUDED_unotools_CMDOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/collatorwrapper.hxx b/unotools/inc/unotools/collatorwrapper.hxx
index e4f2a3443f1d..3b90c8465cf1 100644
--- a/unotools/inc/unotools/collatorwrapper.hxx
+++ b/unotools/inc/unotools/collatorwrapper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,9 +30,7 @@
#ifndef _UNOTOOLS_COLLATORWRAPPER_HXX
#define _UNOTOOLS_COLLATORWRAPPER_HXX
-#ifndef _COM_SUN_STAR_UTIL_XCOLLATOR_HPP_
#include <com/sun/star/i18n/XCollator.hpp>
-#endif
namespace com { namespace sun { namespace star { namespace lang {
class XMultiServiceFactory;
@@ -95,3 +94,5 @@ class UNOTOOLS_DLLPUBLIC CollatorWrapper
};
#endif /* _UNOTOOLS_COLLATORWRAPPER_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/compatibility.hxx b/unotools/inc/unotools/compatibility.hxx
index eb01e43f3ba0..42e207f08056 100644
--- a/unotools/inc/unotools/compatibility.hxx
+++ b/unotools/inc/unotools/compatibility.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -153,6 +154,8 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options
void Clear();
+ void SetDefault( ::rtl::OUString sName, bool bValue );
+
/*-****************************************************************************************************//**
@short return complete specified list
@descr Call it to get all entries of compatibility options.
@@ -251,3 +254,4 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityOptions: public utl::detail::Options
#endif // #ifndef INCLUDED_unotools_COMPATIBILITY_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/componentresmodule.hxx b/unotools/inc/unotools/componentresmodule.hxx
index 079af63e9b4a..0ac796f33d73 100644
--- a/unotools/inc/unotools/componentresmodule.hxx
+++ b/unotools/inc/unotools/componentresmodule.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -148,22 +149,8 @@ namespace utl
OSingletonRegistration() : BaseClass( ModuleClass::getInstance() ) \
{ \
} \
- }; \
- \
- /* -------------------------------------------------------------------- */ \
- template < class TYPE > \
- class OLegacySingletonRegistration : public ::comphelper::OLegacySingletonRegistration< TYPE > \
- { \
- private: \
- typedef ::comphelper::OLegacySingletonRegistration< TYPE > BaseClass; \
- \
- public: \
- OLegacySingletonRegistration() : BaseClass( ModuleClass::getInstance() ) \
- { \
- } \
};
-
//====================================================================
//= implementing a concrete module
//====================================================================
@@ -201,3 +188,4 @@ namespace utl
#endif // UNOTOOLS_INC_UNOTOOLS_COMPONENTRESMODULE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/configitem.hxx b/unotools/inc/unotools/configitem.hxx
index d1477cba1b74..dd1ab6964b93 100644
--- a/unotools/inc/unotools/configitem.hxx
+++ b/unotools/inc/unotools/configitem.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,7 +115,7 @@ namespace utl
GetTree();
protected:
- ConfigItem(const rtl::OUString rSubTree,
+ ConfigItem(const rtl::OUString &rSubTree,
sal_Int16 nMode = CONFIG_MODE_DELAYED_UPDATE);
ConfigItem(utl::ConfigManager& rManager, const rtl::OUString rSubTree);
@@ -210,3 +211,5 @@ namespace utl
};
}//namespace utl
#endif //_UTL_CONFIGITEM_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/configmgr.hxx b/unotools/inc/unotools/configmgr.hxx
index c26ff5245739..61bcac6b8737 100644
--- a/unotools/inc/unotools/configmgr.hxx
+++ b/unotools/inc/unotools/configmgr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -54,7 +55,6 @@ namespace utl
xConfigurationProvider;
ConfigMgr_Impl* pMgrImpl;
- static ConfigManager* pConfigManager;
static void getBasisAboutBoxProductVersion( rtl::OUString& rVersion );
public:
@@ -80,8 +80,7 @@ namespace utl
void StoreConfigItems();
- static ConfigManager* GetConfigManager();
- static void RemoveConfigManager();
+ static ConfigManager& GetConfigManager();
static rtl::OUString GetConfigBaseURL();
enum ConfigProperty
@@ -114,3 +113,5 @@ namespace utl
};
}//namespace utl
#endif //_UTL_CONFIGMGR_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/confignode.hxx b/unotools/inc/unotools/confignode.hxx
index 57b5f5bd2afb..baa812d28d56 100644
--- a/unotools/inc/unotools/confignode.hxx
+++ b/unotools/inc/unotools/confignode.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -359,3 +360,4 @@ namespace utl
#endif // _UNOTOOLS_CONFIGNODE_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/configpathes.hxx b/unotools/inc/unotools/configpathes.hxx
index 4e537193b22f..30a0845e3541 100644
--- a/unotools/inc/unotools/configpathes.hxx
+++ b/unotools/inc/unotools/configpathes.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -179,3 +180,4 @@ namespace utl
#endif // UNOTOOLS_CONFIGPATHES_HXX_INCLUDED
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/configvaluecontainer.hxx b/unotools/inc/unotools/configvaluecontainer.hxx
index 57a140a00e58..ed336373f703 100644
--- a/unotools/inc/unotools/configvaluecontainer.hxx
+++ b/unotools/inc/unotools/configvaluecontainer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -234,3 +235,4 @@ namespace utl
#endif // UNOTOOLS_CONFIGVALUECONTAINER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/datetime.hxx b/unotools/inc/unotools/datetime.hxx
index ef02822f1dc5..282d6df3a63f 100644
--- a/unotools/inc/unotools/datetime.hxx
+++ b/unotools/inc/unotools/datetime.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -61,3 +62,4 @@ namespace utl
#endif // _UNOTOOLS_DATETIME_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/defaultoptions.hxx b/unotools/inc/unotools/defaultoptions.hxx
index f4c10f0b9e09..ee6b005f05df 100644
--- a/unotools/inc/unotools/defaultoptions.hxx
+++ b/unotools/inc/unotools/defaultoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,4 @@ public:
#endif // #ifndef INCLUDED_unotools_DEFAULTOPTIONS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/desktopterminationobserver.hxx b/unotools/inc/unotools/desktopterminationobserver.hxx
index 6b1f0d3e52f6..701097b08f7a 100644
--- a/unotools/inc/unotools/desktopterminationobserver.hxx
+++ b/unotools/inc/unotools/desktopterminationobserver.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,4 @@ namespace utl
#endif // UNOTOOLS_INC_UNOTOOLS_DESKTOPTERMINATIONOBSERVER_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/digitgroupingiterator.hxx b/unotools/inc/unotools/digitgroupingiterator.hxx
index 19f3ebf37abb..acf1dcc945f0 100644
--- a/unotools/inc/unotools/digitgroupingiterator.hxx
+++ b/unotools/inc/unotools/digitgroupingiterator.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -202,3 +203,5 @@ public:
} // namespace utl
#endif // INCLUDED_UNOTOOLS_DIGITGROUPINGITERATOR_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/docinfohelper.hxx b/unotools/inc/unotools/docinfohelper.hxx
index 9ce9d346af20..ed3ff52f2ca0 100644
--- a/unotools/inc/unotools/docinfohelper.hxx
+++ b/unotools/inc/unotools/docinfohelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,3 +46,4 @@ public:
#endif // _UNOTOOLS_DOCINFOHELPER_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/dynamicmenuoptions.hxx b/unotools/inc/unotools/dynamicmenuoptions.hxx
index 9d695e166471..e47bd0b6d723 100644
--- a/unotools/inc/unotools/dynamicmenuoptions.hxx
+++ b/unotools/inc/unotools/dynamicmenuoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -217,3 +218,5 @@ class UNOTOOLS_DLLPUBLIC SvtDynamicMenuOptions: public utl::detail::Options
}; // class SvtDynamicMenuOptions
#endif // #ifndef INCLUDED_unotools_DYNAMICMENUOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/eventcfg.hxx b/unotools/inc/unotools/eventcfg.hxx
index 839811f9dd80..05dec2159595 100644
--- a/unotools/inc/unotools/eventcfg.hxx
+++ b/unotools/inc/unotools/eventcfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include <com/sun/star/frame/XFrame.hpp>
#include <cppuhelper/weakref.hxx>
#include <cppuhelper/implbase2.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <vector>
#define STR_EVENT_STARTAPP 0
@@ -66,7 +67,7 @@
#define STR_EVENT_MODECHANGED 26
#define STR_EVENT_STORAGECHANGED 27
-typedef ::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > EventBindingHash;
+typedef ::boost::unordered_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > EventBindingHash;
typedef ::std::vector< ::com::sun::star::uno::WeakReference< ::com::sun::star::frame::XFrame > > FrameVector;
typedef ::std::vector< ::rtl::OUString > SupportedEventsVector;
@@ -120,3 +121,5 @@ class UNOTOOLS_DLLPUBLIC GlobalEventConfig:
};
#endif // _EVENTCFG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/eventlisteneradapter.hxx b/unotools/inc/unotools/eventlisteneradapter.hxx
index c46cabc4dffb..1252be9445fe 100644
--- a/unotools/inc/unotools/eventlisteneradapter.hxx
+++ b/unotools/inc/unotools/eventlisteneradapter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,4 @@ namespace utl
#endif // _UNOTOOLS_EVENTLISTENERADAPTER_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/extendedsecurityoptions.hxx b/unotools/inc/unotools/extendedsecurityoptions.hxx
index 6e6b04472d31..478e1f274663 100644
--- a/unotools/inc/unotools/extendedsecurityoptions.hxx
+++ b/unotools/inc/unotools/extendedsecurityoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -158,3 +159,5 @@ class UNOTOOLS_DLLPUBLIC SvtExtendedSecurityOptions: public utl::detail::Options
}; // class SvtExtendedSecurityOptions
#endif // #ifndef INCLUDED_unotools_EXTENDEDSECURITYOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/fltrcfg.hxx b/unotools/inc/unotools/fltrcfg.hxx
index 890efebde071..e601804e6c53 100644
--- a/unotools/inc/unotools/fltrcfg.hxx
+++ b/unotools/inc/unotools/fltrcfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,6 +49,8 @@ public:
void SetLoadWordBasicCode( sal_Bool bFlag );
sal_Bool IsLoadWordBasicCode() const;
+ void SetLoadWordBasicExecutable( sal_Bool bFlag );
+ sal_Bool IsLoadWordBasicExecutable() const;
void SetLoadWordBasicStorage( sal_Bool bFlag );
sal_Bool IsLoadWordBasicStorage() const;
@@ -98,3 +101,4 @@ public:
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/fontcfg.hxx b/unotools/inc/unotools/fontcfg.hxx
index 37bbdf3018e3..7932bc5cda46 100644
--- a/unotools/inc/unotools/fontcfg.hxx
+++ b/unotools/inc/unotools/fontcfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,8 +35,8 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
-#include <hash_map>
-#include <hash_set>
+#include <boost/unordered_map.hpp>
+#include <boost/unordered_set.hpp>
#include <vector>
namespace com {
@@ -85,18 +86,18 @@ class UNOTOOLS_DLLPUBLIC DefaultFontConfiguration
mutable com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xAccess;
};
- std::hash_map< com::sun::star::lang::Locale,
+ boost::unordered_map< com::sun::star::lang::Locale,
LocaleAccess,
utl::LocaleHash >
m_aConfig;
rtl::OUString tryLocale( const com::sun::star::lang::Locale& rLocale, const rtl::OUString& rType ) const;
- DefaultFontConfiguration();
public:
+ DefaultFontConfiguration();
~DefaultFontConfiguration();
- static DefaultFontConfiguration* get();
+ static DefaultFontConfiguration& get();
rtl::OUString getDefaultFont( const com::sun::star::lang::Locale& rLocale, int nType ) const;
rtl::OUString getUserInterfaceFont( const com::sun::star::lang::Locale& rLocale ) const;
@@ -191,8 +192,8 @@ private:
LocaleSubst() : bConfigRead( false ) {}
};
- std::hash_map< com::sun::star::lang::Locale, LocaleSubst, utl::LocaleHash > m_aSubst;
- typedef std::hash_set< rtl::OUString, rtl::OUStringHash > UniqueSubstHash;
+ boost::unordered_map< com::sun::star::lang::Locale, LocaleSubst, utl::LocaleHash > m_aSubst;
+ typedef boost::unordered_set< rtl::OUString, rtl::OUStringHash > UniqueSubstHash;
mutable UniqueSubstHash maSubstHash;
@@ -206,11 +207,11 @@ private:
unsigned long getSubstType( const com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > xFont,
const rtl::OUString& rType ) const;
void readLocaleSubst( const com::sun::star::lang::Locale& rLocale ) const;
- FontSubstConfiguration();
public:
+ FontSubstConfiguration();
~FontSubstConfiguration();
- static FontSubstConfiguration* get();
+ static FontSubstConfiguration& get();
const FontNameAttr* getSubstInfo(
const String& rFontName,
@@ -225,3 +226,5 @@ public:
} // namespace utl
#endif // _UNOTOOLS_FONTCFG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/fontcvt.hxx b/unotools/inc/unotools/fontcvt.hxx
index 715ffeb56623..12d937cb62e4 100644
--- a/unotools/inc/unotools/fontcvt.hxx
+++ b/unotools/inc/unotools/fontcvt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -77,3 +78,5 @@ public:
//which were inside and those outside the unicode private area.
UNOTOOLS_DLLPUBLIC StarSymbolToMSMultiFont *CreateStarSymbolToMSMultiFont(bool bPerfectOnly=false);
#endif // _UNOTOOLS_FONTCVT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/fontdefs.hxx b/unotools/inc/unotools/fontdefs.hxx
index 3ba232b6eba4..12d9c43a109d 100644
--- a/unotools/inc/unotools/fontdefs.hxx
+++ b/unotools/inc/unotools/fontdefs.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,3 +109,5 @@ UNOTOOLS_DLLPUBLIC String GetNextFontToken( const String& rTokenStr, xub_StrLen&
UNOTOOLS_DLLPUBLIC void GetEnglishSearchFontName( String& rName );
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/fontoptions.hxx b/unotools/inc/unotools/fontoptions.hxx
index 7809fb4380cf..1c438ae44570 100644
--- a/unotools/inc/unotools/fontoptions.hxx
+++ b/unotools/inc/unotools/fontoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -171,3 +172,5 @@ class UNOTOOLS_DLLPUBLIC SvtFontOptions: public utl::detail::Options
}; // class SvtFontOptions
#endif // #ifndef INCLUDED_unotools_FONTOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/historyoptions.hxx b/unotools/inc/unotools/historyoptions.hxx
index 50b411e5d17e..ee3b9c0dd5ea 100644
--- a/unotools/inc/unotools/historyoptions.hxx
+++ b/unotools/inc/unotools/historyoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -246,3 +247,5 @@ class UNOTOOLS_DLLPUBLIC SvtHistoryOptions: public utl::detail::Options
}; // class SvtHistoryOptions
#endif // #ifndef INCLUDED_SVTOOLS_HISTORYOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/historyoptions_const.hxx b/unotools/inc/unotools/historyoptions_const.hxx
index 1d57d5146666..b432e02a9f89 100644
--- a/unotools/inc/unotools/historyoptions_const.hxx
+++ b/unotools/inc/unotools/historyoptions_const.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,21 +36,23 @@
namespace
{
- static const ::rtl::OUString s_sCommonHistory = ::rtl::OUString::createFromAscii("org.openoffice.Office.Common/History");
- static const ::rtl::OUString s_sHistories = ::rtl::OUString::createFromAscii("org.openoffice.Office.Histories/Histories");
- static const ::rtl::OUString s_sPickListSize = ::rtl::OUString::createFromAscii("PickListSize");
- static const ::rtl::OUString s_sURLHistorySize = ::rtl::OUString::createFromAscii("Size");
- static const ::rtl::OUString s_sHelpBookmarksSize = ::rtl::OUString::createFromAscii("HelpBookmarkSize");
- static const ::rtl::OUString s_sPickList = ::rtl::OUString::createFromAscii("PickList");
- static const ::rtl::OUString s_sURLHistory = ::rtl::OUString::createFromAscii("URLHistory");
- static const ::rtl::OUString s_sHelpBookmarks = ::rtl::OUString::createFromAscii("HelpBookmarks");
- static const ::rtl::OUString s_sItemList = ::rtl::OUString::createFromAscii("ItemList");
- static const ::rtl::OUString s_sOrderList = ::rtl::OUString::createFromAscii("OrderList");
- static const ::rtl::OUString s_sHistoryItemRef = ::rtl::OUString::createFromAscii("HistoryItemRef");
- static const ::rtl::OUString s_sURL = ::rtl::OUString::createFromAscii("URL");
- static const ::rtl::OUString s_sFilter = ::rtl::OUString::createFromAscii("Filter");
- static const ::rtl::OUString s_sTitle = ::rtl::OUString::createFromAscii("Title");
- static const ::rtl::OUString s_sPassword = ::rtl::OUString::createFromAscii("Password");
+ static const ::rtl::OUString s_sCommonHistory(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Common/History"));
+ static const ::rtl::OUString s_sHistories(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Histories/Histories"));
+ static const ::rtl::OUString s_sPickListSize(RTL_CONSTASCII_USTRINGPARAM("PickListSize"));
+ static const ::rtl::OUString s_sURLHistorySize(RTL_CONSTASCII_USTRINGPARAM("Size"));
+ static const ::rtl::OUString s_sHelpBookmarksSize(RTL_CONSTASCII_USTRINGPARAM("HelpBookmarkSize"));
+ static const ::rtl::OUString s_sPickList(RTL_CONSTASCII_USTRINGPARAM("PickList"));
+ static const ::rtl::OUString s_sURLHistory(RTL_CONSTASCII_USTRINGPARAM("URLHistory"));
+ static const ::rtl::OUString s_sHelpBookmarks(RTL_CONSTASCII_USTRINGPARAM("HelpBookmarks"));
+ static const ::rtl::OUString s_sItemList(RTL_CONSTASCII_USTRINGPARAM("ItemList"));
+ static const ::rtl::OUString s_sOrderList(RTL_CONSTASCII_USTRINGPARAM("OrderList"));
+ static const ::rtl::OUString s_sHistoryItemRef(RTL_CONSTASCII_USTRINGPARAM("HistoryItemRef"));
+ static const ::rtl::OUString s_sURL(RTL_CONSTASCII_USTRINGPARAM("URL"));
+ static const ::rtl::OUString s_sFilter(RTL_CONSTASCII_USTRINGPARAM("Filter"));
+ static const ::rtl::OUString s_sTitle(RTL_CONSTASCII_USTRINGPARAM("Title"));
+ static const ::rtl::OUString s_sPassword(RTL_CONSTASCII_USTRINGPARAM("Password"));
}
#endif // INCLUDE_CONFIGITEMS_HISTORYOPTIONS_CONST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/idhelper.hxx b/unotools/inc/unotools/idhelper.hxx
index d8c734025b12..0b66c6c67671 100644
--- a/unotools/inc/unotools/idhelper.hxx
+++ b/unotools/inc/unotools/idhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -208,3 +209,4 @@ void classname::implCreateMap() \
#endif // _UNOTOOLS_ID_HELPER_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/inetoptions.hxx b/unotools/inc/unotools/inetoptions.hxx
index f69d3d211c9c..420705101d12 100644
--- a/unotools/inc/unotools/inetoptions.hxx
+++ b/unotools/inc/unotools/inetoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -75,27 +76,21 @@ public:
enum ProxyType { NONE, AUTOMATIC, MANUAL };
rtl::OUString GetProxyNoProxy() const;
-
sal_Int32 GetProxyType() const;
rtl::OUString GetProxyFtpName() const;
-
sal_Int32 GetProxyFtpPort() const;
rtl::OUString GetProxyHttpName() const;
-
sal_Int32 GetProxyHttpPort() const;
void SetProxyNoProxy(rtl::OUString const & rValue, bool bFlush = false);
-
void SetProxyType(ProxyType eValue, bool bFlush = false);
void SetProxyFtpName(rtl::OUString const & rValue, bool bFlush = false);
-
void SetProxyFtpPort(sal_Int32 nValue, bool bFlush = false);
void SetProxyHttpName(rtl::OUString const & rValue, bool bFlush = false);
-
void SetProxyHttpPort(sal_Int32 nValue, bool bFlush = false);
void flush();
@@ -141,3 +136,5 @@ private:
};
#endif // _unotools_INETOPTIONS_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/internaloptions.hxx b/unotools/inc/unotools/internaloptions.hxx
index 7e2be078811d..38bb8337dc55 100644
--- a/unotools/inc/unotools/internaloptions.hxx
+++ b/unotools/inc/unotools/internaloptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -178,3 +179,5 @@ class UNOTOOLS_DLLPUBLIC SvtInternalOptions: public utl::detail::Options
}; // class SvtInternalOptions
#endif // #ifndef INCLUDED_unotools_INTERNALOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/intlwrapper.hxx b/unotools/inc/unotools/intlwrapper.hxx
index 1ccc85b55037..d614a2088e4e 100644
--- a/unotools/inc/unotools/intlwrapper.hxx
+++ b/unotools/inc/unotools/intlwrapper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -121,3 +122,5 @@ public:
};
#endif // _UNOTOOLS_INTLWRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/itemholderbase.hxx b/unotools/inc/unotools/itemholderbase.hxx
index df1892d41a12..8f14f9a17f11 100644
--- a/unotools/inc/unotools/itemholderbase.hxx
+++ b/unotools/inc/unotools/itemholderbase.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -126,3 +127,5 @@ struct TItemInfo
typedef ::std::vector< TItemInfo > TItems;
#endif // INCLUDED_unotools_ITEMHOLDERBASE_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/javaoptions.hxx b/unotools/inc/unotools/javaoptions.hxx
index 38e023556716..04c60bf4bab7 100644
--- a/unotools/inc/unotools/javaoptions.hxx
+++ b/unotools/inc/unotools/javaoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -71,3 +72,4 @@ public:
#endif //
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/lingucfg.hxx b/unotools/inc/unotools/lingucfg.hxx
index affba64d9377..f1a2e119a2ed 100755..100644
--- a/unotools/inc/unotools/lingucfg.hxx
+++ b/unotools/inc/unotools/lingucfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -227,11 +228,11 @@ public:
std::vector< SvtLinguConfigDictionaryEntry > GetActiveDictionariesByFormat( const rtl::OUString &rFormatName );
// functions returning file URLs to the respective images (if found) and empty string otherwise
- ::rtl::OUString GetSpellAndGrammarDialogImage( const ::rtl::OUString &rServiceImplName, bool bHighContrast = false ) const;
- ::rtl::OUString GetSpellAndGrammarContextSuggestionImage( const ::rtl::OUString &rServiceImplName, bool bHighContrast = false ) const;
- ::rtl::OUString GetSpellAndGrammarContextDictionaryImage( const ::rtl::OUString &rServiceImplName, bool bHighContrast = false ) const;
- ::rtl::OUString GetThesaurusDialogImage( const ::rtl::OUString &rServiceImplName, bool bHighContrast = false ) const;
- ::rtl::OUString GetSynonymsContextImage( const ::rtl::OUString &rServiceImplName, bool bHighContrast = false ) const;
+ ::rtl::OUString GetSpellAndGrammarDialogImage( const ::rtl::OUString &rServiceImplName ) const;
+ ::rtl::OUString GetSpellAndGrammarContextSuggestionImage( const ::rtl::OUString &rServiceImplName ) const;
+ ::rtl::OUString GetSpellAndGrammarContextDictionaryImage( const ::rtl::OUString &rServiceImplName ) const;
+ ::rtl::OUString GetThesaurusDialogImage( const ::rtl::OUString &rServiceImplName ) const;
+ ::rtl::OUString GetSynonymsContextImage( const ::rtl::OUString &rServiceImplName ) const;
bool HasVendorImages( const char *pImageName ) const;
bool HasGrammarChecker() const;
@@ -241,3 +242,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/linguprops.hxx b/unotools/inc/unotools/linguprops.hxx
index 4f2640116454..902dc1c91f0a 100644
--- a/unotools/inc/unotools/linguprops.hxx
+++ b/unotools/inc/unotools/linguprops.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,3 +120,4 @@
#define UPH_IS_GRAMMAR_INTERACTIVE 35
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/localedatawrapper.hxx b/unotools/inc/unotools/localedatawrapper.hxx
index 0e815f61ccb6..306316683b94 100644
--- a/unotools/inc/unotools/localedatawrapper.hxx
+++ b/unotools/inc/unotools/localedatawrapper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,9 +36,7 @@
#include <unotools/readwritemutexguard.hxx>
#include "unotools/unotoolsdllapi.h"
-#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
#include <boost/shared_ptr.hpp>
-#endif
namespace com { namespace sun { namespace star {
@@ -361,3 +360,5 @@ private:
#endif // _UNOTOOLS_LOCALEDATAWRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/localfilehelper.hxx b/unotools/inc/unotools/localfilehelper.hxx
index 11e0851c3298..08be26017cdc 100644
--- a/unotools/inc/unotools/localfilehelper.hxx
+++ b/unotools/inc/unotools/localfilehelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -66,3 +67,5 @@ public:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/localisationoptions.hxx b/unotools/inc/unotools/localisationoptions.hxx
index acce942f6a42..f9aa7a850e0b 100644
--- a/unotools/inc/unotools/localisationoptions.hxx
+++ b/unotools/inc/unotools/localisationoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -176,3 +177,5 @@ class UNOTOOLS_DLLPUBLIC SvtLocalisationOptions: public utl::detail::Options
}; // class SvtLocalisationOptions
#endif // #ifndef INCLUDED_unotools_LOCALISATIONOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/loghelper.hxx b/unotools/inc/unotools/loghelper.hxx
index d5421089dff4..bae5c7ed09c4 100644
--- a/unotools/inc/unotools/loghelper.hxx
+++ b/unotools/inc/unotools/loghelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,8 +45,9 @@ inline void logIt(const css::uno::Exception& ex)
sMsg.appendAscii("Unexpected exception catched. Original message was:\n\"" );
sMsg.append(ex.Message);
sMsg.appendAscii("\"");
- OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr());
+ OSL_FAIL(::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr());
}
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/misccfg.hxx b/unotools/inc/unotools/misccfg.hxx
index 9751e494e9a1..39777fc0b3d7 100644
--- a/unotools/inc/unotools/misccfg.hxx
+++ b/unotools/inc/unotools/misccfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,6 @@
#include "tools/solar.h"
#include "unotools/options.hxx"
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
namespace utl
{
class SfxMiscCfg;
@@ -65,3 +63,4 @@ public:
#endif // _MISCCFG_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/moduleoptions.hxx b/unotools/inc/unotools/moduleoptions.hxx
index d48a390a30bc..a2b89f98528b 100644
--- a/unotools/inc/unotools/moduleoptions.hxx
+++ b/unotools/inc/unotools/moduleoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -255,3 +256,5 @@ class UNOTOOLS_DLLPUBLIC SvtModuleOptions: public utl::detail::Options
}; // class SvtModuleOptions
#endif // #ifndef INCLUDED_SVTOOLS_MODULEOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/nativenumberwrapper.hxx b/unotools/inc/unotools/nativenumberwrapper.hxx
index 9b7d5c130a51..99acc411080b 100644
--- a/unotools/inc/unotools/nativenumberwrapper.hxx
+++ b/unotools/inc/unotools/nativenumberwrapper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -73,3 +74,5 @@ public:
};
#endif // _UNOTOOLS_NATIVENUMBERWRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/numberformatcodewrapper.hxx b/unotools/inc/unotools/numberformatcodewrapper.hxx
index 394346275b14..f0bf53f5da55 100644
--- a/unotools/inc/unotools/numberformatcodewrapper.hxx
+++ b/unotools/inc/unotools/numberformatcodewrapper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,3 +75,5 @@ public:
};
#endif // _UNOTOOLS_NUMBERFORMATCODEWRAPPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/options.hxx b/unotools/inc/unotools/options.hxx
index 0279e16df1d9..d743e9571524 100644
--- a/unotools/inc/unotools/options.hxx
+++ b/unotools/inc/unotools/options.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,6 +31,7 @@
#include "sal/config.h"
#include "unotools/unotoolsdllapi.h"
+#include <vector>
/*
The class utl::detail::Options provides a kind of multiplexer. It implements a ConfigurationListener
@@ -43,7 +45,6 @@
namespace utl {
class ConfigurationBroadcaster;
- class IMPL_ConfigurationListenerList;
// interface for configuration listener
class UNOTOOLS_DLLPUBLIC ConfigurationListener
@@ -51,6 +52,7 @@ namespace utl {
public:
virtual void ConfigurationChanged( ConfigurationBroadcaster* p, sal_uInt32 nHint=0 ) = 0;
};
+ typedef ::std::vector< ConfigurationListener* > IMPL_ConfigurationListenerList;
// complete broadcasting implementation
class UNOTOOLS_DLLPUBLIC ConfigurationBroadcaster
@@ -95,3 +97,5 @@ protected:
} }
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/optionsdlg.hxx b/unotools/inc/unotools/optionsdlg.hxx
index 833e8d5700c3..9a0034e1a3c8 100644
--- a/unotools/inc/unotools/optionsdlg.hxx
+++ b/unotools/inc/unotools/optionsdlg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,9 +28,7 @@
#ifndef INCLUDED_unotools_OPTIONSDLG_HXX
#define INCLUDED_unotools_OPTIONSDLG_HXX
-#ifndef INCLUDED_unotoolsdllapi_H
#include "unotools/unotoolsdllapi.h"
-#endif
#include <tools/string.hxx>
#include <unotools/options.hxx>
@@ -54,3 +53,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/pathoptions.hxx b/unotools/inc/unotools/pathoptions.hxx
index 1308c2d181e2..53e6ccaca463 100644
--- a/unotools/inc/unotools/pathoptions.hxx
+++ b/unotools/inc/unotools/pathoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -139,3 +140,4 @@ public:
#endif // #ifndef INCLUDED_unotools_PATHOPTIONS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/printwarningoptions.hxx b/unotools/inc/unotools/printwarningoptions.hxx
index 94f3bc6a3ddb..da8395a520d9 100644
--- a/unotools/inc/unotools/printwarningoptions.hxx
+++ b/unotools/inc/unotools/printwarningoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -159,3 +160,5 @@ class UNOTOOLS_DLLPUBLIC SvtPrintWarningOptions: public utl::detail::Options
}; // class SvtPrintWarningOptions
#endif // #ifndef INCLUDED_unotools_PRINTWARNINGOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/processfactory.hxx b/unotools/inc/unotools/processfactory.hxx
index fd852f2c46fa..a9573ec7f401 100644
--- a/unotools/inc/unotools/processfactory.hxx
+++ b/unotools/inc/unotools/processfactory.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -57,3 +58,4 @@ UNOTOOLS_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMu
#endif // _UNOTOOLS_PROCESSFACTORY_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/progresshandlerwrap.hxx b/unotools/inc/unotools/progresshandlerwrap.hxx
index 4326da0a331f..c1623221ff30 100644
--- a/unotools/inc/unotools/progresshandlerwrap.hxx
+++ b/unotools/inc/unotools/progresshandlerwrap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -55,3 +56,4 @@ public:
#endif // _UTL_PROGRESSHANDLERWRAP_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/propertysethelper.hxx b/unotools/inc/unotools/propertysethelper.hxx
index ad6508e76df3..5f6a80e2c03a 100644
--- a/unotools/inc/unotools/propertysethelper.hxx
+++ b/unotools/inc/unotools/propertysethelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -94,3 +95,4 @@ public:
#endif // _UTL_PROPERTYSETHELPER_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/propertysetinfo.hxx b/unotools/inc/unotools/propertysetinfo.hxx
index 7e3f26dfc73b..7ed5bed46e1a 100644
--- a/unotools/inc/unotools/propertysetinfo.hxx
+++ b/unotools/inc/unotools/propertysetinfo.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -91,3 +92,4 @@ public:
#endif // _UTL_PROPERTSETINFO_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/querydeep.hxx b/unotools/inc/unotools/querydeep.hxx
index fd57f38147d0..8b44a3c39672 100644
--- a/unotools/inc/unotools/querydeep.hxx
+++ b/unotools/inc/unotools/querydeep.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -484,3 +485,4 @@ inline ::com::sun::star::uno::Any queryDeepInterface(
#endif // _UNOTOOLS_QUERYDEEPINTERFACE_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/readwritemutexguard.hxx b/unotools/inc/unotools/readwritemutexguard.hxx
index 3035d5bda878..f428e105faf7 100644
--- a/unotools/inc/unotools/readwritemutexguard.hxx
+++ b/unotools/inc/unotools/readwritemutexguard.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111,3 +112,4 @@ public:
#endif // INCLUDED_UNOTOOLS_READWRITEMUTEXGUARD_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/regoptions.hxx b/unotools/inc/unotools/regoptions.hxx
index 1cca531886ca..e43d61f9ba6b 100644
--- a/unotools/inc/unotools/regoptions.hxx
+++ b/unotools/inc/unotools/regoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -124,3 +125,4 @@ namespace utl
#endif // unotools_REGOPTIONS_HXX
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/regpathhelper.hxx b/unotools/inc/unotools/regpathhelper.hxx
index 1f48dda63fc8..f1986d8bb58c 100644
--- a/unotools/inc/unotools/regpathhelper.hxx
+++ b/unotools/inc/unotools/regpathhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -69,3 +70,4 @@ namespace utl
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/saveopt.hxx b/unotools/inc/unotools/saveopt.hxx
index 9dab6150a8ad..43f60c5b4b19 100644
--- a/unotools/inc/unotools/saveopt.hxx
+++ b/unotools/inc/unotools/saveopt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -132,3 +133,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/searchopt.hxx b/unotools/inc/unotools/searchopt.hxx
index ab9941da6507..10ed2ca79bce 100644
--- a/unotools/inc/unotools/searchopt.hxx
+++ b/unotools/inc/unotools/searchopt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -117,3 +118,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/securityoptions.hxx b/unotools/inc/unotools/securityoptions.hxx
index ddeed4b94520..fd1b7c757163 100644
--- a/unotools/inc/unotools/securityoptions.hxx
+++ b/unotools/inc/unotools/securityoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -294,3 +295,5 @@ class UNOTOOLS_DLLPUBLIC SvtSecurityOptions: public utl::detail::Options
}; // class SvtSecurityOptions
#endif // #ifndef INCLUDED_unotools_SECURITYOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/sharedunocomponent.hxx b/unotools/inc/unotools/sharedunocomponent.hxx
index 70c01b0cc0af..e4065387b6fb 100644
--- a/unotools/inc/unotools/sharedunocomponent.hxx
+++ b/unotools/inc/unotools/sharedunocomponent.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -368,3 +369,5 @@ namespace utl
//............................................................................
#endif // UNOTOOLS_INC_SHAREDUNOCOMPONENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/sourceviewconfig.hxx b/unotools/inc/unotools/sourceviewconfig.hxx
index 5f66d6d05c76..02b2ab0ab79b 100644
--- a/unotools/inc/unotools/sourceviewconfig.hxx
+++ b/unotools/inc/unotools/sourceviewconfig.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,9 +35,6 @@
#include <rtl/ustring.hxx>
#include <unotools/options.hxx>
-/* -----------------------------12.10.00 11:40--------------------------------
-
- ---------------------------------------------------------------------------*/
namespace utl
{
class SourceViewConfig_Impl;
@@ -61,3 +59,4 @@ namespace utl
}
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/startoptions.hxx b/unotools/inc/unotools/startoptions.hxx
index 4fbb2c091864..7c964960999b 100644
--- a/unotools/inc/unotools/startoptions.hxx
+++ b/unotools/inc/unotools/startoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -168,3 +169,5 @@ class UNOTOOLS_DLLPUBLIC SvtStartOptions: public utl::detail::Options
}; // class SvtStartOptions
#endif // #ifndef INCLUDED_unotools_STARTOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/streamhelper.hxx b/unotools/inc/unotools/streamhelper.hxx
index d6250e7b0306..51c0b7fd4025 100644
--- a/unotools/inc/unotools/streamhelper.hxx
+++ b/unotools/inc/unotools/streamhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -114,3 +115,4 @@ public:
#endif // _UNOTOOLS_STREAM_WRAPPER_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/streamsection.hxx b/unotools/inc/unotools/streamsection.hxx
index 4c51ed648eb1..76860a2630ed 100644
--- a/unotools/inc/unotools/streamsection.hxx
+++ b/unotools/inc/unotools/streamsection.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -83,3 +84,4 @@ public:
#endif // _UNOTOOLS_STREAMSECTION_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/streamwrap.hxx b/unotools/inc/unotools/streamwrap.hxx
index d8544cc25f3e..f05be3584229 100644
--- a/unotools/inc/unotools/streamwrap.hxx
+++ b/unotools/inc/unotools/streamwrap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,7 +51,7 @@ namespace utl
//==================================================================
typedef ::cppu::WeakImplHelper1 < stario::XInputStream
> InputStreamWrapper_Base;
- // needed for some compilers
+// needed for some compilers
/// helper class for wrapping an SvStream into an <type scope="com.sun.star.io">XInputStream</type>
class UNOTOOLS_DLLPUBLIC OInputStreamWrapper : public InputStreamWrapper_Base
{
@@ -68,9 +69,6 @@ public:
OInputStreamWrapper(SvStream* pStream, sal_Bool bOwner=sal_False);
virtual ~OInputStreamWrapper();
-// UNO Anbindung
- DECLARE_UNO3_AGG_DEFAULTS(OInputStreamWrapper, InputStreamWrapper_Base);
-
// stario::XInputStream
virtual sal_Int32 SAL_CALL readBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
virtual sal_Int32 SAL_CALL readSomeBytes(staruno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
@@ -121,9 +119,6 @@ protected:
public:
OOutputStreamWrapper(SvStream& _rStream) :rStream(_rStream) { }
-// UNO Anbindung
- DECLARE_UNO3_AGG_DEFAULTS(OOutputStreamWrapper, OutputStreamWrapper_Base);
-
// stario::XOutputStream
virtual void SAL_CALL writeBytes(const staruno::Sequence< sal_Int8 >& aData) throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
virtual void SAL_CALL flush() throw(stario::NotConnectedException, stario::BufferSizeExceededException, staruno::RuntimeException);
@@ -181,3 +176,4 @@ public:
#endif // _UTL_STREAM_WRAPPER_HXX_
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/syslocale.hxx b/unotools/inc/unotools/syslocale.hxx
index 5d653297fde1..e9c5e0b938ea 100644
--- a/unotools/inc/unotools/syslocale.hxx
+++ b/unotools/inc/unotools/syslocale.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,3 +87,5 @@ public:
};
#endif // INCLUDED_SVTOOLS_SYSLOCALE_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/syslocaleoptions.hxx b/unotools/inc/unotools/syslocaleoptions.hxx
index 3bd719e10460..7d70ebd589b3 100755..100644
--- a/unotools/inc/unotools/syslocaleoptions.hxx
+++ b/unotools/inc/unotools/syslocaleoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -166,3 +167,5 @@ public:
};
#endif // INCLUDED_SVTOOLS_SYSLOCALEOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/tempfile.hxx b/unotools/inc/unotools/tempfile.hxx
index 29ca06a23c71..3565396dd612 100644
--- a/unotools/inc/unotools/tempfile.hxx
+++ b/unotools/inc/unotools/tempfile.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -159,3 +160,5 @@ public:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/textsearch.hxx b/unotools/inc/unotools/textsearch.hxx
index 39b201cc672e..bbc40cda01bd 100644
--- a/unotools/inc/unotools/textsearch.hxx
+++ b/unotools/inc/unotools/textsearch.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -185,3 +186,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/transliterationwrapper.hxx b/unotools/inc/unotools/transliterationwrapper.hxx
index acd3bbf5dcf4..c4c340d30150 100644
--- a/unotools/inc/unotools/transliterationwrapper.hxx
+++ b/unotools/inc/unotools/transliterationwrapper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -143,3 +144,5 @@ public:
// ............................................................................
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/ucbhelper.hxx b/unotools/inc/unotools/ucbhelper.hxx
index a24d132ae793..44af28b17ecc 100644
--- a/unotools/inc/unotools/ucbhelper.hxx
+++ b/unotools/inc/unotools/ucbhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,3 +88,4 @@ namespace utl
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/ucblockbytes.hxx b/unotools/inc/unotools/ucblockbytes.hxx
index bb77b2d67cc2..d3c53e882fec 100644
--- a/unotools/inc/unotools/ucblockbytes.hxx
+++ b/unotools/inc/unotools/ucblockbytes.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,9 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include "unotools/unotoolsdllapi.h"
-#include <vos/thread.hxx>
-#include <vos/conditn.hxx>
-#include <vos/mutex.hxx>
+#include <osl/thread.hxx>
+#include <osl/conditn.hxx>
+#include <osl/mutex.hxx>
#include <tools/stream.hxx>
#include <tools/link.hxx>
#include <tools/errcode.hxx>
@@ -104,9 +105,9 @@ SV_DECL_IMPL_REF( UcbLockBytesHandler )
class UNOTOOLS_DLLPUBLIC UcbLockBytes : public virtual SvLockBytes
{
- vos::OCondition m_aInitialized;
- vos::OCondition m_aTerminated;
- vos::OMutex m_aMutex;
+ osl::Condition m_aInitialized;
+ osl::Condition m_aTerminated;
+ osl::Mutex m_aMutex;
String m_aContentType;
String m_aRealURL;
@@ -183,25 +184,25 @@ public:
NS_UNO::Reference < NS_IO::XInputStream > getInputStream_Impl() const
{
- vos::OGuard aGuard( SAL_CONST_CAST(UcbLockBytes*, this)->m_aMutex );
+ osl::MutexGuard aGuard( SAL_CONST_CAST(UcbLockBytes*, this)->m_aMutex );
return m_xInputStream;
}
NS_UNO::Reference < NS_IO::XOutputStream > getOutputStream_Impl() const
{
- vos::OGuard aGuard( SAL_CONST_CAST(UcbLockBytes*, this)->m_aMutex );
+ osl::MutexGuard aGuard( SAL_CONST_CAST(UcbLockBytes*, this)->m_aMutex );
return m_xOutputStream;
}
NS_UNO::Reference < NS_IO::XSeekable > getSeekable_Impl() const
{
- vos::OGuard aGuard( SAL_CONST_CAST(UcbLockBytes*, this)->m_aMutex );
+ osl::MutexGuard aGuard( SAL_CONST_CAST(UcbLockBytes*, this)->m_aMutex );
return m_xSeekable;
}
sal_Bool hasInputStream_Impl() const
{
- vos::OGuard aGuard( SAL_CONST_CAST(UcbLockBytes*, this)->m_aMutex );
+ osl::MutexGuard aGuard( SAL_CONST_CAST(UcbLockBytes*, this)->m_aMutex );
return m_xInputStream.is();
}
@@ -220,3 +221,5 @@ SV_IMPL_REF( UcbLockBytes );
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/ucbstreamhelper.hxx b/unotools/inc/unotools/ucbstreamhelper.hxx
index 2c06d925ddb2..8c20fd506c7b 100644
--- a/unotools/inc/unotools/ucbstreamhelper.hxx
+++ b/unotools/inc/unotools/ucbstreamhelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,3 +82,5 @@ namespace utl
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/undoopt.hxx b/unotools/inc/unotools/undoopt.hxx
index 319f5f4edf32..840687b4b1cb 100644
--- a/unotools/inc/unotools/undoopt.hxx
+++ b/unotools/inc/unotools/undoopt.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,4 @@ public:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/unotoolsdllapi.h b/unotools/inc/unotools/unotoolsdllapi.h
index 521c9c3af3f6..8f0af8db744e 100644
--- a/unotools/inc/unotools/unotoolsdllapi.h
+++ b/unotools/inc/unotools/unotoolsdllapi.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,3 +40,4 @@
#endif /* INCLUDED_UNOTOOLSDLLAPI_H */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/unotunnelhelper.hxx b/unotools/inc/unotools/unotunnelhelper.hxx
deleted file mode 100644
index 1054249de54b..000000000000
--- a/unotools/inc/unotools/unotunnelhelper.hxx
+++ /dev/null
@@ -1,193 +0,0 @@
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _UNOTOOLS_UNOTUNNELHLP_HXX
-#define _UNOTOOLS_UNOTUNNELHLP_HXX
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
-#include <rtl/uuid.h>
-#include <rtl/memory.h>
-#include <comphelper/extract.hxx>
-
-namespace utl
-{
-namespace staruno = ::com::sun::star::uno;
-namespace starlang = ::com::sun::star::lang;
-
-//-----------------------------------------------------------------------------------------------------------
-// to use the following, define
-// sal_Bool getTunneledImplementation(Classname*& pObjImpl, staruno::Reference<starlang::XUnoTunnel> const& xObj);
-
-template <class Classname>
-sal_Bool getImplementation(Classname*& pImpl, staruno::Reference<starlang::XUnoTunnel> const& xTunnel)
- throw(staruno::RuntimeException)
-{
- if (xTunnel.is())
- return getTunneledImplementation(pImpl, xTunnel);
-
- pImpl = 0;
- return sal_False;
-}
-
-template <class Classname>
-sal_Bool getImplementation(Classname*& pImpl, staruno::Reference<staruno::XInterface> const& xObj)
- throw(staruno::RuntimeException)
-{
- staruno::Reference<starlang::XUnoTunnel> xTunnel(xObj,staruno::UNO_QUERY);
- if (xTunnel.is())
- return getTunneledImplementation(pImpl, xTunnel);
-
- pImpl = 0;
- return sal_False;
-}
-
-template <class Classname>
-sal_Bool getImplementation(Classname*& pImpl, staruno::Any const& aObj)
- throw(staruno::RuntimeException)
-{
- staruno::Reference<starlang::XUnoTunnel> xTunnel;
- if (cppu::extractInterface(xTunnel, aObj))
- getTunneledImplementation(pImpl, xTunnel);
-
- pImpl = 0;
- return sal_False;
-}
-
-template <class Classname>
-sal_Bool getImplementation(Classname*& pImpl, starlang::XUnoTunnel* pObj)
- throw(staruno::RuntimeException)
-{
- if (pObj)
- {
- staruno::Reference<starlang::XUnoTunnel> xTunnel(pObj);
- return getTunneledImplementation(pImpl, xTunnel);
- }
-
- pImpl = 0;
- return sal_False;
-}
-
-//-----------------------------------------------------------------------------------------------------------
-
-class UnoTunnelId
-{
- sal_Int8 tunnelId[16];
-public:
- UnoTunnelId(sal_Bool bUseMAC = sal_True) throw()
- {
- rtl_createUuid(reinterpret_cast<sal_uInt8*>(tunnelId),0,bUseMAC);
- }
-
- staruno::Sequence<sal_Int8> getId() const throw(staruno::RuntimeException)
- {
- return staruno::Sequence<sal_Int8>(tunnelId, sizeof(tunnelId));
- }
-
- sal_Bool equalTo(staruno::Sequence<sal_Int8> const& rIdentifier) throw()
- {
- return rIdentifier.getLength() == sizeof(tunnelId) &&
- rtl_compareMemory(tunnelId, rIdentifier.getConstArray(), sizeof(tunnelId)) == 0;
- }
-
- sal_Int8 const (&getIdBytes() const)[16] { return tunnelId; }
-};
-
-//-----------------------------------------------------------------------------------------------------------
-template<class Classname>
-class UnoTunnelImplBase
-{
-protected:
- Classname* ThisImplementation() throw() { return static_cast<Classname*>(this); }
-
- sal_Int64 makeUnoSomething() throw()
- {
- return reinterpret_cast<sal_Int64>(static_cast<void*>(ThisImplementation()));
- }
-
- static Classname* extractUnoSomething(sal_Int64 nSomething) throw()
- {
- if (nSomething != sal_Int64())
- return static_cast<Classname*>(reinterpret_cast<void*>(nSomething));
-
- return NULL;
- }
-#ifdef LINUX
-public:
-#endif
- static Classname*
- extractUnoSomething(
- staruno::Reference<starlang::XUnoTunnel> const& xObj,
- staruno::Sequence<sal_Int8> const& rMyTunnelId
- )
- throw(staruno::RuntimeException)
- {
- return xObj.is() ? extractUnoSomething(xObj->getSomething(rMyTunnelId)) : NULL;
- }
-};
-//-----------------------------------------------------------------------------------------------------------
-
-
-template<class Classname>
-class UnoTunnelHelper : public UnoTunnelImplBase<Classname>
-{
-protected:
- static UnoTunnelId s_aTunnelId;
-
- sal_Int64 getSomething(staruno::Sequence<sal_Int8> const& rTunnelId) throw()
- {
- if (s_aTunnelId.equalTo(rTunnelId))
- return this->makeUnoSomething();
- else
- return sal_Int64();
- }
-public:
- static staruno::Sequence<sal_Int8> getImplementationTunnelId()
- throw(staruno::RuntimeException)
- {
- return s_aTunnelId.getId();
- }
-#ifndef LINUX
- friend sal_Bool getTunneledImplementation(Classname*& pImpl, staruno::Reference<starlang::XUnoTunnel> const& xObj)
- throw(staruno::RuntimeException)
- {
- pImpl = UnoTunnelHelper<Classname>::UnoTunnelHelper<Classname>::extractUnoSomething( xObj, UnoTunnelHelper<Classname>::getImplementationTunnelId() );
-
- return pImpl != 0;
- }
-#endif
-};
-template<class Classname>
-UnoTunnelId UnoTunnelHelper<Classname>::s_aTunnelId;
-
-
-//-----------------------------------------------------------------------------------------------------------
-} // namespace utl
-
-#endif // _UNOTOOLS_UNOTUNNELHLP_HXX
-
diff --git a/unotools/inc/unotools/useroptions.hxx b/unotools/inc/unotools/useroptions.hxx
index 0eca30fe3075..17f4d52bc248 100644
--- a/unotools/inc/unotools/useroptions.hxx
+++ b/unotools/inc/unotools/useroptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -116,3 +117,5 @@ public:
};
#endif // #ifndef INCLUDED_unotools_USEROPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/useroptions_const.hxx b/unotools/inc/unotools/useroptions_const.hxx
index 34a12f6519bf..e71ef8f4003d 100644
--- a/unotools/inc/unotools/useroptions_const.hxx
+++ b/unotools/inc/unotools/useroptions_const.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,25 +33,27 @@
namespace
{
- static const ::rtl::OUString s_sData = ::rtl::OUString::createFromAscii("org.openoffice.UserProfile/Data");
- static const ::rtl::OUString s_so = ::rtl::OUString::createFromAscii("o"); // USER_OPT_COMPANY
- static const ::rtl::OUString s_sgivenname = ::rtl::OUString::createFromAscii("givenname"); // USER_OPT_FIRSTNAME
- static const ::rtl::OUString s_ssn = ::rtl::OUString::createFromAscii("sn"); // USER_OPT_LASTNAME
- static const ::rtl::OUString s_sinitials = ::rtl::OUString::createFromAscii("initials"); // USER_OPT_ID
- static const ::rtl::OUString s_sstreet = ::rtl::OUString::createFromAscii("street"); // USER_OPT_STREET
- static const ::rtl::OUString s_sl = ::rtl::OUString::createFromAscii("l"); // USER_OPT_CITY
- static const ::rtl::OUString s_sst = ::rtl::OUString::createFromAscii("st"); // USER_OPT_STATE
- static const ::rtl::OUString s_spostalcode = ::rtl::OUString::createFromAscii("postalcode"); // USER_OPT_ZIP
- static const ::rtl::OUString s_sc = ::rtl::OUString::createFromAscii("c"); // USER_OPT_COUNTRY
- static const ::rtl::OUString s_stitle = ::rtl::OUString::createFromAscii("title"); // USER_OPT_TITLE
- static const ::rtl::OUString s_sposition = ::rtl::OUString::createFromAscii("position"); // USER_OPT_POSITION
- static const ::rtl::OUString s_shomephone = ::rtl::OUString::createFromAscii("homephone"); // USER_OPT_TELEPHONEHOME
- static const ::rtl::OUString s_stelephonenumber = ::rtl::OUString::createFromAscii("telephonenumber"); // USER_OPT_TELEPHONEWORK
- static const ::rtl::OUString s_sfacsimiletelephonenumber = ::rtl::OUString::createFromAscii("facsimiletelephonenumber"); // USER_OPT_FAX
- static const ::rtl::OUString s_smail = ::rtl::OUString::createFromAscii("mail"); // USER_OPT_EMAIL
- static const ::rtl::OUString s_scustomernumber = ::rtl::OUString::createFromAscii("customernumber"); // USER_OPT_CUSTOMERNUMBER
- static const ::rtl::OUString s_sfathersname = ::rtl::OUString::createFromAscii("fathersname"); // USER_OPT_FATHERSNAME
- static const ::rtl::OUString s_sapartment = ::rtl::OUString::createFromAscii("apartment"); // USER_OPT_APARTMENT
+ static const ::rtl::OUString s_sData(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.UserProfile/Data"));
+ static const ::rtl::OUString s_so(RTL_CONSTASCII_USTRINGPARAM("o")); // USER_OPT_COMPANY
+ static const ::rtl::OUString s_sgivenname(RTL_CONSTASCII_USTRINGPARAM("givenname")); // USER_OPT_FIRSTNAME
+ static const ::rtl::OUString s_ssn(RTL_CONSTASCII_USTRINGPARAM("sn")); // USER_OPT_LASTNAME
+ static const ::rtl::OUString s_sinitials(RTL_CONSTASCII_USTRINGPARAM("initials")); // USER_OPT_ID
+ static const ::rtl::OUString s_sstreet(RTL_CONSTASCII_USTRINGPARAM("street")); // USER_OPT_STREET
+ static const ::rtl::OUString s_sl(RTL_CONSTASCII_USTRINGPARAM("l")); // USER_OPT_CITY
+ static const ::rtl::OUString s_sst(RTL_CONSTASCII_USTRINGPARAM("st")); // USER_OPT_STATE
+ static const ::rtl::OUString s_spostalcode(RTL_CONSTASCII_USTRINGPARAM("postalcode")); // USER_OPT_ZIP
+ static const ::rtl::OUString s_sc(RTL_CONSTASCII_USTRINGPARAM("c")); // USER_OPT_COUNTRY
+ static const ::rtl::OUString s_stitle(RTL_CONSTASCII_USTRINGPARAM("title")); // USER_OPT_TITLE
+ static const ::rtl::OUString s_sposition(RTL_CONSTASCII_USTRINGPARAM("position")); // USER_OPT_POSITION
+ static const ::rtl::OUString s_shomephone(RTL_CONSTASCII_USTRINGPARAM("homephone")); // USER_OPT_TELEPHONEHOME
+ static const ::rtl::OUString s_stelephonenumber(RTL_CONSTASCII_USTRINGPARAM("telephonenumber")); // USER_OPT_TELEPHONEWORK
+ static const ::rtl::OUString s_sfacsimiletelephonenumber(RTL_CONSTASCII_USTRINGPARAM("facsimiletelephonenumber")); // USER_OPT_FAX
+ static const ::rtl::OUString s_smail(RTL_CONSTASCII_USTRINGPARAM("mail")); // USER_OPT_EMAIL
+ static const ::rtl::OUString s_scustomernumber(RTL_CONSTASCII_USTRINGPARAM("customernumber")); // USER_OPT_CUSTOMERNUMBER
+ static const ::rtl::OUString s_sfathersname(RTL_CONSTASCII_USTRINGPARAM("fathersname")); // USER_OPT_FATHERSNAME
+ static const ::rtl::OUString s_sapartment(RTL_CONSTASCII_USTRINGPARAM("apartment")); // USER_OPT_APARTMENT
}
#endif // INCLUDE_CONFIGITEMS_USEROPTIONS_CONST_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/viewoptions.hxx b/unotools/inc/unotools/viewoptions.hxx
index 6fa60ea3fb05..34c00590dc0a 100644
--- a/unotools/inc/unotools/viewoptions.hxx
+++ b/unotools/inc/unotools/viewoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -351,3 +352,5 @@ class UNOTOOLS_DLLPUBLIC SvtViewOptions: public utl::detail::Options
}; // class SvtViewOptions
#endif // #ifndef INCLUDED_unotools_VIEWOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/workingsetoptions.hxx b/unotools/inc/unotools/workingsetoptions.hxx
index 04a4a0bea6cb..bad092a207cc 100644
--- a/unotools/inc/unotools/workingsetoptions.hxx
+++ b/unotools/inc/unotools/workingsetoptions.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -154,3 +155,5 @@ class SvtWorkingSetOptions: public utl::detail::Options
}; // class SvtWorkingSetOptions
#endif // #ifndef INCLUDED_unotools_WORKINGSETOPTIONS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/unotools/xmlaccelcfg.hxx b/unotools/inc/unotools/xmlaccelcfg.hxx
index db561660d3c2..d3421f65a064 100644
--- a/unotools/inc/unotools/xmlaccelcfg.hxx
+++ b/unotools/inc/unotools/xmlaccelcfg.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,7 @@
#ifndef INCLUDED_unotools_XMLACCELCFG_HXX
#define INCLUDED_unotools_XMLACCELCFG_HXX
-#ifndef __COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
-#endif
#include <cppuhelper/weak.hxx>
#include <unotools/accelcfg.hxx>
@@ -107,3 +106,5 @@ class OWriteAccelatorDocumentHandler
};
#endif // INCLUDED_unotools_XMLACCELCFG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/prj/build.lst b/unotools/prj/build.lst
index fd0b4a7e925c..b7883fa2e3dd 100644
--- a/unotools/prj/build.lst
+++ b/unotools/prj/build.lst
@@ -1,3 +1,3 @@
-ut unotools : LIBXSLT:libxslt comphelper cppuhelper offuh tools ucbhelper NULL
-ut unotools\prj nmake - all ut_prj NULL
+ut unotools : LIBXSLT:libxslt comphelper cppuhelper offuh tools ucbhelper NULL
+ut unotools\prj nmake - all ut_prj NULL
diff --git a/unotools/prj/makefile.mk b/unotools/prj/makefile.mk
index 88cd9dfe08b8..e312a7ccab65 100644..100755
--- a/unotools/prj/makefile.mk
+++ b/unotools/prj/makefile.mk
@@ -37,4 +37,4 @@ VERBOSEFLAG := -s
.ENDIF
all:
- cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
+ cd $(PRJ) && $(GNUMAKE) $(VERBOSEFLAG) -r -j$(MAXPROCESS) $(gb_MAKETARGET) && $(GNUMAKE) $(VERBOSEFLAG) -r deliverlog
diff --git a/unotools/source/accessibility/accessiblerelationsethelper.cxx b/unotools/source/accessibility/accessiblerelationsethelper.cxx
index 60e807ee9320..69eb31d41c2d 100644
--- a/unotools/source/accessibility/accessiblerelationsethelper.cxx
+++ b/unotools/source/accessibility/accessiblerelationsethelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,9 @@
#include "unotools/accessiblerelationsethelper.hxx"
-#include <rtl/uuid.h>
#include <vector>
#include <comphelper/sequence.hxx>
+#include <comphelper/servicehelper.hxx>
using namespace ::utl;
using namespace ::rtl;
@@ -167,7 +168,7 @@ sal_Int32 SAL_CALL
AccessibleRelationSetHelper::getRelationCount( )
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
return mpHelperImpl->getRelationCount();
}
@@ -189,7 +190,7 @@ sal_Int32 SAL_CALL
throw (lang::IndexOutOfBoundsException,
uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
return mpHelperImpl->getRelation(nIndex);
}
@@ -209,7 +210,7 @@ sal_Bool SAL_CALL
AccessibleRelationSetHelper::containsRelation( sal_Int16 aRelationType )
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
return mpHelperImpl->containsRelation(aRelationType);
}
@@ -228,14 +229,14 @@ AccessibleRelation SAL_CALL
AccessibleRelationSetHelper::getRelationByType( sal_Int16 aRelationType )
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
return mpHelperImpl->getRelationByType(aRelationType);
}
void AccessibleRelationSetHelper::AddRelation(const AccessibleRelation& rRelation)
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
mpHelperImpl->AddRelation(rRelation);
}
@@ -245,7 +246,7 @@ uno::Sequence< ::com::sun::star::uno::Type>
AccessibleRelationSetHelper::getTypes (void)
throw (::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
const ::com::sun::star::uno::Type aTypeList[] = {
::getCppuType((const uno::Reference<
XAccessibleRelationSet>*)0),
@@ -257,16 +258,16 @@ uno::Sequence< ::com::sun::star::uno::Type>
return aTypeSequence;
}
+namespace
+{
+ class theAccessibleRelationSetHelperUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theAccessibleRelationSetHelperUnoTunnelId > {};
+}
+
uno::Sequence<sal_Int8> SAL_CALL
AccessibleRelationSetHelper::getImplementationId (void)
throw (::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
- static uno::Sequence<sal_Int8> aId;
- if (aId.getLength() == 0)
- {
- aId.realloc (16);
- rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True);
- }
- return aId;
+ return theAccessibleRelationSetHelperUnoTunnelId::get().getSeq();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/accessibility/accessiblestatesethelper.cxx b/unotools/source/accessibility/accessiblestatesethelper.cxx
index be7bf3fbeb28..9229e1c4045c 100644
--- a/unotools/source/accessibility/accessiblestatesethelper.cxx
+++ b/unotools/source/accessibility/accessiblestatesethelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,12 +31,8 @@
#include "unotools/accessiblestatesethelper.hxx"
-#include <rtl/uuid.h>
#include <tools/debug.hxx>
-
-#if 0
-#include <bitset>
-#endif
+#include <comphelper/servicehelper.hxx>
// defines how many states the bitfield can contain
// it has the size of 64 because I use a uInt64
@@ -53,11 +50,11 @@ public:
AccessibleStateSetHelperImpl(const AccessibleStateSetHelperImpl& rImpl);
~AccessibleStateSetHelperImpl();
- sal_Bool IsEmpty ()
+ sal_Bool IsEmpty () const
throw (uno::RuntimeException);
- sal_Bool Contains (sal_Int16 aState)
+ sal_Bool Contains (sal_Int16 aState) const
throw (uno::RuntimeException);
- uno::Sequence<sal_Int16> GetStates()
+ uno::Sequence<sal_Int16> GetStates() const
throw (uno::RuntimeException);
void AddState(sal_Int16 aState)
throw (uno::RuntimeException);
@@ -65,15 +62,12 @@ public:
throw (uno::RuntimeException);
sal_Bool Compare(const AccessibleStateSetHelperImpl* pComparativeValue,
AccessibleStateSetHelperImpl* pOldStates,
- AccessibleStateSetHelperImpl* pNewStates)
+ AccessibleStateSetHelperImpl* pNewStates) const
throw (uno::RuntimeException);
inline void AddStates( const sal_Int64 _nStates ) SAL_THROW( ( ) );
private:
-#if 0
- ::std::bitset<BITFIELDSIZE> maStates; //Bitfield
-#endif
sal_uInt64 maStates;
};
@@ -91,28 +85,22 @@ AccessibleStateSetHelperImpl::~AccessibleStateSetHelperImpl()
{
}
-inline sal_Bool AccessibleStateSetHelperImpl::IsEmpty ()
+inline sal_Bool AccessibleStateSetHelperImpl::IsEmpty () const
throw (uno::RuntimeException)
{
-#if 0
- return maStates.none();
-#endif
return maStates == 0;
}
-inline sal_Bool AccessibleStateSetHelperImpl::Contains (sal_Int16 aState)
+inline sal_Bool AccessibleStateSetHelperImpl::Contains (sal_Int16 aState) const
throw (uno::RuntimeException)
{
DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
-#if 0
- return maStates.test(aState);
-#endif
sal_uInt64 aTempBitSet(1);
aTempBitSet <<= aState;
return ((aTempBitSet & maStates) != 0);
}
-inline uno::Sequence<sal_Int16> AccessibleStateSetHelperImpl::GetStates()
+inline uno::Sequence<sal_Int16> AccessibleStateSetHelperImpl::GetStates() const
throw (uno::RuntimeException)
{
uno::Sequence<sal_Int16> aRet(BITFIELDSIZE);
@@ -138,9 +126,6 @@ inline void AccessibleStateSetHelperImpl::AddState(sal_Int16 aState)
throw (uno::RuntimeException)
{
DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
-#if 0
- maStates.set(aState);
-#endif
sal_uInt64 aTempBitSet(1);
aTempBitSet <<= aState;
maStates |= aTempBitSet;
@@ -150,9 +135,6 @@ inline void AccessibleStateSetHelperImpl::RemoveState(sal_Int16 aState)
throw (uno::RuntimeException)
{
DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
-#if 0
- maStates.set(aState, 0);
-#endif
sal_uInt64 aTempBitSet(1);
aTempBitSet <<= aState;
aTempBitSet = ~aTempBitSet;
@@ -162,7 +144,7 @@ inline void AccessibleStateSetHelperImpl::RemoveState(sal_Int16 aState)
inline sal_Bool AccessibleStateSetHelperImpl::Compare(
const AccessibleStateSetHelperImpl* pComparativeValue,
AccessibleStateSetHelperImpl* pOldStates,
- AccessibleStateSetHelperImpl* pNewStates)
+ AccessibleStateSetHelperImpl* pNewStates) const
throw (uno::RuntimeException)
{
sal_Bool bResult(sal_False);
@@ -172,9 +154,6 @@ inline sal_Bool AccessibleStateSetHelperImpl::Compare(
bResult = sal_True;
else
{
-#if 0
- std::bitset<BITFIELDSIZE> aTempBitSet(maStates);
-#endif
sal_uInt64 aTempBitSet(maStates);
aTempBitSet ^= pComparativeValue->maStates;
pOldStates->maStates = aTempBitSet;
@@ -228,7 +207,7 @@ AccessibleStateSetHelper::~AccessibleStateSetHelper(void)
sal_Bool SAL_CALL AccessibleStateSetHelper::isEmpty ()
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
return mpHelperImpl->IsEmpty();
}
@@ -246,7 +225,7 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::isEmpty ()
sal_Bool SAL_CALL AccessibleStateSetHelper::contains (sal_Int16 aState)
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
return mpHelperImpl->Contains(aState);
}
@@ -269,7 +248,7 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::containsAll
(const uno::Sequence<sal_Int16>& rStateSet)
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
sal_Int32 nCount(rStateSet.getLength());
const sal_Int16* pStates = rStateSet.getConstArray();
sal_Int32 i = 0;
@@ -285,21 +264,21 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::containsAll
uno::Sequence<sal_Int16> SAL_CALL AccessibleStateSetHelper::getStates()
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard(maMutex);
+ osl::MutexGuard aGuard(maMutex);
return mpHelperImpl->GetStates();
}
void AccessibleStateSetHelper::AddState(sal_Int16 aState)
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
mpHelperImpl->AddState(aState);
}
void AccessibleStateSetHelper::RemoveState(sal_Int16 aState)
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
mpHelperImpl->RemoveState(aState);
}
@@ -309,7 +288,7 @@ sal_Bool AccessibleStateSetHelper::Compare(
AccessibleStateSetHelper& rNewStates)
throw (uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
+ osl::MutexGuard aGuard (maMutex);
return mpHelperImpl->Compare(rComparativeValue.mpHelperImpl,
rOldStates.mpHelperImpl, rNewStates.mpHelperImpl);
}
@@ -331,16 +310,16 @@ uno::Sequence< ::com::sun::star::uno::Type>
return aTypeSequence;
}
+namespace
+{
+ class theAccessibleStateSetHelperUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theAccessibleStateSetHelperUnoTunnelId > {};
+}
+
uno::Sequence<sal_Int8> SAL_CALL
AccessibleStateSetHelper::getImplementationId (void)
throw (::com::sun::star::uno::RuntimeException)
{
- ::vos::OGuard aGuard (maMutex);
- static uno::Sequence<sal_Int8> aId;
- if (aId.getLength() == 0)
- {
- aId.realloc (16);
- rtl_createUuid ((sal_uInt8 *)aId.getArray(), 0, sal_True);
- }
- return aId;
+ return theAccessibleStateSetHelperUnoTunnelId::get().getSeq();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/accelcfg.cxx b/unotools/source/config/accelcfg.cxx
index d3f26de35304..c1748e3b411c 100644
--- a/unotools/source/config/accelcfg.cxx
+++ b/unotools/source/config/accelcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,8 +28,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
+
#include "rtl/instance.hxx"
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -54,11 +54,12 @@
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::io;
using namespace com::sun::star::xml::sax;
+using ::rtl::OUString;
+
static SvtAcceleratorConfig_Impl* pOptions = NULL;
static sal_Int32 nRefCount = 0;
@@ -84,7 +85,7 @@ SvtAcceleratorConfig_Impl::SvtAcceleratorConfig_Impl( Reference< XInputStream >&
: bModified( false )
{
Reference< XParser > xParser( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Parser" )),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser"))),
UNO_QUERY);
// connect stream to input stream to the parser
@@ -104,7 +105,7 @@ bool SvtAcceleratorConfig_Impl::Commit( Reference< XOutputStream >& rOutputStrea
Reference< XDocumentHandler > xWriter;
xWriter = Reference< XDocumentHandler >( ::comphelper::getProcessServiceFactory()->createInstance(
- ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" )), UNO_QUERY) ;
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer"))), UNO_QUERY) ;
Reference< ::com::sun::star::io::XActiveDataSource> xDataSource( xWriter , UNO_QUERY );
xDataSource->setOutputStream( rOutputStream );
@@ -235,7 +236,7 @@ SvtAcceleratorConfiguration::~SvtAcceleratorConfiguration()
nCode = rKeyEvent.KeyFunc;
std::list< SvtAcceleratorConfigItem>::const_iterator p;
- for ( p = pImp->aList.begin(); p != pImp->aList.end(); p++ )
+ for ( p = pImp->aList.begin(); p != pImp->aList.end(); ++p )
if ( p->nCode == nCode && p->nModifier == nModifier )
return p->aCommand;
@@ -250,7 +251,7 @@ const SvtAcceleratorItemList& SvtAcceleratorConfiguration::GetItems()
void SvtAcceleratorConfiguration::SetCommand( const SvtAcceleratorConfigItem& rItem )
{
std::list< SvtAcceleratorConfigItem>::iterator p;
- for ( p = pImp->aList.begin(); p != pImp->aList.end(); p++ )
+ for ( p = pImp->aList.begin(); p != pImp->aList.end(); ++p )
if ( p->nCode == rItem.nCode && p->nModifier == rItem.nModifier )
{
p->aCommand = rItem.aCommand;
@@ -270,7 +271,7 @@ void SvtAcceleratorConfiguration::SetItems( const SvtAcceleratorItemList& rItems
else
{
std::list< SvtAcceleratorConfigItem>::const_iterator p;
- for ( p = rItems.begin(); p != rItems.end(); p++ )
+ for ( p = rItems.begin(); p != rItems.end(); ++p )
SetCommand( *p );
}
}
@@ -287,3 +288,5 @@ SvStream* SvtAcceleratorConfiguration::GetDefaultStream( StreamMode nMode )
aObj.insertName( GetStreamName() );
return ::utl::UcbStreamHelper::CreateStream( aObj.GetMainURL( INetURLObject::NO_DECODE ), nMode );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx
index b2e1bf1739f8..64555b2de877 100644
--- a/unotools/source/config/bootstrap.cxx
+++ b/unotools/source/config/bootstrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,7 @@
#include <osl/diagnose.h>
// ---------------------------------------------------------------------------------------
#include <rtl/bootstrap.hxx>
+#include <rtl/instance.hxx>
#include <osl/process.h> // for osl_getExecutableFile
#include "tools/getprocessworkingdir.hxx"
@@ -51,6 +53,7 @@
#define BOOTSTRAP_DATA_NAME SAL_CONFIGFILE("bootstrap")
#define BOOTSTRAP_ITEM_PRODUCT_KEY "ProductKey"
+#define BOOTSTRAP_ITEM_PRODUCT_VERSION "OOOBaseVersion"
#define BOOTSTRAP_ITEM_PRODUCT_SOURCE "ProductSource"
#define BOOTSTRAP_ITEM_VERSIONFILE "Location"
#define BOOTSTRAP_ITEM_BUILDID "buildid"
@@ -85,9 +88,21 @@ namespace utl
// Implementation class: Bootstrap::Impl
// ---------------------------------------------------------------------------------------
+ namespace
+ {
+ rtl::OUString makeImplName()
+ {
+ rtl::OUString uri;
+ rtl::Bootstrap::get(
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BRAND_BASE_DIR")),
+ uri);
+ return uri + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/program/"BOOTSTRAP_DATA_NAME));
+ }
+ }
+
class Bootstrap::Impl
{
- OUString const m_aImplName;
+ const OUString m_aImplName;
public: // struct to cache the result of a path lookup
struct PathData
{
@@ -114,14 +129,12 @@ namespace utl
Status status_;
public: // construction and initialization
- explicit
- Impl(OUString const& _aImplName)
- : m_aImplName(_aImplName)
+ Impl() : m_aImplName(makeImplName())
{
- status_ = initialize();
+ initialize();
}
- Status initialize();
+ void initialize();
// access helper
OUString getBootstrapValue(OUString const& _sName, OUString const& _sDefault) const;
@@ -133,36 +146,20 @@ namespace utl
bool initBaseInstallationData(rtl::Bootstrap& _rData);
bool initUserInstallationData(rtl::Bootstrap& _rData);
};
-// ---------------------------------------------------------------------------------------
- static OUString getExecutableDirectory();
-// ---------------------------------------------------------------------------------------
- static Bootstrap::Impl* s_pData = NULL;
-
- Bootstrap::Impl const& Bootstrap::data()
+ namespace
{
+ class theImpl : public rtl::Static<Bootstrap::Impl, theImpl> {};
+ }
- if (!s_pData)
- {
- using namespace osl;
- MutexGuard aGuard( Mutex::getGlobalMutex() );
-
- // static Impl s_theData(getExecutableDirectory() + OUString(RTL_CONSTASCII_USTRINGPARAM("/"BOOTSTRAP_DATA_NAME)));
- // s_pData = &s_theData;
- rtl::OUString uri;
- rtl::Bootstrap::get(
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("BRAND_BASE_DIR")), uri);
- s_pData = new Impl(uri + OUString(RTL_CONSTASCII_USTRINGPARAM("/program/"BOOTSTRAP_DATA_NAME)));
- }
- return *s_pData;
+ const Bootstrap::Impl& Bootstrap::data()
+ {
+ return theImpl::get();
}
void Bootstrap::reloadData()
{
- if (s_pData != NULL) {
- delete s_pData;
- s_pData = NULL;
- }
+ theImpl::get().initialize();
}
// ---------------------------------------------------------------------------------------
@@ -232,9 +229,9 @@ bool implNormalizeURL(OUString & _sURL, osl::DirectoryItem& aDirItem)
OSL_PRECOND(aDirItem.is(), "Opened DirItem required");
- static const sal_uInt32 cFileStatusMask = FileStatusMask_FileURL;
+ static const sal_uInt32 cosl_FileStatus_Mask = osl_FileStatus_Mask_FileURL;
- FileStatus aFileStatus(cFileStatusMask);
+ FileStatus aFileStatus(cosl_FileStatus_Mask);
if (aDirItem.getFileStatus(aFileStatus) != DirectoryItem::E_None)
return false;
@@ -260,7 +257,7 @@ bool implEnsureAbsolute(OUString & _rsURL) // also strips embedded dots !!
using osl::File;
OUString sBasePath;
- OSL_VERIFY(tools::getProcessWorkingDir(&sBasePath));
+ OSL_VERIFY(tools::getProcessWorkingDir(sBasePath));
OUString sAbsolute;
if ( File::E_None == File::getAbsoluteFileURL(sBasePath, _rsURL, sAbsolute))
@@ -270,7 +267,7 @@ bool implEnsureAbsolute(OUString & _rsURL) // also strips embedded dots !!
}
else
{
- OSL_ENSURE(false, "Could not get absolute file URL for URL");
+ OSL_FAIL("Could not get absolute file URL for URL");
return false;
}
}
@@ -358,7 +355,7 @@ PathStatus checkStatusAndNormalizeURL(OUString & _sURL)
if (eStatus == Bootstrap::PATH_EXISTS)
{
if (!implNormalizeURL(_sURL,aDirItem))
- OSL_ENSURE(false,"Unexpected failure getting actual URL for existing object");
+ OSL_FAIL("Unexpected failure getting actual URL for existing object");
}
}
return eStatus;
@@ -400,7 +397,7 @@ PathStatus getDerivedPath(
OSL_ENSURE(sDerivedURL == _rURL,"Could not set derived URL via Bootstrap default parameter");
OSL_POSTCOND(RTL_BOOTSTRAP_DEFAULTS_BROKEN ||
- _rData.getFrom(_sBootstrapParameter,sDerivedURL) && sDerivedURL==_rURL,"Use of default did not affect bootstrap value");
+ (_rData.getFrom(_sBootstrapParameter,sDerivedURL) && sDerivedURL==_rURL),"Use of default did not affect bootstrap value");
}
else
{
@@ -651,6 +648,14 @@ OUString Bootstrap::getProductKey(OUString const& _sDefault)
}
// ---------------------------------------------------------------------------------------
+OUString Bootstrap::getProductVersion()
+{
+ // read OOOBaseVersion from version.ini (versionrc)
+ OUString sVersion;
+ data().getVersionValue( OUString( RTL_CONSTASCII_USTRINGPARAM( BOOTSTRAP_ITEM_PRODUCT_VERSION ) ), sVersion, OUString() );
+ return sVersion;
+}
+
OUString Bootstrap::getProductSource(OUString const& _sDefault)
{
OUString const csProductSourceItem(RTL_CONSTASCII_USTRINGPARAM(BOOTSTRAP_ITEM_PRODUCT_SOURCE));
@@ -674,6 +679,7 @@ OUString Bootstrap::getBuildIdData(OUString const& _sDefault)
sBuildId = data().getBootstrapValue( csBuildIdItem, _sDefault );
return sBuildId;
}
+
// ---------------------------------------------------------------------------------------
OUString Bootstrap::getAllUsersValue(OUString const& _sDefault)
@@ -840,19 +846,17 @@ bool Bootstrap::Impl::initUserInstallationData(rtl::Bootstrap& _rData)
}
// ---------------------------------------------------------------------------------------
-Bootstrap::Status Bootstrap::Impl::initialize()
+void Bootstrap::Impl::initialize()
{
- Bootstrap::Status result;
-
rtl::Bootstrap aData( m_aImplName );
if (!initBaseInstallationData(aData))
{
- result = INVALID_BASE_INSTALL;
+ status_ = INVALID_BASE_INSTALL;
}
else if (!initUserInstallationData(aData))
{
- result = INVALID_USER_INSTALL;
+ status_ = INVALID_USER_INSTALL;
if (aUserInstall_.status >= DATA_MISSING)
{
@@ -860,12 +864,12 @@ Bootstrap::Status Bootstrap::Impl::initialize()
{
case PATH_EXISTS:
case PATH_VALID:
- result = MISSING_USER_INSTALL;
+ status_ = MISSING_USER_INSTALL;
break;
case DATA_INVALID:
case DATA_MISSING:
- result = INVALID_BASE_INSTALL;
+ status_ = INVALID_BASE_INSTALL;
break;
default:
break;
@@ -874,9 +878,8 @@ Bootstrap::Status Bootstrap::Impl::initialize()
}
else
{
- result = DATA_OK;
+ status_ = DATA_OK;
}
- return result;
}
// ---------------------------------------------------------------------------------------
@@ -910,3 +913,4 @@ sal_Bool Bootstrap::Impl::getVersionValue(OUString const& _sName, OUString& _rVa
} // namespace utl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/cacheoptions.cxx b/unotools/source/config/cacheoptions.cxx
index 2b2b612274ac..3e2ce0251970 100644
--- a/unotools/source/config/cacheoptions.cxx
+++ b/unotools/source/config/cacheoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,16 +28,11 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/cacheoptions.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/configitem.hxx>
+#include <rtl/instance.hxx>
#include <tools/debug.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -334,13 +330,10 @@ void SvtCacheOptions_Impl::SetGraphicManagerObjectReleaseTime( sal_Int32 nGrfMgr
SetModified();
}
-//*****************************************************************************************************************
-// private method
-//*****************************************************************************************************************
Sequence< OUString > SvtCacheOptions_Impl::impl_GetPropertyNames()
{
- // Build static list of configuration key names.
- static const OUString pProperties[] =
+ // Build list of configuration key names.
+ const OUString pProperties[] =
{
PROPERTYNAME_WRITEROLE,
PROPERTYNAME_DRAWINGOLE,
@@ -349,7 +342,7 @@ Sequence< OUString > SvtCacheOptions_Impl::impl_GetPropertyNames()
PROPERTYNAME_GRFMGR_OBJECTRELEASE
};
// Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
// ... and return it.
return seqPropertyNames;
}
@@ -486,27 +479,17 @@ void SvtCacheOptions::SetGraphicManagerObjectReleaseTime( sal_Int32 nGrfMgrObjec
m_pDataContainer->SetGraphicManagerObjectReleaseTime( nGrfMgrObjectReleaseTime );
}
+namespace
+{
+ class theCacheOptionsMutex : public rtl::Static<osl::Mutex, theCacheOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtCacheOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theCacheOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/cmdoptions.cxx b/unotools/source/config/cmdoptions.cxx
index fd4fb07e7918..c110148c069f 100644
--- a/unotools/source/config/cmdoptions.cxx
+++ b/unotools/source/config/cmdoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,11 +42,12 @@
#include <cppuhelper/weakref.hxx>
#include <tools/urlobj.hxx>
#include <rtl/ustrbuf.hxx>
+#include <rtl/instance.hxx>
#include <itemholder1.hxx>
#include <algorithm>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
//_________________________________________________________________________________________________________________
// namespaces
@@ -104,11 +106,6 @@ class SvtCmdOptions
return ( m_aCommandHashMap.size() > 0 );
}
- void SetContainerSize( sal_Int32 nSize )
- {
- m_aCommandHashMap.resize( nSize );
- }
-
sal_Bool Lookup( const OUString& aCmd ) const
{
CommandHashMap::const_iterator pEntry = m_aCommandHashMap.find( aCmd );
@@ -142,7 +139,7 @@ class SvtCmdOptions
}
private:
- class CommandHashMap : public ::std::hash_map< ::rtl::OUString ,
+ class CommandHashMap : public ::boost::unordered_map< ::rtl::OUString ,
sal_Int32 ,
OUStringHashCode ,
::std::equal_to< ::rtl::OUString > >
@@ -291,9 +288,6 @@ SvtCommandOptions_Impl::SvtCommandOptions_Impl()
sal_Int32 nItem = 0 ;
OUString sCmd ;
- // Set size of hash_map reach a used size of approx. 60%
- m_aDisabledCommands.SetContainerSize( lNames.getLength() * 10 / 6 );
-
// Get names/values for disabled commands.
for( nItem=0; nItem < lNames.getLength(); ++nItem )
{
@@ -342,9 +336,7 @@ void SvtCommandOptions_Impl::Notify( const Sequence< OUString >& )
sal_Int32 nItem = 0 ;
OUString sCmd ;
- // Set size of hash_map reach a used size of approx. 60%
m_aDisabledCommands.Clear();
- m_aDisabledCommands.SetContainerSize( lNames.getLength() * 10 / 6 );
// Get names/values for disabled commands.
for( nItem=0; nItem < lNames.getLength(); ++nItem )
@@ -371,7 +363,7 @@ void SvtCommandOptions_Impl::Notify( const Sequence< OUString >& )
//*****************************************************************************************************************
void SvtCommandOptions_Impl::Commit()
{
- DBG_ERROR( "SvtCommandOptions_Impl::Commit()\nNot implemented yet!\n" );
+ OSL_FAIL( "SvtCommandOptions_Impl::Commit()\nNot implemented yet!\n" );
}
//*****************************************************************************************************************
@@ -602,27 +594,17 @@ void SvtCommandOptions::EstablisFrameCallback(const ::com::sun::star::uno::Refer
m_pDataContainer->EstablisFrameCallback(xFrame);
}
+namespace
+{
+ class theCommandOptionsMutex : public rtl::Static<osl::Mutex, theCommandOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtCommandOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theCommandOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
index 61ebe0211817..6a5087089490 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,13 +36,12 @@
#include <unotools/compatibility.hxx>
#include <unotools/configmgr.hxx>
#include <unotools/configitem.hxx>
+#include <unotools/syslocale.hxx>
#include <tools/debug.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-#ifndef __SGI_STL_VECTOR
#include <vector>
-#endif
#include <itemholder1.hxx>
@@ -223,7 +223,7 @@ class SvtCompatibility
return lEntries.size();
}
- const SvtCompatibilityEntry& operator[]( int i )
+ const SvtCompatibilityEntry& operator[]( int i ) const
{
return lEntries[i];
}
@@ -247,6 +247,8 @@ class SvtCompatibilityOptions_Impl : public ConfigItem
SvtCompatibilityOptions_Impl();
~SvtCompatibilityOptions_Impl();
+ void SetDefault( OUString sName, bool bValue );
+
//---------------------------------------------------------------------------------------------------------
// overloaded methods of baseclass
//---------------------------------------------------------------------------------------------------------
@@ -425,6 +427,13 @@ SvtCompatibilityOptions_Impl::SvtCompatibilityOptions_Impl()
if ( !bDefaultFound && aItem.sName.equals( COMPATIBILITY_DEFAULT_NAME ) != sal_False )
{
+ SvtSysLocale aSysLocale;
+ com::sun::star::lang::Locale aLocale = aSysLocale.GetLocale();
+ if ( aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("zh")) ||
+ aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ja")) ||
+ aLocale.Language.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ko")) )
+ aItem.bExpandWordSpace = false;
+
m_aDefOptions = aItem;
bDefaultFound = true;
}
@@ -443,6 +452,32 @@ SvtCompatibilityOptions_Impl::~SvtCompatibilityOptions_Impl()
}
}
+void SvtCompatibilityOptions_Impl::SetDefault( OUString sName, bool bValue )
+{
+ if ( COMPATIBILITY_PROPERTYNAME_USEPRTMETRICS.equals( sName ) )
+ m_aDefOptions.SetUsePrtMetrics( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_ADDSPACING.equals( sName ) )
+ m_aDefOptions.SetAddSpacing( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_ADDSPACINGATPAGES.equals( sName ) )
+ m_aDefOptions.SetAddSpacingAtPages( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_USEOURTABSTOPS.equals( sName ) )
+ m_aDefOptions.SetUseOurTabStops( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_NOEXTLEADING.equals( sName ) )
+ m_aDefOptions.SetNoExtLeading( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_USELINESPACING.equals( sName ) )
+ m_aDefOptions.SetUseLineSpacing( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_ADDTABLESPACING.equals( sName ) )
+ m_aDefOptions.SetAddTableSpacing( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_USEOBJECTPOSITIONING.equals( sName ) )
+ m_aDefOptions.SetUseObjPos( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_USEOURTEXTWRAPPING.equals( sName ) )
+ m_aDefOptions.SetUseOurTextWrapping( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_CONSIDERWRAPPINGSTYLE.equals( sName ) )
+ m_aDefOptions.SetConsiderWrappingStyle( bValue );
+ else if ( COMPATIBILITY_PROPERTYNAME_EXPANDWORDSPACE.equals( sName ) )
+ m_aDefOptions.SetExpandWordSpace( bValue );
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
@@ -680,6 +715,11 @@ void SvtCompatibilityOptions::Clear()
m_pDataContainer->Clear();
}
+void SvtCompatibilityOptions::SetDefault( ::rtl::OUString sName, bool bValue )
+{
+ m_pDataContainer->SetDefault( sName, bValue );
+}
+
//*****************************************************************************************************************
// public method
//*****************************************************************************************************************
@@ -777,28 +817,17 @@ Sequence< Sequence< PropertyValue > > SvtCompatibilityOptions::GetList() const
return m_pDataContainer->GetList();
}
+namespace
+{
+ class theCompatibilityOptionsMutex : public rtl::Static<osl::Mutex, theCompatibilityOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtCompatibilityOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theCompatibilityOptionsMutex::get();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/configitem.cxx b/unotools/source/config/configitem.cxx
index e191f471057a..0832b203ab2c 100644
--- a/unotools/source/config/configitem.cxx
+++ b/unotools/source/config/configitem.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -60,7 +61,7 @@ using namespace com::sun::star::beans;
using namespace com::sun::star::container;
using namespace com::sun::star::configuration;
-#define C2U(cChar) OUString::createFromAscii(cChar)
+#define C2U(cChar) OUString(RTL_CONSTASCII_USTRINGPARAM(cChar))
#include <cppuhelper/implbase1.hxx> // helper for implementations
#ifdef DBG_UTIL
@@ -68,7 +69,7 @@ inline void lcl_CFG_DBG_EXCEPTION(const sal_Char* cText, const Exception& rEx)
{
OString sMsg(cText);
sMsg += OString(rEx.Message.getStr(), rEx.Message.getLength(), RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, sMsg.getStr());
+ OSL_FAIL(sMsg.getStr());
}
#define CATCH_INFO(a) \
catch(Exception& rEx) \
@@ -105,9 +106,7 @@ namespace utl{
//XEventListener
virtual void SAL_CALL disposing( const EventObject& Source ) throw(RuntimeException);
};
-/* -----------------------------12.02.01 11:38--------------------------------
- ---------------------------------------------------------------------------*/
struct ConfigItem_Impl
{
utl::ConfigManager* pManager;
@@ -125,9 +124,7 @@ struct ConfigItem_Impl
{}
};
}
-/* -----------------------------04.12.00 10:25--------------------------------
- ---------------------------------------------------------------------------*/
class ValueCounter_Impl
{
sal_Int16& rCnt;
@@ -141,9 +138,7 @@ public:
rCnt--;
}
};
-/* -----------------------------03.12.02 -------------------------------------
- ---------------------------------------------------------------------------*/
namespace
{
// helper to achieve exception - safe handling of an Item under construction
@@ -165,24 +160,18 @@ namespace
void keep() { m_pItem = 0; }
};
}
-/* -----------------------------29.08.00 16:34--------------------------------
- ---------------------------------------------------------------------------*/
ConfigChangeListener_Impl::ConfigChangeListener_Impl(
ConfigItem& rItem, const Sequence< OUString >& rNames) :
pParent(&rItem),
aPropertyNames(rNames)
{
}
-/* -----------------------------29.08.00 16:34--------------------------------
- ---------------------------------------------------------------------------*/
ConfigChangeListener_Impl::~ConfigChangeListener_Impl()
{
}
-/* -----------------------------29.08.00 16:34--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool lcl_Find(
const rtl::OUString& rTemp,
const OUString* pCheckPropertyNames,
@@ -224,23 +213,19 @@ void ConfigChangeListener_Impl::changesOccurred( const ChangesEvent& rEvent ) th
}
}
-/* -----------------------------29.08.00 16:34--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigChangeListener_Impl::disposing( const EventObject& /*rSource*/ ) throw(RuntimeException)
{
pParent->RemoveChangesListener();
}
-/* -----------------------------29.08.00 12:50--------------------------------
- ---------------------------------------------------------------------------*/
-ConfigItem::ConfigItem(const OUString rSubTree, sal_Int16 nSetMode ) :
+ConfigItem::ConfigItem(const OUString &rSubTree, sal_Int16 nSetMode ) :
sSubTree(rSubTree),
pImpl(new ConfigItem_Impl)
{
AutoDeleter<ConfigItem_Impl> aNewImpl(pImpl);
- pImpl->pManager = ConfigManager::GetConfigManager();
+ pImpl->pManager = &ConfigManager::GetConfigManager();
pImpl->nMode = nSetMode;
if(0 != (nSetMode&CONFIG_MODE_RELEASE_TREE))
pImpl->pManager->AddConfigItem(*this);
@@ -251,9 +236,7 @@ ConfigItem::ConfigItem(const OUString rSubTree, sal_Int16 nSetMode ) :
aNewImpl.keep();
pImpl->nMode &= ~CONFIG_MODE_PROPAGATE_ERRORS;
}
-/* -----------------------------17.11.00 13:53--------------------------------
- ---------------------------------------------------------------------------*/
ConfigItem::ConfigItem(utl::ConfigManager& rManager, const rtl::OUString rSubTree) :
sSubTree(rSubTree),
pImpl(new ConfigItem_Impl)
@@ -262,16 +245,12 @@ ConfigItem::ConfigItem(utl::ConfigManager& rManager, const rtl::OUString rSubTr
pImpl->nMode = CONFIG_MODE_IMMEDIATE_UPDATE; // does not allow exceptions
m_xHierarchyAccess = pImpl->pManager->AddConfigItem(*this);
}
-//---------------------------------------------------------------------
-//--- 02.08.2002 16:33:23 -----------------------------------------------
+
sal_Bool ConfigItem::IsValidConfigMgr() const
{
return ( pImpl->pManager && pImpl->pManager->GetConfigurationProvider().is() );
}
-/* -----------------------------29.08.00 12:52--------------------------------
-
- ---------------------------------------------------------------------------*/
ConfigItem::~ConfigItem()
{
if(pImpl->pManager)
@@ -281,9 +260,7 @@ ConfigItem::~ConfigItem()
}
delete pImpl;
}
-/* -----------------------------29.08.00 12:52--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::ReleaseConfigMgr()
{
Reference<XHierarchicalNameAccess> xHierarchyAccess = GetTree();
@@ -300,9 +277,7 @@ void ConfigItem::ReleaseConfigMgr()
OSL_ENSURE(pImpl->pManager, "ConfigManager already released");
pImpl->pManager = 0;
}
-/* -----------------------------29.08.00 12:52--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::CallNotify( const com::sun::star::uno::Sequence<OUString>& rPropertyNames )
{
// the call is forwarded to the virtual Notify() method
@@ -312,9 +287,6 @@ void ConfigItem::CallNotify( const com::sun::star::uno::Sequence<OUString>& rPro
Notify(rPropertyNames);
}
-/* -----------------------------12.12.00 17:09--------------------------------
-
- ---------------------------------------------------------------------------*/
sal_Bool lcl_IsLocalProperty(const OUString& rSubTree, const OUString& rProperty)
{
static const sal_Char* aLocalProperties[] =
@@ -337,9 +309,7 @@ sal_Bool lcl_IsLocalProperty(const OUString& rSubTree, const OUString& rProperty
return sal_False;
}
-/* -----------------------------10.04.01 15:00--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::impl_packLocalizedProperties( const Sequence< OUString >& lInNames ,
const Sequence< Any >& lInValues ,
Sequence< Any >& lOutValues )
@@ -411,9 +381,7 @@ void ConfigItem::impl_packLocalizedProperties( const Sequence< OUString >&
++nDestinationCounter;
}
}
-/* -----------------------------10.04.01 15:00--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::impl_unpackLocalizedProperties( const Sequence< OUString >& lInNames ,
const Sequence< Any >& lInValues ,
Sequence< OUString >& lOutNames ,
@@ -488,9 +456,7 @@ void ConfigItem::impl_unpackLocalizedProperties( const Sequence< OUString >
}
}
}
-/* -----------------------------03.02.2003 14:44------------------------------
- ---------------------------------------------------------------------------*/
Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Sequence< rtl::OUString >& rNames)
{
sal_Int32 i;
@@ -516,7 +482,7 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se
{
if(pImpl->pManager->IsLocalConfigProvider() && lcl_IsLocalProperty(sSubTree, rNames[i]))
{
- OSL_ENSURE(sal_False, "ConfigItem::IsReadonly()\nlocal mode seams to be used!?\n");
+ OSL_FAIL("ConfigItem::IsReadonly()\nlocal mode seams to be used!?\n");
continue;
}
@@ -527,7 +493,7 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se
::utl::splitLastFromConfigurationPath(sName,sPath,sProperty);
if (!sPath.getLength() && !sProperty.getLength())
{
- OSL_ENSURE(sal_False, "ConfigItem::IsReadonly()\nsplitt failed\n");
+ OSL_FAIL("ConfigItem::IsReadonly()\nsplitt failed\n");
continue;
}
@@ -539,7 +505,7 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se
Any aNode = xHierarchyAccess->getByHierarchicalName(sPath);
if (!(aNode >>= xNode) || !xNode.is())
{
- OSL_ENSURE(sal_False, "ConfigItem::IsReadonly()\nno set available\n");
+ OSL_FAIL("ConfigItem::IsReadonly()\nno set available\n");
continue;
}
}
@@ -562,7 +528,7 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se
if (!xInfo.is())
{
- OSL_ENSURE(sal_False, "ConfigItem::IsReadonly()\nno prop info available\n");
+ OSL_FAIL("ConfigItem::IsReadonly()\nno prop info available\n");
continue;
}
@@ -575,9 +541,6 @@ Sequence< sal_Bool > ConfigItem::GetReadOnlyStates(const com::sun::star::uno::Se
return lStates;
}
-/* -----------------------------29.08.00 15:10--------------------------------
-
- ---------------------------------------------------------------------------*/
Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames)
{
Sequence< Any > aRet(rNames.getLength());
@@ -618,7 +581,7 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames)
sMsg += OString(pNames[i].getStr(),
pNames[i].getLength(),
RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, sMsg.getStr());
+ OSL_FAIL(sMsg.getStr());
#else
(void) rEx; // avoid warning
#endif
@@ -635,9 +598,7 @@ Sequence< Any > ConfigItem::GetProperties(const Sequence< OUString >& rNames)
}
return aRet;
}
-/* -----------------------------29.08.00 17:28--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigItem::PutProperties( const Sequence< OUString >& rNames,
const Sequence< Any>& rValues)
{
@@ -721,17 +682,13 @@ sal_Bool ConfigItem::PutProperties( const Sequence< OUString >& rNames,
return bRet;
}
-/* -----------------------------08.12.05 15:27--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::DisableNotification()
{
OSL_ENSURE( xChangeLstnr.is(), "ConfigItem::DisableNotification: notifications not enabled currently!" );
RemoveChangesListener();
}
-/* -----------------------------29.08.00 16:19--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigItem::EnableNotification(const Sequence< OUString >& rNames,
sal_Bool bEnableInternalNotification )
@@ -759,9 +716,7 @@ sal_Bool ConfigItem::EnableNotification(const Sequence< OUString >& rNames,
}
return bRet;
}
-/* -----------------------------29.08.00 16:47--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::RemoveChangesListener()
{
Reference<XChangesNotifier> xChgNot(m_xHierarchyAccess, UNO_QUERY);
@@ -777,9 +732,7 @@ void ConfigItem::RemoveChangesListener()
}
}
}
-/* -----------------------------10.07.00 --------------------------------
- ---------------------------------------------------------------------------*/
void lcl_normalizeLocalNames(Sequence< OUString >& _rNames, ConfigNameFormat _eFormat, Reference<XInterface> const& _xParentNode)
{
switch (_eFormat)
@@ -803,7 +756,7 @@ void lcl_normalizeLocalNames(Sequence< OUString >& _rNames, ConfigNameFormat _eF
break;
}
}
- OSL_ENSURE(false, "Cannot create absolute pathes: missing interface");
+ OSL_FAIL("Cannot create absolute pathes: missing interface");
// make local pathes instaed
case CONFIG_NAME_LOCAL_PATH:
@@ -854,18 +807,14 @@ void lcl_normalizeLocalNames(Sequence< OUString >& _rNames, ConfigNameFormat _eF
}
}
-/* -----------------------------10.07.00 --------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > ConfigItem::GetNodeNames(const OUString& rNode)
{
ConfigNameFormat const eDefaultFormat = CONFIG_NAME_LOCAL_NAME; // CONFIG_NAME_DEFAULT;
return GetNodeNames(rNode, eDefaultFormat);
}
-/* -----------------------------15.09.00 12:06--------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > ConfigItem::GetNodeNames(const OUString& rNode, ConfigNameFormat eFormat)
{
Sequence< OUString > aRet;
@@ -893,9 +842,7 @@ Sequence< OUString > ConfigItem::GetNodeNames(const OUString& rNode, ConfigNameF
}
return aRet;
}
-/* -----------------------------15.09.00 15:52--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigItem::ClearNodeSet(const OUString& rNode)
{
ValueCounter_Impl aCounter(pImpl->nInValueChange);
@@ -933,9 +880,7 @@ sal_Bool ConfigItem::ClearNodeSet(const OUString& rNode)
}
return bRet;
}
-/* -----------------------------24.11.00 10:58--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigItem::ClearNodeElements(const OUString& rNode, Sequence< OUString >& rElements)
{
ValueCounter_Impl aCounter(pImpl->nInValueChange);
@@ -1007,9 +952,8 @@ Sequence< OUString > lcl_extractSetPropertyNames( const Sequence< PropertyValue
return aSubNodeNames;
}
-/* -----------------------------15.09.00 15:52--------------------------------
- add or change properties
- ---------------------------------------------------------------------------*/
+
+// Add or change properties
sal_Bool ConfigItem::SetSetProperties(
const OUString& rNode, Sequence< PropertyValue > rValues)
{
@@ -1108,9 +1052,7 @@ sal_Bool ConfigItem::SetSetProperties(
}
return bRet;
}
-/* -----------------------------15.09.00 15:52--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigItem::ReplaceSetProperties(
const OUString& rNode, Sequence< PropertyValue > rValues)
{
@@ -1247,9 +1189,7 @@ sal_Bool ConfigItem::ReplaceSetProperties(
}
return bRet;
}
-/* -----------------------------07.05.01 12:15--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigItem::getUniqueSetElementName( const ::rtl::OUString& _rSetNode, ::rtl::OUString& _rName)
{
::rtl::OUString sNewElementName;
@@ -1288,9 +1228,7 @@ sal_Bool ConfigItem::getUniqueSetElementName( const ::rtl::OUString& _rSetNode,
}
return bRet;
}
-/* -----------------------------23.01.01 12:49--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigItem::AddNode(const rtl::OUString& rNode, const rtl::OUString& rNewNode)
{
ValueCounter_Impl aCounter(pImpl->nInValueChange);
@@ -1353,44 +1291,32 @@ sal_Bool ConfigItem::AddNode(const rtl::OUString& rNode, const rtl::OUString& rN
}
return bRet;
}
-/* -----------------------------12.02.01 11:38--------------------------------
- ---------------------------------------------------------------------------*/
sal_Int16 ConfigItem::GetMode() const
{
return pImpl->nMode;
}
-/* -----------------------------12.02.01 13:31--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::SetModified()
{
pImpl->bIsModified = sal_True;
}
-/* -----------------------------05.05.01 14:07--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::ClearModified()
{
pImpl->bIsModified = sal_False;
}
-/* -----------------------------12.02.01 13:31--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigItem::IsModified() const
{
return pImpl->bIsModified;
}
-/* -----------------------------12.02.01 13:33--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigItem::IsInValueChange() const
{
return pImpl->nInValueChange > 0;
}
-/* -----------------------------21.06.01 12:26--------------------------------
- ---------------------------------------------------------------------------*/
Reference< XHierarchicalNameAccess> ConfigItem::GetTree()
{
Reference< XHierarchicalNameAccess> xRet;
@@ -1398,20 +1324,15 @@ Reference< XHierarchicalNameAccess> ConfigItem::GetTree()
xRet = pImpl->pManager->AcquireTree(*this);
else
xRet = m_xHierarchyAccess;
- OSL_ENSURE(xRet.is(), "AcquireTree failed");
return xRet;
}
-/* -----------------------------22.06.01 08:42--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::LockTree()
{
OSL_ENSURE(0 != (pImpl->nMode&CONFIG_MODE_RELEASE_TREE), "call LockTree in CONFIG_MODE_RELEASE_TREE mode, only");
m_xHierarchyAccess = GetTree();
}
-/* -----------------------------22.06.01 08:42--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigItem::UnlockTree()
{
OSL_ENSURE(0 != (pImpl->nMode&CONFIG_MODE_RELEASE_TREE), "call UnlockTree in CONFIG_MODE_RELEASE_TREE mode, only");
@@ -1420,3 +1341,4 @@ void ConfigItem::UnlockTree()
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/configmgr.cxx b/unotools/source/config/configmgr.cxx
index 0df6d49afe59..2ddc11340bc7 100644
--- a/unotools/source/config/configmgr.cxx
+++ b/unotools/source/config/configmgr.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -45,22 +46,26 @@
#include <list>
+#include <stdio.h>
+
//-----------------------------------------------------------------------------
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
-#define C2U(cChar) OUString::createFromAscii(cChar)
+using ::rtl::OUString;
+#if OSL_DEBUG_LEVEL > 0
+using ::rtl::OString;
+#endif
+
#define UNISTRING(s) rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s))
//-----------------------------------------------------------------------------
-const char* cConfigBaseURL = "/org.openoffice.";
-//const char* cConfigBaseURL = "/com.sun.star.";
-const char* cAccessSrvc = "com.sun.star.configuration.ConfigurationUpdateAccess";
+const char* pConfigBaseURL = "/org.openoffice.";
+const char* pAccessSrvc = "com.sun.star.configuration.ConfigurationUpdateAccess";
namespace
{
@@ -101,35 +106,33 @@ struct utl::ConfigMgr_Impl
ConfigItemList aItemList;
};
-/* -----------------------------28.08.00 15:35--------------------------------
-
- ---------------------------------------------------------------------------*/
ConfigManager::ConfigManager() :
pMgrImpl(new utl::ConfigMgr_Impl)
{
GetConfigurationProvider(); // attempt to create the provider early
}
-/* -----------------------------17.11.00 13:51--------------------------------
- ---------------------------------------------------------------------------*/
ConfigManager::ConfigManager(Reference< XMultiServiceFactory > xConfigProv) :
xConfigurationProvider(xConfigProv),
pMgrImpl(new utl::ConfigMgr_Impl)
{
}
-/* -----------------------------28.08.00 15:35--------------------------------
- ---------------------------------------------------------------------------*/
ConfigManager::~ConfigManager()
{
//check list content -> should be empty!
+#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE(pMgrImpl->aItemList.empty(), "some ConfigItems are still alive");
+#endif
if(!pMgrImpl->aItemList.empty())
{
ConfigItemList::iterator aListIter;
for(aListIter = pMgrImpl->aItemList.begin(); aListIter != pMgrImpl->aItemList.end(); ++aListIter)
{
ConfigItemListEntry_Impl& rEntry = *aListIter;
+#if OSL_DEBUG_LEVEL > 0
+ fprintf(stderr, "Dangling config item of %s\n", rtl::OUStringToOString(rEntry.pConfigItem->GetSubTreeName(), RTL_TEXTENCODING_UTF8).getStr());
+#endif
rEntry.pConfigItem->ReleaseConfigMgr();
}
pMgrImpl->aItemList.erase(pMgrImpl->aItemList.begin(), pMgrImpl->aItemList.end());
@@ -137,9 +140,7 @@ ConfigManager::~ConfigManager()
delete pMgrImpl;
}
-/* -----------------------------28.08.00 16:17--------------------------------
- ---------------------------------------------------------------------------*/
Reference< XMultiServiceFactory > ConfigManager::GetConfigurationProvider()
{
if(!xConfigurationProvider.is())
@@ -151,10 +152,10 @@ Reference< XMultiServiceFactory > ConfigManager::GetConfigurationProvider()
{
xConfigurationProvider = Reference< XMultiServiceFactory >
(xMSF->createInstance(
- C2U("com.sun.star.configuration.ConfigurationProvider")),
+ UNISTRING("com.sun.star.configuration.ConfigurationProvider")),
UNO_QUERY);
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
catch(Exception& rEx)
{
static sal_Bool bMessage = sal_True;
@@ -165,7 +166,7 @@ Reference< XMultiServiceFactory > ConfigManager::GetConfigurationProvider()
sMsg += OString(rEx.Message.getStr(),
rEx.Message.getLength(),
RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, sMsg.getStr());
+ OSL_FAIL(sMsg.getStr());
}
}
#else
@@ -175,9 +176,7 @@ Reference< XMultiServiceFactory > ConfigManager::GetConfigurationProvider()
}
return xConfigurationProvider;
}
-/* -----------------------------03.12.02 -------------------------------------
- ---------------------------------------------------------------------------*/
namespace
{
// helper to achieve exception - safe registration of a ConfigItem under construction
@@ -201,16 +200,12 @@ namespace
void keep() { pCfgItem = 0; }
};
}
-/* -----------------------------12.12.00 17:19--------------------------------
- ---------------------------------------------------------------------------*/
Reference< XMultiServiceFactory > ConfigManager::GetLocalConfigurationProvider()
{
return GetConfigurationProvider();
}
-/* -----------------------------29.08.00 12:35--------------------------------
- ---------------------------------------------------------------------------*/
Reference< XHierarchicalNameAccess > ConfigManager::AddConfigItem(utl::ConfigItem& rCfgItem)
{
RegisterConfigItemHelper registeredItem(*this,rCfgItem);
@@ -218,30 +213,26 @@ Reference< XHierarchicalNameAccess > ConfigManager::AddConfigItem(utl::ConfigIte
registeredItem.keep();
return xTree;
}
-/* -----------------------------21.06.01 12:20--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigManager::RegisterConfigItem(utl::ConfigItem& rCfgItem)
{
ConfigItemList::iterator aListIter = pMgrImpl->aItemList.begin();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
for(aListIter = pMgrImpl->aItemList.begin(); aListIter != pMgrImpl->aItemList.end(); ++aListIter)
{
ConfigItemListEntry_Impl& rEntry = *aListIter;
if(rEntry.pConfigItem == &rCfgItem)
- OSL_ENSURE(sal_False, "RegisterConfigItem: already inserted!");
+ OSL_FAIL("RegisterConfigItem: already inserted!");
}
#endif
pMgrImpl->aItemList.insert(aListIter, ConfigItemListEntry_Impl(&rCfgItem));
}
-/* -----------------------------21.06.01 12:20--------------------------------
- ---------------------------------------------------------------------------*/
Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem& rCfgItem)
{
- ConfigItemList::iterator aListIter = pMgrImpl->aItemList.begin();
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
sal_Bool bFound = sal_False;
+ ConfigItemList::iterator aListIter = pMgrImpl->aItemList.begin();
for(aListIter = pMgrImpl->aItemList.begin(); aListIter != pMgrImpl->aItemList.end(); ++aListIter)
{
ConfigItemListEntry_Impl& rEntry = *aListIter;
@@ -253,17 +244,17 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
}
OSL_ENSURE(bFound, "AcquireTree: ConfigItem unknown!");
#endif
- OUString sPath = C2U(cConfigBaseURL);
+ OUString sPath(OUString::createFromAscii(pConfigBaseURL));
sPath += rCfgItem.GetSubTreeName();
Sequence< Any > aArgs(2);
Any* pArgs = aArgs.getArray();
PropertyValue aPath;
- aPath.Name = C2U("nodepath");
+ aPath.Name = UNISTRING("nodepath");
aPath.Value <<= sPath;
pArgs[0] <<= aPath;
sal_Bool bLazy = 0 != (rCfgItem.GetMode()&CONFIG_MODE_DELAYED_UPDATE);
PropertyValue aUpdate;
- aUpdate.Name = C2U("lazywrite");
+ aUpdate.Name = UNISTRING("lazywrite");
aUpdate.Value.setValue(&bLazy, ::getBooleanCppuType());
pArgs[1] <<= aUpdate;
@@ -276,8 +267,8 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
aArgs.realloc(nCount+1);
PropertyValue aAllLocale;
- aAllLocale.Name = C2U("locale");
- aAllLocale.Value <<= C2U("*" );
+ aAllLocale.Name = UNISTRING("locale");
+ aAllLocale.Value <<= UNISTRING("*" );
aArgs[nCount] <<= aAllLocale;
}
@@ -288,7 +279,7 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
try
{
xIFace = xCfgProvider->createInstanceWithArguments(
- C2U(cAccessSrvc),
+ OUString::createFromAscii(pAccessSrvc),
aArgs);
}
catch(Exception& rEx)
@@ -300,23 +291,21 @@ Reference< XHierarchicalNameAccess> ConfigManager::AcquireTree(utl::ConfigItem&
throw;
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
if(0 == (CONFIG_MODE_IGNORE_ERRORS & rCfgItem.GetMode()))
{
OString sMsg("CreateInstance exception: ");
sMsg += OString(rEx.Message.getStr(),
rEx.Message.getLength(),
RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, sMsg.getStr());
+ OSL_FAIL(sMsg.getStr());
}
#endif
}
}
return Reference<XHierarchicalNameAccess>(xIFace, UNO_QUERY);
}
-/* -----------------------------29.08.00 12:35--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigManager::RemoveConfigItem(utl::ConfigItem& rCfgItem)
{
if( !pMgrImpl->aItemList.empty() )
@@ -333,9 +322,7 @@ void ConfigManager::RemoveConfigItem(utl::ConfigItem& rCfgItem)
}
}
}
-/* -----------------------------30.08.00 15:04--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigManager::StoreConfigItems()
{
if(!pMgrImpl->aItemList.empty())
@@ -352,61 +339,37 @@ void ConfigManager::StoreConfigItems()
}
}
}
-ConfigManager* ConfigManager::pConfigManager = 0;
-/* -----------------------------07.09.00 11:06--------------------------------
- ---------------------------------------------------------------------------*/
-ConfigManager* ConfigManager::GetConfigManager()
-{
- if(!pConfigManager)
- {
- pConfigManager = new ConfigManager();
- }
- return pConfigManager;
-}
-/* -----------------------------07.09.00 11:06--------------------------------
+struct theConfigManager : public rtl::Static<ConfigManager, theConfigManager> {};
- ---------------------------------------------------------------------------*/
-void ConfigManager::RemoveConfigManager()
+ConfigManager& ConfigManager::GetConfigManager()
{
- if(pConfigManager)
- {
- delete pConfigManager;
- pConfigManager = 0;
- }
+ return theConfigManager::get();
}
-/* -----------------------------08.09.00 13:22--------------------------------
- ---------------------------------------------------------------------------*/
rtl::OUString ConfigManager::GetConfigBaseURL()
{
- return C2U(cConfigBaseURL);
+ return OUString::createFromAscii(pConfigBaseURL);
}
-/* -----------------------------25.09.00 16:34--------------------------------
- ---------------------------------------------------------------------------*/
Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
{
switch(eProp)
{
case INSTALLPATH:
- OSL_ENSURE( false,
- "ConfigManager::GetDirectConfigProperty: "
+ OSL_FAIL( "ConfigManager::GetDirectConfigProperty: "
"INSTALLPATH no longer supported." );
return Any();
case USERINSTALLURL:
- OSL_ENSURE( false,
- "ConfigManager::GetDirectConfigProperty: "
+ OSL_FAIL( "ConfigManager::GetDirectConfigProperty: "
"USERINSTALLURL no longer supported." );
return Any();
case OFFICEINSTALL:
- OSL_ENSURE( false,
- "ConfigManager::GetDirectConfigProperty: "
+ OSL_FAIL( "ConfigManager::GetDirectConfigProperty: "
"OFFICEINSTALL no longer supported." );
return Any();
case OFFICEINSTALLURL:
- OSL_ENSURE( false,
- "ConfigManager::GetDirectConfigProperty: "
+ OSL_FAIL( "ConfigManager::GetDirectConfigProperty: "
"OFFICEINSTALLURL no longer supported." );
return Any();
default:
@@ -414,6 +377,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
}
Any aRet;
+
::rtl::OUString &rBrandName = BrandName::get();
if ( eProp == PRODUCTNAME && rBrandName.getLength() )
{
@@ -480,9 +444,8 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
if (eProp == PRODUCTEXTENSION) {
rtl::OUString name(
- rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
- "${BRAND_BASE_DIR}/program/edition/edition.ini")));
+ "${BRAND_BASE_DIR}/program/edition/edition.ini"));
rtl::Bootstrap::expandMacros(name);
if (rtl::Bootstrap(name).getFrom(
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("EDITIONNAME")),
@@ -492,10 +455,10 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
}
}
- OUString sPath = C2U(cConfigBaseURL);
+ OUString sPath = OUString::createFromAscii(pConfigBaseURL);
switch(eProp)
{
- case LOCALE: sPath += C2U("Setup/L10N"); break;
+ case LOCALE: sPath += UNISTRING("Setup/L10N"); break;
case PRODUCTNAME:
case PRODUCTVERSION:
@@ -504,25 +467,25 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
case PRODUCTXMLFILEFORMATVERSION:
case OPENSOURCECONTEXT:
case OOOVENDOR:
- case ABOUTBOXPRODUCTVERSION: sPath += C2U("Setup/Product"); break;
+ case ABOUTBOXPRODUCTVERSION: sPath += UNISTRING("Setup/Product"); break;
- case DEFAULTCURRENCY: sPath += C2U("Setup/L10N"); break;
+ case DEFAULTCURRENCY: sPath += UNISTRING("Setup/L10N"); break;
case WRITERCOMPATIBILITYVERSIONOOO11:
- sPath += C2U("Office.Compatibility/WriterCompatibilityVersion"); break;
+ sPath += UNISTRING("Office.Compatibility/WriterCompatibilityVersion"); break;
default:
break;
}
Sequence< Any > aArgs(1);
aArgs[0] <<= sPath;
- Reference< XMultiServiceFactory > xCfgProvider = GetConfigManager()->GetConfigurationProvider();
+ Reference< XMultiServiceFactory > xCfgProvider = GetConfigManager().GetConfigurationProvider();
if(!xCfgProvider.is())
return aRet;
Reference< XInterface > xIFace;
try
{
xIFace = xCfgProvider->createInstanceWithArguments(
- C2U(cAccessSrvc),
+ OUString::createFromAscii(pAccessSrvc),
aArgs);
}
@@ -533,17 +496,17 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
OUString sProperty;
switch(eProp)
{
- case LOCALE: sProperty = C2U("ooLocale"); break;
- case PRODUCTNAME: sProperty = C2U("ooName"); break;
- case PRODUCTVERSION: sProperty = C2U("ooSetupVersion"); break;
- case ABOUTBOXPRODUCTVERSION: sProperty = C2U("ooSetupVersionAboutBox"); break;
- case OOOVENDOR: sProperty = C2U("ooVendor"); break;
- case PRODUCTEXTENSION: sProperty = C2U("ooSetupExtension"); break;
- case PRODUCTXMLFILEFORMATNAME: sProperty = C2U("ooXMLFileFormatName"); break;
- case PRODUCTXMLFILEFORMATVERSION: sProperty = C2U("ooXMLFileFormatVersion"); break;
- case OPENSOURCECONTEXT: sProperty = C2U("ooOpenSourceContext"); break;
- case DEFAULTCURRENCY: sProperty = C2U("ooSetupCurrency"); break;
- case WRITERCOMPATIBILITYVERSIONOOO11: sProperty = C2U("OOo11"); break;
+ case LOCALE: sProperty = UNISTRING("ooLocale"); break;
+ case PRODUCTNAME: sProperty = UNISTRING("ooName"); break;
+ case PRODUCTVERSION: sProperty = UNISTRING("ooSetupVersion"); break;
+ case ABOUTBOXPRODUCTVERSION: sProperty = UNISTRING("ooSetupVersionAboutBox"); break;
+ case OOOVENDOR: sProperty = UNISTRING("ooVendor"); break;
+ case PRODUCTEXTENSION: sProperty = UNISTRING("ooSetupExtension"); break;
+ case PRODUCTXMLFILEFORMATNAME: sProperty = UNISTRING("ooXMLFileFormatName"); break;
+ case PRODUCTXMLFILEFORMATVERSION: sProperty = UNISTRING("ooXMLFileFormatVersion"); break;
+ case OPENSOURCECONTEXT: sProperty = UNISTRING("ooOpenSourceContext"); break;
+ case DEFAULTCURRENCY: sProperty = UNISTRING("ooSetupCurrency"); break;
+ case WRITERCOMPATIBILITYVERSIONOOO11: sProperty = UNISTRING("OOo11"); break;
default:
break;
}
@@ -560,7 +523,7 @@ Any ConfigManager::GetDirectConfigProperty(ConfigProperty eProp)
aBuf.append( "\" under \"" );
aBuf.append( rtl::OUStringToOString( sPath, RTL_TEXTENCODING_ASCII_US ) );
aBuf.append( "\" (caught an exception)!" );
- OSL_ENSURE( sal_False, aBuf.getStr() );
+ OSL_FAIL( aBuf.getStr() );
#endif
}
}
@@ -641,9 +604,6 @@ void ConfigManager::getBasisAboutBoxProductVersion( OUString& rVersion )
}
}
-/* -----------------------------12.12.00 17:22--------------------------------
-
- ---------------------------------------------------------------------------*/
Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUString& rFullPath)
{
Sequence< Any > aArgs(1);
@@ -655,17 +615,17 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt
try
{
xIFace = xCfgProvider->createInstanceWithArguments(
- C2U(cAccessSrvc),
+ OUString::createFromAscii(pAccessSrvc),
aArgs);
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
catch(Exception& rEx)
{
OString sMsg("CreateInstance exception: ");
sMsg += OString(rEx.Message.getStr(),
rEx.Message.getLength(),
RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, sMsg.getStr());
+ OSL_FAIL(sMsg.getStr());
}
#else
catch(Exception&){}
@@ -673,12 +633,10 @@ Reference< XHierarchicalNameAccess> ConfigManager::GetHierarchyAccess(const OUSt
}
return Reference<XHierarchicalNameAccess>(xIFace, UNO_QUERY);
}
-/* -----------------------------12.12.00 17:17--------------------------------
- ---------------------------------------------------------------------------*/
Any ConfigManager::GetLocalProperty(const OUString& rProperty)
{
- OUString sPath = C2U(cConfigBaseURL);
+ OUString sPath(OUString::createFromAscii(pConfigBaseURL));
sPath += rProperty;
OUString sNode, sProperty;
@@ -691,26 +649,24 @@ Any ConfigManager::GetLocalProperty(const OUString& rProperty)
if(xAccess.is())
aRet = xAccess->getByName(sProperty);
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
catch(Exception& rEx)
{
OString sMsg("GetLocalProperty: ");
sMsg += OString(rEx.Message.getStr(),
rEx.Message.getLength(),
RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, sMsg.getStr());
+ OSL_FAIL(sMsg.getStr());
}
#else
catch(Exception&){}
#endif
return aRet;
}
-/* -----------------------------12.12.00 17:17--------------------------------
- ---------------------------------------------------------------------------*/
void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValue)
{
- OUString sPath = C2U(cConfigBaseURL);
+ OUString sPath(OUString::createFromAscii(pConfigBaseURL));
sPath += rProperty;
OUString sNode, sProperty;
@@ -723,25 +679,24 @@ void ConfigManager::PutLocalProperty(const OUString& rProperty, const Any& rValu
{
xNodeReplace->replaceByName(sProperty, rValue);
}
-#ifdef DBG_UTIL
+#if OSL_DEBUG_LEVEL > 1
catch(Exception& rEx)
{
OString sMsg("PutLocalProperty: ");
sMsg += OString(rEx.Message.getStr(),
rEx.Message.getLength(),
RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, sMsg.getStr());
+ OSL_FAIL(sMsg.getStr());
}
#else
catch(Exception& ){}
#endif
}
}
-/* -----------------------------13.12.00 08:47--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool ConfigManager::IsLocalConfigProvider()
{
return false;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index 181c7ca46c8f..264eda0f59ce 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -209,7 +210,7 @@ namespace utl
}
catch(Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::getNodeNames: caught a generic exception!");
+ OSL_FAIL("OConfigurationNode::getNodeNames: caught a generic exception!");
}
}
@@ -235,16 +236,16 @@ namespace utl
aBuf.append("OConfigurationNode::removeNode: there is no element named!");
aBuf.append( rtl::OUStringToOString( _rName, RTL_TEXTENCODING_ASCII_US ) );
aBuf.append( "!" );
- OSL_ENSURE(sal_False, aBuf.getStr());
+ OSL_FAIL(aBuf.getStr());
#endif
}
catch (WrappedTargetException&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::removeNode: caught a WrappedTargetException!");
+ OSL_FAIL("OConfigurationNode::removeNode: caught a WrappedTargetException!");
}
catch(Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::removeNode: caught a generic exception!");
+ OSL_FAIL("OConfigurationNode::removeNode: caught a generic exception!");
}
}
return sal_False;
@@ -315,12 +316,12 @@ namespace utl
if (m_xDirectAccess.is() && m_xDirectAccess->hasByName(sNormalized))
{
if (!::cppu::extractInterface(xNode, m_xDirectAccess->getByName(sNormalized)))
- OSL_ENSURE(sal_False, "OConfigurationNode::openNode: could not open the node!");
+ OSL_FAIL("OConfigurationNode::openNode: could not open the node!");
}
else if (m_xHierarchyAccess.is())
{
if (!::cppu::extractInterface(xNode, m_xHierarchyAccess->getByHierarchicalName(_rPath)))
- OSL_ENSURE(sal_False, "OConfigurationNode::openNode: could not open the node!");
+ OSL_FAIL("OConfigurationNode::openNode: could not open the node!");
}
if (xNode.is())
return OConfigurationNode( xNode );
@@ -333,12 +334,12 @@ namespace utl
aBuf.append("OConfigurationNode::openNode: there is no element named ");
aBuf.append( rtl::OUStringToOString( _rPath, RTL_TEXTENCODING_ASCII_US ) );
aBuf.append("!");
- OSL_ENSURE(sal_False, aBuf.getStr());
+ OSL_FAIL(aBuf.getStr());
#endif
}
catch(Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::openNode: caught an exception while retrieving the node!");
+ OSL_FAIL("OConfigurationNode::openNode: caught an exception while retrieving the node!");
}
return OConfigurationNode();
}
@@ -356,15 +357,12 @@ namespace utl
Reference< XServiceInfo > xSI(m_xHierarchyAccess, UNO_QUERY);
if (xSI.is())
{
- try { bIsSet = xSI->supportsService(::rtl::OUString::createFromAscii("com.sun.star.configuration.SetAccess")); }
+ try { bIsSet = xSI->supportsService(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.SetAccess"))); }
catch(Exception&) { }
}
return bIsSet;
}
- //---------------------------------------------------------------------
- //--- 20.08.01 19:03:20 -----------------------------------------------
-
sal_Bool OConfigurationNode::hasByHierarchicalName( const ::rtl::OUString& _rName ) const throw()
{
OSL_ENSURE( m_xHierarchyAccess.is(), "OConfigurationNode::hasByHierarchicalName: no hierarchy access!" );
@@ -439,19 +437,19 @@ namespace utl
}
catch(IllegalArgumentException&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::setNodeValue: could not replace the value: caught an IllegalArgumentException!");
+ OSL_FAIL("OConfigurationNode::setNodeValue: could not replace the value: caught an IllegalArgumentException!");
}
catch(NoSuchElementException&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::setNodeValue: could not replace the value: caught a NoSuchElementException!");
+ OSL_FAIL("OConfigurationNode::setNodeValue: could not replace the value: caught a NoSuchElementException!");
}
catch(WrappedTargetException&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::setNodeValue: could not replace the value: caught a WrappedTargetException!");
+ OSL_FAIL("OConfigurationNode::setNodeValue: could not replace the value: caught a WrappedTargetException!");
}
catch(Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::setNodeValue: could not replace the value: caught a generic Exception!");
+ OSL_FAIL("OConfigurationNode::setNodeValue: could not replace the value: caught a generic Exception!");
}
@@ -532,10 +530,9 @@ namespace utl
aArgs.put( "lazywrite", i_bLazyWrite );
aArgs.put( "depth", i_nDepth );
- ::rtl::OUString sAccessService = ::rtl::OUString::createFromAscii(
- i_bUpdatable
- ? "com.sun.star.configuration.ConfigurationUpdateAccess"
- : "com.sun.star.configuration.ConfigurationAccess" );
+ ::rtl::OUString sAccessService( i_bUpdatable ?
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationUpdateAccess" )) :
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.configuration.ConfigurationAccess" )));
Reference< XInterface > xRoot(
i_rxConfigProvider->createInstanceWithArguments( sAccessService, aArgs.getWrappedPropertyValues() ),
@@ -663,3 +660,4 @@ namespace utl
} // namespace utl
//........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/configpathes.cxx b/unotools/source/config/configpathes.cxx
index 5e7a4c80813e..5c35e112bad0 100644
--- a/unotools/source/config/configpathes.cxx
+++ b/unotools/source/config/configpathes.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -97,7 +98,7 @@ sal_Bool splitLastFromConfigurationPath(OUString const& _sInPath,
// strip trailing slash
if (nPos > 0 && _sInPath[ nPos ] == sal_Unicode('/'))
{
- OSL_ENSURE(false, "Invalid config path: trailing '/' is not allowed");
+ OSL_FAIL("Invalid config path: trailing '/' is not allowed");
--nPos;
}
@@ -306,3 +307,5 @@ OUString wrapConfigurationElementName(OUString const& _sElementName,
//----------------------------------------------------------------------------
} // namespace utl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx
index 653305f92f74..a7fc30699218 100644
--- a/unotools/source/config/configvaluecontainer.cxx
+++ b/unotools/source/config/configvaluecontainer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -81,9 +82,6 @@ namespace utl
bool operator != ( const NodeValueAccessor& rhs ) const { return !operator == ( rhs ); }
};
- //---------------------------------------------------------------------
- //--- 20.08.01 17:21:13 -----------------------------------------------
-
NodeValueAccessor::NodeValueAccessor( const ::rtl::OUString& _rNodePath )
:sRelativePath( _rNodePath )
,eLocationType( ltUnbound )
@@ -91,9 +89,6 @@ namespace utl
{
}
- //---------------------------------------------------------------------
- //--- 20.08.01 17:06:36 -----------------------------------------------
-
bool NodeValueAccessor::operator == ( const NodeValueAccessor& rhs ) const
{
return ( sRelativePath == rhs.sRelativePath )
@@ -101,9 +96,6 @@ namespace utl
&& ( pLocation == rhs.pLocation );
}
- //---------------------------------------------------------------------
- //--- 20.08.01 17:47:43 -----------------------------------------------
-
void NodeValueAccessor::bind( void* _pLocation, const Type& _rType )
{
DBG_ASSERT( !isBound(), "NodeValueAccessor::bind: already bound!" );
@@ -113,9 +105,6 @@ namespace utl
aDataType = _rType;
}
- //---------------------------------------------------------------------
- //--- 20.08.01 17:48:47 -----------------------------------------------
-
void NodeValueAccessor::bind( Any* _pLocation )
{
DBG_ASSERT( !isBound(), "NodeValueAccessor::bind: already bound!" );
@@ -125,9 +114,6 @@ namespace utl
aDataType = ::getCppuType( _pLocation );
}
- //---------------------------------------------------------------------
- //--- 20.08.01 17:42:17 -----------------------------------------------
-
#ifndef UNX
static
#endif
@@ -173,9 +159,6 @@ namespace utl
}
}
- //---------------------------------------------------------------------
- //--- 21.08.01 12:06:43 -----------------------------------------------
-
#ifndef UNX
static
#endif
@@ -204,9 +187,6 @@ namespace utl
//= functors on NodeValueAccessor instances
//=====================================================================
- //---------------------------------------------------------------------
- //--- 21.08.01 12:01:16 -----------------------------------------------
-
/// base class for functors syncronizing between exchange locations and config sub nodes
struct SubNodeAccess : public ::std::unary_function< NodeValueAccessor, void >
{
@@ -222,9 +202,6 @@ namespace utl
}
};
- //---------------------------------------------------------------------
- //--- 21.08.01 11:25:56 -----------------------------------------------
-
struct UpdateFromConfig : public SubNodeAccess
{
public:
@@ -236,9 +213,6 @@ namespace utl
}
};
- //---------------------------------------------------------------------
- //--- 21.08.01 11:25:56 -----------------------------------------------
-
struct UpdateToConfig : public SubNodeAccess
{
public:
@@ -252,9 +226,6 @@ namespace utl
}
};
- //---------------------------------------------------------------------
- //--- 20.08.01 16:58:24 -----------------------------------------------
-
DECLARE_STL_VECTOR( NodeValueAccessor, NodeValueAccessors );
//=====================================================================
@@ -279,9 +250,6 @@ namespace utl
//= OConfigurationValueContainer
//=====================================================================
- //---------------------------------------------------------------------
- //--- 20.08.01 15:53:35 -----------------------------------------------
-
OConfigurationValueContainer::OConfigurationValueContainer(
const Reference< XMultiServiceFactory >& _rxORB, ::osl::Mutex& _rAccessSafety,
const sal_Char* _pConfigLocation, const sal_uInt16 _nAccessFlags, const sal_Int32 _nLevels )
@@ -290,9 +258,6 @@ namespace utl
implConstruct( ::rtl::OUString::createFromAscii( _pConfigLocation ), _nAccessFlags, _nLevels );
}
- //---------------------------------------------------------------------
- //--- 20.08.01 15:55:20 -----------------------------------------------
-
OConfigurationValueContainer::OConfigurationValueContainer(
const Reference< XMultiServiceFactory >& _rxORB, ::osl::Mutex& _rAccessSafety,
const ::rtl::OUString& _rConfigLocation, const sal_uInt16 _nAccessFlags, const sal_Int32 _nLevels )
@@ -301,25 +266,16 @@ namespace utl
implConstruct( _rConfigLocation, _nAccessFlags, _nLevels );
}
- //---------------------------------------------------------------------
- //--- 20.08.01 16:01:29 -----------------------------------------------
-
OConfigurationValueContainer::~OConfigurationValueContainer()
{
delete m_pImpl;
}
- //---------------------------------------------------------------------
- //--- 20.08.01 15:59:13 -----------------------------------------------
-
const Reference< XMultiServiceFactory >& OConfigurationValueContainer::getServiceFactory( ) const
{
return m_pImpl->xORB;
}
- //---------------------------------------------------------------------
- //--- 20.08.01 16:02:07 -----------------------------------------------
-
void OConfigurationValueContainer::implConstruct( const ::rtl::OUString& _rConfigLocation,
const sal_uInt16 _nAccessFlags, const sal_Int32 _nLevels )
{
@@ -343,9 +299,6 @@ namespace utl
#endif
}
- //---------------------------------------------------------------------
- //--- 20.08.01 16:39:05 -----------------------------------------------
-
void OConfigurationValueContainer::registerExchangeLocation( const sal_Char* _pRelativePath,
void* _pContainer, const Type& _rValueType )
{
@@ -369,9 +322,6 @@ namespace utl
implRegisterExchangeLocation( aNewAccessor );
}
- //---------------------------------------------------------------------
- //--- 21.08.01 14:44:45 -----------------------------------------------
-
void OConfigurationValueContainer::registerNullValueExchangeLocation( const sal_Char* _pRelativePath, Any* _pContainer )
{
// build an accessor for this container
@@ -382,25 +332,19 @@ namespace utl
implRegisterExchangeLocation( aNewAccessor );
}
- //---------------------------------------------------------------------
- //--- 21.08.01 10:23:34 -----------------------------------------------
-
void OConfigurationValueContainer::read( )
{
- for_each(
+ std::for_each(
m_pImpl->aAccessors.begin(),
m_pImpl->aAccessors.end(),
UpdateFromConfig( m_pImpl->aConfigRoot, m_pImpl->rMutex )
);
}
- //---------------------------------------------------------------------
- //--- 21.08.01 12:04:48 -----------------------------------------------
-
void OConfigurationValueContainer::write( sal_Bool _bCommit )
{
// collect the current values in the exchange locations
- for_each(
+ std::for_each(
m_pImpl->aAccessors.begin(),
m_pImpl->aAccessors.end(),
UpdateToConfig( m_pImpl->aConfigRoot, m_pImpl->rMutex )
@@ -411,9 +355,6 @@ namespace utl
commit( sal_False );
}
- //---------------------------------------------------------------------
- //--- 21.08.01 12:09:45 -----------------------------------------------
-
void OConfigurationValueContainer::commit( sal_Bool _bWrite )
{
// write the current values in the exchange locations (if requested)
@@ -424,9 +365,6 @@ namespace utl
m_pImpl->aConfigRoot.commit( );
}
- //---------------------------------------------------------------------
- //--- 20.08.01 17:29:27 -----------------------------------------------
-
void OConfigurationValueContainer::implRegisterExchangeLocation( const NodeValueAccessor& _rAccessor )
{
// some checks
@@ -454,3 +392,4 @@ namespace utl
} // namespace utl
//.........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/defaultoptions.cxx b/unotools/source/config/defaultoptions.cxx
index 7bd4b566e928..0b9f1331b261 100644
--- a/unotools/source/config/defaultoptions.cxx
+++ b/unotools/source/config/defaultoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,7 +40,6 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <osl/mutex.hxx>
-#include <vos/process.hxx>
#include <unotools/localfilehelper.hxx>
#include <rtl/instance.hxx>
@@ -47,9 +47,10 @@
using namespace osl;
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
// define ----------------------------------------------------------------
#define ASCII_STR(s) OUString( RTL_CONSTASCII_USTRINGPARAM(s) )
@@ -125,7 +126,7 @@ struct PathToDefaultMapping_Impl
PathStrPtr _pDefaultPath;
};
-static PathToDefaultMapping_Impl __READONLY_DATA PathMap_Impl[] =
+static PathToDefaultMapping_Impl const PathMap_Impl[] =
{
{ SvtPathOptions::PATH_ADDIN, &SvtDefaultOptions_Impl::m_aAddinPath },
{ SvtPathOptions::PATH_AUTOCORRECT, &SvtDefaultOptions_Impl::m_aAutoCorrectPath },
@@ -361,3 +362,4 @@ String SvtDefaultOptions::GetDefaultPath( sal_uInt16 nId ) const
return pImp->GetDefaultPath( nId );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/docinfohelper.cxx b/unotools/source/config/docinfohelper.cxx
index 677432e1f7d3..462ab33ca162 100644
--- a/unotools/source/config/docinfohelper.cxx
+++ b/unotools/source/config/docinfohelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,6 +34,7 @@
#include <unotools/configmgr.hxx>
#include <unotools/bootstrap.hxx>
#include <unotools/docinfohelper.hxx>
+#include <rtl/bootstrap.hxx>
using namespace ::com::sun::star;
@@ -45,46 +47,47 @@ namespace utl
// First product: branded name + version
// version is <product_versions>_<product_extension>$<platform>
- utl::ConfigManager* pMgr = utl::ConfigManager::GetConfigManager();
- if ( pMgr )
+ utl::ConfigManager& rMgr = utl::ConfigManager::GetConfigManager();
+ // plain product name
+ rtl::OUString aValue;
+ uno::Any aAny = rMgr.GetDirectConfigProperty(
+ utl::ConfigManager::PRODUCTNAME);
+ if ( (aAny >>= aValue) && aValue.getLength() )
{
- // plain product name
- rtl::OUString aValue;
- uno::Any aAny = pMgr->GetDirectConfigProperty(
- utl::ConfigManager::PRODUCTNAME);
+ aResult.append( aValue.replace( ' ', '_' ) );
+ aResult.append( (sal_Unicode)'/' );
+
+ aAny = rMgr.GetDirectConfigProperty(
+ utl::ConfigManager::PRODUCTVERSION);
if ( (aAny >>= aValue) && aValue.getLength() )
{
aResult.append( aValue.replace( ' ', '_' ) );
- aResult.append( (sal_Unicode)'/' );
- aAny = pMgr->GetDirectConfigProperty(
- utl::ConfigManager::PRODUCTVERSION);
+ aAny = rMgr.GetDirectConfigProperty(
+ utl::ConfigManager::PRODUCTEXTENSION);
if ( (aAny >>= aValue) && aValue.getLength() )
{
+ aResult.append( (sal_Unicode)'_' );
aResult.append( aValue.replace( ' ', '_' ) );
-
- aAny = pMgr->GetDirectConfigProperty(
- utl::ConfigManager::PRODUCTEXTENSION);
- if ( (aAny >>= aValue) && aValue.getLength() )
- {
- aResult.append( (sal_Unicode)'_' );
- aResult.append( aValue.replace( ' ', '_' ) );
- }
}
-
- aResult.append( (sal_Unicode)'$' );
- aResult.append( ::rtl::OUString::createFromAscii(
- TOOLS_INETDEF_OS ).replace( ' ', '_' ) );
-
- aResult.append( (sal_Unicode)' ' );
}
+
+ ::rtl::OUString os( RTL_CONSTASCII_USTRINGPARAM("$_OS") );
+ ::rtl::OUString arch( RTL_CONSTASCII_USTRINGPARAM("$_ARCH") );
+ ::rtl::Bootstrap::expandMacros(os);
+ ::rtl::Bootstrap::expandMacros(arch);
+ aResult.append( (sal_Unicode)'$' );
+ aResult.append( os );
+ aResult.append( (sal_Unicode)'_' );
+ aResult.append( arch );
+ aResult.append( (sal_Unicode)' ' );
}
- // second product: OpenOffice.org_project/<build_information>
+ // second product: LibreOffice_project/<build_information>
// build_information has '(' and '[' encoded as '$', ')' and ']' ignored
// and ':' replaced by '-'
{
- aResult.appendAscii( "OpenOffice.org_project/" );
+ aResult.appendAscii( "LibreOffice_project/" );
::rtl::OUString aDefault;
::rtl::OUString aBuildId( Bootstrap::getBuildIdData( aDefault ) );
for( sal_Int32 i=0; i < aBuildId.getLength(); i++ )
@@ -114,3 +117,4 @@ namespace utl
} // end of namespace utl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/dynamicmenuoptions.cxx b/unotools/source/config/dynamicmenuoptions.cxx
index 6ef88002a442..ec80822b4d65 100644
--- a/unotools/source/config/dynamicmenuoptions.cxx
+++ b/unotools/source/config/dynamicmenuoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/dynamicmenuoptions.hxx>
#include <unotools/moduleoptions.hxx>
@@ -42,9 +37,7 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-#ifndef __SGI_STL_VECTOR
#include <vector>
-#endif
#include <itemholder1.hxx>
@@ -546,7 +539,7 @@ void SvtDynamicMenuOptions_Impl::Notify( const Sequence< OUString >& )
//*****************************************************************************************************************
void SvtDynamicMenuOptions_Impl::Commit()
{
- DBG_ERROR( "SvtDynamicMenuOptions_Impl::Commit()\nNot implemented yet!\n" );
+ OSL_FAIL( "SvtDynamicMenuOptions_Impl::Commit()\nNot implemented yet!\n" );
/*
// Write all properties!
// Delete complete sets first.
@@ -894,27 +887,17 @@ void SvtDynamicMenuOptions::AppendItem( EDynamicMenuType eMenu
m_pDataContainer->AppendItem( eMenu, sURL, sTitle, sImageIdentifier, sTargetName );
}
+namespace
+{
+ class theDynamicMenuOptionsMutex : public rtl::Static<osl::Mutex, theDynamicMenuOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtDynamicMenuOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theDynamicMenuOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/eventcfg.cxx b/unotools/source/config/eventcfg.cxx
index a07c99b70381..a6de56a6a5d6 100644
--- a/unotools/source/config/eventcfg.cxx
+++ b/unotools/source/config/eventcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,7 @@
#include <com/sun/star/beans/PropertyValue.hpp>
#include <cppuhelper/weakref.hxx>
-#ifndef __SGI_STL_HASH_MAP
-#include <hash_map>
-#endif
+#include <boost/unordered_map.hpp>
#include <tools/urlobj.hxx>
#include <rtl/ustrbuf.hxx>
@@ -188,8 +187,8 @@ void GlobalEventConfig_Impl::Commit()
ClearNodeSet( SETNODE_BINDINGS );
Sequence< beans::PropertyValue > seqValues( 1 );
OUString sNode;
- static const OUString sPrefix(SETNODE_BINDINGS + PATHDELIMITER + OUString::createFromAscii("BindingType['"));
- static const OUString sPostfix(OUString::createFromAscii("']") + PATHDELIMITER + PROPERTYNAME_BINDINGURL);
+ static const OUString sPrefix(SETNODE_BINDINGS + PATHDELIMITER + OUString(RTL_CONSTASCII_USTRINGPARAM("BindingType['")));
+ static const OUString sPostfix(OUString(RTL_CONSTASCII_USTRINGPARAM("']")) + PATHDELIMITER + PROPERTYNAME_BINDINGURL);
//step through the list of events
for(int i=0;it!=it_end;++it,++i)
{
@@ -291,9 +290,9 @@ Any SAL_CALL GlobalEventConfig_Impl::getByName( const OUString& aName ) throw (c
{
Any aRet;
Sequence< beans::PropertyValue > props(2);
- props[0].Name = OUString::createFromAscii("EventType");
- props[0].Value <<= OUString::createFromAscii("Script");
- props[1].Name = OUString::createFromAscii("Script");
+ props[0].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("EventType"));
+ props[0].Value <<= OUString(RTL_CONSTASCII_USTRINGPARAM("Script"));
+ props[1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("Script"));
EventBindingHash::const_iterator it = m_eventBindingHash.find( aName );
if( it != m_eventBindingHash.end() )
{
@@ -424,28 +423,14 @@ sal_Bool SAL_CALL GlobalEventConfig::hasElements( ) throw (RuntimeException)
return m_pImpl->hasElements( );
}
+namespace
+{
+ class theGlobalEventConfigMutex : public rtl::Static<osl::Mutex, theGlobalEventConfigMutex>{};
+}
+
Mutex& GlobalEventConfig::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect following code with
- // the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that
- // another instance of our class will be faster then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theGlobalEventConfigMutex::get();
}
::rtl::OUString GlobalEventConfig::GetEventName( sal_Int32 nIndex )
@@ -453,3 +438,4 @@ Mutex& GlobalEventConfig::GetOwnStaticMutex()
return GlobalEventConfig().m_pImpl->GetEventName( nIndex );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx
index 716733e2d090..c93d85ed5fe7 100644
--- a/unotools/source/config/extendedsecurityoptions.cxx
+++ b/unotools/source/config/extendedsecurityoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -44,7 +45,7 @@
#include <unotools/pathoptions.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <rtl/logfile.hxx>
#include "itemholder1.hxx"
@@ -85,7 +86,7 @@ struct OUStringHashCode
}
};
-class ExtensionHashMap : public ::std::hash_map< ::rtl::OUString,
+class ExtensionHashMap : public ::boost::unordered_map< ::rtl::OUString,
sal_Int32,
OUStringHashCode,
::std::equal_to< ::rtl::OUString > >
@@ -256,7 +257,7 @@ SvtExtendedSecurityOptions_Impl::SvtExtendedSecurityOptions_Impl()
if ( seqValues[nProperty] >>= nMode )
m_eOpenHyperlinkMode = (SvtExtendedSecurityOptions::OpenHyperlinkMode)nMode;
else {
- DBG_ERROR("Wrong type for Open mode!");
+ OSL_FAIL("Wrong type for Open mode!");
}
m_bROOpenHyperlinkMode = seqRO[nProperty];
}
@@ -341,7 +342,7 @@ Sequence< OUString > SvtExtendedSecurityOptions_Impl::GetSecureExtensionList() c
sal_Int32 nIndex = 0;
for ( ExtensionHashMap::const_iterator pIter = m_aExtensionHashMap.begin();
- pIter != m_aExtensionHashMap.end(); pIter++ )
+ pIter != m_aExtensionHashMap.end(); ++pIter )
{
aResult[nIndex++] = pIter->first;
}
@@ -356,9 +357,7 @@ SvtExtendedSecurityOptions::OpenHyperlinkMode SvtExtendedSecurityOptions_Impl::G
{
return m_eOpenHyperlinkMode;
}
-/* -----------------09.07.2003 11:26-----------------
- --------------------------------------------------*/
sal_Bool SvtExtendedSecurityOptions_Impl::IsOpenHyperlinkModeReadOnly() const
{
return m_bROOpenHyperlinkMode;
@@ -413,13 +412,13 @@ void SvtExtendedSecurityOptions_Impl::FillExtensionHashMap( ExtensionHashMap& aH
//*****************************************************************************************************************
Sequence< OUString > SvtExtendedSecurityOptions_Impl::GetPropertyNames()
{
- // Build static list of configuration key names.
- static const OUString pProperties[] =
+ // Build list of configuration key names.
+ const OUString pProperties[] =
{
PROPERTYNAME_HYPERLINKS_OPEN
};
// Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
// ... and return it.
return seqPropertyNames;
}
@@ -495,9 +494,7 @@ SvtExtendedSecurityOptions::OpenHyperlinkMode SvtExtendedSecurityOptions::GetOpe
MutexGuard aGuard( GetInitMutex() );
return m_pDataContainer->GetOpenHyperlinkMode();
}
-/* -----------------09.07.2003 11:26-----------------
- --------------------------------------------------*/
sal_Bool SvtExtendedSecurityOptions::IsOpenHyperlinkModeReadOnly() const
{
return m_pDataContainer->IsOpenHyperlinkModeReadOnly();
@@ -512,27 +509,17 @@ void SvtExtendedSecurityOptions::SetOpenHyperlinkMode( SvtExtendedSecurityOption
m_pDataContainer->SetOpenHyperlinkMode( eMode );
}
+namespace
+{
+ class theExtendedSecurityOptionsMutex : public rtl::Static<osl::Mutex, theExtendedSecurityOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtExtendedSecurityOptions::GetInitMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theExtendedSecurityOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/fltrcfg.cxx b/unotools/source/config/fltrcfg.cxx
index f16f6ed9cfca..805a38f98620 100644
--- a/unotools/source/config/fltrcfg.cxx
+++ b/unotools/source/config/fltrcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,10 +37,11 @@
#include <com/sun/star/uno/Sequence.hxx>
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
-#define C2U(cChar) OUString::createFromAscii(cChar)
+using ::rtl::OUString;
+
+#define C2U(cChar) OUString(RTL_CONSTASCII_USTRINGPARAM(cChar))
// -----------------------------------------------------------------------
#define FILTERCFG_WORD_CODE 0x0001
@@ -61,12 +63,10 @@ using namespace com::sun::star::uno;
#define FILTERCFG_ENABLE_EXCEL_PREVIEW 0x40000
#define FILTERCFG_ENABLE_WORD_PREVIEW 0x80000
#define FILTERCFG_USE_ENHANCED_FIELDS 0x100000
+#define FILTERCFG_WORD_WBCTBL 0x200000
static SvtFilterOptions* pOptions=0;
-/* -----------------------------22.01.01 10:23--------------------------------
-
- ---------------------------------------------------------------------------*/
class SvtAppFilterOptions_Impl : public utl::ConfigItem
{
sal_Bool bLoadVBA;
@@ -97,17 +97,12 @@ public:
}
};
-/* -----------------------------22.01.01 11:08--------------------------------
-
- ---------------------------------------------------------------------------*/
SvtAppFilterOptions_Impl::~SvtAppFilterOptions_Impl()
{
if(IsModified())
Commit();
}
-/* -----------------------------22.01.01 10:38--------------------------------
- ---------------------------------------------------------------------------*/
void SvtAppFilterOptions_Impl::Commit()
{
Sequence<OUString> aNames(2);
@@ -129,10 +124,6 @@ void SvtAppFilterOptions_Impl::Notify( const Sequence< rtl::OUString >& )
// no listeners supported yet
}
-
-/* -----------------------------22.01.01 10:38--------------------------------
-
- ---------------------------------------------------------------------------*/
void SvtAppFilterOptions_Impl::Load()
{
Sequence<OUString> aNames(2);
@@ -150,6 +141,52 @@ void SvtAppFilterOptions_Impl::Load()
}
// -----------------------------------------------------------------------
+class SvtWriterFilterOptions_Impl : public SvtAppFilterOptions_Impl
+{
+ sal_Bool bLoadExecutable;
+public:
+ SvtWriterFilterOptions_Impl(const OUString& rRoot) :
+ SvtAppFilterOptions_Impl(rRoot),
+ bLoadExecutable(sal_False)
+ {}
+ virtual void Commit();
+ void Load();
+
+ sal_Bool IsLoadExecutable() const {return bLoadExecutable;}
+ void SetLoadExecutable(sal_Bool bSet)
+ {
+ if(bSet != bLoadExecutable)
+ SetModified();
+ bLoadExecutable = bSet;
+ }
+};
+
+void SvtWriterFilterOptions_Impl::Commit()
+{
+ SvtAppFilterOptions_Impl::Commit();
+
+ Sequence<OUString> aNames(1);
+ aNames[0] = C2U("Executable");
+ Sequence<Any> aValues(1);
+ aValues[0] <<= bLoadExecutable;
+
+ PutProperties(aNames, aValues);
+}
+
+void SvtWriterFilterOptions_Impl::Load()
+{
+ SvtAppFilterOptions_Impl::Load();
+
+ Sequence<OUString> aNames(1);
+ aNames[0] = C2U("Executable");
+
+ Sequence<Any> aValues = GetProperties(aNames);
+ const Any* pValues = aValues.getConstArray();
+ if(pValues[0].hasValue())
+ bLoadExecutable = *(sal_Bool*)pValues[0].getValue();
+}
+
+// -----------------------------------------------------------------------
class SvtCalcFilterOptions_Impl : public SvtAppFilterOptions_Impl
{
sal_Bool bLoadExecutable;
@@ -195,13 +232,10 @@ void SvtCalcFilterOptions_Impl::Load()
bLoadExecutable = *(sal_Bool*)pValues[0].getValue();
}
-/* -----------------------------22.01.01 10:32--------------------------------
-
- ---------------------------------------------------------------------------*/
struct SvtFilterOptions_Impl
{
sal_uLong nFlags;
- SvtAppFilterOptions_Impl aWriterCfg;
+ SvtWriterFilterOptions_Impl aWriterCfg;
SvtCalcFilterOptions_Impl aCalcCfg;
SvtAppFilterOptions_Impl aImpressCfg;
@@ -237,15 +271,14 @@ struct SvtFilterOptions_Impl
aImpressCfg.Load();
}
};
-/* -----------------------------22.01.01 10:34--------------------------------
- ---------------------------------------------------------------------------*/
void SvtFilterOptions_Impl::SetFlag( sal_uLong nFlag, sal_Bool bSet )
{
switch(nFlag)
{
case FILTERCFG_WORD_CODE: aWriterCfg.SetLoad(bSet);break;
case FILTERCFG_WORD_STORAGE: aWriterCfg.SetSave(bSet);break;
+ case FILTERCFG_WORD_WBCTBL: aWriterCfg.SetLoadExecutable(bSet);break;
case FILTERCFG_EXCEL_CODE: aCalcCfg.SetLoad(bSet);break;
case FILTERCFG_EXCEL_STORAGE: aCalcCfg.SetSave(bSet);break;
case FILTERCFG_EXCEL_EXECTBL: aCalcCfg.SetLoadExecutable(bSet);break;
@@ -258,9 +291,7 @@ void SvtFilterOptions_Impl::SetFlag( sal_uLong nFlag, sal_Bool bSet )
nFlags &= ~nFlag;
}
}
-/* -----------------------------22.01.01 10:35--------------------------------
- ---------------------------------------------------------------------------*/
sal_Bool SvtFilterOptions_Impl::IsFlag( sal_uLong nFlag ) const
{
sal_Bool bRet;
@@ -268,6 +299,7 @@ sal_Bool SvtFilterOptions_Impl::IsFlag( sal_uLong nFlag ) const
{
case FILTERCFG_WORD_CODE : bRet = aWriterCfg.IsLoad();break;
case FILTERCFG_WORD_STORAGE : bRet = aWriterCfg.IsSave();break;
+ case FILTERCFG_WORD_WBCTBL : bRet = aWriterCfg.IsLoadExecutable();break;
case FILTERCFG_EXCEL_CODE : bRet = aCalcCfg.IsLoad();break;
case FILTERCFG_EXCEL_STORAGE : bRet = aCalcCfg.IsSave();break;
case FILTERCFG_EXCEL_EXECTBL : bRet = aCalcCfg.IsLoadExecutable();break;
@@ -294,9 +326,7 @@ SvtFilterOptions::~SvtFilterOptions()
{
delete pImp;
}
-/* -----------------------------22.01.01 08:45--------------------------------
- ---------------------------------------------------------------------------*/
const Sequence<OUString>& SvtFilterOptions::GetPropertyNames()
{
static Sequence<OUString> aNames;
@@ -321,7 +351,7 @@ const Sequence<OUString>& SvtFilterOptions::GetPropertyNames()
};
OUString* pNames = aNames.getArray();
for(int i = 0; i < nCount; i++)
- pNames[i] = C2U(aPropNames[i]);
+ pNames[i] = OUString::createFromAscii(aPropNames[i]);
}
return aNames;
}
@@ -344,20 +374,16 @@ static sal_uLong lcl_GetFlag(sal_Int32 nProp)
case 10: nFlag = FILTERCFG_ENABLE_WORD_PREVIEW; break;
case 11: nFlag = FILTERCFG_USE_ENHANCED_FIELDS; break;
- default: DBG_ERROR("illegal value");
+ default: OSL_FAIL("illegal value");
}
return nFlag;
}
-/*-- 22.01.01 08:53:03---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtFilterOptions::Notify( const Sequence<OUString>& )
{
Load();
}
-/*-- 22.01.01 08:53:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtFilterOptions::Commit()
{
const Sequence<OUString>& aNames = GetPropertyNames();
@@ -374,9 +400,7 @@ void SvtFilterOptions::Commit()
}
PutProperties(aNames, aValues);
}
-/*-- 22.01.01 08:53:04---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtFilterOptions::Load()
{
pImp->Load();
@@ -410,6 +434,17 @@ sal_Bool SvtFilterOptions::IsLoadWordBasicCode() const
return pImp->IsFlag( FILTERCFG_WORD_CODE );
}
+void SvtFilterOptions::SetLoadWordBasicExecutable( sal_Bool bFlag )
+{
+ pImp->SetFlag( FILTERCFG_WORD_WBCTBL, bFlag );
+ SetModified();
+}
+
+sal_Bool SvtFilterOptions::IsLoadWordBasicExecutable() const
+{
+ return pImp->IsFlag( FILTERCFG_WORD_WBCTBL );
+}
+
void SvtFilterOptions::SetLoadWordBasicStorage( sal_Bool bFlag )
{
pImp->SetFlag( FILTERCFG_WORD_STORAGE, bFlag );
@@ -530,8 +565,7 @@ void SvtFilterOptions::SetWriter2WinWord( sal_Bool bFlag )
sal_Bool SvtFilterOptions::IsUseEnhancedFields() const
{
- return false; // disable for now;
-// return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS );
+ return pImp->IsFlag( FILTERCFG_USE_ENHANCED_FIELDS );
}
void SvtFilterOptions::SetUseEnhancedFields( sal_Bool bFlag )
@@ -614,3 +648,4 @@ sal_Bool SvtFilterOptions::IsEnableWordPreview() const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/fontcfg.cxx b/unotools/source/config/fontcfg.cxx
index b7fd73898c71..46d92d121a66 100644
--- a/unotools/source/config/fontcfg.cxx
+++ b/unotools/source/config/fontcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,6 +37,8 @@
#include <unotools/configpathes.hxx>
#include <unotools/syslocale.hxx>
#include <rtl/ustrbuf.hxx>
+#include <rtl/instance.hxx>
+#include <sal/macros.h>
#include <tools/debug.hxx>
#if OSL_DEBUG_LEVEL > 1
@@ -49,16 +52,13 @@
#define DEFAULTFONT_CONFIGNODE "VCL/DefaultFonts"
#define SUBSTFONT_CONFIGNODE "VCL/FontSubstitutions"
-using namespace rtl;
using namespace utl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
-static DefaultFontConfiguration* mpDefaultFontConfiguration = 0;
-
-static FontSubstConfiguration* mpFontSubstConfiguration = 0;
+using ::rtl::OUString;
/*
* DefaultFontConfiguration
@@ -92,16 +92,23 @@ static const char* getKeyType( int nKeyType )
case DEFAULTFONT_UI_FIXED: return "UI_FIXED";
case DEFAULTFONT_UI_SANS: return "UI_SANS";
default:
- DBG_ERROR( "unmatched type" );
+ OSL_FAIL( "unmatched type" );
return "";
}
}
-DefaultFontConfiguration* DefaultFontConfiguration::get()
+namespace
+{
+ class theDefaultFontConfiguration
+ : public rtl::Static<DefaultFontConfiguration,
+ theDefaultFontConfiguration>
+ {
+ };
+}
+
+DefaultFontConfiguration& DefaultFontConfiguration::get()
{
- if( !mpDefaultFontConfiguration )
- mpDefaultFontConfiguration = new DefaultFontConfiguration();
- return mpDefaultFontConfiguration;
+ return theDefaultFontConfiguration::get();
}
DefaultFontConfiguration::DefaultFontConfiguration()
@@ -191,7 +198,7 @@ OUString DefaultFontConfiguration::tryLocale( const Locale& rLocale, const OUStr
{
OUString aRet;
- std::hash_map< Locale, LocaleAccess, LocaleHash >::const_iterator it =
+ boost::unordered_map< Locale, LocaleAccess, LocaleHash >::const_iterator it =
m_aConfig.find( rLocale );
if( it != m_aConfig.end() )
{
@@ -325,40 +332,40 @@ OUString DefaultFontConfiguration::getUserInterfaceFont( const Locale& rLocale )
static const OUString aFallBackKorean( aFallBackKoreanLocalized );
// optimize font list for some locales, as long as Andale Sans UI does not support them
- if( aLocale.Language.equalsAscii( "ar" ) ||
- aLocale.Language.equalsAscii( "he" ) ||
- aLocale.Language.equalsAscii( "iw" ) )
+ if( aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ar" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "he" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "iw" ) ) )
{
return aFallBackArabic;
}
- else if( aLocale.Language.equalsAscii( "th" ) )
+ else if( aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "th" ) ) )
{
return aFallBackThai;
}
- else if( aLocale.Language.equalsAscii( "ko" ) )
+ else if( aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ko" ) ) )
{
return aFallBackKorean;
}
- else if( aLocale.Language.equalsAscii( "cs" ) ||
- aLocale.Language.equalsAscii( "hu" ) ||
- aLocale.Language.equalsAscii( "pl" ) ||
- aLocale.Language.equalsAscii( "ro" ) ||
- aLocale.Language.equalsAscii( "rm" ) ||
- aLocale.Language.equalsAscii( "hr" ) ||
- aLocale.Language.equalsAscii( "sk" ) ||
- aLocale.Language.equalsAscii( "sl" ) ||
- aLocale.Language.equalsAscii( "sb" ) )
+ else if( aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "cs" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "hu" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "pl" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ro" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "rm" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "hr" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "sk" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "sl" ) ) ||
+ aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "sb" ) ) )
{
return aFallbackLatin2;
}
- else if( aLocale.Language.equalsAscii( "zh" ) )
+ else if( aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "zh" ) ) )
{
- if( ! aLocale.Country.equalsAscii( "cn" ) )
+ if( ! aLocale.Country.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "cn" ) ) )
return aFallBackChineseTRD;
else
return aFallBackChineseSIM;
}
- else if( aLocale.Language.equalsAscii( "ja" ) )
+ else if( aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ja" ) ) )
{
return aFallBackJapanese;
}
@@ -372,11 +379,17 @@ OUString DefaultFontConfiguration::getUserInterfaceFont( const Locale& rLocale )
* FontSubstConfigItem::get
*/
-FontSubstConfiguration* FontSubstConfiguration::get()
+namespace
+{
+ class theFontSubstConfiguration
+ : public rtl::Static<FontSubstConfiguration, theFontSubstConfiguration>
+ {
+ };
+}
+
+FontSubstConfiguration& FontSubstConfiguration::get()
{
- if( !mpFontSubstConfiguration )
- mpFontSubstConfiguration = new FontSubstConfiguration();
- return mpFontSubstConfiguration;
+ return theFontSubstConfiguration::get();
}
/*
@@ -1001,7 +1014,7 @@ FontWeight FontSubstConfiguration::getSubstWeight( const com::sun::star::uno::Re
const OUString* pLine = (const OUString*)aAny.getValue();
if( pLine->getLength() )
{
- for( weight=sizeof(pWeightNames)/sizeof(pWeightNames[0])-1; weight >= 0; weight-- )
+ for( weight=SAL_N_ELEMENTS(pWeightNames)-1; weight >= 0; weight-- )
if( pLine->equalsIgnoreAsciiCaseAscii( pWeightNames[weight].pName ) )
break;
}
@@ -1033,7 +1046,7 @@ FontWidth FontSubstConfiguration::getSubstWidth( const com::sun::star::uno::Refe
const OUString* pLine = (const OUString*)aAny.getValue();
if( pLine->getLength() )
{
- for( width=sizeof(pWidthNames)/sizeof(pWidthNames[0])-1; width >= 0; width-- )
+ for( width=SAL_N_ELEMENTS(pWidthNames)-1; width >= 0; width-- )
if( pLine->equalsIgnoreAsciiCaseAscii( pWidthNames[width].pName ) )
break;
}
@@ -1091,7 +1104,7 @@ unsigned long FontSubstConfiguration::getSubstType( const com::sun::star::uno::R
void FontSubstConfiguration::readLocaleSubst( const com::sun::star::lang::Locale& rLocale ) const
{
- std::hash_map< Locale, LocaleSubst, LocaleHash >::const_iterator it =
+ boost::unordered_map< Locale, LocaleSubst, LocaleHash >::const_iterator it =
m_aSubst.find( rLocale );
if( it != m_aSubst.end() )
{
@@ -1191,7 +1204,7 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam
while( aLocale.Language.getLength() )
{
- std::hash_map< Locale, LocaleSubst, LocaleHash >::const_iterator lang = m_aSubst.find( aLocale );
+ boost::unordered_map< Locale, LocaleSubst, LocaleHash >::const_iterator lang = m_aSubst.find( aLocale );
if( lang != m_aSubst.end() )
{
if( ! lang->second.bConfigRead )
@@ -1214,7 +1227,7 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam
aLocale.Variant = OUString();
else if( aLocale.Country.getLength() )
aLocale.Country = OUString();
- else if( ! aLocale.Language.equalsAscii( "en" ) )
+ else if( ! aLocale.Language.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "en" ) ) )
aLocale.Language = OUString( RTL_CONSTASCII_USTRINGPARAM( "en" ) );
else
aLocale.Language = OUString();
@@ -1222,3 +1235,4 @@ const FontNameAttr* FontSubstConfiguration::getSubstInfo( const String& rFontNam
return NULL;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/fontoptions.cxx b/unotools/source/config/fontoptions.cxx
index 5853dd36af98..7c32000a6a0d 100644
--- a/unotools/source/config/fontoptions.cxx
+++ b/unotools/source/config/fontoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/fontoptions.hxx>
#include <unotools/configmgr.hxx>
@@ -42,6 +37,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <rtl/logfile.hxx>
+#include <rtl/instance.hxx>
#include "itemholder1.hxx"
//_________________________________________________________________________________________________________________
@@ -373,15 +369,15 @@ void SvtFontOptions_Impl::EnableFontWYSIWYG( sal_Bool bState )
//*****************************************************************************************************************
Sequence< OUString > SvtFontOptions_Impl::impl_GetPropertyNames()
{
- // Build static list of configuration key names.
- static const OUString pProperties[] =
+ // Build list of configuration key names.
+ const OUString pProperties[] =
{
PROPERTYNAME_REPLACEMENTTABLE ,
PROPERTYNAME_FONTHISTORY ,
PROPERTYNAME_FONTWYSIWYG ,
};
// Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
// ... and return it.
return seqPropertyNames;
}
@@ -485,27 +481,17 @@ void SvtFontOptions::EnableFontWYSIWYG( sal_Bool bState )
m_pDataContainer->EnableFontWYSIWYG( bState );
}
+namespace
+{
+ class theFontOptionsMutex : public rtl::Static<osl::Mutex, theFontOptionsMutex> {};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtFontOptions::impl_GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theFontOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index 5cb74f9bbf35..d6990fb40fa8 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/historyoptions.hxx>
#include <unotools/historyoptions_const.hxx>
@@ -42,44 +37,25 @@
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-#ifndef __SGI_STL_DEQUE
#include <deque>
-#endif
-
-#ifndef __SGI_STL_ALGORITHM
#include <algorithm>
-#endif
#include <rtl/logfile.hxx>
#include "itemholder1.hxx"
-#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
#include <com/sun/star/beans/XPropertySet.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
#include <com/sun/star/container/XNameAccess.hpp>
-#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMECONTAINER_HPP_
#include <com/sun/star/container/XNameContainer.hpp>
-#endif
-#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#endif
-#ifndef _COMPHELPER_CONFIGURATIONHELPER_HXX_
#include <comphelper/configurationhelper.hxx>
-#endif
-#ifndef _UNOTOOLS_PROCESSFACTORY_HXX_
#include <unotools/processfactory.hxx>
-#endif
-#ifndef _SVT_LOGHELPER_HXX
#include <unotools/loghelper.hxx>
-#endif
//_________________________________________________________________________________________________________________
// namespaces
@@ -126,7 +102,7 @@ struct IMPL_THistoryItem
sPassword = sNewPassword ;
}
- sal_Bool operator==( const OUString& sSearchedURL )
+ sal_Bool operator==( const OUString& sSearchedURL ) const
{
return( sURL == sSearchedURL );
}
@@ -208,9 +184,13 @@ SvtHistoryOptions_Impl::~SvtHistoryOptions_Impl()
//*****************************************************************************************************************
sal_uInt32 SvtHistoryOptions_Impl::GetSize( EHistoryType eHistory )
{
- sal_uInt32 nSize = 0 ;
css::uno::Reference< css::beans::XPropertySet > xListAccess(m_xCommonXCU, css::uno::UNO_QUERY);
+ if (!xListAccess.is())
+ return 0;
+
+ sal_uInt32 nSize = 0 ;
+
try
{
switch( eHistory )
@@ -719,27 +699,17 @@ void SvtHistoryOptions::AppendItem( EHistoryType eHistory ,
m_pDataContainer->AppendItem( eHistory, sURL, sFilter, sTitle, sPassword );
}
+namespace
+{
+ class theHistoryOptionsMutex : public rtl::Static<osl::Mutex, theHistoryOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtHistoryOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theHistoryOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/inetoptions.cxx b/unotools/source/config/inetoptions.cxx
index 15bf425af744..d851102d2d23 100644
--- a/unotools/source/config/inetoptions.cxx
+++ b/unotools/source/config/inetoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <unotools/inetoptions.hxx>
#include "rtl/instance.hxx"
#include <tools/urlobj.hxx>
-#ifndef _WILDCARD_HXX
#include <tools/wldcrd.hxx>
-#endif
#include <algorithm>
#include <map>
@@ -248,7 +247,7 @@ SvtInetOptions::Impl::notifyListeners(
{
aEvents.realloc(nCount);
aNotifications.
- push_back(std::make_pair< List::value_type::first_type,
+ push_back(std::pair< List::value_type::first_type,
List::value_type::second_type >(
aIt->first, aEvents));
}
@@ -281,8 +280,7 @@ SvtInetOptions::Impl::Impl():
for (sal_Int32 i = 0; i < ENTRY_COUNT; ++i)
aKeys[i] = m_aEntries[i].m_aName;
if (!EnableNotification(aKeys))
- OSL_ENSURE(false,
- "SvtInetOptions::Impl::Impl(): Bad EnableNotifications()");
+ OSL_FAIL("SvtInetOptions::Impl::Impl(): Bad EnableNotifications()");
}
//============================================================================
@@ -331,8 +329,7 @@ star::uno::Any SvtInetOptions::Impl::getProperty(Index nPropIndex)
}
}
}
- OSL_ENSURE(false,
- "SvtInetOptions::Impl::getProperty(): Possible life lock");
+ OSL_FAIL("SvtInetOptions::Impl::getProperty(): Possible life lock");
{
osl::MutexGuard aGuard(m_aMutex);
return m_aEntries[nPropIndex].m_aValue;
@@ -552,3 +549,5 @@ SvtInetOptions::removePropertiesChangeListener(
{
m_pImpl->removePropertiesChangeListener(rPropertyNames, rListener);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/internaloptions.cxx b/unotools/source/config/internaloptions.cxx
index 310b52f8c98f..60601f9dea3e 100644
--- a/unotools/source/config/internaloptions.cxx
+++ b/unotools/source/config/internaloptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <deque>
@@ -267,14 +262,14 @@ SvtInternalOptions_Impl::SvtInternalOptions_Impl()
// Init baseclasses first
: ConfigItem ( ROOTNODE_INTERNAL, CONFIG_MODE_IMMEDIATE_UPDATE )
// Init member then.
- , m_bRemoveMenuEntryClose ( sal_False )
- , m_bRemoveMenuEntryBackToWebtop ( sal_False )
- , m_bRemoveMenuEntryNewWebtop ( sal_False )
- , m_bRemoveMenuEntryLogout ( sal_False )
- , m_bSlotCFG ( DEFAULT_SLOTCFG )
- , m_bSendCrashMail ( DEFAULT_SENDCRASHMAIL )
- , m_bUseMailUI ( DEFAULT_USEMAILUI )
- , m_aCurrentTempURL ( DEFAULT_CURRENTTEMPURL )
+ , m_bRemoveMenuEntryClose(sal_False)
+ , m_bRemoveMenuEntryBackToWebtop(sal_False)
+ , m_bRemoveMenuEntryNewWebtop(sal_False)
+ , m_bRemoveMenuEntryLogout(sal_False)
+ , m_bSlotCFG(DEFAULT_SLOTCFG)
+ , m_bSendCrashMail(DEFAULT_SENDCRASHMAIL)
+ , m_bUseMailUI(DEFAULT_USEMAILUI)
+ , m_aCurrentTempURL(DEFAULT_CURRENTTEMPURL)
{
// Use our list of configuration keys to get his values.
// structure of internal section: (first 2 entries are fixed - all other are member of a set!)
@@ -296,38 +291,12 @@ SvtInternalOptions_Impl::SvtInternalOptions_Impl()
DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtInternalOptions_Impl::SvtInternalOptions_Impl()\nI miss some values of configuration keys!\n" );
// Read fixed values first!
- DBG_ASSERT(!(seqValues[FIXPROPERTYHANDLE_SLOTCFG].getValueTypeClass()!=TypeClass_BOOLEAN) , "SvtInternalOptions_Impl::SvtInternalOptions_Impl()\nWho has changed the value type of \"Office.Common\\Internal\\Slot\"?" );
- DBG_ASSERT(!(seqValues[FIXPROPERTYHANDLE_SENDCRASHMAIL].getValueTypeClass()!=TypeClass_BOOLEAN) , "SvtInternalOptions_Impl::SvtInternalOptions_Impl()\nWho has changed the value type of \"Office.Common\\Internal\\SendCrashMail\"?" );
- seqValues[FIXPROPERTYHANDLE_SLOTCFG ] >>= m_bSlotCFG ;
- seqValues[FIXPROPERTYHANDLE_SENDCRASHMAIL ] >>= m_bSendCrashMail ;
- seqValues[FIXPROPERTYHANDLE_USEMAILUI ] >>= m_bUseMailUI ;
- seqValues[FIXPROPERTYHANDLE_CURRENTTEMPURL ] >>= m_aCurrentTempURL ;
-// seqValues[FIXPROPERTYHANDLE_REMOVEMENUENTRYCLOSE ] >>= m_bRemoveMenuEntryClose ;
-// seqValues[FIXPROPERTYHANDLE_REMOVEMENUENTRYBACKTOWEBTOP ] >>= m_bRemoveMenuEntryBackToWebtop ;
-// seqValues[FIXPROPERTYHANDLE_REMOVEMENUENTRYNEWWEBTOP ] >>= m_bRemoveMenuEntryNewWebtop ;
-// seqValues[FIXPROPERTYHANDLE_REMOVEMENUENTRYLOGOUT ] >>= m_bRemoveMenuEntryLogout ;
-/*
- // Read dynamical set "RecoveryList" then.
- // 3 subkeys for every item!
- // Attention: Start at next element after last fixed entry! We must ignore "Slot" and "SendCrashMail" ...
- tIMPL_RecoveryEntry aEntry;
- sal_uInt32 nCount = seqValues.getLength() ;
- sal_uInt32 nPosition = FIXPROPERTYCOUNT ;
-
- while( nPosition<nCount )
- {
- seqValues[nPosition] >>= aEntry.sURL ;
- ++nPosition;
- seqValues[nPosition] >>= aEntry.sFilter ;
- ++nPosition;
- seqValues[nPosition] >>= aEntry.sTempName ;
- ++nPosition;
- m_aRecoveryList.push_front( aEntry );
- }
-*/
- // We don't need any notifications here.
- // "Slot" and "SendCrashMail" are readonly(!) and our recovery list should not modified during runtime - it's used
- // by our crash guard only ... otherwise we have a big problem.
+ DBG_ASSERT(!seqValues[FIXPROPERTYHANDLE_SLOTCFG].hasValue() || (seqValues[FIXPROPERTYHANDLE_SLOTCFG].getValueTypeClass() == TypeClass_BOOLEAN), "SvtInternalOptions_Impl::SvtInternalOptions_Impl()\nWho has changed the value type of \"Office.Common\\Internal\\Slot\"?");
+ DBG_ASSERT(!seqValues[FIXPROPERTYHANDLE_SENDCRASHMAIL].hasValue() || !(seqValues[FIXPROPERTYHANDLE_SENDCRASHMAIL].getValueTypeClass()!=TypeClass_BOOLEAN), "SvtInternalOptions_Impl::SvtInternalOptions_Impl()\nWho has changed the value type of \"Office.Common\\Internal\\SendCrashMail\"?");
+ seqValues[FIXPROPERTYHANDLE_SLOTCFG] >>= m_bSlotCFG;
+ seqValues[FIXPROPERTYHANDLE_SENDCRASHMAIL] >>= m_bSendCrashMail;
+ seqValues[FIXPROPERTYHANDLE_USEMAILUI] >>= m_bUseMailUI;
+ seqValues[FIXPROPERTYHANDLE_CURRENTTEMPURL] >>= m_aCurrentTempURL;
}
//*****************************************************************************************************************
@@ -411,43 +380,6 @@ void SvtInternalOptions_Impl::SetCurrentTempURL( const OUString& aNewCurrentTemp
Commit();
}
-#if 0
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtInternalOptions_Impl::PushRecoveryItem( const OUString& sURL ,
- const OUString& sFilter ,
- const OUString& sTempName )
-{
- tIMPL_RecoveryEntry aEntry( sURL, sFilter, sTempName );
- m_aRecoveryList.push_front( aEntry );
- SetModified();
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-void SvtInternalOptions_Impl::PopRecoveryItem( OUString& sURL ,
- OUString& sFilter ,
- OUString& sTempName )
-{
- tIMPL_RecoveryEntry aEntry = m_aRecoveryList.front();
- m_aRecoveryList.pop_front();
- SetModified(); // Don't forget it - we delete an entry here!
- sURL = aEntry.sURL ;
- sFilter = aEntry.sFilter ;
- sTempName = aEntry.sTempName ;
-}
-
-//*****************************************************************************************************************
-// public method
-//*****************************************************************************************************************
-sal_Bool SvtInternalOptions_Impl::IsRecoveryListEmpty() const
-{
- return ( m_aRecoveryList.empty() );
-}
-#endif
-
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
@@ -602,27 +534,17 @@ void SvtInternalOptions::SetCurrentTempURL( const OUString& aNewCurrentTempURL )
m_pDataContainer->SetCurrentTempURL( aNewCurrentTempURL );
}
+namespace
+{
+ class theInternalOptionsMutex : public rtl::Static<osl::Mutex, theInternalOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtInternalOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theInternalOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/itemholder1.cxx b/unotools/source/config/itemholder1.cxx
index 48b1decc4983..f9a22805dd6d 100644
--- a/unotools/source/config/itemholder1.cxx
+++ b/unotools/source/config/itemholder1.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -86,7 +87,7 @@ ItemHolder1::ItemHolder1()
{
css::uno::Reference< css::lang::XMultiServiceFactory > xSMGR = ::comphelper::getProcessServiceFactory();
css::uno::Reference< css::lang::XComponent > xCfg(
- xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.configuration.ConfigurationProvider")),
+ xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider"))),
css::uno::UNO_QUERY);
if (xCfg.is())
xCfg->addEventListener(static_cast< css::lang::XEventListener* >(this));
@@ -103,7 +104,7 @@ ItemHolder1::ItemHolder1()
sMsg += ::rtl::OString(rEx.Message.getStr(),
rEx.Message.getLength(),
RTL_TEXTENCODING_ASCII_US);
- OSL_ENSURE(sal_False, sMsg.getStr());
+ OSL_FAIL(sMsg.getStr());
}
}
#else
@@ -312,7 +313,7 @@ void ItemHolder1::impl_newItem(TItemInfo& rItem)
break;
default:
- OSL_ASSERT( "unknown item type" );
+ OSL_FAIL( "unknown item type" );
break;
}
}
@@ -327,3 +328,4 @@ void ItemHolder1::impl_deleteItem(TItemInfo& rItem)
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/itemholder1.hxx b/unotools/source/config/itemholder1.hxx
index 8e7fd285cc0a..e04b423152ba 100644
--- a/unotools/source/config/itemholder1.hxx
+++ b/unotools/source/config/itemholder1.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,3 +88,5 @@ class ItemHolder1 : private ItemHolderMutexBase
#undef css
#endif // INCLUDED_unotools_ITEMHOLDER1_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/javaoptions.cxx b/unotools/source/config/javaoptions.cxx
index 8c41aac2d3de..1ddef0dd409b 100644
--- a/unotools/source/config/javaoptions.cxx
+++ b/unotools/source/config/javaoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-#ifndef _unotools_JAVAPTIONS_HXX
#include <unotools/javaoptions.hxx>
-#endif
#include <com/sun/star/uno/Any.h>
#include <com/sun/star/uno/Sequence.hxx>
#include <rtl/logfile.hxx>
@@ -41,11 +38,9 @@
using namespace ::com::sun::star::uno;
using namespace ::rtl;
-#define C2U(cChar) OUString::createFromAscii(cChar)
+#define C2U(cChar) OUString(RTL_CONSTASCII_USTRINGPARAM(cChar))
#define CFG_READONLY_DEFAULT sal_False
-/* -----------------------------10.04.01 12:39--------------------------------
- ---------------------------------------------------------------------------*/
class SvtExecAppletsItem_Impl : public utl::ConfigItem
{
sal_Bool bExecute;
@@ -60,9 +55,7 @@ public:
void SetExecuteApplets(sal_Bool bSet);
sal_Bool IsReadOnly() const {return bRO;}
};
-/* -----------------------------10.02.2003 07:46------------------------------
- ---------------------------------------------------------------------------*/
void SvtExecAppletsItem_Impl::SetExecuteApplets(sal_Bool bSet)
{
OSL_ENSURE(!bRO, "SvtExecAppletsItem_Impl::SetExecuteApplets()\nYou tried to write on a readonly value!\n");
@@ -72,9 +65,7 @@ void SvtExecAppletsItem_Impl::SetExecuteApplets(sal_Bool bSet)
SetModified();
}
}
-/* -----------------------------18.05.01 14:44--------------------------------
- ---------------------------------------------------------------------------*/
SvtExecAppletsItem_Impl::SvtExecAppletsItem_Impl() :
utl::ConfigItem(C2U("Office.Common/Java/Applet")),
bExecute (sal_False ),
@@ -142,9 +133,7 @@ struct SvtJavaOptions_Impl
pNames[3] = C2U("UserClassPath");
}
};
-/* -----------------------------18.05.01 13:28--------------------------------
- ---------------------------------------------------------------------------*/
SvtJavaOptions::SvtJavaOptions() :
utl::ConfigItem(C2U("Office.Java/VirtualMachine")),
pImpl(new SvtJavaOptions_Impl)
@@ -176,16 +165,12 @@ SvtJavaOptions::SvtJavaOptions() :
pImpl->bROUserClassPath = pROStates[3];
}
}
-/* -----------------------------18.05.01 13:28--------------------------------
- ---------------------------------------------------------------------------*/
SvtJavaOptions::~SvtJavaOptions()
{
delete pImpl;
}
-/*-- 18.05.01 13:28:35---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtJavaOptions::Commit()
{
pImpl->aExecItem.Commit();
@@ -246,37 +231,27 @@ void SvtJavaOptions::Commit()
aNames.realloc(nRealCount);
PutProperties(aNames,aValues);
}
-/*-- 18.05.01 13:28:35---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SvtJavaOptions::IsEnabled() const
{
return pImpl->bEnabled;
}
-/*-- 18.05.01 13:28:35---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SvtJavaOptions::IsSecurity()const
{
return pImpl->bSecurity;
}
-/*-- 18.05.01 13:28:35---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int32 SvtJavaOptions::GetNetAccess() const
{
return pImpl->nNetAccess;
}
-/*-- 18.05.01 13:28:36---------------------------------------------------
- -----------------------------------------------------------------------*/
rtl::OUString& SvtJavaOptions::GetUserClassPath()const
{
return pImpl->sUserClassPath;
}
-/*-- 18.05.01 13:28:37---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtJavaOptions::SetEnabled(sal_Bool bSet)
{
OSL_ENSURE(!pImpl->bROEnabled, "SvtJavaOptions::SetEnabled()\nYou tried to write on a readonly value!\n");
@@ -286,9 +261,7 @@ void SvtJavaOptions::SetEnabled(sal_Bool bSet)
SetModified();
}
}
-/*-- 18.05.01 13:28:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtJavaOptions::SetSecurity(sal_Bool bSet)
{
OSL_ENSURE(!pImpl->bROSecurity, "SvtJavaOptions::SetSecurity()\nYou tried to write on a readonly value!\n");
@@ -298,9 +271,7 @@ void SvtJavaOptions::SetSecurity(sal_Bool bSet)
SetModified();
}
}
-/*-- 18.05.01 13:28:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtJavaOptions::SetNetAccess(sal_Int32 nSet)
{
OSL_ENSURE(!pImpl->bRONetAccess, "SvtJavaOptions::SetNetAccess()\nYou tried to write on a readonly value!\n");
@@ -310,9 +281,7 @@ void SvtJavaOptions::SetNetAccess(sal_Int32 nSet)
SetModified();
}
}
-/*-- 18.05.01 13:28:38---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtJavaOptions::SetUserClassPath(const rtl::OUString& rSet)
{
OSL_ENSURE(!pImpl->bROUserClassPath, "SvtJavaOptions::SetUserClassPath()\nYou tried to write on a readonly value!\n");
@@ -323,16 +292,12 @@ void SvtJavaOptions::SetUserClassPath(const rtl::OUString& rSet)
}
}
-/*-- 18.05.01 14:34:32---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SvtJavaOptions::IsExecuteApplets() const
{
return pImpl->aExecItem.IsExecuteApplets();
}
-/*-- 18.05.01 14:34:32---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtJavaOptions::SetExecuteApplets(sal_Bool bSet)
{
if(!pImpl->aExecItem.IsReadOnly() && pImpl->aExecItem.IsExecuteApplets() != bSet)
@@ -341,9 +306,7 @@ void SvtJavaOptions::SetExecuteApplets(sal_Bool bSet)
SetModified();
}
}
-/*--10.02.2003 08:40---------------------------------------------------
------------------------------------------------------------------------*/
sal_Bool SvtJavaOptions::IsReadOnly( EOption eOption ) const
{
sal_Bool bRO = sal_True;
@@ -367,3 +330,5 @@ sal_Bool SvtJavaOptions::IsReadOnly( EOption eOption ) const
}
return bRO;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/lingucfg.cxx b/unotools/source/config/lingucfg.cxx
index b17681331935..382ac3f578f3 100755..100644
--- a/unotools/source/config/lingucfg.cxx
+++ b/unotools/source/config/lingucfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -38,37 +39,38 @@
#include "com/sun/star/util/XMacroExpander.hpp"
#include "com/sun/star/beans/XPropertySet.hpp"
#include <rtl/uri.hxx>
-#include <vos/mutex.hxx>
+#include <rtl/instance.hxx>
+#include <osl/mutex.hxx>
#include <i18npool/mslangid.hxx>
#include <tools/debug.hxx>
#include <tools/string.hxx>
#include <unotools/lingucfg.hxx>
#include <unotools/linguprops.hxx>
+#include <sal/macros.h>
#include <comphelper/processfactory.hxx>
#include <itemholder1.hxx>
-using namespace rtl;
using namespace com::sun::star;
-#define A2OU(x) ::rtl::OUString::createFromAscii( x )
+using ::rtl::OUString;
+using ::rtl::Uri;
+
+#define A2OU(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( x ))
#define EXPAND_PROTOCOL "vnd.sun.star.expand:"
#define FILE_PROTOCOL "file:///"
///////////////////////////////////////////////////////////////////////////
-
-static osl::Mutex & GetOwnMutex()
+namespace
{
- static osl::Mutex aMutex;
- return aMutex;
+ class theSvtLinguConfigItemMutex :
+ public rtl::Static< osl::Mutex, theSvtLinguConfigItemMutex > {};
}
-
///////////////////////////////////////////////////////////////////////////
-
static sal_Bool lcl_SetLocale( sal_Int16 &rLanguage, const uno::Any &rVal )
{
sal_Bool bSucc = sal_False;
@@ -167,7 +169,7 @@ class SvtLinguConfigItem : public utl::ConfigItem
SvtLinguConfigItem & operator = ( const SvtLinguConfigItem & );
static sal_Bool GetHdlByName( sal_Int32 &rnHdl, const OUString &rPropertyName, sal_Bool bFullPropName = sal_False );
- static const uno::Sequence< OUString > & GetPropertyNames();
+ static const uno::Sequence< OUString > GetPropertyNames();
sal_Bool LoadOptions( const uno::Sequence< OUString > &rProperyNames );
sal_Bool SaveOptions( const uno::Sequence< OUString > &rProperyNames );
@@ -209,11 +211,12 @@ public:
SvtLinguConfigItem::SvtLinguConfigItem() :
utl::ConfigItem( String::CreateFromAscii( "Office.Linguistic" ) )
{
- LoadOptions( GetPropertyNames() );
+ const uno::Sequence< OUString > &rPropertyNames = GetPropertyNames();
+ LoadOptions( rPropertyNames );
ClearModified();
// request notify events when properties change
- EnableNotification( GetPropertyNames() );
+ EnableNotification( rPropertyNames );
}
@@ -285,31 +288,26 @@ static struct NamesToHdl
};
-const uno::Sequence< OUString > & SvtLinguConfigItem::GetPropertyNames()
+const uno::Sequence< OUString > SvtLinguConfigItem::GetPropertyNames()
{
- static uno::Sequence< OUString > aNames;
- static sal_Bool bInitialized = sal_False;
+ uno::Sequence< OUString > aNames;
- if (!bInitialized)
- {
- sal_Int32 nMax = sizeof(aNamesToHdl) / sizeof(aNamesToHdl[0]);
+ sal_Int32 nMax = SAL_N_ELEMENTS(aNamesToHdl);
- aNames.realloc( nMax );
- OUString *pNames = aNames.getArray();
- sal_Int32 nIdx = 0;
- for (sal_Int32 i = 0; i < nMax; ++i)
- {
- const sal_Char *pFullPropName = aNamesToHdl[i].pFullPropName;
- if (pFullPropName)
- pNames[ nIdx++ ] = A2OU( pFullPropName );
- }
- aNames.realloc( nIdx );
- bInitialized = sal_True;
+ aNames.realloc( nMax );
+ OUString *pNames = aNames.getArray();
+ sal_Int32 nIdx = 0;
+ for (sal_Int32 i = 0; i < nMax; ++i)
+ {
+ const sal_Char *pFullPropName = aNamesToHdl[i].pFullPropName;
+ if (pFullPropName)
+ pNames[ nIdx++ ] = ::rtl::OUString::createFromAscii( pFullPropName );
}
+ aNames.realloc( nIdx );
+
return aNames;
}
-
sal_Bool SvtLinguConfigItem::GetHdlByName(
sal_Int32 &rnHdl,
const OUString &rPropertyName,
@@ -348,7 +346,7 @@ sal_Bool SvtLinguConfigItem::GetHdlByName(
uno::Any SvtLinguConfigItem::GetProperty( const OUString &rPropertyName ) const
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
sal_Int32 nHdl;
return GetHdlByName( nHdl, rPropertyName ) ? GetProperty( nHdl ) : uno::Any();
@@ -357,7 +355,7 @@ uno::Any SvtLinguConfigItem::GetProperty( const OUString &rPropertyName ) const
uno::Any SvtLinguConfigItem::GetProperty( sal_Int32 nPropertyHandle ) const
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
uno::Any aRes;
@@ -440,7 +438,7 @@ uno::Any SvtLinguConfigItem::GetProperty( sal_Int32 nPropertyHandle ) const
sal_Bool SvtLinguConfigItem::SetProperty( const OUString &rPropertyName, const uno::Any &rValue )
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
sal_Bool bSucc = sal_False;
sal_Int32 nHdl;
@@ -452,7 +450,7 @@ sal_Bool SvtLinguConfigItem::SetProperty( const OUString &rPropertyName, const u
sal_Bool SvtLinguConfigItem::SetProperty( sal_Int32 nPropertyHandle, const uno::Any &rValue )
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
sal_Bool bSucc = sal_False;
if (!rValue.hasValue())
@@ -578,7 +576,7 @@ sal_Bool SvtLinguConfigItem::SetProperty( sal_Int32 nPropertyHandle, const uno::
sal_Bool SvtLinguConfigItem::GetOptions( SvtLinguOptions &rOptions ) const
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
rOptions = aOpt;
return sal_True;
@@ -587,7 +585,7 @@ sal_Bool SvtLinguConfigItem::GetOptions( SvtLinguOptions &rOptions ) const
sal_Bool SvtLinguConfigItem::SetOptions( const SvtLinguOptions &rOptions )
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
aOpt = rOptions;
SetModified();
@@ -598,7 +596,7 @@ sal_Bool SvtLinguConfigItem::SetOptions( const SvtLinguOptions &rOptions )
sal_Bool SvtLinguConfigItem::LoadOptions( const uno::Sequence< OUString > &rProperyNames )
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
sal_Bool bRes = sal_False;
@@ -721,7 +719,7 @@ sal_Bool SvtLinguConfigItem::SaveOptions( const uno::Sequence< OUString > &rProp
if (!IsModified())
return sal_True;
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
sal_Bool bRet = sal_False;
const uno::Type &rBOOL = ::getBooleanCppuType();
@@ -786,7 +784,7 @@ sal_Bool SvtLinguConfigItem::SaveOptions( const uno::Sequence< OUString > &rProp
sal_Bool SvtLinguConfigItem::IsReadOnly( const rtl::OUString &rPropertyName ) const
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
sal_Bool bReadOnly = sal_False;
sal_Int32 nHdl;
@@ -797,7 +795,7 @@ sal_Bool SvtLinguConfigItem::IsReadOnly( const rtl::OUString &rPropertyName ) co
sal_Bool SvtLinguConfigItem::IsReadOnly( sal_Int32 nPropertyHandle ) const
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
sal_Bool bReadOnly = sal_False;
@@ -845,25 +843,25 @@ sal_Bool SvtLinguConfigItem::IsReadOnly( sal_Int32 nPropertyHandle ) const
static SvtLinguConfigItem *pCfgItem = 0;
static sal_Int32 nCfgItemRefCount = 0;
-static const rtl::OUString aG_SupportedDictionaryFormats( A2OU("SupportedDictionaryFormats") );
-static const rtl::OUString aG_Dictionaries( A2OU("Dictionaries") );
-static const rtl::OUString aG_Locations( A2OU("Locations") );
-static const rtl::OUString aG_Format( A2OU("Format") );
-static const rtl::OUString aG_Locales( A2OU("Locales") );
-static const rtl::OUString aG_DisabledDictionaries( A2OU("DisabledDictionaries") );
-static const rtl::OUString aG_LastActiveDictionaries( A2OU("LastActiveDictionaries") );
+static const rtl::OUString aG_SupportedDictionaryFormats(RTL_CONSTASCII_USTRINGPARAM("SupportedDictionaryFormats"));
+static const rtl::OUString aG_Dictionaries(RTL_CONSTASCII_USTRINGPARAM("Dictionaries"));
+static const rtl::OUString aG_Locations(RTL_CONSTASCII_USTRINGPARAM("Locations"));
+static const rtl::OUString aG_Format(RTL_CONSTASCII_USTRINGPARAM("Format"));
+static const rtl::OUString aG_Locales(RTL_CONSTASCII_USTRINGPARAM("Locales"));
+static const rtl::OUString aG_DisabledDictionaries(RTL_CONSTASCII_USTRINGPARAM("DisabledDictionaries"));
+static const rtl::OUString aG_LastActiveDictionaries(RTL_CONSTASCII_USTRINGPARAM("LastActiveDictionaries"));
SvtLinguConfig::SvtLinguConfig()
{
// Global access, must be guarded (multithreading)
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
++nCfgItemRefCount;
}
SvtLinguConfig::~SvtLinguConfig()
{
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
if (pCfgItem && pCfgItem->IsModified())
pCfgItem->Commit();
@@ -880,7 +878,7 @@ SvtLinguConfig::~SvtLinguConfig()
SvtLinguConfigItem & SvtLinguConfig::GetConfigItem()
{
// Global access, must be guarded (multithreading)
- osl::MutexGuard aGuard( GetOwnMutex() );
+ osl::MutexGuard aGuard(theSvtLinguConfigItemMutex::get());
if (!pCfgItem)
{
pCfgItem = new SvtLinguConfigItem;
@@ -963,7 +961,7 @@ sal_Bool SvtLinguConfig::GetElementNamesFor(
try
{
uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("ServiceManager") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( rNodeName ), uno::UNO_QUERY_THROW );
rElementNames = xNA->getElementNames();
bSuccess = true;
@@ -1007,7 +1005,7 @@ sal_Bool SvtLinguConfig::GetSupportedDictionaryFormatsFor(
try
{
uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("ServiceManager") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( rSetName ), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( rSetEntry ), uno::UNO_QUERY_THROW );
if (xNA->getByName( aG_SupportedDictionaryFormats ) >>= rFormatList)
@@ -1033,7 +1031,7 @@ void SvtLinguConfig::SetOrCreateSupportedDictionaryFormatsFor(
uno::Reference< util::XChangesBatch > xUpdateAccess( GetMainUpdateAccess() );
uno::Reference< container::XNameAccess > xNA( xUpdateAccess, uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("ServiceManager") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( rSetName ), uno::UNO_QUERY_THROW );
xNA = GetOrCreateSetEntry_Impl( xNA, rSetEntry );
@@ -1059,11 +1057,11 @@ static uno::Reference< util::XMacroExpander > lcl_GetMacroExpander()
{
uno::Reference< uno::XComponentContext > xContext;
uno::Reference< beans::XPropertySet > xProps( ::comphelper::getProcessServiceFactory(), uno::UNO_QUERY );
- xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext;
+ xProps->getPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DefaultContext"))) >>= xContext;
if ( xContext.is() )
{
aG_xMacroExpander = uno::Reference< com::sun::star::util::XMacroExpander >( xContext->getValueByName(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "/singletons/com.sun.star.util.theMacroExpander"))),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("/singletons/com.sun.star.util.theMacroExpander"))),
uno::UNO_QUERY );
xMacroExpander = aG_xMacroExpander;
}
@@ -1123,7 +1121,7 @@ sal_Bool SvtLinguConfig::GetDictionaryEntry(
try
{
uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("ServiceManager") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( aG_Dictionaries ), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( rNodeName ), uno::UNO_QUERY_THROW );
@@ -1175,7 +1173,7 @@ void SvtLinguConfig::SetOrCreateDictionaryEntry(
{
uno::Reference< util::XChangesBatch > xUpdateAccess( GetMainUpdateAccess() );
uno::Reference< container::XNameAccess > xNA( xUpdateAccess, uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("ServiceManager") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( aG_Dictionaries ), uno::UNO_QUERY_THROW );
xNA = GetOrCreateSetEntry_Impl( xNA, rNodeName );
@@ -1201,7 +1199,7 @@ uno::Sequence< rtl::OUString > SvtLinguConfig::GetDisabledDictionaries() const
try
{
uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("ServiceManager") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
xNA->getByName( aG_DisabledDictionaries ) >>= aResult;
}
catch (uno::Exception &)
@@ -1217,7 +1215,7 @@ void SvtLinguConfig::SetDisabledDictionaries(
{
uno::Reference< util::XChangesBatch > xUpdateAccess( GetMainUpdateAccess() );
uno::Reference< container::XNameAccess > xNA( xUpdateAccess, uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("ServiceManager") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager"))), uno::UNO_QUERY_THROW );
if (xNA->hasByName( aG_DisabledDictionaries ))
{
uno::Reference< container::XNameReplace > xNR( xNA, uno::UNO_QUERY_THROW );
@@ -1299,20 +1297,20 @@ uno::Reference< util::XChangesBatch > SvtLinguConfig::GetMainUpdateAccess() cons
if (xMgr.is())
{
xConfigurationProvider = uno::Reference< lang::XMultiServiceFactory > (
- xMgr->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.configuration.ConfigurationProvider" ) ) ),
+ xMgr->createInstance(OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.configuration.ConfigurationProvider"))),
uno::UNO_QUERY_THROW ) ;
}
// get configuration update access
beans::PropertyValue aValue;
- aValue.Name = A2OU( "nodepath" );
- aValue.Value = uno::makeAny( A2OU("org.openoffice.Office.Linguistic") );
+ aValue.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
+ aValue.Value = uno::makeAny(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Linguistic")));
uno::Sequence< uno::Any > aProps(1);
aProps[0] <<= aValue;
m_xMainUpdateAccess = uno::Reference< util::XChangesBatch >(
xConfigurationProvider->createInstanceWithArguments(
- A2OU( "com.sun.star.configuration.ConfigurationUpdateAccess" ), aProps ),
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationUpdateAccess")), aProps),
uno::UNO_QUERY_THROW );
}
catch (uno::Exception &)
@@ -1332,16 +1330,16 @@ rtl::OUString SvtLinguConfig::GetVendorImageUrl_Impl(
try
{
uno::Reference< container::XNameAccess > xImagesNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
- xImagesNA.set( xImagesNA->getByName( A2OU("Images") ), uno::UNO_QUERY_THROW );
+ xImagesNA.set( xImagesNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Images"))), uno::UNO_QUERY_THROW );
- uno::Reference< container::XNameAccess > xNA( xImagesNA->getByName( A2OU("ServiceNameEntries") ), uno::UNO_QUERY_THROW );
+ uno::Reference< container::XNameAccess > xNA( xImagesNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceNameEntries"))), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( rServiceImplName ), uno::UNO_QUERY_THROW );
- uno::Any aAny( xNA->getByName( A2OU("VendorImagesNode") ) );
+ uno::Any aAny(xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VendorImagesNode"))));
rtl::OUString aVendorImagesNode;
if (aAny >>= aVendorImagesNode)
{
xNA = xImagesNA;
- xNA.set( xNA->getByName( A2OU("VendorImages") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VendorImages"))), uno::UNO_QUERY_THROW );
xNA.set( xNA->getByName( aVendorImagesNode ), uno::UNO_QUERY_THROW );
aAny = xNA->getByName( rImageName );
rtl::OUString aTmp;
@@ -1362,13 +1360,13 @@ rtl::OUString SvtLinguConfig::GetVendorImageUrl_Impl(
rtl::OUString SvtLinguConfig::GetSpellAndGrammarDialogImage(
- const rtl::OUString &rServiceImplName,
- bool bHighContrast ) const
+ const rtl::OUString &rServiceImplName
+) const
{
rtl::OUString aRes;
if (rServiceImplName.getLength() > 0)
{
- rtl::OUString aImageName( A2OU( bHighContrast ? "SpellAndGrammarDialogImage_HC" : "SpellAndGrammarDialogImage" ));
+ rtl::OUString aImageName( A2OU( "SpellAndGrammarDialogImage" ));
rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) );
aRes = aPath;
}
@@ -1377,13 +1375,13 @@ rtl::OUString SvtLinguConfig::GetSpellAndGrammarDialogImage(
rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextSuggestionImage(
- const rtl::OUString &rServiceImplName,
- bool bHighContrast ) const
+ const rtl::OUString &rServiceImplName
+) const
{
rtl::OUString aRes;
if (rServiceImplName.getLength() > 0)
{
- rtl::OUString aImageName( A2OU( bHighContrast ? "SpellAndGrammarContextMenuSuggestionImage_HC" : "SpellAndGrammarContextMenuSuggestionImage" ));
+ rtl::OUString aImageName( A2OU( "SpellAndGrammarContextMenuSuggestionImage" ));
rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) );
aRes = aPath;
}
@@ -1392,13 +1390,13 @@ rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextSuggestionImage(
rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextDictionaryImage(
- const rtl::OUString &rServiceImplName,
- bool bHighContrast ) const
+ const rtl::OUString &rServiceImplName
+) const
{
rtl::OUString aRes;
if (rServiceImplName.getLength() > 0)
{
- rtl::OUString aImageName( A2OU( bHighContrast ? "SpellAndGrammarContextMenuDictionaryImage_HC" : "SpellAndGrammarContextMenuDictionaryImage" ));
+ rtl::OUString aImageName( A2OU( "SpellAndGrammarContextMenuDictionaryImage" ));
rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) );
aRes = aPath;
}
@@ -1407,13 +1405,13 @@ rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextDictionaryImage(
::rtl::OUString SvtLinguConfig::GetThesaurusDialogImage(
- const ::rtl::OUString &rServiceImplName,
- bool bHighContrast ) const
+ const ::rtl::OUString &rServiceImplName
+) const
{
rtl::OUString aRes;
if (rServiceImplName.getLength() > 0)
{
- rtl::OUString aImageName( A2OU( bHighContrast ? "ThesaurusDialogImage_HC" : "ThesaurusDialogImage" ));
+ rtl::OUString aImageName( A2OU( "ThesaurusDialogImage" ));
rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) );
aRes = aPath;
}
@@ -1422,13 +1420,13 @@ rtl::OUString SvtLinguConfig::GetSpellAndGrammarContextDictionaryImage(
::rtl::OUString SvtLinguConfig::GetSynonymsContextImage(
- const ::rtl::OUString &rServiceImplName,
- bool bHighContrast ) const
+ const ::rtl::OUString &rServiceImplName
+) const
{
rtl::OUString aRes;
if (rServiceImplName.getLength() > 0)
{
- rtl::OUString aImageName( A2OU( bHighContrast ? "SynonymsContextMenuImage_HC" : "SynonymsContextMenuImage" ));
+ rtl::OUString aImageName( A2OU( "SynonymsContextMenuImage" ));
rtl::OUString aPath( GetVendorImageUrl_Impl( rServiceImplName, aImageName ) );
aRes = aPath;
}
@@ -1444,8 +1442,8 @@ bool SvtLinguConfig::HasVendorImages( const char *pImageName ) const
try
{
uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("Images") ), uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("VendorImages") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Images")) ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VendorImages")) ), uno::UNO_QUERY_THROW );
uno::Sequence< rtl::OUString > aElementNames( xNA->getElementNames() );
sal_Int32 nVendors = aElementNames.getLength();
@@ -1484,8 +1482,8 @@ bool SvtLinguConfig::HasGrammarChecker() const
try
{
uno::Reference< container::XNameAccess > xNA( GetMainUpdateAccess(), uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("ServiceManager") ), uno::UNO_QUERY_THROW );
- xNA.set( xNA->getByName( A2OU("GrammarCheckerList") ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ServiceManager")) ), uno::UNO_QUERY_THROW );
+ xNA.set( xNA->getByName( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("GrammarCheckerList")) ), uno::UNO_QUERY_THROW );
uno::Sequence< rtl::OUString > aElementNames( xNA->getElementNames() );
bRes = aElementNames.getLength() > 0;
@@ -1499,3 +1497,4 @@ bool SvtLinguConfig::HasGrammarChecker() const
//////////////////////////////////////////////////////////////////////
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/localisationoptions.cxx b/unotools/source/config/localisationoptions.cxx
index f4b8bbd087ef..b38f4d42fb97 100644
--- a/unotools/source/config/localisationoptions.cxx
+++ b/unotools/source/config/localisationoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/localisationoptions.hxx>
#include <unotools/configmgr.hxx>
@@ -199,13 +194,12 @@ SvtLocalisationOptions_Impl::SvtLocalisationOptions_Impl()
// Follow assignment use order of values in relation to our list of key names!
DBG_ASSERT( !(seqNames.getLength()!=seqValues.getLength()), "SvtLocalisationOptions_Impl::SvtLocalisationOptions_Impl()\nI miss some values of configuration keys!\n" );
- // Copy values from list in right order to ouer internal member.
+ // Copy values from list in right order to our internal member.
sal_Int32 nPropertyCount = seqValues.getLength();
for( sal_Int32 nProperty=0; nProperty<nPropertyCount; ++nProperty )
{
- // Safe impossible cases.
- // Check any for valid value.
- DBG_ASSERT( !(seqValues[nProperty].hasValue()==sal_False), "SvtLocalisationOptions_Impl::SvtLocalisationOptions_Impl()\nInvalid property value detected!\n" );
+ if (!seqValues[nProperty].hasValue())
+ continue;
switch( nProperty )
{
case PROPERTYHANDLE_AUTOMNEMONIC : {
@@ -334,19 +328,16 @@ void SvtLocalisationOptions_Impl::SetDialogScale( sal_Int32 nScale )
SetModified();
}
-//*****************************************************************************************************************
-// private method
-//*****************************************************************************************************************
Sequence< OUString > SvtLocalisationOptions_Impl::GetPropertyNames()
{
// Build static list of configuration key names.
- static const OUString pProperties[] =
+ const OUString aProperties[] =
{
PROPERTYNAME_AUTOMNEMONIC ,
PROPERTYNAME_DIALOGSCALE ,
};
// Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ Sequence< OUString > seqPropertyNames(aProperties, PROPERTYCOUNT);
// ... and return it.
return seqPropertyNames;
}
@@ -432,27 +423,17 @@ void SvtLocalisationOptions::SetDialogScale( sal_Int32 nScale )
m_pDataContainer->SetDialogScale( nScale );
}
+namespace
+{
+ class theLocalisationOptionsMutex : public rtl::Static<osl::Mutex, theLocalisationOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtLocalisationOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theLocalisationOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/misccfg.cxx b/unotools/source/config/misccfg.cxx
index 37e3dfac304f..903a3a8c2657 100644
--- a/unotools/source/config/misccfg.cxx
+++ b/unotools/source/config/misccfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,7 @@
#include <tools/debug.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <osl/mutex.hxx>
#include <rtl/logfile.hxx>
#include "itemholder1.hxx"
@@ -45,10 +46,9 @@
#define DEF_INCH 2540L
#define DEF_RELTWIP 1440L
-using namespace rtl;
using namespace com::sun::star::uno;
-#define C2U(cChar) OUString::createFromAscii(cChar)
+using ::rtl::OUString;
namespace utl
{
@@ -63,7 +63,7 @@ class SfxMiscCfg : public utl::ConfigItem
sal_Bool bNotFound;
sal_Int32 nYear2000; // two digit year representation
- const com::sun::star::uno::Sequence<rtl::OUString>& GetPropertyNames();
+ const com::sun::star::uno::Sequence<rtl::OUString> GetPropertyNames();
void Load();
public:
@@ -88,11 +88,8 @@ public:
};
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
SfxMiscCfg::SfxMiscCfg() :
- ConfigItem(C2U("Office.Common") ),
+ ConfigItem(OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common")) ),
bPaperSize(sal_False),
bPaperOrientation (sal_False),
bNotFound (sal_False),
@@ -102,15 +99,10 @@ SfxMiscCfg::SfxMiscCfg() :
Load();
}
-/* -----------------------------02.03.01 15:31--------------------------------
- ---------------------------------------------------------------------------*/
SfxMiscCfg::~SfxMiscCfg()
{
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SfxMiscCfg::SetNotFoundWarning( sal_Bool bSet)
{
@@ -119,10 +111,6 @@ void SfxMiscCfg::SetNotFoundWarning( sal_Bool bSet)
bNotFound = bSet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
-
void SfxMiscCfg::SetPaperSizeWarning( sal_Bool bSet)
{
if(bPaperSize != bSet)
@@ -130,18 +118,12 @@ void SfxMiscCfg::SetPaperSizeWarning( sal_Bool bSet)
bPaperSize = bSet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SfxMiscCfg::SetPaperOrientationWarning( sal_Bool bSet)
{
if(bPaperOrientation != bSet)
SetModified();
bPaperOrientation = bSet;
}
-/*--------------------------------------------------------------------
- Beschreibung:
- --------------------------------------------------------------------*/
void SfxMiscCfg::SetYear2000( sal_Int32 nSet )
{
@@ -149,42 +131,30 @@ void SfxMiscCfg::SetYear2000( sal_Int32 nSet )
SetModified();
nYear2000 = nSet;
}
-/* -----------------------------02.03.01 15:31--------------------------------
- ---------------------------------------------------------------------------*/
-const Sequence<OUString>& SfxMiscCfg::GetPropertyNames()
+const Sequence<OUString> SfxMiscCfg::GetPropertyNames()
{
- static Sequence<OUString> aNames;
- if(!aNames.getLength())
+ const OUString pProperties[] =
{
- static const char* aPropNames[] =
- {
- "Print/Warning/PaperSize", // 0
- "Print/Warning/PaperOrientation", // 1
- "Print/Warning/NotFound", // 2
- "DateFormat/TwoDigitYear", // 3
- };
- const int nCount = 4;
- aNames.realloc(nCount);
- OUString* pNames = aNames.getArray();
- for(int i = 0; i < nCount; i++)
- pNames[i] = OUString::createFromAscii(aPropNames[i]);
- }
- return aNames;
+ OUString(RTL_CONSTASCII_USTRINGPARAM("Print/Warning/PaperSize")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("Print/Warning/PaperOrientation")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("Print/Warning/NotFound")),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("DateFormat/TwoDigitYear"))
+ };
+ const Sequence< OUString > seqPropertyNames( pProperties, 4 );
+ return seqPropertyNames;
}
-/* -----------------------------02.03.01 15:31--------------------------------
- ---------------------------------------------------------------------------*/
void SfxMiscCfg::Load()
{
- const Sequence<OUString>& aNames = GetPropertyNames();
- Sequence<Any> aValues = GetProperties(aNames);
- EnableNotification(aNames);
+ const Sequence<OUString>& rNames = GetPropertyNames();
+ Sequence<Any> aValues = GetProperties(rNames);
+ EnableNotification(rNames);
const Any* pValues = aValues.getConstArray();
- DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed");
- if(aValues.getLength() == aNames.getLength())
+ DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed");
+ if(aValues.getLength() == rNames.getLength())
{
- for(int nProp = 0; nProp < aNames.getLength(); nProp++)
+ for(int nProp = 0; nProp < rNames.getLength(); nProp++)
{
if(pValues[nProp].hasValue())
{
@@ -199,24 +169,20 @@ void SfxMiscCfg::Load()
}
}
}
-/* -----------------------------02.03.01 15:31--------------------------------
- ---------------------------------------------------------------------------*/
void SfxMiscCfg::Notify( const com::sun::star::uno::Sequence<rtl::OUString>& )
{
Load();
}
-/* -----------------------------02.03.01 15:31--------------------------------
- ---------------------------------------------------------------------------*/
void SfxMiscCfg::Commit()
{
- const Sequence<OUString>& aNames = GetPropertyNames();
- Sequence<Any> aValues(aNames.getLength());
+ const Sequence<OUString>& rNames = GetPropertyNames();
+ Sequence<Any> aValues(rNames.getLength());
Any* pValues = aValues.getArray();
const Type& rType = ::getBooleanCppuType();
- for(int nProp = 0; nProp < aNames.getLength(); nProp++)
+ for(int nProp = 0; nProp < rNames.getLength(); nProp++)
{
switch(nProp)
{
@@ -226,7 +192,7 @@ void SfxMiscCfg::Commit()
case 3: pValues[nProp] <<= nYear2000;break; //"DateFormat/TwoDigitYear",
}
}
- PutProperties(aNames, aValues);
+ PutProperties(rNames, aValues);
}
// -----------------------------------------------------------------------
namespace
@@ -308,3 +274,4 @@ void MiscCfg::SetYear2000( sal_Int32 nSet )
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx
index ec2da6bff054..c275a910510e 100644
--- a/unotools/source/config/moduleoptions.cxx
+++ b/unotools/source/config/moduleoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/moduleoptions.hxx>
#include <comphelper/sequenceashashmap.hxx>
@@ -43,6 +38,7 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/logfile.hxx>
+#include <rtl/instance.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/PropertyValue.hpp>
@@ -222,7 +218,6 @@ struct FactoryInfo
::rtl::OUString getShortName () const { return sShortName; };
::rtl::OUString getTemplateFile () const { return sTemplateFile; };
::rtl::OUString getWindowAttributes () const { return sWindowAttributes; };
- ::rtl::OUString getEmptyDocumentURL () const { return sEmptyDocumentURL; };
::rtl::OUString getDefaultFilter () const { return sDefaultFilter; };
sal_Bool isDefaultFilterReadonly() const { return bDefaultFilterReadonly; }
sal_Int32 getIcon () const { return nIcon; };
@@ -255,24 +250,6 @@ struct FactoryInfo
}
//---------------------------------------------------------------------------------------------------------
- void setInstalled( sal_Bool bNewInstalled )
- {
- bInstalled = bNewInstalled;
- };
-
- //---------------------------------------------------------------------------------------------------------
- void setFactory( const ::rtl::OUString& sNewFactory )
- {
- sFactory = sNewFactory;
- };
-
- //---------------------------------------------------------------------------------------------------------
- void setShortName( const ::rtl::OUString& sNewShortName )
- {
- sShortName = sNewShortName;
- };
-
- //---------------------------------------------------------------------------------------------------------
void setTemplateFile( const ::rtl::OUString& sNewTemplateFile )
{
if( sTemplateFile != sNewTemplateFile )
@@ -293,16 +270,6 @@ struct FactoryInfo
};
//---------------------------------------------------------------------------------------------------------
- void setEmptyDocumentURL( const ::rtl::OUString& sNewEmptyDocumentURL )
- {
- if( sEmptyDocumentURL != sNewEmptyDocumentURL )
- {
- sEmptyDocumentURL = sNewEmptyDocumentURL;
- bChangedEmptyDocumentURL = sal_True ;
- }
- };
-
- //---------------------------------------------------------------------------------------------------------
void setDefaultFilter( const ::rtl::OUString& sNewDefaultFilter )
{
if( sDefaultFilter != sNewDefaultFilter )
@@ -312,16 +279,6 @@ struct FactoryInfo
}
};
- //---------------------------------------------------------------------------------------------------------
- void setIcon( sal_Int32 nNewIcon )
- {
- if( nNewIcon != nNewIcon )
- {
- nNewIcon = nNewIcon;
- bChangedIcon = sal_True;
- }
- };
-
private:
css::uno::Reference< css::util::XStringSubstitution > getStringSubstitution()
{
@@ -522,7 +479,7 @@ SvtModuleOptions_Impl::~SvtModuleOptions_Impl()
*//*-*************************************************************************************************************/
void SvtModuleOptions_Impl::Notify( const css::uno::Sequence< ::rtl::OUString >& )
{
- OSL_ENSURE( sal_False, "SvtModuleOptions_Impl::Notify()\nNot implemented yet!\n" );
+ OSL_FAIL( "SvtModuleOptions_Impl::Notify()\nNot implemented yet!\n" );
}
/*-****************************************************************************************************//**
@@ -724,7 +681,7 @@ sal_Bool SvtModuleOptions_Impl::IsModuleInstalled( SvtModuleOptions::EModule eMo
case SvtModuleOptions::E_DATABASE : sShortName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("sdatabase"));
break;
default:
- OSL_ASSERT( "unknown factory" );
+ OSL_FAIL( "unknown factory" );
break;
}
@@ -789,7 +746,7 @@ sal_Bool SvtModuleOptions_Impl::IsModuleInstalled( SvtModuleOptions::EModule eMo
case SvtModuleOptions::E_DATABASE : sURL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("private:factory/sdatabase?Interactive"));
break;
default:
- OSL_ASSERT( "unknown factory" );
+ OSL_FAIL( "unknown factory" );
break;
}
return sURL;
@@ -1322,6 +1279,10 @@ sal_uInt32 SvtModuleOptions::GetFeatures() const
return nFeature;
}
+namespace
+{
+ class theModuleOptionsMutex : public rtl::Static<osl::Mutex, theModuleOptionsMutex> {};
+}
/*-****************************************************************************************************//**
@short return a reference to a static mutex
@descr These class is threadsafe.
@@ -1338,42 +1299,25 @@ sal_uInt32 SvtModuleOptions::GetFeatures() const
*//*-*****************************************************************************************************/
::osl::Mutex& SvtModuleOptions::impl_GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static ::osl::Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static ::osl::Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theModuleOptionsMutex::get();
}
::rtl::OUString SvtModuleOptions::GetModuleName( EModule eModule ) const
{
switch( eModule )
{
- case SvtModuleOptions::E_SWRITER : { return ::rtl::OUString::createFromAscii("Writer"); }
- case SvtModuleOptions::E_SWEB : { return ::rtl::OUString::createFromAscii("Web"); }
- case SvtModuleOptions::E_SGLOBAL : { return ::rtl::OUString::createFromAscii("Global"); }
- case SvtModuleOptions::E_SCALC : { return ::rtl::OUString::createFromAscii("Calc"); }
- case SvtModuleOptions::E_SDRAW : { return ::rtl::OUString::createFromAscii("Draw"); }
- case SvtModuleOptions::E_SIMPRESS : { return ::rtl::OUString::createFromAscii("Impress"); }
- case SvtModuleOptions::E_SMATH : { return ::rtl::OUString::createFromAscii("Math"); }
- case SvtModuleOptions::E_SCHART : { return ::rtl::OUString::createFromAscii("Chart"); }
- case SvtModuleOptions::E_SBASIC : { return ::rtl::OUString::createFromAscii("Basic"); }
- case SvtModuleOptions::E_SDATABASE : { return ::rtl::OUString::createFromAscii("Database"); }
+ case SvtModuleOptions::E_SWRITER : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Writer")); }
+ case SvtModuleOptions::E_SWEB : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Web")); }
+ case SvtModuleOptions::E_SGLOBAL : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Global")); }
+ case SvtModuleOptions::E_SCALC : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Calc")); }
+ case SvtModuleOptions::E_SDRAW : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Draw")); }
+ case SvtModuleOptions::E_SIMPRESS : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Impress")); }
+ case SvtModuleOptions::E_SMATH : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Math")); }
+ case SvtModuleOptions::E_SCHART : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Chart")); }
+ case SvtModuleOptions::E_SBASIC : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Basic")); }
+ case SvtModuleOptions::E_SDATABASE : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Database")); }
default:
- OSL_ASSERT( "unknown module" );
+ OSL_FAIL( "unknown module" );
break;
}
@@ -1384,18 +1328,18 @@ sal_uInt32 SvtModuleOptions::GetFeatures() const
{
switch( eFactory )
{
- case SvtModuleOptions::E_WRITER : { return ::rtl::OUString::createFromAscii("Writer"); }
- case SvtModuleOptions::E_WRITERWEB : { return ::rtl::OUString::createFromAscii("Writer"); }
- case SvtModuleOptions::E_WRITERGLOBAL : { return ::rtl::OUString::createFromAscii("Writer"); }
- case SvtModuleOptions::E_CALC : { return ::rtl::OUString::createFromAscii("Calc"); }
- case SvtModuleOptions::E_DRAW : { return ::rtl::OUString::createFromAscii("Draw"); }
- case SvtModuleOptions::E_IMPRESS : { return ::rtl::OUString::createFromAscii("Impress"); }
- case SvtModuleOptions::E_MATH : { return ::rtl::OUString::createFromAscii("Math"); }
- case SvtModuleOptions::E_CHART : { return ::rtl::OUString::createFromAscii("Chart"); }
- case SvtModuleOptions::E_BASIC : { return ::rtl::OUString::createFromAscii("Basic"); }
- case SvtModuleOptions::E_DATABASE : { return ::rtl::OUString::createFromAscii("Database"); }
+ case SvtModuleOptions::E_WRITER : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Writer")); }
+ case SvtModuleOptions::E_WRITERWEB : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Writer")); }
+ case SvtModuleOptions::E_WRITERGLOBAL : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Writer")); }
+ case SvtModuleOptions::E_CALC : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Calc")); }
+ case SvtModuleOptions::E_DRAW : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Draw")); }
+ case SvtModuleOptions::E_IMPRESS : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Impress")); }
+ case SvtModuleOptions::E_MATH : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Math")); }
+ case SvtModuleOptions::E_CHART : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Chart")); }
+ case SvtModuleOptions::E_BASIC : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Basic")); }
+ case SvtModuleOptions::E_DATABASE : { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Database")); }
default:
- OSL_ASSERT( "unknown factory" );
+ OSL_FAIL( "unknown factory" );
break;
}
@@ -1407,25 +1351,25 @@ sal_uInt32 SvtModuleOptions::GetFeatures() const
-----------------------------------------------*/
SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByShortName(const ::rtl::OUString& sName)
{
- if (sName.equalsAscii("swriter"))
+ if (sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swriter")))
return E_WRITER;
- if (sName.equalsIgnoreAsciiCaseAscii("swriter/Web")) // sometimes they are registerd for swriter/web :-(
+ if (sName.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("swriter/Web"))) // sometimes they are registerd for swriter/web :-(
return E_WRITERWEB;
- if (sName.equalsIgnoreAsciiCaseAscii("swriter/GlobalDocument")) // sometimes they are registerd for swriter/globaldocument :-(
+ if (sName.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("swriter/GlobalDocument"))) // sometimes they are registerd for swriter/globaldocument :-(
return E_WRITERGLOBAL;
- if (sName.equalsAscii("scalc"))
+ if (sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("scalc")))
return E_CALC;
- if (sName.equalsAscii("sdraw"))
+ if (sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sdraw")))
return E_DRAW;
- if (sName.equalsAscii("simpress"))
+ if (sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("simpress")))
return E_IMPRESS;
- if (sName.equalsAscii("schart"))
+ if (sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("schart")))
return E_CHART;
- if (sName.equalsAscii("smath"))
+ if (sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("smath")))
return E_MATH;
- if (sName.equalsAscii("sbasic"))
+ if (sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sbasic")))
return E_BASIC;
- if (sName.equalsAscii("sdatabase"))
+ if (sName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sdatabase")))
return E_DATABASE;
return E_UNKNOWN_FACTORY;
@@ -1473,9 +1417,9 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByURL(const ::rtl::O
try
{
xFilterCfg = css::uno::Reference< css::container::XNameAccess >(
- xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.document.FilterFactory")), css::uno::UNO_QUERY);
+ xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.FilterFactory"))), css::uno::UNO_QUERY);
xTypeCfg = css::uno::Reference< css::container::XNameAccess >(
- xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.document.TypeDetection")), css::uno::UNO_QUERY);
+ xSMGR->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.document.TypeDetection"))), css::uno::UNO_QUERY);
}
catch(const css::uno::RuntimeException&)
{ throw; }
@@ -1485,13 +1429,13 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByURL(const ::rtl::O
::comphelper::SequenceAsHashMap stlDesc(lMediaDescriptor);
// is there already a filter inside the descriptor?
- ::rtl::OUString sFilterName = stlDesc.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("FilterName"), ::rtl::OUString());
+ ::rtl::OUString sFilterName = stlDesc.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")), ::rtl::OUString());
if (sFilterName.getLength())
{
try
{
::comphelper::SequenceAsHashMap stlFilterProps (xFilterCfg->getByName(sFilterName));
- ::rtl::OUString sDocumentService = stlFilterProps.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("DocumentService"), ::rtl::OUString());
+ ::rtl::OUString sDocumentService = stlFilterProps.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentService")), ::rtl::OUString());
SvtModuleOptions::EFactory eApp = SvtModuleOptions::ClassifyFactoryByServiceName(sDocumentService);
if (eApp != E_UNKNOWN_FACTORY)
@@ -1504,7 +1448,7 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByURL(const ::rtl::O
}
// is there already a type inside the descriptor?
- ::rtl::OUString sTypeName = stlDesc.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("TypeName"), ::rtl::OUString());
+ ::rtl::OUString sTypeName = stlDesc.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TypeName")), ::rtl::OUString());
if (!sTypeName.getLength())
{
// no :-(
@@ -1521,9 +1465,9 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByURL(const ::rtl::O
try
{
::comphelper::SequenceAsHashMap stlTypeProps (xTypeCfg->getByName(sTypeName));
- ::rtl::OUString sPreferredFilter = stlTypeProps.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("PreferredFilter"), ::rtl::OUString());
+ ::rtl::OUString sPreferredFilter = stlTypeProps.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter")), ::rtl::OUString());
::comphelper::SequenceAsHashMap stlFilterProps (xFilterCfg->getByName(sPreferredFilter));
- ::rtl::OUString sDocumentService = stlFilterProps.getUnpackedValueOrDefault(::rtl::OUString::createFromAscii("DocumentService"), ::rtl::OUString());
+ ::rtl::OUString sDocumentService = stlFilterProps.getUnpackedValueOrDefault(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentService")), ::rtl::OUString());
SvtModuleOptions::EFactory eApp = SvtModuleOptions::ClassifyFactoryByServiceName(sDocumentService);
if (eApp != E_UNKNOWN_FACTORY)
@@ -1595,3 +1539,4 @@ SvtModuleOptions::EFactory SvtModuleOptions::ClassifyFactoryByModel(const css::u
return aModule;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/options.cxx b/unotools/source/config/options.cxx
index c65fd09efd0c..5eee90dd28d9 100644
--- a/unotools/source/config/options.cxx
+++ b/unotools/source/config/options.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,14 +30,8 @@
#include "precompiled_unotools.hxx"
#include "sal/config.h"
-#include <tools/list.hxx>
#include <unotools/options.hxx>
-namespace utl
-{
- DECLARE_LIST( IMPL_ConfigurationListenerList, ConfigurationListener* )
-}
-
using utl::detail::Options;
using utl::ConfigurationBroadcaster;
@@ -56,13 +51,22 @@ void ConfigurationBroadcaster::AddListener( utl::ConfigurationListener* pListene
{
if ( !mpList )
mpList = new IMPL_ConfigurationListenerList;
- mpList->Insert( pListener );
+ mpList->push_back( pListener );
}
void ConfigurationBroadcaster::RemoveListener( utl::ConfigurationListener* pListener )
{
- if ( mpList )
- mpList->Remove( pListener );
+ if ( mpList ) {
+ for ( IMPL_ConfigurationListenerList::iterator it = mpList->begin();
+ it < mpList->end();
+ ++it
+ ) {
+ if ( *it == pListener ) {
+ mpList->erase( it );
+ break;
+ }
+ }
+ }
}
void ConfigurationBroadcaster::NotifyListeners( sal_uInt32 nHint )
@@ -73,9 +77,11 @@ void ConfigurationBroadcaster::NotifyListeners( sal_uInt32 nHint )
{
nHint |= m_nBlockedHint;
m_nBlockedHint = 0;
- if ( mpList )
- for ( sal_uInt32 n=0; n<mpList->Count(); n++ )
- mpList->GetObject(n)->ConfigurationChanged( this, nHint );
+ if ( mpList ) {
+ for ( size_t n = 0; n < mpList->size(); n++ ) {
+ (*mpList)[ n ]->ConfigurationChanged( this, nHint );
+ }
+ }
}
}
@@ -104,3 +110,4 @@ void Options::ConfigurationChanged( ConfigurationBroadcaster*, sal_uInt32 nHint
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx
index cb98e8514358..4aeb603a6717 100644
--- a/unotools/source/config/optionsdlg.cxx
+++ b/unotools/source/config/optionsdlg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,14 +38,15 @@
#include <osl/mutex.hxx>
#include <comphelper/stl_types.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include "itemholder1.hxx"
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::beans ;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
+
#define CFG_FILENAME OUString( RTL_CONSTASCII_USTRINGPARAM( "Office.OptionsDialog" ) )
#define ROOT_NODE OUString( RTL_CONSTASCII_USTRINGPARAM( "OptionsDialogGroups" ) )
#define PAGES_NODE OUString( RTL_CONSTASCII_USTRINGPARAM( "Pages" ) )
@@ -65,7 +67,7 @@ private:
}
};
- typedef std::hash_map< OUString, sal_Bool, OUStringHashCode, ::std::equal_to< OUString > > OptionNodeList;
+ typedef boost::unordered_map< OUString, sal_Bool, OUStringHashCode, ::std::equal_to< OUString > > OptionNodeList;
OUString m_sPathDelimiter;
OptionNodeList m_aOptionNodeList;
@@ -90,20 +92,14 @@ public:
const OUString& _rGroup ) const;
};
-::osl::Mutex & SvtOptionsDlgOptions_Impl::getInitMutex()
+namespace
{
- static ::osl::Mutex *pMutex = 0;
+ class theOptionsDlgOptions_ImplMutex : public rtl::Static<osl::Mutex, theOptionsDlgOptions_ImplMutex>{};
+}
- if( ! pMutex )
- {
- ::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() );
- if( ! pMutex )
- {
- static ::osl::Mutex mutex;
- pMutex = &mutex;
- }
- }
- return *pMutex;
+::osl::Mutex & SvtOptionsDlgOptions_Impl::getInitMutex()
+{
+ return theOptionsDlgOptions_ImplMutex::get();
}
// -----------------------------------------------------------------------
@@ -288,3 +284,4 @@ sal_Bool SvtOptionsDialogOptions::IsOptionHidden(
return m_pImp->IsOptionHidden( _rOption, _rPage, _rGroup );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 613b9056d346..7bfbf487e164 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,8 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
#include <unotools/pathoptions.hxx>
#include <unotools/configitem.hxx>
@@ -44,7 +43,6 @@
#include <unotools/bootstrap.hxx>
#include <unotools/ucbhelper.hxx>
-#include <vos/process.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/componentcontext.hxx>
#include <com/sun/star/beans/XFastPropertySet.hpp>
@@ -59,16 +57,19 @@
#include <itemholder1.hxx>
#include <vector>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
using namespace osl;
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::beans;
using namespace com::sun::star::util;
using namespace com::sun::star::lang;
+using ::rtl::OUString;
+using ::rtl::OString;
+using ::rtl::OStringToOUString;
+
// define ----------------------------------------------------------------
#define SEARCHPATH_DELIMITER ';'
@@ -110,19 +111,19 @@ enum VarNameProperty
VAR_NEEDS_FILEURL
};
-class NameToHandleMap : public ::std::hash_map< ::rtl::OUString, sal_Int32, OUStringHashCode, ::std::equal_to< ::rtl::OUString > >
+class NameToHandleMap : public ::boost::unordered_map< ::rtl::OUString, sal_Int32, OUStringHashCode, ::std::equal_to< ::rtl::OUString > >
{
public:
inline void free() { NameToHandleMap().swap( *this ); }
};
-class EnumToHandleMap : public ::std::hash_map< sal_Int32, sal_Int32, std::hash< sal_Int32 >, std::equal_to< sal_Int32 > >
+class EnumToHandleMap : public ::boost::unordered_map< sal_Int32, sal_Int32, boost::hash< sal_Int32 >, std::equal_to< sal_Int32 > >
{
public:
inline void free() { EnumToHandleMap().swap( *this ); }
};
-class VarNameToEnumMap : public ::std::hash_map< OUString, VarNameProperty, OUStringHashCode, ::std::equal_to< OUString > >
+class VarNameToEnumMap : public ::boost::unordered_map< OUString, VarNameProperty, OUStringHashCode, ::std::equal_to< OUString > >
{
public:
inline void free() { VarNameToEnumMap().swap( *this ); }
@@ -263,51 +264,45 @@ static VarNameAttribute aVarNameAttribute[] =
{ SUBSTITUTE_PATH, VAR_NEEDS_SYSTEM_PATH }, // $(path)
};
-#if 0
-// currently unused
-static Sequence< OUString > GetPathPropertyNames()
-{
- const int nCount = sizeof( aPropNames ) / sizeof( PropertyStruct );
- Sequence< OUString > aNames( nCount );
- OUString* pNames = aNames.getArray();
- for ( int i = 0; i < nCount; i++ )
- pNames[i] = OUString::createFromAscii( aPropNames[i].pPropName );
-
- return aNames;
-}
-#endif
-
// class SvtPathOptions_Impl ---------------------------------------------
const String& SvtPathOptions_Impl::GetPath( SvtPathOptions::Pathes ePath )
{
- ::osl::MutexGuard aGuard( m_aMutex );
-
if ( ePath >= SvtPathOptions::PATH_COUNT )
return m_aEmptyString;
- OUString aPathValue;
- String aResult;
- sal_Int32 nHandle = m_aMapEnumToPropHandle[ (sal_Int32)ePath ];
-
- // Substitution is done by the service itself using the substition service
- Any a = m_xPathSettings->getFastPropertyValue( nHandle );
- a >>= aPathValue;
- if( ePath == SvtPathOptions::PATH_ADDIN ||
- ePath == SvtPathOptions::PATH_FILTER ||
- ePath == SvtPathOptions::PATH_HELP ||
- ePath == SvtPathOptions::PATH_MODULE ||
- ePath == SvtPathOptions::PATH_PLUGIN ||
- ePath == SvtPathOptions::PATH_STORAGE
- )
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ try
+ {
+ OUString aPathValue;
+ String aResult;
+ sal_Int32 nHandle = m_aMapEnumToPropHandle[ (sal_Int32)ePath ];
+
+ // Substitution is done by the service itself using the substition service
+ Any a = m_xPathSettings->getFastPropertyValue( nHandle );
+ a >>= aPathValue;
+ if( ePath == SvtPathOptions::PATH_ADDIN ||
+ ePath == SvtPathOptions::PATH_FILTER ||
+ ePath == SvtPathOptions::PATH_HELP ||
+ ePath == SvtPathOptions::PATH_MODULE ||
+ ePath == SvtPathOptions::PATH_PLUGIN ||
+ ePath == SvtPathOptions::PATH_STORAGE
+ )
+ {
+ // These office paths have to be converted to system pathes
+ utl::LocalFileHelper::ConvertURLToPhysicalName( aPathValue, aResult );
+ aPathValue = aResult;
+ }
+
+ m_aPathArray[ ePath ] = aPathValue;
+ return m_aPathArray[ ePath ];
+ }
+ catch (UnknownPropertyException &)
{
- // These office paths have to be converted to system pathes
- utl::LocalFileHelper::ConvertURLToPhysicalName( aPathValue, aResult );
- aPathValue = aResult;
}
- m_aPathArray[ ePath ] = aPathValue;
- return m_aPathArray[ ePath ];
+ return m_aEmptyString;
}
// -----------------------------------------------------------------------
sal_Bool SvtPathOptions_Impl::IsPathReadonly(SvtPathOptions::Pathes ePath)const
@@ -482,7 +477,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() :
if ( !m_xPathSettings.is() )
{
// #112719#: check for existance
- DBG_ERROR( "SvtPathOptions_Impl::SvtPathOptions_Impl(): #112719# happened again!" );
+ OSL_FAIL( "SvtPathOptions_Impl::SvtPathOptions_Impl(): #112719# happened again!" );
throw RuntimeException(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Service com.sun.star.util.PathSettings cannot be created" )),
Reference< XInterface >() );
@@ -530,7 +525,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() :
}
// Set language type!
- Any aLocale = ConfigManager::GetConfigManager()->GetDirectConfigProperty( ConfigManager::LOCALE );
+ Any aLocale = ConfigManager::GetConfigManager().GetDirectConfigProperty( ConfigManager::LOCALE );
OUString aLocaleStr;
if ( aLocale >>= aLocaleStr )
{
@@ -541,7 +536,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() :
}
else
{
- DBG_ERRORFILE( "wrong any type" );
+ DBG_ASSERT(!aLocale.hasValue(), "wrong any type");
m_aLocale.Language = OStringToOUString(OString("en"), RTL_TEXTENCODING_UTF8);
m_aLocale.Country = OStringToOUString(OString("US"), RTL_TEXTENCODING_UTF8);
m_aLocale.Variant = OStringToOUString(OString(""), RTL_TEXTENCODING_UTF8);
@@ -1060,50 +1055,4 @@ void SvtPathOptions::SetPath( SvtPathOptions::Pathes ePath, const String& rNewPa
pImp->SetPath(ePath, rNewPath);
}
-// class PathService -----------------------------------------------------
-#include <com/sun/star/frame/XConfigManager.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/implbase2.hxx>
-
-class PathService : public ::cppu::WeakImplHelper2< ::com::sun::star::frame::XConfigManager, ::com::sun::star::lang::XServiceInfo >
-{
- virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
- virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL
- getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
- virtual ::rtl::OUString SAL_CALL substituteVariables( const ::rtl::OUString& sText ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& sKeyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& sKeyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL flush( ) throw(::com::sun::star::uno::RuntimeException);
-};
-
-// class PathService -----------------------------------------------------
-
-void SAL_CALL PathService::addPropertyChangeListener( const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& ) throw(::com::sun::star::uno::RuntimeException) {}
-void SAL_CALL PathService::removePropertyChangeListener( const ::rtl::OUString&, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& ) throw(::com::sun::star::uno::RuntimeException) {}
-void SAL_CALL PathService::flush( ) throw(::com::sun::star::uno::RuntimeException) {}
-
-::rtl::OUString SAL_CALL PathService::substituteVariables( const ::rtl::OUString& sText ) throw(::com::sun::star::uno::RuntimeException)
-{
- return SvtPathOptions().SubstituteVariable( sText );
-}
-
-::rtl::OUString SAL_CALL PathService::getImplementationName( ) throw(::com::sun::star::uno::RuntimeException)
-{
- return OUString::createFromAscii("com.sun.star.comp.unotools.PathService");
-}
-
-sal_Bool SAL_CALL PathService::supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException)
-{
- if ( ServiceName.compareToAscii("com.sun.star.config.SpecialConfigManager") == COMPARE_EQUAL )
- return sal_True;
- else
- return sal_False;
-}
-
-::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL PathService::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException)
-{
- Sequence< OUString > aRet(1);
- *aRet.getArray() = OUString::createFromAscii("com.sun.star.config.SpecialConfigManager");
- return aRet;
-}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/printwarningoptions.cxx b/unotools/source/config/printwarningoptions.cxx
index d723b3c068d4..bf8b5738c818 100644
--- a/unotools/source/config/printwarningoptions.cxx
+++ b/unotools/source/config/printwarningoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/printwarningoptions.hxx>
#include <unotools/configmgr.hxx>
@@ -249,8 +244,8 @@ void SvtPrintWarningOptions_Impl::Notify( const Sequence< rtl::OUString >& )
//*****************************************************************************************************************
Sequence< OUString > SvtPrintWarningOptions_Impl::impl_GetPropertyNames()
{
- // Build static list of configuration key names.
- static const OUString pProperties[] =
+ // Build list of configuration key names.
+ const OUString pProperties[] =
{
PROPERTYNAME_PAPERSIZE,
PROPERTYNAME_PAPERORIENTATION,
@@ -260,7 +255,7 @@ Sequence< OUString > SvtPrintWarningOptions_Impl::impl_GetPropertyNames()
};
// Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
return seqPropertyNames;
}
@@ -395,27 +390,17 @@ void SvtPrintWarningOptions::SetModifyDocumentOnPrintingAllowed( sal_Bool bState
m_pDataContainer->SetModifyDocumentOnPrintingAllowed( bState ) ;
}
+namespace
+{
+ class thePrintWarningOptionsMutex : public rtl::Static<osl::Mutex, thePrintWarningOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtPrintWarningOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return thePrintWarningOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/regoptions.cxx b/unotools/source/config/regoptions.cxx
index 3e99cf2dd327..9b0550a8cdc5 100644
--- a/unotools/source/config/regoptions.cxx
+++ b/unotools/source/config/regoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,6 +35,7 @@
#include <osl/mutex.hxx>
#include <unotools/bootstrap.hxx>
#include <rtl/ustring.hxx>
+#include <rtl/instance.hxx>
//........................................................................
namespace utl
@@ -138,7 +140,7 @@ namespace utl
#define DECLARE_STATIC_LAZY_USTRING( name ) \
static const ::rtl::OUString& lcl_get##name##Name() \
{ \
- static const ::rtl::OUString sName = ::rtl::OUString::createFromAscii( #name ); \
+ static const ::rtl::OUString sName(RTL_CONSTASCII_USTRINGPARAM( #name )); \
return sName; \
}
@@ -195,20 +197,15 @@ namespace utl
sal_Bool RegOptionsImpl::s_bThisSessionDone = sal_False;
sal_Int32 RegOptionsImpl::s_nInstanceCount = 0;
+ namespace
+ {
+ class theRegOptionsImplMutex : public rtl::Static<osl::Mutex, theRegOptionsImplMutex>{};
+ }
+
//--------------------------------------------------------------------
::osl::Mutex& RegOptionsImpl::getStaticMutex()
{
- static ::osl::Mutex* s_pStaticMutex = NULL;
- if ( !s_pStaticMutex )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !s_pStaticMutex )
- {
- static ::osl::Mutex s_aStaticMutex;
- s_pStaticMutex = &s_aStaticMutex;
- }
- }
- return *s_pStaticMutex;
+ return theRegOptionsImplMutex::get();
}
//--------------------------------------------------------------------
@@ -258,13 +255,13 @@ namespace utl
// create the config node for all our registration information
m_aRegistrationNode = OConfigurationTreeRoot::createWithServiceFactory(
::comphelper::getProcessServiceFactory(),
- ::rtl::OUString::createFromAscii( "/org.openoffice.Office.Common/Help/Registration" )
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.Common/Help/Registration"))
);
// cache some data
//the URL to use for online registration
::rtl::OUString sStringValue;
- m_aRegistrationNode.getNodeValue( ::rtl::OUString::createFromAscii( "URL" ) ) >>= sStringValue;
+ m_aRegistrationNode.getNodeValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")) ) >>= sStringValue;
m_sRegistrationURL = sStringValue;
// the state of the dialog
@@ -548,3 +545,4 @@ namespace utl
} // namespace utl
//........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/saveopt.cxx b/unotools/source/config/saveopt.cxx
index 6a30149c555f..83aea5d7cc9f 100644
--- a/unotools/source/config/saveopt.cxx
+++ b/unotools/source/config/saveopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,9 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
#include <unotools/saveopt.hxx>
#include "rtl/instance.hxx"
#include <unotools/configmgr.hxx>
@@ -46,8 +44,10 @@
#include "itemholder1.hxx"
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+
+using ::rtl::OUString;
+
namespace css = ::com::sun::star;
class SvtSaveOptions_Impl;
@@ -421,7 +421,7 @@ Sequence< OUString > GetPropertyNames()
// -----------------------------------------------------------------------
SvtSaveOptions_Impl::SvtSaveOptions_Impl()
- : ConfigItem( OUString::createFromAscii("Office.Common/Save") )
+ : ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Save")) )
, nAutoSaveTime( 0 )
, bUseUserData( sal_False )
, bBackup( sal_False )
@@ -483,7 +483,7 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
if ( pValues[nProp] >>= nTemp )
nAutoSaveTime = nTemp;
else {
- DBG_ERROR( "Wrong Type!" );
+ OSL_FAIL( "Wrong Type!" );
};
bROAutoSaveTime = pROStates[nProp];
break;
@@ -584,7 +584,7 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
}
else
{
- DBG_ERROR( "Wrong Type!" );
+ OSL_FAIL( "Wrong Type!" );
}
}
}
@@ -596,21 +596,21 @@ SvtSaveOptions_Impl::SvtSaveOptions_Impl()
{
css::uno::Reference< css::uno::XInterface > xCFG = ::comphelper::ConfigurationHelper::openConfig(
::utl::getProcessServiceFactory(),
- ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery")),
::comphelper::ConfigurationHelper::E_READONLY);
::comphelper::ConfigurationHelper::readRelativeKey(
xCFG,
- ::rtl::OUString::createFromAscii("AutoSave"),
- ::rtl::OUString::createFromAscii("Enabled")) >>= bAutoSave;
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoSave")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Enabled"))) >>= bAutoSave;
::comphelper::ConfigurationHelper::readRelativeKey(
xCFG,
- ::rtl::OUString::createFromAscii("AutoSave"),
- ::rtl::OUString::createFromAscii("TimeIntervall")) >>= nAutoSaveTime;
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoSave")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TimeIntervall"))) >>= nAutoSaveTime;
}
catch(const css::uno::Exception&)
- { DBG_ERROR("Could not find needed informations for AutoSave feature."); }
+ { OSL_FAIL("Could not find needed informations for AutoSave feature."); }
}
SvtSaveOptions_Impl::~SvtSaveOptions_Impl()
@@ -783,19 +783,19 @@ void SvtSaveOptions_Impl::Commit()
css::uno::Reference< css::uno::XInterface > xCFG = ::comphelper::ConfigurationHelper::openConfig(
::utl::getProcessServiceFactory(),
- ::rtl::OUString::createFromAscii("org.openoffice.Office.Recovery"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Recovery")),
::comphelper::ConfigurationHelper::E_STANDARD);
::comphelper::ConfigurationHelper::writeRelativeKey(
xCFG,
- ::rtl::OUString::createFromAscii("AutoSave"),
- ::rtl::OUString::createFromAscii("TimeIntervall"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoSave")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("TimeIntervall")),
css::uno::makeAny(nAutoSaveTime));
::comphelper::ConfigurationHelper::writeRelativeKey(
xCFG,
- ::rtl::OUString::createFromAscii("AutoSave"),
- ::rtl::OUString::createFromAscii("Enabled"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoSave")),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Enabled")),
css::uno::makeAny(bAutoSave));
::comphelper::ConfigurationHelper::flush(xCFG);
@@ -827,7 +827,7 @@ public:
const sal_Char cUserDefinedSettings[] = "UserDefinedSettings";
SvtLoadOptions_Impl::SvtLoadOptions_Impl()
- : ConfigItem( OUString::createFromAscii("Office.Common/Load") )
+ : ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Load")) )
, bLoadUserDefinedSettings( sal_False )
{
Sequence< OUString > aNames(1);
@@ -1088,3 +1088,4 @@ sal_Bool SvtSaveOptions::IsReadOnly( SvtSaveOptions::EOption eOption ) const
return pImp->pSaveOpt->IsReadOnly(eOption);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/searchopt.cxx b/unotools/source/config/searchopt.cxx
index 9e09dcc96dac..800672c3ac95 100644
--- a/unotools/source/config/searchopt.cxx
+++ b/unotools/source/config/searchopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,13 +37,15 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Any.h>
#include <rtl/logfile.hxx>
+#include <sal/macros.h>
-using namespace rtl;
using namespace utl;
using namespace com::sun::star::uno;
using namespace com::sun::star::i18n;
+using ::rtl::OUString;
+
#define MAX_FLAGS_OFFSET 25
//////////////////////////////////////////////////////////////////////
@@ -81,7 +84,7 @@ public:
SvtSearchOptions_Impl::SvtSearchOptions_Impl() :
- ConfigItem( OUString::createFromAscii( "Office.Common/SearchOptions" ) )
+ ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/SearchOptions")) )
{
RTL_LOGFILE_CONTEXT(aLog, "unotools SvtSearchOptions_Impl::SvtSearchOptions_Impl()");
nFlags = 0x0003FFFF; // set all options values to 'true'
@@ -171,7 +174,7 @@ Sequence< OUString > SvtSearchOptions_Impl::GetPropertyNames() const
"IsNotes" // 25
};
- const int nCount = sizeof( aPropNames ) / sizeof( aPropNames[0] );
+ const int nCount = SAL_N_ELEMENTS( aPropNames );
Sequence< OUString > aNames( nCount );
OUString* pNames = aNames.getArray();
for (sal_Int32 i = 0; i < nCount; ++i)
@@ -213,18 +216,18 @@ sal_Bool SvtSearchOptions_Impl::Load()
SetFlag( i, bVal );
}
else {
- DBG_ERROR( "unexpected index" );
+ OSL_FAIL( "unexpected index" );
}
}
else
{
- DBG_ERROR( "unexpected type" );
+ OSL_FAIL( "unexpected type" );
bSucc = sal_False;
}
}
else
{
- DBG_ERROR( "value missing" );
+ OSL_FAIL( "value missing" );
bSucc = sal_False;
}
}
@@ -634,3 +637,4 @@ void SvtSearchOptions::SetNotes( sal_Bool bVal )
//////////////////////////////////////////////////////////////////////
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/securityoptions.cxx b/unotools/source/config/securityoptions.cxx
index 526e33d1917c..ef4689dc6922 100644
--- a/unotools/source/config/securityoptions.cxx
+++ b/unotools/source/config/securityoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/securityoptions.hxx>
#include <unotools/configmgr.hxx>
@@ -1029,7 +1024,7 @@ sal_Bool SvtSecurityOptions_Impl::IsOptionEnabled( SvtSecurityOptions::EOption e
Sequence< OUString > SvtSecurityOptions_Impl::GetPropertyNames()
{
// Build static list of configuration key names.
- static const OUString pProperties[] =
+ const OUString pProperties[] =
{
PROPERTYNAME_SECUREURL,
PROPERTYNAME_STAROFFICEBASIC,
@@ -1048,7 +1043,7 @@ Sequence< OUString > SvtSecurityOptions_Impl::GetPropertyNames()
PROPERTYNAME_MACRO_DISABLE
};
// Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
// ... and return it.
return seqPropertyNames;
}
@@ -1171,26 +1166,14 @@ bool SvtSecurityOptions::IsOptionEnabled( EOption eOption ) const
return m_pDataContainer->IsOptionEnabled( eOption );
}
+namespace
+{
+ class theSecurityOptionsMutex : public rtl::Static<osl::Mutex, theSecurityOptionsMutex>{};
+}
+
Mutex& SvtSecurityOptions::GetInitMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be faster then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theSecurityOptionsMutex::get();
}
@@ -1307,3 +1290,4 @@ EBasicSecurityMode SvtSecurityOptions::GetBasicMode() const
return m_pDataContainer->GetBasicMode();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/sourceviewconfig.cxx b/unotools/source/config/sourceviewconfig.cxx
index cb37db74138d..82b71fbceabb 100644
--- a/unotools/source/config/sourceviewconfig.cxx
+++ b/unotools/source/config/sourceviewconfig.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,8 +38,10 @@
#include <itemholder1.hxx>
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+
+using ::rtl::OUString;
+
namespace utl
{
class SourceViewConfig_Impl : public utl::ConfigItem
@@ -96,25 +99,19 @@ public:
SourceViewConfig_Impl* SourceViewConfig::m_pImplConfig = 0;
sal_Int32 SourceViewConfig::m_nRefCount = 0;
namespace { struct lclMutex : public rtl::Static< ::osl::Mutex, lclMutex > {}; }
-/* -----------------------------28.08.2002 16:45------------------------------
- ---------------------------------------------------------------------------*/
SourceViewConfig_Impl::SourceViewConfig_Impl() :
- ConfigItem(OUString::createFromAscii("Office.Common/Font/SourceViewFont")),
+ ConfigItem(OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Font/SourceViewFont"))),
m_nFontHeight(12),
m_bProportionalFontOnly(sal_False)
{
Load();
}
-/* -----------------------------28.08.2002 16:45------------------------------
- ---------------------------------------------------------------------------*/
SourceViewConfig_Impl::~SourceViewConfig_Impl()
{
}
-/* -----------------------------28.08.2002 16:25------------------------------
- ---------------------------------------------------------------------------*/
Sequence< OUString > SourceViewConfig_Impl::GetPropertyNames()
{
//this list needs exactly to mach the enum PropertyNameIndex
@@ -133,9 +130,6 @@ Sequence< OUString > SourceViewConfig_Impl::GetPropertyNames()
return aNames;
}
-/*-- 28.08.2002 16:37:59---------------------------------------------------
-
- -----------------------------------------------------------------------*/
void SourceViewConfig_Impl::Load()
{
Sequence< OUString > aNames = GetPropertyNames();
@@ -159,16 +153,12 @@ void SourceViewConfig_Impl::Load()
}
}
}
-/*-- 28.08.2002 16:38:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SourceViewConfig_Impl::Notify( const Sequence< OUString >& )
{
Load();
}
-/*-- 28.08.2002 16:38:00---------------------------------------------------
- -----------------------------------------------------------------------*/
void SourceViewConfig_Impl::Commit()
{
ClearModified();
@@ -190,9 +180,7 @@ void SourceViewConfig_Impl::Commit()
NotifyListeners(0);
}
-/*-- 28.08.2002 16:32:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SourceViewConfig::SourceViewConfig()
{
{
@@ -208,9 +196,7 @@ SourceViewConfig::SourceViewConfig()
m_pImplConfig->AddListener( this );
}
-/*-- 28.08.2002 16:32:19---------------------------------------------------
- -----------------------------------------------------------------------*/
SourceViewConfig::~SourceViewConfig()
{
m_pImplConfig->RemoveListener( this );
@@ -222,47 +208,37 @@ SourceViewConfig::~SourceViewConfig()
DELETEZ( m_pImplConfig );
}
}
-/*-- 28.08.2002 16:32:19---------------------------------------------------
- -----------------------------------------------------------------------*/
const OUString& SourceViewConfig::GetFontName() const
{
return m_pImplConfig->GetFontName();
}
-/*-- 28.08.2002 16:32:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SourceViewConfig::SetFontName(const OUString& rName)
{
m_pImplConfig->SetFontName(rName);
}
-/*-- 28.08.2002 16:32:20---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Int16 SourceViewConfig::GetFontHeight() const
{
return m_pImplConfig->GetFontHeight();
}
-/*-- 28.08.2002 16:32:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SourceViewConfig::SetFontHeight(sal_Int16 nHeight)
{
m_pImplConfig->SetFontHeight(nHeight);
}
-/*-- 28.08.2002 16:32:20---------------------------------------------------
- -----------------------------------------------------------------------*/
sal_Bool SourceViewConfig::IsShowProportionalFontsOnly() const
{
return m_pImplConfig->IsShowProportionalFontsOnly();
}
-/*-- 28.08.2002 16:32:20---------------------------------------------------
- -----------------------------------------------------------------------*/
void SourceViewConfig::SetShowProportionalFontsOnly(sal_Bool bSet)
{
m_pImplConfig->SetShowProportionalFontsOnly(bSet);
}
}
// namespace utl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/startoptions.cxx b/unotools/source/config/startoptions.cxx
index d6012c0ad84f..edeab14539c0 100644
--- a/unotools/source/config/startoptions.cxx
+++ b/unotools/source/config/startoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/startoptions.hxx>
#include <unotools/configmgr.hxx>
@@ -339,14 +334,14 @@ void SvtStartOptions_Impl::SetConnectionURL( const OUString& sURL )
//*****************************************************************************************************************
Sequence< OUString > SvtStartOptions_Impl::impl_GetPropertyNames()
{
- // Build static list of configuration key names.
- static const OUString pProperties[] =
+ // Build list of configuration key names.
+ const OUString pProperties[] =
{
PROPERTYNAME_SHOWINTRO ,
PROPERTYNAME_CONNECTIONURL ,
};
// Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
// ... and return it.
return seqPropertyNames;
}
@@ -432,27 +427,17 @@ void SvtStartOptions::SetConnectionURL( const OUString& sURL )
m_pDataContainer->SetConnectionURL( sURL );
}
+namespace
+{
+ class theStartOptionsMutex : public rtl::Static<osl::Mutex, theStartOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtStartOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theStartOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/syslocaleoptions.cxx b/unotools/source/config/syslocaleoptions.cxx
index 64ea0816d210..eb61d75f2483 100755..100644
--- a/unotools/source/config/syslocaleoptions.cxx
+++ b/unotools/source/config/syslocaleoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,10 +47,10 @@
using namespace osl;
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
+using ::rtl::OUString;
SvtSysLocaleOptions_Impl* SvtSysLocaleOptions::pOptions = NULL;
sal_Int32 SvtSysLocaleOptions::nRefCount = 0;
@@ -146,14 +147,14 @@ public:
const Sequence< OUString > SvtSysLocaleOptions_Impl::GetPropertyNames()
{
- static const OUString pProperties[] =
+ const OUString pProperties[] =
{
PROPERTYNAME_LOCALE,
PROPERTYNAME_UILOCALE,
PROPERTYNAME_CURRENCY,
PROPERTYNAME_DECIMALSEPARATOR
};
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
return seqPropertyNames;
}
@@ -182,7 +183,6 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl()
{
for ( sal_Int32 nProp = 0; nProp < aNames.getLength(); nProp++ )
{
- DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" );
if ( pValues[nProp].hasValue() )
{
switch ( nProp )
@@ -241,7 +241,6 @@ SvtSysLocaleOptions_Impl::SvtSysLocaleOptions_Impl()
}
}
}
-// UpdateMiscSettings_Impl();
EnableNotification( aNames );
}
@@ -272,19 +271,16 @@ void SvtSysLocaleOptions_Impl::MakeRealLocale()
void SvtSysLocaleOptions_Impl::MakeRealUILocale()
{
- if ( !m_aRealUILocale.Language.getLength() )
+ // as we can't switch UILocale at runtime, we only store changes in the configuration
+ m_aRealUILocale = lcl_str_to_locale( m_aUILocaleString );
+ if ( m_aRealUILocale.Language.getLength() )
{
- // as we can't switch UILocale at runtime, we only store changes in the configuration
- m_aRealUILocale = lcl_str_to_locale( m_aUILocaleString );
- if ( m_aRealUILocale.Language.getLength() )
- {
- m_eRealUILanguage = MsLangId::convertLocaleToLanguage( m_aRealUILocale );
- }
- else
- {
- m_eRealUILanguage = MsLangId::getSystemUILanguage();
- MsLangId::convertLanguageToLocale( m_eRealUILanguage, m_aRealUILocale );
- }
+ m_eRealUILanguage = MsLangId::convertLocaleToLanguage( m_aRealUILocale );
+ }
+ else
+ {
+ m_eRealUILanguage = MsLangId::getSystemUILanguage();
+ MsLangId::convertLanguageToLocale( m_eRealUILanguage, m_aRealUILocale );
}
}
@@ -398,13 +394,12 @@ void SvtSysLocaleOptions_Impl::SetUILocaleString( const OUString& rStr )
if (!m_bROUILocale && rStr != m_aUILocaleString )
{
m_aUILocaleString = rStr;
-/*
+
// as we can't switch UILocale at runtime, we only store changes in the configuration
MakeRealUILocale();
MsLangId::setConfiguredSystemLanguage( m_eRealUILanguage );
SetModified();
NotifyListeners( SYSLOCALEOPTIONS_HINT_UILOCALE );
-*/
}
}
@@ -577,19 +572,12 @@ void SvtSysLocaleOptions::SetCurrencyConfigString( const OUString& rStr )
pOptions->SetCurrencyString( rStr );
}
-
-
-/*-- 11.02.2004 13:31:41---------------------------------------------------
-
- -----------------------------------------------------------------------*/
sal_Bool SvtSysLocaleOptions::IsDecimalSeparatorAsLocale() const
{
MutexGuard aGuard( GetMutex() );
return pOptions->IsDecimalSeparatorAsLocale();
}
-/*-- 11.02.2004 13:31:41---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtSysLocaleOptions::SetDecimalSeparatorAsLocale( sal_Bool bSet)
{
MutexGuard aGuard( GetMutex() );
@@ -700,3 +688,4 @@ LanguageType SvtSysLocaleOptions::GetRealUILanguage() const
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/undoopt.cxx b/unotools/source/config/undoopt.cxx
index 25cb7837008f..3ae8aab68de0 100644
--- a/unotools/source/config/undoopt.cxx
+++ b/unotools/source/config/undoopt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,14 +36,14 @@
#include <tools/debug.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <osl/mutex.hxx>
#include <rtl/logfile.hxx>
#include "itemholder1.hxx"
using namespace utl;
-using namespace rtl;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
static SvtUndoOptions_Impl* pOptions = NULL;
static sal_Int32 nRefCount = 0;
@@ -68,7 +69,7 @@ public:
// -----------------------------------------------------------------------
SvtUndoOptions_Impl::SvtUndoOptions_Impl()
- : ConfigItem( OUString::createFromAscii("Office.Common/Undo") )
+ : ConfigItem( OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Common/Undo")) )
, nUndoCount( 20 )
{
Load();
@@ -119,7 +120,6 @@ void SvtUndoOptions_Impl::Load()
{
for ( int nProp = 0; nProp < m_aPropertyNames.getLength(); nProp++ )
{
- DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" );
if ( pValues[nProp].hasValue() )
{
switch ( nProp )
@@ -131,13 +131,13 @@ void SvtUndoOptions_Impl::Load()
nUndoCount = nTemp;
else
{
- DBG_ERROR( "Wrong Type!" );
+ OSL_FAIL( "Wrong Type!" );
}
break;
}
default:
- DBG_ERROR( "Wrong Type!" );
+ OSL_FAIL( "Wrong Type!" );
break;
}
}
@@ -199,3 +199,5 @@ sal_Int32 SvtUndoOptions::GetUndoCount() const
{
return pImp->GetUndoCount();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/useroptions.cxx b/unotools/source/config/useroptions.cxx
index 59f4a14548ca..11a781213b4c 100644
--- a/unotools/source/config/useroptions.cxx
+++ b/unotools/source/config/useroptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,7 +36,7 @@
#include <tools/debug.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
-#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
#include <rtl/instance.hxx>
#include <rtl/logfile.hxx>
#include "itemholder1.hxx"
@@ -54,9 +55,9 @@
#include <unotools/loghelper.hxx>
using namespace utl;
-using namespace rtl;
using namespace com::sun::star;
using namespace com::sun::star::uno;
+using ::rtl::OUString;
namespace css = ::com::sun::star;
@@ -145,30 +146,21 @@ static sal_Int32 nRefCount = 0;
#define READONLY_DEFAULT sal_False
-/*-- 16.06.2009 14:22:56---------------------------------------------------
-
- -----------------------------------------------------------------------*/
SvtUserConfigChangeListener_Impl::SvtUserConfigChangeListener_Impl(SvtUserOptions_Impl& rParent) :
m_rParent( rParent )
{
}
-/*-- 16.06.2009 14:22:56---------------------------------------------------
- -----------------------------------------------------------------------*/
SvtUserConfigChangeListener_Impl::~SvtUserConfigChangeListener_Impl()
{
}
-/*-- 16.06.2009 14:22:56---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtUserConfigChangeListener_Impl::changesOccurred( const util::ChangesEvent& rEvent ) throw(RuntimeException)
{
if(rEvent.Changes.getLength())
m_rParent.Notify();
}
-/*-- 16.06.2009 14:22:56---------------------------------------------------
- -----------------------------------------------------------------------*/
void SvtUserConfigChangeListener_Impl::disposing( const lang::EventObject& rSource ) throw(RuntimeException)
{
try
@@ -212,7 +204,7 @@ SvtUserOptions_Impl::SvtUserOptions_Impl() :
LogHelper::logIt(ex);
}
- Any aAny = ConfigManager::GetConfigManager()->GetDirectConfigProperty( ConfigManager::LOCALE );
+ Any aAny = ConfigManager::GetConfigManager().GetDirectConfigProperty( ConfigManager::LOCALE );
::rtl::OUString aLocale;
if ( aAny >>= aLocale )
m_aLocale = aLocale;
@@ -234,7 +226,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_so) >>= sCompany;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_so) >>= sCompany;
}
catch ( const css::uno::Exception& ex )
{
@@ -250,7 +243,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sgivenname) >>= sFirstName;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sgivenname) >>= sFirstName;
}
catch ( const css::uno::Exception& ex )
{
@@ -266,7 +260,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_ssn) >>= sLastName;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_ssn) >>= sLastName;
}
catch ( const css::uno::Exception& ex )
{
@@ -282,7 +277,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sinitials) >>= sID;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sinitials) >>= sID;
}
catch ( const css::uno::Exception& ex )
{
@@ -298,7 +294,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sstreet) >>= sStreet;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sstreet) >>= sStreet;
}
catch ( const css::uno::Exception& ex )
{
@@ -314,7 +311,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sl) >>= sCity;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sl) >>= sCity;
}
catch ( const css::uno::Exception& ex )
{
@@ -330,7 +328,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sst) >>= sState;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sst) >>= sState;
}
catch ( const css::uno::Exception& ex )
{
@@ -346,7 +345,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_spostalcode) >>= sZip;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_spostalcode) >>= sZip;
}
catch ( const css::uno::Exception& ex )
{
@@ -362,7 +362,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sc) >>= sCountry;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sc) >>= sCountry;
}
catch ( const css::uno::Exception& ex )
{
@@ -378,7 +379,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sposition) >>= sPosition;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sposition) >>= sPosition;
}
catch ( const css::uno::Exception& ex )
{
@@ -394,7 +396,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_stitle) >>= sTitle;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_stitle) >>= sTitle;
}
catch ( const css::uno::Exception& ex )
{
@@ -410,7 +413,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_shomephone) >>= sTelephoneHome;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_shomephone) >>= sTelephoneHome;
}
catch ( const css::uno::Exception& ex )
{
@@ -426,7 +430,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_stelephonenumber) >>= sTelephoneWork;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_stelephonenumber) >>= sTelephoneWork;
}
catch ( const css::uno::Exception& ex )
{
@@ -442,7 +447,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sfacsimiletelephonenumber) >>= sFax;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sfacsimiletelephonenumber) >>= sFax;
}
catch ( const css::uno::Exception& ex )
{
@@ -458,7 +464,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_smail) >>= sEmail;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_smail) >>= sEmail;
}
catch ( const css::uno::Exception& ex )
{
@@ -474,7 +481,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_scustomernumber) >>= sCustomerNumber;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_scustomernumber) >>= sCustomerNumber;
}
catch ( const css::uno::Exception& ex )
{
@@ -490,7 +498,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sfathersname) >>= sFathersName;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sfathersname) >>= sFathersName;
}
catch ( const css::uno::Exception& ex )
{
@@ -506,7 +515,8 @@ SvtUserOptions_Impl::~SvtUserOptions_Impl()
try
{
- m_xData->getPropertyValue(s_sapartment) >>= sApartment;
+ if (m_xData.is())
+ m_xData->getPropertyValue(s_sapartment) >>= sApartment;
}
catch ( const css::uno::Exception& ex )
{
@@ -520,7 +530,8 @@ void SvtUserOptions_Impl::SetCompany( const ::rtl::OUString& sCompany )
{
try
{
- m_xData->setPropertyValue(s_so, css::uno::makeAny(::rtl::OUString(sCompany)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_so, css::uno::makeAny(::rtl::OUString(sCompany)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -533,7 +544,8 @@ void SvtUserOptions_Impl::SetFirstName( const ::rtl::OUString& sFirstName )
{
try
{
- m_xData->setPropertyValue(s_sgivenname, css::uno::makeAny(::rtl::OUString(sFirstName)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sgivenname, css::uno::makeAny(::rtl::OUString(sFirstName)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -546,7 +558,8 @@ void SvtUserOptions_Impl::SetLastName( const ::rtl::OUString& sLastName )
{
try
{
- m_xData->setPropertyValue(s_ssn, css::uno::makeAny(::rtl::OUString(sLastName)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_ssn, css::uno::makeAny(::rtl::OUString(sLastName)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -558,7 +571,8 @@ void SvtUserOptions_Impl::SetID( const ::rtl::OUString& sID )
{
try
{
- m_xData->setPropertyValue(s_sinitials, css::uno::makeAny(::rtl::OUString(sID)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sinitials, css::uno::makeAny(::rtl::OUString(sID)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -571,7 +585,8 @@ void SvtUserOptions_Impl::SetStreet( const ::rtl::OUString& sStreet )
{
try
{
- m_xData->setPropertyValue(s_sstreet, css::uno::makeAny(::rtl::OUString(sStreet)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sstreet, css::uno::makeAny(::rtl::OUString(sStreet)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -584,7 +599,8 @@ void SvtUserOptions_Impl::SetCity( const ::rtl::OUString& sCity )
{
try
{
- m_xData->setPropertyValue(s_sl, css::uno::makeAny(::rtl::OUString(sCity)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sl, css::uno::makeAny(::rtl::OUString(sCity)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -597,7 +613,8 @@ void SvtUserOptions_Impl::SetState( const ::rtl::OUString& sState )
{
try
{
- m_xData->setPropertyValue(s_sst, css::uno::makeAny(::rtl::OUString(sState)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sst, css::uno::makeAny(::rtl::OUString(sState)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -610,7 +627,8 @@ void SvtUserOptions_Impl::SetZip( const ::rtl::OUString& sZip )
{
try
{
- m_xData->setPropertyValue(s_spostalcode, css::uno::makeAny(::rtl::OUString(sZip)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_spostalcode, css::uno::makeAny(::rtl::OUString(sZip)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -623,7 +641,8 @@ void SvtUserOptions_Impl::SetCountry( const ::rtl::OUString& sCountry )
{
try
{
- m_xData->setPropertyValue(s_sc, css::uno::makeAny(::rtl::OUString(sCountry)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sc, css::uno::makeAny(::rtl::OUString(sCountry)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -636,7 +655,8 @@ void SvtUserOptions_Impl::SetPosition( const ::rtl::OUString& sPosition )
{
try
{
- m_xData->setPropertyValue(s_sposition, css::uno::makeAny(::rtl::OUString(sPosition)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sposition, css::uno::makeAny(::rtl::OUString(sPosition)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -649,7 +669,8 @@ void SvtUserOptions_Impl::SetTitle( const ::rtl::OUString& sTitle )
{
try
{
- m_xData->setPropertyValue(s_stitle, css::uno::makeAny(::rtl::OUString(sTitle)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_stitle, css::uno::makeAny(::rtl::OUString(sTitle)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -662,7 +683,8 @@ void SvtUserOptions_Impl::SetTelephoneHome( const ::rtl::OUString& sTelephoneHom
{
try
{
- m_xData->setPropertyValue(s_shomephone, css::uno::makeAny(::rtl::OUString(sTelephoneHome)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_shomephone, css::uno::makeAny(::rtl::OUString(sTelephoneHome)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -675,7 +697,8 @@ void SvtUserOptions_Impl::SetTelephoneWork( const ::rtl::OUString& sTelephoneWor
{
try
{
- m_xData->setPropertyValue(s_stelephonenumber, css::uno::makeAny(::rtl::OUString(sTelephoneWork)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_stelephonenumber, css::uno::makeAny(::rtl::OUString(sTelephoneWork)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -688,7 +711,8 @@ void SvtUserOptions_Impl::SetFax( const ::rtl::OUString& sFax )
{
try
{
- m_xData->setPropertyValue(s_sfacsimiletelephonenumber, css::uno::makeAny(::rtl::OUString(sFax)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sfacsimiletelephonenumber, css::uno::makeAny(::rtl::OUString(sFax)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -701,7 +725,8 @@ void SvtUserOptions_Impl::SetEmail( const ::rtl::OUString& sEmail )
{
try
{
- m_xData->setPropertyValue(s_smail, css::uno::makeAny(::rtl::OUString(sEmail)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_smail, css::uno::makeAny(::rtl::OUString(sEmail)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -714,7 +739,8 @@ void SvtUserOptions_Impl::SetCustomerNumber( const ::rtl::OUString& sCustomerNum
{
try
{
- m_xData->setPropertyValue(s_scustomernumber, css::uno::makeAny(::rtl::OUString(sCustomerNumber)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_scustomernumber, css::uno::makeAny(::rtl::OUString(sCustomerNumber)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -727,7 +753,8 @@ void SvtUserOptions_Impl::SetFathersName( const ::rtl::OUString& sFathersName )
{
try
{
- m_xData->setPropertyValue(s_sfathersname, css::uno::makeAny(::rtl::OUString(sFathersName)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sfathersname, css::uno::makeAny(::rtl::OUString(sFathersName)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -740,7 +767,8 @@ void SvtUserOptions_Impl::SetApartment( const ::rtl::OUString& sApartment )
{
try
{
- m_xData->setPropertyValue(s_sapartment, css::uno::makeAny(::rtl::OUString(sApartment)));
+ if (m_xData.is())
+ m_xData->setPropertyValue(s_sapartment, css::uno::makeAny(::rtl::OUString(sApartment)));
::comphelper::ConfigurationHelper::flush(m_xCfg);
}
catch ( const css::uno::Exception& ex)
@@ -758,7 +786,7 @@ void SvtUserOptions_Impl::SetApartment( const ::rtl::OUString& sApartment )
sFullName = GetFirstName();
sFullName.trim();
if ( sFullName.getLength() )
- sFullName += ::rtl::OUString::createFromAscii(" ");
+ sFullName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" "));
sFullName += GetLastName();
sFullName.trim();
@@ -957,27 +985,14 @@ SvtUserOptions::~SvtUserOptions()
// -----------------------------------------------------------------------
+namespace
+{
+ class theUserOptionsMutex : public rtl::Static<osl::Mutex, theUserOptionsMutex>{};
+}
+
::osl::Mutex& SvtUserOptions::GetInitMutex()
{
- // Initialize static mutex only for one time!
- static ::osl::Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if ( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- // We must check our pointer again -
- // because another instance of our class will be faster then this instance!
- if ( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static ::osl::Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theUserOptionsMutex::get();
}
// -----------------------------------------------------------------------
@@ -1295,3 +1310,5 @@ sal_Bool SvtUserOptions::IsTokenReadonly( sal_uInt16 nToken ) const
::osl::MutexGuard aGuard( GetInitMutex() );
return pImp->GetToken( nToken );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/viewoptions.cxx b/unotools/source/config/viewoptions.cxx
index f76ce48eebdf..9fe4aba17ed7 100644
--- a/unotools/source/config/viewoptions.cxx
+++ b/unotools/source/config/viewoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,7 +35,7 @@
#include <unotools/viewoptions.hxx>
#include <com/sun/star/uno/Any.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
@@ -103,7 +104,6 @@ namespace css = ::com::sun::star;
sMsg.appendAscii("Unexpected exception catched. Original message was:\n\"" ); \
sMsg.append (SVTVIEWOPTIONS_LOG_UNEXPECTED_EXCEPTION_PARAM_EXCEPTION.Message); \
sMsg.appendAscii("\"" ); \
- OSL_ENSURE(sal_False, ::rtl::OUStringToOString(sMsg.makeStringAndClear(), RTL_TEXTENCODING_UTF8).getStr()); \
}
//_________________________________________________________________________________________________________________
@@ -272,7 +272,7 @@ struct IMPL_TStringHashCode
}
};
-typedef ::std::hash_map< ::rtl::OUString ,
+typedef ::boost::unordered_map< ::rtl::OUString ,
IMPL_TViewData ,
IMPL_TStringHashCode ,
::std::equal_to< ::rtl::OUString > > IMPL_TViewHash;
@@ -859,7 +859,7 @@ SvtViewOptions::SvtViewOptions( EViewType eType ,
}
}
break;
- default : OSL_ENSURE( sal_False, "SvtViewOptions::SvtViewOptions()\nThese view type is unknown! All following calls at these instance will do nothing!\n" );
+ default : OSL_FAIL( "SvtViewOptions::SvtViewOptions()\nThese view type is unknown! All following calls at these instance will do nothing!\n" );
}
}
@@ -1225,29 +1225,17 @@ void SvtViewOptions::SetUserItem( const ::rtl::OUString& sName ,
}
}
+namespace
+{
+ class theViewOptionsMutex : public rtl::Static<osl::Mutex, theViewOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
::osl::Mutex& SvtViewOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static ::osl::Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static ::osl::Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theViewOptionsMutex::get();
}
void SvtViewOptions::AcquireOptions()
@@ -1299,3 +1287,5 @@ void SvtViewOptions::ReleaseOptions()
m_pDataContainer_Windows = NULL;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/workingsetoptions.cxx b/unotools/source/config/workingsetoptions.cxx
index aebac3377510..e465ac439981 100644
--- a/unotools/source/config/workingsetoptions.cxx
+++ b/unotools/source/config/workingsetoptions.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,12 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
-
-//_________________________________________________________________________________________________________________
-// includes
-//_________________________________________________________________________________________________________________
#include <unotools/workingsetoptions.hxx>
#include <unotools/configmgr.hxx>
@@ -295,13 +290,13 @@ void SvtWorkingSetOptions_Impl::SetWindowList( const Sequence< OUString >& seqWi
//*****************************************************************************************************************
Sequence< OUString > SvtWorkingSetOptions_Impl::GetPropertyNames()
{
- // Build static list of configuration key names.
- static const OUString pProperties[] =
+ // Build list of configuration key names.
+ const OUString pProperties[] =
{
PROPERTYNAME_WINDOWLIST ,
};
// Initialize return sequence with these list ...
- static const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
+ const Sequence< OUString > seqPropertyNames( pProperties, PROPERTYCOUNT );
// ... and return it.
return seqPropertyNames;
}
@@ -367,27 +362,17 @@ void SvtWorkingSetOptions::SetWindowList( const Sequence< OUString >& seqWindowL
m_pDataContainer->SetWindowList( seqWindowList );
}
+namespace
+{
+ class theWorkingSetOptionsMutex : public rtl::Static<osl::Mutex, theWorkingSetOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtWorkingSetOptions::GetOwnStaticMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theWorkingSetOptionsMutex::get();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/config/xmlaccelcfg.cxx b/unotools/source/config/xmlaccelcfg.cxx
index a446c60bbdc5..fbf33a889ca5 100644
--- a/unotools/source/config/xmlaccelcfg.cxx
+++ b/unotools/source/config/xmlaccelcfg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,10 +35,11 @@
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <cppuhelper/implbase1.hxx>
-using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::xml::sax;
+using ::rtl::OUString;
+
#define ELEMENT_ACCELERATORLIST "acceleratorlist"
#define ELEMENT_ACCELERATORITEM "item"
@@ -376,7 +378,7 @@ void OWriteAccelatorDocumentHandler::WriteAcceleratorDocument()
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
std::list< SvtAcceleratorConfigItem>::const_iterator p;
- for ( p = m_aWriteAcceleratorList.begin(); p != m_aWriteAcceleratorList.end(); p++ )
+ for ( p = m_aWriteAcceleratorList.begin(); p != m_aWriteAcceleratorList.end(); ++p )
WriteAcceleratorItem( *p );
m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_ACCELERATORLIST )) );
@@ -413,3 +415,5 @@ void OWriteAccelatorDocumentHandler::WriteAcceleratorItem(
m_xWriteDocumentHandler->ignorableWhitespace( OUString() );
m_xWriteDocumentHandler->endElement( OUString( RTL_CONSTASCII_USTRINGPARAM( ELEMENT_ACCELERATORITEM )) );
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/calendarwrapper.cxx b/unotools/source/i18n/calendarwrapper.cxx
index ebf8146ef0fa..add5d6733938 100644
--- a/unotools/source/i18n/calendarwrapper.cxx
+++ b/unotools/source/i18n/calendarwrapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <tools/string.hxx>
#include <tools/debug.hxx>
-#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_
#include <comphelper/componentfactory.hxx>
-#endif
#include <com/sun/star/i18n/CalendarFieldIndex.hpp>
#include <com/sun/star/i18n/XExtendedCalendar.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -678,3 +677,4 @@ String CalendarWrapper::getDisplayString( sal_Int32 nCalendarDisplayCode, sal_In
return String();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/caserotate.cxx b/unotools/source/i18n/caserotate.cxx
new file mode 100644
index 000000000000..85d820212e77
--- /dev/null
+++ b/unotools/source/i18n/caserotate.cxx
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (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.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * Caolán McNamara <caolanm@redhat.com>
+ *
+ * Contributor(s):
+ * Caolán McNamara <caolanm@redhat.com>
+ * Dózsa Bálint <dozsa@linux-dugf.site>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_unotools.hxx"
+
+#include "unotools/caserotate.hxx"
+#include <com/sun/star/i18n/TransliterationModules.hpp>
+#include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
+
+//TODO Use XCharacterClassification::getStringType to determine the current
+//(possibly mixed) case type and rotate to the next one
+
+sal_uInt32 RotateTransliteration::getNextMode()
+{
+ using namespace ::com::sun::star::i18n;
+
+ sal_uInt32 nMode = 0;
+
+ switch (nF3ShiftCounter)
+ {
+ case 0:
+ nMode = TransliterationModulesExtra::TITLE_CASE;
+ break;
+ case 1:
+ nMode = TransliterationModules_LOWERCASE_UPPERCASE;
+ break;
+ default:
+ case 2:
+ nMode = TransliterationModules_UPPERCASE_LOWERCASE;
+ nF3ShiftCounter = -1;
+ break;
+ }
+
+ nF3ShiftCounter++;
+
+ return nMode;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx
index e82fd7a603ad..d4a9be17929a 100644
--- a/unotools/source/i18n/charclass.cxx
+++ b/unotools/source/i18n/charclass.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,9 +33,7 @@
#include <tools/string.hxx>
#include <tools/debug.hxx>
-#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_
#include <comphelper/componentfactory.hxx>
-#endif
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -62,7 +61,7 @@ CharClass::CharClass(
::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( CHARCLASS_SERVICENAME ) ) ),
uno::UNO_QUERY );
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "CharClass ctor: Exception caught!" );
}
@@ -102,7 +101,7 @@ void CharClass::getComponentInstance()
x >>= xCC;
}
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "getComponentInstance: Exception caught!" );
}
@@ -187,7 +186,7 @@ sal_Bool CharClass::isAlpha( const String& rStr, xub_StrLen nPos ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isAlpha: Exception caught!" );
return sal_False;
@@ -204,7 +203,7 @@ sal_Bool CharClass::isAlpha( const String& rStr ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isAlpha: Exception caught!" );
return sal_False;
@@ -226,7 +225,7 @@ sal_Bool CharClass::isLetter( const String& rStr, xub_StrLen nPos ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isLetter: Exception caught!" );
return sal_False;
@@ -243,7 +242,7 @@ sal_Bool CharClass::isLetter( const String& rStr ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isLetter: Exception caught!" );
return sal_False;
@@ -265,7 +264,7 @@ sal_Bool CharClass::isDigit( const String& rStr, xub_StrLen nPos ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isDigit: Exception caught!" );
return sal_False;
@@ -282,7 +281,7 @@ sal_Bool CharClass::isNumeric( const String& rStr ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isNumeric: Exception caught!" );
return sal_False;
@@ -304,7 +303,7 @@ sal_Bool CharClass::isAlphaNumeric( const String& rStr, xub_StrLen nPos ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isAlphaNumeric: Exception caught!" );
return sal_False;
@@ -321,7 +320,7 @@ sal_Bool CharClass::isAlphaNumeric( const String& rStr ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isAlphaNumeric: Exception caught!" );
return sal_False;
@@ -343,7 +342,7 @@ sal_Bool CharClass::isLetterNumeric( const String& rStr, xub_StrLen nPos ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isLetterNumeric: Exception caught!" );
return sal_False;
@@ -360,7 +359,7 @@ sal_Bool CharClass::isLetterNumeric( const String& rStr ) const
else
return sal_False;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "isLetterNumeric: Exception caught!" );
return sal_False;
@@ -389,7 +388,7 @@ String CharClass::toTitle( const String& rStr, xub_StrLen nPos, xub_StrLen nCoun
else
return rStr.Copy( nPos, nCount );
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "toTitle: Exception caught!" );
return rStr.Copy( nPos, nCount );
@@ -406,7 +405,7 @@ String CharClass::toTitle( const String& rStr, xub_StrLen nPos, xub_StrLen nCoun
else
return rStr.copy( nPos, nCount );
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "toUpper: Exception caught!" );
return rStr.copy( nPos, nCount );
@@ -423,7 +422,7 @@ String CharClass::toTitle( const String& rStr, xub_StrLen nPos, xub_StrLen nCoun
else
return rStr.copy( nPos, nCount );
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "toLower: Exception caught!" );
return rStr.copy( nPos, nCount );
@@ -440,7 +439,7 @@ sal_Int16 CharClass::getType( const String& rStr, xub_StrLen nPos ) const
else
return 0;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "getType: Exception caught!" );
return 0;
@@ -457,7 +456,7 @@ sal_Int16 CharClass::getCharacterDirection( const String& rStr, xub_StrLen nPos
else
return 0;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "getCharacterDirection: Exception caught!" );
return 0;
@@ -474,7 +473,7 @@ sal_Int16 CharClass::getScript( const String& rStr, xub_StrLen nPos ) const
else
return 0;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "getScript: Exception caught!" );
return 0;
@@ -491,7 +490,7 @@ sal_Int32 CharClass::getCharacterType( const String& rStr, xub_StrLen nPos ) con
else
return 0;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "getCharacterType: Exception caught!" );
return 0;
@@ -508,7 +507,7 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
else
return 0;
}
- catch ( Exception& )
+ catch ( const Exception& )
{
DBG_ERRORFILE( "getStringType: Exception caught!" );
return 0;
@@ -533,7 +532,7 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
else
return ParseResult();
}
- catch ( Exception& e )
+ catch ( const Exception& e )
{
#ifdef DBG_UTIL
ByteString aMsg( "parseAnyToken: Exception caught\n" );
@@ -565,7 +564,7 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
else
return ParseResult();
}
- catch ( Exception& e )
+ catch ( const Exception& e )
{
#ifdef DBG_UTIL
ByteString aMsg( "parsePredefinedToken: Exception caught\n" );
@@ -580,3 +579,4 @@ sal_Int32 CharClass::getStringType( const String& rStr, xub_StrLen nPos, xub_Str
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/collatorwrapper.cxx b/unotools/source/i18n/collatorwrapper.cxx
index f4d679607424..58f0b1764914 100644
--- a/unotools/source/i18n/collatorwrapper.cxx
+++ b/unotools/source/i18n/collatorwrapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,9 +31,7 @@
#include <unotools/collatorwrapper.hxx>
#include <tools/debug.hxx>
-#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_
#include <comphelper/componentfactory.hxx>
-#endif
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -212,3 +211,5 @@ CollatorWrapper::loadCollatorAlgorithmWithEndUserOption (
DBG_ERRORFILE ("CollatorWrapper: loadCollatorAlgorithmWithEndUserOption failed");
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/intlwrapper.cxx b/unotools/source/i18n/intlwrapper.cxx
index aa20045eb17f..f98d6828efb3 100644
--- a/unotools/source/i18n/intlwrapper.cxx
+++ b/unotools/source/i18n/intlwrapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,3 +109,5 @@ void IntlWrapper::ImplNewCollator( sal_Bool bCaseSensitive ) const
((IntlWrapper*)this)->pCollator = p;
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/localedatawrapper.cxx b/unotools/source/i18n/localedatawrapper.cxx
index 1ae7d1c7e0f0..656453dde274 100644
--- a/unotools/source/i18n/localedatawrapper.cxx
+++ b/unotools/source/i18n/localedatawrapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,9 +40,7 @@
#include <tools/debug.hxx>
#include <i18npool/mslangid.hxx>
-#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_
#include <comphelper/componentfactory.hxx>
-#endif
#include <unotools/processfactory.hxx>
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -50,10 +49,9 @@
#include <com/sun/star/i18n/CalendarFieldIndex.hpp>
#include <com/sun/star/i18n/CalendarDisplayIndex.hpp>
-#ifndef _COM_SUN_STAR_I18N_NUMBERFORMATINDEX_HPP_
#include <com/sun/star/i18n/NumberFormatIndex.hdl>
-#endif
#include <rtl/instance.hxx>
+#include <sal/macros.h>
#define LOCALEDATA_LIBRARYNAME "i18npool"
#define LOCALEDATA_SERVICENAME "com.sun.star.i18n.LocaleData"
@@ -1402,18 +1400,14 @@ sal_Unicode* LocaleDataWrapper::ImplAddFormatNum( sal_Unicode* pBuf,
sal_Unicode* pNumBuf;
sal_uInt16 nNumLen;
sal_uInt16 i = 0;
- sal_Bool bNeg;
// negative number
if ( nNumber < 0 )
{
nNumber *= -1;
- bNeg = sal_True;
*pBuf = '-';
pBuf++;
}
- else
- bNeg = sal_False;
// convert number
pNumBuf = ImplAddUNum( aNumBuf, (sal_uInt64)nNumber );
@@ -1598,11 +1592,6 @@ String LocaleDataWrapper::getTime( const Time& rTime, sal_Bool bSec, sal_Bool b1
else
aStr += getTimeAM();
}
-#if 0
-//!TODO: do we need a time string? like "o'clock" or "Uhr" or similar
- else
- aStr += getTimeStr();
-#endif
return aStr;
}
@@ -1744,7 +1733,7 @@ String LocaleDataWrapper::getCurr( sal_Int64 nNumber, sal_uInt16 nDecimals,
new sal_Unicode[nGuess + 16]);
sal_Unicode* const pBuffer =
- ((size_t(rCurrencySymbol.Len()) + nGuess + 20) < sizeof(aBuf)/sizeof(aBuf[0]) ? aBuf :
+ ((size_t(rCurrencySymbol.Len()) + nGuess + 20) < SAL_N_ELEMENTS(aBuf) ? aBuf :
new sal_Unicode[ rCurrencySymbol.Len() + nGuess + 20 ]);
sal_Unicode* pBuf = pBuffer;
@@ -1970,7 +1959,7 @@ void LocaleDataWrapper::outputCheckMessage( const char* pStr )
{
fprintf( stderr, "\n%s\n", pStr);
fflush( stderr);
- DBG_ERROR( pStr);
+ OSL_TRACE("%s", pStr);
}
@@ -2005,3 +1994,5 @@ void LocaleDataWrapper::evaluateLocaleDataChecking()
OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/nativenumberwrapper.cxx b/unotools/source/i18n/nativenumberwrapper.cxx
index f6df87615c6c..71e74fd0c249 100644
--- a/unotools/source/i18n/nativenumberwrapper.cxx
+++ b/unotools/source/i18n/nativenumberwrapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <unotools/nativenumberwrapper.hxx>
#include <tools/debug.hxx>
-#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_
#include <comphelper/componentfactory.hxx>
-#endif
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -168,3 +167,4 @@ NativeNumberWrapper::convertFromXmlAttributes(
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/numberformatcodewrapper.cxx b/unotools/source/i18n/numberformatcodewrapper.cxx
index 2638e6730164..116c64f9fc70 100644
--- a/unotools/source/i18n/numberformatcodewrapper.cxx
+++ b/unotools/source/i18n/numberformatcodewrapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -31,9 +32,7 @@
#include <unotools/numberformatcodewrapper.hxx>
#include <tools/debug.hxx>
-#ifndef _COMPHELPER_COMPONENTFACTORY_HXX_
#include <comphelper/componentfactory.hxx>
-#endif
#include <com/sun/star/uno/XInterface.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -168,3 +167,5 @@ NumberFormatCodeWrapper::getAllFormatCodes() const
}
return ::com::sun::star::uno::Sequence< ::com::sun::star::i18n::NumberFormatCode > (0);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/readwritemutexguard.cxx b/unotools/source/i18n/readwritemutexguard.cxx
index 6adc5bab14bf..c6e17024e6ea 100644
--- a/unotools/source/i18n/readwritemutexguard.cxx
+++ b/unotools/source/i18n/readwritemutexguard.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -118,3 +119,5 @@ void ReadWriteGuard::changeReadToWrite()
}
} // namespace utl
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index c40654ebef1f..abf2ce5af79e 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,13 +30,8 @@
#include "precompiled_unotools.hxx"
#include <i18npool/mslangid.hxx>
#include <tools/debug.hxx>
-#ifndef _INTN_HXX //autogen
-//#include <tools/intn.hxx>
-#endif
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#ifndef _COM_SUN_STAR_UTIL_SEARCHFLAGS_HDL_
#include <com/sun/star/util/SearchFlags.hdl>
-#endif
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <unotools/charclass.hxx>
#include <comphelper/processfactory.hxx>
@@ -405,3 +401,4 @@ void TextSearch::ReplaceBackReferences( String& rReplaceStr, const String &rStr,
} // namespace utl
// ............................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/i18n/transliterationwrapper.cxx b/unotools/source/i18n/transliterationwrapper.cxx
index a10a52802e19..82b8492f80ce 100644
--- a/unotools/source/i18n/transliterationwrapper.cxx
+++ b/unotools/source/i18n/transliterationwrapper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -343,3 +344,5 @@ sal_Bool TransliterationWrapper::isMatch( const String& rStr1, const String& rSt
rStr2, 0, rStr2.Len(), nMatch2 );
return (nMatch1 <= nMatch2) && (nMatch1 == rStr1.Len());
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/atom.cxx b/unotools/source/misc/atom.cxx
index 3d7ccd1dd10e..d8bf5bbfa053 100644
--- a/unotools/source/misc/atom.cxx
+++ b/unotools/source/misc/atom.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -46,7 +47,7 @@ AtomProvider::~AtomProvider()
int AtomProvider::getAtom( const ::rtl::OUString& rString, sal_Bool bCreate )
{
- ::std::hash_map< ::rtl::OUString, int, ::rtl::OUStringHash >::iterator it = m_aAtomMap.find( rString );
+ ::boost::unordered_map< ::rtl::OUString, int, ::rtl::OUStringHash >::iterator it = m_aAtomMap.find( rString );
if( it != m_aAtomMap.end() )
return it->second;
if( ! bCreate )
@@ -60,7 +61,7 @@ int AtomProvider::getAtom( const ::rtl::OUString& rString, sal_Bool bCreate )
void AtomProvider::getAll( ::std::list< ::utl::AtomDescription >& atoms )
{
atoms.clear();
- ::std::hash_map< ::rtl::OUString, int, ::rtl::OUStringHash >::const_iterator it = m_aAtomMap.begin();
+ ::boost::unordered_map< ::rtl::OUString, int, ::rtl::OUStringHash >::const_iterator it = m_aAtomMap.begin();
::utl::AtomDescription aDesc;
while( it != m_aAtomMap.end() )
@@ -76,7 +77,7 @@ void AtomProvider::getRecent( int atom, ::std::list< ::utl::AtomDescription >& a
{
atoms.clear();
- ::std::hash_map< ::rtl::OUString, int, ::rtl::OUStringHash >::const_iterator it = m_aAtomMap.begin();
+ ::boost::unordered_map< ::rtl::OUString, int, ::rtl::OUStringHash >::const_iterator it = m_aAtomMap.begin();
::utl::AtomDescription aDesc;
while( it != m_aAtomMap.end() )
@@ -94,7 +95,7 @@ void AtomProvider::getRecent( int atom, ::std::list< ::utl::AtomDescription >& a
const ::rtl::OUString& AtomProvider::getString( int nAtom ) const
{
static ::rtl::OUString aEmpty;
- ::std::hash_map< int, ::rtl::OUString, ::std::hash< int > >::const_iterator it = m_aStringMap.find( nAtom );
+ ::boost::unordered_map< int, ::rtl::OUString, ::boost::hash< int > >::const_iterator it = m_aStringMap.find( nAtom );
return it == m_aStringMap.end() ? aEmpty : it->second;
}
@@ -120,14 +121,14 @@ MultiAtomProvider::MultiAtomProvider()
MultiAtomProvider::~MultiAtomProvider()
{
- for( ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::iterator it = m_aAtomLists.begin(); it != m_aAtomLists.end(); ++it )
+ for( ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::iterator it = m_aAtomLists.begin(); it != m_aAtomLists.end(); ++it )
delete it->second;
}
sal_Bool MultiAtomProvider::insertAtomClass( int atomClass )
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
return sal_False;
@@ -137,7 +138,7 @@ sal_Bool MultiAtomProvider::insertAtomClass( int atomClass )
int MultiAtomProvider::getAtom( int atomClass, const ::rtl::OUString& rString, sal_Bool bCreate )
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
return it->second->getAtom( rString, bCreate );
@@ -153,7 +154,7 @@ int MultiAtomProvider::getAtom( int atomClass, const ::rtl::OUString& rString, s
int MultiAtomProvider::getLastAtom( int atomClass ) const
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it =
m_aAtomLists.find( atomClass );
return it != m_aAtomLists.end() ? it->second->getLastAtom() : INVALID_ATOM;
@@ -161,7 +162,7 @@ int MultiAtomProvider::getLastAtom( int atomClass ) const
void MultiAtomProvider::getRecent( int atomClass, int atom, ::std::list< ::utl::AtomDescription >& atoms )
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
it->second->getRecent( atom, atoms );
@@ -171,7 +172,7 @@ void MultiAtomProvider::getRecent( int atomClass, int atom, ::std::list< ::utl::
const ::rtl::OUString& MultiAtomProvider::getString( int atomClass, int atom ) const
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it =
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it =
m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
return it->second->getString( atom );
@@ -182,13 +183,13 @@ const ::rtl::OUString& MultiAtomProvider::getString( int atomClass, int atom ) c
sal_Bool MultiAtomProvider::hasAtom( int atomClass, int atom ) const
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
return it != m_aAtomLists.end() ? it->second->hasAtom( atom ) : sal_False;
}
void MultiAtomProvider::getClass( int atomClass, ::std::list< ::utl::AtomDescription >& atoms) const
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
if( it != m_aAtomLists.end() )
it->second->getAll( atoms );
@@ -198,7 +199,7 @@ void MultiAtomProvider::getClass( int atomClass, ::std::list< ::utl::AtomDescrip
void MultiAtomProvider::overrideAtom( int atomClass, int atom, const ::rtl::OUString& description )
{
- ::std::hash_map< int, AtomProvider*, ::std::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
+ ::boost::unordered_map< int, AtomProvider*, ::boost::hash< int > >::const_iterator it = m_aAtomLists.find( atomClass );
if( it == m_aAtomLists.end() )
m_aAtomLists[ atomClass ] = new AtomProvider();
m_aAtomLists[ atomClass ]->overrideAtom( atom, description );
@@ -381,3 +382,5 @@ void AtomClient::updateAtomClasses( const Sequence< sal_Int32 >& atomClasses )
m_aProvider.overrideAtom( nClass, pDesc->atom, pDesc->description );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/componentresmodule.cxx b/unotools/source/misc/componentresmodule.cxx
index 21c50d9ec7f1..ea99f394aadf 100644
--- a/unotools/source/misc/componentresmodule.cxx
+++ b/unotools/source/misc/componentresmodule.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -144,3 +145,5 @@ namespace utl
//........................................................................
} // namespace utl
//........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/datetime.cxx b/unotools/source/misc/datetime.cxx
index 6bfd053b3fe9..428cc05f3cb3 100644
--- a/unotools/source/misc/datetime.cxx
+++ b/unotools/source/misc/datetime.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -119,3 +120,4 @@ sal_Bool operator ==(const starutil::Time& _rLeft, const starutil::Time& _rRi
} // namespace utl
//.........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/desktopterminationobserver.cxx b/unotools/source/misc/desktopterminationobserver.cxx
index 3900449f03c9..b9f457792dde 100644
--- a/unotools/source/misc/desktopterminationobserver.cxx
+++ b/unotools/source/misc/desktopterminationobserver.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -122,7 +123,7 @@ namespace utl
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "OObserverImpl::ensureObservation: caught an exception!" );
+ OSL_FAIL( "OObserverImpl::ensureObservation: caught an exception!" );
}
}
@@ -229,3 +230,4 @@ namespace utl
} // namespace utl
//........................................................................
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/eventlisteneradapter.cxx b/unotools/source/misc/eventlisteneradapter.cxx
index 0e14a54cd3c0..4ee8c8430027 100644
--- a/unotools/source/misc/eventlisteneradapter.cxx
+++ b/unotools/source/misc/eventlisteneradapter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -168,7 +169,7 @@ namespace utl
{
if (!_rxComp.is())
{
- OSL_ENSURE(sal_False, "OEventListenerAdapter::startComponentListening: invalid component!");
+ OSL_FAIL("OEventListenerAdapter::startComponentListening: invalid component!");
return;
}
@@ -180,3 +181,5 @@ namespace utl
//.........................................................................
} // namespace utl
//.........................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/fontcvt.cxx b/unotools/source/misc/fontcvt.cxx
index b7e3b452483a..00f4ffce1e6b 100644
--- a/unotools/source/misc/fontcvt.cxx
+++ b/unotools/source/misc/fontcvt.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,6 +30,7 @@
#include "precompiled_unotools.hxx"
#include <unotools/fontcvt.hxx>
#include <unotools/fontdefs.hxx>
+#include <sal/macros.h>
#ifndef _STLP_MAP
#include <map>
@@ -1187,7 +1189,7 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl(bool bPerfectOnly)
//Reverse map from a given starsymbol char to exact matches in ms symbol
//fonts.
- int nEntries = sizeof(aConservativeTable) / sizeof(aConservativeTable[0]);
+ int nEntries = SAL_N_ELEMENTS(aConservativeTable);
int i;
for (i = 0; i < nEntries; ++i)
{
@@ -1218,7 +1220,7 @@ StarSymbolToMSMultiFontImpl::StarSymbolToMSMultiFontImpl(bool bPerfectOnly)
//Allow extra conversions that are not perfect, but "good enough"
if (!bPerfectOnly)
- nEntries = sizeof(aAgressiveTable) / sizeof(aAgressiveTable[0]);
+ nEntries = SAL_N_ELEMENTS(aAgressiveTable);
else
nEntries = 1;
@@ -1438,7 +1440,7 @@ const ConvertChar* ConvertChar::GetRecodeData( const String& rOrgFontName, const
if( aMapName.EqualsAscii( "starsymbol" )
|| aMapName.EqualsAscii( "opensymbol" ) )
{
- int nEntries = sizeof(aRecodeTable) / sizeof(aRecodeTable[0]);
+ int nEntries = SAL_N_ELEMENTS(aRecodeTable);
for( int i = 0; i < nEntries; ++i)
{
RecodeTable& r = aRecodeTable[i];
@@ -1469,7 +1471,7 @@ FontToSubsFontConverter CreateFontToSubsFontConverter(
if ( nFlags & FONTTOSUBSFONT_IMPORT )
{
- int nEntries = sizeof(aRecodeTable) / sizeof(aRecodeTable[0]);
+ int nEntries = SAL_N_ELEMENTS(aRecodeTable);
if ( nFlags & FONTTOSUBSFONT_ONLYOLDSOSYMBOLFONTS ) // only StarMath+StarBats
nEntries = 2;
for( int i = 0; i < nEntries; ++i )
@@ -1518,3 +1520,4 @@ String GetFontToSubsFontName( FontToSubsFontConverter hConverter )
return String::CreateFromAscii( pName );
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index c93175ed1c73..d51c30ec7f58 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,7 @@
#include "precompiled_unotools.hxx"
#include <unotools/fontdefs.hxx>
#include <unotools/fontcfg.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
struct ImplLocalizedFontName
{
@@ -90,6 +91,10 @@ static sal_Unicode const aIPAPMincho[] = { 'i', 'p', 'a', 'p', 0x660E, 0x671D, 0
static sal_Unicode const aIPAGothic[] = { 'i', 'p', 'a', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
static sal_Unicode const aIPAPGothic[] = { 'i', 'p', 'a', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
static sal_Unicode const aIPAUIGothic[] = { 'i', 'p', 'a', 'u', 'i', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
+static sal_Unicode const aTakaoMincho[] = { 't', 'a', 'k', 'a', 'o', 0x660E, 0x671D, 0 };
+static sal_Unicode const aTakaoPMincho[] = { 't', 'a', 'k', 'a', 'o', 'p', 0x660E, 0x671D, 0 };
+static sal_Unicode const aTakaoGothic[] = { 't', 'a', 'k', 'a', 'o', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
+static sal_Unicode const aTakaoPGothic[] = { 't', 'a', 'k', 'a', 'o', 'p', 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0 };
static sal_Unicode const aSazanamiMincho[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x660E, 0x671D, 0, 0 };
static sal_Unicode const aSazanamiGothic[] = { 0x3055, 0x3056, 0x306A, 0x307F, 0x30B4, 0x30B7, 0x30C3, 0x30AF, 0, 0 };
static sal_Unicode const aKochiMincho[] = { 0x6771, 0x98A8, 0x660E, 0x671D, 0, 0 };
@@ -235,6 +240,10 @@ static ImplLocalizedFontName aImplLocalizedNamesList[] =
{ "ipagothic", aIPAGothic },
{ "ipapgothic", aIPAPGothic },
{ "ipauigothic", aIPAUIGothic },
+{ "takaomincho", aTakaoMincho },
+{ "takaopmincho", aTakaoPMincho },
+{ "takaogothic", aTakaoGothic },
+{ "takaopgothic", aTakaoPGothic },
{ "sazanamimincho", aSazanamiMincho },
{ "sazanamigothic", aSazanamiGothic },
{ "kochimincho", aKochiMincho },
@@ -412,7 +421,7 @@ void GetEnglishSearchFontName( String& rName )
// translate normalized localized name to its normalized English ASCII name
if( bNeedTranslation )
{
- typedef std::hash_map<const String, const char*,FontNameHash> FontNameDictionary;
+ typedef boost::unordered_map<const String, const char*,FontNameHash> FontNameDictionary;
static FontNameDictionary aDictionary( sizeof(aImplLocalizedNamesList) / sizeof(*aImplLocalizedNamesList) );
// the font name dictionary needs to be intialized once
if( aDictionary.empty() )
@@ -533,7 +542,7 @@ String GetSubsFontName( const String& rName, sal_uLong nFlags )
|| aOrgName.EqualsAscii( "opensymbol" ) ) )
return aName;
- const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get()->getSubstInfo( aOrgName );
+ const utl::FontNameAttr* pAttr = utl::FontSubstConfiguration::get().getSubstInfo( aOrgName );
if ( pAttr )
{
for( int i = 0; i < 3; i++ )
@@ -596,3 +605,4 @@ int FontNameHash::operator()( const String& rStr ) const
return nHash;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/sharedunocomponent.cxx b/unotools/source/misc/sharedunocomponent.cxx
index 5402ebc06085..8da98aa34954 100644
--- a/unotools/source/misc/sharedunocomponent.cxx
+++ b/unotools/source/misc/sharedunocomponent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -70,7 +71,7 @@ namespace utl
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "DisposableComponent::~DisposableComponent: caught an exception!" );
+ OSL_FAIL( "DisposableComponent::~DisposableComponent: caught an exception!" );
}
m_xComponent.clear();
}
@@ -156,7 +157,7 @@ namespace utl
catch( const CloseVetoException& ) { /* fine */ }
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "CloseableComponentImpl::nf_closeComponent: caught an unexpected exception!" );
+ OSL_FAIL( "CloseableComponentImpl::nf_closeComponent: caught an unexpected exception!" );
}
// reset
@@ -178,7 +179,7 @@ namespace utl
}
catch( const Exception& )
{
- OSL_ENSURE( sal_False, "CloseableComponentImpl::impl_nf_switchListening: caught an exception!" );
+ OSL_FAIL( "CloseableComponentImpl::impl_nf_switchListening: caught an exception!" );
}
}
@@ -207,7 +208,7 @@ namespace utl
// this should be unreachable: As long as we're a CloseListener, we veto the closing. If we're going
// to close the component ourself, then we revoke ourself as listener *before* the close call. So,
// if this here fires, something went definately wrong.
- DBG_ERROR( "CloseableComponentImpl::notifyClosing: unreachable!" );
+ OSL_FAIL( "CloseableComponentImpl::notifyClosing: unreachable!" );
}
//--------------------------------------------------------------------
@@ -218,7 +219,7 @@ namespace utl
) throw (RuntimeException)
{
DBG_ASSERT( Source.Source == m_xCloseable, "CloseableComponentImpl::disposing: where did this come from?" );
- DBG_ERROR( "CloseableComponentImpl::disposing: unreachable!" );
+ OSL_FAIL( "CloseableComponentImpl::disposing: unreachable!" );
// same reasoning for this assertion as in ->notifyClosing
}
@@ -244,3 +245,5 @@ namespace utl
//............................................................................
} // namespace utl
//............................................................................
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx
index f51ef35512cb..f5382b2c2074 100644
--- a/unotools/source/misc/syslocale.cxx
+++ b/unotools/source/misc/syslocale.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -27,8 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
-#ifndef GCC
-#endif
#include <unotools/syslocale.hxx>
#include <tools/string.hxx>
@@ -212,3 +211,4 @@ rtl_TextEncoding SvtSysLocale::GetBestMimeEncoding()
return nRet;
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/processfactory/processfactory.cxx b/unotools/source/processfactory/processfactory.cxx
index e1f0cc876dce..e514c01bf324 100644
--- a/unotools/source/processfactory/processfactory.cxx
+++ b/unotools/source/processfactory/processfactory.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,4 @@ namespace utl
} // namesapce utl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/property/propertysethelper.cxx b/unotools/source/property/propertysethelper.cxx
index fac76bbe882a..8e884cffbbea 100644
--- a/unotools/source/property/propertysethelper.cxx
+++ b/unotools/source/property/propertysethelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -284,18 +285,20 @@ Any SAL_CALL PropertySetHelper::getPropertyDefault( const ::rtl::OUString& aProp
void PropertySetHelper::_getPropertyStates( const utl::PropertyMapEntry** /*ppEntries*/, PropertyState* /*pStates*/ ) throw(UnknownPropertyException )
{
- DBG_ERROR( "you have to implement this yourself!" );
+ OSL_FAIL( "you have to implement this yourself!" );
}
void PropertySetHelper::_setPropertyToDefault( const utl::PropertyMapEntry* /*pEntry*/ ) throw(UnknownPropertyException )
{
- DBG_ERROR( "you have to implement this yourself!" );
+ OSL_FAIL( "you have to implement this yourself!" );
}
Any PropertySetHelper::_getPropertyDefault( const utl::PropertyMapEntry* /*pEntry*/ ) throw(UnknownPropertyException, WrappedTargetException )
{
- DBG_ERROR( "you have to implement this yourself!" );
+ OSL_FAIL( "you have to implement this yourself!" );
Any aAny;
return aAny;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/property/propertysetinfo.cxx b/unotools/source/property/propertysetinfo.cxx
index a5b8381de942..295486d3bf4c 100644
--- a/unotools/source/property/propertysetinfo.cxx
+++ b/unotools/source/property/propertysetinfo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -80,12 +81,12 @@ void PropertyMapImpl::add( PropertyMapEntry* pMap ) throw()
PropertyMap::iterator aIter = maPropertyMap.find( aName );
if( aIter != maPropertyMap.end() )
{
- DBG_ERROR( "Warning: PropertyMapEntry added twice, possible error!" );
+ OSL_FAIL( "Warning: PropertyMapEntry added twice, possible error!" );
}
#endif
if( NULL == pMap->mpType )
{
- DBG_ERROR( "No type in PropertyMapEntry!" );
+ OSL_FAIL( "No type in PropertyMapEntry!" );
pMap->mpType = &::getCppuType((const sal_Int32*)0);
}
@@ -126,8 +127,8 @@ Sequence< Property > PropertyMapImpl::getProperties() throw()
pProperties->Handle = pEntry->mnWhich;
pProperties->Type = *pEntry->mpType;
pProperties->Attributes = pEntry->mnFlags;
- pProperties++;
- aIter++;
+ ++pProperties;
+ ++aIter;
}
}
@@ -197,3 +198,5 @@ const PropertyMap* PropertySetInfo::getPropertyMap() const throw()
{
return mpMap->getPropertyMap();
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/streaming/streamhelper.cxx b/unotools/source/streaming/streamhelper.cxx
index 0ca20cf1c5e2..b4912d5ef89d 100644
--- a/unotools/source/streaming/streamhelper.cxx
+++ b/unotools/source/streaming/streamhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -202,3 +203,4 @@ void SAL_CALL OOutputStreamHelper::closeOutput( )
} // namespace utl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx
index b9d0185ffd48..812397f63839 100644
--- a/unotools/source/streaming/streamwrap.cxx
+++ b/unotools/source/streaming/streamwrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -115,16 +116,8 @@ void SAL_CALL OInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip) throw( star
::osl::MutexGuard aGuard( m_aMutex );
checkError();
-#ifdef DBG_UTIL
- sal_uInt32 nCurrentPos = m_pSvStream->Tell();
-#endif
-
m_pSvStream->SeekRel(nBytesToSkip);
checkError();
-
-#ifdef DBG_UTIL
- nCurrentPos = m_pSvStream->Tell();
-#endif
}
//------------------------------------------------------------------------------
@@ -377,3 +370,4 @@ void SAL_CALL OStreamWrapper::truncate() throw(::com::sun::star::io::IOException
} // namespace utl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/ucbhelper/XTempFile.hxx b/unotools/source/ucbhelper/XTempFile.hxx
index 115f6cf823a7..da570ed39d1e 100644
--- a/unotools/source/ucbhelper/XTempFile.hxx
+++ b/unotools/source/ucbhelper/XTempFile.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase5.hxx>
-#ifndef _CPPUHELPER_PROPERTYSETMIXIN_HXX_
#include <cppuhelper/propertysetmixin.hxx>
-#endif
#include <osl/mutex.hxx>
class SvStream;
@@ -151,3 +150,5 @@ private:
};
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/ucbhelper/localfilehelper.cxx b/unotools/source/ucbhelper/localfilehelper.cxx
index be855cd960af..f1026f749f45 100644
--- a/unotools/source/ucbhelper/localfilehelper.cxx
+++ b/unotools/source/ucbhelper/localfilehelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,9 +38,9 @@
#include <rtl/ustring.hxx>
#include <osl/file.hxx>
#include <tools/debug.hxx>
-#include <tools/list.hxx>
#include <tools/urlobj.hxx>
#include <ucbhelper/content.hxx>
+#include <vector>
using namespace ::osl;
using namespace ::com::sun::star::uno;
@@ -171,7 +172,7 @@ sal_Bool LocalFileHelper::IsFileContent( const String& rName )
return ConvertURLToSystemPath( rName, aTmp );
}
-DECLARE_LIST( StringList_Impl, ::rtl::OUString* )
+typedef ::std::vector< ::rtl::OUString* > StringList_Impl;
::com::sun::star::uno::Sequence < ::rtl::OUString > LocalFileHelper::GetFolderContents( const ::rtl::OUString& rFolder, sal_Bool bFolder )
{
@@ -182,7 +183,7 @@ DECLARE_LIST( StringList_Impl, ::rtl::OUString* )
Reference< ::com::sun::star::sdbc::XResultSet > xResultSet;
::com::sun::star::uno::Sequence< ::rtl::OUString > aProps(1);
::rtl::OUString* pProps = aProps.getArray();
- pProps[0] = ::rtl::OUString::createFromAscii( "Url" );
+ pProps[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Url"));
try
{
@@ -206,7 +207,7 @@ DECLARE_LIST( StringList_Impl, ::rtl::OUString* )
{
::rtl::OUString aId = xContentAccess->queryContentIdentifierString();
::rtl::OUString* pFile = new ::rtl::OUString( aId );
- pFiles->Insert( pFile, LIST_APPEND );
+ pFiles->push_back( pFile );
}
}
catch( ::com::sun::star::ucb::CommandAbortedException& )
@@ -223,12 +224,12 @@ DECLARE_LIST( StringList_Impl, ::rtl::OUString* )
if ( pFiles )
{
- sal_uLong nCount = pFiles->Count();
+ size_t nCount = pFiles->size();
Sequence < ::rtl::OUString > aRet( nCount );
::rtl::OUString* pRet = aRet.getArray();
- for ( sal_uInt16 i = 0; i < nCount; ++i )
+ for ( size_t i = 0; i < nCount; ++i )
{
- ::rtl::OUString* pFile = pFiles->GetObject(i);
+ ::rtl::OUString* pFile = (*pFiles)[ i ];
pRet[i] = *( pFile );
delete pFile;
}
@@ -240,3 +241,5 @@ DECLARE_LIST( StringList_Impl, ::rtl::OUString* )
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/ucbhelper/progresshandlerwrap.cxx b/unotools/source/ucbhelper/progresshandlerwrap.cxx
index 7fdbdacabc4b..5a87e4f4bb55 100644
--- a/unotools/source/ucbhelper/progresshandlerwrap.cxx
+++ b/unotools/source/ucbhelper/progresshandlerwrap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -96,3 +97,4 @@ void SAL_CALL ProgressHandlerWrap::pop()
} // namespace utl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index 26742151ee3d..99f0b85d68b8 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -74,10 +75,10 @@ rtl::OUString getParentName( const rtl::OUString& aFileName )
rtl::OUString aParent = aFileName.copy( 0,lastIndex );
if( aParent[ aParent.getLength()-1] == sal_Unicode(':') && aParent.getLength() == 6 )
- aParent += rtl::OUString::createFromAscii( "/" );
+ aParent += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
if( 0 == aParent.compareToAscii( "file://" ) )
- aParent = rtl::OUString::createFromAscii( "file:///" );
+ aParent = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("file:///"));
return aParent;
}
@@ -202,7 +203,7 @@ void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_Tru
unsigned const nRadix = 36;
unsigned long const nMax = (nRadix*nRadix*nRadix*nRadix*nRadix*nRadix);
String aName( rName );
- aName += String::CreateFromAscii( "sv" );
+ aName += String::CreateFromAscii( "lu" );
rName.Erase();
unsigned long nSeed = Time::GetSystemTicks() % nMax;
@@ -215,8 +216,14 @@ void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_Tru
if ( bDir )
{
+#ifdef UNX /* RW permission for the user only! */
+ mode_t old_mode = umask(077);
+#endif
FileBase::RC err = Directory::create( aTmp );
- if ( err == FileBase::E_None )
+#ifdef UNX
+ umask(old_mode);
+#endif
+ if ( err == FileBase::E_None )
{
// !bKeep: only for creating a name, not a file or directory
if ( bKeep || Directory::remove( aTmp ) == FileBase::E_None )
@@ -233,13 +240,12 @@ void CreateTempName_Impl( String& rName, sal_Bool bKeep, sal_Bool bDir = sal_Tru
{
DBG_ASSERT( bKeep, "Too expensive, use directory for creating name!" );
File aFile( aTmp );
-#ifdef UNX
-/* RW permission for the user only! */
- mode_t old_mode = umask(077);
+#ifdef UNX /* RW permission for the user only! */
+ mode_t old_mode = umask(077);
#endif
FileBase::RC err = aFile.open( osl_File_OpenFlag_Create | osl_File_OpenFlag_NoLock );
#ifdef UNX
-umask(old_mode);
+ umask(old_mode);
#endif
if ( err == FileBase::E_None )
{
@@ -253,7 +259,7 @@ umask(old_mode);
// but if there is a folder with such name proceed further
DirectoryItem aTmpItem;
- FileStatus aTmpStatus( FileStatusMask_Type );
+ FileStatus aTmpStatus( osl_FileStatus_Mask_Type );
if ( DirectoryItem::get( aTmp, aTmpItem ) != FileBase::E_None
|| aTmpItem.getFileStatus( aTmpStatus ) != FileBase::E_None
|| aTmpStatus.getFileType() != FileStatus::Directory )
@@ -306,7 +312,7 @@ void lcl_createName(TempFile_Impl& _rImpl,const String& rLeadingChars,sal_Bool _
#ifdef UNX
umask(old_mode);
#endif
- if ( err == FileBase::E_None )
+ if ( err == FileBase::E_None || err == FileBase::E_NOLCK )
{
_rImpl.aName = aTmp;
aFile.close();
@@ -318,7 +324,7 @@ umask(old_mode);
// but if there is a folder with such name proceed further
DirectoryItem aTmpItem;
- FileStatus aTmpStatus( FileStatusMask_Type );
+ FileStatus aTmpStatus( osl_FileStatus_Mask_Type );
if ( DirectoryItem::get( aTmp, aTmpItem ) != FileBase::E_None
|| aTmpItem.getFileStatus( aTmpStatus ) != FileBase::E_None
|| aTmpStatus.getFileType() != FileStatus::Directory )
@@ -491,3 +497,5 @@ String TempFile::GetTempNameBaseDirectory()
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx
index f363e8d1153d..513a8e0672ce 100644
--- a/unotools/source/ucbhelper/ucbhelper.cxx
+++ b/unotools/source/ucbhelper/ucbhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -64,6 +65,7 @@
#include <ucbhelper/contentbroker.hxx>
#include "unotools/localfilehelper.hxx"
+#include <vector>
using namespace ucbhelper;
using namespace com::sun::star;
@@ -74,11 +76,12 @@ using namespace com::sun::star::sdbc;
using namespace com::sun::star::task;
using namespace com::sun::star::uno;
using namespace com::sun::star::ucb;
-using namespace rtl;
using namespace comphelper;
using namespace osl;
-DECLARE_LIST( StringList_Impl, OUString* )
+using ::rtl::OUString;
+
+typedef ::std::vector< OUString* > StringList_Impl;
#define CONVERT_DATETIME( aUnoDT, aToolsDT ) \
aToolsDT = DateTime( Date( aUnoDT.Day, aUnoDT.Month, aUnoDT.Year ), \
@@ -108,7 +111,7 @@ sal_Bool UCBContentHelper::Transfer_Impl( const String& rSource, const String& r
{
Content aDestPath( aDestObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
uno::Reference< ::com::sun::star::ucb::XCommandInfo > xInfo = aDestPath.getCommands();
- OUString aTransferName = OUString::createFromAscii( "transfer" );
+ OUString aTransferName(RTL_CONSTASCII_USTRINGPARAM("transfer"));
if ( xInfo->hasCommandByName( aTransferName ) )
{
aDestPath.executeCommand( aTransferName, makeAny(
@@ -239,7 +242,7 @@ sal_Bool UCBContentHelper::GetTitle( const String& rContent, String& rTitle )
{
Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
OUString aTemp;
- if ( aCnt.getPropertyValue( OUString::createFromAscii( "Title" ) ) >>= aTemp )
+ if ( aCnt.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Title")) ) >>= aTemp )
{
rTitle = String( aTemp );
bRet = sal_True;
@@ -265,7 +268,7 @@ sal_Bool UCBContentHelper::Kill( const String& rContent )
try
{
Content aCnt( aDeleteObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
- aCnt.executeCommand( OUString::createFromAscii( "delete" ), makeAny( sal_Bool( sal_True ) ) );
+ aCnt.executeCommand( OUString(RTL_CONSTASCII_USTRINGPARAM("delete")), makeAny( sal_Bool( sal_True ) ) );
}
catch( ::com::sun::star::ucb::CommandAbortedException& )
{
@@ -294,9 +297,9 @@ Sequence < OUString > UCBContentHelper::GetFolderContents( const String& rFolder
uno::Reference< XResultSet > xResultSet;
Sequence< OUString > aProps( bSorted ? 2 : 1 );
OUString* pProps = aProps.getArray();
- pProps[0] = OUString::createFromAscii( "Title" );
+ pProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("Title"));
if ( bSorted )
- pProps[1] = OUString::createFromAscii( "IsFolder" );
+ pProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder"));
try
{
@@ -313,7 +316,7 @@ Sequence < OUString > UCBContentHelper::GetFolderContents( const String& rFolder
uno::Reference < com::sun::star::ucb::XAnyCompareFactory > xFactory;
uno::Reference < XMultiServiceFactory > xMgr = getProcessServiceFactory();
uno::Reference < com::sun::star::ucb::XSortedDynamicResultSetFactory > xSRSFac(
- xMgr->createInstance( ::rtl::OUString::createFromAscii("com.sun.star.ucb.SortedDynamicResultSetFactory") ), UNO_QUERY );
+ xMgr->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SortedDynamicResultSetFactory")) ), UNO_QUERY );
Sequence< com::sun::star::ucb::NumberedSortingInfo > aSortInfo( 2 );
com::sun::star::ucb::NumberedSortingInfo* pInfo = aSortInfo.getArray();
@@ -349,7 +352,7 @@ Sequence < OUString > UCBContentHelper::GetFolderContents( const String& rFolder
{
OUString aId = xContentAccess->queryContentIdentifierString();
OUString* pFile = new OUString( aId );
- pFiles->Insert( pFile, LIST_APPEND );
+ pFiles->push_back( pFile );
}
}
catch( ::com::sun::star::ucb::CommandAbortedException& )
@@ -366,12 +369,12 @@ Sequence < OUString > UCBContentHelper::GetFolderContents( const String& rFolder
if ( pFiles )
{
- sal_uLong nCount = pFiles->Count();
+ size_t nCount = pFiles->size();
Sequence < OUString > aRet( nCount );
OUString* pRet = aRet.getArray();
- for ( sal_uLong i = 0; i < nCount; ++i )
+ for ( size_t i = 0; i < nCount; ++i )
{
- OUString* pFile = pFiles->GetObject(i);
+ OUString* pFile = (*pFiles)[ i ];
pRet[i] = *( pFile );
delete pFile;
}
@@ -394,10 +397,10 @@ Sequence < OUString > UCBContentHelper::GetResultSet( const String& rURL )
uno::Reference< com::sun::star::ucb::XDynamicResultSet > xDynResultSet;
Sequence< OUString > aProps(3);
OUString* pProps = aProps.getArray();
- pProps[0] = OUString::createFromAscii( "Title" );
- pProps[1] = OUString::createFromAscii( "ContentType" );
+ pProps[0] = OUString(RTL_CONSTASCII_USTRINGPARAM("Title"));
+ pProps[1] = OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType"));
// TODO: can be optimized, property never used:
- pProps[2] = OUString::createFromAscii( "IsFolder" );
+ pProps[2] = OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder"));
try
{
@@ -430,7 +433,7 @@ Sequence < OUString > UCBContentHelper::GetResultSet( const String& rURL )
aRow += '\t';
aRow += String( xContentAccess->queryContentIdentifierString() );
OUString* pRow = new OUString( aRow );
- pList->Insert( pRow, LIST_APPEND );
+ pList->push_back( pRow );
}
}
catch( ::com::sun::star::ucb::CommandAbortedException& )
@@ -447,12 +450,12 @@ Sequence < OUString > UCBContentHelper::GetResultSet( const String& rURL )
if ( pList )
{
- sal_uLong nCount = pList->Count();
+ size_t nCount = pList->size();
Sequence < OUString > aRet( nCount );
OUString* pRet = aRet.getArray();
- for ( sal_uLong i = 0; i < nCount; ++i )
+ for ( size_t i = 0; i < nCount; ++i )
{
- OUString* pEntry = pList->GetObject(i);
+ OUString* pEntry = (*pList)[ i ];
pRet[i] = *( pEntry );
delete pEntry;
}
@@ -635,7 +638,7 @@ sal_uLong UCBContentHelper::GetSize( const String& rContent )
try
{
Content aCnt( aObj.GetMainURL( INetURLObject::NO_DECODE ), uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > () );
- aCnt.getPropertyValue( OUString::createFromAscii( "Size" ) ) >>= nTemp;
+ aCnt.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Size")) ) >>= nTemp;
}
catch( ::com::sun::star::ucb::CommandAbortedException& )
{
@@ -661,11 +664,11 @@ sal_Bool UCBContentHelper::IsYounger( const String& rIsYoung, const String& rIsO
uno::Reference< ::com::sun::star::ucb::XCommandEnvironment > aCmdEnv;
Content aYoung( aYoungObj.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv );
::com::sun::star::util::DateTime aTempYoungDate;
- aYoung.getPropertyValue( OUString::createFromAscii( "DateModified" ) ) >>= aTempYoungDate;
+ aYoung.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DateModified")) ) >>= aTempYoungDate;
CONVERT_DATETIME( aTempYoungDate, aYoungDate );
Content aOlder( aOlderObj.GetMainURL( INetURLObject::NO_DECODE ), aCmdEnv );
::com::sun::star::util::DateTime aTempOlderDate;
- aOlder.getPropertyValue( OUString::createFromAscii( "DateModified" ) ) >>= aTempOlderDate;
+ aOlder.getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("DateModified")) ) >>= aTempOlderDate;
CONVERT_DATETIME( aTempOlderDate, aOlderDate );
}
catch( ::com::sun::star::ucb::CommandAbortedException& )
@@ -911,7 +914,7 @@ sal_Bool UCBContentHelper::EqualURLs( const ::rtl::OUString& aFirstURL, const ::
}
catch( uno::Exception& )
{
- OSL_ENSURE( sal_False, "Can't compare URL's, treat as different!\n" );
+ OSL_FAIL( "Can't compare URL's, treat as different!\n" );
}
}
}
@@ -923,3 +926,4 @@ sal_Bool UCBContentHelper::EqualURLs( const ::rtl::OUString& aFirstURL, const ::
} // namespace utl
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/ucbhelper/ucblockbytes.cxx b/unotools/source/ucbhelper/ucblockbytes.cxx
index 71640c6e5b08..c95608c3faaf 100644
--- a/unotools/source/ucbhelper/ucblockbytes.cxx
+++ b/unotools/source/ucbhelper/ucblockbytes.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,21 +29,18 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_unotools.hxx"
+#include <sal/macros.h>
#include <unotools/ucblockbytes.hxx>
#include <comphelper/processfactory.hxx>
#include <salhelper/condition.hxx>
-#ifndef _OSL_THREAD_HXX_
#include <osl/thread.hxx>
-#endif
#include <tools/urlobj.hxx>
#include <ucbhelper/interactionrequest.hxx>
#include <com/sun/star/task/XInteractionAbort.hpp>
#include <com/sun/star/ucb/InteractiveNetworkConnectException.hpp>
#include <com/sun/star/ucb/CommandFailedException.hpp>
#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
-#ifndef _COM_SUN_STAR_UCB_INTERACTIVEIODEXCEPTION_HPP_
#include <com/sun/star/ucb/InteractiveIOException.hpp>
-#endif
#include <com/sun/star/io/XActiveDataStreamer.hpp>
#include <com/sun/star/ucb/DocumentHeaderField.hpp>
#include <com/sun/star/ucb/XCommandInfo.hpp>
@@ -120,7 +118,6 @@ class UcbStreamer_Impl : public ::cppu::WeakImplHelper2< XActiveDataStreamer, XA
UcbLockBytesRef m_xLockBytes;
public:
-
UcbStreamer_Impl( UcbLockBytes* pLockBytes )
: m_xLockBytes( pLockBytes )
{}
@@ -172,7 +169,6 @@ public:
, m_xProgressHandler( rxProgressHandler )
{}
-
virtual Reference<XInteractionHandler> SAL_CALL getInteractionHandler() throw (RuntimeException)
{ return m_xInteractionHandler; }
@@ -203,7 +199,7 @@ void SAL_CALL UcbPropertiesChangeListener_Impl::propertiesChange ( const Sequenc
for (i = 0; i < n; i++)
{
PropertyChangeEvent evt (rEvent[i]);
- if (evt.PropertyName == ::rtl::OUString::createFromAscii ("DocumentHeader"))
+ if (evt.PropertyName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("DocumentHeader")))
{
Sequence<DocumentHeaderField> aHead;
if (evt.NewValue >>= aHead)
@@ -228,12 +224,12 @@ void SAL_CALL UcbPropertiesChangeListener_Impl::propertiesChange ( const Sequenc
m_xLockBytes->SetStreamValid_Impl();
}
- else if (evt.PropertyName == rtl::OUString::createFromAscii ("PresentationURL"))
+ else if (evt.PropertyName == rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("PresentationURL")))
{
::rtl::OUString aUrl;
if (evt.NewValue >>= aUrl)
{
- ::rtl::OUString aBad (::rtl::OUString::createFromAscii ("private:"));
+ ::rtl::OUString aBad (RTL_CONSTASCII_USTRINGPARAM ("private:"));
if (!(aUrl.compareTo (aBad, aBad.getLength()) == 0))
{
// URL changed (Redirection).
@@ -241,7 +237,7 @@ void SAL_CALL UcbPropertiesChangeListener_Impl::propertiesChange ( const Sequenc
}
}
}
- else if (evt.PropertyName == ::rtl::OUString::createFromAscii ("MediaType"))
+ else if (evt.PropertyName == ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("MediaType")))
{
::rtl::OUString aContentType;
if (evt.NewValue >>= aContentType)
@@ -261,7 +257,6 @@ class Moderator
// returns. This would imply that these class must be refcounted !!!
public:
-
Moderator(
Reference < XContent >& xContent,
Reference < XInteractionHandler >& xInteract,
@@ -302,7 +297,6 @@ public:
: public salhelper::Condition
{
public:
-
ConditionRes(osl::Mutex& aMutex,Moderator& aModerator)
: salhelper::Condition(aMutex),
m_aModerator(aModerator)
@@ -310,13 +304,11 @@ public:
}
protected:
-
bool applies() const {
return m_aModerator.m_aResultType != NORESULT;
}
private:
-
Moderator& m_aModerator;
};
@@ -327,10 +319,8 @@ public:
sal_Int32 ioErrorCode;
};
-
Result getResult(const sal_uInt32 milliSec);
-
enum ReplyType {
NOREPLY,
EXIT,
@@ -338,12 +328,10 @@ public:
REQUESTHANDLED
};
-
class ConditionRep
: public salhelper::Condition
{
public:
-
ConditionRep(osl::Mutex& aMutex,Moderator& aModerator)
: salhelper::Condition(aMutex),
m_aModerator(aModerator)
@@ -351,40 +339,30 @@ public:
}
protected:
-
bool applies() const {
return m_aModerator.m_aReplyType != NOREPLY;
}
private:
-
Moderator& m_aModerator;
};
void setReply(ReplyType);
-
void handle( const Reference<XInteractionRequest >& Request );
-
void push( const Any& Status );
-
void update( const Any& Status );
-
void pop( );
void setStream(const Reference< XStream >& aStream);
-
void setInputStream(const Reference<XInputStream> &rxInputStream);
protected:
-
virtual void SAL_CALL run();
-
virtual void SAL_CALL onTerminated();
private:
-
osl::Mutex m_aMutex;
friend class ConditionRes;
@@ -435,7 +413,6 @@ public:
private:
-
Moderator& m_aModerator;
osl::Mutex m_aMutex;
@@ -443,7 +420,6 @@ private:
};
-
class ModeratorsActiveDataSink
: public ::cppu::WeakImplHelper1<XActiveDataSink>
{
@@ -475,7 +451,6 @@ public:
private:
-
Moderator& m_aModerator;
osl::Mutex m_aMutex;
Reference<XInputStream> m_xStream;
@@ -559,7 +534,6 @@ class ModeratorsProgressHandler
: public ::cppu::WeakImplHelper1<XProgressHandler>
{
public:
-
ModeratorsProgressHandler(Moderator &theModerator);
~ModeratorsProgressHandler();
@@ -576,7 +550,6 @@ public:
private:
-
Moderator& m_aModerator;
};
@@ -613,8 +586,6 @@ void SAL_CALL ModeratorsProgressHandler::pop( )
}
-
-
ModeratorsInteractionHandler::ModeratorsInteractionHandler(
Moderator &aModerator)
: m_aModerator(aModerator)
@@ -778,7 +749,6 @@ void Moderator::handle( const Reference<XInteractionRequest >& Request )
}
-
void Moderator::push( const Any& Status )
{
{
@@ -868,7 +838,6 @@ void Moderator::setInputStream(const Reference<XInputStream> &rxInputStream)
}
-
void SAL_CALL Moderator::run()
{
ResultType aResultType;
@@ -910,8 +879,6 @@ void SAL_CALL Moderator::run()
}
}
-
-
void SAL_CALL Moderator::onTerminated()
{
{
@@ -920,12 +887,10 @@ void SAL_CALL Moderator::onTerminated()
delete this;
}
-
/**
Function for opening UCB contents synchronously,
but with handled timeout;
*/
-
static sal_Bool _UCBOpenContentSync(
UcbLockBytesRef xLockBytes,
Reference < XContent > xContent,
@@ -958,10 +923,10 @@ static sal_Bool UCBOpenContentSync(
aScheme = xContId->getContentProviderScheme();
// now determine wether we use a timeout or not;
- if( ! aScheme.equalsIgnoreAsciiCaseAscii("http") &&
- ! aScheme.equalsIgnoreAsciiCaseAscii("https") &&
- ! aScheme.equalsIgnoreAsciiCaseAscii("vnd.sun.star.webdav") &&
- ! aScheme.equalsIgnoreAsciiCaseAscii("ftp"))
+ if( ! aScheme.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("http")) &&
+ ! aScheme.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("https")) &&
+ ! aScheme.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.webdav")) &&
+ ! aScheme.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("ftp")))
return _UCBOpenContentSync(
xLockBytes,xContent,rArg,xSink,xInteract,xProgress,xHandler);
@@ -1273,7 +1238,6 @@ static sal_Bool _UCBOpenContentSync(
return ( bAborted || bException );
}
-
//----------------------------------------------------------------------------
UcbLockBytes::UcbLockBytes( UcbLockBytesHandler* pHandler )
: m_xInputStream (NULL)
@@ -1320,14 +1284,14 @@ UcbLockBytes::~UcbLockBytes()
Reference < XInputStream > UcbLockBytes::getInputStream()
{
- vos::OClearableGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
m_bDontClose = sal_True;
return m_xInputStream;
}
Reference < XStream > UcbLockBytes::getStream()
{
- vos::OClearableGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
Reference < XStream > xStream( m_xSeekable, UNO_QUERY );
if ( xStream.is() )
m_bDontClose = sal_True;
@@ -1338,7 +1302,7 @@ Reference < XStream > UcbLockBytes::getStream()
sal_Bool UcbLockBytes::setStream_Impl( const Reference<XStream>& aStream )
{
- vos::OClearableGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
if ( aStream.is() )
{
m_xOutputStream = aStream->getOutputStream();
@@ -1360,7 +1324,7 @@ sal_Bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInp
try
{
- vos::OClearableGuard aGuard( m_aMutex );
+ osl::MutexGuard aGuard( m_aMutex );
if ( !m_bDontClose && m_xInputStream.is() )
m_xInputStream->closeInput();
@@ -1374,7 +1338,7 @@ sal_Bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInp
{
Reference < XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
Reference< XOutputStream > rxTempOut = Reference < XOutputStream > (
- xFactory->createInstance ( ::rtl::OUString::createFromAscii( "com.sun.star.io.TempFile" ) ),
+ xFactory->createInstance ( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.TempFile")) ),
UNO_QUERY );
if( rxTempOut.is() )
@@ -1387,7 +1351,6 @@ sal_Bool UcbLockBytes::setInputStream_Impl( const Reference<XInputStream> &rxInp
}
bRet = m_xInputStream.is();
- // aGuard.clear();
}
catch( Exception& )
{}
@@ -1414,7 +1377,7 @@ void UcbLockBytes::terminate_Impl()
if ( GetError() == ERRCODE_NONE && !m_xInputStream.is() )
{
- DBG_ERROR("No InputStream, but no error set!" );
+ OSL_FAIL("No InputStream, but no error set!" );
SetError( ERRCODE_IO_NOTEXISTS );
}
@@ -1469,7 +1432,7 @@ ErrCode UcbLockBytes::ReadAt ( sal_uLong nPos, void *pBuffer, sal_uLong nCount,
Sequence<sal_Int8> aData;
sal_Int32 nSize;
- nCount = VOS_MIN(nCount, 0x7FFFFFFF);
+ nCount = SAL_MIN(nCount, 0x7FFFFFFF);
try
{
if ( !m_bTerminated && !IsSynchronMode() )
@@ -1679,7 +1642,7 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo
aArgument.Referer = rReferer;
Command aCommand;
- aCommand.Name = ::rtl::OUString::createFromAscii ("post");
+ aCommand.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM ("post"));
aCommand.Argument <<= aArgument;
Reference< XProgressHandler > xProgressHdl = new ProgressHandler_Impl( LINK( &xLockBytes, UcbLockBytes, DataAvailHdl ) );
@@ -1694,7 +1657,7 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo
if ( xLockBytes->GetError() == ERRCODE_NONE && ( bError || !xLockBytes->getInputStream().is() ) )
{
- DBG_ERROR("No InputStream, but no error set!" );
+ OSL_FAIL("No InputStream, but no error set!" );
xLockBytes->SetError( ERRCODE_IO_GENERAL );
}
@@ -1719,7 +1682,7 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo
{
Reference < XCommandProcessor > xProcessor( xContent, UNO_QUERY );
Command aCommand;
- aCommand.Name = ::rtl::OUString::createFromAscii("setPropertyValues");
+ aCommand.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("setPropertyValues"));
aCommand.Handle = -1; /* unknown */
aCommand.Argument <<= rProps;
xProcessor->execute( aCommand, 0, Reference < XCommandEnvironment >() );
@@ -1745,7 +1708,7 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo
if ( xLockBytes->GetError() == ERRCODE_NONE && ( bError || !xLockBytes->getInputStream().is() ) )
{
- DBG_ERROR("No InputStream, but no error set!" );
+ OSL_FAIL("No InputStream, but no error set!" );
xLockBytes->SetError( ERRCODE_IO_GENERAL );
}
@@ -1753,3 +1716,5 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx
index f27f663b3698..62ab90eb3998 100644
--- a/unotools/source/ucbhelper/ucbstreamhelper.cxx
+++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
-#ifndef _COM_SUN_STAR_UCB_XCOMMANDENVIRONMENT_HDL_
#include <com/sun/star/ucb/XCommandEnvironment.hdl>
-#endif
#include <com/sun/star/ucb/InsertCommandArgument.hpp>
#include <com/sun/star/io/XActiveDataStreamer.hpp>
@@ -73,17 +72,17 @@ static SvStream* lcl_CreateStream( const String& rFileName, StreamMode eOpenMode
{
// truncate is implemented with deleting the original file
::ucbhelper::Content aCnt( rFileName, Reference < XCommandEnvironment >() );
- aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ), makeAny( sal_Bool( sal_True ) ) );
+ aCnt.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("delete")), makeAny( sal_Bool( sal_True ) ) );
}
- catch ( CommandAbortedException& )
+ catch ( const CommandAbortedException& )
{
// couldn't truncate/delete
}
- catch ( ContentCreationException& )
+ catch ( const ContentCreationException& )
{
}
- catch ( Exception& )
+ catch ( const Exception& )
{
}
}
@@ -104,18 +103,18 @@ static SvStream* lcl_CreateStream( const String& rFileName, StreamMode eOpenMode
aInsertArg.ReplaceExisting = sal_False;
Any aCmdArg;
aCmdArg <<= aInsertArg;
- aContent.executeCommand( ::rtl::OUString::createFromAscii( "insert" ), aCmdArg );
+ aContent.executeCommand( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("insert")), aCmdArg );
}
// it is NOT an error when the stream already exists and no truncation was desired
- catch ( CommandAbortedException& )
+ catch ( const CommandAbortedException& )
{
// currently never an error is detected !
}
- catch ( ContentCreationException& )
+ catch ( const ContentCreationException& )
{
}
- catch ( Exception& )
+ catch ( const Exception& )
{
}
}
@@ -134,13 +133,13 @@ static SvStream* lcl_CreateStream( const String& rFileName, StreamMode eOpenMode
pStream->SetError( xLockBytes->GetError() );
}
}
- catch ( CommandAbortedException& )
+ catch ( const CommandAbortedException& )
{
}
- catch ( ContentCreationException& )
+ catch ( const ContentCreationException& )
{
}
- catch ( Exception& )
+ catch ( const Exception& )
{
}
}
@@ -246,3 +245,5 @@ SvStream* UcbStreamHelper::CreateStream( Reference < XStream > xStream, sal_Bool
};
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/source/ucbhelper/xtempfile.cxx b/unotools/source/ucbhelper/xtempfile.cxx
index 525596fae854..7883a3e85cb2 100644
--- a/unotools/source/ucbhelper/xtempfile.cxx
+++ b/unotools/source/ucbhelper/xtempfile.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -516,3 +517,5 @@ extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
}
return pRet;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */