#ifdef _DEBUG_
static int MYDEBUG = 0;
+using namespace std;
#else
static int MYDEBUG = 0;
#endif
{
if(!_document) return false;
- _OCAFApp->SaveAs(_document, theFileName);
+#if defined(WIN32) && defined(UNICODE)
+ std::wstring aFileName = Kernel_Utils::utf8_decode_s(theFileName);
+#else
+ std::string aFileName = theFileName;
+#endif
+
+ _OCAFApp->SaveAs( _document, aFileName.c_str() );
return true;
}
//=============================================================================
bool GEOM_Engine::Load(const char* theFileName)
{
+#if defined(WIN32) && defined(UNICODE)
+ std::wstring aFileName = Kernel_Utils::utf8_decode_s(theFileName);
+#else
+ std::string aFileName = theFileName;
+#endif
Handle(TDocStd_Document) aDoc;
- if (_OCAFApp->Open(theFileName, aDoc) != PCDM_RS_OK) {
+ if (_OCAFApp->Open(aFileName.c_str(), aDoc) != PCDM_RS_OK) {
return false;
}
aStartPos = aCommand.Location(i-1, COMMA, 1, aCommand.Length()) + 2;
aEndPos = aCommand.Location(i, COMMA, 1, aCommand.Length());
}
+ if (aStartPos == 0 || aEndPos == 0)
+ continue;
if( aCommand.Value( aStartPos ) == O_SQR_BRACKET )
aStartPos++;
if (!thePublished.count(theTag)) {
// This object is not published yet.
+ thePublished.insert(theTag);
+
std::map< int, TCollection_AsciiString >::const_iterator anIt =
theEntryToCmdMap.find(theTag);
TIntToListIntMap::const_iterator aRefIt = theMapRefs.find(theTag);
if (aRefIt != theMapRefs.end()) {
- // Recursively publish all references.
+ // Recursively publish all references.
std::list< int >::const_iterator aRefTagIt = aRefIt->second.begin();
for(; aRefTagIt != aRefIt->second.end(); ++aRefTagIt) {
// Add the object command.
aResult += anIt->second;
}
-
- thePublished.insert(theTag);
}
return aResult;