summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/source/gallery2/galmisc.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index b1214d5f96e4..fca950f8660f 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -199,10 +199,22 @@ OUString GetReducedString( const INetURLObject& rURL, sal_Int32 nMaxLen )
if( aPath.getLength() > nMaxLen )
{
- aReduced = aPath.copy( 0, nMaxLen - aName.getLength() - 4 );
- aReduced += "...";
- aReduced += OUString(aDelimiter);
- aReduced += aName;
+ sal_Int32 nPathPrefixLen = nMaxLen - aName.getLength() - 4;
+
+ if (nPathPrefixLen >= 0)
+ {
+ aReduced = aPath.copy(0, nPathPrefixLen);
+ aReduced += "...";
+ aReduced += OUString(aDelimiter);
+ aReduced += aName;
+ }
+ else
+ {
+ aReduced += "...";
+ aReduced += OUString(aDelimiter);
+ aReduced += "...";
+ aReduced += aName.copy( aName.getLength() - (nMaxLen - 7) );
+ }
}
else
aReduced = aPath;