From 85ccdcce1c015733930f8ecec39294b0769eb6a2 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 17 Jul 1998 12:44:13 +0000 Subject: [PATCH] some "const"s added git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/postscrp.h | 2 +- include/wx/prntbase.h | 2 +- src/common/postscrp.cpp | 22 +++++++++++----------- src/common/prntbase.cpp | 4 ++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/include/wx/postscrp.h b/include/wx/postscrp.h index e8b72bdd69..3c8a2e39af 100644 --- a/include/wx/postscrp.h +++ b/include/wx/postscrp.h @@ -284,7 +284,7 @@ class WXDLLEXPORT wxPrintPaperDatabase: public wxList void ClearDatabase(void); void AddPaperType(char *name, int wmm, int hmm, int wp, int hp); - wxPrintPaperType *FindPaperType(char *name); + wxPrintPaperType *FindPaperType(const char *name); }; WXDLLEXPORT_DATA(extern wxPrintPaperDatabase*) wxThePrintPaperDatabase; diff --git a/include/wx/prntbase.h b/include/wx/prntbase.h index b713fbc614..b1b455853a 100644 --- a/include/wx/prntbase.h +++ b/include/wx/prntbase.h @@ -94,7 +94,7 @@ class WXDLLEXPORT wxPrintout: public wxObject bool isPreview; public: - wxPrintout(char *title = "Printout"); + wxPrintout(const char *title = "Printout"); ~wxPrintout(void); virtual bool OnBeginDocument(int startPage, int endPage); diff --git a/src/common/postscrp.cpp b/src/common/postscrp.cpp index 3ab71e83d8..196350876e 100644 --- a/src/common/postscrp.cpp +++ b/src/common/postscrp.cpp @@ -690,8 +690,8 @@ void wxPostScriptDC::SetFont (const wxFont& the_font) return; char buf[100]; - char *name; - char *style = ""; + const char *name; + const char *style = ""; int Style = m_font.GetStyle (); int Weight = m_font.GetWeight (); @@ -790,12 +790,12 @@ void wxPostScriptDC::SetPen (const wxPen& pen) will be first black line *2* units long, then space 4 units, then the pattern of *3* units black, 4 units space will be repeated. */ - static char *dotted = "[2 5] 2"; - static char *short_dashed = "[4 4] 2"; - static char *long_dashed = "[4 8] 2"; - static char *dotted_dashed = "[6 6 2 6] 4"; + static const char *dotted = "[2 5] 2"; + static const char *short_dashed = "[4 4] 2"; + static const char *long_dashed = "[4 8] 2"; + static const char *dotted_dashed = "[6 6 2 6] 4"; - char *psdash = NULL; + const char *psdash = NULL; switch (m_pen.GetStyle ()) { case wxDOT: @@ -1640,7 +1640,7 @@ void wxPostScriptDC::GetTextExtent (const wxString& string, long *x, long *y, // 1. construct filename ****************************************** /* MATTHEW: [2] Use wxTheFontNameDirectory */ - char *name; + const char *name; // Julian - we'll need to do this a different way now we've removed the // font directory system. Must find Stefan's original code. @@ -1983,7 +1983,7 @@ long wxPostScriptDC::LogicalToDeviceYRel (long y) const void wxPostScriptDC::GetSize(int* width, int* height) const { - char *paperType = wxThePrintSetupData->GetPaperName(); + const char *paperType = wxThePrintSetupData->GetPaperName(); if (!paperType) paperType = "A4 210 x 297 mm"; @@ -2004,7 +2004,7 @@ void wxPostScriptDC::GetSize(int* width, int* height) const void wxPostScriptDC::GetSizeMM(long *width, long *height) const { - char *paperType = wxThePrintSetupData->GetPaperName(); + const char *paperType = wxThePrintSetupData->GetPaperName(); if (!paperType) paperType = "A4 210 x 297 mm"; @@ -2565,7 +2565,7 @@ void wxPrintPaperDatabase::AddPaperType(char *name, int wmm, int hmm, int wp, in Append(name, new wxPrintPaperType(name, wmm, hmm, wp, hp)); } -wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(char *name) +wxPrintPaperType *wxPrintPaperDatabase::FindPaperType(const char *name) { wxNode *node = Find(name); if (node) diff --git a/src/common/prntbase.cpp b/src/common/prntbase.cpp index 99dcfbc57d..9f0da1d25f 100644 --- a/src/common/prntbase.cpp +++ b/src/common/prntbase.cpp @@ -148,9 +148,9 @@ void wxPrinterBase::ReportError(wxWindow *parent, wxPrintout *WXUNUSED(printout) * Printout class */ -wxPrintout::wxPrintout(char *title) +wxPrintout::wxPrintout(const char *title) { - printoutTitle = title ? copystring(title) : (char*)NULL; + printoutTitle = title ? copystring(title) : NULL; printoutDC = NULL; pageWidthMM = 0; pageHeightMM = 0; -- 2.45.2