Compare commits

...

5 Commits

Author SHA1 Message Date
roytam1 4f0154b92c Merge remote-tracking branch 'origin/master' into kmeleon76 1 month ago
roytam1 646c78a9d0 import changes from `dev' branch of rmottola/Arctic-Fox: 1 month ago
roytam1 e8d74fa3c4 import changes from `dev' branch of rmottola/Arctic-Fox: 2 months ago
roytam1 5628de57cc partly import changes from `dev' branch of rmottola/Arctic-Fox: 2 months ago
roytam1 5f65eee252 import changes from tenfourfox: #651: update HSTS, pins, TLDs, TZ data (fbd13e3c8) 2 months ago
  1. 3
      build/unix/stdc++compat/Makefile.in
  2. 3
      build/unix/stdc++compat/moz.build
  3. 2
      config/Makefile.in
  4. 3
      config/config.mk
  5. 6
      config/moz.build
  6. 4
      config/pathsub.c
  7. 4
      config/pathsub.h
  8. 6
      configure.in
  9. 5
      docshell/shistory/src/nsSHEntry.cpp
  10. 6
      docshell/shistory/src/nsSHEntry.h
  11. 6
      docshell/shistory/src/nsSHEntryShared.cpp
  12. 2
      docshell/shistory/src/nsSHEntryShared.h
  13. 6
      docshell/shistory/src/nsSHTransaction.cpp
  14. 6
      docshell/shistory/src/nsSHTransaction.h
  15. 14
      docshell/shistory/src/nsSHistory.cpp
  16. 6
      docshell/shistory/src/nsSHistory.h
  17. 3
      dom/base/nsDocument.cpp
  18. 15
      dom/base/nsGlobalWindow.cpp
  19. 6
      dom/base/nsGlobalWindow.h
  20. 2
      dom/canvas/CanvasImageCache.cpp
  21. 10
      dom/canvas/CanvasRenderingContext2D.cpp
  22. 2
      dom/ipc/ProcessPriorityManager.cpp
  23. 2
      extensions/spellcheck/hunspell/src/README.mozilla
  24. 9
      extensions/spellcheck/hunspell/src/affentry.cxx
  25. 9
      extensions/spellcheck/hunspell/src/affentry.hxx
  26. 31
      extensions/spellcheck/hunspell/src/affixmgr.cxx
  27. 9
      extensions/spellcheck/hunspell/src/affixmgr.hxx
  28. 9
      extensions/spellcheck/hunspell/src/atypes.hxx
  29. 9
      extensions/spellcheck/hunspell/src/baseaffix.hxx
  30. 66
      extensions/spellcheck/hunspell/src/csutil.cxx
  31. 9
      extensions/spellcheck/hunspell/src/csutil.hxx
  32. 9
      extensions/spellcheck/hunspell/src/filemgr.cxx
  33. 9
      extensions/spellcheck/hunspell/src/filemgr.hxx
  34. 25
      extensions/spellcheck/hunspell/src/hashmgr.cxx
  35. 10
      extensions/spellcheck/hunspell/src/hashmgr.hxx
  36. 9
      extensions/spellcheck/hunspell/src/htypes.hxx
  37. 28
      extensions/spellcheck/hunspell/src/hunspell.cxx
  38. 9
      extensions/spellcheck/hunspell/src/hunspell.hxx
  39. 9
      extensions/spellcheck/hunspell/src/hunzip.cxx
  40. 9
      extensions/spellcheck/hunspell/src/hunzip.hxx
  41. 9
      extensions/spellcheck/hunspell/src/langnum.hxx
  42. 3
      extensions/spellcheck/hunspell/src/phonet.cxx
  43. 39
      extensions/spellcheck/hunspell/src/replist.cxx
  44. 9
      extensions/spellcheck/hunspell/src/replist.hxx
  45. 159
      extensions/spellcheck/hunspell/src/suggestmgr.cxx
  46. 9
      extensions/spellcheck/hunspell/src/suggestmgr.hxx
  47. 9
      extensions/spellcheck/hunspell/src/w_char.hxx
  48. 7
      extensions/spellcheck/src/mozInlineSpellChecker.cpp
  49. 3
      gfx/layers/apz/test/helper_bug982141.html
  50. 2
      gfx/layers/client/TiledContentClient.cpp
  51. 3
      gfx/src/nsFontMetrics.cpp
  52. 2
      gfx/tests/gtest/gfxFontSelectionTest.cpp
  53. 2
      gfx/tests/gtest/gfxTextRunPerfTest.cpp
  54. 184
      gfx/tests/gtest/gfxWordCacheTest.cpp
  55. 5
      gfx/tests/reftest/1143303-1.svg
  56. 5
      gfx/thebes/gfxAndroidPlatform.cpp
  57. 5
      gfx/thebes/gfxAndroidPlatform.h
  58. 2
      gfx/thebes/gfxBlur.cpp
  59. 3
      gfx/thebes/gfxFont.cpp
  60. 2
      gfx/thebes/gfxFontconfigFonts.cpp
  61. 3
      gfx/thebes/gfxGradientCache.cpp
  62. 11
      gfx/thebes/gfxPlatform.h
  63. 7
      gfx/thebes/gfxPlatformGtk.cpp
  64. 8
      gfx/thebes/gfxPlatformGtk.h
  65. 3
      gfx/thebes/gfxPlatformMac.cpp
  66. 1
      gfx/thebes/gfxPlatformMac.h
  67. 1
      gfx/thebes/gfxQtPlatform.cpp
  68. 8
      gfx/thebes/gfxQtPlatform.h
  69. 7
      gfx/thebes/gfxTextRun.cpp
  70. 6
      gfx/thebes/gfxTextRun.h
  71. 3
      gfx/thebes/gfxWindowsPlatform.cpp
  72. 8
      gfx/thebes/gfxWindowsPlatform.h
  73. 140
      image/BMPFileHeaders.h
  74. 3
      image/SurfaceCache.cpp
  75. 209
      image/decoders/nsBMPDecoder.cpp
  76. 4
      image/decoders/nsBMPDecoder.h
  77. 2
      image/decoders/nsICODecoder.cpp
  78. 17
      image/encoders/bmp/nsBMPEncoder.cpp
  79. 11
      image/encoders/ico/nsICOEncoder.cpp
  80. 3
      image/imgLoader.cpp
  81. 170
      intl/icu/source/data/misc/zoneinfo64.txt
  82. 4
      js/src/configure.in
  83. 4
      layout/base/ActiveLayerTracker.cpp
  84. 4
      layout/base/FrameLayerBuilder.cpp
  85. 8
      layout/base/ZoomConstraintsClient.cpp
  86. 91
      layout/base/nsLayoutUtils.cpp
  87. 39
      layout/base/nsLayoutUtils.h
  88. 8
      layout/forms/nsComboboxControlFrame.cpp
  89. 5
      layout/generic/nsBlockFrame.cpp
  90. 5
      layout/generic/nsBlockReflowContext.cpp
  91. 37
      layout/generic/nsBulletFrame.cpp
  92. 6
      layout/generic/nsBulletFrame.h
  93. 8
      layout/generic/nsContainerFrame.h
  94. 20
      layout/generic/nsFrame.cpp
  95. 87
      layout/generic/nsGfxScrollFrame.cpp
  96. 36
      layout/generic/nsGfxScrollFrame.h
  97. 1584
      layout/generic/nsGridContainerFrame.cpp
  98. 172
      layout/generic/nsGridContainerFrame.h
  99. 52
      layout/generic/nsIFrame.h
  100. 19
      layout/generic/nsIScrollableFrame.h
  101. Some files were not shown because too many files have changed in this diff Show More

3
build/unix/stdc++compat/Makefile.in

@ -5,6 +5,3 @@
ENABLE_CLANG_PLUGIN :=
include $(topsrcdir)/config/rules.mk
CXXFLAGS += -DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_TARGET_VERSION)
HOST_CXXFLAGS += -DMOZ_LIBSTDCXX_VERSION=$(MOZ_LIBSTDCXX_HOST_VERSION)

3
build/unix/stdc++compat/moz.build

@ -19,3 +19,6 @@ FORCE_STATIC_LIB = True
NO_PGO = True
DISABLE_STL_WRAPPING = True
DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_TARGET_VERSION']
HOST_DEFINES['MOZ_LIBSTDCXX_VERSION'] = CONFIG['MOZ_LIBSTDCXX_HOST_VERSION']

2
config/Makefile.in

@ -41,8 +41,6 @@ endif
include $(topsrcdir)/config/rules.mk
HOST_CFLAGS += -DUNICODE -D_UNICODE
ifndef JS_STANDALONE
ifndef MOZ_PROFILE_USE
# Generate a new buildid every time we "export" in config... that's only

3
config/config.mk

@ -447,6 +447,9 @@ ifndef CROSS_COMPILE
HOST_CFLAGS += $(RTL_FLAGS)
endif
HOST_CFLAGS += $(HOST_DEFINES) $(MOZBUILD_HOST_CFLAGS)
HOST_CXXFLAGS += $(HOST_DEFINES) $(MOZBUILD_HOST_CXXFLAGS)
#
# Name of the binary code directories
#

6
config/moz.build

@ -46,5 +46,7 @@ PYTHON_UNIT_TESTS += [
if CONFIG['GNU_CC'] and CONFIG['MOZ_OPTIMIZE']:
CFLAGS += ['-O3']
# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
HOST_DEFINES = {
'UNICODE': True,
'_UNICODE': True,
}

4
config/pathsub.c

@ -34,7 +34,7 @@
char *program;
void
fail(char *format, ...)
fail(const char *format, ...)
{
int error;
va_list ap;
@ -143,7 +143,7 @@ xbasename(char *path)
}
void
xchdir(char *dir)
xchdir(const char *dir)
{
if (chdir(dir) < 0)
fail("cannot change directory to %s", dir);

4
config/pathsub.h

@ -25,13 +25,13 @@
extern char *program;
extern void fail(char *format, ...);
extern void fail(const char *format, ...);
extern char *getcomponent(char *path, char *name);
extern char *ino2name(ino_t ino);
extern void *xmalloc(size_t size);
extern char *xstrdup(char *s);
extern char *xbasename(char *path);
extern void xchdir(char *dir);
extern void xchdir(const char *dir);
/* Relate absolute pathnames from and to returning the result in outpath. */
extern int relatepaths(char *from, char *to, char *outpath);

6
configure.in

@ -1819,7 +1819,7 @@ case "$host" in
HOST_CFLAGS="$HOST_CFLAGS -mwindows"
fi
HOST_CFLAGS="$HOST_CFLAGS -DXP_WIN32 -DXP_WIN -DWIN32 -D_WIN32 -DNO_X11 -D_CRT_SECURE_NO_WARNINGS"
HOST_NSPR_MDCPUCFG='\"md/_winnt.cfg\"'
HOST_NSPR_MDCPUCFG='"md/_winnt.cfg"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O2}"
HOST_BIN_SUFFIX=.exe
case "$host" in
@ -1845,13 +1845,13 @@ case "$host" in
*-darwin*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX -DXP_MACOSX -DNO_X11"
HOST_NSPR_MDCPUCFG='\"md/_darwin.cfg\"'
HOST_NSPR_MDCPUCFG='"md/_darwin.cfg"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
;;
*-linux*|*-kfreebsd*-gnu|*-gnu*)
HOST_CFLAGS="$HOST_CFLAGS -DXP_UNIX"
HOST_NSPR_MDCPUCFG='\"md/_linux.cfg\"'
HOST_NSPR_MDCPUCFG='"md/_linux.cfg"'
HOST_OPTIMIZE_FLAGS="${HOST_OPTIMIZE_FLAGS=-O3}"
;;

5
docshell/shistory/src/nsSHEntry.cpp

@ -1,4 +1,5 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -83,7 +84,7 @@ nsSHEntry::SetScrollPosition(int32_t aX, int32_t aY)
}
NS_IMETHODIMP
nsSHEntry::GetScrollPosition(int32_t *aX, int32_t *aY)
nsSHEntry::GetScrollPosition(int32_t* aX, int32_t* aY)
{
*aX = mScrollPositionX;
*aY = mScrollPositionY;

6
docshell/shistory/src/nsSHEntry.h

@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

6
docshell/shistory/src/nsSHEntryShared.cpp

@ -1,3 +1,5 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -25,7 +27,7 @@ namespace {
uint64_t gSHEntrySharedID = 0;
} // anonymous namespace
} // namespace
#define CONTENT_VIEWER_TIMEOUT_SECONDS "browser.sessionhistory.contentViewerTimeout"
// Default this to time out unused content viewers after 30 minutes
@ -36,7 +38,7 @@ class HistoryTracker final : public HistoryTrackerBase
{
public:
explicit HistoryTracker(uint32_t aTimeout)
: HistoryTrackerBase(1000 * aTimeout / 2)
: HistoryTrackerBase(1000 * aTimeout / 2, "HistoryTracker")
{
}

2
docshell/shistory/src/nsSHEntryShared.h

@ -1,3 +1,5 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

6
docshell/shistory/src/nsSHTransaction.cpp

@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

6
docshell/shistory/src/nsSHTransaction.h

@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

14
docshell/shistory/src/nsSHistory.cpp

@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -227,7 +227,7 @@ EvictContentViewerForTransaction(nsISHTransaction* aTrans)
}
}
} // anonymous namespace
} // namespace
nsSHistory::nsSHistory()
: mIndex(-1)
@ -1046,7 +1046,7 @@ public:
int32_t mDistance;
};
} // anonymous namespace
} // namespace
// static
void
@ -1315,7 +1315,9 @@ nsSHistory::RemoveDuplicate(int32_t aIndex, bool aKeepNext)
nsCOMPtr<nsISHTransaction> txToRemove, txToKeep, txNext, txPrev;
GetTransactionAtIndex(aIndex, getter_AddRefs(txToRemove));
GetTransactionAtIndex(compareIndex, getter_AddRefs(txToKeep));
NS_ENSURE_TRUE(txToRemove, false);
if (!txToRemove) {
return false;
}
NS_ENSURE_TRUE(txToKeep, false);
txToRemove->GetNext(getter_AddRefs(txNext));
txToRemove->GetPrev(getter_AddRefs(txPrev));

6
docshell/shistory/src/nsSHistory.h

@ -1,6 +1,6 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* This Source Code Form is subject to the terms of the Mozilla Public
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

3
dom/base/nsDocument.cpp

@ -1413,7 +1413,8 @@ nsDOMStyleSheetSetList::EnsureFresh()
// ==================================================================
nsIDocument::SelectorCache::SelectorCache()
: nsExpirationTracker<SelectorCacheKey, 4>(1000) { }
: nsExpirationTracker<SelectorCacheKey, 4>(1000, "nsIDocument::SelectorCache")
{ }
// CacheList takes ownership of aSelectorList.
void nsIDocument::SelectorCache::CacheList(const nsAString& aSelector,

15
dom/base/nsGlobalWindow.cpp

@ -544,6 +544,13 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsTimeout, AddRef)
NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsTimeout, Release)
nsresult
nsTimeout::InitTimer(uint32_t aDelay)
{
return mTimer->InitWithFuncCallback(nsGlobalWindow::TimerCallback, this,
aDelay, nsITimer::TYPE_ONE_SHOT);
}
// Return true if this timeout has a refcount of 1. This is used to check
// that dummy_timeout doesn't leak from nsGlobalWindow::RunTimeout.
bool
@ -12225,7 +12232,7 @@ nsGlobalWindow::SetTimeoutOrInterval(nsIScriptTimeoutHandler *aHandler,
nsRefPtr<nsTimeout> copy = timeout;
rv = timeout->InitTimer(TimerCallback, realInterval);
rv = timeout->InitTimer(realInterval);
if (NS_FAILED(rv)) {
return rv;
}
@ -12474,7 +12481,7 @@ nsGlobalWindow::RescheduleTimeout(nsTimeout* aTimeout, const TimeStamp& now,
// Reschedule the OS timer. Don't bother returning any error codes if
// this fails since the callers of this method don't care about them.
nsresult rv = aTimeout->InitTimer(TimerCallback, delay.ToMilliseconds());
nsresult rv = aTimeout->InitTimer(delay.ToMilliseconds());
if (NS_FAILED(rv)) {
NS_ERROR("Error initializing timer for DOM timeout!");
@ -12771,7 +12778,7 @@ nsresult nsGlobalWindow::ResetTimersForNonBackgroundWindow()
timeout->mFiringDepth = firingDepth;
timeout->Release();
nsresult rv = timeout->InitTimer(TimerCallback, delay.ToMilliseconds());
nsresult rv = timeout->InitTimer(delay.ToMilliseconds());
if (NS_FAILED(rv)) {
NS_WARNING("Error resetting non background timer for DOM timeout!");
@ -13213,7 +13220,7 @@ nsGlobalWindow::ResumeTimeouts(bool aThawChildren)
t->mTimer = do_CreateInstance("@mozilla.org/timer;1");
NS_ENSURE_TRUE(t->mTimer, NS_ERROR_OUT_OF_MEMORY);
rv = t->InitTimer(TimerCallback, delay);
rv = t->InitTimer(delay);
if (NS_FAILED(rv)) {
t->mTimer = nullptr;
return rv;

6
dom/base/nsGlobalWindow.h

@ -159,11 +159,7 @@ public:
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsTimeout)
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsTimeout)
nsresult InitTimer(nsTimerCallbackFunc aFunc, uint32_t aDelay)
{
return mTimer->InitWithFuncCallback(aFunc, this, aDelay,
nsITimer::TYPE_ONE_SHOT);
}
nsresult InitTimer(uint32_t aDelay);
bool HasRefCntOne();

2
dom/canvas/CanvasImageCache.cpp

@ -216,7 +216,7 @@ public:
};
ImageCache::ImageCache()
: nsExpirationTracker<ImageCacheEntryData,4>(GENERATION_MS)
: nsExpirationTracker<ImageCacheEntryData,4>(GENERATION_MS, "ImageCache")
, mTotal(0)
{
if (!sPrefsInitialized) {

10
dom/canvas/CanvasRenderingContext2D.cpp

@ -4006,16 +4006,16 @@ gfxFontGroup *CanvasRenderingContext2D::GetCurrentFontStyle()
if (err.Failed() || !fontUpdated) {
gfxFontStyle style;
style.size = kDefaultFontSize;
gfxTextPerfMetrics* tp = nullptr;
if (presShell && !presShell->IsDestroying()) {
tp = presShell->GetPresContext()->GetTextPerfMetrics();
}
CurrentState().fontGroup =
gfxPlatform::GetPlatform()->CreateFontGroup(FontFamilyList(eFamily_sans_serif),
&style,
&style, tp,
nullptr);
if (CurrentState().fontGroup) {
CurrentState().font = kDefaultFontStyle;
if (presShell && !presShell->IsDestroying()) {
CurrentState().fontGroup->SetTextPerfMetrics(
presShell->GetPresContext()->GetTextPerfMetrics());
}
} else {
NS_ERROR("Default canvas font is invalid");
}

2
dom/ipc/ProcessPriorityManager.cpp

@ -1095,7 +1095,7 @@ ParticularProcessPriorityManager::SetPriorityNow(ProcessPriority aPriority,
}
if (aPriority < PROCESS_PRIORITY_FOREGROUND) {
unused << mContentParent->SendFlushMemory(NS_LITERAL_STRING("low-memory"));
unused << mContentParent->SendFlushMemory(NS_LITERAL_STRING("lowering-priority"));
}
FireTestOnlyObserverNotification("process-priority-set",

2
extensions/spellcheck/hunspell/src/README.mozilla

@ -0,0 +1,2 @@
Hunspell Version: 1.6.1
Additional Patches: See patches directory.

9
extensions/spellcheck/hunspell/src/affentry.cxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,

9
extensions/spellcheck/hunspell/src/affentry.hxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,

31
extensions/spellcheck/hunspell/src/affixmgr.cxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,
@ -1290,8 +1287,8 @@ int AffixMgr::cpdrep_check(const char* word, int wl) {
// search every occurence of the pattern in the word
while ((r = strstr(r, reptable[i].pattern.c_str())) != NULL) {
std::string candidate(word);
size_t type = r == word ? 1 : 0;
if (r - word + reptable[i].pattern.size() == lenp)
size_t type = r == word && langnum != LANG_hu ? 1 : 0;
if (r - word + reptable[i].pattern.size() == lenp && langnum != LANG_hu)
type += 2;
candidate.replace(r - word, lenp, reptable[i].outstrings[type]);
if (candidate_check(candidate.c_str(), candidate.size()))
@ -1494,9 +1491,8 @@ int AffixMgr::defcpd_check(hentry*** words,
}
inline int AffixMgr::candidate_check(const char* word, int len) {
struct hentry* rv = NULL;
rv = lookup(word);
struct hentry* rv = lookup(word);
if (rv)
return 1;
@ -1817,7 +1813,7 @@ struct hentry* AffixMgr::compound_check(const std::string& word,
// LANG_hu section: spec. Hungarian rule
if (langnum == LANG_hu) {
// calculate syllable number of the word
numsyllable += get_syllable(st.substr(i));
numsyllable += get_syllable(st.substr(0, i));
// + 1 word, if syllable number of the prefix > 1 (hungarian
// convention)
if (pfx && (get_syllable(pfx->getKey()) > 1))
@ -1902,7 +1898,7 @@ struct hentry* AffixMgr::compound_check(const std::string& word,
(compoundend && TESTAFF(rv->astr, compoundend, rv->alen))) &&
(((cpdwordmax == -1) || (wordnum + 1 < cpdwordmax)) ||
((cpdmaxsyllable != 0) &&
(numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->clen)) <=
(numsyllable + get_syllable(std::string(HENTRY_WORD(rv), rv->blen)) <=
cpdmaxsyllable))) &&
(
// test CHECKCOMPOUNDPATTERN
@ -2383,7 +2379,7 @@ int AffixMgr::compound_check_morph(const char* word,
// LANG_hu section: spec. Hungarian rule
if (langnum == LANG_hu) {
// calculate syllable number of the word
numsyllable += get_syllable(st.substr(i));
numsyllable += get_syllable(st.substr(0, i));
// + 1 word, if syllable number of the prefix > 1 (hungarian
// convention)
@ -3045,10 +3041,9 @@ struct hentry* AffixMgr::affix_check(const char* word,
int len,
const FLAG needflag,
char in_compound) {
struct hentry* rv = NULL;
// check all prefixes (also crossed with suffixes if allowed)
rv = prefix_check(word, len, in_compound, needflag);
struct hentry* rv = prefix_check(word, len, in_compound, needflag);
if (rv)
return rv;
@ -3292,7 +3287,7 @@ int AffixMgr::expand_rootword(struct guessword* wlst,
wlst[nh].word = mystrdup(ts);
if (!wlst[nh].word)
return 0;
wlst[nh].allow = (1 == 0);
wlst[nh].allow = false;
wlst[nh].orig = NULL;
nh++;
// add special phonetic version
@ -3300,7 +3295,7 @@ int AffixMgr::expand_rootword(struct guessword* wlst,
wlst[nh].word = mystrdup(phon);
if (!wlst[nh].word)
return nh - 1;
wlst[nh].allow = (1 == 0);
wlst[nh].allow = false;
wlst[nh].orig = mystrdup(ts);
if (!wlst[nh].orig)
return nh - 1;
@ -3341,7 +3336,7 @@ int AffixMgr::expand_rootword(struct guessword* wlst,
wlst[nh].word = mystrdup(prefix.c_str());
if (!wlst[nh].word)
return nh - 1;
wlst[nh].allow = (1 == 0);
wlst[nh].allow = false;
wlst[nh].orig = mystrdup(newword.c_str());
if (!wlst[nh].orig)
return nh - 1;

9
extensions/spellcheck/hunspell/src/affixmgr.hxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,

9
extensions/spellcheck/hunspell/src/atypes.hxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,

9
extensions/spellcheck/hunspell/src/baseaffix.hxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,

66
extensions/spellcheck/hunspell/src/csutil.cxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,
@ -518,18 +515,20 @@ unsigned char ccase(const struct cs_info* csconv, int nIndex) {
w_char upper_utf(w_char u, int langnum) {
unsigned short idx = (u.h << 8) + u.l;
if (idx != unicodetoupper(idx, langnum)) {
u.h = (unsigned char)(unicodetoupper(idx, langnum) >> 8);
u.l = (unsigned char)(unicodetoupper(idx, langnum) & 0x00FF);
unsigned short upridx = unicodetoupper(idx, langnum);
if (idx != upridx) {
u.h = (unsigned char)(upridx >> 8);
u.l = (unsigned char)(upridx & 0x00FF);
}
return u;
}
w_char lower_utf(w_char u, int langnum) {
unsigned short idx = (u.h << 8) + u.l;
if (idx != unicodetolower(idx, langnum)) {
u.h = (unsigned char)(unicodetolower(idx, langnum) >> 8);
u.l = (unsigned char)(unicodetolower(idx, langnum) & 0x00FF);
unsigned short lwridx = unicodetolower(idx, langnum);
if (idx != lwridx) {
u.h = (unsigned char)(lwridx >> 8);
u.l = (unsigned char)(lwridx & 0x00FF);
}
return u;
}
@ -551,12 +550,13 @@ std::string& mkallsmall(std::string& s, const struct cs_info* csconv) {
}
std::vector<w_char>& mkallsmall_utf(std::vector<w_char>& u,
int langnum) {
int langnum) {
for (size_t i = 0; i < u.size(); ++i) {
unsigned short idx = (u[i].h << 8) + u[i].l;
if (idx != unicodetolower(idx, langnum)) {
u[i].h = (unsigned char)(unicodetolower(idx, langnum) >> 8);
u[i].l = (unsigned char)(unicodetolower(idx, langnum) & 0x00FF);
unsigned short lwridx = unicodetolower(idx, langnum);
if (idx != lwridx) {
u[i].h = (unsigned char)(lwridx >> 8);
u[i].l = (unsigned char)(lwridx & 0x00FF);
}
}
return u;
@ -565,9 +565,10 @@ std::vector<w_char>& mkallsmall_utf(std::vector<w_char>& u,
std::vector<w_char>& mkallcap_utf(std::vector<w_char>& u, int langnum) {
for (size_t i = 0; i < u.size(); i++) {
unsigned short idx = (u[i].h << 8) + u[i].l;
if (idx != unicodetoupper(idx, langnum)) {
u[i].h = (unsigned char)(unicodetoupper(idx, langnum) >> 8);
u[i].l = (unsigned char)(unicodetoupper(idx, langnum) & 0x00FF);
unsigned short upridx = unicodetoupper(idx, langnum);
if (idx != upridx) {
u[i].h = (unsigned char)(upridx >> 8);
u[i].l = (unsigned char)(upridx & 0x00FF);
}
}
return u;
@ -583,9 +584,10 @@ std::string& mkinitcap(std::string& s, const struct cs_info* csconv) {
std::vector<w_char>& mkinitcap_utf(std::vector<w_char>& u, int langnum) {
if (!u.empty()) {
unsigned short idx = (u[0].h << 8) + u[0].l;
if (idx != unicodetoupper(idx, langnum)) {
u[0].h = (unsigned char)(unicodetoupper(idx, langnum) >> 8);
u[0].l = (unsigned char)(unicodetoupper(idx, langnum) & 0x00FF);
unsigned short upridx = unicodetoupper(idx, langnum);
if (idx != upridx) {
u[0].h = (unsigned char)(upridx >> 8);
u[0].l = (unsigned char)(upridx & 0x00FF);
}
}
return u;
@ -601,9 +603,10 @@ std::string& mkinitsmall(std::string& s, const struct cs_info* csconv) {
std::vector<w_char>& mkinitsmall_utf(std::vector<w_char>& u, int langnum) {
if (!u.empty()) {
unsigned short idx = (u[0].h << 8) + u[0].l;
if (idx != unicodetolower(idx, langnum)) {
u[0].h = (unsigned char)(unicodetolower(idx, langnum) >> 8);
u[0].l = (unsigned char)(unicodetolower(idx, langnum) & 0x00FF);
unsigned short lwridx = unicodetolower(idx, langnum);
if (idx != lwridx) {
u[0].h = (unsigned char)(lwridx >> 8);
u[0].l = (unsigned char)(lwridx & 0x00FF);
}
}
return u;
@ -2531,12 +2534,17 @@ int get_captype_utf8(const std::vector<w_char>& word, int langnum) {
size_t ncap = 0;
size_t nneutral = 0;
size_t firstcap = 0;
for (size_t i = 0; i < word.size(); ++i) {
unsigned short idx = (word[i].h << 8) + word[i].l;
if (idx != unicodetolower(idx, langnum))
std::vector<w_char>::const_iterator it = word.begin();
std::vector<w_char>::const_iterator it_end = word.end();
while (it != it_end) {
unsigned short idx = (it->h << 8) + it->l;
unsigned short lwridx = unicodetolower(idx, langnum);
if (idx != lwridx)
ncap++;
if (unicodetoupper(idx, langnum) == unicodetolower(idx, langnum))
if (unicodetoupper(idx, langnum) == lwridx)
nneutral++;
++it;
}
if (ncap) {
unsigned short idx = (word[0].h << 8) + word[0].l;

9
extensions/spellcheck/hunspell/src/csutil.hxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,

9
extensions/spellcheck/hunspell/src/filemgr.cxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,

9
extensions/spellcheck/hunspell/src/filemgr.hxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,

25
extensions/spellcheck/hunspell/src/hashmgr.cxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,
@ -363,12 +360,11 @@ int HashMgr::add_hidden_capitalized_word(const std::string& word,
}
// detect captype and modify word length for UTF-8 encoding
int HashMgr::get_clen_and_captype(const std::string& word, int* captype) {
int HashMgr::get_clen_and_captype(const std::string& word, int* captype, std::vector<w_char> &workbuf) {
int len;
if (utf8) {
std::vector<w_char> dest_utf;
len = u8_u16(dest_utf, word);
*captype = get_captype_utf8(dest_utf, langnum);
len = u8_u16(workbuf, word);
*captype = get_captype_utf8(workbuf, langnum);
} else {
len = word.size();
*captype = get_captype(word, csconv);
@ -376,6 +372,11 @@ int HashMgr::get_clen_and_captype(const std::string& word, int* captype) {
return len;
}
int HashMgr::get_clen_and_captype(const std::string& word, int* captype) {
std::vector<w_char> workbuf;
return get_clen_and_captype(word, captype, workbuf);
}
// remove word (personal dictionary function for standalone applications)
int HashMgr::remove(const std::string& word) {
struct hentry* dp = lookup(word.c_str());
@ -527,6 +528,8 @@ int HashMgr::load_tables(const char* tpath, const char* key) {
// loop through all words on much list and add to hash
// table and create word and affix strings
std::vector<w_char> workbuf;
while (dict->getline(ts)) {
mychomp(ts);
// split each line into word and morphological description
@ -599,7 +602,7 @@ int HashMgr::load_tables(const char* tpath, const char* key) {
}
int captype;
int wcl = get_clen_and_captype(ts, &captype);
int wcl = get_clen_and_captype(ts, &captype, workbuf);
const std::string *dp_str = dp.empty() ? NULL : &dp;
// add the word and its index plus its capitalized form optionally
if (add_word(ts, wcl, flags, al, dp_str, false) ||

10
extensions/spellcheck/hunspell/src/hashmgr.hxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,
@ -125,6 +122,7 @@ class HashMgr {
private:
int get_clen_and_captype(const std::string& word, int* captype);
int get_clen_and_captype(const std::string& word, int* captype, std::vector<w_char> &workbuf);
int load_tables(const char* tpath, const char* key);
int add_word(const std::string& word,
int wcl,

9
extensions/spellcheck/hunspell/src/htypes.hxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,

28
extensions/spellcheck/hunspell/src/hunspell.cxx

@ -1,6 +1,8 @@
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* Copyright (C) 2002-2017 Németh László
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
@ -11,12 +13,7 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Hunspell, based on MySpell.
*
* The Initial Developers of the Original Code are
* Kevin Hendricks (MySpell) and Németh László (Hunspell).
* Portions created by the Initial Developers are Copyright (C) 2002-2005
* the Initial Developers. All Rights Reserved.
* Hunspell is based on MySpell which is Copyright (C) 2002 Kevin Hendricks.
*
* Contributor(s): David Einstein, Davide Prina, Giuseppe Modugno,
* Gianluca Turconi, Simon Brouwer, Noll János, Bíró Árpád,
@ -241,8 +238,8 @@ size_t HunspellImpl::cleanword2(std::string& dest,
const char* q = src.c_str();
// first skip over any leading blanks
while ((*q != '\0') && (*q == ' '))
q++;
while (*q == ' ')
++q;
// now strip off any trailing periods (recording their presence)
*pabbrev = 0;
@ -278,8 +275,8 @@ void HunspellImpl::cleanword(std::string& dest,
int firstcap = 0;
// first skip over any leading blanks
while ((*q != '\0') && (*q == ' '))
q++;
while (*q == ' ')
++q;
// now strip off any trailing periods (recording their presence)
*pabbrev = 0;
@ -1664,7 +1661,7 @@ std::string HunspellImpl::get_xml_par(const char* par) {
if (end == '>')
end = '<';
else if (end != '\'' && end != '"')
return 0; // bad XML
return dest; // bad XML
for (par++; *par != '\0' && *par != end; ++par) {
dest.push_back(*par);
}
@ -1707,14 +1704,17 @@ bool HunspellImpl::input_conv(const std::string& word, std::string& dest) {
// return the beginning of the element (attr == NULL) or the attribute
const char* HunspellImpl::get_xml_pos(const char* s, const char* attr) {
const char* end = strchr(s, '>');
const char* p = s;
if (attr == NULL)