summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2008-07-22 11:54:50 +0000
committerOliver Bolte <obo@openoffice.org>2008-07-22 11:54:50 +0000
commit7f939557b83cac26df8a7e8b6d323f96e729a880 (patch)
treec655828dc272eb07c3278f4f3d179908fe09c0a0 /writerfilter
parent6b015aea9c0ce4c345c7118906f0a29c25553678 (diff)
INTEGRATION: CWS xmlfilter06 (1.3.6); FILE MERGED
2008/06/29 13:05:44 dr 1.3.6.4: RESYNC: (1.3-1.4); FILE MERGED 2008/06/12 15:04:43 hbrinkm 1.3.6.3: moved PropertySetToTagHandler 2008/05/30 12:26:58 hbrinkm 1.3.6.2: moved classes/functioins to util.cxx 2008/05/27 11:36:11 dr 1.3.6.1: joined changes from CWS xmlfilter05
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/resourcemodel/util.cxx34
1 files changed, 33 insertions, 1 deletions
diff --git a/writerfilter/source/resourcemodel/util.cxx b/writerfilter/source/resourcemodel/util.cxx
index fe6811170aba..00c25be41c42 100644
--- a/writerfilter/source/resourcemodel/util.cxx
+++ b/writerfilter/source/resourcemodel/util.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: util.cxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
* This file is part of OpenOffice.org.
*
@@ -39,12 +39,14 @@
#include <com/sun/star/drawing/HomogenMatrix3.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <resourcemodel/WW8ResourceModel.hxx>
+#include <resourcemodel/TagLogger.hxx>
namespace writerfilter
{
using namespace com::sun::star;
using namespace std;
using text::TextContentAnchorType;
+
static string & logger_file()
{
static string _logger_file = string(getenv("TEMP")?getenv("TEMP"):"/tmp") + "/writerfilter.ooxml.tmp";
@@ -368,4 +370,34 @@ string propertysetToString(uno::Reference<beans::XPropertySet> const & xPropSet)
return sResult;
}
+ 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 += "&lt;";
+ else if (c == '>')
+ result += "&gt;";
+ else if (c == '&')
+ result += "&amp;";
+ else
+ result += c;
+ }
+ else
+ {
+ snprintf(sBuffer, sizeof(sBuffer), "\\%03d", c);
+ result += sBuffer;
+ }
+ }
+
+ return result;
+ }
+
}