Merge branch 'main' into fix-variablelink
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
# include <unordered_set>
|
||||
#endif
|
||||
|
||||
#include "DocumentObject.h"
|
||||
#include "MappedElement.h"
|
||||
|
||||
using namespace Data;
|
||||
@@ -161,4 +162,11 @@ bool ElementNameComparator::operator()(const MappedName& leftName,
|
||||
}
|
||||
}
|
||||
return leftName.size() < rightName.size();
|
||||
}
|
||||
}
|
||||
|
||||
HistoryItem::HistoryItem(App::DocumentObject *obj, const Data::MappedName &name)
|
||||
:obj(obj),tag(0),element(name)
|
||||
{
|
||||
if(obj)
|
||||
tag = obj->getID();
|
||||
}
|
||||
|
||||
@@ -99,6 +99,15 @@ struct AppExport MappedElement
|
||||
}
|
||||
};
|
||||
|
||||
struct AppExport HistoryItem {
|
||||
App::DocumentObject *obj;
|
||||
long tag;
|
||||
Data::MappedName element;
|
||||
Data::IndexedName index;
|
||||
std::vector<Data::MappedName> intermediates;
|
||||
HistoryItem(App::DocumentObject *obj, const Data::MappedName &name);
|
||||
};
|
||||
|
||||
struct AppExport ElementNameComparator {
|
||||
/** Comparison function to make topo name more stable
|
||||
*
|
||||
|
||||
@@ -143,7 +143,7 @@ private:
|
||||
metadata.uuid = propMap.at("Uid");
|
||||
}
|
||||
|
||||
void readProperty(DOMNode* propNode, std::map<std::string, std::string>& propMap)
|
||||
static void readProperty(DOMNode* propNode, std::map<std::string, std::string>& propMap)
|
||||
{
|
||||
DOMNode* nameAttr = propNode->getAttributes()->getNamedItem(XStr("name").unicodeForm());
|
||||
if (nameAttr) {
|
||||
@@ -530,7 +530,7 @@ std::string ProjectFile::extractInputFile(const std::string& name)
|
||||
return {};
|
||||
}
|
||||
|
||||
void ProjectFile::readInputFile(const std::string& name, std::stringstream& str)
|
||||
void ProjectFile::readInputFile(const std::string& name, std::ostream& str)
|
||||
{
|
||||
Base::FileInfo fi(extractInputFile(name));
|
||||
if (fi.exists()) {
|
||||
@@ -543,7 +543,7 @@ void ProjectFile::readInputFile(const std::string& name, std::stringstream& str)
|
||||
|
||||
// Read the given input file from the zip directly into the given stream (not using a temporary
|
||||
// file)
|
||||
void ProjectFile::readInputFileDirect(const std::string& name, std::stringstream& str)
|
||||
void ProjectFile::readInputFileDirect(const std::string& name, std::ostream& str)
|
||||
{
|
||||
zipios::ZipFile project(stdFile);
|
||||
std::unique_ptr<std::istream> istr(project.getInputStream(name));
|
||||
|
||||
@@ -156,11 +156,11 @@ public:
|
||||
/**
|
||||
* Extracts, via a temporary file the content of an input file of @a name.
|
||||
*/
|
||||
void readInputFile(const std::string& name, std::stringstream& str);
|
||||
void readInputFile(const std::string& name, std::ostream& str);
|
||||
/**
|
||||
* Directly extracts the content of an input file of @a name.
|
||||
*/
|
||||
void readInputFileDirect(const std::string& name, std::stringstream& str);
|
||||
void readInputFileDirect(const std::string& name, std::ostream& str);
|
||||
/**
|
||||
* Replaces the input file @a name with the content of the given @a stream.
|
||||
* The method returns the file name of the newly created project file.
|
||||
|
||||
Reference in New Issue
Block a user