diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-06 09:34:45 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-06 09:34:45 +0100 |
commit | 28180c40a6ad3e500156fa660fdf7ec810049629 (patch) | |
tree | 225d0098f7647e5750e6e89e4c4a3361862f6608 /forms/source/xforms | |
parent | b6a1e3e6fa048d381cca257e52b244d5bba67f37 (diff) |
No need for an OUStringBuffer here
Change-Id: I01697ac2b84f836ff0b3d15aa8d03042f229eacb
Diffstat (limited to 'forms/source/xforms')
-rw-r--r-- | forms/source/xforms/model_ui.cxx | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/forms/source/xforms/model_ui.cxx b/forms/source/xforms/model_ui.cxx index 5b75be5d53e3..50cdf8254fb4 100644 --- a/forms/source/xforms/model_ui.cxx +++ b/forms/source/xforms/model_ui.cxx @@ -853,29 +853,20 @@ static OUString lcl_serializeForDisplay( const Reference<XXPathObject>& xResult if( ! xResult.is() ) return getResource( RID_STR_XFORMS_CANT_EVALUATE ); - // TODO: localize - OUStringBuffer aBuffer; - switch( xResult->getObjectType() ) { case XPathObjectType_XPATH_BOOLEAN: - aBuffer.append( xResult->getBoolean() - ? OUString("true") - : OUString("false") ); - break; + return xResult->getBoolean() ? OUString("true") : OUString("false"); case XPathObjectType_XPATH_STRING: - aBuffer.append("\"" + xResult->getString() + "\""); - break; + return "\"" + xResult->getString() + "\""; case XPathObjectType_XPATH_NODESET: - aBuffer.append( lcl_serializeForDisplay( xResult->getNodeList() ) ); - break; + return lcl_serializeForDisplay( xResult->getNodeList() ); case XPathObjectType_XPATH_NUMBER: - aBuffer.append( xResult->getDouble() ); - break; + return OUString::number(xResult->getDouble()); case XPathObjectType_XPATH_UNDEFINED: case XPathObjectType_XPATH_POINT: @@ -885,10 +876,8 @@ static OUString lcl_serializeForDisplay( const Reference<XXPathObject>& xResult case XPathObjectType_XPATH_XSLT_TREE: default: // TODO: localized error message? - break; + return OUString(); } - - return aBuffer.makeStringAndClear(); } OUString Model::getResultForExpression( |