diff options
author | Bjoern Michaelsen <b_michaelsen@openoffice.org> | 2010-07-13 14:36:24 +0200 |
---|---|---|
committer | Bjoern Michaelsen <b_michaelsen@openoffice.org> | 2010-07-13 14:36:24 +0200 |
commit | fd90f23f3a727dc80e4fa0be1a2a967feee8cb43 (patch) | |
tree | d5dd671ec5249774c3efdd741a0964181b802c49 /linguistic | |
parent | e8ec11b41233376724acd0f58bf3f6439c0e21d8 (diff) | |
parent | a2e7c2e0d002d75a6b77a629a4e904ab54bf8375 (diff) |
CWS gnumake2: resync to DEV300_m84
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/prj/build.lst | 1 | ||||
-rw-r--r-- | linguistic/qa/unoapi/Test.java | 51 | ||||
-rw-r--r-- | linguistic/qa/unoapi/makefile.mk | 30 | ||||
-rw-r--r-- | linguistic/source/convdiclist.cxx | 38 | ||||
-rw-r--r-- | linguistic/source/dicimp.cxx | 48 | ||||
-rw-r--r-- | linguistic/source/dlistimp.cxx | 7 | ||||
-rw-r--r-- | linguistic/source/staticmb.cxx | 29 | ||||
-rw-r--r-- | linguistic/workben/lex.map | 8 | ||||
-rw-r--r-- | linguistic/workben/makefile.mk | 2 |
9 files changed, 111 insertions, 103 deletions
diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index 8e09e3fd4226..57c332f6f3ea 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -3,3 +3,4 @@ lg linguistic usr1 - all lg_mkout NULL lg linguistic\prj get - all lg_prj NULL lg linguistic\inc nmake - all lg_inc NULL lg linguistic\source nmake - all lg_src lg_inc NULL +lg linguistic\qa\unoapi nmake - all lg_qa_unoapi NULL diff --git a/linguistic/qa/unoapi/Test.java b/linguistic/qa/unoapi/Test.java new file mode 100644 index 000000000000..4a96418255ff --- /dev/null +++ b/linguistic/qa/unoapi/Test.java @@ -0,0 +1,51 @@ +/************************************************************************* +* 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 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", "lng.sce", "-xcl", "knownissues.xcl", "-cs", + connection.getDescription())); + } + + private final OfficeConnection connection = new OfficeConnection(); +} diff --git a/linguistic/qa/unoapi/makefile.mk b/linguistic/qa/unoapi/makefile.mk index d24be0361501..bd330c6fbaca 100644 --- a/linguistic/qa/unoapi/makefile.mk +++ b/linguistic/qa/unoapi/makefile.mk @@ -1,7 +1,6 @@ #************************************************************************* -# # 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 @@ -22,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # <http://www.openoffice.org/license.html> # for a copy of the LGPLv3 License. -# -#************************************************************************* +#***********************************************************************/ -PRJ=..$/.. +.IF "$(OOO_SUBSEQUENT_TESTS)" == "" +nothing .PHONY: +.ELSE -PRJNAME=linguistic -TARGET=qa_unoapi +PRJ = ../.. +PRJNAME = linguistic +TARGET = qa_unoapi -.INCLUDE: settings.mk +.IF "$(OOO_JUNIT_JAR)" != "" +PACKAGE = org/openoffice/linguistic/qa/unoapi +JAVATESTFILES = Test.java +JAVAFILES = $(JAVATESTFILES) +JARFILES = OOoRunner.jar ridl.jar test.jar +EXTRAJARFILES = $(OOO_JUNIT_JAR) +.END +.INCLUDE: settings.mk .INCLUDE: target.mk +.INCLUDE: installationtest.mk -ALLTAR : UNOAPI_TEST +ALLTAR : javatest -UNOAPI_TEST: - +$(SOLARENV)$/bin$/checkapi -sce lng.sce -xcl knownissues.xcl -tdoc $(PWD)$/testdocuments +.END diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 86c8e25b787c..6f94f4735fab 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -27,6 +27,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" + #include <tools/fsys.hxx> #include <tools/stream.hxx> #include <tools/urlobj.hxx> @@ -397,41 +398,12 @@ void ConvDicNameContainer::AddConvDics( namespace { -template<typename T, typename InitData, - typename Unique = InitData, typename Data = T> -class StaticWithInit_ { -public: - /** Gets the static. Mutual exclusion is performed using the - osl global mutex. - - @return - static variable - */ - static T & get() { - return *rtl_Instance< - T, StaticInstanceWithInit, - ::osl::MutexGuard, ::osl::GetGlobalMutex, - Data, InitData >::create( StaticInstanceWithInit(), - ::osl::GetGlobalMutex(), - InitData() ); - } -private: - struct StaticInstanceWithInit { - T * operator () ( Data d ) { - static T instance(d); - return &instance; + struct StaticConvDicList : public rtl::StaticWithInit< + uno::Reference<XInterface>, StaticConvDicList> { + uno::Reference<XInterface> operator () () { + return (cppu::OWeakObject *) new ConvDicList; } }; -}; - -//after src680m62 you can replace StaticWithInit_ with rtl::StaticWithInit and remove the above definition of StaticWithInit_ - -struct StaticConvDicList : public StaticWithInit_< - uno::Reference<XInterface>, StaticConvDicList> { - uno::Reference<XInterface> operator () () { - return (cppu::OWeakObject *) new ConvDicList; - } -}; } diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 969321ec3991..fe53bf344ac3 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -74,6 +74,12 @@ static const sal_Char* pVerStr5 = "WBSWG5"; static const sal_Char* pVerStr6 = "WBSWG6"; static const sal_Char* pVerOOo7 = "OOoUserDict1"; +static const INT16 DIC_VERSION_DONTKNOW = -1; +static const INT16 DIC_VERSION_2 = 2; +static const INT16 DIC_VERSION_5 = 5; +static const INT16 DIC_VERSION_6 = 6; +static const INT16 DIC_VERSION_7 = 7; + static sal_Bool getTag(const ByteString &rLine, const sal_Char *pTagName, ByteString &rTagValue) { @@ -89,7 +95,7 @@ static sal_Bool getTag(const ByteString &rLine, INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) { // Sniff the header - INT16 nDicVersion; + INT16 nDicVersion = DIC_VERSION_DONTKNOW; sal_Char pMagicHeader[MAX_HEADER_LENGTH]; nLng = LANGUAGE_NONE; @@ -107,7 +113,7 @@ INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) sal_Bool bSuccess; ByteString aLine; - nDicVersion = 7; + nDicVersion = DIC_VERSION_7; // 1st skip magic / header line rpStream->ReadLine(aLine); @@ -160,17 +166,17 @@ INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) // Check version magic if (0 == strcmp( pMagicHeader, pVerStr6 )) - nDicVersion = 6; + nDicVersion = DIC_VERSION_6; else if (0 == strcmp( pMagicHeader, pVerStr5 )) - nDicVersion = 5; + nDicVersion = DIC_VERSION_5; else if (0 == strcmp( pMagicHeader, pVerStr2 )) - nDicVersion = 2; + nDicVersion = DIC_VERSION_2; else - nDicVersion = -1; + nDicVersion = DIC_VERSION_DONTKNOW; - if (2 == nDicVersion || - 5 == nDicVersion || - 6 == nDicVersion) + if (DIC_VERSION_2 == nDicVersion || + DIC_VERSION_5 == nDicVersion || + DIC_VERSION_6 == nDicVersion) { // The language of the dictionary *rpStream >> nLng; @@ -203,7 +209,7 @@ DictionaryNeo::DictionaryNeo() : nLanguage (LANGUAGE_NONE) { nCount = 0; - nDicVersion = -1; + nDicVersion = DIC_VERSION_DONTKNOW; bNeedEntries = FALSE; bIsModified = bIsActive = FALSE; bIsReadonly = FALSE; @@ -220,7 +226,7 @@ DictionaryNeo::DictionaryNeo(const OUString &rName, nLanguage (nLang) { nCount = 0; - nDicVersion = -1; + nDicVersion = DIC_VERSION_DONTKNOW; bNeedEntries = TRUE; bIsModified = bIsActive = FALSE; bIsReadonly = !bWriteable; @@ -230,8 +236,8 @@ DictionaryNeo::DictionaryNeo(const OUString &rName, BOOL bExists = FileExists( rMainURL ); if( !bExists ) { - // save new dictionaries with in 6.0 Format (uses UTF8) - nDicVersion = 6; + // save new dictionaries with in Format 7 (UTF8 plain text) + nDicVersion = DIC_VERSION_7; //! create physical representation of an **empty** dictionary //! that could be found by the dictionary-list implementation @@ -303,13 +309,13 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) eDicType = bNegativ ? DictionaryType_NEGATIVE : DictionaryType_POSITIVE; rtl_TextEncoding eEnc = osl_getThreadTextEncoding(); - if (nDicVersion >= 6) + if (nDicVersion >= DIC_VERSION_6) eEnc = RTL_TEXTENCODING_UTF8; nCount = 0; - if (6 == nDicVersion || - 5 == nDicVersion || - 2 == nDicVersion) + if (DIC_VERSION_6 == nDicVersion || + DIC_VERSION_5 == nDicVersion || + DIC_VERSION_2 == nDicVersion) { USHORT nLen = 0; sal_Char aWordBuf[ BUFSIZE ]; @@ -363,7 +369,7 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) *(aWordBuf + nLen) = 0; } } - else if (7 == nDicVersion) + else if (DIC_VERSION_7 == nDicVersion) { sal_Bool bSuccess; ByteString aLine; @@ -436,10 +442,10 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) ULONG nErr = sal::static_int_cast< ULONG >(-1); rtl_TextEncoding eEnc = osl_getThreadTextEncoding(); - if (nDicVersion >= 6) + if (nDicVersion >= DIC_VERSION_6) eEnc = RTL_TEXTENCODING_UTF8; - if (nDicVersion == 7) + if (nDicVersion == DIC_VERSION_7) { pStream->WriteLine(ByteString (pVerOOo7)); if (0 != (nErr = pStream->GetError())) @@ -482,7 +488,7 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) // write version const sal_Char *pVerStr = NULL; - if (6 == nDicVersion) + if (DIC_VERSION_6 == nDicVersion) pVerStr = pVerStr6; else pVerStr = eDicType == DictionaryType_POSITIVE ? pVerStr2 : pVerStr5; diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index be127e0999af..817dbeb311ca 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -28,6 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" +#include <cppuhelper/factory.hxx> +#include <i18npool/mslangid.hxx> #include <osl/file.hxx> #include <tools/fsys.hxx> #include <tools/stream.hxx> @@ -52,6 +54,11 @@ #include "dicimp.hxx" #include "lngopt.hxx" +#include "defs.hxx" +#include "dlistimp.hxx" +#include "dicimp.hxx" +#include "lngopt.hxx" + //using namespace utl; using namespace osl; using namespace rtl; diff --git a/linguistic/source/staticmb.cxx b/linguistic/source/staticmb.cxx deleted file mode 100644 index 8b2b6bc1a364..000000000000 --- a/linguistic/source/staticmb.cxx +++ /dev/null @@ -1,29 +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. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_linguistic.hxx" diff --git a/linguistic/workben/lex.map b/linguistic/workben/lex.map deleted file mode 100644 index bd76ef3b85ce..000000000000 --- a/linguistic/workben/lex.map +++ /dev/null @@ -1,8 +0,0 @@ -LEX_1_0 { - global: - component_getFactory; - component_getImplementationEnvironment; - component_writeInfo; - local: - *; -}; diff --git a/linguistic/workben/makefile.mk b/linguistic/workben/makefile.mk index 5c8cc67e852c..26cbb7ec8d65 100644 --- a/linguistic/workben/makefile.mk +++ b/linguistic/workben/makefile.mk @@ -94,7 +94,7 @@ SHL1IMPLIB= i$(TARGET) SHL1DEPN= $(SHL1LIBS) SHL1DEF= $(MISC)$/$(SHL1TARGET).def .IF "$(OS)"!="MACOSX" -SHL1VERSIONMAP= $(TARGET).map +SHL1VERSIONMAP=$(SOLARENV)/src/component.map .ENDIF # build DEF file |