diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 12:24:29 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2011-06-19 12:24:29 +0200 |
commit | 92667c8edbaee9a252b1d5d221eb62849f76697c (patch) | |
tree | 8f1d329f2259b7d5bff054bc14d0965637df6961 /linguistic | |
parent | fixing rebase errors (diff) | |
parent | remove unused define (diff) | |
download | core-92667c8edbaee9a252b1d5d221eb62849f76697c.tar.gz core-92667c8edbaee9a252b1d5d221eb62849f76697c.zip |
Merge branch 'master' into feature/gnumake4
Conflicts:
connectivity/source/cpool/Zregistration.cxx
connectivity/source/drivers/evoab/LCatalog.cxx
connectivity/source/drivers/evoab/LColumnAlias.cxx
connectivity/source/drivers/evoab/LColumnAlias.hxx
connectivity/source/drivers/evoab/LColumns.cxx
connectivity/source/drivers/evoab/LColumns.hxx
connectivity/source/drivers/evoab/LConfigAccess.cxx
connectivity/source/drivers/evoab/LConfigAccess.hxx
connectivity/source/drivers/evoab/LConnection.cxx
connectivity/source/drivers/evoab/LConnection.hxx
connectivity/source/drivers/evoab/LDatabaseMetaData.cxx
connectivity/source/drivers/evoab/LDatabaseMetaData.hxx
connectivity/source/drivers/evoab/LDriver.cxx
connectivity/source/drivers/evoab/LDriver.hxx
connectivity/source/drivers/evoab/LFolderList.cxx
connectivity/source/drivers/evoab/LFolderList.hxx
connectivity/source/drivers/evoab/LNoException.cxx
connectivity/source/drivers/evoab/LPreparedStatement.cxx
connectivity/source/drivers/evoab/LPreparedStatement.hxx
connectivity/source/drivers/evoab/LResultSet.cxx
connectivity/source/drivers/evoab/LResultSet.hxx
connectivity/source/drivers/evoab/LServices.cxx
connectivity/source/drivers/evoab/LStatement.cxx
connectivity/source/drivers/evoab/LStatement.hxx
connectivity/source/drivers/evoab/LTable.cxx
connectivity/source/drivers/evoab/LTable.hxx
connectivity/source/drivers/evoab/LTables.cxx
connectivity/source/drivers/evoab/LTables.hxx
connectivity/source/drivers/evoab/evoab.xml
connectivity/source/drivers/evoab/makefile.mk
editeng/Library_editeng.mk
framework/Library_fwe.mk
framework/test/test.cxx
idl/prj/d.lst
idl/util/idlpch.cxx
linguistic/Makefile
linguistic/Module_linguistic.mk
linguistic/inc/linguistic/lngdllapi.h
linguistic/inc/linguistic/lngprophelp.hxx
linguistic/inc/linguistic/misc.hxx
linguistic/prj/build.lst
linguistic/prj/d.lst
linguistic/qa/unoapi/Test.java
linguistic/source/grammarchecker.cxx
linguistic/source/grammarchecker.hxx
linguistic/source/hyphdta.cxx
linguistic/source/lngprophelp.cxx
linguistic/source/makefile.mk
linguistic/source/spelldta.cxx
sfx2/Library_qstart.mk
sfx2/Library_sfx.mk
sfx2/inc/sfx2/qswin32.h
sfx2/prj/build.lst
sfx2/qa/cppunit/makefile.mk
xmlscript/inc/xmlscript/xcrdllapi.h
xmlscript/prj/d.lst
xmlscript/util/makefile.mk
Diffstat (limited to 'linguistic')
63 files changed, 271 insertions, 831 deletions
diff --git a/linguistic/JunitTest_linguistic_unoapi.mk b/linguistic/JunitTest_linguistic_unoapi.mk index c6638746b71c..c6638746b71c 100644..100755 --- a/linguistic/JunitTest_linguistic_unoapi.mk +++ b/linguistic/JunitTest_linguistic_unoapi.mk diff --git a/linguistic/Makefile b/linguistic/Makefile index 90947b2e5f48..a79aff831024 100644 --- a/linguistic/Makefile +++ b/linguistic/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/linguistic/Module_linguistic.mk b/linguistic/Module_linguistic.mk index 045a6b9da292..1c1651657d4b 100644 --- a/linguistic/Module_linguistic.mk +++ b/linguistic/Module_linguistic.mk @@ -1,29 +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 +# 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 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_Module_Module,linguistic)) @@ -36,7 +36,7 @@ $(eval $(call gb_Module_add_targets,linguistic,\ #)) $(eval $(call gb_Module_add_subsequentcheck_targets,linguistic,\ - JunitTest_linguistic_unoapi \ + JunitTest_linguistic_unoapi \ )) # was disabled in old build system diff --git a/linguistic/Package_inc.mk b/linguistic/Package_inc.mk index 4c86bddc7c96..4c86bddc7c96 100644..100755 --- a/linguistic/Package_inc.mk +++ b/linguistic/Package_inc.mk diff --git a/linguistic/inc/iprcache.hxx b/linguistic/inc/iprcache.hxx index 842747a723cb..be48fac9bd46 100644 --- a/linguistic/inc/iprcache.hxx +++ b/linguistic/inc/iprcache.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,7 +49,6 @@ namespace linguistic { -/////////////////////////////////////////////////////////////////////////// class Flushable { @@ -56,7 +56,6 @@ public: virtual void Flush() = 0; }; -/////////////////////////////////////////////////////////////////////////// class FlushListener : public cppu::WeakImplHelper2 @@ -94,7 +93,6 @@ public: virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& rEvt ) throw(::com::sun::star::uno::RuntimeException); }; -/////////////////////////////////////////////////////////////////////////// class SpellCache : public Flushable @@ -123,9 +121,9 @@ public: bool CheckWord( const ::rtl::OUString& rWord, LanguageType nLang ); }; -/////////////////////////////////////////////////////////////////////////// } // namespace linguistic #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/inc/linguistic/hyphdta.hxx b/linguistic/inc/linguistic/hyphdta.hxx index 7814c7821aa9..ffdc36a01509 100644 --- a/linguistic/inc/linguistic/hyphdta.hxx +++ b/linguistic/inc/linguistic/hyphdta.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. @@ -38,8 +39,6 @@ namespace linguistic { -/////////////////////////////////////////////////////////////////////////// - class HyphenatedWord : public cppu::WeakImplHelper1 < @@ -94,8 +93,6 @@ public: }; -/////////////////////////////////////////////////////////////////////////// - class PossibleHyphens : public cppu::WeakImplHelper1 < @@ -141,11 +138,8 @@ public: const ::rtl::OUString &rHyphWord, const ::com::sun::star::uno::Sequence< sal_Int16 > &rPositions); }; - - -/////////////////////////////////////////////////////////////////////////// - } // namespace linguistic #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/inc/linguistic/lngdllapi.h b/linguistic/inc/linguistic/lngdllapi.h index 5db6d4dbd799..265a11d8b51a 100644 --- a/linguistic/inc/linguistic/lngdllapi.h +++ b/linguistic/inc/linguistic/lngdllapi.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. @@ -40,3 +41,5 @@ #define LNG_DLLPRIVATE SAL_DLLPRIVATE #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/inc/linguistic/lngprophelp.hxx b/linguistic/inc/linguistic/lngprophelp.hxx index 879b67e46b50..18528eb465b0 100644 --- a/linguistic/inc/linguistic/lngprophelp.hxx +++ b/linguistic/inc/linguistic/lngprophelp.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. @@ -49,7 +50,6 @@ namespace com { namespace sun { namespace star { namespace linguistic2 { namespace linguistic { -/////////////////////////////////////////////////////////////////////////// // PropertyChgHelper // Base class for all XPropertyChangeListener members of the // various lingu services. @@ -58,7 +58,6 @@ namespace linguistic // Flags for type of events allowed to be launched #define AE_SPELLCHECKER 1 #define AE_HYPHENATOR 2 -//#define AE_THESAURUS 4 typedef cppu::WeakImplHelper2 < @@ -159,7 +158,6 @@ public: }; -/////////////////////////////////////////////////////////////////////////// class PropertyHelper_Thes : public PropertyChgHelper { @@ -203,8 +201,6 @@ public: }; -/////////////////////////////////////////////////////////////////////////// - class PropertyHelper_Spell : public PropertyChgHelper { @@ -289,7 +285,6 @@ public: throw(::com::sun::star::uno::RuntimeException); }; -/////////////////////////////////////////////////////////////////////////// class PropertyHelper_Hyphen : public PropertyChgHelper @@ -368,9 +363,8 @@ public: throw(::com::sun::star::uno::RuntimeException); }; -/////////////////////////////////////////////////////////////////////////// - } // namespace linguistic #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/inc/linguistic/lngprops.hxx b/linguistic/inc/linguistic/lngprops.hxx index 68f599d50a8c..2b611d530ef8 100644 --- a/linguistic/inc/linguistic/lngprops.hxx +++ b/linguistic/inc/linguistic/lngprops.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. @@ -60,3 +61,4 @@ #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/inc/linguistic/misc.hxx b/linguistic/inc/linguistic/misc.hxx index 957fbd429b9f..4061701c1f66 100644 --- a/linguistic/inc/linguistic/misc.hxx +++ b/linguistic/inc/linguistic/misc.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. @@ -59,7 +60,7 @@ namespace com { namespace sun { namespace star { namespace frame { class LocaleDataWrapper; -/////////////////////////////////////////////////////////////////////////// + #define SN_GRAMMARCHECKER "com.sun.star.linguistic2.Proofreader" #define SN_GRAMMARCHECKINGITERATOR "com.sun.star.linguistic2.ProofreadingIterator" #define SN_SPELLCHECKER "com.sun.star.linguistic2.SpellChecker" @@ -76,7 +77,7 @@ namespace linguistic { // ascii to OUString conversion -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) +#define A2OU(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( x )) /// Flags to be used with the multi-path related functions /// @see GetDictionaryPaths, GetLinguisticPaths @@ -93,14 +94,11 @@ namespace linguistic #define DIC_ERR_UNKNOWN 3 #define DIC_ERR_NOT_EXISTS 4 -/////////////////////////////////////////////////////////////////////////// LNG_DLLPUBLIC ::osl::Mutex& GetLinguMutex(); LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang ); -/////////////////////////////////////////////////////////////////////////// - rtl_TextEncoding GetTextEncoding( sal_Int16 nLanguage ); inline ::rtl::OUString BS2OU(const ByteString &rText, rtl_TextEncoding nEnc) @@ -115,12 +113,8 @@ inline ByteString OU2BS(const ::rtl::OUString &rText, rtl_TextEncoding nEnc) rtl::OUString StripTrailingChars( rtl::OUString &rTxt, sal_Unicode cChar ); -/////////////////////////////////////////////////////////////////////////// - sal_Int32 LevDistance( const rtl::OUString &rTxt1, const rtl::OUString &rTxt2 ); -/////////////////////////////////////////////////////////////////////////// - ::com::sun::star::lang::Locale CreateLocale( LanguageType eLang ); @@ -137,8 +131,6 @@ LNG_DLLPUBLIC LanguageType LocaleSeqToLangSeq( ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > &rLocaleSeq ); -/////////////////////////////////////////////////////////////////////////// - // checks if file pointed to by rURL is readonly // and may also check return if such a file exists or not sal_Bool IsReadOnly( const String &rURL, sal_Bool *pbExist = 0 ); @@ -146,15 +138,6 @@ sal_Bool IsReadOnly( const String &rURL, sal_Bool *pbExist = 0 ); // checks if a file with the given URL exists sal_Bool FileExists( const String &rURL ); -#ifdef TL_OUTDATED -// returns complete file URL for given filename that is to be searched in -// the specified path -String GetFileURL( SvtPathOptions::Pathes ePath, const String &rFileName ); - -String GetModulePath( SvtPathOptions::Pathes ePath, sal_Bool bAddAccessDelim = sal_True ); -#endif - -/////////////////////////////////////////////////////////////////////////// ::rtl::OUString GetDictionaryWriteablePath(); ::com::sun::star::uno::Sequence< ::rtl::OUString > GetDictionaryPaths( sal_Int16 nPathFlags = PATH_FLAG_ALL ); @@ -165,12 +148,10 @@ String GetModulePath( SvtPathOptions::Pathes ePath, sal_Bool bAddAccessDelim = LNG_DLLPUBLIC String GetWritableDictionaryURL( const String &rDicName ); // looks for the specified file in the list of paths. -// In case of multiple occurences only the first found is returned. +// In case of multiple occurrences only the first found is returned. String SearchFileInPaths( const String &rFile, const ::com::sun::star::uno::Sequence< ::rtl::OUString > &rPaths ); -/////////////////////////////////////////////////////////////////////////// - LNG_DLLPUBLIC sal_Int32 GetPosInWordToCheck( const rtl::OUString &rTxt, sal_Int32 nPos ); ::com::sun::star::uno::Reference< @@ -179,7 +160,6 @@ LNG_DLLPUBLIC sal_Int32 GetPosInWordToCheck( const rtl::OUString &rTxt, sal_Int3 ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XHyphenatedWord > &rxHyphWord ); -/////////////////////////////////////////////////////////////////////////// LNG_DLLPUBLIC sal_Bool IsUpper( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage ); LNG_DLLPUBLIC sal_Bool IsLower( const String &rText, xub_StrLen nPos, xub_StrLen nLen, sal_Int16 nLanguage ); @@ -195,7 +175,6 @@ sal_Unicode ToUpper( const sal_Unicode cChar, sal_Int16 nLanguage ); LNG_DLLPUBLIC sal_Bool HasDigits( const ::rtl::OUString &rText ); LNG_DLLPUBLIC sal_Bool IsNumeric( const String &rText ); -/////////////////////////////////////////////////////////////////////////// ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > GetOneInstanceService( const char *pServiceName ); LNG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetLinguProperties(); @@ -203,7 +182,6 @@ LNG_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::beans::XProper ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > GetDictionaryList(); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionary > GetIgnoreAllList(); -/////////////////////////////////////////////////////////////////////////// sal_Bool IsUseDicList( const ::com::sun::star::beans::PropertyValues &rProperties, const ::com::sun::star::uno::Reference< @@ -228,12 +206,9 @@ LNG_DLLPUBLIC sal_uInt8 AddEntryToDic( LNG_DLLPUBLIC sal_Bool SaveDictionaries( const ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XDictionaryList > &xDicList ); -/////////////////////////////////////////////////////////////////////////// -// // AppExitLstnr: // virtual base class that calls it AtExit function when the application // (ie the Desktop) is about to terminate -// class AppExitListener : public cppu::WeakImplHelper1 @@ -261,9 +236,8 @@ public: virtual void SAL_CALL notifyTermination( const ::com::sun::star::lang::EventObject& aEvent ) throw(::com::sun::star::uno::RuntimeException); }; -/////////////////////////////////////////////////////////////////////////// - } // namespace linguistic #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/inc/linguistic/spelldta.hxx b/linguistic/inc/linguistic/spelldta.hxx index aab68ac63eb7..81ff61791b30 100644 --- a/linguistic/inc/linguistic/spelldta.hxx +++ b/linguistic/inc/linguistic/spelldta.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. @@ -134,3 +135,4 @@ public: #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/inc/pch/precompiled_linguistic.cxx b/linguistic/inc/pch/precompiled_linguistic.cxx index bc06ba5df311..0cf855ebe4f6 100644 --- a/linguistic/inc/pch/precompiled_linguistic.cxx +++ b/linguistic/inc/pch/precompiled_linguistic.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_linguistic.hxx" +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/inc/pch/precompiled_linguistic.hxx b/linguistic/inc/pch/precompiled_linguistic.hxx index 8f0a3f8c0291..e0e70ffb9bd9 100644 --- a/linguistic/inc/pch/precompiled_linguistic.hxx +++ b/linguistic/inc/pch/precompiled_linguistic.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/linguistic/inc/thesdta.hxx b/linguistic/inc/thesdta.hxx index 2267a7d4c2fd..f6922dacc4fa 100644 --- a/linguistic/inc/thesdta.hxx +++ b/linguistic/inc/thesdta.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. @@ -38,7 +39,6 @@ namespace linguistic { -/////////////////////////////////////////////////////////////////////////// class ThesaurusMeaning : @@ -76,9 +76,9 @@ public: }; -/////////////////////////////////////////////////////////////////////////// } // namespace linguistic #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index cae9ac8692a6..3ef507e2e115 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -1,2 +1,2 @@ -lg linguistic : svl xmloff ucbhelper vos comphelper ICU:icu LIBXSLT:libxslt NULL +lg linguistic : svl xmloff ucbhelper comphelper ICU:icu LIBXSLT:libxslt NULL lg linguistic\prj nmake - all lg_prj NULL diff --git a/linguistic/prj/makefile.mk b/linguistic/prj/makefile.mk index 88cd9dfe08b8..88cd9dfe08b8 100644..100755 --- a/linguistic/prj/makefile.mk +++ b/linguistic/prj/makefile.mk diff --git a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java index 63412254c29f..63412254c29f 100644..100755 --- a/linguistic/qa/complex/linguistic/HangulHanjaConversion.java +++ b/linguistic/qa/complex/linguistic/HangulHanjaConversion.java diff --git a/linguistic/qa/complex/linguistic/TestDocument.java b/linguistic/qa/complex/linguistic/TestDocument.java index 575640662e5f..575640662e5f 100644..100755 --- a/linguistic/qa/complex/linguistic/TestDocument.java +++ b/linguistic/qa/complex/linguistic/TestDocument.java diff --git a/linguistic/qa/unoapi/Test.java b/linguistic/qa/unoapi/Test.java deleted file mode 100644 index eca9622d5247..000000000000 --- a/linguistic/qa/unoapi/Test.java +++ /dev/null @@ -1,52 +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. -************************************************************************/ - -package org.openoffice.linguistic.qa.unoapi; - -import org.openoffice.Runner; -import org.openoffice.test.OfficeConnection; -import org.openoffice.test.Argument; -import static org.junit.Assert.*; - -public final class Test { - @org.junit.Before public void setUp() throws Exception { - connection.setUp(); - } - - @org.junit.After public void tearDown() - throws InterruptedException, com.sun.star.uno.Exception - { - connection.tearDown(); - } - - @org.junit.Test public void test() { - assertTrue( - Runner.run( - "-sce", Argument.get("sce"), "-xcl", Argument.get("xcl"), "-tdoc", - Argument.get("tdoc"), "-cs", connection.getDescription())); - } - - private final OfficeConnection connection = new OfficeConnection(); -} diff --git a/linguistic/qa/unoapi/knownissues.xcl b/linguistic/qa/unoapi/knownissues.xcl index e5bf99558ac6..e5bf99558ac6 100644..100755 --- a/linguistic/qa/unoapi/knownissues.xcl +++ b/linguistic/qa/unoapi/knownissues.xcl diff --git a/linguistic/qa/unoapi/lng.sce b/linguistic/qa/unoapi/lng.sce index fd412843865d..fd412843865d 100644..100755 --- a/linguistic/qa/unoapi/lng.sce +++ b/linguistic/qa/unoapi/lng.sce diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 2f2fa78b8f72..c1b59ed974be 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.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. @@ -72,18 +73,18 @@ using namespace std; using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; + #define SN_CONV_DICTIONARY "com.sun.star.linguistic2.ConversionDictionary" #define SN_HCD_CONV_DICTIONARY "com.sun.star.linguistic2.HangulHanjaConversionDictionary" -/////////////////////////////////////////////////////////////////////////// void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) { if (rMainURL.Len() == 0) @@ -110,8 +111,6 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xIn ) ); - sal_uLong nError = sal::static_int_cast< sal_uLong >(-1); - // prepare ParserInputSource xml::sax::InputSource aParserInput; aParserInput.aInputStream = xIn; @@ -130,8 +129,6 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) if (!xParser.is()) return; - // get filter - //ConvDicXMLImport *pImport = new ConvDicXMLImport( this, rMainURL ); //!! keep a reference until everything is done to //!! ensure the proper lifetime of the object uno::Reference < xml::sax::XDocumentHandler > xFilter( @@ -144,18 +141,12 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) try { xParser->parseStream( aParserInput ); // implicitly calls ConvDicXMLImport::CreateContext - if (rImport.GetSuccess()) - nError = 0; } catch( xml::sax::SAXParseException& ) { -// if( bEncrypted ) -// nError = ERRCODE_SFX_WRONGPASSWORD; } catch( xml::sax::SAXException& ) { -// if( bEncrypted ) -// nError = ERRCODE_SFX_WRONGPASSWORD; } catch( io::IOException& ) { @@ -201,7 +192,6 @@ sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvTy } -/////////////////////////////////////////////////////////////////////////// ConvDic::ConvDic( const String &rName, @@ -304,7 +294,7 @@ void ConvDic::Save() { xSaxWriter = uno::Reference< io::XActiveDataSource >( xServiceFactory->createInstance( - OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ) ), UNO_QUERY ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")) ), UNO_QUERY ); } catch (uno::Exception &) { @@ -717,7 +707,7 @@ sal_Bool SAL_CALL ConvDic::supportsService( const OUString& rServiceName ) { MutexGuard aGuard( GetLinguMutex() ); sal_Bool bRes = sal_False; - if (rServiceName.equalsAscii( SN_CONV_DICTIONARY )) + if (rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SN_CONV_DICTIONARY))) bRes = sal_True; return bRes; } @@ -739,6 +729,6 @@ uno::Sequence< OUString > ConvDic::getSupportedServiceNames_Static() return aSNS; } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/convdic.hxx b/linguistic/source/convdic.hxx index 77346927df9b..f33ad751f91b 100644 --- a/linguistic/source/convdic.hxx +++ b/linguistic/source/convdic.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,7 +36,7 @@ #include <cppuhelper/interfacecontainer.h> #include <tools/string.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <set> #include <memory> #include "linguistic/misc.hxx" @@ -50,12 +51,8 @@ class SvStream; -/////////////////////////////////////////////////////////////////////////// - sal_Bool IsConvDic( const String &rFileURL, sal_Int16 &nLang, sal_Int16 &nConvType ); -/////////////////////////////////////////////////////////////////////////// - struct StrLT { bool operator()( const rtl::OUString &rTxt1, const rtl::OUString &rTxt2 ) const @@ -72,15 +69,14 @@ struct StrEQ } }; -typedef std::hash_multimap< const rtl::OUString, rtl::OUString, +typedef boost::unordered_multimap< const rtl::OUString, rtl::OUString, const rtl::OUStringHash, StrEQ > ConvMap; typedef std::set< rtl::OUString, StrLT > ConvMapKeySet; -typedef std::hash_multimap< const rtl::OUString, sal_Int16, +typedef boost::unordered_multimap< const rtl::OUString, sal_Int16, rtl::OUStringHash, StrEQ > PropTypeMap; -/////////////////////////////////////////////////////////////////////////// class ConvDic : public ::cppu::WeakImplHelper4 @@ -173,7 +169,7 @@ inline ::rtl::OUString ConvDic::getImplementationName_Static() throw() return A2OU( "com.sun.star.lingu2.ConvDic" ); } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index f1af7ea597df..b240d13e03a6 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.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. @@ -42,9 +43,7 @@ #include <com/sun/star/linguistic2/ConversionDictionaryType.hpp> #include <com/sun/star/util/XFlushable.hpp> #include <com/sun/star/lang/Locale.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.h> -#endif #include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/container/XNameContainer.hpp> @@ -56,9 +55,7 @@ #include "linguistic/misc.hxx" #include "defs.hxx" -//using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::lang; using namespace com::sun::star::uno; @@ -66,10 +63,11 @@ using namespace com::sun::star::container; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; + #define SN_CONV_DICTIONARY_LIST "com.sun.star.linguistic2.ConversionDictionaryList" -/////////////////////////////////////////////////////////////////////////// bool operator == ( const Locale &r1, const Locale &r2 ) { @@ -78,7 +76,6 @@ bool operator == ( const Locale &r1, const Locale &r2 ) r1.Variant == r2.Variant; } -/////////////////////////////////////////////////////////////////////////// String GetConvDicMainURL( const String &rDicName, const String &rDirectoryURL ) { @@ -98,7 +95,6 @@ String GetConvDicMainURL( const String &rDicName, const String &rDirectoryURL ) return aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); } -/////////////////////////////////////////////////////////////////////////// class ConvDicNameContainer : public cppu::WeakImplHelper1 @@ -179,7 +175,7 @@ void ConvDicNameContainer::FlushDics() const } catch(Exception &) { - DBG_ERROR( "flushing of conversion dictionary failed" ); + OSL_FAIL( "flushing of conversion dictionary failed" ); } } } @@ -321,7 +317,7 @@ void SAL_CALL ConvDicNameContainer::removeByName( const OUString& rName ) { ::ucbhelper::Content aCnt( aObj.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& ) { @@ -394,7 +390,6 @@ void ConvDicNameContainer::AddConvDics( } } -/////////////////////////////////////////////////////////////////////////// namespace { @@ -427,9 +422,6 @@ ConvDicList::ConvDicList() : ConvDicList::~ConvDicList() { - // NameContainer will deleted when the reference xNameContainer - // is destroyed. - // delete pNameContainer; if (!bDisposing && pNameContainer) pNameContainer->FlushDics(); @@ -545,8 +537,6 @@ uno::Sequence< OUString > SAL_CALL ConvDicList::queryConversions( { MutexGuard aGuard( GetLinguMutex() ); - /*sal_Int16 nLang = LocaleToLanguage( rLocale );*/ - sal_Int32 nCount = 0; uno::Sequence< OUString > aRes( 20 ); OUString *pRes = aRes.getArray(); @@ -662,7 +652,7 @@ sal_Bool SAL_CALL ConvDicList::supportsService( const OUString& rServiceName ) throw (RuntimeException) { MutexGuard aGuard( GetLinguMutex() ); - return rServiceName.equalsAscii( SN_CONV_DICTIONARY_LIST ); + return rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SN_CONV_DICTIONARY_LIST)); } @@ -683,7 +673,6 @@ uno::Sequence< OUString > ConvDicList::getSupportedServiceNames_Static() } -/////////////////////////////////////////////////////////////////////////// uno::Reference< uno::XInterface > SAL_CALL ConvDicList_CreateInstance( const uno::Reference< XMultiServiceFactory > & /*rSMgr*/ ) @@ -712,5 +701,5 @@ void * SAL_CALL ConvDicList_getFactory( return pRet; } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/convdiclist.hxx b/linguistic/source/convdiclist.hxx index 206f88bf1c22..f5f4c74360d8 100644 --- a/linguistic/source/convdiclist.hxx +++ b/linguistic/source/convdiclist.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. @@ -42,7 +43,6 @@ class ConvDicNameContainer; -/////////////////////////////////////////////////////////////////////////// class ConvDicList : public cppu::WeakImplHelper3 @@ -116,7 +116,7 @@ inline ::rtl::OUString ConvDicList::getImplementationName_Static() throw() return A2OU( "com.sun.star.lingu2.ConvDicList" ); } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index 64e6f7a071bd..56ddd94f4487 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.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,9 +45,7 @@ #include <com/sun/star/util/XFlushable.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/lang/EventObject.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.h> -#endif #include <com/sun/star/registry/XRegistryKey.hpp> #include <com/sun/star/util/XFlushListener.hpp> #include <com/sun/star/io/XActiveDataSource.hpp> @@ -64,18 +63,18 @@ using namespace std; using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; + #define XML_NAMESPACE_TCD_STRING "http://openoffice.org/2003/text-conversion-dictionary" #define CONV_TYPE_HANGUL_HANJA "Hangul / Hanja" #define CONV_TYPE_SCHINESE_TCHINESE "Chinese simplified / Chinese traditional" -/////////////////////////////////////////////////////////////////////////// static const OUString ConversionTypeToText( sal_Int16 nConversionType ) { @@ -97,7 +96,6 @@ static sal_Int16 GetConversionTypeFromText( const String &rText ) return nRes; } -/////////////////////////////////////////////////////////////////////////// class ConvDicXMLImportContext : public SvXMLImportContext @@ -204,7 +202,6 @@ public: ConvDic * GetDic() { return GetConvDicImport().GetDic(); } }; -/////////////////////////////////////////////////////////////////////////// void ConvDicXMLImportContext::Characters(const OUString & /*rChars*/) { @@ -216,8 +213,6 @@ void ConvDicXMLImportContext::Characters(const OUString & /*rChars*/) */ //collapsing not done yet! - // warning-free code: since the result is not used there is no need for trimming... - //const OUString &rChars2 = rChars.trim(); } SvXMLImportContext * ConvDicXMLImportContext::CreateChildContext( @@ -225,14 +220,13 @@ SvXMLImportContext * ConvDicXMLImportContext::CreateChildContext( const uno::Reference< xml::sax::XAttributeList > & /*rxAttrList*/ ) { SvXMLImportContext *pContext = 0; - if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAscii( "text-conversion-dictionary" )) + if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("text-conversion-dictionary"))) pContext = new ConvDicXMLDictionaryContext_Impl( GetConvDicImport(), nPrefix, rLocalName ); else pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); return pContext; } -//////////////////////////////////////// void ConvDicXMLDictionaryContext_Impl::StartElement( const uno::Reference< xml::sax::XAttributeList > &rxAttrList ) @@ -246,18 +240,14 @@ void ConvDicXMLDictionaryContext_Impl::StartElement( GetKeyByAttrName( aAttrName, &aLocalName ); OUString aValue = rxAttrList->getValueByIndex(i); - if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAscii( "lang" )) + if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("lang"))) nLanguage = MsLangId::convertIsoStringToLanguage( aValue ); - else if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAscii( "conversion-type" )) + else if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("conversion-type"))) nConversionType = GetConversionTypeFromText( aValue ); } GetConvDicImport().SetLanguage( nLanguage ); GetConvDicImport().SetConversionType( nConversionType ); - //!! hack to stop the parser from reading the rest of the file !! - //!! when only the header (language, conversion type) is needed !! -// if (GetConvDicImport().GetDic() == 0) -// throw uno::RuntimeException(); } SvXMLImportContext * ConvDicXMLDictionaryContext_Impl::CreateChildContext( @@ -265,21 +255,20 @@ SvXMLImportContext * ConvDicXMLDictionaryContext_Impl::CreateChildContext( const uno::Reference< xml::sax::XAttributeList > & /*rxAttrList*/ ) { SvXMLImportContext *pContext = 0; - if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAscii( "entry" )) + if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("entry"))) pContext = new ConvDicXMLEntryTextContext_Impl( GetConvDicImport(), nPrefix, rLocalName, *this ); else pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); return pContext; } -//////////////////////////////////////// SvXMLImportContext * ConvDicXMLEntryTextContext_Impl::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList > & /*rxAttrList*/ ) { SvXMLImportContext *pContext = 0; - if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAscii( "right-text" )) + if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("right-text"))) pContext = new ConvDicXMLRightTextContext_Impl( GetConvDicImport(), nPrefix, rLocalName, *this ); else pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); @@ -298,14 +287,13 @@ void ConvDicXMLEntryTextContext_Impl::StartElement( GetKeyByAttrName( aAttrName, &aLocalName ); OUString aValue = rxAttrList->getValueByIndex(i); - if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAscii( "left-text" )) + if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("left-text"))) aLeftText = aValue; - if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAscii( "property-type" )) + if (nPrefix == XML_NAMESPACE_TCD && aLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("property-type"))) nPropertyType = (sal_Int16) aValue.toInt32(); } } -//////////////////////////////////////// SvXMLImportContext * ConvDicXMLRightTextContext_Impl::CreateChildContext( sal_uInt16 nPrefix, const OUString& rLocalName, @@ -329,7 +317,6 @@ void ConvDicXMLRightTextContext_Impl::EndElement() } -/////////////////////////////////////////////////////////////////////////// sal_Bool ConvDicXMLExport::Export() { @@ -421,7 +408,6 @@ void ConvDicXMLExport::_ExportContent() return A2OU( "com.sun.star.lingu2.ConvDicXMLExport" ); } -/////////////////////////////////////////////////////////////////////////// void SAL_CALL ConvDicXMLImport::startDocument(void) throw( xml::sax::SAXException, uno::RuntimeException ) @@ -444,7 +430,7 @@ SvXMLImportContext * ConvDicXMLImport::CreateContext( const uno::Reference < xml::sax::XAttributeList > & /*rxAttrList*/ ) { SvXMLImportContext *pContext = 0; - if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAscii( "text-conversion-dictionary" )) + if (nPrefix == XML_NAMESPACE_TCD && rLocalName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("text-conversion-dictionary"))) pContext = new ConvDicXMLDictionaryContext_Impl( *this, nPrefix, rLocalName ); else pContext = new SvXMLImportContext( *this, nPrefix, rLocalName ); @@ -458,5 +444,5 @@ OUString SAL_CALL ConvDicXMLImport::getImplementationName() return A2OU( "com.sun.star.lingu2.ConvDicXMLImport" ); } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx index edf5ebe104d1..c93965d65dcf 100644 --- a/linguistic/source/convdicxml.hxx +++ b/linguistic/source/convdicxml.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,16 +45,12 @@ class ConvDic; -/////////////////////////////////////////////////////////////////////////// class ConvDicXMLExport : public SvXMLExport { ConvDic &rDic; sal_Bool bSuccess; -protected: - //void ExportNodes(const SmNode *pIn, int nLevel); - public: ConvDicXMLExport( ConvDic &rConvDic, const rtl::OUString &rFileName, @@ -128,7 +125,7 @@ public: void SetConversionType( sal_Int16 nType ) { nConversionType = nType; } }; -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/defs.hxx b/linguistic/source/defs.hxx index b888d86f8720..14c0ce2f2853 100644 --- a/linguistic/source/defs.hxx +++ b/linguistic/source/defs.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. @@ -38,15 +39,11 @@ class SvStream; -/////////////////////////////////////////////////////////////////////////// - -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) typedef boost::shared_ptr< SvStream > SvStreamPtr; namespace css = ::com::sun::star; -/////////////////////////////////////////////////////////////////////////// struct LangSvcEntries { @@ -117,7 +114,6 @@ struct LangSvcEntries_Thes : public LangSvcEntries LangSvcEntries_Thes( const css::uno::Sequence< ::rtl::OUString > &rSvcImplNames ) : LangSvcEntries( rSvcImplNames ) {} }; -/////////////////////////////////////////////////////////////////////////// // virtual base class for the different dispatchers class LinguDispatcher @@ -130,7 +126,7 @@ public: virtual DspType GetDspType() const = 0; }; -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 05924609384f..9339136b9faa 100755..100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.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. @@ -54,14 +55,14 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; -/////////////////////////////////////////////////////////////////////////// +using ::rtl::OUString; + #define BUFSIZE 4096 #define VERS2_NOLANGUAGE 1024 @@ -201,7 +202,6 @@ const String GetDicExtension() return String::CreateFromAscii( pDicExt ); } -/////////////////////////////////////////////////////////////////////////// DictionaryNeo::DictionaryNeo() : aDicEvtListeners( GetLinguMutex() ), @@ -297,7 +297,7 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL) sal_uLong nErr = sal::static_int_cast< sal_uLong >(-1); - // Header einlesen + // read header sal_Bool bNegativ; sal_uInt16 nLang; nDicVersion = ReadDicVersion(pStream, nLang, bNegativ); @@ -320,7 +320,7 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL) sal_uInt16 nLen = 0; sal_Char aWordBuf[ BUFSIZE ]; - // Das erste Wort einlesen + // Read the first word if (!pStream->IsEof()) { *pStream >> nLen; @@ -337,8 +337,8 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL) while(!pStream->IsEof()) { - // Aus dem File einlesen - // Einfuegen ins Woerterbuch ohne Konvertierung + // Read from file + // Paste in dictionary without converting if(*aWordBuf) { ByteString aDummy( aWordBuf ); @@ -349,7 +349,7 @@ sal_uLong DictionaryNeo::loadEntries(const OUString &rMainURL) } *pStream >> nLen; - if (pStream->IsEof()) // #75082# GPF in online-spelling + if (pStream->IsEof()) break; if (0 != (nErr = pStream->GetError())) return nErr; @@ -1076,7 +1076,6 @@ void SAL_CALL DictionaryNeo::storeToURL( } } -/////////////////////////////////////////////////////////////////////////// DicEntry::DicEntry() { @@ -1150,5 +1149,5 @@ OUString SAL_CALL DicEntry::getReplacementText( ) } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/dicimp.hxx b/linguistic/source/dicimp.hxx index d6b4653db28e..8f5e232b724d 100644 --- a/linguistic/source/dicimp.hxx +++ b/linguistic/source/dicimp.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. @@ -42,16 +43,11 @@ #include "defs.hxx" #include "linguistic/misc.hxx" - -/////////////////////////////////////////////////////////////////////////// - #define DIC_MAX_ENTRIES 30000 sal_Int16 ReadDicVersion( SvStreamPtr &rpStream, sal_uInt16 &nLng, sal_Bool &bNeg ); const String GetDicExtension(); -/////////////////////////////////////////////////////////////////////////// - class DictionaryNeo : public ::cppu::WeakImplHelper2 < @@ -195,7 +191,6 @@ public: }; -/////////////////////////////////////////////////////////////////////////// class DicEntry : public cppu::WeakImplHelper1 @@ -232,7 +227,7 @@ public: }; -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index e8e6ef4e15fd..319cd9d56be8 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.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. @@ -59,16 +60,15 @@ #include "dicimp.hxx" #include "lngopt.hxx" -//using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; -/////////////////////////////////////////////////////////////////////////// +using ::rtl::OUString; + static sal_Bool IsVers2OrNewer( const String& rFileURL, sal_uInt16& nLng, sal_Bool& bNeg ); @@ -76,7 +76,6 @@ static void AddInternal( const uno::Reference< XDictionary > &rDic, const rtl::OUString& rNew ); static void AddUserData( const uno::Reference< XDictionary > &rDic ); -/////////////////////////////////////////////////////////////////////////// class DicEvtListenerHelper : public cppu::WeakImplHelper1 @@ -183,10 +182,7 @@ void SAL_CALL DicEvtListenerHelper::processDictionaryEvent( || xDicEntry.is(), "lng : missing dictionary entry" ); - /*sal_Bool bActiveDicsModified = sal_False;*/ - // // evaluate DictionaryEvents and update data for next DictionaryListEvent - // DictionaryType eDicType = xDic->getDictionaryType(); DBG_ASSERT(eDicType != DictionaryType_MIXED, "lng : unexpected dictionary type"); @@ -296,7 +292,6 @@ sal_Int16 DicEvtListenerHelper::FlushEvents() } -/////////////////////////////////////////////////////////////////////////// void DicList::MyAppExitListener::AtExit() @@ -346,7 +341,7 @@ void DicList::SearchForDictionaries( if(!::IsVers2OrNewer( aURL, nLang, bNeg )) { - // Wenn kein + // When not xub_StrLen nPos = aURL.Search('.'); String aExt(aURL.Copy(nPos + 1)); aExt.ToLowerAscii(); @@ -359,9 +354,8 @@ void DicList::SearchForDictionaries( continue; // andere Files } - // Aufnehmen in die Liste der Dictionaries - // Wenn existent nicht aufnehmen - // + // Record in the list of Dictoinaries + // When it already exists don't record sal_Int16 nSystemLanguage = MsLangId::getSystemLanguage(); String aTmp1 = ToLower( aURL, nSystemLanguage ); xub_StrLen nPos = aTmp1.SearchBackward( '/' ); @@ -644,6 +638,7 @@ void SAL_CALL xDic->removeDictionaryEventListener( xDicEvtLstnrHelper ); } } + xDicEvtLstnrHelper.clear(); } } @@ -696,12 +691,10 @@ void DicList::_CreateDicList() // evaluate list of dictionaries to be activated from configuration - // //! to suppress overwriting the list of active dictionaries in the //! configuration with incorrect arguments during the following //! activation of the dictionaries pDicEvtLstnrHelper->BeginCollectEvents(); - // const uno::Sequence< rtl::OUString > aActiveDics( aOpt.GetActiveDics() ); const rtl::OUString *pActiveDic = aActiveDics.getConstArray(); sal_Int32 nLen = aActiveDics.getLength(); @@ -754,9 +747,7 @@ void DicList::SaveDics() } -/////////////////////////////////////////////////////////////////////////// // Service specific part -// rtl::OUString SAL_CALL DicList::getImplementationName( ) throw(RuntimeException) { @@ -791,7 +782,7 @@ uno::Sequence< rtl::OUString > DicList::getSupportedServiceNames_Static() throw( { osl::MutexGuard aGuard( GetLinguMutex() ); - uno::Sequence< rtl::OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich + uno::Sequence< rtl::OUString > aSNS( 1 ); // more than 1 service possible aSNS.getArray()[0] = A2OU( SN_DICTIONARY_LIST ); return aSNS; } @@ -815,7 +806,6 @@ void * SAL_CALL DicList_getFactory( const sal_Char * pImplName, return pRet; } -/////////////////////////////////////////////////////////////////////////// xub_StrLen lcl_GetToken( String &rToken, const String &rText, xub_StrLen nPos, const String &rDelim ) @@ -891,7 +881,6 @@ static void AddUserData( const uno::Reference< XDictionary > &rDic ) } } -/////////////////////////////////////////////////////////////////////////// #if defined _MSC_VER #pragma optimize("g",off) @@ -940,5 +929,5 @@ static sal_Bool IsVers2OrNewer( const String& rFileURL, sal_uInt16& nLng, sal_Bo return sal_False; } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/dlistimp.hxx b/linguistic/source/dlistimp.hxx index ca88be6660ca..ca8df5a3b2c4 100644 --- a/linguistic/source/dlistimp.hxx +++ b/linguistic/source/dlistimp.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. @@ -46,7 +47,6 @@ class DicEvtListenerHelper; -/////////////////////////////////////////////////////////////////////////// class DicList : public cppu::WeakImplHelper3 @@ -145,7 +145,7 @@ inline ::rtl::OUString DicList::getImplementationName_Static() throw() return A2OU( "com.sun.star.lingu2.DicList" ); } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 19972d641492..26cbb9f1a521 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.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. @@ -26,6 +27,7 @@ ************************************************************************/ #include "precompiled_linguistic.hxx" +#include <sal/macros.h> #include <com/sun/star/container/XContentEnumerationAccess.hpp> #include <com/sun/star/container/XEnumeration.hpp> #include <com/sun/star/container/XNameAccess.hpp> @@ -82,7 +84,6 @@ static ::rtl::OUString GrammarCheckingIterator_getImplementationName() throw(); static uno::Sequence< OUString > GrammarCheckingIterator_getSupportedServiceNames() throw(); -////////////////////////////////////////////////////////////////////// // white space list: obtained from the fonts.config.txt of a Linux system. static sal_Unicode aWhiteSpaces[] = @@ -137,7 +138,7 @@ static sal_Unicode aWhiteSpaces[] = 0xfffb /* INTERLINEAR ANNOTATION TERMINATOR */ }; -static int nWhiteSpaces = sizeof( aWhiteSpaces ) / sizeof( aWhiteSpaces[0] ); +static int nWhiteSpaces = SAL_N_ELEMENTS( aWhiteSpaces ); static bool lcl_IsWhiteSpace( sal_Unicode cChar ) { @@ -227,7 +228,6 @@ static sal_Int32 lcl_BacktraceWhiteSpaces( const OUString &rText, sal_Int32 nSta return nRes; } -////////////////////////////////////////////////////////////////////// extern "C" void workerfunc (void * gci) { @@ -242,37 +242,6 @@ static lang::Locale lcl_GetPrimaryLanguageOfSentence( return xFlatPara->getLanguageOfText( nStartIndex, 1 ); } -////////////////////////////////////////////////////////////////////// -/* -class MyThread : punlic osl::Thread -{ - void run () - { - DequeueAndCheck(); - } - - void own_terminate () - { - m_bEnd = true; - wait (3000); - terminate (); - } -} - -MyThread m_aQueue; - -vois startGrammarChecking() -{ - if (!m_aQueue.isRunning ()) - m_aQueue.create (); -} - -void stopGrammarChecking () -{ - if (m_aQueue.isRunning ()) - m_aQueue.own_terminate (); -} -*/ GrammarCheckingIterator::GrammarCheckingIterator( const uno::Reference< lang::XMultiServiceFactory > & rxMgr ) : m_xMSF( rxMgr ), @@ -371,9 +340,7 @@ void GrammarCheckingIterator::ProcessResult( } else // paragraph is still unchanged... { - // // mark found errors... - // sal_Int32 nTextLen = rRes.aText.getLength(); bool bBoundariesOk = 0 <= rRes.nStartOfSentencePosition && rRes.nStartOfSentencePosition <= nTextLen && @@ -424,7 +391,7 @@ void GrammarCheckingIterator::ProcessResult( } catch (lang::IllegalArgumentException &) { - DBG_ERROR( "commitMultiTextMarkup: IllegalArgumentException exception caught" ); + OSL_FAIL( "commitMultiTextMarkup: IllegalArgumentException exception caught" ); } } @@ -468,9 +435,7 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC // check supported locales for each grammarchecker if not already done if (!m_bGCServicesChecked) { - //GetAvailableGCSvcs_Impl(); GetConfiguredGCSvcs_Impl(); - //GetMatchingGCSvcs_Impl(); m_bGCServicesChecked = sal_True; } @@ -790,7 +755,7 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence( uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory(); if ( xMSF.is() ) xBreakIterator = uno::Reference < i18n::XBreakIterator >( xMSF->createInstance( - ::rtl::OUString::createFromAscii("com.sun.star.i18n.BreakIterator") ), uno::UNO_QUERY ); + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.i18n.BreakIterator")) ), uno::UNO_QUERY ); } sal_Int32 nTextLen = rText.getLength(); sal_Int32 nEndPosition = nTextLen; @@ -910,7 +875,6 @@ throw (uno::RuntimeException) { if (xListener.is()) { -// ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); m_aNotifyListeners.addInterface( xListener ); } return sal_True; @@ -923,7 +887,6 @@ throw (uno::RuntimeException) { if (xListener.is()) { -// ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); m_aNotifyListeners.removeInterface( xListener ); } return sal_True; @@ -936,9 +899,7 @@ throw (uno::RuntimeException) lang::EventObject aEvt( (linguistic2::XProofreadingIterator *) this ); m_aEventListeners.disposeAndClear( aEvt ); - // // now end the thread... - // m_aRequestEndThread.reset(); // ---- THREAD SAFE START ---- { @@ -979,7 +940,6 @@ throw (uno::RuntimeException) { if (xListener.is()) { -// ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); m_aEventListeners.addInterface( xListener ); } } @@ -991,7 +951,6 @@ throw (uno::RuntimeException) { if (xListener.is()) { -// ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); m_aEventListeners.removeInterface( xListener ); } } @@ -1102,116 +1061,7 @@ void GrammarCheckingIterator::GetConfiguredGCSvcs_Impl() } } -/* -void GrammarCheckingIterator::GetMatchingGCSvcs_Impl() -{ - GCImplNames_t aTmpGCImplNamesByLang; - - try - { - // get node names (locale iso strings) for configured grammar checkers - uno::Reference< container::XNameAccess > xNA( GetUpdateAccess(), uno::UNO_QUERY_THROW ); - xNA.set( xNA->getByName( A2OU("GrammarCheckers") ), uno::UNO_QUERY_THROW ); - const uno::Sequence< OUString > aGCImplNames( xNA->getElementNames() ); - const OUString *pGCImplNames = aGCImplNames.getConstArray(); - - sal_Int32 nLen = aGCImplNames.getLength(); - for (sal_Int32 i = 0; i < nLen; ++i) - { - uno::Reference< container::XNameAccess > xTmpNA( xNA->getByName( pGCImplNames[i] ), uno::UNO_QUERY_THROW ); - uno::Any aTmp( xTmpNA->getByName( A2OU("Locales") ) ); - uno::Sequence< OUString > aIsoLocaleNames; - if (aTmp >>= aIsoLocaleNames) - { - const OUString *pIsoLocaleNames = aIsoLocaleNames.getConstArray(); - for (sal_Int32 k = 0; k < aIsoLocaleNames.getLength(); ++k) - { - // if there are more grammar checkers for one language, for the time being, - // the last one found here will win... - const LanguageType nLang = MsLangId::convertIsoStringToLanguage( pIsoLocaleNames[k] ); - aTmpGCImplNamesByLang[ nLang ] = pGCImplNames[i]; - } - } - else - { - DBG_ASSERT( 0, "failed to get aImplNames. Wrong type?" ); - } - } - } - catch (uno::Exception &) - { - DBG_ASSERT( 0, "exception caught. Failed to get matching grammar checker services" ); - } - - { - // ---- THREAD SAFE START ---- - ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); - m_aGCImplNamesByLang = aTmpGCImplNamesByLang; - // ---- THREAD SAFE END ---- - } -} -*/ - -/* -void GrammarCheckingIterator::GetAvailableGCSvcs_Impl() -{ - // internal method; will always be called with locked mutex - if (m_xMSF.is()) - { - uno::Reference< container::XContentEnumerationAccess > xEnumAccess( m_xMSF, uno::UNO_QUERY ); - uno::Reference< container::XEnumeration > xEnum; - if (xEnumAccess.is()) - xEnum = xEnumAccess->createContentEnumeration( A2OU( SN_GRAMMARCHECKER ) ); - if (xEnum.is()) - { - while (xEnum->hasMoreElements()) - { - uno::Any aCurrent = xEnum->nextElement(); - uno::Reference< lang::XSingleComponentFactory > xCompFactory; - uno::Reference< lang::XSingleServiceFactory > xFactory; - - uno::Reference< uno::XComponentContext > xContext; - uno::Reference< beans::XPropertySet > xProps( m_xMSF, uno::UNO_QUERY ); - xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext; - - if ( xContext.is() && - (cppu::extractInterface( xCompFactory, aCurrent ) || - cppu::extractInterface( xFactory, aCurrent )) ) - { - try - { - uno::Reference< linguistic2::XProofreader > xSvc( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY ); - if (xSvc.is()) - { - OUString aImplName; - uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY ); - if (xInfo.is()) - aImplName = xInfo->getImplementationName(); - DBG_ASSERT( aImplName.getLength(), "empty implementation name" ); - uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY ); - DBG_ASSERT( xSuppLoc.is(), "interfaces not supported" ); - if (xSuppLoc.is() && aImplName.getLength() > 0) - { - uno::Sequence< lang::Locale > aLocaleSequence( xSuppLoc->getLocales() ); - // ---- THREAD SAFE START ---- - ::osl::Guard< ::osl::Mutex > aGuard( MyMutex::get() ); - m_aGCLocalesByService[ aImplName ] = aLocaleSequence; - m_aGCReferencesByService[ aImplName ] = xSvc; - // ---- THREAD SAFE END ---- - } - } - } - catch (uno::Exception &) - { - DBG_ASSERT( 0, "instantiating grammar checker failed" ); - } - } - } - } - } -} -*/ sal_Bool SAL_CALL GrammarCheckingIterator::supportsService( @@ -1288,7 +1138,6 @@ LinguDispatcher::DspType GrammarCheckingIterator::GetDspType() const } -/////////////////////////////////////////////////////////////////////////// static OUString GrammarCheckingIterator_getImplementationName() throw() @@ -1333,3 +1182,5 @@ void * SAL_CALL GrammarCheckingIterator_getFactory( } return pRet; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/gciterator.hxx b/linguistic/source/gciterator.hxx index 95105c7d29c9..aab04dd6f0ae 100644 --- a/linguistic/source/gciterator.hxx +++ b/linguistic/source/gciterator.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. @@ -49,7 +50,6 @@ #include "defs.hxx" -////////////////////////////////////////////////////////////////////// struct FPEntry @@ -78,7 +78,6 @@ struct FPEntry }; -/////////////////////////////////////////////////////////////////////////// class GrammarCheckingIterator: @@ -109,10 +108,6 @@ class GrammarCheckingIterator: typedef std::map< XComponent *, ::rtl::OUString > DocMap_t; DocMap_t m_aDocIdMap; - // parameter ::rtl::OUString --> implementation name - // parameter ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > --> list of locales supported by service -// typedef std::map< ::rtl::OUString, ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > > GCLocales_t; -// GCLocales_t m_aGCLocalesByService; // language -> implname mapping typedef std::map< LanguageType, ::rtl::OUString > GCImplNames_t; @@ -131,7 +126,6 @@ class GrammarCheckingIterator: //! beware of initilization order ! struct MyMutex : public rtl::Static< osl::Mutex, MyMutex > {}; - // cppu::OInterfaceContainerHelper m_aEventListeners; cppu::OInterfaceContainerHelper m_aNotifyListeners; @@ -153,8 +147,6 @@ class GrammarCheckingIterator: sal_Int32 GetSuggestedEndOfSentence( const ::rtl::OUString &rText, sal_Int32 nSentenceStartPos, const ::com::sun::star::lang::Locale &rLocale ); void GetConfiguredGCSvcs_Impl(); -// void GetMatchingGCSvcs_Impl(); -// void GetAvailableGCSvcs_Impl(); ::com::sun::star::uno::Reference< ::com::sun::star::linguistic2::XProofreader > GetGrammarChecker( const ::com::sun::star::lang::Locale & rLocale ); ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesBatch > GetUpdateAccess() const; @@ -203,7 +195,7 @@ public: }; -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx index d54bdbe4bbfa..706005a68c62 100644 --- a/linguistic/source/hhconvdic.cxx +++ b/linguistic/source/hhconvdic.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. @@ -42,9 +43,7 @@ #include <com/sun/star/linguistic2/XConversionDictionary.hpp> #include <com/sun/star/linguistic2/ConversionDictionaryType.hpp> #include <com/sun/star/lang/Locale.hpp> -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ #include <com/sun/star/uno/Reference.h> -#endif #include <com/sun/star/registry/XRegistryKey.hpp> #include "hhconvdic.hxx" @@ -53,16 +52,16 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; + #define SN_HH_CONV_DICTIONARY "com.sun.star.linguistic2.HangulHanjaConversionDictionary" -/////////////////////////////////////////////////////////////////////////// #include <i18nutil/unicode.hxx> #include <com/sun/star/i18n/UnicodeScript.hpp> @@ -100,7 +99,6 @@ sal_Bool TextIsAllScriptType( const OUString &rTxt, sal_Int16 nScriptType ) } -/////////////////////////////////////////////////////////////////////////// HHConvDic::HHConvDic( const String &rName, const String &rMainURL ) : ConvDic( rName, LANGUAGE_KOREAN, ConversionDictionaryType::HANGUL_HANJA, sal_True, rMainURL ) @@ -141,8 +139,8 @@ sal_Bool SAL_CALL HHConvDic::supportsService( const OUString& rServiceName ) { MutexGuard aGuard( GetLinguMutex() ); sal_Bool bRes = sal_False; - if (rServiceName.equalsAscii( SN_CONV_DICTIONARY )|| - rServiceName.equalsAscii( SN_HH_CONV_DICTIONARY )) + if (rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SN_CONV_DICTIONARY)) || + rServiceName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SN_HH_CONV_DICTIONARY))) bRes = sal_True; return bRes; } @@ -165,5 +163,5 @@ uno::Sequence< OUString > HHConvDic::getSupportedServiceNames_Static() return aSNS; } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/hhconvdic.hxx b/linguistic/source/hhconvdic.hxx index 8d30ea2fd812..1419e0d78608 100644 --- a/linguistic/source/hhconvdic.hxx +++ b/linguistic/source/hhconvdic.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. @@ -39,7 +40,6 @@ #include "defs.hxx" #include "convdic.hxx" -/////////////////////////////////////////////////////////////////////////// class HHConvDic : public ConvDic @@ -72,7 +72,7 @@ inline ::rtl::OUString HHConvDic::getImplementationName_Static() throw() return A2OU( "com.sun.star.lingu2.HHConvDic" ); } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index d296a8a56bfb..d745b10f4d4e 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.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. @@ -49,7 +50,6 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -57,7 +57,9 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; -/////////////////////////////////////////////////////////////////////////// +using ::rtl::OUString; +using ::rtl::OUStringBuffer; + HyphenatorDispatcher::HyphenatorDispatcher( LngSvcMgr &rLngSvcMgr ) : rMgr (rLngSvcMgr) @@ -338,7 +340,6 @@ Reference< XHyphenatedWord > SAL_CALL else if (pEntry->nLastTriedSvcIndex < nLen - 1) // instantiate services and try it { -// const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray(); Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray(); Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() ); @@ -347,9 +348,6 @@ Reference< XHyphenatedWord > SAL_CALL // build service initialization argument Sequence< Any > aArgs(2); aArgs.getArray()[0] <<= GetPropSet(); - //! The dispatcher searches the dictionary-list - //! thus the service needs not to now about it - //aArgs.getArray()[1] <<= GetDicList(); // create specific service via it's implementation name try @@ -477,7 +475,6 @@ Reference< XHyphenatedWord > SAL_CALL else if (pEntry->nLastTriedSvcIndex < nLen - 1) // instantiate services and try it { -// const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray(); Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray(); Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() ); @@ -486,9 +483,6 @@ Reference< XHyphenatedWord > SAL_CALL // build service initialization argument Sequence< Any > aArgs(2); aArgs.getArray()[0] <<= GetPropSet(); - //! The dispatcher searches the dictionary-list - //! thus the service needs not to now about it - //aArgs.getArray()[1] <<= GetDicList(); // create specific service via it's implementation name try @@ -611,7 +605,6 @@ Reference< XPossibleHyphens > SAL_CALL else if (pEntry->nLastTriedSvcIndex < nLen - 1) // instantiate services and try it { -// const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray(); Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray(); Reference< XMultiServiceFactory > xMgr( getProcessServiceFactory() ); @@ -620,9 +613,6 @@ Reference< XPossibleHyphens > SAL_CALL // build service initialization argument Sequence< Any > aArgs(2); aArgs.getArray()[0] <<= GetPropSet(); - //! The dispatcher searches the dictionary-list - //! thus the service needs not to now about it - //aArgs.getArray()[1] <<= GetDicList(); // create specific service via it's implementation name try @@ -684,8 +674,6 @@ void HyphenatorDispatcher::SetServiceList( const Locale &rLocale, { // modify/add entry LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get(); - // only one hypenator can be in use for a language... - //const OUString &rSvcImplName = rSvcImplNames.getConstArray()[0]; if (pEntry) { pEntry->Clear(); @@ -732,5 +720,5 @@ LinguDispatcher::DspType HyphenatorDispatcher::GetDspType() const } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/hyphdsp.hxx b/linguistic/source/hyphdsp.hxx index 8271c5f08969..520365d0edcf 100644 --- a/linguistic/source/hyphdsp.hxx +++ b/linguistic/source/hyphdsp.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,6 @@ class LngSvcMgr; -/////////////////////////////////////////////////////////////////////////// class HyphenatorDispatcher : public cppu::WeakImplHelper1 @@ -165,8 +165,8 @@ inline ::com::sun::star::uno::Reference< } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx index b27238c9218e..12244e21fc57 100644 --- a/linguistic/source/hyphdta.cxx +++ b/linguistic/source/hyphdta.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,18 +40,16 @@ #include <svl/lngmisc.hxx> #include <unotools/localedatawrapper.hxx> -//using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; -//using namespace com::sun::star::beans; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; +using ::rtl::OUString; + namespace linguistic { -/////////////////////////////////////////////////////////////////////////// HyphenatedWord::HyphenatedWord(const OUString &rWord, sal_Int16 nLang, sal_Int16 nHPos, @@ -133,7 +132,6 @@ sal_Bool SAL_CALL HyphenatedWord::isAlternativeSpelling() } -/////////////////////////////////////////////////////////////////////////// PossibleHyphens::PossibleHyphens(const OUString &rWord, sal_Int16 nLang, @@ -199,7 +197,7 @@ com::sun::star::uno::Reference < com::sun::star::linguistic2::XPossibleHyphens > } -/////////////////////////////////////////////////////////////////////////// } // namespace linguistic +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/iprcache.cxx b/linguistic/source/iprcache.cxx index bdde4e6851ff..60fead4a3374 100644 --- a/linguistic/source/iprcache.cxx +++ b/linguistic/source/iprcache.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,43 +37,22 @@ #include <com/sun/star/linguistic2/DictionaryListEventFlags.hpp> #include <tools/debug.hxx> #include <osl/mutex.hxx> - -//#define IPR_DEF_CACHE_SIZE 503 -#define IPR_DEF_CACHE_MAX 375 -#define IPR_DEF_CACHE_MAXINPUT 200 - -#ifdef DBG_STATISTIC -#include <tools/stream.hxx> - -//#define IPR_CACHE_SIZE nTblSize -#define IPR_CACHE_MAX nMax -#define IPR_CACHE_MAXINPUT nMaxInput - -#else - -//#define IPR_CACHE_SIZE IPR_DEF_CACHE_SIZE -#define IPR_CACHE_MAX IPR_DEF_CACHE_MAX -#define IPR_CACHE_MAXINPUT IPR_DEF_CACHE_MAXINPUT - -#endif #include <unotools/processfactory.hxx> - #include <linguistic/lngprops.hxx> using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; +using ::rtl::OUString; namespace linguistic { -/////////////////////////////////////////////////////////////////////////// #define NUM_FLUSH_PROPS 6 @@ -99,7 +79,7 @@ static void lcl_AddAsPropertyChangeListener( for (int i = 0; i < NUM_FLUSH_PROPS; ++i) { rPropSet->addPropertyChangeListener( - A2OU(aFlushProperties[i].pPropName), xListener ); + ::rtl::OUString::createFromAscii(aFlushProperties[i].pPropName), xListener ); } } } @@ -114,7 +94,7 @@ static void lcl_RemoveAsPropertyChangeListener( for (int i = 0; i < NUM_FLUSH_PROPS; ++i) { rPropSet->removePropertyChangeListener( - A2OU(aFlushProperties[i].pPropName), xListener ); + ::rtl::OUString::createFromAscii(aFlushProperties[i].pPropName), xListener ); } } } @@ -233,7 +213,6 @@ void SAL_CALL FlushListener::propertyChange( } -/////////////////////////////////////////////////////////////////////////// SpellCache::SpellCache() { @@ -278,7 +257,7 @@ void SpellCache::AddWord( const OUString& rWord, LanguageType nLang ) rList.clear(); rList.insert( rWord ); } -/////////////////////////////////////////////////////////////////////////// } // namespace linguistic +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/lng.component b/linguistic/source/lng.component index f4f3ca603a88..f4f3ca603a88 100644..100755 --- a/linguistic/source/lng.component +++ b/linguistic/source/lng.component diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index 95cde6a32812..b7b2f1546015 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.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,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" +#include <sal/macros.h> #include "lngopt.hxx" #include "linguistic/lngprops.hxx" #include "linguistic/misc.hxx" @@ -48,7 +50,6 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::container; using namespace com::sun::star::beans; @@ -59,12 +60,13 @@ using namespace linguistic; using namespace com::sun::star::registry; -/////////////////////////////////////////////////////////////////////////// +using ::rtl::OUString; + // static member intialization SvtLinguOptions * LinguOptions::pData = NULL; -vos::ORefCount LinguOptions::aRefCount; +oslInterlockedCount LinguOptions::nRefCount; LinguOptions::LinguOptions() @@ -76,14 +78,14 @@ LinguOptions::LinguOptions() aLinguCfg.GetOptions( *pData ); } - ++aRefCount; + osl_incrementInterlockedCount( &nRefCount ); } LinguOptions::LinguOptions(const LinguOptions & /*rOpt*/) { DBG_ASSERT( pData, "lng : data missing" ); - ++aRefCount; + osl_incrementInterlockedCount( &nRefCount ); } @@ -91,7 +93,7 @@ LinguOptions::~LinguOptions() { MutexGuard aGuard( GetLinguMutex() ); - if (--aRefCount == 0) + if ( osl_decrementInterlockedCount( &nRefCount ) == 0 ) { delete pData; pData = NULL; } @@ -190,8 +192,6 @@ sal_Bool LinguOptions::SetValue( Any &rOld, const Any &rVal, sal_Int32 nWID ) } } -// if (bRes) -// pData->SetModified(); return bRes; } @@ -297,23 +297,16 @@ OUString LinguOptions::GetName( sal_Int32 nWID ) OUString aRes; - sal_Int32 nLen = sizeof( aWID_Name ) / sizeof( aWID_Name[0] ); - if (0 <= nWID && nWID < nLen - && aWID_Name[ nWID ].nWID == nWID) - { - aRes = OUString( RTL_CONSTASCII_USTRINGPARAM( - aWID_Name[ nWID ].pPropertyName ) ); - } + sal_Int32 nLen = SAL_N_ELEMENTS( aWID_Name ); + if (0 <= nWID && nWID < nLen && aWID_Name[ nWID ].nWID == nWID) + aRes = OUString::createFromAscii(aWID_Name[nWID].pPropertyName); else - { - DBG_ASSERT( 0,"lng : unknown WID"); - } + OSL_FAIL("lng : unknown WID"); return aRes; } -/////////////////////////////////////////////////////////////////////////// //! map must be sorted by first entry in alphabetical increasing order. const SfxItemPropertyMapEntry* lcl_GetLinguProps() @@ -501,7 +494,6 @@ void SAL_CALL LinguProps::addVetoableChangeListener( const Reference< XVetoableChangeListener >& /*xListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { -// MutexGuard aGuard( GetLinguMutex() ); } void SAL_CALL LinguProps::removeVetoableChangeListener( @@ -509,7 +501,6 @@ void SAL_CALL LinguProps::removeVetoableChangeListener( const Reference< XVetoableChangeListener >& /*xListener*/ ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { -// MutexGuard aGuard( GetLinguMutex() ); } @@ -620,9 +611,7 @@ void SAL_CALL } -/////////////////////////////////////////////////////////////////////////// // Service specific part -// // XServiceInfo OUString SAL_CALL LinguProps::getImplementationName() @@ -660,7 +649,7 @@ uno::Sequence< OUString > LinguProps::getSupportedServiceNames_Static() { MutexGuard aGuard( GetLinguMutex() ); - uno::Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich + uno::Sequence< OUString > aSNS( 1 ); // more than 1 service possible aSNS.getArray()[0] = A2OU( SN_LINGU_PROPERTIES ); return aSNS; } @@ -684,5 +673,5 @@ void * SAL_CALL LinguProps_getFactory( const sal_Char * pImplName, return pRet; } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx index ecfa5461e2c3..d0e8ae556496 100644 --- a/linguistic/source/lngopt.hxx +++ b/linguistic/source/lngopt.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,7 +48,6 @@ #include <svl/itemprop.hxx> #include "linguistic/misc.hxx" #include "defs.hxx" -#include <vos/refernce.hxx> namespace com { namespace sun { namespace star { namespace beans { @@ -60,15 +60,13 @@ namespace com { namespace sun { namespace star { -/////////////////////////////////////////////////////////////////////////// // LinguOptions // This class represents all Linguistik relevant options. -// class LinguOptions { static SvtLinguOptions *pData; - static vos::ORefCount aRefCount; // number of objects of this class + static oslInterlockedCount nRefCount; // number of objects of this class //! uses default assignment-operator @@ -95,7 +93,6 @@ public: }; -/////////////////////////////////////////////////////////////////////////// // uses templates from <cppuhelper/interfacecontainer.h> @@ -113,7 +110,6 @@ typedef cppu::OMultiTypeInterfaceContainerHelperVar std::equal_to< sal_Int32 > > OPropertyListenerContainerHelper; -/////////////////////////////////////////////////////////////////////////// class LinguProps : @@ -180,7 +176,7 @@ inline ::rtl::OUString LinguProps::getImplementationName_Static() throw() return A2OU( "com.sun.star.lingu2.LinguProps" ); } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/lngprophelp.cxx b/linguistic/source/lngprophelp.cxx index 2854a74ae335..ef5a910e0867 100644 --- a/linguistic/source/lngprophelp.cxx +++ b/linguistic/source/lngprophelp.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_linguistic.hxx" #include <tools/debug.hxx> +#include <sal/macros.h> #include <com/sun/star/linguistic2/LinguServiceEvent.hpp> #include <com/sun/star/linguistic2/LinguServiceEventFlags.hpp> @@ -41,10 +43,7 @@ #include <linguistic/lngprophelp.hxx> - -//using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -52,10 +51,11 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; + namespace linguistic { -/////////////////////////////////////////////////////////////////////////// static const char *aCH[] = { @@ -63,7 +63,7 @@ static const char *aCH[] = UPN_IS_USE_DICTIONARY_LIST, }; -static int nCHCount = sizeof(aCH) / sizeof(aCH[0]); +static int nCHCount = SAL_N_ELEMENTS(aCH); PropertyChgHelper::PropertyChgHelper( @@ -80,7 +80,7 @@ PropertyChgHelper::PropertyChgHelper( OUString *pName = aPropNames.getArray(); for (sal_Int32 i = 0; i < nCHCount; ++i) { - pName[i] = A2OU( aCH[i] ); + pName[i] = ::rtl::OUString::createFromAscii( aCH[i] ); } SetDefaultValues(); @@ -117,7 +117,8 @@ void PropertyChgHelper::AddPropNames( const char *pNewNames[], sal_Int32 nCount OUString *pName = GetPropNames().getArray(); for (sal_Int32 i = 0; i < nCount; ++i) { - pName[ nLen + i ] = A2OU( pNewNames[ i ] ); + pName[ nLen + i ] = ::rtl::OUString::createFromAscii( pNewNames[ i ] ); + } } } @@ -168,7 +169,7 @@ void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals ) // temporary value bResIsIgnoreControlCharacters = bIsIgnoreControlCharacters; bResIsUseDictionaryList = bIsUseDictionaryList; - // + sal_Int32 nLen = rPropVals.getLength(); if (nLen) { @@ -184,7 +185,6 @@ void PropertyChgHelper::SetTmpPropVals( const PropertyValues &rPropVals ) pbResVal = &bResIsUseDictionaryList; break; default: ; - //DBG_ASSERT( 0, "unknown property" ); } if (pbResVal) pVal[i].Value >>= *pbResVal; @@ -222,7 +222,6 @@ sal_Bool PropertyChgHelper::propertyChange_Impl( const PropertyChangeEvent& rEvt default: { bRes = sal_False; - //DBG_ASSERT( 0, "unknown property" ); } } if (pbVal) @@ -344,7 +343,6 @@ sal_Bool SAL_CALL return bRes; } -/////////////////////////////////////////////////////////////////////////// PropertyHelper_Thes::PropertyHelper_Thes( @@ -371,7 +369,6 @@ void SAL_CALL } -/////////////////////////////////////////////////////////////////////////// // list of properties from the property set to be used // and listened to @@ -388,7 +385,7 @@ PropertyHelper_Spell::PropertyHelper_Spell( Reference< XPropertySet > &rxPropSet ) : PropertyChgHelper ( rxSource, rxPropSet, AE_SPELLCHECKER ) { - AddPropNames( aSP, sizeof(aSP) / sizeof(aSP[0]) ); + AddPropNames( aSP, SAL_N_ELEMENTS(aSP)); SetDefaultValues(); GetCurrentValues(); @@ -527,14 +524,14 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) nResMaxNumberOfSuggestions = GetDefaultNumberOfSuggestions(); bResIsSpellWithDigits = bIsSpellWithDigits; bResIsSpellCapitalization = bIsSpellCapitalization; - // + sal_Int32 nLen = rPropVals.getLength(); if (nLen) { const PropertyValue *pVal = rPropVals.getConstArray(); for (sal_Int32 i = 0; i < nLen; ++i) { - if (pVal[i].Name.equalsAscii( UPN_MAX_NUMBER_OF_SUGGESTIONS )) + if (pVal[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(UPN_MAX_NUMBER_OF_SUGGESTIONS))) { pVal[i].Value >>= nResMaxNumberOfSuggestions; } @@ -561,7 +558,6 @@ sal_Int16 PropertyHelper_Spell::GetDefaultNumberOfSuggestions() const return 16; } -/////////////////////////////////////////////////////////////////////////// static const char *aHP[] = { @@ -576,7 +572,7 @@ PropertyHelper_Hyphen::PropertyHelper_Hyphen( Reference< XPropertySet > &rxPropSet ) : PropertyChgHelper ( rxSource, rxPropSet, AE_HYPHENATOR ) { - AddPropNames( aHP, sizeof(aHP) / sizeof(aHP[0]) ); + AddPropNames( aHP, SAL_N_ELEMENTS(aHP)); SetDefaultValues(); GetCurrentValues(); } @@ -689,7 +685,7 @@ void PropertyHelper_Hyphen::SetTmpPropVals( const PropertyValues &rPropVals ) nResHyphMinLeading = nHyphMinLeading; nResHyphMinTrailing = nHyphMinTrailing; nResHyphMinWordLength = nHyphMinWordLength; - // + sal_Int32 nLen = rPropVals.getLength(); if (nLen) { @@ -866,7 +862,7 @@ sal_Bool PropertyHelper_Spelling::removeLinguServiceEventListener( } -/////////////////////////////////////////////////////////////////////////// } // namespace linguistic +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/lngreg.cxx b/linguistic/source/lngreg.cxx index 1f2ed71824b6..3ddf8f1ee046 100644 --- a/linguistic/source/lngreg.cxx +++ b/linguistic/source/lngreg.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. @@ -73,16 +74,8 @@ extern void * SAL_CALL GrammarCheckingIterator_getFactory void * ); -//extern void * SAL_CALL GrammarChecker_getFactory -//( -// const sal_Char * pImplName, -// XMultiServiceFactory * pServiceManager, -// void * -//); -//////////////////////////////////////// // definition of the two functions that are used to provide the services -// extern "C" { @@ -125,16 +118,9 @@ SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( pImplName, reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), pRegistryKey ); -/* - if(!pRet) - pRet = GrammarChecker_getFactory( - pImplName, - reinterpret_cast< XMultiServiceFactory * >( pServiceManager ), - pRegistryKey ); -*/ return pRet; } } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 2b88947aa9ee..14216f8f8174 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.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,8 +46,6 @@ #include <comphelper/extract.hxx> #include <rtl/logfile.hxx> -#include <boost/checked_delete.hpp> - #include "lngsvcmgr.hxx" #include "lngopt.hxx" #include "linguistic/misc.hxx" @@ -64,7 +63,6 @@ using ::rtl::OUString; uno::Sequence< OUString > static GetLangSvcList( const uno::Any &rVal ); uno::Sequence< OUString > static GetLangSvc( const uno::Any &rVal ); -/////////////////////////////////////////////////////////////////////////// static sal_Bool lcl_SeqHasString( const uno::Sequence< OUString > &rSeq, const OUString &rText ) { @@ -83,7 +81,6 @@ static sal_Bool lcl_SeqHasString( const uno::Sequence< OUString > &rSeq, const O return bRes; } -/////////////////////////////////////////////////////////////////////////// static uno::Sequence< lang::Locale > GetAvailLocales( const uno::Sequence< OUString > &rSvcImplNames ) @@ -154,7 +151,6 @@ static uno::Sequence< lang::Locale > GetAvailLocales( return aRes; } -/////////////////////////////////////////////////////////////////////////// struct SvcInfo { @@ -187,7 +183,6 @@ sal_Bool SvcInfo::HasLanguage( sal_Int16 nLanguage ) const } -/////////////////////////////////////////////////////////////////////////// void LngSvcMgr::SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, @@ -255,7 +250,7 @@ void LngSvcMgr::SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, size_t nAvailSvcs = rAvailSvcs.size(); for (size_t m = 0; m < nAvailSvcs; ++m) { - const SvcInfo &rSvcInfo = *rAvailSvcs[m]; + const SvcInfo &rSvcInfo = rAvailSvcs[m]; if (rSvcInfo.aSvcImplName == pImplNames[k] && rSvcInfo.HasLanguage( nLang )) { @@ -276,7 +271,6 @@ void LngSvcMgr::SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, } -/////////////////////////////////////////////////////////////////////////// class LngSvcMgrListenerHelper : @@ -287,13 +281,10 @@ class LngSvcMgrListenerHelper : > { LngSvcMgr &rMyManager; -// Timer aLaunchTimer; - //cppu::OMultiTypeInterfaceContainerHelper aListeners; ::cppu::OInterfaceContainerHelper aLngSvcMgrListeners; ::cppu::OInterfaceContainerHelper aLngSvcEvtBroadcasters; uno::Reference< linguistic2::XDictionaryList > xDicList; - uno::Reference< uno::XInterface > xMyEvtObj; sal_Int16 nCombinedLngSvcEvt; @@ -303,13 +294,11 @@ class LngSvcMgrListenerHelper : void LaunchEvent( sal_Int16 nLngSvcEvtFlags ); -// DECL_LINK( TimeOut, Timer* ); long Timeout(); public: LngSvcMgrListenerHelper( LngSvcMgr &rLngSvcMgr, - const uno::Reference< uno::XInterface > &rxSource, - const uno::Reference< linguistic2::XDictionaryList > &rxDicList ); + const uno::Reference< linguistic2::XDictionaryList > &rxDicList ); // lang::XEventListener virtual void SAL_CALL @@ -343,13 +332,11 @@ public: LngSvcMgrListenerHelper::LngSvcMgrListenerHelper( LngSvcMgr &rLngSvcMgr, - const uno::Reference< uno::XInterface > &rxSource, const uno::Reference< linguistic2::XDictionaryList > &rxDicList ) : rMyManager ( rLngSvcMgr ), aLngSvcMgrListeners ( GetLinguMutex() ), aLngSvcEvtBroadcasters ( GetLinguMutex() ), - xDicList ( rxDicList ), - xMyEvtObj ( rxSource ) + xDicList ( rxDicList ) { if (xDicList.is()) { @@ -357,14 +344,6 @@ LngSvcMgrListenerHelper::LngSvcMgrListenerHelper( (linguistic2::XDictionaryListEventListener *) this, sal_False ); } - //! The timer is used to 'sum up' different events in order to reduce the - //! number of events forwarded. - //! (This may happen already if a property was changed that has several - //! listeners, and each of them is launching an event of it's own!) - //! Thus this behaviour is necessary to avoid unecessary actions of - //! this objects listeners! -// aLaunchTimer.SetTimeout( 2000 ); -// aLaunchTimer.SetTimeoutHdl( LINK( this, LngSvcMgrListenerHelper, TimeOut ) ); nCombinedLngSvcEvt = 0; } @@ -390,12 +369,12 @@ long LngSvcMgrListenerHelper::Timeout() { osl::MutexGuard aGuard( GetLinguMutex() ); -// if (&aLaunchTimer == pTimer) { // change event source to LinguServiceManager since the listeners // probably do not know (and need not to know) about the specific // SpellChecker's or Hyphenator's. - linguistic2::LinguServiceEvent aEvtObj( xMyEvtObj, nCombinedLngSvcEvt ); + linguistic2::LinguServiceEvent aEvtObj( + static_cast<com::sun::star::linguistic2::XLinguServiceManager*>(&rMyManager), nCombinedLngSvcEvt ); nCombinedLngSvcEvt = 0; if (rMyManager.pSpellDsp) @@ -417,7 +396,6 @@ long LngSvcMgrListenerHelper::Timeout() void LngSvcMgrListenerHelper::AddLngSvcEvt( sal_Int16 nLngSvcEvt ) { nCombinedLngSvcEvt |= nLngSvcEvt; -// aLaunchTimer.Start(); Timeout(); } @@ -454,11 +432,8 @@ void SAL_CALL xRef->processDictionaryListEvent( rDicListEvent ); } - // // "translate" DictionaryList event into linguistic2::LinguServiceEvent - // sal_Int16 nLngSvcEvt = 0; - // sal_Int16 nSpellCorrectFlags = linguistic2::DictionaryListEventFlags::ADD_NEG_ENTRY | linguistic2::DictionaryListEventFlags::DEL_POS_ENTRY | @@ -466,7 +441,7 @@ void SAL_CALL linguistic2::DictionaryListEventFlags::DEACTIVATE_POS_DIC; if (0 != (nDlEvt & nSpellCorrectFlags)) nLngSvcEvt |= linguistic2::LinguServiceEventFlags::SPELL_CORRECT_WORDS_AGAIN; - // + sal_Int16 nSpellWrongFlags = linguistic2::DictionaryListEventFlags::ADD_POS_ENTRY | linguistic2::DictionaryListEventFlags::DEL_NEG_ENTRY | @@ -474,7 +449,7 @@ void SAL_CALL linguistic2::DictionaryListEventFlags::DEACTIVATE_NEG_DIC; if (0 != (nDlEvt & nSpellWrongFlags)) nLngSvcEvt |= linguistic2::LinguServiceEventFlags::SPELL_WRONG_WORDS_AGAIN; - // + sal_Int16 nHyphenateFlags = linguistic2::DictionaryListEventFlags::ADD_POS_ENTRY | linguistic2::DictionaryListEventFlags::DEL_POS_ENTRY | @@ -492,7 +467,8 @@ void SAL_CALL void LngSvcMgrListenerHelper::LaunchEvent( sal_Int16 nLngSvcEvtFlags ) { - linguistic2::LinguServiceEvent aEvt( xMyEvtObj, nLngSvcEvtFlags ); + linguistic2::LinguServiceEvent aEvt( + static_cast<com::sun::star::linguistic2::XLinguServiceManager*>(&rMyManager), nLngSvcEvtFlags ); // pass event on to linguistic2::XLinguServiceEventListener's cppu::OInterfaceIteratorHelper aIt( aLngSvcMgrListeners ); @@ -573,17 +549,12 @@ sal_Bool LngSvcMgrListenerHelper::RemoveLngSvcEvtBroadcaster( } -/////////////////////////////////////////////////////////////////////////// -LngSvcMgr::LngSvcMgr() : - utl::ConfigItem( String::CreateFromAscii( "Office.Linguistic" ) ), - aEvtListeners ( GetLinguMutex() ) +LngSvcMgr::LngSvcMgr() + : utl::ConfigItem(OUString(RTL_CONSTASCII_USTRINGPARAM("Office.Linguistic"))) + , aEvtListeners(GetLinguMutex()) { - bHasAvailSpellLocales = - bHasAvailGrammarLocales = - bHasAvailHyphLocales = - bHasAvailThesLocales = bDisposing = sal_False; pSpellDsp = 0; @@ -607,14 +578,6 @@ LngSvcMgr::LngSvcMgr() : EnableNotification( aNames ); } -void LngSvcMgr::clearSvcInfoArray(SvcInfoArray* pInfo) -{ - if (pInfo) - { - std::for_each(pInfo->begin(), pInfo->end(), boost::checked_deleter<SvcInfo>()); - delete pInfo; - } -} LngSvcMgr::~LngSvcMgr() { @@ -622,10 +585,10 @@ LngSvcMgr::~LngSvcMgr() // will be freed in the destructor of the respective Reference's // xSpellDsp, xGrammarDsp, xHyphDsp, xThesDsp - clearSvcInfoArray(pAvailSpellSvcs); - clearSvcInfoArray(pAvailGrammarSvcs); - clearSvcInfoArray(pAvailHyphSvcs); - clearSvcInfoArray(pAvailThesSvcs); + delete pAvailSpellSvcs; + delete pAvailGrammarSvcs; + delete pAvailHyphSvcs; + delete pAvailThesSvcs; } @@ -662,7 +625,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) if (0 == rName.compareTo( aSpellCheckerList, aSpellCheckerList.getLength() )) { // delete old cached data, needs to be acquired new on demand - clearSvcInfoArray(pAvailSpellSvcs); pAvailSpellSvcs = 0; + delete pAvailSpellSvcs; pAvailSpellSvcs = 0; OUString aNode( aSpellCheckerList ); if (lcl_SeqHasString( aSpellCheckerListEntries, aKeyText )) @@ -687,7 +650,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) else if (0 == rName.compareTo( aGrammarCheckerList, aGrammarCheckerList.getLength() )) { // delete old cached data, needs to be acquired new on demand - clearSvcInfoArray(pAvailGrammarSvcs); pAvailGrammarSvcs = 0; + delete pAvailGrammarSvcs; pAvailGrammarSvcs = 0; OUString aNode( aGrammarCheckerList ); if (lcl_SeqHasString( aGrammarCheckerListEntries, aKeyText )) @@ -715,7 +678,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) else if (0 == rName.compareTo( aHyphenatorList, aHyphenatorList.getLength() )) { // delete old cached data, needs to be acquired new on demand - clearSvcInfoArray(pAvailHyphSvcs); pAvailHyphSvcs = 0; + delete pAvailHyphSvcs; pAvailHyphSvcs = 0; OUString aNode( aHyphenatorList ); if (lcl_SeqHasString( aHyphenatorListEntries, aKeyText )) @@ -740,7 +703,7 @@ void LngSvcMgr::Notify( const uno::Sequence< OUString > &rPropertyNames ) else if (0 == rName.compareTo( aThesaurusList, aThesaurusList.getLength() )) { // delete old cached data, needs to be acquired new on demand - clearSvcInfoArray(pAvailThesSvcs); pAvailThesSvcs = 0; + delete pAvailThesSvcs; pAvailThesSvcs = 0; OUString aNode( aThesaurusList ); if (lcl_SeqHasString( aThesaurusListEntries, aKeyText )) @@ -782,8 +745,7 @@ void LngSvcMgr::GetListenerHelper_Impl() { if (!pListenerHelper) { - pListenerHelper = new LngSvcMgrListenerHelper( *this, - (XLinguServiceManager *) this, linguistic::GetDictionaryList() ); + pListenerHelper = new LngSvcMgrListenerHelper( *this, linguistic::GetDictionaryList() ); xListenerHelper = (linguistic2::XLinguServiceEventListener *) pListenerHelper; } } @@ -1148,10 +1110,6 @@ void LngSvcMgr::SetCfgServiceLists( SpellCheckerDispatcher &rSpellDsp ) uno::Sequence< OUString > aSvcImplNames; if (pValues[i] >>= aSvcImplNames) { -#if OSL_DEBUG_LEVEL > 1 -// sal_Int32 nSvcs = aSvcImplNames.getLength(); -// const OUString *pSvcImplNames = aSvcImplNames.getConstArray(); -#endif String aLocaleStr( pNames[i] ); xub_StrLen nSeperatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); aLocaleStr = aLocaleStr.Copy( nSeperatorPos + 1 ); @@ -1195,10 +1153,6 @@ void LngSvcMgr::SetCfgServiceLists( GrammarCheckingIterator &rGrammarDsp ) if (aSvcImplNames.getLength() > 1) aSvcImplNames.realloc(1); -#if OSL_DEBUG_LEVEL > 1 -// sal_Int32 nSvcs = aSvcImplNames.getLength(); -// const OUString *pSvcImplNames = aSvcImplNames.getConstArray(); -#endif String aLocaleStr( pNames[i] ); xub_StrLen nSeperatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); aLocaleStr = aLocaleStr.Copy( nSeperatorPos + 1 ); @@ -1242,10 +1196,6 @@ void LngSvcMgr::SetCfgServiceLists( HyphenatorDispatcher &rHyphDsp ) if (aSvcImplNames.getLength() > 1) aSvcImplNames.realloc(1); -#if OSL_DEBUG_LEVEL > 1 -// sal_Int32 nSvcs = aSvcImplNames.getLength(); -// const OUString *pSvcImplNames = aSvcImplNames.getConstArray(); -#endif String aLocaleStr( pNames[i] ); xub_StrLen nSeperatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); aLocaleStr = aLocaleStr.Copy( nSeperatorPos + 1 ); @@ -1285,10 +1235,6 @@ void LngSvcMgr::SetCfgServiceLists( ThesaurusDispatcher &rThesDsp ) uno::Sequence< OUString > aSvcImplNames; if (pValues[i] >>= aSvcImplNames) { -#if OSL_DEBUG_LEVEL > 1 -// sal_Int32 nSvcs = aSvcImplNames.getLength(); -// const OUString *pSvcImplNames = aSvcImplNames.getConstArray(); -#endif String aLocaleStr( pNames[i] ); xub_StrLen nSeperatorPos = aLocaleStr.SearchBackward( sal_Unicode( '/' ) ); aLocaleStr = aLocaleStr.Copy( nSeperatorPos + 1 ); @@ -1412,7 +1358,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - clearSvcInfoArray(pAvailSpellSvcs); pAvailSpellSvcs = 0; + delete pAvailSpellSvcs; pAvailSpellSvcs = 0; GetAvailableSpellSvcs_Impl(); pInfoArray = pAvailSpellSvcs; } @@ -1420,7 +1366,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - clearSvcInfoArray(pAvailGrammarSvcs); pAvailGrammarSvcs = 0; + delete pAvailGrammarSvcs; pAvailGrammarSvcs = 0; GetAvailableGrammarSvcs_Impl(); pInfoArray = pAvailGrammarSvcs; } @@ -1428,7 +1374,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - clearSvcInfoArray(pAvailHyphSvcs); pAvailHyphSvcs = 0; + delete pAvailHyphSvcs; pAvailHyphSvcs = 0; GetAvailableHyphSvcs_Impl(); pInfoArray = pAvailHyphSvcs; } @@ -1436,7 +1382,7 @@ uno::Sequence< OUString > SAL_CALL { // don't used cached data here (force re-evaluation in order to have downloaded dictionaries // already found without the need to restart the office - clearSvcInfoArray(pAvailThesSvcs); pAvailThesSvcs = 0; + delete pAvailThesSvcs; pAvailThesSvcs = 0; GetAvailableThesSvcs_Impl(); pInfoArray = pAvailThesSvcs; } @@ -1450,13 +1396,13 @@ uno::Sequence< OUString > SAL_CALL sal_uInt16 nCnt = 0; LanguageType nLanguage = LocaleToLanguage( rLocale ); - for (size_t i = 0; i < nMaxCnt; ++i) + for (size_t i = 0; i < nMaxCnt; ++i) { - const SvcInfo *pInfo = (*pInfoArray)[i]; + const SvcInfo &rInfo = (*pInfoArray)[i]; if (LANGUAGE_NONE == nLanguage - || (pInfo && pInfo->HasLanguage( nLanguage ))) + || rInfo.HasLanguage( nLanguage )) { - pImplName[ nCnt++ ] = pInfo->aSvcImplName; + pImplName[ nCnt++ ] = rInfo.aSvcImplName; } } @@ -1479,39 +1425,21 @@ uno::Sequence< lang::Locale > SAL_CALL uno::Sequence< lang::Locale > aRes; uno::Sequence< lang::Locale > *pAvailLocales = NULL; - sal_Bool *pHasAvailLocales = NULL; if (0 == rServiceName.compareToAscii( SN_SPELLCHECKER )) - { pAvailLocales = &aAvailSpellLocales; - pHasAvailLocales = &bHasAvailSpellLocales; - } else if (0 == rServiceName.compareToAscii( SN_GRAMMARCHECKER )) - { pAvailLocales = &aAvailGrammarLocales; - pHasAvailLocales = &bHasAvailGrammarLocales; - } else if (0 == rServiceName.compareToAscii( SN_HYPHENATOR )) - { pAvailLocales = &aAvailHyphLocales; - pHasAvailLocales = &bHasAvailHyphLocales; - } else if (0 == rServiceName.compareToAscii( SN_THESAURUS )) - { pAvailLocales = &aAvailThesLocales; - pHasAvailLocales = &bHasAvailThesLocales; - } - // about pHasAvailLocales: nowadays (with OOo lingu in SO) we want to know immediately about + // Nowadays (with OOo lingu in SO) we want to know immediately about // new downloaded dictionaries and have them ready right away if the Tools/Options... // is used to activate them. Thus we can not rely anymore on buffered data. - if (pAvailLocales /*&& pHasAvailLocales */) - { -// if (!*pHasAvailLocales) -// { - *pAvailLocales = GetAvailLocales( - getAvailableServices( rServiceName, lang::Locale() ) ); -// *pHasAvailLocales = sal_True; -// } + if (pAvailLocales) + { + *pAvailLocales = GetAvailLocales(getAvailableServices(rServiceName, lang::Locale())); aRes = *pAvailLocales; } @@ -1552,7 +1480,6 @@ void SAL_CALL osl::MutexGuard aGuard( GetLinguMutex() ); #if OSL_DEBUG_LEVEL > 1 -// const OUString *pImplNames = rServiceImplNames.getConstArray(); #endif LanguageType nLanguage = LocaleToLanguage( rLocale ); @@ -1684,7 +1611,7 @@ sal_Bool LngSvcMgr::SaveCfgSvcs( const String &rServiceName ) { DBG_ASSERT( 0, "node name missing" ); } - OUString aNodeName( A2OU(pNodeName) ); + OUString aNodeName( ::rtl::OUString::createFromAscii(pNodeName) ); for (sal_Int32 i = 0; i < nLen; ++i) { @@ -1784,7 +1711,6 @@ static uno::Sequence< OUString > GetLangSvc( const uno::Any &rVal ) } -/////////////////////////////////////////////////////////////////////////// uno::Sequence< OUString > SAL_CALL LngSvcMgr::getConfiguredServices( @@ -1804,7 +1730,7 @@ uno::Sequence< OUString > SAL_CALL OUString *pNames = aNames.getArray(); if ( 0 == rServiceName.compareToAscii( SN_SPELLCHECKER ) ) { - OUString aNode( OUString::createFromAscii( "ServiceManager/SpellCheckerList" )); + OUString aNode( RTL_CONSTASCII_USTRINGPARAM("ServiceManager/SpellCheckerList")); const uno::Sequence< OUString > aNodeEntries( GetNodeNames( aNode ) ); if (lcl_SeqHasString( aNodeEntries, aCfgLocale )) { @@ -1819,7 +1745,7 @@ uno::Sequence< OUString > SAL_CALL } else if ( 0 == rServiceName.compareToAscii( SN_GRAMMARCHECKER ) ) { - OUString aNode( OUString::createFromAscii( "ServiceManager/GrammarCheckerList" )); + OUString aNode( RTL_CONSTASCII_USTRINGPARAM("ServiceManager/GrammarCheckerList")); const uno::Sequence< OUString > aNodeEntries( GetNodeNames( aNode ) ); if (lcl_SeqHasString( aNodeEntries, aCfgLocale )) { @@ -1834,7 +1760,7 @@ uno::Sequence< OUString > SAL_CALL } else if ( 0 == rServiceName.compareToAscii( SN_HYPHENATOR ) ) { - OUString aNode( OUString::createFromAscii( "ServiceManager/HyphenatorList" )); + OUString aNode( RTL_CONSTASCII_USTRINGPARAM("ServiceManager/HyphenatorList")); const uno::Sequence< OUString > aNodeEntries( GetNodeNames( aNode ) ); if (lcl_SeqHasString( aNodeEntries, aCfgLocale )) { @@ -1849,7 +1775,7 @@ uno::Sequence< OUString > SAL_CALL } else if ( 0 == rServiceName.compareToAscii( SN_THESAURUS ) ) { - OUString aNode( OUString::createFromAscii( "ServiceManager/ThesaurusList" )); + OUString aNode( RTL_CONSTASCII_USTRINGPARAM("ServiceManager/ThesaurusList")); const uno::Sequence< OUString > aNodeEntries( GetNodeNames( aNode ) ); if (lcl_SeqHasString( aNodeEntries, aCfgLocale )) { @@ -1882,7 +1808,7 @@ void SAL_CALL bDisposing = sal_True; // require listeners to release this object - lang::EventObject aEvtObj( (XLinguServiceManager *) this ); + lang::EventObject aEvtObj( static_cast<XLinguServiceManager*>(this) ); aEvtListeners.disposeAndClear( aEvtObj ); if (pListenerHelper) @@ -1986,7 +1912,7 @@ uno::Sequence< OUString > LngSvcMgr::getSupportedServiceNames_Static() { osl::MutexGuard aGuard( GetLinguMutex() ); - uno::Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich + uno::Sequence< OUString > aSNS( 1 ); // more than 1 service possible aSNS.getArray()[0] = A2OU( SN_LINGU_SERVCICE_MANAGER ); return aSNS; } @@ -2023,5 +1949,5 @@ void * SAL_CALL LngSvcMgr_getFactory( } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx index 9116b36f767b..7054cf1b4455 100644 --- a/linguistic/source/lngsvcmgr.hxx +++ b/linguistic/source/lngsvcmgr.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. @@ -40,7 +41,7 @@ #include <com/sun/star/linguistic2/XAvailableLocales.hpp> #include <unotools/configitem.hxx> -//#include <vcl/timer.hxx> +#include <boost/ptr_container/ptr_vector.hpp> #include "linguistic/misc.hxx" #include "defs.hxx" @@ -61,7 +62,6 @@ namespace com { namespace sun { namespace star { namespace linguistic2 { class XThesaurus; } } } } -/////////////////////////////////////////////////////////////////////////// class LngSvcMgr : @@ -106,17 +106,13 @@ class LngSvcMgr : LngSvcMgrListenerHelper * pListenerHelper; - typedef std::vector< SvcInfo * > SvcInfoArray; + typedef boost::ptr_vector< SvcInfo > SvcInfoArray; SvcInfoArray * pAvailSpellSvcs; SvcInfoArray * pAvailGrammarSvcs; SvcInfoArray * pAvailHyphSvcs; SvcInfoArray * pAvailThesSvcs; sal_Bool bDisposing; - sal_Bool bHasAvailSpellLocales; - sal_Bool bHasAvailGrammarLocales; - sal_Bool bHasAvailHyphLocales; - sal_Bool bHasAvailThesLocales; // disallow copy-constructor and assignment-operator for now LngSvcMgr(const LngSvcMgr &); @@ -143,8 +139,6 @@ class LngSvcMgr : void SetAvailableCfgServiceLists( LinguDispatcher &rDispatcher, const SvcInfoArray &rAvailSvcs ); - static void clearSvcInfoArray(SvcInfoArray *pInfo); - // utl::ConfigItem (to allow for listening of changes of relevant properties) virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString > &rPropertyNames ); virtual void Commit(); @@ -195,7 +189,7 @@ inline ::rtl::OUString LngSvcMgr::getImplementationName_Static() } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index f0a26ca50f09..2f2df5e2f4a4 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.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,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" +#include <sal/macros.h> #include <tools/string.hxx> #include <tools/fsys.hxx> #include <tools/debug.hxx> @@ -61,7 +63,6 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -69,10 +70,11 @@ using namespace com::sun::star::uno; using namespace com::sun::star::i18n; using namespace com::sun::star::linguistic2; +using ::rtl::OUString; + namespace linguistic { -/////////////////////////////////////////////////////////////////////////// //!! multi-thread safe mutex for all platforms !! struct LinguMutex : public rtl::Static< osl::Mutex, LinguMutex > @@ -84,7 +86,6 @@ osl::Mutex & GetLinguMutex() return LinguMutex::get(); } -/////////////////////////////////////////////////////////////////////////// LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang ) { @@ -101,7 +102,6 @@ LocaleDataWrapper & GetLocaleDataWrapper( sal_Int16 nLang ) return aLclDtaWrp; } -/////////////////////////////////////////////////////////////////////////// /** returns text-encoding used for ByteString unicode String conversion @@ -173,7 +173,6 @@ rtl_TextEncoding GetTextEncoding( sal_Int16 nLanguage ) return nEncoding; } -/////////////////////////////////////////////////////////////////////////// static inline sal_Int32 Minimum( sal_Int32 n1, sal_Int32 n2, sal_Int32 n3 ) { @@ -181,7 +180,6 @@ static inline sal_Int32 Minimum( sal_Int32 n1, sal_Int32 n2, sal_Int32 n3 ) return nMin < n3 ? nMin : n3; } -/////////////////////////////////////////////////////////////////////////// class IntArray2D { @@ -263,7 +261,6 @@ sal_Int32 LevDistance( const OUString &rTxt1, const OUString &rTxt2 ) return nDist; } -/////////////////////////////////////////////////////////////////////////// sal_Bool IsUseDicList( const PropertyValues &rProperties, const uno::Reference< XPropertySet > &rxProp ) @@ -456,7 +453,6 @@ sal_uInt8 AddEntryToDic( } -/////////////////////////////////////////////////////////////////////////// LanguageType LocaleToLanguage( const Locale& rLocale ) { @@ -516,7 +512,6 @@ uno::Sequence< sal_Int16 > return aLangs; } -/////////////////////////////////////////////////////////////////////////// sal_Bool IsReadOnly( const String &rURL, sal_Bool *pbExist ) { @@ -548,7 +543,6 @@ sal_Bool IsReadOnly( const String &rURL, sal_Bool *pbExist ) return bRes; } -/////////////////////////////////////////////////////////////////////////// static sal_Bool GetAltSpelling( sal_Int16 &rnChgPos, sal_Int16 &rnChgLen, OUString &rRplc, @@ -704,7 +698,6 @@ uno::Reference< XHyphenatedWord > RebuildHyphensAndControlChars( } -/////////////////////////////////////////////////////////////////////////// static CharClass & lcl_GetCharClass() @@ -835,7 +828,7 @@ static const sal_uInt32 the_aDigitZeroes [] = sal_Bool HasDigits( const OUString &rText ) { - static const int nNumDigitZeroes = sizeof(the_aDigitZeroes) / sizeof(the_aDigitZeroes[0]); + static const int nNumDigitZeroes = SAL_N_ELEMENTS(the_aDigitZeroes); const sal_Int32 nLen = rText.getLength(); sal_Int32 i = 0; @@ -877,7 +870,6 @@ sal_Bool IsNumeric( const String &rText ) } -/////////////////////////////////////////////////////////////////////////// uno::Reference< XInterface > GetOneInstanceService( const char *pServiceName ) { @@ -890,7 +882,7 @@ uno::Reference< XInterface > GetOneInstanceService( const char *pServiceName ) { try { - xRef = xMgr->createInstance( A2OU( pServiceName ) ); + xRef = xMgr->createInstance( ::rtl::OUString::createFromAscii( pServiceName ) ); } catch (uno::Exception &) { @@ -929,7 +921,6 @@ uno::Reference< XDictionary > GetIgnoreAllList() return xRes; } -/////////////////////////////////////////////////////////////////////////// AppExitListener::AppExitListener() { @@ -987,7 +978,6 @@ void SAL_CALL AppExitListener::queryTermination( const EventObject& /*rEvtSource*/ ) throw(frame::TerminationVetoException, RuntimeException) { - //MutexGuard aGuard( GetLinguMutex() ); } @@ -1003,7 +993,7 @@ void SAL_CALL } } -/////////////////////////////////////////////////////////////////////////// } // namespace linguistic +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx index dbfbd19f3f55..6895eae9bff8 100644 --- a/linguistic/source/misc2.cxx +++ b/linguistic/source/misc2.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. @@ -51,7 +52,6 @@ using namespace com::sun::star; namespace linguistic { -/////////////////////////////////////////////////////////////////////////// sal_Bool FileExists( const String &rMainURL ) { @@ -72,70 +72,6 @@ sal_Bool FileExists( const String &rMainURL ) } -#ifdef TL_OUTDATED - -String GetFileURL( SvtPathOptions::Pathes ePath, const String &rFileName ) -{ - String aURL; - if (rFileName.Len()) - { - INetURLObject aURLObj; - aURLObj.SetSmartProtocol( INET_PROT_FILE ); - aURLObj.SetSmartURL( GetModulePath(ePath) ); - aURLObj.Append( rFileName ); - if (aURLObj.HasError()) - { - DBG_ASSERT(!aURLObj.HasError(), "lng : invalid URL"); - } - aURL = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI ); - } - return aURL; -} - - -String GetModulePath( SvtPathOptions::Pathes ePath, sal_Bool bAddAccessDelim ) -{ - String aRes; - - SvtPathOptions aPathOpt; - switch (ePath) - { - case SvtPathOptions::PATH_MODULE : - aRes = aPathOpt.GetModulePath(); - break; - case SvtPathOptions::PATH_LINGUISTIC : - { - String aTmp( aPathOpt.GetLinguisticPath() ); - utl::LocalFileHelper::ConvertURLToPhysicalName( aTmp, aRes ); - break; - } -/* - case SvtPathOptions::PATH_USERDICTIONARY : - { - String aTmp( aPathOpt.GetUserDictionaryPath() ); - utl::LocalFileHelper::ConvertURLToPhysicalName( aTmp, aRes ); - break; - } -*/ - default: - DBG_ASSERT( 0, "unexpected argument (path)" ); - } - if (bAddAccessDelim && aRes.Len()) - { -#ifdef WNT - aRes += '\\'; -#else - aRes += '/'; -#endif - } - - return aRes; -} - -#endif - -/////////////////////////////////////////////////////////////////////////// - rtl::OUString StripTrailingChars( rtl::OUString &rTxt, sal_Unicode cChar ) { sal_Int32 nTrailing = 0; @@ -149,7 +85,6 @@ rtl::OUString StripTrailingChars( rtl::OUString &rTxt, sal_Unicode cChar ) return aRes; } -/////////////////////////////////////////////////////////////////////////// static uno::Sequence< rtl::OUString > GetMultiPaths_Impl( const rtl::OUString &rPathPrefix, @@ -301,3 +236,4 @@ String SearchFileInPaths( } // namespace linguistic +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 6cc73236a5de..97f96ce227b4 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.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. @@ -50,7 +51,6 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -58,7 +58,8 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; -/////////////////////////////////////////////////////////////////////////// +using ::rtl::OUString; + // ProposalList: list of proposals for misspelled words // The order of strings in the array should be left unchanged because the // spellchecker should have put the more likely suggestions at the top. @@ -66,7 +67,6 @@ using namespace linguistic; // Removing entries is done by assigning the empty string. // The sequence is constructed from all non empty strings in the original // while maintaining the order. -// class ProposalList { std::vector< OUString > aVec; @@ -80,7 +80,6 @@ class ProposalList public: ProposalList() {} - //size_t Size() const { return aVec.size(); } size_t Count() const; void Prepend( const OUString &rText ); void Append( const OUString &rNew ); @@ -183,9 +182,6 @@ void ProposalList::Remove( const OUString &rText ) } } - -/////////////////////////////////////////////////////////////////////////// - sal_Bool SvcListHasLanguage( const LangSvcEntries_Spell &rEntry, LanguageType nLanguage ) @@ -208,9 +204,6 @@ sal_Bool SvcListHasLanguage( return bHasLanguage; } -/////////////////////////////////////////////////////////////////////////// - - SpellCheckerDispatcher::SpellCheckerDispatcher( LngSvcMgr &rLngSvcMgr ) : rMgr (rLngSvcMgr) { @@ -406,9 +399,6 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl( // build service initialization argument Sequence< Any > aArgs(2); aArgs.getArray()[0] <<= GetPropSet(); - //! The dispatcher searches the dictionary-list - //! thus the service needs not to now about it - //aArgs.getArray()[1] <<= GetDicList(); while (i < nLen && (!bTmpResValid || sal_False == bTmpRes)) { @@ -592,9 +582,6 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( // build service initialization argument Sequence< Any > aArgs(2); aArgs.getArray()[0] <<= GetPropSet(); - //! The dispatcher searches the dictionary-list - //! thus the service needs not to now about it - //aArgs.getArray()[1] <<= GetDicList(); sal_Int32 nNumSugestions = -1; while (i < nLen && (!bTmpResValid || xTmpRes.is())) @@ -679,12 +666,10 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( // list of proposals found (to be checked against entries of // neagtive dictionaries) ProposalList aProposalList; -// Sequence< OUString > aProposals; sal_Int16 eFailureType = -1; // no failure if (xRes.is()) { aProposalList.Append( xRes->getAlternatives() ); -// aProposals = xRes->getAlternatives(); eFailureType = xRes->getFailureType(); } Reference< XDictionaryList > xDList; @@ -867,5 +852,4 @@ void SpellCheckerDispatcher::FlushSpellCache() pCache->Flush(); } -/////////////////////////////////////////////////////////////////////////// - +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/spelldsp.hxx b/linguistic/source/spelldsp.hxx index 99c8eeefbc6b..9ae9cd45456b 100644 --- a/linguistic/source/spelldsp.hxx +++ b/linguistic/source/spelldsp.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,7 +53,6 @@ class LngSvcMgr; -/////////////////////////////////////////////////////////////////////////// class SpellCheckerDispatcher : public cppu::WeakImplHelper2 @@ -157,7 +157,7 @@ inline ::com::sun::star::uno::Reference< } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/spelldta.cxx b/linguistic/source/spelldta.cxx index 8bfdd1e609f6..ced7de88ed0f 100644 --- a/linguistic/source/spelldta.cxx +++ b/linguistic/source/spelldta.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. @@ -43,17 +44,17 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; +using ::rtl::OUString; + namespace linguistic { -/////////////////////////////////////////////////////////////////////////// #define MAX_PROPOSALS 40 @@ -234,14 +235,12 @@ Sequence< OUString > MergeProposalSeqs( pMerged[ nIndex++ ] = pAlt[ i ]; } } - //DBG_ASSERT(nIndex == nCountNew, "wrong number of proposals"); aMerged.realloc( nIndex ); } return aMerged; } -/////////////////////////////////////////////////////////////////////////// SpellAlternatives::SpellAlternatives() @@ -370,7 +369,7 @@ com::sun::star::uno::Reference < com::sun::star::linguistic2::XSpellAlternatives return Reference < XSpellAlternatives >(pAlt); } -/////////////////////////////////////////////////////////////////////////// } // namespace linguistic +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index 8cf9110c7570..7e4f72308597 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.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. @@ -42,7 +43,6 @@ using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -50,7 +50,8 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; -/////////////////////////////////////////////////////////////////////////// +using ::rtl::OUString; + static sal_Bool SvcListHasLanguage( const Sequence< Reference< XThesaurus > > &rRefs, @@ -69,7 +70,6 @@ static sal_Bool SvcListHasLanguage( return bHasLanguage; } -/////////////////////////////////////////////////////////////////////////// ThesaurusDispatcher::ThesaurusDispatcher() @@ -278,5 +278,5 @@ LinguDispatcher::DspType ThesaurusDispatcher::GetDspType() const } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/thesdsp.hxx b/linguistic/source/thesdsp.hxx index e7eeeff120ee..dabd278a8926 100644 --- a/linguistic/source/thesdsp.hxx +++ b/linguistic/source/thesdsp.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,7 +46,7 @@ #include <cppuhelper/implbase5.hxx> // helper for implementations #include <cppuhelper/interfacecontainer.h> -#include <vos/mutex.hxx> +#include <osl/mutex.hxx> #include <boost/shared_ptr.hpp> #include <map> @@ -53,7 +54,6 @@ #include "lngopt.hxx" -/////////////////////////////////////////////////////////////////////////// class ThesaurusDispatcher : public cppu::WeakImplHelper1 @@ -123,7 +123,7 @@ inline ::com::sun::star::uno::Reference< } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/source/thesdta.cxx b/linguistic/source/thesdta.cxx index 1978923a59ff..218e5ce2af89 100644 --- a/linguistic/source/thesdta.cxx +++ b/linguistic/source/thesdta.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,9 +35,7 @@ #include "thesdta.hxx" -//using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -44,11 +43,11 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; namespace linguistic { -/////////////////////////////////////////////////////////////////////////// ThesaurusMeaning::ThesaurusMeaning(const OUString &rText, @@ -77,7 +76,7 @@ uno::Sequence< OUString > SAL_CALL ThesaurusMeaning::querySynonyms() } */ -/////////////////////////////////////////////////////////////////////////// } // namespace linguistic +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/workben/exports.dxp b/linguistic/workben/exports.dxp index b0f85bf7bebf..b0f85bf7bebf 100644..100755 --- a/linguistic/workben/exports.dxp +++ b/linguistic/workben/exports.dxp diff --git a/linguistic/workben/makefile.mk b/linguistic/workben/makefile.mk index 26cbb7ec8d65..6c04929d7b73 100644..100755 --- a/linguistic/workben/makefile.mk +++ b/linguistic/workben/makefile.mk @@ -77,7 +77,6 @@ SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1STDLIBS= \ $(CPPULIB) \ $(CPPUHELPERLIB) \ - $(VOSLIB) \ $(TOOLSLIB) \ $(SVTOOLLIB) \ $(SVLLIB) \ diff --git a/linguistic/workben/sprophelp.cxx b/linguistic/workben/sprophelp.cxx index dcfa1d240cde..62f4b215ecba 100644 --- a/linguistic/workben/sprophelp.cxx +++ b/linguistic/workben/sprophelp.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,6 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" +#include <sal/macros.h> #include "linguistic/misc.hxx" #include "sprophelp.hxx" @@ -40,9 +42,7 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <osl/mutex.hxx> -//using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -50,10 +50,10 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) +#define A2OU(x) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( x )) -/////////////////////////////////////////////////////////////////////////// PropertyChgHelper::PropertyChgHelper( @@ -68,7 +68,7 @@ PropertyChgHelper::PropertyChgHelper( OUString *pName = aPropNames.getArray(); for (INT32 i = 0; i < nPropCount; ++i) { - pName[i] = A2OU( pPropNames[i] ); + pName[i] = ::rtl::OUString::createFromAscii( pPropNames[i] ); } } @@ -176,7 +176,6 @@ sal_Bool SAL_CALL return bRes; } -/////////////////////////////////////////////////////////////////////////// static const char *aSP[] = { @@ -192,7 +191,7 @@ static const char *aSP[] = PropertyHelper_Spell::PropertyHelper_Spell( const Reference< XInterface > & rxSource, Reference< XPropertySet > &rxPropSet ) : - PropertyChgHelper ( rxSource, rxPropSet, aSP, sizeof(aSP) / sizeof(aSP[0]) ) + PropertyChgHelper ( rxSource, rxPropSet, aSP, SAL_N_ELEMENTS(aSP)) { SetDefault(); INT32 nLen = GetPropNames().getLength(); @@ -315,7 +314,7 @@ void SAL_CALL break; } default: - DBG_ERROR( "unknown property" ); + OSL_FAIL( "unknown property" ); } if (pbVal) rEvt.NewValue >>= *pbVal; @@ -343,7 +342,7 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) bResIsSpellUpperCase = bIsSpellUpperCase; bResIsSpellWithDigits = bIsSpellWithDigits; bResIsSpellCapitalization = bIsSpellCapitalization; - // + INT32 nLen = rPropVals.getLength(); if (nLen) { @@ -360,7 +359,7 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) case UPH_IS_SPELL_WITH_DIGITS : pbResVal = &bResIsSpellWithDigits; break; case UPH_IS_SPELL_CAPITALIZATION : pbResVal = &bResIsSpellCapitalization; break; default: - DBG_ERROR( "unknown property" ); + OSL_FAIL( "unknown property" ); } if (pbResVal) pVal[i].Value >>= *pbResVal; @@ -368,5 +367,5 @@ void PropertyHelper_Spell::SetTmpPropVals( const PropertyValues &rPropVals ) } } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/workben/sprophelp.hxx b/linguistic/workben/sprophelp.hxx index 92e25e88f221..b5cf94f84a48 100644 --- a/linguistic/workben/sprophelp.hxx +++ b/linguistic/workben/sprophelp.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. @@ -53,7 +54,6 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::linguistic2; -/////////////////////////////////////////////////////////////////////////// // PropertyChgHelper // virtual base class for all XPropertyChangeListener members of the // various lingu services. @@ -116,7 +116,6 @@ public: }; -/////////////////////////////////////////////////////////////////////////// class PropertyHelper_Spell : @@ -166,7 +165,7 @@ public: BOOL IsSpellCapitalization() const { return bResIsSpellCapitalization; } }; -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/workben/sreg.cxx b/linguistic/workben/sreg.cxx index 21fa50246472..85e218da1ef5 100644 --- a/linguistic/workben/sreg.cxx +++ b/linguistic/workben/sreg.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 @@ using namespace com::sun::star::lang; using namespace com::sun::star::registry; -//////////////////////////////////////// // declaration of external RegEntry-functions defined by the service objects -// extern sal_Bool SAL_CALL SpellChecker_writeInfo( void * /*pServiceManager*/, XRegistryKey * pRegistryKey ); @@ -49,9 +48,7 @@ extern void * SAL_CALL SpellChecker_getFactory( XMultiServiceFactory * pServiceManager, void * /*pRegistryKey*/ ); -//////////////////////////////////////// // definition of the two functions that are used to provide the services -// extern "C" { @@ -62,13 +59,13 @@ sal_Bool SAL_CALL component_writeInfo( return SpellChecker_writeInfo( pServiceManager, pRegistryKey ); } -void SAL_CALL component_getImplementationEnvironment( +SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } -void * SAL_CALL component_getFactory( +SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) { void * pRet = SpellChecker_getFactory( @@ -81,5 +78,5 @@ void * SAL_CALL component_getFactory( } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/workben/sspellimp.cxx b/linguistic/workben/sspellimp.cxx index 38123a144655..bed18d9df855 100644 --- a/linguistic/workben/sspellimp.cxx +++ b/linguistic/workben/sspellimp.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,16 +38,13 @@ #include <unotools/processfactory.hxx> #include <osl/mutex.hxx> -#ifndef _SPELLIMP_HXX #include <sspellimp.hxx> -#endif #include "linguistic/lngprops.hxx" #include "linguistic/spelldta.hxx" using namespace utl; using namespace osl; -using namespace rtl; using namespace com::sun::star; using namespace com::sun::star::beans; using namespace com::sun::star::lang; @@ -54,8 +52,8 @@ using namespace com::sun::star::uno; using namespace com::sun::star::linguistic2; using namespace linguistic; +using ::rtl::OUString; -/////////////////////////////////////////////////////////////////////////// BOOL operator == ( const Locale &rL1, const Locale &rL2 ) { @@ -64,7 +62,6 @@ BOOL operator == ( const Locale &rL1, const Locale &rL2 ) rL1.Variant == rL2.Variant; } -/////////////////////////////////////////////////////////////////////////// SpellChecker::SpellChecker() : @@ -366,7 +363,6 @@ void SAL_CALL { Reference< XPropertySet > xPropSet; rArguments.getConstArray()[0] >>= xPropSet; - //rArguments.getConstArray()[1] >>= xDicList; //! Pointer allows for access of the non-UNO functions. //! And the reference to the UNO-functions while increasing @@ -377,7 +373,7 @@ void SAL_CALL pPropHelper->AddAsPropListener(); //! after a reference is established } else - DBG_ERROR( "wrong number of arguments in sequence" ); + OSL_FAIL( "wrong number of arguments in sequence" ); } } @@ -419,9 +415,7 @@ void SAL_CALL } -/////////////////////////////////////////////////////////////////////////// // Service specific part -// OUString SAL_CALL SpellChecker::getImplementationName() throw(RuntimeException) @@ -458,7 +452,7 @@ Sequence< OUString > SpellChecker::getSupportedServiceNames_Static() { MutexGuard aGuard( GetLinguMutex() ); - Sequence< OUString > aSNS( 1 ); // auch mehr als 1 Service moeglich + Sequence< OUString > aSNS( 1 ); // more than 1 service possible aSNS.getArray()[0] = A2OU( SN_SPELLCHECKER ); return aSNS; } @@ -508,5 +502,5 @@ void * SAL_CALL SpellChecker_getFactory( const sal_Char * pImplName, } -/////////////////////////////////////////////////////////////////////////// +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/workben/sspellimp.hxx b/linguistic/workben/sspellimp.hxx index e6796afc6356..bc85186a07d0 100644 --- a/linguistic/workben/sspellimp.hxx +++ b/linguistic/workben/sspellimp.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,10 +53,6 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::linguistic2; -#define A2OU(x) ::rtl::OUString::createFromAscii( x ) - -/////////////////////////////////////////////////////////////////////////// - class SpellChecker : public cppu::WeakImplHelper6 @@ -143,9 +140,7 @@ public: removeEventListener( const Reference< XEventListener >& rxListener ) throw(RuntimeException); - //////////////////////////////////////////////////////////// // Service specific part - // // XServiceInfo virtual OUString SAL_CALL @@ -167,11 +162,11 @@ public: inline OUString SpellChecker::getImplementationName_Static() throw() { - return A2OU( "com.sun.star.lingu.examples.SpellChecker" ); + return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.lingu.examples.SpellChecker" )); } -/////////////////////////////////////////////////////////////////////////// #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/linguistic/xml/linguistic.xml b/linguistic/xml/linguistic.xml index 83aaaeb0c1e0..83aaaeb0c1e0 100644..100755 --- a/linguistic/xml/linguistic.xml +++ b/linguistic/xml/linguistic.xml |