Changeset 87117 in webkit


Ignore:
Timestamp:
May 23, 2011 6:58:41 PM (13 years ago)
Author:
morrita@google.com
Message:

2011-05-22 MORITA Hajime <morrita@google.com>

Reviewed by Ryosuke Niwa.

SUPPORT_AUTOCORRECTION_PANEL should be USE(AUTOCORRECTION_PANEL)
https://bugs.webkit.org/show_bug.cgi?id=61181

  • Removed SUPPORT_AUTOCORRECTION_PANEL and REMOVE_MARKERS_UPON_EDITING from SpellingCorrectionController.h
  • Define WTF_USE_UNIFIED_TEXT_CHECKING and WTF_USE_AUTOMATIC_TEXT_REPLACEMENT at TextChecking.h

No new tests. Just renaming a compilation conditional.

  • editing/Editor.cpp: (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
  • editing/SpellingCorrectionCommand.cpp: (WebCore::SpellingCorrectionCommand::doApply):
  • editing/SpellingCorrectionController.cpp:
  • editing/SpellingCorrectionController.h: (WebCore::SpellingCorrectionController::shouldRemoveMarkersUponEditing):
  • loader/EmptyClients.h:
  • page/EditorClient.h:
  • platform/text/TextChecking.h:
Location:
trunk/Source/WebCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87115 r87117  
     12011-05-22  MORITA Hajime  <morrita@google.com>
     2
     3        Reviewed by Ryosuke Niwa.
     4
     5        SUPPORT_AUTOCORRECTION_PANEL should be USE(AUTOCORRECTION_PANEL)
     6        https://bugs.webkit.org/show_bug.cgi?id=61181
     7
     8        - Removed SUPPORT_AUTOCORRECTION_PANEL and REMOVE_MARKERS_UPON_EDITING from SpellingCorrectionController.h
     9        - Define WTF_USE_UNIFIED_TEXT_CHECKING and WTF_USE_AUTOMATIC_TEXT_REPLACEMENT at TextChecking.h
     10
     11        No new tests. Just renaming a compilation conditional.
     12
     13        * editing/Editor.cpp:
     14        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
     15        * editing/SpellingCorrectionCommand.cpp:
     16        (WebCore::SpellingCorrectionCommand::doApply):
     17        * editing/SpellingCorrectionController.cpp:
     18        * editing/SpellingCorrectionController.h:
     19        (WebCore::SpellingCorrectionController::shouldRemoveMarkersUponEditing):
     20        * loader/EmptyClients.h:
     21        * page/EditorClient.h:
     22        * platform/text/TextChecking.h:
     23
    1242011-05-23  Sheriff Bot  <webkit.review.bot@gmail.com>
    225
  • trunk/Source/WebCore/editing/Editor.cpp

    r87082 r87117  
    22222222
    22232223            if (shouldShowCorrectionPanel) {
    2224                 ASSERT(SUPPORT_AUTOCORRECTION_PANEL);
     2224#if !USE(AUTOCORRECTION_PANEL)
     2225                ASSERT_NOT_REACHED();
     2226#endif
    22252227                // shouldShowCorrectionPanel can be true only when the panel is available.
    22262228                if (resultLocation + resultLength == spellingRangeEndOffset) {
  • trunk/Source/WebCore/editing/SpellingCorrectionCommand.cpp

    r86325 r87117  
    3838namespace WebCore {
    3939
    40 #if SUPPORT_AUTOCORRECTION_PANEL
     40#if USE(AUTOCORRECTION_PANEL)
    4141// On Mac OS X, we use this command to keep track of user undoing a correction for the first time.
    4242// This information is needed by spell checking service to update user specific data.
     
    9797
    9898    applyCommandToComposite(SetSelectionCommand::create(m_selectionToBeCorrected, FrameSelection::SpellCorrectionTriggered | FrameSelection::CloseTyping | FrameSelection::ClearTypingStyle));
    99 #if SUPPORT_AUTOCORRECTION_PANEL
     99#if USE(AUTOCORRECTION_PANEL)
    100100    applyCommandToComposite(SpellingCorrectionRecordUndoCommand::create(document(), m_corrected, m_correction));
    101101#endif
  • trunk/Source/WebCore/editing/SpellingCorrectionController.cpp

    r86847 r87117  
    4949using namespace WTF;
    5050
    51 #if SUPPORT_AUTOCORRECTION_PANEL
     51#if USE(AUTOCORRECTION_PANEL)
    5252
    5353static const Vector<DocumentMarker::MarkerType>& markerTypesForAutocorrection()
  • trunk/Source/WebCore/editing/SpellingCorrectionController.h

    r86813 r87117  
    2626#ifndef SpellingCorrectionController_h
    2727#define SpellingCorrectionController_h
    28 
    29 #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
    30 // Some platforms provide UI for suggesting autocorrection.
    31 #define SUPPORT_AUTOCORRECTION_PANEL 1
    32 // Some platforms use spelling and autocorrection markers to provide visual cue.
    33 // On such platform, if word with marker is edited, we need to remove the marker.
    34 #define REMOVE_MARKERS_UPON_EDITING 1
    35 #else
    36 #define SUPPORT_AUTOCORRECTION_PANEL 0
    37 #define REMOVE_MARKERS_UPON_EDITING 0
    38 #endif // #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
    3928
    4029#include "DocumentMarker.h"
     
    7463};
    7564
    76 #if SUPPORT_AUTOCORRECTION_PANEL
     65#if USE(AUTOCORRECTION_PANEL)
    7766#define UNLESS_ENABLED(functionBody) ;
    7867#else
     
    111100    bool isSpellingMarkerAllowed(PassRefPtr<Range> misspellingRange) const UNLESS_ENABLED({ UNUSED_PARAM(misspellingRange); return true; })
    112101    bool isAutomaticSpellingCorrectionEnabled() UNLESS_ENABLED({ return false; })
    113     bool shouldRemoveMarkersUponEditing() { return REMOVE_MARKERS_UPON_EDITING; }
     102    bool shouldRemoveMarkersUponEditing();
    114103
    115104    void correctionPanelTimerFired(Timer<SpellingCorrectionController>*) UNLESS_ENABLED({})
     
    123112    void deletedAutocorrectionAtPosition(const Position&, const String& originalString) UNLESS_ENABLED({ UNUSED_PARAM(originalString); })
    124113
    125 #if SUPPORT_AUTOCORRECTION_PANEL
     114#if USE(AUTOCORRECTION_PANEL)
    126115private:
    127116    void recordAutocorrectionResponseReversed(const String& replacedString, const String& replacementString);
     
    152141#undef UNLESS_ENABLED
    153142
     143inline bool SpellingCorrectionController::shouldRemoveMarkersUponEditing()
     144{
     145#if USE(MARKER_REMOVAL_UPON_EDITING)
     146    return true;
     147#else
     148    return false;
     149#endif
     150}
     151
    154152} // namespace WebCore
    155153
  • trunk/Source/WebCore/loader/EmptyClients.h

    r86988 r87117  
    517517    TextCheckerClient* textChecker() { return &m_textCheckerClient; }
    518518
    519 #if SUPPORT_AUTOCORRECTION_PANEL
     519#if USE(AUTOCORRECTION_PANEL)
    520520    virtual void showCorrectionPanel(CorrectionPanelInfo::PanelType, const FloatRect&, const String&, const String&, const Vector<String>&) { }
    521521    virtual void dismissCorrectionPanel(ReasonForDismissingCorrectionPanel) { }
  • trunk/Source/WebCore/page/EditorClient.h

    r86451 r87117  
    156156    };
    157157
    158 #if SUPPORT_AUTOCORRECTION_PANEL
     158#if USE(AUTOCORRECTION_PANEL)
    159159    virtual void showCorrectionPanel(CorrectionPanelInfo::PanelType, const FloatRect& boundingBoxOfReplacedString, const String& replacedString, const String& replacmentString, const Vector<String>& alternativeReplacementStrings) = 0;
    160160    virtual void dismissCorrectionPanel(ReasonForDismissingCorrectionPanel) = 0;
  • trunk/Source/WebCore/platform/text/TextChecking.h

    r86520 r87117  
    4141#endif
    4242
     43#if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     44// Some platforms provide UI for suggesting autocorrection.
     45#define WTF_USE_AUTOCORRECTION_PANEL 1
     46// Some platforms use spelling and autocorrection markers to provide visual cue.
     47// On such platform, if word with marker is edited, we need to remove the marker.
     48#define WTF_USE_MARKER_REMOVAL_UPON_EDITING 1
     49#endif // #if PLATFORM(MAC) && !defined(BUILDING_ON_LEOPARD) && !defined(BUILDING_ON_SNOW_LEOPARD)
     50
    4351enum TextCheckingType {
    4452    TextCheckingTypeSpelling    = 1 << 1,
Note: See TracChangeset for help on using the changeset viewer.