diff options
-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 ); |