Salome HOME
projects
/
modules
/
gui.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enable back CAF package.
[modules/gui.git]
/
src
/
CAF
/
CAF_Study.cxx
diff --git
a/src/CAF/CAF_Study.cxx
b/src/CAF/CAF_Study.cxx
index 3f3be8e2671ded3836084a944887b9f492d4c473..f4f4cf957be6cb5960581e41bf45a828a33acdcb 100755
(executable)
--- a/
src/CAF/CAF_Study.cxx
+++ b/
src/CAF/CAF_Study.cxx
@@
-1,4
+1,4
@@
-// Copyright (C) 2007-201
2
CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-201
6
CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@
-6,7
+6,7
@@
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License
, or (at your option) any later version
.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-25,8
+25,6
@@
#include "CAF_Tools.h"
#include "CAF_Application.h"
#include "CAF_Tools.h"
#include "CAF_Application.h"
-#include <Basics_OCCTVersion.hxx>
-
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Application.h>
#include <SUIT_Desktop.h>
#include <SUIT_MessageBox.h>
#include <SUIT_Application.h>
@@
-35,8
+33,7
@@
#include <TDF_Delta.hxx>
#include <TDF_ListIteratorOfDeltaList.hxx>
#include <TDF_Delta.hxx>
#include <TDF_ListIteratorOfDeltaList.hxx>
-#include <TDocStd_Application.hxx>
-
+#include <TColStd_SequenceOfAsciiString.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
#include <Standard_ErrorHandler.hxx>
@@
-108,11
+105,11
@@
bool CAF_Study::createDocument( const QString& doc )
if ( res && app && !app->stdApp().IsNull() )
{
try {
if ( res && app && !app->stdApp().IsNull() )
{
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
- TColStd_SequenceOfExtendedString formats;
- app->stdApp()->Formats( formats );
+ TColStd_SequenceOfAsciiString formats;
+ app->stdApp()->WritingFormats( formats );
+ if ( formats.IsEmpty() )
+ app->stdApp()->ReadingFormats( formats );
if ( !formats.IsEmpty() )
app->stdApp()->NewDocument( formats.First(), myStdDoc );
}
if ( !formats.IsEmpty() )
app->stdApp()->NewDocument( formats.First(), myStdDoc );
}
@@
-149,15
+146,8
@@
bool CAF_Study::openDocument( const QString& fname )
bool status = false;
try {
bool status = false;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
-
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == PCDM_RS_OK;
status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == PCDM_RS_OK;
-#else
- status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == CDF_RS_OK;
-#endif
}
catch ( Standard_Failure ) {
status = false;
}
catch ( Standard_Failure ) {
status = false;
@@
-179,21
+169,15
@@
bool CAF_Study::saveDocumentAs( const QString& fname )
bool save = false;
if ( !stdDoc().IsNull() && stdDoc()->IsSaved() )
{
bool save = false;
if ( !stdDoc().IsNull() && stdDoc()->IsSaved() )
{
- QString path = QDir::
convert
Separators( CAF_Tools::toQString( stdDoc()->GetPath() ) );
- save = path == QDir::
convert
Separators( fname );
+ QString path = QDir::
toNative
Separators( CAF_Tools::toQString( stdDoc()->GetPath() ) );
+ save = path == QDir::
toNative
Separators( fname );
}
bool status = false;
try {
}
bool status = false;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
if ( save )
if ( save )
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
status = app->Save( stdDoc() ) == PCDM_SS_OK;
status = app->Save( stdDoc() ) == PCDM_SS_OK;
-#else
- status = app->Save( stdDoc() ) == CDF_SS_OK;
-#endif
else
{
TCollection_ExtendedString format, path( CAF_Tools::toExtString( fname ) );
else
{
TCollection_ExtendedString format, path( CAF_Tools::toExtString( fname ) );
@@
-202,11
+186,7
@@
bool CAF_Study::saveDocumentAs( const QString& fname )
if ( format.Length() )
stdDoc()->ChangeStorageFormat( format );
if ( format.Length() )
stdDoc()->ChangeStorageFormat( format );
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
status = app->SaveAs( stdDoc(), path ) == PCDM_SS_OK;
status = app->SaveAs( stdDoc(), path ) == PCDM_SS_OK;
-#else
- status = app->SaveAs( stdDoc(), path ) == CDF_SS_OK;
-#endif
}
}
catch ( Standard_Failure ) {
}
}
catch ( Standard_Failure ) {
@@
-233,9
+213,7
@@
bool CAF_Study::openTransaction()
bool res = true;
try {
bool res = true;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
if ( myStdDoc->HasOpenCommand() )
myStdDoc->AbortCommand();
if ( myStdDoc->HasOpenCommand() )
myStdDoc->AbortCommand();
@@
-259,9
+237,7
@@
bool CAF_Study::abortTransaction()
bool res = true;
try {
bool res = true;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
myStdDoc->AbortCommand();
update();
}
myStdDoc->AbortCommand();
update();
}
@@
-282,9
+258,7
@@
bool CAF_Study::commitTransaction( const QString& name )
bool res = true;
try {
bool res = true;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
myStdDoc->CommitCommand();
if ( canUndo() )
myStdDoc->CommitCommand();
if ( canUndo() )
@@
-387,9
+361,7
@@
bool CAF_Study::undo()
return false;
try {
return false;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
myStdDoc->Undo();
undoModified(); /* decrement modification counter */
}
myStdDoc->Undo();
undoModified(); /* decrement modification counter */
}
@@
-411,9
+383,7
@@
bool CAF_Study::redo()
return false;
try {
return false;
try {
-#if OCC_VERSION_LARGE > 0x06010000
OCC_CATCH_SIGNALS;
OCC_CATCH_SIGNALS;
-#endif
myStdDoc->Redo();
doModified(); /* increment modification counter */
}
myStdDoc->Redo();
doModified(); /* increment modification counter */
}