diff options
author | Oliver Bolte <obo@openoffice.org> | 2008-07-22 11:54:11 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2008-07-22 11:54:11 +0000 |
commit | 0e516a7a7e06540010d12aad99fdcef91ca197a7 (patch) | |
tree | f6ac2567a7f8c914bcff65a3ae23ab2dd899f606 /writerfilter | |
parent | 72767f6293265dcbe749b2751ce34318c5836ebd (diff) |
INTEGRATION: CWS xmlfilter06 (1.3.6); FILE MERGED
2008/05/30 12:26:32 hbrinkm 1.3.6.1: moved classes/functioins to util.cxx
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/resourcemodel/qnametostrfooter | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/writerfilter/source/resourcemodel/qnametostrfooter b/writerfilter/source/resourcemodel/qnametostrfooter index ca3d0c509bc4..d0af0f6fa30f 100644 --- a/writerfilter/source/resourcemodel/qnametostrfooter +++ b/writerfilter/source/resourcemodel/qnametostrfooter @@ -4,36 +4,6 @@ QNameToString::QNameToString() init_ooxml(); } -string xmlify(const string & str) -{ - string result = ""; - char sBuffer[16]; - - for (string::const_iterator aIt = str.begin(); aIt != str.end(); ++aIt) - { - char c = *aIt; - - if (isprint(c) && c != '\"') - { - if (c == '<') - result += "<"; - else if (c == '>') - result += ">"; - else if (c == '&') - result += "&"; - else - result += c; - } - else - { - snprintf(sBuffer, sizeof(sBuffer), "\\%03d", c); - result += sBuffer; - } - } - - return result; -} - void WRITERFILTER_DLLPUBLIC analyzerIds() { cout << "<ids type=\"sprm\">" << endl; @@ -51,65 +21,4 @@ void WRITERFILTER_DLLPUBLIC analyzerIds() cout << "</ids>" << endl; } -void XMLTag::addAttr(string sName, string sValue) -{ - XMLAttribute aAttr(sName, sValue); - - mAttrs.push_back(aAttr); -} - -void XMLTag::addTag(XMLTag::Pointer_t pTag) -{ - mTags.push_back(pTag); -} - -void XMLTag::chars(const string & rChars) -{ - mChars = rChars; -} - -string XMLTag::toString() const -{ - if (mChars.length() > 0) - return mChars; - - string sResult; - - if (mMode == START || mMode == COMPLETE) - { - sResult += "<" + mTag; - - vector<XMLAttribute>::const_iterator aIt = mAttrs.begin(); - while (aIt != mAttrs.end()) - { - sResult += " "; - sResult += aIt->mName; - sResult += "=\""; - sResult += xmlify(aIt->mValue); - sResult += "\""; - - aIt++; - } - - sResult +=">"; - - if (mTags.size() > 0) - { - vector<XMLTag::Pointer_t>::const_iterator aItTags = mTags.begin(); - while (aItTags != mTags.end()) - { - if ((*aItTags).get() != NULL) - sResult += (*aItTags)->toString(); - - aItTags++; - } - } - } - - if (mMode == END || mMode == COMPLETE) - sResult += "</" + mTag + ">"; - - return sResult; -} - } |