From 2c18f21dc7d5aedd7100b02f7a721551b73c537b Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 22 Nov 2001 00:30:44 +0000 Subject: [PATCH] change to /usr/share/wx/version git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/utils.h | 2 ++ src/common/utilscmn.cpp | 12 ++++++++++++ src/generic/dcpsg.cpp | 4 +--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/include/wx/utils.h b/include/wx/utils.h index f99f033246..9a0bc84d80 100644 --- a/include/wx/utils.h +++ b/include/wx/utils.h @@ -87,6 +87,8 @@ WXDLLEXPORT wxString wxNow(); // Return path where wxWindows is installed (mostly useful in Unices) WXDLLEXPORT const wxChar *wxGetInstallPrefix(); +// Return path to wxWin data (/usr/share/wx/%{version}) (Unices) +WXDLLEXPORT wxString wxGetDataDir(); #if wxUSE_GUI diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 9d0d3b771c..52c3b99282 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -1087,6 +1087,18 @@ const wxChar *wxGetInstallPrefix() #endif } +wxString wxGetDataDir() +{ + wxString format = wxGetInstallPrefix(); + format << wxFILE_SEP_PATH + << wxT("share") << wxFILE_SEP_PATH + << wxT("wx") << wxFILE_SEP_PATH + << wxT("%i.%i"); + wxString dir; + dir.Printf(format.c_str(), wxMAJOR_VERSION, wxMINOR_VERSION); + return dir; +} + // ---------------------------------------------------------------------------- // network and user id functions diff --git a/src/generic/dcpsg.cpp b/src/generic/dcpsg.cpp index ab20644576..03aa8f13d2 100644 --- a/src/generic/dcpsg.cpp +++ b/src/generic/dcpsg.cpp @@ -2034,10 +2034,8 @@ void wxPostScriptDC::DoGetTextExtent(const wxString& string, - afmFile = fopen() may fail and in that case the next if branch MUST be executed - and it would not if there was "else" */ { - afmName = wxGetInstallPrefix(); + afmName = wxGetDataDir(); afmName << wxFILE_SEP_PATH - << wxT("share") << wxFILE_SEP_PATH - << wxT("wx") << wxFILE_SEP_PATH #if defined(__LINUX__) || defined(__FREEBSD__) << wxT("gs_afm") << wxFILE_SEP_PATH #else -- 2.45.2