LibreOffice Module lingucomponent (master)  1
macspellimp.mm
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <com/sun/star/uno/Reference.h>
21 
22 #include <com/sun/star/linguistic2/SpellFailure.hpp>
23 #include <com/sun/star/linguistic2/XLinguProperties.hpp>
24 #include <cppuhelper/factory.hxx>
26 #include <com/sun/star/registry/XRegistryKey.hpp>
27 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
28 #include <tools/debug.hxx>
29 #include <osl/mutex.hxx>
30 
31 #include "macspellimp.hxx"
32 
33 #include <linguistic/spelldta.hxx>
34 #include <unotools/pathoptions.hxx>
35 #include <unotools/useroptions.hxx>
36 #include <osl/file.hxx>
37 #include <rtl/ustrbuf.hxx>
38 
39 using namespace utl;
40 using namespace osl;
41 using namespace com::sun::star;
42 using namespace com::sun::star::beans;
43 using namespace com::sun::star::lang;
44 using namespace com::sun::star::uno;
45 using namespace com::sun::star::linguistic2;
46 using namespace linguistic;
47 
49  aEvtListeners( GetLinguMutex() )
50 {
51  aDEncs = nullptr;
52  aDLocs = nullptr;
53  aDNames = nullptr;
54  bDisposing = false;
55  numdict = 0;
56 #ifndef IOS
57  NSApplicationLoad();
58  NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
59  macTag = [NSSpellChecker uniqueSpellDocumentTag];
60  [pool release];
61 #else
62  pChecker = [[UITextChecker alloc] init];
63 #endif
64 }
65 
66 
68 {
69  numdict = 0;
70  if (aDEncs) delete[] aDEncs;
71  aDEncs = nullptr;
72  if (aDLocs) delete[] aDLocs;
73  aDLocs = nullptr;
74  if (aDNames) delete[] aDNames;
75  aDNames = nullptr;
76  if (xPropHelper.is())
77  xPropHelper->RemoveAsPropListener();
78 }
79 
80 
81 PropertyHelper_Spell & MacSpellChecker::GetPropHelper_Impl()
82 {
83  if (!xPropHelper.is())
84  {
86 
87  xPropHelper = new PropertyHelper_Spell( static_cast<XSpellChecker *>(this), xPropSet );
88  xPropHelper->AddAsPropListener();
89  }
90  return *xPropHelper;
91 }
92 
93 
95 {
96  MutexGuard aGuard( GetLinguMutex() );
97 
98  // this routine should return the locales supported by the installed
99  // dictionaries. So here we need to parse both the user edited
100  // dictionary list and the shared dictionary list
101  // to see what dictionaries the admin/user has installed
102 
103  int numshr; // number of shared dictionary entries
104  rtl_TextEncoding aEnc = RTL_TEXTENCODING_UTF8;
105 
106  std::vector<NSString *> postspdict;
107 
108  if (!numdict) {
109 
110  // invoke a dictionary manager to get the user dictionary list
111  // TODO How on macOS?
112 
113  // invoke a second dictionary manager to get the shared dictionary list
114 #ifdef MACOSX
115  NSArray *aSpellCheckLanguages = [[NSSpellChecker sharedSpellChecker] availableLanguages];
116 #else
117  NSArray *aSpellCheckLanguages = [UITextChecker availableLanguages];
118 #endif
119 
120  for (NSUInteger i = 0; i < [aSpellCheckLanguages count]; i++)
121  {
122  NSString* pLangStr = static_cast<NSString*>([aSpellCheckLanguages objectAtIndex:i]);
123 
124  // Fix up generic languages (without territory code) and odd combinations that LO
125  // doesn't handle.
126  if ([pLangStr isEqualToString:@"da"])
127  {
128  postspdict.push_back( @"da_DK" );
129  }
130  else if ([pLangStr isEqualToString:@"de"])
131  {
132  const std::vector<NSString*> aDE
133  { @"AT", @"BE", @"CH", @"DE", @"LI", @"LU" };
134  for (auto c: aDE)
135  {
136  pLangStr = [@"de_" stringByAppendingString: c];
137  postspdict.push_back( pLangStr );
138  }
139  }
140 #ifdef IOS
141  // iOS says it has specifically de_DE, but let's assume it is good enough for the other
142  // variants, too, for now.
143  else if ([pLangStr isEqualToString:@"de_DE"])
144  {
145  const std::vector<NSString*> aDE
146  { @"AT", @"BE", @"CH", @"DE", @"LI", @"LU" };
147  for (auto c: aDE)
148  {
149  pLangStr = [@"de_" stringByAppendingString: c];
150  postspdict.push_back( pLangStr );
151  }
152  }
153 #endif
154  else if ([pLangStr isEqualToString:@"en"])
155  {
156  // System has en_AU, en_CA, en_GB, and en_IN. Add the rest.
157  const std::vector<NSString*> aEN
158  { @"BW", @"BZ", @"GH", @"GM", @"IE", @"JM", @"MU", @"MW", @"MY", @"NA",
159  @"NZ", @"PH", @"TT", @"US", @"ZA", @"ZW" };
160  for (auto c: aEN)
161  {
162  pLangStr = [@"en_" stringByAppendingString: c];
163  postspdict.push_back( pLangStr );
164  }
165  }
166  else if ([pLangStr isEqualToString:@"en_JP"]
167  || [pLangStr isEqualToString:@"en_SG"])
168  {
169  // Just skip, LO doesn't have those yet in this context.
170  }
171  else if ([pLangStr isEqualToString:@"es"])
172  {
173  const std::vector<NSString*> aES
174  { @"AR", @"BO", @"CL", @"CO", @"CR", @"CU", @"DO", @"EC", @"ES", @"GT",
175  @"HN", @"MX", @"NI", @"PA", @"PE", @"PR", @"PY", @"SV", @"UY", @"VE" };
176  for (auto c: aES)
177  {
178  pLangStr = [@"es_" stringByAppendingString: c];
179  postspdict.push_back( pLangStr );
180  }
181  }
182  else if ([pLangStr isEqualToString:@"fi"])
183  {
184  postspdict.push_back( @"fi_FI" );
185  }
186  else if ([pLangStr isEqualToString:@"fr"])
187  {
188  const std::vector<NSString*> aFR
189  { @"BE", @"BF", @"BJ", @"CA", @"CH", @"CI", @"FR", @"LU", @"MC", @"ML",
190  @"MU", @"NE", @"SN", @"TG" };
191  for (auto c: aFR)
192  {
193  pLangStr = [@"fr_" stringByAppendingString: c];
194  postspdict.push_back( pLangStr );
195  }
196  }
197  else if ([pLangStr isEqualToString:@"it"])
198  {
199  postspdict.push_back( @"it_CH" );
200  postspdict.push_back( @"it_IT" );
201  }
202  else if ([pLangStr isEqualToString:@"ko"])
203  {
204  postspdict.push_back( @"ko_KR" );
205  }
206  else if ([pLangStr isEqualToString:@"nl"])
207  {
208  postspdict.push_back( @"nl_BE" );
209  postspdict.push_back( @"nl_NL" );
210  }
211  else if ([pLangStr isEqualToString:@"nb"])
212  {
213  postspdict.push_back( @"nb_NO" );
214  }
215  else if ([pLangStr isEqualToString:@"pl"])
216  {
217  postspdict.push_back( @"pl_PL" );
218  }
219  else if ([pLangStr isEqualToString:@"ru"])
220  {
221  postspdict.push_back( @"ru_RU" );
222  }
223  else if ([pLangStr isEqualToString:@"sv"])
224  {
225  postspdict.push_back( @"sv_FI" );
226  postspdict.push_back( @"sv_SE" );
227  }
228 #ifdef IOS
229  else if ([pLangStr isEqualToString:@"sv_SE"])
230  {
231  postspdict.push_back( @"sv_FI" );
232  postspdict.push_back( @"sv_SE" );
233  }
234 #endif
235  else if ([pLangStr isEqualToString:@"tr"])
236  {
237  postspdict.push_back( @"tr_TR" );
238  }
239  else
240  postspdict.push_back( pLangStr );
241  }
242  // System has pt_BR and pt_PT, add pt_AO.
243  postspdict.push_back( @"pt_AO" );
244 
245  numshr = postspdict.size();
246 
247  // we really should merge these and remove duplicates but since
248  // users can name their dictionaries anything they want it would
249  // be impossible to know if a real duplication exists unless we
250  // add some unique key to each myspell dictionary
251  numdict = numshr;
252 
253  if (numdict) {
254  aDLocs = new Locale [numdict];
255  aDEncs = new rtl_TextEncoding [numdict];
256  aDNames = new OUString [numdict];
257  aSuppLocales.realloc(numdict);
258  Locale * pLocale = aSuppLocales.getArray();
259  int numlocs = 0;
260  int newloc;
261  int i,j;
262  int k = 0;
263 
264  //first add the user dictionaries
265  //TODO for MAC?
266 
267  // now add the shared dictionaries
268  for (i = 0; i < numshr; i++) {
269  NSDictionary *aLocDict = [ NSLocale componentsFromLocaleIdentifier:postspdict[i] ];
270  NSString* aLang = [ aLocDict objectForKey:NSLocaleLanguageCode ];
271  NSString* aCountry = [ aLocDict objectForKey:NSLocaleCountryCode ];
272  OUString lang([aLang cStringUsingEncoding: NSUTF8StringEncoding], [aLang length], aEnc);
273  OUString country([ aCountry cStringUsingEncoding: NSUTF8StringEncoding], [aCountry length], aEnc);
274  Locale nLoc( lang, country, OUString() );
275  newloc = 1;
276  //eliminate duplicates (is this needed for MacOS?)
277  for (j = 0; j < numlocs; j++) {
278  if (nLoc == pLocale[j]) newloc = 0;
279  }
280  if (newloc) {
281  pLocale[numlocs] = nLoc;
282  numlocs++;
283  }
284  aDLocs[k] = nLoc;
285  aDEncs[k] = 0;
286  k++;
287  }
288 
289  aSuppLocales.realloc(numlocs);
290 
291  } else {
292  /* no dictionary.lst found so register no dictionaries */
293  numdict = 0;
294  aDEncs = nullptr;
295  aDLocs = nullptr;
296  aDNames = nullptr;
297  aSuppLocales.realloc(0);
298  }
299  }
300 
301  return aSuppLocales;
302 }
303 
304 
305 
306 sal_Bool SAL_CALL MacSpellChecker::hasLocale(const Locale& rLocale)
307 {
308  MutexGuard aGuard( GetLinguMutex() );
309 
310  bool bRes = false;
311  if (!aSuppLocales.getLength())
312  getLocales();
313 
314  sal_Int32 nLen = aSuppLocales.getLength();
315  for (sal_Int32 i = 0; i < nLen; ++i)
316  {
317  const Locale *pLocale = aSuppLocales.getConstArray();
318  if (rLocale == pLocale[i])
319  {
320  bRes = true;
321  break;
322  }
323  }
324  return bRes;
325 }
326 
327 
328 sal_Int16 MacSpellChecker::GetSpellFailure( const OUString &rWord, const Locale &rLocale )
329 {
330  rtl_TextEncoding aEnc;
331 
332  // initialize a myspell object for each dictionary once
333  // (note: mutex is held higher up in isValid)
334 
335 
336  sal_Int16 nRes = -1;
337 
338  // first handle smart quotes both single and double
339  OUStringBuffer rBuf(rWord);
340  sal_Int32 n = rBuf.getLength();
341  sal_Unicode c;
342  for (sal_Int32 ix=0; ix < n; ix++) {
343  c = rBuf[ix];
344  if ((c == 0x201C) || (c == 0x201D)) rBuf[ix] = u'"';
345  if ((c == 0x2018) || (c == 0x2019)) rBuf[ix] = u'\'';
346  }
347  OUString nWord(rBuf.makeStringAndClear());
348 
349  if (n)
350  {
351  aEnc = 0;
352  NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
353  NSString* aNSStr = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(nWord.getStr()) length: nWord.getLength()]autorelease];
354  NSString* aLang = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rLocale.Language.getStr()) length: rLocale.Language.getLength()]autorelease];
355  if(rLocale.Country.getLength()>0)
356  {
357  NSString* aCountry = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rLocale.Country.getStr()) length: rLocale.Country.getLength()]autorelease];
358  NSString* aTaggedCountry = [@"_" stringByAppendingString:aCountry];
359  aLang = [aLang stringByAppendingString:aTaggedCountry];
360  }
361 
362 #ifdef MACOSX
363  NSInteger aCount;
364  NSRange range = [[NSSpellChecker sharedSpellChecker] checkSpellingOfString:aNSStr startingAt:0 language:aLang wrap:false inSpellDocumentWithTag:macTag wordCount:&aCount];
365 #else
366  NSRange range = [pChecker rangeOfMisspelledWordInString:aNSStr range:NSMakeRange(0, [aNSStr length]) startingAt:0 wrap:NO language:aLang];
367 #endif
368  int rVal = 0;
369  if(range.length>0)
370  {
371  rVal = -1;
372  }
373  else
374  {
375  rVal = 1;
376  }
377  [pool release];
378  if (rVal != 1)
379  {
380  nRes = SpellFailure::SPELLING_ERROR;
381  } else {
382  return -1;
383  }
384  }
385  return nRes;
386 }
387 
388 
389 
390 sal_Bool SAL_CALL
391  MacSpellChecker::isValid( const OUString& rWord, const Locale& rLocale,
392  const css::uno::Sequence<PropertyValue>& rProperties )
393 {
394  MutexGuard aGuard( GetLinguMutex() );
395 
396  if (rLocale == Locale() || !rWord.getLength())
397  return true;
398 
399  if (!hasLocale( rLocale ))
400  return true;
401 
402  // Get property values to be used.
403  // These are be the default values set in the SN_LINGU_PROPERTIES
404  // PropertySet which are overridden by the supplied ones from the
405  // last argument.
406  // You'll probably like to use a simpler solution than the provided
407  // one using the PropertyHelper_Spell.
408 
409  PropertyHelper_Spell &rHelper = GetPropHelper();
410  rHelper.SetTmpPropVals( rProperties );
411 
412  sal_Int16 nFailure = GetSpellFailure( rWord, rLocale );
413  if (nFailure != -1)
414  {
415  LanguageType nLang = LinguLocaleToLanguage( rLocale );
416  // postprocess result for errors that should be ignored
417  if ( (!rHelper.IsSpellUpperCase() && IsUpper( rWord, nLang ))
418  || (!rHelper.IsSpellWithDigits() && HasDigits( rWord ))
419  || (!rHelper.IsSpellCapitalization()
420  && nFailure == SpellFailure::CAPTION_ERROR)
421  )
422  nFailure = -1;
423  }
424 
425  return (nFailure == -1);
426 }
427 
429  MacSpellChecker::GetProposals( const OUString &rWord, const Locale &rLocale )
430 {
431  // Retrieves the return values for the 'spell' function call in case
432  // of a misspelled word.
433  // Especially it may give a list of suggested (correct) words:
434 
436  // note: mutex is held by higher up by spell which covers both
437 
438  LanguageType nLang = LinguLocaleToLanguage( rLocale );
439  int count;
441 
442  // first handle smart quotes (single and double)
443  OUStringBuffer rBuf(rWord);
444  sal_Int32 n = rBuf.getLength();
445  sal_Unicode c;
446  for (sal_Int32 ix=0; ix < n; ix++) {
447  c = rBuf[ix];
448  if ((c == 0x201C) || (c == 0x201D)) rBuf[ix] = u'"';
449  if ((c == 0x2018) || (c == 0x2019)) rBuf[ix] = u'\'';
450  }
451  OUString nWord(rBuf.makeStringAndClear());
452 
453  if (n)
454  {
455  NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
456  NSString* aNSStr = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(nWord.getStr()) length: nWord.getLength()]autorelease];
457  NSString* aLang = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rLocale.Language.getStr()) length: rLocale.Language.getLength()]autorelease];
458  if(rLocale.Country.getLength()>0)
459  {
460  NSString* aCountry = [[[NSString alloc] initWithCharacters: reinterpret_cast<unichar const *>(rLocale.Country.getStr()) length: rLocale.Country.getLength()]autorelease];
461  NSString* aTaggedCountry = [@"_" stringByAppendingString:aCountry];
462  aLang = [aLang stringByAppendingString:aTaggedCountry];
463  }
464 #ifdef MACOSX
465  [[NSSpellChecker sharedSpellChecker] setLanguage:aLang];
466  NSArray *guesses = [[NSSpellChecker sharedSpellChecker] guessesForWordRange:NSMakeRange(0, [aNSStr length]) inString:aNSStr language:aLang inSpellDocumentWithTag:0];
467  (void) this; // avoid loplugin:staticmethods, the !MACOSX case uses 'this'
468 #else
469  NSArray *guesses = [pChecker guessesForWordRange:NSMakeRange(0, [aNSStr length]) inString:aNSStr language:aLang];
470 #endif
471  count = [guesses count];
472  if (count)
473  {
474  aStr.realloc( count );
475  OUString *pStr = aStr.getArray();
476  for (int ii=0; ii < count; ii++)
477  {
478  // if needed add: if (suglst[ii] == NULL) continue;
479  NSString* guess = [guesses objectAtIndex:ii];
480  OUString cvtwrd(reinterpret_cast<const sal_Unicode*>([guess cStringUsingEncoding:NSUnicodeStringEncoding]), static_cast<sal_Int32>([guess length]));
481  pStr[ii] = cvtwrd;
482  }
483  }
484  [pool release];
485  }
486 
487  // now return an empty alternative for no suggestions or the list of alternatives if some found
489  pAlt->SetWordLanguage( rWord, nLang );
490  pAlt->SetFailureType( SpellFailure::SPELLING_ERROR );
491  pAlt->SetAlternatives( aStr );
492  xRes = pAlt;
493  return xRes;
494 
495 }
496 
498  MacSpellChecker::spell( const OUString& rWord, const Locale& rLocale,
499  const css::uno::Sequence<PropertyValue>& rProperties )
500 {
501  MutexGuard aGuard( GetLinguMutex() );
502 
503  if (rLocale == Locale() || !rWord.getLength())
504  return nullptr;
505 
506  if (!hasLocale( rLocale ))
507  return nullptr;
508 
510  if (!isValid( rWord, rLocale, rProperties ))
511  {
512  xAlt = GetProposals( rWord, rLocale );
513  }
514  return xAlt;
515 }
516 
517 sal_Bool SAL_CALL
520 {
521  MutexGuard aGuard( GetLinguMutex() );
522 
523  bool bRes = false;
524  if (!bDisposing && rxLstnr.is())
525  {
526  bRes = GetPropHelper().addLinguServiceEventListener( rxLstnr );
527  }
528  return bRes;
529 }
530 
531 
532 sal_Bool SAL_CALL
535 {
536  MutexGuard aGuard( GetLinguMutex() );
537 
538  bool bRes = false;
539  if (!bDisposing && rxLstnr.is())
540  {
541  DBG_ASSERT( xPropHelper.is(), "xPropHelper non existent" );
542  bRes = GetPropHelper().removeLinguServiceEventListener( rxLstnr );
543  }
544  return bRes;
545 }
546 
547 
548 OUString SAL_CALL
549  MacSpellChecker::getServiceDisplayName( const Locale& /*rLocale*/ )
550 {
551  MutexGuard aGuard( GetLinguMutex() );
552  return "macOS Spell Checker";
553 }
554 
555 
556 void SAL_CALL
558 {
559  MutexGuard aGuard( GetLinguMutex() );
560 
561  if (!xPropHelper.is())
562  {
563  sal_Int32 nLen = rArguments.getLength();
564  if (2 == nLen)
565  {
567  rArguments.getConstArray()[0] >>= xPropSet;
568  //rArguments.getConstArray()[1] >>= xDicList;
569 
574  xPropHelper = new PropertyHelper_Spell( static_cast<XSpellChecker *>(this), xPropSet );
575  xPropHelper->AddAsPropListener();
576  }
577  else
578  OSL_FAIL( "wrong number of arguments in sequence" );
579 
580  }
581 }
582 
583 
584 void SAL_CALL
586 {
587  MutexGuard aGuard( GetLinguMutex() );
588 
589  if (!bDisposing)
590  {
591  bDisposing = true;
592  EventObject aEvtObj( static_cast<XSpellChecker *>(this) );
593  aEvtListeners.disposeAndClear( aEvtObj );
594  }
595 }
596 
597 
598 void SAL_CALL
600 {
601  MutexGuard aGuard( GetLinguMutex() );
602 
603  if (!bDisposing && rxListener.is())
604  aEvtListeners.addInterface( rxListener );
605 }
606 
607 
608 void SAL_CALL
610 {
611  MutexGuard aGuard( GetLinguMutex() );
612 
613  if (!bDisposing && rxListener.is())
614  aEvtListeners.removeInterface( rxListener );
615 }
616 
617 // Service specific part
619 {
620  return "org.openoffice.lingu.MacOSXSpellChecker";
621 }
622 
623 sal_Bool SAL_CALL MacSpellChecker::supportsService( const OUString& ServiceName )
624 {
625  return cppu::supportsService(this, ServiceName);
626 }
627 
629 {
630  return { SN_SPELLCHECKER };
631 }
632 
633 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
635  css::uno::XComponentContext* , css::uno::Sequence<css::uno::Any> const&)
636 {
637  static rtl::Reference<MacSpellChecker> g_Instance(new MacSpellChecker());
638  g_Instance->acquire();
639  return static_cast<cppu::OWeakObject*>(g_Instance.get());
640 }
641 
642 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual OUString SAL_CALL getImplementationName() override
Definition: macspellimp.mm:618
osl::Mutex & GetLinguMutex()
const size_t count(pCandidateA->getBorderLines().size())
sal_Int32 numdict
Definition: macspellimp.hxx:66
virtual OUString SAL_CALL getServiceDisplayName(const Locale &rLocale) override
Definition: macspellimp.mm:549
const char * pLocale
virtual ~MacSpellChecker() override
Definition: macspellimp.mm:67
virtual Sequence< Locale > SAL_CALL getLocales() override
Definition: macspellimp.mm:94
sal_Int32 addInterface(const css::uno::Reference< css::uno::XInterface > &rxIFace)
virtual sal_Bool SAL_CALL hasLocale(const Locale &rLocale) override
Definition: macspellimp.mm:306
sal_Int64 n
linguistic::PropertyHelper_Spell & GetPropHelper()
Definition: macspellimp.hxx:80
void disposeAndClear(const css::lang::EventObject &rEvt)
virtual sal_Bool SAL_CALL addLinguServiceEventListener(const Reference< XLinguServiceEventListener > &rxLstnr) override
Definition: macspellimp.mm:518
sal_Int32 removeInterface(const css::uno::Reference< css::uno::XInterface > &rxIFace)
virtual void SAL_CALL dispose() override
Definition: macspellimp.mm:585
virtual void SAL_CALL initialize(const Sequence< Any > &rArguments) override
Definition: macspellimp.mm:557
UITextChecker * pChecker
Definition: macspellimp.hxx:70
sal_uInt16 sal_Unicode
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * lingucomponent_MacSpellChecker_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
Definition: macspellimp.mm:634
length
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual Reference< XSpellAlternatives > SAL_CALL spell(const OUString &rWord, const Locale &rLocale, const css::uno::Sequence< PropertyValue > &rProperties) override
Definition: macspellimp.mm:498
Reference< XSpellAlternatives > GetProposals(const OUString &rWord, const Locale &rLocale)
Definition: macspellimp.mm:429
bool HasDigits(const OUString &rText)
virtual sal_Bool SAL_CALL supportsService(const OUString &rServiceName) override
Definition: macspellimp.mm:623
linguistic::PropertyHelper_Spell & GetPropHelper_Impl()
Definition: macspellimp.mm:81
rtl_TextEncoding * aDEncs
Definition: macspellimp.hxx:63
virtual void SAL_CALL addEventListener(const Reference< XEventListener > &rxListener) override
Definition: macspellimp.mm:599
virtual sal_Bool SAL_CALL removeLinguServiceEventListener(const Reference< XLinguServiceEventListener > &rxLstnr) override
Definition: macspellimp.mm:533
#define DBG_ASSERT(sCon, aError)
int i
sal_Int16 GetSpellFailure(const OUString &rWord, const Locale &rLocale)
Definition: macspellimp.mm:328
float u
unsigned char sal_Bool
bool IsUpper(const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, LanguageType nLanguage)
::comphelper::OInterfaceContainerHelper2 aEvtListeners
Definition: macspellimp.hxx:72
OUString * aDNames
Definition: macspellimp.hxx:65
rtl::Reference< linguistic::PropertyHelper_Spell > xPropHelper
Definition: macspellimp.hxx:73
exports com.sun.star. lang
LanguageType LinguLocaleToLanguage(const css::lang::Locale &rLocale)
uno::Reference< XLinguProperties > GetLinguProperties()
Sequence< Locale > aSuppLocales
Definition: macspellimp.hxx:62
virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: macspellimp.mm:628
virtual void SAL_CALL removeEventListener(const Reference< XEventListener > &rxListener) override
Definition: macspellimp.mm:609
aStr
virtual sal_Bool SAL_CALL isValid(const OUString &rWord, const Locale &rLocale, const css::uno::Sequence< PropertyValue > &rProperties) override
Definition: macspellimp.mm:391
#define SN_SPELLCHECKER
typedef void(CALLTYPE *GetFuncDataPtr)(sal_uInt16 &nNo