From 953aebc2d5174d8e6243645ee2cb5aef1174808d Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Thu, 11 Dec 2008 12:14:14 +0000 Subject: [PATCH 1/1] substitute (c) and (C) for copyright strings as documented git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/aboutdlg.h | 4 ++++ src/generic/aboutdlgg.cpp | 12 +++++++++++- src/gtk/aboutdlg.cpp | 4 ++-- src/osx/carbon/aboutdlg.cpp | 2 +- src/osx/cocoa/aboutdlg.mm | 4 ++-- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/wx/aboutdlg.h b/include/wx/aboutdlg.h index 9c8946d193..44e86b06f6 100644 --- a/include/wx/aboutdlg.h +++ b/include/wx/aboutdlg.h @@ -128,6 +128,10 @@ public: // artists and translators) as a one long multiline string wxString GetDescriptionAndCredits() const; + // returns the copyright with the (C) string substituted by the Unicode + // character U+00A9 + wxString GetCopyrightToDisplay() const; + private: wxString m_name, m_version, diff --git a/src/generic/aboutdlgg.cpp b/src/generic/aboutdlgg.cpp index 09122a1c16..b7a9fcf977 100644 --- a/src/generic/aboutdlgg.cpp +++ b/src/generic/aboutdlgg.cpp @@ -96,6 +96,16 @@ wxIcon wxAboutDialogInfo::GetIcon() const return icon; } +wxString wxAboutDialogInfo::GetCopyrightToDisplay() const +{ + wxString ret = m_copyright; + + ret.Replace("(c)", "\u00A9"); + ret.Replace("(C)", "\u00A9"); + + return ret; +} + // ---------------------------------------------------------------------------- // wxGenericAboutDialog // ---------------------------------------------------------------------------- @@ -120,7 +130,7 @@ bool wxGenericAboutDialog::Create(const wxAboutDialogInfo& info) m_sizerText->Add(label, wxSizerFlags().Centre().Border()); m_sizerText->AddSpacer(5); - AddText(info.GetCopyright()); + AddText(info.GetCopyrightToDisplay()); AddText(info.GetDescription()); if ( info.HasWebSite() ) diff --git a/src/gtk/aboutdlg.cpp b/src/gtk/aboutdlg.cpp index 6e06f39b68..7be26532d9 100644 --- a/src/gtk/aboutdlg.cpp +++ b/src/gtk/aboutdlg.cpp @@ -44,7 +44,7 @@ public: GtkArray() : m_strings(0), m_count(0) { } - + // Create GtkArray from wxArrayString. Note that the created object is // only valid as long as 'a' is! GtkArray(const wxArrayString& a) @@ -124,7 +124,7 @@ void wxAboutBox(const wxAboutDialogInfo& info) else gtk_about_dialog_set_version(dlg, NULL); if ( info.HasCopyright() ) - gtk_about_dialog_set_copyright(dlg, wxGTK_CONV_SYS(info.GetCopyright())); + gtk_about_dialog_set_copyright(dlg, wxGTK_CONV_SYS(info.GetCopyrightToDisplay())); else gtk_about_dialog_set_copyright(dlg, NULL); if ( info.HasDescription() ) diff --git a/src/osx/carbon/aboutdlg.cpp b/src/osx/carbon/aboutdlg.cpp index 061a42b2a5..9188a221c7 100644 --- a/src/osx/carbon/aboutdlg.cpp +++ b/src/osx/carbon/aboutdlg.cpp @@ -75,7 +75,7 @@ void wxAboutBox(const wxAboutDialogInfo& info) } if ( info.HasCopyright() ) - opts.Set(kHIAboutBoxCopyrightKey, info.GetCopyright()); + opts.Set(kHIAboutBoxCopyrightKey, info.GetCopyrightToDisplay()); opts.Set(kHIAboutBoxDescriptionKey, info.GetDescriptionAndCredits()); diff --git a/src/osx/cocoa/aboutdlg.mm b/src/osx/cocoa/aboutdlg.mm index 553094bf18..9c702e9d55 100644 --- a/src/osx/cocoa/aboutdlg.mm +++ b/src/osx/cocoa/aboutdlg.mm @@ -62,7 +62,7 @@ public: void SetAttributedString( CFStringRef key, const wxString& value ) { - wxCFRef attrString( + wxCFRef attrString( CFAttributedStringCreate(kCFAllocatorDefault, wxCFStringRef(value), NULL) ); CFDictionarySetValue(*this, key, attrString); } @@ -92,7 +92,7 @@ void wxAboutBox(const wxAboutDialogInfo& info) } if ( info.HasCopyright() ) - opts.Set(CFSTR("Copyright"), info.GetCopyright()); + opts.Set(CFSTR("Copyright"), info.GetCopyrightToDisplay()); opts.SetAttributedString(CFSTR("Credits"), info.GetDescriptionAndCredits()); -- 2.45.2