From 4540a6f4557a171c8df2e1e4a51e1340a461d185 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Sat, 16 Nov 2019 19:57:45 +0100 Subject: [PATCH] Fixes the numerical streaming value for FLineEdit and FLabel --- src/flabel.cpp | 22 ++++++++++++++++++++-- src/flineedit.cpp | 22 ++++++++++++++++++++-- src/fstring.cpp | 26 +++++++++++++------------- src/include/final/flabel.h | 6 ++++-- src/include/final/flineedit.h | 6 ++++-- src/include/final/fstring.h | 12 ++++++------ 6 files changed, 67 insertions(+), 27 deletions(-) diff --git a/src/flabel.cpp b/src/flabel.cpp index 2941a21e..5bb41d4b 100644 --- a/src/flabel.cpp +++ b/src/flabel.cpp @@ -89,7 +89,7 @@ FLabel& FLabel::operator << (const wchar_t c) } //---------------------------------------------------------------------- -FLabel& FLabel::operator << (const uInt num) +FLabel& FLabel::operator << (const uInt16 num) { FString num_str; num_str << num; @@ -98,7 +98,25 @@ FLabel& FLabel::operator << (const uInt num) } //---------------------------------------------------------------------- -FLabel& FLabel::operator << (const int num) +FLabel& FLabel::operator << (const sInt16 num) +{ + FString num_str; + num_str << num; + setText(text + num_str); + return *this; +} + +//---------------------------------------------------------------------- +FLabel& FLabel::operator << (const uInt32 num) +{ + FString num_str; + num_str << num; + setText(text + num_str); + return *this; +} + +//---------------------------------------------------------------------- +FLabel& FLabel::operator << (const sInt32 num) { FString num_str; num_str << num; diff --git a/src/flineedit.cpp b/src/flineedit.cpp index 8fe0a46c..7c4e9cf6 100644 --- a/src/flineedit.cpp +++ b/src/flineedit.cpp @@ -94,7 +94,7 @@ FLineEdit& FLineEdit::operator << (const wchar_t c) } //---------------------------------------------------------------------- -FLineEdit& FLineEdit::operator << (const uInt num) +FLineEdit& FLineEdit::operator << (const uInt16 num) { FString num_str; num_str << num; @@ -103,7 +103,25 @@ FLineEdit& FLineEdit::operator << (const uInt num) } //---------------------------------------------------------------------- -FLineEdit& FLineEdit::operator << (const int num) +FLineEdit& FLineEdit::operator << (const sInt16 num) +{ + FString num_str; + num_str << num; + setText(text + num_str); + return *this; +} + +//---------------------------------------------------------------------- +FLineEdit& FLineEdit::operator << (const uInt32 num) +{ + FString num_str; + num_str << num; + setText(text + num_str); + return *this; +} + +//---------------------------------------------------------------------- +FLineEdit& FLineEdit::operator << (const sInt32 num) { FString num_str; num_str << num; diff --git a/src/fstring.cpp b/src/fstring.cpp index e06c8cd4..cb3d800a 100644 --- a/src/fstring.cpp +++ b/src/fstring.cpp @@ -261,15 +261,7 @@ FString& FString::operator << (const uInt16 num) } //---------------------------------------------------------------------- -FString& FString::operator << (const int num) -{ - FString numstr(FString().setNumber(num)); - _insert (length, numstr.length, numstr.string); - return *this; -} - -//---------------------------------------------------------------------- -FString& FString::operator << (const uInt num) +FString& FString::operator << (const sInt32 num) { FString numstr(FString().setNumber(num)); _insert (length, numstr.length, numstr.string); @@ -284,6 +276,14 @@ FString& FString::operator << (const sInt64 num) return *this; } +//---------------------------------------------------------------------- +FString& FString::operator << (const uInt32 num) +{ + FString numstr(FString().setNumber(num)); + _insert (length, numstr.length, numstr.string); + return *this; +} + //---------------------------------------------------------------------- FString& FString::operator << (const uInt64 num) { @@ -367,28 +367,28 @@ const FString& FString::operator >> (uInt16& num) } //---------------------------------------------------------------------- -const FString& FString::operator >> (int& num) +const FString& FString::operator >> (sInt32& num) { num = toInt(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (uInt& num) +const FString& FString::operator >> (uInt32& num) { num = toUInt(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (long& num) +const FString& FString::operator >> (sInt64& num) { num = toLong(); return *this; } //---------------------------------------------------------------------- -const FString& FString::operator >> (uLong& num) +const FString& FString::operator >> (uInt64& num) { num = toULong(); return *this; diff --git a/src/include/final/flabel.h b/src/include/final/flabel.h index 47bbfb04..d70db168 100644 --- a/src/include/final/flabel.h +++ b/src/include/final/flabel.h @@ -88,8 +88,10 @@ class FLabel : public FWidget FLabel& operator << (const FString&); FLabel& operator << (fc::SpecialCharacter); FLabel& operator << (const wchar_t); - FLabel& operator << (const uInt); - FLabel& operator << (const int); + FLabel& operator << (const uInt16); + FLabel& operator << (const sInt16); + FLabel& operator << (const uInt32); + FLabel& operator << (const sInt32); FLabel& operator << (const uInt64); FLabel& operator << (const sInt64); FLabel& operator << (const float); diff --git a/src/include/final/flineedit.h b/src/include/final/flineedit.h index e009ac5d..b14ee013 100644 --- a/src/include/final/flineedit.h +++ b/src/include/final/flineedit.h @@ -104,8 +104,10 @@ class FLineEdit : public FWidget FLineEdit& operator << (const FString&); FLineEdit& operator << (fc::SpecialCharacter); FLineEdit& operator << (const wchar_t); - FLineEdit& operator << (const uInt); - FLineEdit& operator << (const int); + FLineEdit& operator << (const uInt16); + FLineEdit& operator << (const sInt16); + FLineEdit& operator << (const uInt32); + FLineEdit& operator << (const sInt32); FLineEdit& operator << (const uInt64); FLineEdit& operator << (const sInt64); FLineEdit& operator << (const float); diff --git a/src/include/final/fstring.h b/src/include/final/fstring.h index b83995e7..35799f6b 100644 --- a/src/include/final/fstring.h +++ b/src/include/final/fstring.h @@ -116,8 +116,8 @@ class FString FString& operator << (const char); FString& operator << (const sInt16); FString& operator << (const uInt16); - FString& operator << (const int); - FString& operator << (const uInt); + FString& operator << (const sInt32); + FString& operator << (const uInt32); FString& operator << (const sInt64); FString& operator << (const uInt64); FString& operator << (const float); @@ -131,10 +131,10 @@ class FString const FString& operator >> (char&); const FString& operator >> (sInt16&); const FString& operator >> (uInt16&); - const FString& operator >> (int&); - const FString& operator >> (uInt&); - const FString& operator >> (long&); - const FString& operator >> (uLong&); + const FString& operator >> (sInt32&); + const FString& operator >> (uInt32&); + const FString& operator >> (sInt64&); + const FString& operator >> (uInt64&); const FString& operator >> (double&); const FString& operator >> (float&);