commit 679252b3e7d3faf5e307e7bfe39dc234b0fe07c9
Author: Koji Yokota <[email protected]>
Date: Wed Jul 16 17:40:32 2025 +0900
Fix warnings from -Woverloaded-virtual (again)
Resolved asymmetry of overloaded functions in a way of overriding.
Function names are brought back to the original as they are not the
cause.
---
src/MetricsInfo.cpp | 8 ++++----
src/MetricsInfo.h | 5 ++---
src/RowPainter.cpp | 2 +-
src/frontends/NullPainter.h | 8 ++++++--
src/frontends/Painter.h | 11 +++++------
src/frontends/qt/GuiPainter.cpp | 6 +++---
src/frontends/qt/GuiPainter.h | 15 +++++++--------
src/mathed/InsetMathChar.cpp | 4 ++--
src/mathed/InsetMathChar.h | 5 ++---
src/mathed/MathRow.cpp | 3 +--
10 files changed, 33 insertions(+), 34 deletions(-)
diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp
index c7a5ab2a82..095d591c95 100644
--- a/src/MetricsInfo.cpp
+++ b/src/MetricsInfo.cpp
@@ -179,11 +179,11 @@ void PainterInfo::draw(int x, int y, docstring const &
str)
}
-void PainterInfo::drawWithInputMethod(int x, int y, char_type c,
- frontend::InputMethod const * im,
- pos_type const char_format_index)
+void PainterInfo::draw(int x, int y, char_type c,
+ frontend::InputMethod const * im,
+ pos_type const char_format_index)
{
- pain.textWithInputMethod(x, y, c, im, char_format_index);
+ pain.text(x, y, c, im, char_format_index);
}
diff --git a/src/MetricsInfo.h b/src/MetricsInfo.h
index 061309d3e5..889e508efd 100644
--- a/src/MetricsInfo.h
+++ b/src/MetricsInfo.h
@@ -128,9 +128,8 @@ public:
///
void draw(int x, int y, docstring const & str);
///
- void drawWithInputMethod(int x, int y, char_type c,
- frontend::InputMethod const * im,
- pos_type const char_format_index);
+ void draw(int x, int y, char_type c, frontend::InputMethod const * im,
+ pos_type const char_format_index);
/// Determines the background color based on the
/// selection state, the background color inherited from the parent
inset
diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp
index 4bafe87f58..3ee26b6096 100644
--- a/src/RowPainter.cpp
+++ b/src/RowPainter.cpp
@@ -256,7 +256,7 @@ void RowPainter::paintStringAndSel(Row::Element const & e)
const
if (e.type == Row::PREEDIT) {
// the case of the preedit element
- pi_.pain.textWithInputMethod(int(x_), yo_, e.str, e.im,
e.char_format_index);
+ pi_.pain.text(int(x_), yo_, e.str, e.im, e.char_format_index);
} else if (all_sel || e.change.changed()) {
Font copy = e.font;
Color const col = e.change.changed() ? e.change.color()
diff --git a/src/frontends/NullPainter.h b/src/frontends/NullPainter.h
index 0c057dcf6a..28a1982d11 100644
--- a/src/frontends/NullPainter.h
+++ b/src/frontends/NullPainter.h
@@ -77,9 +77,13 @@ public:
void text(int, int, docstring const &, Font const &,
Color, size_type, size_type, double, double) override {}
+ /// draw a char with input method
+ void text(int, int, char_type, InputMethod const *,
+ pos_type const, Direction const = Auto) override {}
+
/// draw a string with input method
- void textWithInputMethod(int, int, docstring const &, InputMethod const
*,
- pos_type const, Direction const = Auto)
override {}
+ void text(int, int, docstring const &, InputMethod const *,
+ pos_type const, Direction const = Auto) override {}
/// This painter does not paint
bool isNull() const override { return true; }
diff --git a/src/frontends/Painter.h b/src/frontends/Painter.h
index aa2ec4303d..d1a9b95f4d 100644
--- a/src/frontends/Painter.h
+++ b/src/frontends/Painter.h
@@ -161,14 +161,13 @@ public:
double wordspacing, double textwidth) = 0;
/// draw a char at position x, y (y is the baseline) using input method
- virtual void textWithInputMethod(int, int, char_type, InputMethod const
*,
- pos_type const, Direction const =
Auto) {}
+ virtual void text(int, int, char_type, InputMethod const *,
+ pos_type const, Direction const = Auto) = 0;
/// draw a string at position x, y (y is the baseline) using input
method.
- virtual void textWithInputMethod(int x, int y, docstring const & str,
- InputMethod const * im,
- pos_type const char_format_index,
- Direction const dir = Auto) = 0;
+ virtual void text(int x, int y, docstring const & str,
+ InputMethod const * im, pos_type const
char_format_index,
+ Direction const dir = Auto) = 0;
// Returns true if the painter does not actually paint.
virtual bool isNull() const = 0;
diff --git a/src/frontends/qt/GuiPainter.cpp b/src/frontends/qt/GuiPainter.cpp
index c16a1dc86a..3d23b1ce97 100644
--- a/src/frontends/qt/GuiPainter.cpp
+++ b/src/frontends/qt/GuiPainter.cpp
@@ -344,14 +344,14 @@ void GuiPainter::text(int x, int y, docstring const & s,
}
-void GuiPainter::textWithInputMethod(int x, int y, char_type c, InputMethod
const * im,
+void GuiPainter::text(int x, int y, char_type c, InputMethod const * im,
pos_type const char_format_index, Direction const dir)
{
- textWithInputMethod(x, y, docstring(1, c), im, char_format_index, dir);
+ text(x, y, docstring(1, c), im, char_format_index, dir);
}
-void GuiPainter::textWithInputMethod(int x, int y, docstring const & s,
+void GuiPainter::text(int x, int y, docstring const & s,
InputMethod const * im,
pos_type const char_format_index,
Direction const dir)
diff --git a/src/frontends/qt/GuiPainter.h b/src/frontends/qt/GuiPainter.h
index fb98fd3c89..9e499e3c0d 100644
--- a/src/frontends/qt/GuiPainter.h
+++ b/src/frontends/qt/GuiPainter.h
@@ -136,15 +136,14 @@ public:
Color other, size_type from, size_type to,
double wordspacing, double textwidth) override;
- /// draw a string at position x, y (y is the baseline) using input
method.
- void textWithInputMethod(int x, int y, docstring const & str,
- InputMethod const * im,
- pos_type const char_format_index,
- Direction const dir = Auto) override;
/// draw a char at position x, y (y is the baseline) using input method
- void textWithInputMethod(int x, int y, char_type c, InputMethod const *
im,
- pos_type const char_format_index,
- Direction const dir = Auto) override;
+ void text(int x, int y, char_type c, InputMethod const * im,
+ pos_type const char_format_index,
+ Direction const dir = Auto) override;
+ /// draw a string at position x, y (y is the baseline) using input
method.
+ void text(int x, int y, docstring const & str, InputMethod const * im,
+ pos_type const char_format_index,
+ Direction const dir = Auto) override;
///
void textDecoration(FontInfo const & f, int x, int y, int width)
override;
diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp
index 3179589fd5..d6f93c558e 100644
--- a/src/mathed/InsetMathChar.cpp
+++ b/src/mathed/InsetMathChar.cpp
@@ -191,11 +191,11 @@ void InsetMathChar::draw(PainterInfo & pi, int x, int y)
const
}
-void InsetMathChar::drawWithInputMethod(PainterInfo & pi, int x, int y,
+void InsetMathChar::draw(PainterInfo & pi, int x, int y,
frontend::InputMethod const * im,
pos_type const char_format_index) const
{
- pi.drawWithInputMethod(x, y, char_, im, char_format_index);
+ pi.draw(x, y, char_, im, char_format_index);
}
diff --git a/src/mathed/InsetMathChar.h b/src/mathed/InsetMathChar.h
index 9ceaa3dff1..bd63436ded 100644
--- a/src/mathed/InsetMathChar.h
+++ b/src/mathed/InsetMathChar.h
@@ -28,9 +28,8 @@ public:
///
void draw(PainterInfo & pi, int x, int y) const override;
///
- void drawWithInputMethod(PainterInfo & pi, int x, int y,
- frontend::InputMethod const * im,
- pos_type const char_format_index) const;
+ void draw(PainterInfo & pi, int x, int y, frontend::InputMethod const *
im,
+ pos_type const char_format_index) const;
///
void metricsT(TextMetricsInfo const & mi, Dimension & dim) const
override;
///
diff --git a/src/mathed/MathRow.cpp b/src/mathed/MathRow.cpp
index 2507f23199..26de8b998d 100644
--- a/src/mathed/MathRow.cpp
+++ b/src/mathed/MathRow.cpp
@@ -346,8 +346,7 @@ void MathRow::draw(PainterInfo & pi, int x, int const y)
const
e.inset->draw(pi, x + e.before, y);
else
e.inset->asInsetMath()->asCharInset()
- ->drawWithInputMethod(pi, x + e.before,
y, e.im,
-
e.char_format_index);
+ ->draw(pi, x + e.before, y, e.im,
e.char_format_index);
g.pos = {x, y};
g.dim.wid += e.before + e.after;
drawMarkers(pi, e, x, y);
--
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs