From bff284e216792b8d2a4e498beaba806eeddf844a Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 6 Oct 2009 07:38:24 +0200 Subject: #103496#: move VCL free ConfigItems to unotools --- linguistic/source/convdiclist.cxx | 6 +++--- linguistic/source/dlistimp.cxx | 4 ++-- linguistic/source/lngopt.cxx | 2 +- linguistic/source/lngopt.hxx | 2 +- linguistic/source/lngsvcmgr.cxx | 2 +- linguistic/source/misc.cxx | 2 +- linguistic/source/misc2.cxx | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) (limited to 'linguistic/source') diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index ff68146834bf..89604517a41f 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -33,9 +33,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/linguistic/source/dlistimp.cxx b/linguistic/source/dlistimp.cxx index 4da58e270991..fea10319a99c 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -39,8 +39,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include // helper for factories diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index 995b0686e2f8..6b7b74a68d86 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -35,7 +35,7 @@ #include "lngprops.hxx" #include "misc.hxx" #include -#include +#include #include #include // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx index b424970a929b..34a9259545d3 100644 --- a/linguistic/source/lngopt.hxx +++ b/linguistic/source/lngopt.hxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index 41d805fe9212..a002799efedc 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -40,7 +40,7 @@ #include #include -#include +#include #include #include #include diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 91beaa2e2c9f..8d754054422a 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/linguistic/source/misc2.cxx b/linguistic/source/misc2.cxx index f89ebc1bc661..ffd54b78f860 100644 --- a/linguistic/source/misc2.cxx +++ b/linguistic/source/misc2.cxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include -- cgit From 7e01bc8d28ffefd4539a5eae2587e1f7da0999e7 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Tue, 6 Oct 2009 12:34:07 +0200 Subject: #i103496#: removes sfx2 dependency from linguistic --- 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 | 37 +++++++++++--- linguistic/source/hhconvdic.cxx | 1 - linguistic/source/makefile.mk | 2 +- 10 files changed, 156 insertions(+), 96 deletions(-) (limited to 'linguistic/source') 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 89604517a41f..098ae669ddd6 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 fea10319a99c..80c61e64001b 100644 --- a/linguistic/source/dlistimp.cxx +++ b/linguistic/source/dlistimp.cxx @@ -30,9 +30,6 @@ // 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 @@ -41,16 +38,22 @@ #include #include #include -#include -#include #include // helper for factories #include +#include +#include #include #include #include #include #include #include +#include + +#include "defs.hxx" +#include "dlistimp.hxx" +#include "dicimp.hxx" +#include "lngopt.hxx" //using namespace utl; using namespace osl; @@ -930,10 +933,28 @@ static BOOL IsVers2OrNewer( const String& rFileURL, USHORT& nLng, BOOL& bNeg ) 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( comphelper::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..ccc9d1343f6f 100644 --- a/linguistic/source/makefile.mk +++ b/linguistic/source/makefile.mk @@ -68,13 +68,13 @@ SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1STDLIBS= \ $(CPPULIB) \ $(CPPUHELPERLIB) \ + $(COMPHELPERLIB) \ $(VOSLIB) \ $(TOOLSLIB) \ $(I18NISOLANGLIB) \ $(SVTOOLLIB) \ $(SVLLIB) \ $(VCLLIB) \ - $(SFXLIB) \ $(SALLIB) \ $(UCBHELPERLIB) \ $(UNOTOOLSLIB) \ -- cgit From 9f2fde7ab5de20926bb25a6b298b4e5dffb66eb2 Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Fri, 16 Oct 2009 00:05:16 +0200 Subject: #i103496#: split svtools; improve ConfitItems --- linguistic/source/convdic.cxx | 15 +++++++++------ linguistic/source/convdiclist.cxx | 2 +- linguistic/source/convdiclist.hxx | 2 +- linguistic/source/convdicxml.hxx | 2 +- linguistic/source/gciterator.cxx | 6 ++++-- linguistic/source/grammarchecker.cxx | 2 +- linguistic/source/hyphdsp.cxx | 2 +- linguistic/source/hyphdta.cxx | 2 +- linguistic/source/lngopt.cxx | 1 - linguistic/source/lngopt.hxx | 6 +++--- linguistic/source/lngsvcmgr.cxx | 17 ++++++++++------- linguistic/source/lngsvcmgr.hxx | 2 +- linguistic/source/makefile.mk | 12 +++++++----- linguistic/source/misc.cxx | 7 ++++--- linguistic/source/spelldsp.cxx | 2 +- linguistic/source/thesdsp.cxx | 2 +- 16 files changed, 46 insertions(+), 36 deletions(-) (limited to 'linguistic/source') diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index c55e4ef30f4c..68cc76277fe5 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -68,7 +68,7 @@ #include "convdic.hxx" -#include "convdicxml.hxx" +//#include "convdicxml.hxx" #include "misc.hxx" #include "defs.hxx" @@ -87,7 +87,7 @@ using namespace linguistic; /////////////////////////////////////////////////////////////////////////// - +#if XML void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) { if (rMainURL.Len() == 0) @@ -165,7 +165,7 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) { } } - +#endif BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) { @@ -186,6 +186,7 @@ BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) // first argument being 0 should stop the file from being parsed // up to the end (reading all entries) when the required // data (language, conversion type) is found. +#if XML ConvDicXMLImport *pImport = new ConvDicXMLImport( 0, rFileURL ); //!! keep a first reference to ensure the lifetime of the object !! @@ -201,6 +202,7 @@ BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) nLang = pImport->GetLanguage(); nConvType = pImport->GetConversionType(); } +#endif return bRes; } @@ -266,12 +268,12 @@ void ConvDic::Load() //!! prevent function from being called recursively via HasEntry, AddEntry bNeedEntries = FALSE; - +#if XML ConvDicXMLImport *pImport = new ConvDicXMLImport( this, aMainURL ); //!! keep a first reference to ensure the lifetime of the object !! uno::Reference< XInterface > xRef( (document::XFilter *) pImport, UNO_QUERY ); ReadThroughDic( aMainURL, *pImport ); // will implicitly add the entries - +#endif bIsModified = FALSE; } @@ -326,7 +328,7 @@ void ConvDic::Save() // prepare arguments (prepend doc handler to given arguments) uno::Reference< xml::sax::XDocumentHandler > xDocHandler( xSaxWriter, UNO_QUERY ); - +#if XML ConvDicXMLExport *pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler ); //!! keep a first(!) reference until everything is done to //!! ensure the proper lifetime of the object @@ -335,6 +337,7 @@ void ConvDic::Save() DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" ); if (bRet) bIsModified = FALSE; +#endif } DBG_ASSERT( !bIsModified, "dictionary still modified after save. Save failed?" ); } diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 098ae669ddd6..058da1ec794f 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -36,7 +36,7 @@ #include #include #include -#include +//#include #include #include // helper for factories #include diff --git a/linguistic/source/convdiclist.hxx b/linguistic/source/convdiclist.hxx index 7a7f866a69a1..8467955b4d87 100644 --- a/linguistic/source/convdiclist.hxx +++ b/linguistic/source/convdiclist.hxx @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include "misc.hxx" diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx index f0a3ae4417d4..f3bd86c90c9a 100644 --- a/linguistic/source/convdicxml.hxx +++ b/linguistic/source/convdicxml.hxx @@ -77,7 +77,7 @@ public: void _ExportAutoStyles() {} void _ExportMasterStyles() {} void _ExportContent(); - sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ); +// sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ); sal_Bool Export(); }; diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index bb63e9bb8c8b..2697d5880b80 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -63,7 +63,6 @@ #include #include #include -#include #include #include @@ -790,7 +789,10 @@ sal_Int32 GrammarCheckingIterator::GetSuggestedEndOfSentence( uno::Reference< i18n::XBreakIterator > xBreakIterator; if (!m_xBreakIterator.is()) { - m_xBreakIterator = vcl::unohelper::CreateBreakIterator(); + 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 ); } sal_Int32 nTextLen = rText.getLength(); sal_Int32 nEndPosition = nTextLen; diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx index 3d4953b8e17a..8b0b5a74ce4b 100644 --- a/linguistic/source/grammarchecker.cxx +++ b/linguistic/source/grammarchecker.cxx @@ -34,7 +34,7 @@ #include #include #include -#include +//#include #include #include #include diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index a04d01c0d1a7..419f1a3cf4a9 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include #include diff --git a/linguistic/source/hyphdta.cxx b/linguistic/source/hyphdta.cxx index 5286a6aada22..ea7d8e7c8233 100644 --- a/linguistic/source/hyphdta.cxx +++ b/linguistic/source/hyphdta.cxx @@ -39,7 +39,7 @@ #include #include -#include +#include #include //using namespace utl; diff --git a/linguistic/source/lngopt.cxx b/linguistic/source/lngopt.cxx index 6b7b74a68d86..6eb59fa09ef4 100644 --- a/linguistic/source/lngopt.cxx +++ b/linguistic/source/lngopt.cxx @@ -36,7 +36,6 @@ #include "misc.hxx" #include #include -#include #include // CPPU_CURRENT_LANGUAGE_BINDING_NAME macro, which specify the environment type #include // helper for implementations diff --git a/linguistic/source/lngopt.hxx b/linguistic/source/lngopt.hxx index 34a9259545d3..f690fc1112c8 100644 --- a/linguistic/source/lngopt.hxx +++ b/linguistic/source/lngopt.hxx @@ -42,15 +42,15 @@ #include #include #include -#include +#include #include #include #include -#include -#include +#include #include "misc.hxx" #include "defs.hxx" +#include namespace com { namespace sun { namespace star { namespace beans { diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx index a002799efedc..3a8e3e017fae 100644 --- a/linguistic/source/lngsvcmgr.cxx +++ b/linguistic/source/lngsvcmgr.cxx @@ -288,7 +288,7 @@ class LngSvcMgrListenerHelper : > { LngSvcMgr &rMyManager; - Timer aLaunchTimer; +// Timer aLaunchTimer; //cppu::OMultiTypeInterfaceContainerHelper aListeners; ::cppu::OInterfaceContainerHelper aLngSvcMgrListeners; @@ -304,7 +304,8 @@ class LngSvcMgrListenerHelper : void LaunchEvent( INT16 nLngSvcEvtFlags ); - DECL_LINK( TimeOut, Timer* ); +// DECL_LINK( TimeOut, Timer* ); + long Timeout(); public: LngSvcMgrListenerHelper( LngSvcMgr &rLngSvcMgr, @@ -363,8 +364,8 @@ LngSvcMgrListenerHelper::LngSvcMgrListenerHelper( //! 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 ) ); +// aLaunchTimer.SetTimeout( 2000 ); +// aLaunchTimer.SetTimeoutHdl( LINK( this, LngSvcMgrListenerHelper, TimeOut ) ); nCombinedLngSvcEvt = 0; } @@ -385,11 +386,12 @@ void SAL_CALL LngSvcMgrListenerHelper::disposing( const lang::EventObject& rSour } -IMPL_LINK( LngSvcMgrListenerHelper, TimeOut, Timer*, pTimer ) +//IMPL_LINK( LngSvcMgrListenerHelper, TimeOut, Timer*, pTimer ) +long LngSvcMgrListenerHelper::Timeout() { osl::MutexGuard aGuard( GetLinguMutex() ); - if (&aLaunchTimer == pTimer) +// if (&aLaunchTimer == pTimer) { // change event source to LinguServiceManager since the listeners // probably do not know (and need not to know) about the specific @@ -416,7 +418,8 @@ IMPL_LINK( LngSvcMgrListenerHelper, TimeOut, Timer*, pTimer ) void LngSvcMgrListenerHelper::AddLngSvcEvt( INT16 nLngSvcEvt ) { nCombinedLngSvcEvt |= nLngSvcEvt; - aLaunchTimer.Start(); +// aLaunchTimer.Start(); + Timeout(); } diff --git a/linguistic/source/lngsvcmgr.hxx b/linguistic/source/lngsvcmgr.hxx index aa7587527587..9716b082ddd5 100644 --- a/linguistic/source/lngsvcmgr.hxx +++ b/linguistic/source/lngsvcmgr.hxx @@ -43,7 +43,7 @@ #include #include -#include +//#include #include "misc.hxx" #include "defs.hxx" diff --git a/linguistic/source/makefile.mk b/linguistic/source/makefile.mk index ccc9d1343f6f..6db2fae4daf9 100644 --- a/linguistic/source/makefile.mk +++ b/linguistic/source/makefile.mk @@ -41,10 +41,12 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- +# $(SLO)$/convdicxml.obj\ + + SLOFILES = \ $(SLO)$/convdiclist.obj\ $(SLO)$/convdic.obj\ - $(SLO)$/convdicxml.obj\ $(SLO)$/dicimp.obj\ $(SLO)$/dlistimp.obj\ $(SLO)$/hhconvdic.obj\ @@ -72,14 +74,14 @@ SHL1STDLIBS= \ $(VOSLIB) \ $(TOOLSLIB) \ $(I18NISOLANGLIB) \ - $(SVTOOLLIB) \ - $(SVLLIB) \ - $(VCLLIB) \ + $(SVLLIB) \ $(SALLIB) \ $(UCBHELPERLIB) \ $(UNOTOOLSLIB) \ - $(XMLOFFLIB) \ $(ICUUCLIB) + +# $(VCLLIB) \ +# $(XMLOFFLIB) \ # build DLL SHL1LIBS= $(SLB)$/$(TARGET).lib diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 8d754054422a..1067a9c369c9 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include @@ -52,6 +52,7 @@ #include #include #include +#include #include @@ -59,7 +60,7 @@ #include "defs.hxx" #include "lngprops.hxx" #include "hyphdta.hxx" - +#include using namespace utl; using namespace osl; @@ -92,7 +93,7 @@ LocaleDataWrapper & GetLocaleDataWrapper( INT16 nLang ) { static LocaleDataWrapper aLclDtaWrp( getProcessServiceFactory(), - CreateLocale( Application::GetSettings().GetUILanguage() ) ); + CreateLocale( SvtSysLocale().GetUILanguage() ) ); const Locale &rLcl = aLclDtaWrp.getLoadedLocale(); Locale aLcl( CreateLocale( nLang ) ); diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 48e64163dbe4..35cf6304f105 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -40,7 +40,7 @@ #include #include #include -#include +#include #include #include diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index cc0623d1dd82..e9a8617cf698 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -32,7 +32,7 @@ #include "precompiled_linguistic.hxx" #include #include -#include +#include #include // helper for factories #include -- cgit From f7c25671940f897e485fc6ca68a1708b66544f4b Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Sun, 18 Oct 2009 13:56:34 +0200 Subject: #i103496#: reactivate xmloff base code --- linguistic/source/convdic.cxx | 10 +--------- linguistic/source/convdiclist.cxx | 1 - linguistic/source/convdicxml.hxx | 2 +- linguistic/source/grammarchecker.cxx | 1 - linguistic/source/makefile.mk | 8 ++------ 5 files changed, 4 insertions(+), 18 deletions(-) (limited to 'linguistic/source') diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx index 68cc76277fe5..068f9147f426 100644 --- a/linguistic/source/convdic.cxx +++ b/linguistic/source/convdic.cxx @@ -68,7 +68,7 @@ #include "convdic.hxx" -//#include "convdicxml.hxx" +#include "convdicxml.hxx" #include "misc.hxx" #include "defs.hxx" @@ -87,7 +87,6 @@ using namespace linguistic; /////////////////////////////////////////////////////////////////////////// -#if XML void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) { if (rMainURL.Len() == 0) @@ -165,7 +164,6 @@ void ReadThroughDic( const String &rMainURL, ConvDicXMLImport &rImport ) { } } -#endif BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) { @@ -186,7 +184,6 @@ BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) // first argument being 0 should stop the file from being parsed // up to the end (reading all entries) when the required // data (language, conversion type) is found. -#if XML ConvDicXMLImport *pImport = new ConvDicXMLImport( 0, rFileURL ); //!! keep a first reference to ensure the lifetime of the object !! @@ -202,7 +199,6 @@ BOOL IsConvDic( const String &rFileURL, INT16 &nLang, sal_Int16 &nConvType ) nLang = pImport->GetLanguage(); nConvType = pImport->GetConversionType(); } -#endif return bRes; } @@ -268,12 +264,10 @@ void ConvDic::Load() //!! prevent function from being called recursively via HasEntry, AddEntry bNeedEntries = FALSE; -#if XML ConvDicXMLImport *pImport = new ConvDicXMLImport( this, aMainURL ); //!! keep a first reference to ensure the lifetime of the object !! uno::Reference< XInterface > xRef( (document::XFilter *) pImport, UNO_QUERY ); ReadThroughDic( aMainURL, *pImport ); // will implicitly add the entries -#endif bIsModified = FALSE; } @@ -328,7 +322,6 @@ void ConvDic::Save() // prepare arguments (prepend doc handler to given arguments) uno::Reference< xml::sax::XDocumentHandler > xDocHandler( xSaxWriter, UNO_QUERY ); -#if XML ConvDicXMLExport *pExport = new ConvDicXMLExport( *this, aMainURL, xDocHandler ); //!! keep a first(!) reference until everything is done to //!! ensure the proper lifetime of the object @@ -337,7 +330,6 @@ void ConvDic::Save() DBG_ASSERT( !pStream->GetError(), "I/O error while writing to stream" ); if (bRet) bIsModified = FALSE; -#endif } DBG_ASSERT( !bIsModified, "dictionary still modified after save. Save failed?" ); } diff --git a/linguistic/source/convdiclist.cxx b/linguistic/source/convdiclist.cxx index 058da1ec794f..831c67b7baa8 100644 --- a/linguistic/source/convdiclist.cxx +++ b/linguistic/source/convdiclist.cxx @@ -36,7 +36,6 @@ #include #include #include -//#include #include #include // helper for factories #include diff --git a/linguistic/source/convdicxml.hxx b/linguistic/source/convdicxml.hxx index f3bd86c90c9a..f0a3ae4417d4 100644 --- a/linguistic/source/convdicxml.hxx +++ b/linguistic/source/convdicxml.hxx @@ -77,7 +77,7 @@ public: void _ExportAutoStyles() {} void _ExportMasterStyles() {} void _ExportContent(); -// sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ); + sal_uInt32 exportDoc( enum ::xmloff::token::XMLTokenEnum eClass ); sal_Bool Export(); }; diff --git a/linguistic/source/grammarchecker.cxx b/linguistic/source/grammarchecker.cxx index 8b0b5a74ce4b..5985ffe7d27b 100644 --- a/linguistic/source/grammarchecker.cxx +++ b/linguistic/source/grammarchecker.cxx @@ -34,7 +34,6 @@ #include #include #include -//#include #include #include #include diff --git a/linguistic/source/makefile.mk b/linguistic/source/makefile.mk index 6db2fae4daf9..bdf0b297d2f2 100644 --- a/linguistic/source/makefile.mk +++ b/linguistic/source/makefile.mk @@ -41,12 +41,10 @@ ENABLE_EXCEPTIONS=TRUE # --- Files -------------------------------------------------------- -# $(SLO)$/convdicxml.obj\ - - SLOFILES = \ $(SLO)$/convdiclist.obj\ $(SLO)$/convdic.obj\ + $(SLO)$/convdicxml.obj\ $(SLO)$/dicimp.obj\ $(SLO)$/dlistimp.obj\ $(SLO)$/hhconvdic.obj\ @@ -76,12 +74,10 @@ SHL1STDLIBS= \ $(I18NISOLANGLIB) \ $(SVLLIB) \ $(SALLIB) \ + $(XMLOFFLIB) \ $(UCBHELPERLIB) \ $(UNOTOOLSLIB) \ $(ICUUCLIB) - -# $(VCLLIB) \ -# $(XMLOFFLIB) \ # build DLL SHL1LIBS= $(SLB)$/$(TARGET).lib -- cgit From fb1cd2d70660d4614c835d35b3aa22a3ddbc7b3c Mon Sep 17 00:00:00 2001 From: Mathias Bauer Date: Wed, 4 Nov 2009 21:54:56 +0100 Subject: #i196421#: some problems with pch on Windows --- linguistic/source/dicimp.cxx | 1 - 1 file changed, 1 deletion(-) (limited to 'linguistic/source') diff --git a/linguistic/source/dicimp.cxx b/linguistic/source/dicimp.cxx index 019c6ffa1cd4..fa7dd0be3948 100644 --- a/linguistic/source/dicimp.cxx +++ b/linguistic/source/dicimp.cxx @@ -271,7 +271,6 @@ ULONG DictionaryNeo::loadEntries(const OUString &rMainURL) if (rMainURL.getLength() == 0) return 0; - DBG_ASSERT(!INetURLObject( rURL ).HasError(), "lng : invalid URL"); uno::Reference< lang::XMultiServiceFactory > xServiceFactory( utl::getProcessServiceFactory() ); -- cgit From 893d3ed1b6d83775df277825f07bf3d47f721004 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 23 Nov 2009 16:33:39 +0000 Subject: CWS-TOOLING: integrate CWS fwk125 2009-11-19 08:11:20 +0100 jsk r277554 : fwk125: #i105760# - removed warnlog, re-enabled autotest e_help.bas 2009-11-16 16:21:49 +0100 tl r277521 : #i106571# fixed locale list for dictionaries to get rid of duplicate entries 2009-11-12 08:47:31 +0100 hde r277469 : rework of hyphenation 2009-11-11 15:25:16 +0100 hde r277462 : rework of hyphenation 2009-11-11 15:24:09 +0100 hde r277461 : rework of hyphenation 2009-11-11 13:52:02 +0100 hde r277453 : new include for hyphenation tools 2009-11-10 12:28:51 +0100 tl r277427 : #i102304# fix for hyphenation dialog 2009-11-10 12:00:10 +0100 mav r277425 : #i10000# A workaround for pch and windows headers conflict 2009-11-10 11:58:32 +0100 mav r277424 : #i10000# A workaround for pch and windows headers conflict 2009-11-09 15:47:59 +0100 kso r277414 : #i16732# fixed url matching. 2009-11-09 11:51:40 +0100 mav r277406 : #i10000# use precompiled headers 2009-11-08 23:53:03 +0100 mav r277399 : #i10000# fix warning 2009-11-08 23:50:23 +0100 mav r277398 : #i10000# adapt for unix 2009-11-08 23:49:52 +0100 mav r277397 : #i10000# adapt for unix 2009-11-08 21:26:06 +0100 mav r277396 : CWS-TOOLING: rebase CWS fwk125 to branches/OOO320@277373 (milestone: OOO320:m4) 2009-11-06 16:30:27 +0100 ab r277394 : #i106100# Hold references to packages to speed up further calls to getDeployedPackages() 2009-11-06 15:58:48 +0100 mav r277392 : #i102464# check the Windows ACL 2009-11-06 15:58:23 +0100 mav r277391 : #i102464# check the Windows ACL 2009-11-04 11:54:06 +0100 tl r277342 : #i106497# incorrectly found 'supported languages' fixed 2009-11-04 10:40:51 +0100 tl r277335 : #i106571# dictionary updates for Polish and Swedish. 2009-10-28 09:54:41 +0100 tl r277236 : #i106100# context menu performance 2009-10-27 15:47:05 +0100 tl r277213 : #i106100# context menu performance 2009-10-23 17:31:56 +0200 mav r277170 : #i106075# use correct path to inprocserv.dll 2009-10-23 16:07:27 +0200 mav r277168 : #i105760# seek the temporary file to beginning also for URL case 2009-10-23 11:03:58 +0200 mav r277134 : CWS-TOOLING: rebase CWS fwk125 to branches/OOO320@276942 (milestone: OOO320:m2) --- linguistic/source/hyphdsp.cxx | 14 +++++++++----- linguistic/source/spelldsp.cxx | 11 +++++++---- linguistic/source/thesdsp.cxx | 8 +++++--- 3 files changed, 21 insertions(+), 12 deletions(-) (limited to 'linguistic/source') diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx index a04d01c0d1a7..e1ebe970a44f 100644 --- a/linguistic/source/hyphdsp.cxx +++ b/linguistic/source/hyphdsp.cxx @@ -275,7 +275,8 @@ Reference< XHyphenatedWord > SAL_CALL return xRes; // search for entry with that language - LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get(); + HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); + LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; BOOL bWordModified = FALSE; if (!pEntry || (nMaxLeading < 0 || nMaxLeading > nWordLen)) @@ -418,7 +419,8 @@ Reference< XHyphenatedWord > SAL_CALL return xRes; // search for entry with that language - LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get(); + HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); + LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; BOOL bWordModified = FALSE; if (!pEntry || !(0 <= nIndex && nIndex <= nWordLen - 2)) @@ -555,7 +557,8 @@ Reference< XPossibleHyphens > SAL_CALL return xRes; // search for entry with that language - LangSvcEntries_Hyph *pEntry = aSvcMap[ nLanguage ].get(); + HyphSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); + LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; if (!pEntry) { @@ -713,8 +716,9 @@ Sequence< OUString > // search for entry with that language and use data from that INT16 nLanguage = LocaleToLanguage( rLocale ); - HyphenatorDispatcher *pThis = (HyphenatorDispatcher *) this; - const LangSvcEntries_Hyph *pEntry = pThis->aSvcMap[ nLanguage ].get(); + HyphenatorDispatcher *pThis = (HyphenatorDispatcher *) this; + const HyphSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) ); + const LangSvcEntries_Hyph *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; if (pEntry) { aRes = pEntry->aSvcImplNames; diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 48e64163dbe4..6009461c7e7c 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -330,7 +330,8 @@ BOOL SpellCheckerDispatcher::isValid_Impl( return bRes; // search for entry with that language - LangSvcEntries_Spell *pEntry = aSvcMap[ nLanguage ].get(); + SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); + LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; if (!pEntry) { @@ -497,7 +498,8 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( return xRes; // search for entry with that language - LangSvcEntries_Spell *pEntry = aSvcMap[ nLanguage ].get(); + SpellSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); + LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; if (!pEntry) { @@ -847,8 +849,9 @@ Sequence< OUString > // search for entry with that language and use data from that INT16 nLanguage = LocaleToLanguage( rLocale ); - SpellCheckerDispatcher *pThis = (SpellCheckerDispatcher *) this; - const LangSvcEntries_Spell *pEntry = pThis->aSvcMap[ nLanguage ].get(); + SpellCheckerDispatcher *pThis = (SpellCheckerDispatcher *) this; + const SpellSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) ); + const LangSvcEntries_Spell *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; if (pEntry) aRes = pEntry->aSvcImplNames; diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx index cc0623d1dd82..b944e3a44d1b 100644 --- a/linguistic/source/thesdsp.cxx +++ b/linguistic/source/thesdsp.cxx @@ -136,7 +136,8 @@ Sequence< Reference< XMeaning > > SAL_CALL return aMeanings; // search for entry with that language - LangSvcEntries_Thes *pEntry = aSvcMap[ nLanguage ].get(); + ThesSvcByLangMap_t::iterator aIt( aSvcMap.find( nLanguage ) ); + LangSvcEntries_Thes *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; if (!pEntry) { @@ -264,8 +265,9 @@ Sequence< OUString > // search for entry with that language and use data from that INT16 nLanguage = LocaleToLanguage( rLocale ); - ThesaurusDispatcher *pThis = (ThesaurusDispatcher *) this; - const LangSvcEntries_Thes *pEntry = pThis->aSvcMap[ nLanguage ].get(); + ThesaurusDispatcher *pThis = (ThesaurusDispatcher *) this; + const ThesSvcByLangMap_t::iterator aIt( pThis->aSvcMap.find( nLanguage ) ); + const LangSvcEntries_Thes *pEntry = aIt != aSvcMap.end() ? aIt->second.get() : NULL; if (pEntry) aRes = pEntry->aSvcImplNames; -- cgit