Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 8389 → Rev 8390

/branches/Version13x/Scribus/scribus/styles/charstyle.cpp
263,7 → 263,7
#include "charstyle.attrdefs.cxx"
#undef ATTRDEF
if (!name().isEmpty())
att["id"] = elemtag + toXMLString((unsigned long)(this));
att["id"] = mkXMLName(elemtag + name());
handler.begin(elemtag, att);
if (hasParent() && parentStyle())
parentStyle()->saxx(handler);
/branches/Version13x/Scribus/scribus/styles/linestyle.cpp
180,7 → 180,7
#include "linestyle.attrdefs.cxx"
#undef ATTRDEF
if (!name().isEmpty())
att["id"] = elemtag + (unsigned long long)(this);
att["id"] = mkXMLName(elemtag + name());
handler.begin(elemtag, att);
if (parentStyle())
parentStyle()->saxx(handler);
/branches/Version13x/Scribus/scribus/styles/paragraphstyle.cpp
219,7 → 219,7
#include "paragraphstyle.attrdefs.cxx"
#undef ATTRDEF
if (!name().isEmpty())
att["id"] = elemtag + toXMLString((unsigned long)(this));
att["id"] = mkXMLName(elemtag + name());
handler.begin(elemtag, att);
if (parentStyle() && hasParent())
parentStyle()->saxx(handler);
/branches/Version13x/Scribus/scribus/desaxe/digester.h
30,7 → 30,8
class Action;
class RuleState;
 
namespace { // ANON
 
namespace PRIVATE {
class VarPtr
{
85,7 → 86,7
};
 
 
} // namespace ANON
} // namespace PRIVATE
 
 
 
156,16 → 157,16
RuleState*
state;
std::vector<VarPtr>
std::vector<PRIVATE::VarPtr>
objects;
std::map<Xml_string, VarPtr>
std::map<Xml_string, PRIVATE::VarPtr>
storage;
 
std::map<Xml_string, Patch*>
std::map<Xml_string, PRIVATE::Patch*>
patches;
VarPtr
PRIVATE::VarPtr
result_;
std::vector<Xml_string>
183,7 → 184,7
#endif
unsigned int count = objects.size();
assert (offset < count);
chkcell<ObjType>(objects[count - offset - 1], &objects);
PRIVATE::chkcell<ObjType>(objects[count - offset - 1], &objects);
#ifdef DESAXE_DEBUG
std::cerr << "stack-> " << static_cast<ObjType*>(objects[count - offset - 1].ptr) << "\n";
#endif
201,7 → 202,7
#endif
unsigned int count = objects.size();
assert (offset < count);
chkcell<ObjType> (objects[offset]);
PRIVATE::chkcell<ObjType> (objects[offset]);
return static_cast<ObjType*>(objects[offset].ptr);
}
 
227,7 → 228,7
#ifdef DESAXE_DEBUG
std::cerr << res << " ->result\n";
#endif
result_ = mkcell(res);
result_ = PRIVATE::mkcell(res);
}
 
 
255,13 → 256,13
#ifdef DESAXE_DEBUG
std::cerr << "stack<- " << obj << "\n";
#endif
objects.push_back(mkcell(obj));
objects.push_back(PRIVATE::mkcell(obj));
}
 
 
// now lookup / store / patch business
 
namespace {
namespace PRIVATE {
template <class LinkType>
struct Patch1 : public Patch
294,6 → 295,7
};
inline
void runPatches(Patch*& list, VarPtr link)
{
while (list)
305,7 → 307,7
}
}
inline
void deletePatches(std::map<Xml_string, Patch*>& patches)
{
std::map<Xml_string, Patch*>::iterator it;
326,7 → 328,7
// template<> class Patch1<void>;
// template<> class Patch2<VarPtr,void>;
} //namespace ANON
} //namespace PRIVATE
 
 
 
334,6 → 336,8
inline
ObjType* Digester::lookup(const Xml_string idref)
{
using namespace PRIVATE;
 
std::map<Xml_string, VarPtr>::iterator cell = storage.find(idref);
if (cell == storage.end())
{
357,7 → 361,8
template<class ObjType>
inline
void Digester::store(const Xml_string idref, ObjType* obj)
{
{
using namespace PRIVATE;
#ifdef DESAXE_DEBUG
std::cerr << "store[" << idref << "] <- " << obj << "\n";
#endif
370,6 → 375,8
template<class LinkType>
void Digester::patchCall(const Xml_string idref, void (*fun)(LinkType*) )
{
using namespace PRIVATE;
std::map<Xml_string, VarPtr>::iterator cell = storage.find(idref);
if (cell == storage.end())
{
385,6 → 392,8
template<class ObjType, class LinkType>
void Digester::patchInvoke(const Xml_string idref, ObjType* obj, void (ObjType::*fun)(LinkType*) )
{
using namespace PRIVATE;
std::map<Xml_string, VarPtr>::iterator cell = storage.find(idref);
if (cell == storage.end())
{
/branches/Version13x/Scribus/scribus/desaxe/saxiohelper.cpp
10,6 → 10,44
const Xml_string SaxIO::saxxDefaultElem("");
 
 
 
Xml_string mkXMLName(QString any)
{
QString result("");
for (unsigned int i=0; i < any.length(); ++i)
{
unsigned int ch = any[i].unicode();
if (ch == ':' || ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z')
|| (0xC0 <= ch && ch <= 0xD6) || (0xD8 <= ch && ch <= 0xF6)
|| (0xF8 <= ch && ch <= 0x2FF) || (0x370 <= ch && ch <= 0x37D)
|| (0x37F <= ch && ch <= 0x1FFF) || (0x200C <= ch && ch <= 0x200D)
|| (0x2070 <= ch && ch <= 0x218F) || (0x2C00 <= ch && ch <= 0x2FEF)
|| (0x3001 <= ch && ch <= 0xD7FF) || (0xF900 <= ch && ch <= 0xFDCF)
|| (0xFDF0 <= ch && ch <= 0xFFFD) || ch > 0xFFFF
|| (i > 0 && (ch == '-' || ch == '.' || ('0' <= ch && ch <= '9') || ch == 0xB7
|| (0x300 <= ch && ch <= 0x36F) || (0x203F <= ch && ch <= 0x2040) )))
{
result += ch;
}
else
{
result += '_';
result += ('0' + ch >> 12 & 15);
result += ('0' + ch >> 8 & 15);
result += ('0' + ch >> 4 & 15);
result += ('0' + ch & 15);
}
}
return result;
}
 
/*
NameStartChar ::= ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D]
| [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
NameChar ::= NameStartChar | "-" | "." | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]
*/
 
 
// FIXME: this is too Qt dependent
Xml_string toXMLString(unsigned int val)
{
/branches/Version13x/Scribus/scribus/desaxe/uniqueid.cpp
42,4 → 42,4
{
if (level == 0)
SaxFilter::chars(text);
}
}
/branches/Version13x/Scribus/scribus/desaxe/saxiohelper.h
35,6 → 35,10
QValueList<int> parseIntList(Xml_string str);
QValueStack<int> parseIntStack(Xml_string str);
 
 
Xml_string mkXMLName(QString any);
 
 
template<class ENUM>
inline
ENUM parseEnum(Xml_string str)