LibreOffice Module editeng (master) 1
Classes | Namespaces | Functions | Variables
svxacorr.cxx File Reference
#include <memory>
#include <utility>
#include <algorithm>
#include <string_view>
#include <sal/config.h>
#include <com/sun/star/linguistic2/XSpellChecker1.hpp>
#include <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <tools/urlobj.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <i18nutil/transliteration.hxx>
#include <sal/log.hxx>
#include <osl/diagnose.h>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <svl/fstathelper.hxx>
#include <svl/urihelper.hxx>
#include <unotools/charclass.hxx>
#include <com/sun/star/i18n/UnicodeType.hpp>
#include <unotools/collatorwrapper.hxx>
#include <com/sun/star/i18n/UnicodeScript.hpp>
#include <com/sun/star/i18n/OrdinalSuffix.hpp>
#include <unotools/localedatawrapper.hxx>
#include <unotools/transliterationwrapper.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/storagehelper.hxx>
#include <o3tl/string_view.hxx>
#include <editeng/editids.hrc>
#include <sot/storage.hxx>
#include <editeng/udlnitem.hxx>
#include <editeng/wghtitem.hxx>
#include <editeng/postitem.hxx>
#include <editeng/crossedoutitem.hxx>
#include <editeng/escapementitem.hxx>
#include <editeng/svxacorr.hxx>
#include <editeng/unolingu.hxx>
#include <vcl/window.hxx>
#include <com/sun/star/xml/sax/InputSource.hpp>
#include <com/sun/star/xml/sax/FastParser.hpp>
#include <com/sun/star/xml/sax/Writer.hpp>
#include <com/sun/star/xml/sax/SAXParseException.hpp>
#include <unotools/streamwrap.hxx>
#include "SvXMLAutoCorrectImport.hxx"
#include "SvXMLAutoCorrectExport.hxx"
#include "SvXMLAutoCorrectTokenHandler.hxx"
#include <ucbhelper/content.hxx>
#include <com/sun/star/ucb/ContentCreationException.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/TransferInfo.hpp>
#include <com/sun/star/ucb/NameClash.hpp>
#include <comphelper/diagnose_ex.hxx>
#include <xmloff/xmltoken.hxx>
#include <unordered_map>
#include <rtl/character.hxx>
Include dependency graph for svxacorr.cxx:

Go to the source code of this file.

Classes

struct  o3tl::typed_flags< Flags >
 
struct  SvxAutocorrWordList::CompareSvxAutocorrWordList
 
struct  SvxAutocorrWordList::Impl
 

Namespaces

namespace  o3tl
 

Functions

static OUString EncryptBlockName_Imp (std::u16string_view rName)
 
static bool NonFieldWordDelim (const sal_Unicode c)
 
static bool IsWordDelim (const sal_Unicode c)
 
static bool IsLowerLetter (sal_Int32 nCharType)
 
static bool IsUpperLetter (sal_Int32 nCharType)
 
static bool lcl_IsUnsupportedUnicodeChar (CharClass const &rCC, const OUString &rTxt, sal_Int32 nStt, sal_Int32 nEnd)
 
static bool lcl_IsSymbolChar (CharClass const &rCC, const OUString &rTxt, sal_Int32 nStt, sal_Int32 nEnd)
 
static bool lcl_IsInArr (std::u16string_view arr, const sal_uInt32 c)
 
static const LanguageTagGetAppLang ()
 
static LanguageType GetDocLanguage (const SvxAutoCorrDoc &rDoc, sal_Int32 nPos)
 Never use an unresolved LANGUAGE_SYSTEM. More...
 
static LocaleDataWrapperGetLocaleDataWrapper (LanguageType nLang)
 
static TransliterationWrapper & GetIgnoreTranslWrapper ()
 
static CollatorWrapperGetCollatorWrapper ()
 
constexpr OUStringLiteral sEmDash (u"\u2014")
 
constexpr OUStringLiteral sEnDash (u"\u2013")
 
static bool lcl_HasPrecedingChar (std::u16string_view rTxt, sal_Int32 nPos, const sal_Unicode sPrecedingChar, const sal_Unicode sStopChar, const sal_Unicode *aStopChars)
 
static void GeneratePackageName (std::u16string_view rShort, OUString &rPackageName)
 
static const SvxAutocorrWordlcl_SearchWordsInList (SvxAutoCorrectLanguageLists *pList, std::u16string_view rTxt, sal_Int32 &rStt, sal_Int32 nEndPos)
 
static bool lcl_FindAbbreviation (const SvStringsISortDtor *pList, const OUString &sWord)
 

Variables

const sal_Unicode cNonBreakingSpace = 0xA0
 
constexpr OUStringLiteral pXMLImplWordStart_ExcptLstStr = u"WordExceptList.xml"
 
constexpr OUStringLiteral pXMLImplCplStt_ExcptLstStr = u"SentenceExceptList.xml"
 
constexpr OUStringLiteral pXMLImplAutocorr_ListStr = u"DocumentList.xml"
 
constexpr std::u16string_view sImplSttSkipChars = u"\"'([{\u2018\u2019\u201a\u201b\u201c\u201d\u201e\u201f\u0083\u0084\u0089\u0091\u0092\u0093\u0094"
 
constexpr std::u16string_view sImplEndSkipChars = u"\"')]}\u2018\u2019\u201a\u201b\u201c\u201d\u201e\u201f\u0083\u0084\u0089\u0091\u0092\u0093\u0094"
 
constexpr sal_Unicode cEmDash = 0x2014
 
constexpr sal_Unicode cEnDash = 0x2013
 
constexpr sal_Unicode cApostrophe = 0x2019
 
constexpr sal_Unicode cLeftDoubleAngleQuote = 0xAB
 
constexpr sal_Unicode cRightDoubleAngleQuote = 0xBB
 
constexpr sal_Unicode cLeftSingleAngleQuote = 0x2039
 
constexpr sal_Unicode cRightSingleAngleQuote = 0x203A
 
const sal_Unicode aStopDoubleAngleQuoteStart [] = { 0x201E, 0x201D, 0x201C, 0 }
 
const sal_Unicode aStopDoubleAngleQuoteEnd [] = { cRightDoubleAngleQuote, cLeftDoubleAngleQuote, 0x201D, 0x201E, 0 }
 
const sal_Unicode aStopDoubleAngleQuoteEndRo [] = { cLeftDoubleAngleQuote, cRightDoubleAngleQuote, 0x201D, 0x201E, 0x201C, 0 }
 
const sal_Unicode aStopSingleQuoteEnd [] = { 0x201A, 0x2018, 0x201C, 0x201E, 0 }
 
const sal_Unicode aStopSingleQuoteEndRuUa [] = { 0x201E, 0x201C, cRightDoubleAngleQuote, cLeftDoubleAngleQuote, 0 }
 

Function Documentation

◆ EncryptBlockName_Imp()

OUString EncryptBlockName_Imp ( std::u16string_view  rName)
static

◆ GeneratePackageName()

static void GeneratePackageName ( std::u16string_view  rShort,
OUString &  rPackageName 
)
static

◆ GetAppLang()

static const LanguageTag & GetAppLang ( )
static

◆ GetCollatorWrapper()

static CollatorWrapper & GetCollatorWrapper ( )
static

◆ GetDocLanguage()

static LanguageType GetDocLanguage ( const SvxAutoCorrDoc rDoc,
sal_Int32  nPos 
)
static

◆ GetIgnoreTranslWrapper()

static TransliterationWrapper & GetIgnoreTranslWrapper ( )
static

Definition at line 223 of file svxacorr.cxx.

References GetAppLang().

Referenced by SvxAutocorrWordList::WordMatches().

◆ GetLocaleDataWrapper()

static LocaleDataWrapper & GetLocaleDataWrapper ( LanguageType  nLang)
static

Definition at line 215 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::DoAutoCorrect(), and SvxAutoCorrect::GetQuote().

◆ IsLowerLetter()

static bool IsLowerLetter ( sal_Int32  nCharType)
static

◆ IsUpperLetter()

static bool IsUpperLetter ( sal_Int32  nCharType)
static

◆ IsWordDelim()

static bool IsWordDelim ( const sal_Unicode  c)
static

◆ lcl_FindAbbreviation()

static bool lcl_FindAbbreviation ( const SvStringsISortDtor pList,
const OUString &  sWord 
)
static

◆ lcl_HasPrecedingChar()

static bool lcl_HasPrecedingChar ( std::u16string_view  rTxt,
sal_Int32  nPos,
const sal_Unicode  sPrecedingChar,
const sal_Unicode  sStopChar,
const sal_Unicode aStopChars 
)
static

Definition at line 1311 of file svxacorr.cxx.

References nPos.

Referenced by SvxAutoCorrect::DoAutoCorrect().

◆ lcl_IsInArr()

static bool lcl_IsInArr ( std::u16string_view  arr,
const sal_uInt32  c 
)
static

◆ lcl_IsSymbolChar()

static bool lcl_IsSymbolChar ( CharClass const &  rCC,
const OUString &  rTxt,
sal_Int32  nStt,
sal_Int32  nEnd 
)
static

◆ lcl_IsUnsupportedUnicodeChar()

static bool lcl_IsUnsupportedUnicodeChar ( CharClass const &  rCC,
const OUString &  rTxt,
sal_Int32  nStt,
sal_Int32  nEnd 
)
static

Definition at line 138 of file svxacorr.cxx.

References CharClass::getScript().

Referenced by SvxAutoCorrect::DoAutoCorrect().

◆ lcl_SearchWordsInList()

static const SvxAutocorrWord * lcl_SearchWordsInList ( SvxAutoCorrectLanguageLists pList,
std::u16string_view  rTxt,
sal_Int32 &  rStt,
sal_Int32  nEndPos 
)
static

◆ NonFieldWordDelim()

static bool NonFieldWordDelim ( const sal_Unicode  c)
static

◆ sEmDash()

constexpr OUStringLiteral sEmDash ( u"\u2014"  )
constexpr

◆ sEnDash()

constexpr OUStringLiteral sEnDash ( u"\u2013"  )
constexpr

Variable Documentation

◆ aStopDoubleAngleQuoteEnd

const sal_Unicode aStopDoubleAngleQuoteEnd[] = { cRightDoubleAngleQuote, cLeftDoubleAngleQuote, 0x201D, 0x201E, 0 }

Definition at line 317 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::DoAutoCorrect().

◆ aStopDoubleAngleQuoteEndRo

const sal_Unicode aStopDoubleAngleQuoteEndRo[] = { cLeftDoubleAngleQuote, cRightDoubleAngleQuote, 0x201D, 0x201E, 0x201C, 0 }

Definition at line 319 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::DoAutoCorrect().

◆ aStopDoubleAngleQuoteStart

const sal_Unicode aStopDoubleAngleQuoteStart[] = { 0x201E, 0x201D, 0x201C, 0 }

Definition at line 316 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::DoAutoCorrect().

◆ aStopSingleQuoteEnd

const sal_Unicode aStopSingleQuoteEnd[] = { 0x201A, 0x2018, 0x201C, 0x201E, 0 }

Definition at line 320 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::DoAutoCorrect().

◆ aStopSingleQuoteEndRuUa

const sal_Unicode aStopSingleQuoteEndRuUa[] = { 0x201E, 0x201C, cRightDoubleAngleQuote, cLeftDoubleAngleQuote, 0 }

Definition at line 321 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::DoAutoCorrect().

◆ cApostrophe

constexpr sal_Unicode cApostrophe = 0x2019
constexpr

◆ cEmDash

constexpr sal_Unicode cEmDash = 0x2014
constexpr

Definition at line 305 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::DoAutoCorrect().

◆ cEnDash

constexpr sal_Unicode cEnDash = 0x2013
constexpr

Definition at line 306 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::DoAutoCorrect().

◆ cLeftDoubleAngleQuote

constexpr sal_Unicode cLeftDoubleAngleQuote = 0xAB
constexpr

Definition at line 310 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::InsertQuote().

◆ cLeftSingleAngleQuote

constexpr sal_Unicode cLeftSingleAngleQuote = 0x2039
constexpr

Definition at line 312 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::InsertQuote().

◆ cNonBreakingSpace

const sal_Unicode cNonBreakingSpace = 0xA0

◆ cRightDoubleAngleQuote

constexpr sal_Unicode cRightDoubleAngleQuote = 0xBB
constexpr

Definition at line 311 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::InsertQuote().

◆ cRightSingleAngleQuote

constexpr sal_Unicode cRightSingleAngleQuote = 0x203A
constexpr

Definition at line 313 of file svxacorr.cxx.

Referenced by SvxAutoCorrect::InsertQuote().

◆ pXMLImplAutocorr_ListStr

constexpr OUStringLiteral pXMLImplAutocorr_ListStr = u"DocumentList.xml"
constexpr

◆ pXMLImplCplStt_ExcptLstStr

constexpr OUStringLiteral pXMLImplCplStt_ExcptLstStr = u"SentenceExceptList.xml"
constexpr

◆ pXMLImplWordStart_ExcptLstStr

constexpr OUStringLiteral pXMLImplWordStart_ExcptLstStr = u"WordExceptList.xml"
constexpr

◆ sImplEndSkipChars

constexpr std::u16string_view sImplEndSkipChars = u"\"')]}\u2018\u2019\u201a\u201b\u201c\u201d\u201e\u201f\u0083\u0084\u0089\u0091\u0092\u0093\u0094"

◆ sImplSttSkipChars

constexpr std::u16string_view sImplSttSkipChars = u"\"'([{\u2018\u2019\u201a\u201b\u201c\u201d\u201e\u201f\u0083\u0084\u0089\u0091\u0092\u0093\u0094"
constexpr