summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorAndreas Bille <abi@openoffice.org>2001-07-17 07:19:42 +0000
committerAndreas Bille <abi@openoffice.org>2001-07-17 07:19:42 +0000
commitfb177ea23a68799c9b131b6e50ab6eb5f7deed51 (patch)
treebbe4170d8e5ad902eddadaee5156ebecde707874 /xmlhelp
parent6db29c63406c676afff04f8916265bd5f2b552fa (diff)
Optimization: using rtl::StringBuffer to concatenate more than two strings.
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/treeview/tvread.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index 060d7d37e435..0d56b10c426a 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -1,4 +1,7 @@
#include <string.h>
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
#ifndef _VOS_DIAGNOSE_HXX_
#include <vos/diagnose.hxx>
#endif
@@ -109,13 +112,22 @@ namespace treeview {
if( ! targetURL.getLength() )
{
const TVDom* p = this;
- while( ! p->application.getLength() )
+ sal_Int32 len;
+ while( ! ( len = p->application.getLength() ) )
p = p->parent;
- targetURL = ( rtl::OUString::createFromAscii( "vnd.sun.star.help://" ) +
- p->application +
- rtl::OUString::createFromAscii( "/" ) +
- id );
+ rtl::OUStringBuffer strBuff( 22 + len + id.getLength() );
+ strBuff.appendAscii(
+ "vnd.sun.star.help://"
+ ).append(
+ p->application
+ ).appendAscii(
+ "/"
+ ).append(
+ id
+ );
+
+ targetURL = strBuff.makeStringAndClear();
}
return targetURL;