]> git.saurik.com Git - wxWidgets.git/commitdiff
change to /usr/share/wx/version
authorVáclav Slavík <vslavik@fastmail.fm>
Thu, 22 Nov 2001 00:30:44 +0000 (00:30 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Thu, 22 Nov 2001 00:30:44 +0000 (00:30 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/utils.h
src/common/utilscmn.cpp
src/generic/dcpsg.cpp

index f99f0332460d9696dd7c4e4b7a9ab4a6d3a92dea..9a0bc84d80bc6e0996c5d1878e2c9ba1e0b14744 100644 (file)
@@ -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
index 9d0d3b771cfd085d9ac4bd5237915583d2ba2d9b..52c3b99282c4ab550d71b8346d4cfa6055dc2316 100644 (file)
@@ -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
index ab2064457652d8afa087cdb551c60fa00771ad0d..03aa8f13d21c1a45d97a1868b0bf43349f569f60 100644 (file)
@@ -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