From 99e0c16a598611c7bb7e8d0fa1afffcf428e2f92 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Tue, 29 Sep 2009 14:30:58 +0000 Subject: #i105421# get rid of sfx2 --- linguistic/prj/build.lst | 2 +- linguistic/source/convdic.cxx | 92 ++++++++++++++++++--------------- linguistic/source/convdiclist.cxx | 1 - linguistic/source/convdicxml.cxx | 3 +- linguistic/source/convdicxml.hxx | 2 +- linguistic/source/defs.hxx | 7 +++ linguistic/source/dicimp.cxx | 104 ++++++++++++++++++++++++-------------- linguistic/source/dicimp.hxx | 3 +- linguistic/source/dlistimp.cxx | 48 +++++++++++++----- linguistic/source/hhconvdic.cxx | 1 - linguistic/source/makefile.mk | 1 - 11 files changed, 162 insertions(+), 102 deletions(-) (limited to 'linguistic') diff --git a/linguistic/prj/build.lst b/linguistic/prj/build.lst index 0b8f5f62fb1c..344453253054 100644 --- a/linguistic/prj/build.lst +++ b/linguistic/prj/build.lst @@ -1,4 +1,4 @@ -lg linguistic : xmloff sfx2 NULL +lg linguistic : xmloff NULL lg linguistic usr1 - all lg_mkout NULL lg linguistic\prj get - all lg_prj NULL lg linguistic\inc nmake - all lg_inc NULL diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index c58e7d142d47..c55e4ef30f4c 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -30,19 +30,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" + +#include #include -#include +#include #include #include #include -#include #include -#include -#include -#include +#include +#include #include +#include +#include +#include -#include // helper for factories #include #include #include @@ -50,18 +52,19 @@ #include #include #include -#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_ +#include #include -#endif #include #include #include +#include +#include +#include #include #include #include #include #include -#include #include "convdic.hxx" @@ -89,23 +92,27 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) { if (rMainURL.Len() == 0) return; - - // get stream to be used DBG_ASSERT(!INetURLObject( rMainURL ).HasError(), "invalid URL"); - SfxMedium aMedium( rMainURL, STREAM_READ | STREAM_SHARE_DENYWRITE, FALSE ); - SvStream *pStream = aMedium.GetInStream(); - DBG_ASSERT( pStream, "input stream missing" ); - if (!pStream || pStream->GetError()) - return; - uno::Reference< lang::XMultiServiceFactory > xServiceFactory( - utl::getProcessServiceFactory() ); - DBG_ASSERT( xServiceFactory.is(), "XMLReader::Read: got no service manager" ); - if (!xServiceFactory.is()) + uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); + + // get xInputStream stream + uno::Reference< io::XInputStream > xIn; + try + { + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); + xIn = xAccess->openFileRead( rMainURL ); + } + catch (uno::Exception & e) + { + DBG_ASSERT( 0, "failed to get input stream" ); + (void) e; + } + if (!xIn.is()) return; - uno::Reference< io::XInputStream > xIn = new utl::OInputStreamWrapper( *pStream ); - DBG_ASSERT( xIn.is(), "input stream missing" ); + SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xIn ) ); ULONG nError = sal::static_int_cast< ULONG >(-1); @@ -274,23 +281,29 @@ void ConvDic::Save() DBG_ASSERT( !bNeedEntries, "saving while entries missing" ); if (aMainURL.Len() == 0 || bNeedEntries) return; - DBG_ASSERT(!INetURLObject( aMainURL ).HasError(), "invalid URL"); - SfxMedium aMedium( aMainURL, STREAM_WRITE | STREAM_TRUNC | STREAM_SHARE_DENYALL, - FALSE ); - aMedium.CreateTempFile(); // use temp file to write to... - SvStream *pStream = aMedium.GetOutStream(); - DBG_ASSERT( pStream, "output stream missing" ); - if (!pStream || pStream->GetError()) + uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); + + // get XOutputStream stream + uno::Reference< io::XStream > xStream; + try + { + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); + xStream = xAccess->openFileReadWrite( aMainURL ); + } + catch (uno::Exception & e) + { + DBG_ASSERT( 0, "failed to get input stream" ); + (void) e; + } + if (!xStream.is()) return; - uno::Reference< io::XOutputStream > xOut( - new utl::OOutputStreamWrapper( *pStream ) ); - DBG_ASSERT( xOut.is(), "output stream missing" ); + + SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); // get XML writer - uno::Reference< lang::XMultiServiceFactory > xServiceFactory( - utl::getProcessServiceFactory() ); uno::Reference< io::XActiveDataSource > xSaxWriter; if (xServiceFactory.is()) { @@ -306,10 +319,10 @@ void ConvDic::Save() } DBG_ASSERT( xSaxWriter.is(), "can't instantiate XML writer" ); - if (xSaxWriter.is() && xOut.is()) + if (xSaxWriter.is() && xStream.is()) { // connect XML writer to output stream - xSaxWriter->setOutputStream( xOut ); + xSaxWriter->setOutputStream( xStream->getOutputStream() ); // prepare arguments (prepend doc handler to given arguments) uno::Reference< xml::sax::XDocumentHandler > xDocHandler( xSaxWriter, UNO_QUERY ); @@ -318,15 +331,10 @@ void ConvDic::Save() //!! keep a first(!) reference until everything is done to //!! ensure the proper lifetime of the object uno::Reference< document::XFilter > aRef( (document::XFilter *) pExport ); - sal_Bool bRet = pExport->Export( aMedium ); // write entries to file + sal_Bool bRet = pExport->Export(); // write entries to file DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" ); if (bRet) - { - // flush file, close it and release any lock - aMedium.Close(); - aMedium.Commit(); bIsModified = FALSE; - } } DBG_ASSERT( !bIsModified, "dictionary still modified after save. Save failed?" ); } diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index ff68146834bf..2d8a058974f7 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include // helper for factories diff --git a/linguistic/source/convdicxml.cxx b/linguistic/source/convdicxml.cxx index 34133a4bc2f9..70ada335f57e 100644 --- a/linguistic/source/convdicxml.cxx +++ b/linguistic/source/convdicxml.cxx @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -335,7 +334,7 @@ void ConvDicXMLRightTextContext_Impl::EndElement() /////////////////////////////////////////////////////////////////////////// -sal_Bool ConvDicXMLExport::Export( SfxMedium & /*rMedium*/ ) +sal_Bool ConvDicXMLExport::Export() { sal_Bool bRet = sal_False; diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx index 0746b5998589..f0a3ae4417d4 100644 --- a/linguistic/source/convdicxml.hxx +++ b/linguistic/source/convdicxml.hxx @@ -79,7 +79,7 @@ public: void _ExportContent(); sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ); - sal_Bool Export( SfxMedium &rMedium ); + sal_Bool Export(); }; diff --git a/linguistic/source/defs.hxx b/linguistic/source/defs.hxx index ca3a611c30ee..48b6dc6d82e7 100644 --- a/linguistic/source/defs.hxx +++ b/linguistic/source/defs.hxx @@ -36,10 +36,17 @@ #include #include +#include + +class SvStream; + + /////////////////////////////////////////////////////////////////////////// #define A2OU(x) ::rtl::OUString::createFromAscii( x ) +typedef boost::shared_ptr< SvStream > SvStreamPtr; + namespace css = ::com::sun::star; /////////////////////////////////////////////////////////////////////////// diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 1555fd3df4d7..019c6ffa1cd4 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -30,29 +30,30 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" -#include -#ifndef _DICIMP_HXX +#include #include -#endif -#ifndef _HYPHIMP_HXX #include -#endif -#include +#include +#include +#include #include #include #include #include -#include -#include +#include #include -#include +#include +#include #include #include #include +#include +#include + +#include "defs.hxx" -#include // helper for factories using namespace utl; using namespace osl; @@ -88,7 +89,7 @@ static sal_Bool getTag(const ByteString &rLine, } -INT16 ReadDicVersion( SvStream *pStream, USHORT &nLng, BOOL &bNeg ) +INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ) { // Sniff the header INT16 nDicVersion; @@ -97,13 +98,13 @@ INT16 ReadDicVersion( SvStream *pStream, USHORT &nLng, BOOL &bNeg ) nLng = LANGUAGE_NONE; bNeg = FALSE; - if (!pStream || pStream->GetError()) + if (!rpStream.get() || rpStream->GetError()) return -1; - sal_Size nSniffPos = pStream->Tell(); + sal_Size nSniffPos = rpStream->Tell(); static sal_Size nVerOOo7Len = sal::static_int_cast< sal_Size >(strlen( pVerOOo7 )); pMagicHeader[ nVerOOo7Len ] = '\0'; - if ((pStream->Read((void *) pMagicHeader, nVerOOo7Len) == nVerOOo7Len) && + if ((rpStream->Read((void *) pMagicHeader, nVerOOo7Len) == nVerOOo7Len) && !strcmp(pMagicHeader, pVerOOo7)) { sal_Bool bSuccess; @@ -112,10 +113,10 @@ INT16 ReadDicVersion( SvStream *pStream, USHORT &nLng, BOOL &bNeg ) nDicVersion = 7; // 1st skip magic / header line - pStream->ReadLine(aLine); + rpStream->ReadLine(aLine); // 2nd line: language all | en-US | pt-BR ... - while (sal_True == (bSuccess = pStream->ReadLine(aLine))) + while (sal_True == (bSuccess = rpStream->ReadLine(aLine))) { ByteString aTagValue; @@ -151,13 +152,13 @@ INT16 ReadDicVersion( SvStream *pStream, USHORT &nLng, BOOL &bNeg ) { USHORT nLen; - pStream->Seek (nSniffPos ); + rpStream->Seek (nSniffPos ); - *pStream >> nLen; + *rpStream >> nLen; if (nLen >= MAX_HEADER_LENGTH) return -1; - pStream->Read(pMagicHeader, nLen); + rpStream->Read(pMagicHeader, nLen); pMagicHeader[nLen] = '\0'; // Check version magic @@ -175,14 +176,14 @@ INT16 ReadDicVersion( SvStream *pStream, USHORT &nLng, BOOL &bNeg ) 6 == nDicVersion) { // The language of the dictionary - *pStream >> nLng; + *rpStream >> nLng; if (VERS2_NOLANGUAGE == nLng) nLng = LANGUAGE_NONE; // Negative Flag sal_Char nTmp; - *pStream >> nTmp; + *rpStream >> nTmp; bNeg = (BOOL)nTmp; } } @@ -270,14 +271,29 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) if (rMainURL.getLength() == 0) return 0; + DBG_ASSERT(!INetURLObject( rURL ).HasError(), "lng : invalid URL"); - ULONG nErr = sal::static_int_cast< ULONG >(-1); + uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); - // get stream to use - SfxMedium aMedium( rMainURL, STREAM_READ | STREAM_SHARE_DENYWRITE, FALSE ); - SvStream *pStream = aMedium.GetInStream(); - if (!pStream) - return nErr; + // get XInputStream stream + uno::Reference< io::XInputStream > xStream; + try + { + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); + xStream = xAccess->openFileRead( rMainURL ); + } + catch (uno::Exception & e) + { + DBG_ASSERT( 0, "failed to get input stream" ); + (void) e; + } + if (!xStream.is()) + return static_cast< ULONG >(-1); + + SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); + + ULONG nErr = sal::static_int_cast< ULONG >(-1); // Header einlesen BOOL bNegativ; @@ -285,6 +301,7 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) nDicVersion = ReadDicVersion(pStream, nLang, bNegativ); if (0 != (nErr = pStream->GetError())) return nErr; + nLanguage = nLang; eDicType = bNegativ ? DictionaryType_NEGATIVE : DictionaryType_POSITIVE; @@ -398,16 +415,29 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) if (rURL.getLength() == 0) return 0; + DBG_ASSERT(!INetURLObject( rURL ).HasError(), "lng : invalid URL"); - ULONG nErr = sal::static_int_cast< ULONG >(-1); + uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); - DBG_ASSERT(!INetURLObject( rURL ).HasError(), "lng : invalid URL"); - SfxMedium aMedium( rURL, STREAM_WRITE | STREAM_TRUNC | STREAM_SHARE_DENYALL, - FALSE ); - aMedium.CreateTempFile(); // use temp file to write to... - SvStream *pStream = aMedium.GetOutStream(); - if (!pStream) - return nErr; + // get XOutputStream stream + uno::Reference< io::XStream > xStream; + try + { + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); + xStream = xAccess->openFileReadWrite( rURL ); + } + catch (uno::Exception & e) + { + DBG_ASSERT( 0, "failed to get input stream" ); + (void) e; + } + if (!xStream.is()) + return static_cast< ULONG >(-1); + + SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); + + ULONG nErr = sal::static_int_cast< ULONG >(-1); rtl_TextEncoding eEnc = osl_getThreadTextEncoding(); if (nDicVersion >= 6) @@ -500,10 +530,6 @@ ULONG DictionaryNeo::saveEntries(const OUString &rURL) //! get return value before Stream is destroyed ULONG nError = pStream->GetError(); - // flush file, close it and release any lock - aMedium.Close(); - aMedium.Commit(); - return nError; } diff --git a/linguistic/source/dicimp.hxx b/linguistic/source/dicimp.hxx index 52eada08c486..917890bdd63c 100644 --- a/linguistic/source/dicimp.hxx +++ b/linguistic/source/dicimp.hxx @@ -42,6 +42,7 @@ #include #include +#include "defs.hxx" #include "misc.hxx" @@ -49,7 +50,7 @@ #define DIC_MAX_ENTRIES 30000 -INT16 ReadDicVersion( SvStream *pStream, USHORT &nLng, BOOL &bNeg ); +INT16 ReadDicVersion( SvStreamPtr &rpStream, USHORT &nLng, BOOL &bNeg ); const String GetDicExtension(); /////////////////////////////////////////////////////////////////////////// diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 4da58e270991..6d247a16b605 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -30,21 +30,21 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_linguistic.hxx" -#include "dlistimp.hxx" -#include "dicimp.hxx" -#include "lngopt.hxx" +#include +#include #include +#include +#include #include #include #include -#include -#include -#include -#include -#include -#include // helper for factories #include +#include +#include +#include + +#include #include #include #include @@ -52,6 +52,11 @@ #include #include +#include "defs.hxx" +#include "dlistimp.hxx" +#include "dicimp.hxx" +#include "lngopt.hxx" + //using namespace utl; using namespace osl; using namespace rtl; @@ -929,11 +934,28 @@ static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg ) if(aExt != aDIC) return FALSE; - // get stream to be used - SfxMedium aMedium( rFileURL, STREAM_READ | STREAM_SHARE_DENYWRITE, FALSE ); - SvStream *pStream = aMedium.GetInStream(); + uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); + + // get XInputStream stream + uno::Reference< io::XInputStream > xStream; + try + { + uno::Reference< ucb::XSimpleFileAccess > xAccess( xServiceFactory->createInstance( + A2OU( "com.sun.star.ucb.SimpleFileAccess" ) ), uno::UNO_QUERY_THROW ); + xStream = xAccess->openFileRead( rFileURL ); + } + catch (uno::Exception & e) + { + DBG_ASSERT( 0, "failed to get input stream" ); + (void) e; + } + DBG_ASSERT( xStream.is(), "failed to get stream for read" ); + if (!xStream.is()) + return FALSE; + + SvStreamPtr pStream = SvStreamPtr( utl::UcbStreamHelper::CreateStream( xStream ) ); - int nDicVersion = ReadDicVersion (pStream, nLng, bNeg); + int nDicVersion = ReadDicVersion(pStream, nLng, bNeg); if (2 == nDicVersion || nDicVersion >= 5) return TRUE; diff --git a/linguistic/source/hhconvdic.cxx b/linguistic/source/hhconvdic.cxx index 7972c1b208c7..980aabb51bef 100644 --- a/linguistic/source/hhconvdic.cxx +++ b/linguistic/source/hhconvdic.cxx @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/linguistic/source/makefile.mk b/linguistic/source/makefile.mk index 0012a9acd156..a6f9d266d095 100644 --- a/linguistic/source/makefile.mk +++ b/linguistic/source/makefile.mk @@ -74,7 +74,6 @@ SHL1STDLIBS= \ $(SVTOOLLIB) \ $(SVLLIB) \ $(VCLLIB) \ - $(SFXLIB) \ $(SALLIB) \ $(UCBHELPERLIB) \ $(UNOTOOLSLIB) \ -- cgit From d8acb8300eaf5cee6d6445722e12221cfc4059a4 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Mon, 11 Jan 2010 13:22:59 +0100 Subject: cws tl74: build errors --- linguistic/source/dlistimp.cxx | 2 -- 1 file changed, 2 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 17fd29b05923..aad11a33dc13 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -34,8 +34,6 @@ #include #include #include -#include -#include #include #include #include -- cgit From d534254e52733c1345d12a226a315f14eae44104 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 10 Mar 2010 12:16:18 +0000 Subject: cmcfixes73: #i110009# use rtl::StaticWithInit --- linguistic/source/convdiclist.cxx | 37 ++++--------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index c1280fc799b0..49ab2b485c13 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -397,41 +397,12 @@ void ConvDicNameContainer::AddConvDics( namespace { -template -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, StaticConvDicList> { + uno::Reference 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, StaticConvDicList> { - uno::Reference operator () () { - return (cppu::OWeakObject *) new ConvDicList; - } -}; } -- cgit From c3965776c8dbc8430176eea50d8dc663c859bcf5 Mon Sep 17 00:00:00 2001 From: David Tardon Date: Thu, 11 Mar 2010 07:16:49 +0100 Subject: dtardon02: #i108500# remove empty file in linguistic --- linguistic/source/staticmb.cxx | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 linguistic/source/staticmb.cxx (limited to 'linguistic') 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 - * - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -// MARKER(update_precomp.py): autogen include statement, do not remove -#include "precompiled_linguistic.hxx" -- cgit From ec0ee57607a1e8a800bb4809a0be6921df1f2e19 Mon Sep 17 00:00:00 2001 From: sb Date: Fri, 29 Jan 2010 17:01:54 +0100 Subject: sb118: #i108776# changed addsym.awk to also export STLport num_put symbols, and simplified it by requiring that first section is labeled UDK_3_0_0; adapted map files accordingly, replacing many individual ones with solenv/src templates --- linguistic/workben/lex.map | 8 -------- linguistic/workben/makefile.mk | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 linguistic/workben/lex.map (limited to 'linguistic') 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 fcabbe9422d2..546ac98d3743 100644 --- a/linguistic/workben/makefile.mk +++ b/linguistic/workben/makefile.mk @@ -98,7 +98,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 -- cgit From e3f3cc2d7f5dc477a01eef94601ca3082e82e3a9 Mon Sep 17 00:00:00 2001 From: sb Date: Tue, 16 Feb 2010 11:53:58 +0100 Subject: sb118: adapted remaining */qa/unoapi tests to new framework --- linguistic/prj/build.lst | 1 + linguistic/qa/unoapi/Test.java | 51 ++++++++++++++++++++++++++++++++++++++++ linguistic/qa/unoapi/makefile.mk | 36 +++++++++++++++------------- 3 files changed, 72 insertions(+), 16 deletions(-) create mode 100644 linguistic/qa/unoapi/Test.java (limited to 'linguistic') 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 +* +* 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 8bac81ca334e..bd330c6fbaca 100644 --- a/linguistic/qa/unoapi/makefile.mk +++ b/linguistic/qa/unoapi/makefile.mk @@ -1,14 +1,9 @@ #************************************************************************* -# # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# Copyright 2008 by Sun Microsystems, Inc. -# -# OpenOffice.org - a multi-platform office productivity suite # -# $RCSfile: makefile.mk,v $ +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $Revision: 1.6 $ +# OpenOffice.org - a multi-platform office productivity suite # # This file is part of OpenOffice.org. # @@ -26,19 +21,28 @@ # version 3 along with OpenOffice.org. If not, see # # 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 -- cgit From 8cf42ae630b46da64f9b86fbc47cbf2e3ed2b05f Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 23 Apr 2010 08:19:46 +0200 Subject: cws tl80: #i106032# changed default dictionary type for new user dictionaries to plain UTF-8 text file --- linguistic/source/dicimp.cxx | 46 +++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 20 deletions(-) (limited to 'linguistic') diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 969321ec3991..e975836c447c 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; @@ -231,7 +237,7 @@ DictionaryNeo::DictionaryNeo(const OUString &rName, if( !bExists ) { // save new dictionaries with in 6.0 Format (uses UTF8) - nDicVersion = 6; + nDicVersion = DIC_VERSION_6; //! 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; -- cgit From 224c0656fd0b1da325a2d6523b205f11058a3250 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 23 Apr 2010 08:45:27 +0200 Subject: cws tl80: #i106032# changed default dictionary type for new user dictionaries to plain UTF-8 text file --- linguistic/source/dicimp.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 linguistic/source/dicimp.cxx (limited to 'linguistic') diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx old mode 100644 new mode 100755 index e975836c447c..1372dd782cf6 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -236,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 = DIC_VERSION_6; + // save new dictionaries with in Format 7 (UTF8 plain text) + nDicVersion = 7; //! create physical representation of an **empty** dictionary //! that could be found by the dictionary-list implementation -- cgit From e347876fb20d1df2e2c71d33865dae6d37fa9f51 Mon Sep 17 00:00:00 2001 From: "Thomas Lange [tl]" Date: Fri, 23 Apr 2010 08:48:44 +0200 Subject: cws tl80: #i106032# changed default dictionary type for new user dictionaries to plain UTF-8 text file --- linguistic/source/dicimp.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linguistic') diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 1372dd782cf6..fe53bf344ac3 100755 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -237,7 +237,7 @@ DictionaryNeo::DictionaryNeo(const OUString &rName, if( !bExists ) { // save new dictionaries with in Format 7 (UTF8 plain text) - nDicVersion = 7; + nDicVersion = DIC_VERSION_7; //! create physical representation of an **empty** dictionary //! that could be found by the dictionary-list implementation -- cgit