summaryrefslogtreecommitdiff
path: root/oox/source/helper
diff options
context:
space:
mode:
authorKatarina Machalkova <kmachalkova@suse.cz>2010-10-19 17:04:12 +0200
committerKatarina Machalkova <kmachalkova@suse.cz>2010-10-19 17:04:12 +0200
commit4f54b69d72817bc642b0804458f3f03de264b7c7 (patch)
treee154966f1b3045e8cf752a6809566461ae944ae3 /oox/source/helper
parentfbcee910cdb406c3c12068b4e68de642006d3cb6 (diff)
Merged oox-smartart-import.diff from ooo-build
Diffstat (limited to 'oox/source/helper')
-rw-r--r--oox/source/helper/storagebase.cxx20
1 files changed, 14 insertions, 6 deletions
diff --git a/oox/source/helper/storagebase.cxx b/oox/source/helper/storagebase.cxx
index 3abd50f81628..6aeb49f79649 100644
--- a/oox/source/helper/storagebase.cxx
+++ b/oox/source/helper/storagebase.cxx
@@ -50,17 +50,25 @@ namespace oox {
namespace {
-void lclSplitFirstElement( OUString& orElement, OUString& orRemainder, const OUString& rFullName )
+void lclSplitFirstElement( OUString& orElement, OUString& orRemainder, OUString aFullName )
{
- sal_Int32 nSlashPos = rFullName.indexOf( '/' );
- if( (0 <= nSlashPos) && (nSlashPos < rFullName.getLength()) )
+ sal_Int32 nSlashPos = aFullName.indexOf( '/' );
+
+ // strip leading slashes
+ while( nSlashPos == 0 )
+ {
+ aFullName = aFullName.copy(1);
+ nSlashPos = aFullName.indexOf( '/' );
+ }
+
+ if( (0 <= nSlashPos) && (nSlashPos < aFullName.getLength()) )
{
- orElement = rFullName.copy( 0, nSlashPos );
- orRemainder = rFullName.copy( nSlashPos + 1 );
+ orElement = aFullName.copy( 0, nSlashPos );
+ orRemainder = aFullName.copy( nSlashPos + 1 );
}
else
{
- orElement = rFullName;
+ orElement = aFullName;
}
}