~ubuntu-branches/ubuntu/maverick/freecad/maverick

« back to all changes in this revision

Viewing changes to src/Gui/ViewProviderDocumentObjectPyImp.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Adam C. Powell, IV
  • Date: 2010-01-11 08:48:33 UTC
  • mfrom: (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20100111084833-4g9vgdqbkw8u34zb
Tags: 0.9.2646.5-1
* New upstream version (closes: #561696).
* Added swig to Build-Depends (closes: #563523, #563772).
* Removed python-opencv from Build-Depends and Recommends (closes: #560768).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/***************************************************************************
2
 
 *   Copyright (c) 2008 Werner Mayer <wmayer@users.sourceforge.net>        *
 
2
 *   Copyright (c) 2008 Werner Mayer <wmayer[at]users.sourceforge.net>     *
3
3
 *                                                                         *
4
4
 *   This file is part of the FreeCAD CAx development system.              *
5
5
 *                                                                         *
37
37
using namespace Gui;
38
38
 
39
39
// returns a string which represents the object e.g. when printed in python
40
 
const char *ViewProviderDocumentObjectPy::representation(void) const
 
40
std::string ViewProviderDocumentObjectPy::representation(void) const
41
41
{
42
42
    std::stringstream str;
43
43
    str << "<View provider object at " << getViewProviderDocumentObjectPtr() << ">";
44
44
 
45
 
    // Note: As the return type is 'const char*' we cannot create a temporary
46
 
    // char array neither on the stack because the array would be freed when
47
 
    // leaving the scope nor on the heap because we would have a memory leak.
48
 
    // So we use a static string that is used by all instances of this class.
49
 
    // This, however, is not a problem as long as we only use this method in
50
 
    // _repr().
51
 
    static std::string buf;
52
 
    buf = str.str();
53
 
    return buf.c_str();
 
45
    return str.str();
54
46
}
55
47
 
56
48
PyObject* ViewProviderDocumentObjectPy::update(PyObject *args)