[SCM] FreeCAD packaging branch, master, updated. debian/0.9.2646-1-6-g82c37eb

Adam C Powell IV (none) hazelsct at workhorse.
Sat Dec 12 02:16:48 UTC 2009


The following commit has been merged in the master branch:
commit 82c37eb8d39d6b20e984c060c43da55305c24290
Author: Adam C Powell IV <hazelsct at workhorse.(none)>
Date:   Fri Dec 11 20:24:47 2009 -0500

    Upstream changes in -4 tarball.

diff --git a/debian/changelog b/debian/changelog
index fb2c008..0524694 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+freecad (0.9.2646.4-1) unstable; urgency=low
+
+  * New upstream version (closes: #559849, #559846).
+
+ -- Adam C. Powell, IV <hazelsct at debian.org>  Fri, 11 Dec 2009 20:21:32 -0500
+
 freecad (0.9.2646.3-1) unstable; urgency=low
 
   * New upstream version. Removes TiddlySaver.jar, fixes help problems.
diff --git a/src/App/Application.cpp b/src/App/Application.cpp
index f2e3dde..40c71f7 100644
--- a/src/App/Application.cpp
+++ b/src/App/Application.cpp
@@ -455,7 +455,7 @@ const char* Application::GetHomePath(void) const
 std::string Application::getResourceDir()
 {
 # ifdef RESOURCEDIR
-    return std::string(RESOURCEDIR);
+    return std::string(RESOURCEDIR) + "/";
 #else
     return mConfig["AppHomePath"];
 #endif
diff --git a/src/App/DocumentObject.cpp b/src/App/DocumentObject.cpp
index 84b4eb4..1f66ab7 100644
--- a/src/App/DocumentObject.cpp
+++ b/src/App/DocumentObject.cpp
@@ -90,7 +90,7 @@ DocumentObjectExecReturn *DocumentObject::execute(void)
 
 short DocumentObject::mustExecute(void) const
 {
-    return 0;
+    return (isTouched() ? 1 : 0);
 }
 
 const char* DocumentObject::getStatusString(void) const
diff --git a/src/Gui/View3DPy.cpp b/src/Gui/View3DPy.cpp
index 64102c5..a06bf20 100644
--- a/src/Gui/View3DPy.cpp
+++ b/src/Gui/View3DPy.cpp
@@ -79,6 +79,7 @@ void View3DInventorPy::init_type()
     add_varargs_method("saveImage",&View3DInventorPy::saveImage,"saveImage()");
     add_varargs_method("saveVectorGraphic",&View3DInventorPy::saveVectorGraphic,"saveVectorGraphic()");
     add_varargs_method("getCamera",&View3DInventorPy::getCamera,"getCamera()");
+    add_varargs_method("getCameraNode",&View3DInventorPy::getCameraNode,"getCameraNode()");
     add_varargs_method("getViewDirection",&View3DInventorPy::getViewDirection,"getViewDirection()");
     add_varargs_method("setCamera",&View3DInventorPy::setCamera,"setCamera()");
     add_varargs_method("getCameraType",&View3DInventorPy::getCameraType,"getCameraType()");
@@ -484,6 +485,27 @@ Py::Object View3DInventorPy::saveVectorGraphic(const Py::Tuple& args)
     }
 }
 
+Py::Object View3DInventorPy::getCameraNode(const Py::Tuple& args)
+{
+    if (!PyArg_ParseTuple(args.ptr(), ""))
+        throw Py::Exception();
+
+    try {
+        SoNode* camera = _view->getViewer()->getCamera();
+        PyObject* proxy = 0;
+        std::string type;
+        type = "So"; // seems that So prefix is missing in camera node
+        type += camera->getTypeId().getName().getString();
+        type += " *";
+        proxy = Base::Interpreter().createSWIGPointerObj(type.c_str(), (void*)camera, 1);
+        camera->ref();
+        return Py::Object(proxy, true);
+    }
+    catch (const Base::Exception& e) {
+        throw Py::Exception(e.what());
+    }
+}
+
 Py::Object View3DInventorPy::getCamera(const Py::Tuple& args)
 {
     if (!PyArg_ParseTuple(args.ptr(), ""))
diff --git a/src/Gui/View3DPy.h b/src/Gui/View3DPy.h
index a3b71b8..66c102a 100644
--- a/src/Gui/View3DPy.h
+++ b/src/Gui/View3DPy.h
@@ -69,6 +69,7 @@ public:
     Py::Object setCamera(const Py::Tuple&);
     Py::Object getCameraType(const Py::Tuple&);
     Py::Object setCameraType(const Py::Tuple&);
+    Py::Object getCameraNode(const Py::Tuple&);
     Py::Object listCameraTypes(const Py::Tuple&);
     Py::Object getCursorPos(const Py::Tuple&);
     Py::Object getObjectInfo(const Py::Tuple&);
diff --git a/src/Main/MainCmd.cpp b/src/Main/MainCmd.cpp
index d19f7ff..6f8745b 100644
--- a/src/Main/MainCmd.cpp
+++ b/src/Main/MainCmd.cpp
@@ -65,6 +65,14 @@ const char sBanner[] = "(c) Juergen Riegel, Werner Mayer 2001-2009\n"\
 
 int main( int argc, char ** argv )
 {
+    // Make sure that we use '.' as decimal point
+#if defined(FC_OS_LINUX)
+    putenv("LANG=C");
+    putenv("LC_ALL=C");
+#else
+    setlocale(LC_NUMERIC, "C");
+#endif
+
     // Name and Version of the Application
     App::Application::Config()["ExeName"] = "FreeCAD";
     App::Application::Config()["ExeVendor"] = "FreeCAD";
diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp
index 6464e3d..9bb5a2d 100644
--- a/src/Main/MainGui.cpp
+++ b/src/Main/MainGui.cpp
@@ -148,6 +148,7 @@ int main( int argc, char ** argv )
     // Make sure that we use '.' as decimal point
 #if defined(FC_OS_LINUX)
     putenv("LANG=C");
+    putenv("LC_ALL=C");
 #else
     setlocale(LC_NUMERIC, "C");
 #endif
diff --git a/src/Mod/Draft/Draft.py b/src/Mod/Draft/Draft.py
index 9a299c5..7199c7b 100644
--- a/src/Mod/Draft/Draft.py
+++ b/src/Mod/Draft/Draft.py
@@ -498,7 +498,7 @@ class arcTracker(Tracker):
 	def __init__(self,dotted=False,scolor=None,swidth=None,axis=Vector(0,0,1)):
 		Tracker.__init__(self,dotted,scolor,swidth)
 		self.axis = axis
-		self.initrot = FreeCADGui.ActiveDocument.ActiveView.getViewer().getCamera().orientation
+		self.initrot = FreeCADGui.ActiveDocument.ActiveView.getCameraNode().orientation
 		container = coin.SoSeparator()
 		self.startrot = coin.SoRotation()
 		self.coords = coin.SoCoordinate4()
@@ -816,7 +816,7 @@ class Creator:
 				self.upVec = Vector(0,1,0)
 			else:
 				self.axis = fcvec.neg(self.view.getViewDirection())
-				rot = self.view.getViewer().getCamera().orientation.getValue()
+				rot = self.view.getCameraNode().orientation.getValue()
 				self.upVec = Vector(rot.multVec(coin.SbVec3f((0,1,0))).getValue())
 				self.xVec = fcvec.rotate(self.upVec,math.pi/2,fcvec.neg(self.axis))
 			self.ui.cross(True)
@@ -1591,7 +1591,7 @@ class Modifier:
 				self.upVec = Vector(0,1,0)
 			else:
 				self.axis = fcvec.neg(self.view.getViewDirection())
-				rot = self.view.getViewer().getCamera().orientation.getValue()
+				rot = self.view.getCameraNode().orientation.getValue()
 				self.upVec = Vector(rot.multVec(coin.SbVec3f((0,1,0))).getValue())
 				self.xVec = fcvec.rotate(self.upVec,math.pi/2,fcvec.neg(self.axis))
 			self.node = []
@@ -1810,7 +1810,7 @@ class Rotate(Modifier):
 			self.upVec = Vector(0,1,0)
 		else:
 			self.axis = fcvec.neg(self.view.getViewDirection())
-			rot = self.view.getViewer().getCamera().orientation.getValue()
+			rot = self.view.getCameraNode().orientation.getValue()
 			self.upVec = Vector(rot.multVec(coin.SbVec3f((0,1,0))).getValue())
 			self.xVec = fcvec.rotate(self.upVec,math.pi/2,fcvec.neg(self.axis))
 		self.arctrack = arcTracker(axis=self.axis)
diff --git a/src/Mod/Drawing/App/FeaturePage.cpp b/src/Mod/Drawing/App/FeaturePage.cpp
index 093b40f..0b33975 100644
--- a/src/Mod/Drawing/App/FeaturePage.cpp
+++ b/src/Mod/Drawing/App/FeaturePage.cpp
@@ -25,7 +25,6 @@
 
 #ifndef _PreComp_
 # include <sstream>
-
 #endif
 
 
@@ -40,9 +39,9 @@
 using namespace Drawing;
 using namespace std;
 
-  
+
 //===========================================================================
-// FeatureView
+// FeaturePage
 //===========================================================================
 
 PROPERTY_SOURCE(Drawing::FeaturePage, App::DocumentObjectGroup)
@@ -51,10 +50,10 @@ const char *group = "Drawing view";
 
 FeaturePage::FeaturePage(void) 
 {
-  static const char *group = "Drawing view";
+    static const char *group = "Drawing view";
 
-  ADD_PROPERTY_TYPE(PageResult ,(0),group,App::Prop_Output,"Resulting SVG document of that page");
-  ADD_PROPERTY_TYPE(Template   ,(""),group,App::Prop_None  ,"Template for the page");
+    ADD_PROPERTY_TYPE(PageResult ,(0),group,App::Prop_Output,"Resulting SVG document of that page");
+    ADD_PROPERTY_TYPE(Template   ,(""),group,App::Prop_None  ,"Template for the page");
 }
 
 FeaturePage::~FeaturePage()
@@ -63,9 +62,8 @@ FeaturePage::~FeaturePage()
 
 App::DocumentObjectExecReturn *FeaturePage::execute(void)
 {
-	const char* t = PageResult.getValue();
-	if(std::string(PageResult.getValue()) == "")
-		PageResult.setValue(Template.getValue());
+    if (std::string(PageResult.getValue()).empty())
+        PageResult.setValue(Template.getValue());
 
     Base::FileInfo fi(Template.getValue());
     if (!fi.isReadable()) {
@@ -75,30 +73,29 @@ App::DocumentObjectExecReturn *FeaturePage::execute(void)
     }
     // open Template file
     string line;
-    ifstream file ( fi.filePath().c_str() );
+    ifstream file (fi.filePath().c_str());
 
     // make a temp file for FileIncluded Property
     string tempName = PageResult.getExchangeTempFile();
     ofstream ofile(tempName.c_str());
 
-    while (! file.eof() )
+    while (!file.eof())
     {
-      getline (file,line);
-      if(line != "<!- DrawingContent -->")
-        ofile << line << endl;
-      else
-      {
-        // get through the children and collect all the views
-		  const std::vector<App::DocumentObject*> &Grp = Group.getValues();
-		  for(std::vector<App::DocumentObject*>::const_iterator It= Grp.begin();It!=Grp.end();++It){
-			  if((*It)->getTypeId().isDerivedFrom(Drawing::FeatureView::getClassTypeId())){
-				  Drawing::FeatureView *View = dynamic_cast<Drawing::FeatureView *>(*It);
-				  ofile << View->ViewResult.getValue();
-				  ofile << endl << endl << endl;
-			  }
-
-		  }
-      }
+        getline (file,line);
+        if(line != "<!- DrawingContent -->")
+            ofile << line << endl;
+        else
+        {
+            // get through the children and collect all the views
+            const std::vector<App::DocumentObject*> &Grp = Group.getValues();
+            for (std::vector<App::DocumentObject*>::const_iterator It= Grp.begin();It!=Grp.end();++It) {
+                if ((*It)->getTypeId().isDerivedFrom(Drawing::FeatureView::getClassTypeId())) {
+                    Drawing::FeatureView *View = dynamic_cast<Drawing::FeatureView *>(*It);
+                    ofile << View->ViewResult.getValue();
+                    ofile << endl << endl << endl;
+                }
+            }
+        }
     }
 
     file.close();
@@ -106,15 +103,12 @@ App::DocumentObjectExecReturn *FeaturePage::execute(void)
 
     PageResult.setValue(tempName.c_str());
 
- 
-  //const char* text = "lskdfjlsd";
-  //const char* regex = "lskdflds";
-  //boost::regex e(regex);
-  //boost::smatch what;
-  //if(boost::regex_match(string(text), what, e))
-  //{
-  //}
-  return App::DocumentObject::StdReturn;
+    //const char* text = "lskdfjlsd";
+    //const char* regex = "lskdflds";
+    //boost::regex e(regex);
+    //boost::smatch what;
+    //if(boost::regex_match(string(text), what, e))
+    //{
+    //}
+    return App::DocumentObject::StdReturn;
 }
-
-
diff --git a/src/Mod/Drawing/App/FeaturePage.h b/src/Mod/Drawing/App/FeaturePage.h
index 064e3eb..fdd5f6f 100644
--- a/src/Mod/Drawing/App/FeaturePage.h
+++ b/src/Mod/Drawing/App/FeaturePage.h
@@ -20,8 +20,6 @@
  *                                                                         *
  ***************************************************************************/
 
- 
-
 
 #ifndef _FeaturePage_h_
 #define _FeaturePage_h_
@@ -35,7 +33,7 @@
 class PyObjectBase;
 
 namespace Base{
-  class PyObjectBase;
+    class PyObjectBase;
 }
 
 namespace Drawing
@@ -46,27 +44,27 @@ namespace Drawing
  */
 class AppDrawingExport FeaturePage: public App::DocumentObjectGroup
 {
-  PROPERTY_HEADER(Drawing::FeaturePage);
+    PROPERTY_HEADER(Drawing::FeaturePage);
 
 public:
-	/// Constructor
-	FeaturePage(void);
-  virtual ~FeaturePage();
+    /// Constructor
+    FeaturePage(void);
+    virtual ~FeaturePage();
 
-  App::PropertyFileIncluded PageResult;
-  App::PropertyFile Template;
+    App::PropertyFileIncluded PageResult;
+    App::PropertyFile Template;
 
 
-  /** @name methods overide Feature */
-  //@{
-  /// recalculate the Feature
-  virtual App::DocumentObjectExecReturn *execute(void);
-  //@}
+    /** @name methods overide Feature */
+    //@{
+    /// recalculate the Feature
+    virtual App::DocumentObjectExecReturn *execute(void);
+    //@}
 
-  /// returns the type name of the ViewProvider
-  virtual const char* getViewProviderName(void) const {
-    return "DrawingGui::ViewProviderDrawingPage";
-  }
+    /// returns the type name of the ViewProvider
+    virtual const char* getViewProviderName(void) const {
+        return "DrawingGui::ViewProviderDrawingPage";
+    }
 };
 
 
diff --git a/src/Mod/Drawing/App/FeatureView.cpp b/src/Mod/Drawing/App/FeatureView.cpp
index a7adc9c..56315ac 100644
--- a/src/Mod/Drawing/App/FeatureView.cpp
+++ b/src/Mod/Drawing/App/FeatureView.cpp
@@ -43,7 +43,7 @@ using namespace Drawing;
 // FeatureView
 //===========================================================================
 
-PROPERTY_SOURCE(Drawing::FeatureView, App::AbstractFeature)
+PROPERTY_SOURCE(Drawing::FeatureView, App::DocumentObject)
 
 
 
@@ -55,7 +55,7 @@ FeatureView::FeatureView(void)
     ADD_PROPERTY_TYPE(Scale ,(1.0),group,App::Prop_None,"Scale factor of the view");
     ADD_PROPERTY_TYPE(Rotation ,(0),group,App::Prop_None,"Rotation of the view in degres counterclockwise");
 
-    App::PropertyType type = (App::PropertyType)(App::Prop_Output|App::Prop_Hidden);
+    App::PropertyType type = (App::PropertyType)(App::Prop_Hidden);
     ADD_PROPERTY_TYPE(ViewResult ,(0),group,type,"Resulting SVG fragment of that view");
 }
 
diff --git a/src/Mod/Drawing/App/FeatureView.h b/src/Mod/Drawing/App/FeatureView.h
index db8a7cc..4a5830c 100644
--- a/src/Mod/Drawing/App/FeatureView.h
+++ b/src/Mod/Drawing/App/FeatureView.h
@@ -45,7 +45,7 @@ namespace Drawing
 
 /** Base class of all View Features in the drawing module
  */
-class AppDrawingExport FeatureView: public App::AbstractFeature
+class AppDrawingExport FeatureView: public App::DocumentObject
 {
   PROPERTY_HEADER(Drawing::FeatureView);
 
diff --git a/src/Mod/Drawing/App/FeatureViewPart.cpp b/src/Mod/Drawing/App/FeatureViewPart.cpp
index b321950..2c5c820 100644
--- a/src/Mod/Drawing/App/FeatureViewPart.cpp
+++ b/src/Mod/Drawing/App/FeatureViewPart.cpp
@@ -67,7 +67,7 @@ using namespace std;
 
 
 //===========================================================================
-// FeatureView
+// FeatureViewPart
 //===========================================================================
 
 PROPERTY_SOURCE(Drawing::FeatureViewPart, Drawing::FeatureView)
@@ -75,11 +75,11 @@ PROPERTY_SOURCE(Drawing::FeatureViewPart, Drawing::FeatureView)
 
 FeatureViewPart::FeatureViewPart(void) 
 {
-  static const char *group = "Shape view";
+    static const char *group = "Shape view";
 
-  ADD_PROPERTY_TYPE(Direction ,(0,0,1.0),group,App::Prop_None,"Projection direction");
-  ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"Shape to view");
-  ADD_PROPERTY_TYPE(ShowHiddenLines ,(false),group,App::Prop_None,"Control the aperance of the dashed hiden lines");
+    ADD_PROPERTY_TYPE(Direction ,(0,0,1.0),group,App::Prop_None,"Projection direction");
+    ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"Shape to view");
+    ADD_PROPERTY_TYPE(ShowHiddenLines ,(false),group,App::Prop_None,"Control the appearance of the dashed hidden lines");
 }
 
 FeatureViewPart::~FeatureViewPart()
@@ -171,7 +171,7 @@ App::DocumentObjectExecReturn *FeatureViewPart::execute(void)
 App::DocumentObjectExecReturn *FeatureViewPart::execute(void)
 {
     std::stringstream result;
-	std::string ViewName = Label.getValue();
+    std::string ViewName = Label.getValue();
 
     App::DocumentObject* link = Source.getValue();
     if (!link)
@@ -181,18 +181,18 @@ App::DocumentObjectExecReturn *FeatureViewPart::execute(void)
     TopoDS_Shape shape = static_cast<Part::Feature*>(link)->Shape.getShape()._Shape;
     if (shape.IsNull())
         return new App::DocumentObjectExecReturn("Linked shape object is empty");
-	Base::Vector3f Dir = Direction.getValue();
-	bool hidden = ShowHiddenLines.getValue();
+    Base::Vector3f Dir = Direction.getValue();
+    bool hidden = ShowHiddenLines.getValue();
 
-	ProjectionAlgos Alg(shape,Dir);
+    ProjectionAlgos Alg(shape,Dir);
 
     result  << "<g" 
             << " id=\"" << ViewName << "\"" << endl
-			<< "   transform=\"rotate("<< Rotation.getValue() << ","<< X.getValue()<<","<<Y.getValue()<<") translate("<< X.getValue()<<","<<Y.getValue()<<") scale("<< Scale.getValue()<<","<<Scale.getValue()<<")\"" << endl
+            << "   transform=\"rotate("<< Rotation.getValue() << ","<< X.getValue()<<","<<Y.getValue()<<") translate("<< X.getValue()<<","<<Y.getValue()<<") scale("<< Scale.getValue()<<","<<Scale.getValue()<<")\"" << endl
             << "  >" << endl;
-			
-	result << Alg.getSVG(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain);
- 
+
+    result << Alg.getSVG(hidden?ProjectionAlgos::WithHidden:ProjectionAlgos::Plain);
+
     result << "</g>" << endl;
 
     // Apply the resulting fragment
diff --git a/src/Mod/Drawing/App/FeatureViewPart.h b/src/Mod/Drawing/App/FeatureViewPart.h
index 8aa7592..df3a8ac 100644
--- a/src/Mod/Drawing/App/FeatureViewPart.h
+++ b/src/Mod/Drawing/App/FeatureViewPart.h
@@ -46,33 +46,31 @@ namespace Drawing
  */
 class AppDrawingExport FeatureViewPart: public FeatureView
 {
-  PROPERTY_HEADER(Part::FeatureViewPart);
+    PROPERTY_HEADER(Part::FeatureViewPart);
 
 public:
-	/// Constructor
-	FeatureViewPart(void);
-  virtual ~FeatureViewPart();
+    /// Constructor
+    FeatureViewPart(void);
+    virtual ~FeatureViewPart();
 
-  App::PropertyLink   Source;
-  App::PropertyVector Direction;
-  App::PropertyBool   ShowHiddenLines;
+    App::PropertyLink   Source;
+    App::PropertyVector Direction;
+    App::PropertyBool   ShowHiddenLines;
  
 
-  /** @name methods overide Feature */
-  //@{
-  /// recalculate the Feature
-  virtual App::DocumentObjectExecReturn *execute(void);
-  //@}
+    /** @name methods overide Feature */
+    //@{
+    /// recalculate the Feature
+    virtual App::DocumentObjectExecReturn *execute(void);
+    //@}
 
-  /// returns the type name of the ViewProvider
-  virtual const char* getViewProviderName(void) const {
-    return "DrawingGui::ViewProviderDrawingView";
-  }
+    /// returns the type name of the ViewProvider
+    virtual const char* getViewProviderName(void) const {
+        return "DrawingGui::ViewProviderDrawingView";
+    }
 };
 
-
 } //namespace Drawing
 
 
-
 #endif
diff --git a/src/Mod/Drawing/Gui/DrawingView.cpp b/src/Mod/Drawing/Gui/DrawingView.cpp
index 14287e5..bff9c79 100644
--- a/src/Mod/Drawing/Gui/DrawingView.cpp
+++ b/src/Mod/Drawing/Gui/DrawingView.cpp
@@ -244,24 +244,31 @@ void DrawingView::viewAll()
     fitDrawing();
 }
 
-void DrawingView::load (const QString & file)
+bool DrawingView::load (const QString & file)
 {
     QFileInfo fi(file);
     QString suffix = fi.suffix().toLower();
+    bool ok;
     if (suffix == QLatin1String("svg")) {
-        this->_drawingView->load(file);
+        ok = this->_drawingView->renderer()->load(file);
     } else if (suffix == QLatin1String("svgz")) {
         QByteArray contents;
         Gui::ByteArrayStream buf(contents);
         Base::igzstream gzip(file.toUtf8());
         gzip >> &buf;
         gzip.close();
-        this->_drawingView->load(contents);
+        ok = this->_drawingView->renderer()->load(contents);
     }
 
-    QSize size = this->_drawingView->renderer()->defaultSize();
-    this->aspectRatio = (float)size.width() / (float)size.height();
-    this->_drawingView->resize(size);
+    if (ok) {
+        QSize size = this->_drawingView->renderer()->defaultSize();
+        this->aspectRatio = (float)size.width() / (float)size.height();
+    }
+    else {
+        this->aspectRatio = 1.0f;
+    }
+
+    return ok;
 }
 
 // Create the action groups, actions, menus and toolbars
@@ -303,10 +310,14 @@ void DrawingView::fitDrawing()
 
 }
 
-
 // Slot function to display the Drawing at a 1:1 scale"
 void DrawingView::oneToOneDrawing()
 {
+    QSize size = this->_drawingView->renderer()->defaultSize();
+    if (size.isValid())
+        this->_drawingView->resize(size);
+    else
+        this->_drawingView->resize(this->size());
 }
 
 // Slot function to handle the color actions
@@ -344,10 +355,6 @@ void DrawingView::sliderValueAdjusted(int NewValue)
         showBrightened();
 }
 
-
-
-
-
 // Mouse press event
 void DrawingView::mousePressEvent(QMouseEvent* cEvent)
 {
diff --git a/src/Mod/Drawing/Gui/DrawingView.h b/src/Mod/Drawing/Gui/DrawingView.h
index 76e6f10..cb2707c 100644
--- a/src/Mod/Drawing/Gui/DrawingView.h
+++ b/src/Mod/Drawing/Gui/DrawingView.h
@@ -45,7 +45,7 @@ public:
     DrawingView(QWidget* parent = 0);
     virtual ~DrawingView();
 
-    void load (const QString & file);
+    bool load (const QString & file);
     const char *getName(void) const {return "DrawingView";}
     void onUpdate(void){};
 
@@ -72,11 +72,11 @@ public:
     //virtual int setColorMapBlueValue(int index, float value);
     //virtual int setColorMapAlphaValue(int index, float value);
 
-public slots:
+public Q_SLOTS:
     virtual void fitDrawing();
     virtual void oneToOneDrawing();
 
-protected slots:
+protected Q_SLOTS:
     virtual void handleColorAct( QAction* act);
     virtual void sliderValueAdjusted(int NewValue);
     virtual void drawGraphics();
diff --git a/src/Mod/Drawing/Gui/ViewProviderPage.cpp b/src/Mod/Drawing/Gui/ViewProviderPage.cpp
index b00b791..ef24e19 100644
--- a/src/Mod/Drawing/Gui/ViewProviderPage.cpp
+++ b/src/Mod/Drawing/Gui/ViewProviderPage.cpp
@@ -48,13 +48,6 @@
 #include "ViewProviderPage.h"
 #include <Mod/Drawing/App/FeaturePage.h>
 
-//#include <Mod/Drawing/App/DrawingFeature.h>
-
-
-//#include "Tree.h"
-
-
-
 using namespace DrawingGui;
 
 PROPERTY_SOURCE(DrawingGui::ViewProviderDrawingPage, Gui::ViewProviderDocumentObjectGroup)
@@ -63,66 +56,56 @@ PROPERTY_SOURCE(DrawingGui::ViewProviderDrawingPage, Gui::ViewProviderDocumentOb
 //**************************************************************************
 // Construction/Destruction
 
-       
 ViewProviderDrawingPage::ViewProviderDrawingPage()
-:view(0)
+  : view(0)
 {
-
-
-  sPixmap = "Page";
-
+    sPixmap = "Page";
 }
 
 ViewProviderDrawingPage::~ViewProviderDrawingPage()
 {
 }
 
-
 void ViewProviderDrawingPage::attach(App::DocumentObject *pcFeat)
 {
-  // call parent attach method
-  ViewProviderDocumentObject::attach(pcFeat);
-
- 
+    // call parent attach method
+    ViewProviderDocumentObject::attach(pcFeat);
 }
 
 void ViewProviderDrawingPage::setDisplayMode(const char* ModeName)
 {
- 
-  ViewProviderDocumentObject::setDisplayMode( ModeName );
+    ViewProviderDocumentObject::setDisplayMode( ModeName );
 }
 
 std::vector<std::string> ViewProviderDrawingPage::getDisplayModes(void) const
 {
-  // get the modes of the father
-  std::vector<std::string> StrList = ViewProviderDocumentObject::getDisplayModes();
+    // get the modes of the father
+    std::vector<std::string> StrList = ViewProviderDocumentObject::getDisplayModes();
 
- 
-  return StrList;
+    return StrList;
 }
 
 void ViewProviderDrawingPage::updateData(const App::Property* prop)
 {
-	Gui::ViewProviderDocumentObjectGroup::updateData(prop);
+    Gui::ViewProviderDocumentObjectGroup::updateData(prop);
     if (prop->getTypeId() == App::PropertyFileIncluded::getClassTypeId()) {
-
-		if(std::string(getPageObject()->PageResult.getValue()) != ""){
-			if(!view){
-				view = new DrawingView(Gui::getMainWindow());
-				view->load(QString::fromUtf8(getPageObject()->PageResult.getValue()));
-				view->setWindowIcon(Gui::BitmapFactory().pixmap("actions/drawing-landscape"));
-				view->setWindowTitle(QObject::tr("Drawing viewer"));
-				view->resize( 400, 300 );
-				Gui::getMainWindow()->addWindow(view);
-			}else{
-				try{
-				view->load(QString::fromUtf8(getPageObject()->PageResult.getValue()));
-				}catch(...){}// dirty hack for the moment....
-			}
-		}
-	}
-
-
+        if (std::string(getPageObject()->PageResult.getValue()) != ""){
+            if (!view){
+                view = new DrawingView(Gui::getMainWindow());
+                view->load(QString::fromUtf8(getPageObject()->PageResult.getValue()));
+                view->setWindowIcon(Gui::BitmapFactory().pixmap("actions/drawing-landscape"));
+                view->setWindowTitle(QObject::tr("Drawing viewer"));
+                view->resize(400, 300);
+                view->oneToOneDrawing();
+                Gui::getMainWindow()->addWindow(view);
+            }
+            else {
+                try{
+                    view->load(QString::fromUtf8(getPageObject()->PageResult.getValue()));
+                }catch(...){}// dirty hack for the moment....
+            }
+        }
+    }
 }
 
 bool ViewProviderDrawingPage::doubleClicked(void)
@@ -135,16 +118,10 @@ bool ViewProviderDrawingPage::doubleClicked(void)
     Gui::getMainWindow()->addWindow(view);
 
     return true;*/
-	return false;
+    return false;
 }
 
-
-
 Drawing::FeaturePage* ViewProviderDrawingPage::getPageObject(void)
 {
     return dynamic_cast<Drawing::FeaturePage*>(pcObject);
 }
-
-
-
-

-- 
FreeCAD packaging



More information about the debian-science-commits mailing list