diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-10-31 16:56:48 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-10-31 16:56:48 +0000 |
commit | 10939b48fecdefe1c838d250280ad07d4275b663 (patch) | |
tree | 8ec5d3d06cbf01cd9d93f5a6a01dc80e53b1534d /xmlscript/source/xmllib_imexp/xmllib_export.cxx | |
parent | f82ff8ca95e657c8f673730944c210e4005de382 (diff) |
experiment with c++0x and ro_data stringsfeature/rodatastrings
Diffstat (limited to 'xmlscript/source/xmllib_imexp/xmllib_export.cxx')
-rw-r--r-- | xmlscript/source/xmllib_imexp/xmllib_export.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/xmlscript/source/xmllib_imexp/xmllib_export.cxx b/xmlscript/source/xmllib_imexp/xmllib_export.cxx index 774a76f135..c0ee1b5c1c 100644 --- a/xmlscript/source/xmllib_imexp/xmllib_export.cxx +++ b/xmlscript/source/xmllib_imexp/xmllib_export.cxx @@ -39,8 +39,8 @@ using namespace rtl; namespace xmlscript { -static OUString aTrueStr ( RTL_CONSTASCII_USTRINGPARAM("true") ); -static OUString aFalseStr( RTL_CONSTASCII_USTRINGPARAM("false") ); +Stack_OUString(aTrueStr, "true"); +Stack_OUString(aFalseStr, "false"); //################################################################################################## @@ -97,13 +97,15 @@ SAL_CALL exportLibraryContainer( OUString( RTL_CONSTASCII_USTRINGPARAM("simple") ) ); } + const OUString &rLinkResult = rLib.bLink ? static_cast<const OUString &>(aTrueStr) : static_cast<const OUString &>(aFalseStr); pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":link") ), - rLib.bLink ? aTrueStr : aFalseStr ); + rLinkResult ); if( rLib.bLink ) { + const OUString &rReadOnlyResult = rLib.bReadOnly ? static_cast<const OUString &>(aTrueStr) : static_cast<const OUString &>(aFalseStr); pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":readonly") ), - rLib.bReadOnly ? aTrueStr : aFalseStr ); + rReadOnlyResult ); } pLibElement->dump( xOut.get() ); @@ -142,11 +144,13 @@ SAL_CALL exportLibrary( pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":name") ), rLib.aName ); + const OUString &rReadOnlyResult = rLib.bReadOnly ? static_cast<const OUString &>(aTrueStr) : static_cast<const OUString &>(aFalseStr); pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":readonly") ), - rLib.bReadOnly ? aTrueStr : aFalseStr ); + rReadOnlyResult ); + const OUString &rPasswordResult = rLib.bPasswordProtected ? static_cast<const OUString &>(aTrueStr) : static_cast<const OUString &>(aFalseStr); pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":passwordprotected") ), - rLib.bPasswordProtected ? aTrueStr : aFalseStr ); + rPasswordResult ); if( rLib.bPreload ) pLibElement->addAttribute( OUString( RTL_CONSTASCII_USTRINGPARAM(XMLNS_LIBRARY_PREFIX ":preload") ), aTrueStr ); |