From 9525f8e464aebffb77ff0a4ed5712cb098ace502 Mon Sep 17 00:00:00 2001 From: Vladimir Glazounov Date: Tue, 24 Jun 2003 06:49:39 +0000 Subject: [PATCH] INTEGRATION: CWS sw017 (1.14.2); FILE MERGED 2003/06/16 13:29:08 tl 1.14.2.1: #i15267# apostroph / typographic apostroph handling fixed --- linguistic/source/spelldsp.cxx | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx index 5b4b965169eb..af5010f1f08a 100644 --- a/linguistic/source/spelldsp.cxx +++ b/linguistic/source/spelldsp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: spelldsp.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: vg $ $Date: 2003-05-28 12:46:16 $ + * last change: $Author: vg $ $Date: 2003-06-24 07:49:39 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -70,6 +70,9 @@ #include // helper for factories #include +#ifndef _UNOTOOLS_LOCALEDATAWRAPPER_HXX +#include +#endif #ifndef _TOOLS_DEBUG_HXX //autogen wg. DBG_ASSERT #include #endif @@ -318,6 +321,13 @@ BOOL SpellCheckerDispatcher::isValid_Impl( { OUString aChkWord( rWord ); Locale aLocale( CreateLocale( nLanguage ) ); + + // replace typographical apostroph by ascii apostroph + String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); + DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" ); + if (aSingleQuote.Len()) + aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' ); + RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) RemoveControlChars( aChkWord ); @@ -562,6 +572,13 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl( { OUString aChkWord( rWord ); Locale aLocale( CreateLocale( nLanguage ) ); + + // replace typographical apostroph by ascii apostroph + String aSingleQuote( GetLocaleDataWrapper( nLanguage ).getQuotationMarkEnd() ); + DBG_ASSERT( 1 == aSingleQuote.Len(), "unexpectend length of quotation mark" ); + if (aSingleQuote.Len()) + aChkWord = aChkWord.replace( aSingleQuote.GetChar(0), '\'' ); + RemoveHyphens( aChkWord ); if (IsIgnoreControlChars( rProperties, GetPropSet() )) RemoveControlChars( aChkWord );