Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-05-01 17:34:56 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-05-01 17:34:56 +0400
commit04cbb3ad149563035e6606db48040e4ef00f1762 (patch)
treee2de26a82133a1d4e22185c81a7777fbba98a83b
parent8843eb906388f9b014458f24bffb690a34ab4e5f (diff)
Fix for [#35116] Freestyle StringUtils::toAscii breakes non-ascii path values.
Just removed all calls of StringUtils::toAscii() as well as the function definitions.
-rw-r--r--source/blender/freestyle/intern/application/AppCanvas.cpp2
-rw-r--r--source/blender/freestyle/intern/application/AppConfig.cpp7
-rw-r--r--source/blender/freestyle/intern/application/Controller.cpp12
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp4
-rw-r--r--source/blender/freestyle/intern/system/StringUtils.cpp20
-rw-r--r--source/blender/freestyle/intern/system/StringUtils.h2
6 files changed, 13 insertions, 34 deletions
diff --git a/source/blender/freestyle/intern/application/AppCanvas.cpp b/source/blender/freestyle/intern/application/AppCanvas.cpp
index e385eb76fbe..e1f300b3ce0 100644
--- a/source/blender/freestyle/intern/application/AppCanvas.cpp
+++ b/source/blender/freestyle/intern/application/AppCanvas.cpp
@@ -39,7 +39,7 @@ AppCanvas::AppCanvas()
:Canvas()
{
_pViewer = 0;
- _MapsPath = StringUtils::toAscii(Config::Path::getInstance()->getMapsDir()).c_str();
+ _MapsPath = Config::Path::getInstance()->getMapsDir().c_str();
}
AppCanvas::AppCanvas(AppView *iViewer)
diff --git a/source/blender/freestyle/intern/application/AppConfig.cpp b/source/blender/freestyle/intern/application/AppConfig.cpp
index 94bda945701..bf6a502c397 100644
--- a/source/blender/freestyle/intern/application/AppConfig.cpp
+++ b/source/blender/freestyle/intern/application/AppConfig.cpp
@@ -83,15 +83,14 @@ Path *Path::getInstance()
string Path::getEnvVar(const string& iEnvVarName)
{
string value;
- if (!getenv(StringUtils::toAscii(iEnvVarName).c_str())) {
- cerr << "Warning: You may want to set the $" <<
- StringUtils::toAscii(iEnvVarName) <<
+ if (!getenv(iEnvVarName.c_str())) {
+ cerr << "Warning: You may want to set the $" << iEnvVarName <<
" environment variable to use Freestyle." << endl <<
" Otherwise, the current directory will be used instead." << endl;
value = ".";
}
else {
- value = getenv(StringUtils::toAscii(iEnvVarName).c_str());
+ value = getenv(iEnvVarName.c_str());
}
return value;
}
diff --git a/source/blender/freestyle/intern/application/Controller.cpp b/source/blender/freestyle/intern/application/Controller.cpp
index aaa8542d63b..7303ccc95f3 100644
--- a/source/blender/freestyle/intern/application/Controller.cpp
+++ b/source/blender/freestyle/intern/application/Controller.cpp
@@ -280,7 +280,7 @@ int Controller::LoadMesh(Render *re, SceneRenderLayer *srl)
char cleaned[FILE_MAX];
BLI_strncpy(cleaned, iFileName, FILE_MAX);
BLI_cleanup_file(NULL, cleaned);
- string basename = StringUtils::toAscii(string(cleaned));
+ string basename = string(cleaned);
#endif
_ListOfModels.push_back("Blender_models");
@@ -851,7 +851,7 @@ Render *Controller::RenderStrokes(Render *re)
void Controller::InsertStyleModule(unsigned index, const char *iFileName)
{
if (!BLI_testextensie(iFileName, ".py")) {
- cerr << "Error: Cannot load \"" << StringUtils::toAscii(string(iFileName)) << "\", unknown extension" << endl;
+ cerr << "Error: Cannot load \"" << string(iFileName) << "\", unknown extension" << endl;
return;
}
@@ -1015,10 +1015,10 @@ void Controller::init_options()
Config::Path * cpath = Config::Path::getInstance();
// Directories
- ViewMapIO::Options::setModelsPath(StringUtils::toAscii(cpath->getModelsPath()));
- PythonInterpreter::Options::setPythonPath(StringUtils::toAscii(cpath->getPythonPath()));
- TextureManager::Options::setPatternsPath(StringUtils::toAscii(cpath->getPatternsPath()));
- TextureManager::Options::setBrushesPath(StringUtils::toAscii(cpath->getModelsPath()));
+ ViewMapIO::Options::setModelsPath(cpath->getModelsPath());
+ PythonInterpreter::Options::setPythonPath(cpath->getPythonPath());
+ TextureManager::Options::setPatternsPath(cpath->getPatternsPath());
+ TextureManager::Options::setBrushesPath(cpath->getModelsPath());
// ViewMap Format
ViewMapIO::Options::rmFlags(ViewMapIO::Options::FLOAT_VECTORS);
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp b/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp
index 7b397f5eea1..e58a219aede 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderTextureManager.cpp
@@ -79,13 +79,13 @@ unsigned int BlenderTextureManager::loadBrush(string sname, Stroke::MediumType m
switch (mediumType) {
case Stroke::DRY_MEDIUM:
//soc prepareTextureLuminance((const char*)path.toAscii(), texId);
- prepareTextureLuminance(StringUtils::toAscii(path), texId);
+ prepareTextureLuminance(path, texId);
break;
case Stroke::HUMID_MEDIUM:
case Stroke::OPAQUE_MEDIUM:
default:
//soc prepareTextureAlpha((const char*)path.toAscii(), texId);
- prepareTextureAlpha(StringUtils::toAscii(path), texId);
+ prepareTextureAlpha(path, texId);
break;
}
if (G.debug & G_DEBUG_FREESTYLE) {
diff --git a/source/blender/freestyle/intern/system/StringUtils.cpp b/source/blender/freestyle/intern/system/StringUtils.cpp
index 20cec90fc9f..28876c4031f 100644
--- a/source/blender/freestyle/intern/system/StringUtils.cpp
+++ b/source/blender/freestyle/intern/system/StringUtils.cpp
@@ -54,7 +54,7 @@ void getPathName(const string& path, const string& base, vector<string>& pathnam
BLI_strncpy(cleaned, dir.c_str(), FILE_MAX);
BLI_cleanup_file(NULL, cleaned);
- res = toAscii(string(cleaned));
+ res = string(cleaned);
if (!base.empty())
res += Config::DIR_SEP + base;
@@ -63,24 +63,6 @@ void getPathName(const string& path, const string& base, vector<string>& pathnam
}
}
-string toAscii(const string &str)
-{
- stringstream out("");
- char s;
-
- for (unsigned int i = 0; i < str.size() ; i++) {
- s = ((char)(str.at(i) & 0x7F));
- out << s;
- }
-
- return out.str();
-}
-
-const char *toAscii(const char *str)
-{
- return toAscii(string(str)).c_str();
-}
-
} // end of namespace StringUtils
} /* namespace Freestyle */
diff --git a/source/blender/freestyle/intern/system/StringUtils.h b/source/blender/freestyle/intern/system/StringUtils.h
index 983e102d439..92600eddc42 100644
--- a/source/blender/freestyle/intern/system/StringUtils.h
+++ b/source/blender/freestyle/intern/system/StringUtils.h
@@ -53,8 +53,6 @@ namespace StringUtils {
LIB_SYSTEM_EXPORT
void getPathName(const string& path, const string& base, vector<string>& pathnames);
-string toAscii(const string &str);
-const char *toAscii(const char *str);
// STL related
struct ltstr