instead of converting from std::string to OUString...
... use OUString directly Change-Id: Ibdf863d7dbbb578e7fe87eac51e3d773a5b05199 Reviewed-on: https://gerrit.libreoffice.org/20009 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
committed by
Noel Grandin
parent
da11e33744
commit
970813b0a4
@@ -15,7 +15,6 @@
|
||||
#include <com/sun/star/geometry/AffineMatrix2D.hpp>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/spirit/include/classic.hpp>
|
||||
@@ -573,22 +572,20 @@ bool parsePaintUri( std::pair<const char*,const char*>& o_rPaintUri,
|
||||
|
||||
|
||||
|
||||
bool parseXlinkHref( const char* sXlinkHref, std::string& data )
|
||||
bool parseXlinkHref( const char* sXlinkHref, OUString& data )
|
||||
{
|
||||
using namespace ::boost::spirit::classic;
|
||||
OUString sLink(OUString::createFromAscii(sXlinkHref));
|
||||
|
||||
data.erase(data.begin(),data.end());
|
||||
|
||||
std::string sLink(sXlinkHref);
|
||||
|
||||
if (!sLink.compare(0,5,"data:"))
|
||||
if (sLink.startsWith("data:"))
|
||||
{
|
||||
sal_Int32 nIndex=0;
|
||||
OUString aCurrToken = sLink.getToken(0,',',nIndex);
|
||||
|
||||
// the inplace "data" uri
|
||||
size_t position = sLink.rfind(',');
|
||||
if (position > 0 && position < std::string::npos)
|
||||
if ( !aCurrToken.isEmpty() )
|
||||
{
|
||||
data = sLink.substr(position+1);
|
||||
OSL_TRACE("%s", data.c_str());
|
||||
data = sLink.copy(nIndex);
|
||||
SAL_INFO("%s", data);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -12,7 +12,7 @@
|
||||
#include <sal/config.h>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
#include <string>
|
||||
#include <rtl/ustring.hxx>
|
||||
|
||||
namespace basegfx
|
||||
{
|
||||
@@ -60,7 +60,7 @@ namespace svgi
|
||||
const char* sPaintUri );
|
||||
|
||||
/// Parse given string for the xlink attribute
|
||||
bool parseXlinkHref( const char* xlink, std::string& data );
|
||||
bool parseXlinkHref( const char* xlink, OUString& data );
|
||||
|
||||
} // namespace svgi
|
||||
|
||||
|
@@ -44,7 +44,6 @@
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <map>
|
||||
#include <string.h>
|
||||
|
||||
#define OASIS_STR "urn:oasis:names:tc:opendocument:xmlns:"
|
||||
|
||||
@@ -1539,10 +1538,10 @@ struct ShapeWritingVisitor
|
||||
|
||||
OUString sValue = xElem->hasAttribute("href") ? xElem->getAttribute("href") : "";
|
||||
OString aValueUtf8( sValue.getStr(), sValue.getLength(), RTL_TEXTENCODING_UTF8 );
|
||||
std::string sLinkValue;
|
||||
OUString sLinkValue;
|
||||
parseXlinkHref(aValueUtf8.getStr(), sLinkValue);
|
||||
|
||||
if (!sLinkValue.empty())
|
||||
if (!sLinkValue.isEmpty())
|
||||
writeBinaryData(xAttrs, xUnoAttrs, xElem, basegfx::B2DRange(x,y,x+width,y+height), sLinkValue);
|
||||
break;
|
||||
}
|
||||
@@ -1642,7 +1641,7 @@ struct ShapeWritingVisitor
|
||||
const uno::Reference<xml::sax::XAttributeList>& xUnoAttrs,
|
||||
const uno::Reference<xml::dom::XElement>& /* xElem */,
|
||||
const basegfx::B2DRange& rShapeBounds,
|
||||
const std::string& data)
|
||||
const OUString& data)
|
||||
{
|
||||
xAttrs->Clear();
|
||||
xAttrs->AddAttribute( "svg:x", OUString::number(pt2mm(rShapeBounds.getMinX()))+"mm");
|
||||
@@ -1657,7 +1656,7 @@ struct ShapeWritingVisitor
|
||||
|
||||
mxDocumentHandler->startElement("office:binary-data", xUnoAttrs);
|
||||
|
||||
mxDocumentHandler->characters(OUString::createFromAscii(data.c_str()));
|
||||
mxDocumentHandler->characters(data);
|
||||
|
||||
mxDocumentHandler->endElement("office:binary-data");
|
||||
|
||||
|
Reference in New Issue
Block a user