From ac2194e67f35ea969946c0a53936c4affde67cc2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20Granjoux?= Date: Mon, 5 Jun 2017 15:11:30 +0200 Subject: [PATCH] Replace deprecated types --- plugins/scintilla/aneditor-indent.cxx | 8 ++++---- plugins/scintilla/aneditor-priv.h | 3 +-- plugins/scintilla/aneditor.cxx | 20 ++++++++++---------- plugins/scintilla/print.c | 9 +++++---- plugins/scintilla/text-editor-iterable.c | 1 - plugins/scintilla/text_editor.c | 7 +++---- plugins/scintilla/text_editor_cbs.c | 1 - plugins/scintilla/text_editor_prefs.c | 1 - 8 files changed, 23 insertions(+), 27 deletions(-) diff --git a/plugins/scintilla/aneditor-indent.cxx b/plugins/scintilla/aneditor-indent.cxx index 8678f42..271823a 100644 --- a/plugins/scintilla/aneditor-indent.cxx +++ b/plugins/scintilla/aneditor-indent.cxx @@ -21,7 +21,7 @@ #include "aneditor-priv.h" void AnEditor::IndentationIncrease(){ - CharacterRange crange = GetSelection(); + Sci_CharacterRange crange = GetSelection(); if (crange.cpMin != crange.cpMax) { SendEditor (SCI_TAB); @@ -34,7 +34,7 @@ void AnEditor::IndentationIncrease(){ } void AnEditor::IndentationDecrease(){ - CharacterRange crange = GetSelection(); + Sci_CharacterRange crange = GetSelection(); if (crange.cpMin != crange.cpMax) { SendEditor (SCI_BACKTAB); @@ -50,7 +50,7 @@ void AnEditor::IndentationDecrease(){ void AnEditor::SetLineIndentation(int line, int indent) { if (indent < 0) return; - CharacterRange crange = GetSelection(); + Sci_CharacterRange crange = GetSelection(); int posBefore = GetLineIndentPosition(line); SendEditor(SCI_SETLINEINDENTATION, line, indent); int posAfter = GetLineIndentPosition(line); @@ -127,7 +127,7 @@ void AnEditor::MaintainIndentation(char ch) { #if 0 void AnEditor::AutomaticIndentation(char ch) { - CharacterRange crange = GetSelection(); + Sci_CharacterRange crange = GetSelection(); int selStart = crange.cpMin; int curLine = GetCurrentLineNumber(); int thisLineStart = SendEditor(SCI_POSITIONFROMLINE, curLine); diff --git a/plugins/scintilla/aneditor-priv.h b/plugins/scintilla/aneditor-priv.h index 4637943..51cb22f 100644 --- a/plugins/scintilla/aneditor-priv.h +++ b/plugins/scintilla/aneditor-priv.h @@ -38,7 +38,6 @@ #include #define GTK -#define INCLUDE_DEPRECATED_FEATURES #include "Platform.h" #include "PropSet.h" #include "Scintilla.h" @@ -294,7 +293,7 @@ protected: void ClearDocument(); void CountLineEnds(int &linesCR, int &linesLF, int &linesCRLF); - CharacterRange GetSelection(); + Sci_CharacterRange GetSelection(); void WordSelect(); void LineSelect(); void SelectionIntoProperties(); diff --git a/plugins/scintilla/aneditor.cxx b/plugins/scintilla/aneditor.cxx index d61e4e1..aa5c568 100644 --- a/plugins/scintilla/aneditor.cxx +++ b/plugins/scintilla/aneditor.cxx @@ -367,7 +367,7 @@ int AnEditor::GetFullLine(SString & text, int line) { void AnEditor::GetRange(Window &win, int start, int end, char *text) { - TextRange tr; + Sci_TextRange tr; tr.chrg.cpMin = start; tr.chrg.cpMax = end; tr.lpstrText = text; @@ -375,7 +375,7 @@ void AnEditor::GetRange(Window &win, int start, int end, char *text) { } void AnEditor::GetRange(guint start, guint end, gchar *text, gboolean styled) { - TextRange tr; + Sci_TextRange tr; tr.chrg.cpMin = start; tr.chrg.cpMax = end; tr.lpstrText = text; @@ -631,8 +631,8 @@ void AnEditor::BraceMatch(bool editor) { } } -CharacterRange AnEditor::GetSelection() { - CharacterRange crange; +Sci_CharacterRange AnEditor::GetSelection() { + Sci_CharacterRange crange; crange.cpMin = SendEditor(SCI_GETSELECTIONSTART); crange.cpMax = SendEditor(SCI_GETSELECTIONEND); return crange; @@ -686,8 +686,8 @@ void AnEditor::LineSelect() { long AnEditor::Find (long flags, char* findWhat) { if (!findWhat) return -1; - TextToFind ft = {{0, 0}, 0, {0, 0}}; - CharacterRange crange = GetSelection(); + Sci_TextToFind ft = {{0, 0}, 0, {0, 0}}; + Sci_CharacterRange crange = GetSelection(); if (flags & ANEFIND_REVERSE_FLAG) { ft.chrg.cpMin = crange.cpMin - 1; ft.chrg.cpMax = 1; @@ -1331,7 +1331,7 @@ int AnEditor::GetLineLength(int line) { } int AnEditor::GetCurrentLineNumber() { - CharacterRange crange = GetSelection(); + Sci_CharacterRange crange = GetSelection(); int selStart = crange.cpMin; return SendEditor(SCI_LINEFROMPOSITION, selStart); } @@ -1344,7 +1344,7 @@ int AnEditor::GetCurrentScrollPosition() { // Upon a character being added, AnEditor may decide to perform some action // such as displaying a completion list. void AnEditor::CharAdded(char ch) { - CharacterRange crange = GetSelection(); + Sci_CharacterRange crange = GetSelection(); int selStart = crange.cpMin; int selEnd = crange.cpMax; if ((selEnd == selStart) && (selStart > 0)) { @@ -2161,7 +2161,7 @@ void AnEditor::HandleDwellStart(int mousePos) { if (debugTipOn) return; - CharacterRange crange = GetSelection(); + Sci_CharacterRange crange = GetSelection(); if (crange.cpMin == crange.cpMax || mousePos < crange.cpMin || mousePos >= crange.cpMax) @@ -2227,7 +2227,7 @@ int AnEditor::KeyPress(unsigned int state, unsigned int keyval){ (!SendEditor(SCI_CALLTIPACTIVE)) && (!SendEditor(SCI_AUTOCACTIVE))) { - CharacterRange crange = GetSelection(); + Sci_CharacterRange crange = GetSelection(); int selStart = crange.cpMin; int selEnd = crange.cpMax; diff --git a/plugins/scintilla/print.c b/plugins/scintilla/print.c index 93a845a..ea21ab7 100644 --- a/plugins/scintilla/print.c +++ b/plugins/scintilla/print.c @@ -39,7 +39,6 @@ #undef PLAT_GTK #define PLAT_GTK 1 -#define INCLUDE_DEPRECATED_FEATURES #include "Scintilla.h" #include "ScintillaWidget.h" #include "print.h" @@ -207,9 +206,11 @@ static void anjuta_print_job_info_style_clear_attributes (PrintJobInfoStyle *pis) { if (pis->attrs != NULL) - g_list_foreach (pis->attrs, (GFunc)pango_attribute_destroy, NULL); - g_list_free (pis->attrs); - pis->attrs = NULL; + { + g_list_foreach (pis->attrs, (GFunc)pango_attribute_destroy, NULL); + g_list_free (pis->attrs); + pis->attrs = NULL; + } } static void diff --git a/plugins/scintilla/text-editor-iterable.c b/plugins/scintilla/text-editor-iterable.c index 79822b4..fe7ad6f 100644 --- a/plugins/scintilla/text-editor-iterable.c +++ b/plugins/scintilla/text-editor-iterable.c @@ -35,7 +35,6 @@ #undef PLAT_GTK #define PLAT_GTK 1 -#define INCLUDE_DEPRECATED_FEATURES #include #include "Scintilla.h" #include "ScintillaWidget.h" diff --git a/plugins/scintilla/text_editor.c b/plugins/scintilla/text_editor.c index 40718d7..9dcfd53 100644 --- a/plugins/scintilla/text_editor.c +++ b/plugins/scintilla/text_editor.c @@ -72,7 +72,6 @@ #define GTK #undef PLAT_GTK #define PLAT_GTK 1 -#define INCLUDE_DEPRECATED_FEATURES #include "Scintilla.h" #include "SciLexer.h" #include "ScintillaWidget.h" @@ -1982,7 +1981,7 @@ gchar* text_editor_get_selection (TextEditor * te) { guint from, to; - struct TextRange tr; + struct Sci_TextRange tr; from = scintilla_send_message (SCINTILLA (te->scintilla), SCI_GETSELECTIONSTART, 0, 0); @@ -3889,7 +3888,7 @@ isearch_forward (IAnjutaEditorSearch* isearch, flags = SCFIND_MATCHCASE; } - struct TextToFind to_find; + struct Sci_TextToFind to_find; to_find.chrg.cpMin = start; to_find.chrg.cpMax = end; @@ -3930,7 +3929,7 @@ isearch_backward (IAnjutaEditorSearch* isearch, flags = SCFIND_MATCHCASE; } - struct TextToFind to_find; + struct Sci_TextToFind to_find; to_find.chrg.cpMin = start; to_find.chrg.cpMax = end; diff --git a/plugins/scintilla/text_editor_cbs.c b/plugins/scintilla/text_editor_cbs.c index 77dda30..c69399f 100644 --- a/plugins/scintilla/text_editor_cbs.c +++ b/plugins/scintilla/text_editor_cbs.c @@ -37,7 +37,6 @@ #define GTK #undef PLAT_GTK #define PLAT_GTK 1 -#define INCLUDE_DEPRECATED_FEATURES #include "Scintilla.h" #include "SciLexer.h" #include "ScintillaWidget.h" diff --git a/plugins/scintilla/text_editor_prefs.c b/plugins/scintilla/text_editor_prefs.c index 887cf5f..b5d4a89 100644 --- a/plugins/scintilla/text_editor_prefs.c +++ b/plugins/scintilla/text_editor_prefs.c @@ -28,7 +28,6 @@ #define GTK #undef PLAT_GTK #define PLAT_GTK 1 -#define INCLUDE_DEPRECATED_FEATURES #include "Scintilla.h" #include "SciLexer.h" #include "ScintillaWidget.h" -- 2.11.4.GIT