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
This commit is contained in:
parent
6b015aea9c
commit
7f939557b8
1 changed files with 33 additions and 1 deletions
|
@ -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 += "<";
|
||||
else if (c == '>')
|
||||
result += ">";
|
||||
else if (c == '&')
|
||||
result += "&";
|
||||
else
|
||||
result += c;
|
||||
}
|
||||
else
|
||||
{
|
||||
snprintf(sBuffer, sizeof(sBuffer), "\\%03d", c);
|
||||
result += sBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue