summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@suse.cz>2010-11-26 14:41:58 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2010-11-26 14:41:58 +0100
commit6423f447db9130673089b5057fd174d321b5de5a (patch)
tree45b7be687c81dbdadc90dae0db6cba577933f107
parent26cf10ee4ff4678a62e1c1f4d1d1f23c30b4adc4 (diff)
samba-hyperlinks-sc-sd.diff: migrated
process relative SMB paths (in hyperlinks) correctly
-rwxr-xr-x[-rw-r--r--]sd/source/filter/eppt/epptso.cxx11
-rwxr-xr-x[-rw-r--r--]sd/source/filter/ppt/pptin.cxx5
2 files changed, 15 insertions, 1 deletions
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 91f0ae42d15a..f3243920e876 100644..100755
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -1229,9 +1229,18 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
String aPageUrl;
String aEmpty;
String aFile( pFieldEntry->aFieldUrl );
+ String aTarget( pFieldEntry->aFieldUrl );
INetURLObject aUrl( pFieldEntry->aFieldUrl );
if ( INET_PROT_FILE == aUrl.GetProtocol() )
aFile = aUrl.PathToFileName();
+ else if ( INET_PROT_SMB == aUrl.GetProtocol() )
+ {
+ // #n382718# (and #n261623#) Convert smb notation to '\\'
+ aFile = aUrl.GetMainURL( INetURLObject::NO_DECODE );
+ aFile = String( aFile.GetBuffer() + 4 ); // skip the 'smb:' part
+ aFile.SearchAndReplaceAll( '/', '\\' );
+ aTarget = aFile;
+ }
else if ( pFieldEntry->aFieldUrl.GetChar( 0 ) == '#' )
{
String aPage( INetURLObject::decode( pFieldEntry->aFieldUrl, '%', INetURLObject::DECODE_WITH_CHARSET ) );
@@ -1252,7 +1261,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u
if ( aPageUrl.Len() )
nHyperId = ImplInsertBookmarkURL( aPageUrl, 1 | ( nPageIndex << 8 ) | ( 1 << 31 ), pFieldEntry->aRepresentation, aEmpty, aEmpty, aPageUrl );
else
- nHyperId = ImplInsertBookmarkURL( pFieldEntry->aFieldUrl, 2 | ( nHyperId << 8 ), aFile, pFieldEntry->aFieldUrl, aEmpty, aEmpty );
+ nHyperId = ImplInsertBookmarkURL( pFieldEntry->aFieldUrl, 2 | ( nHyperId << 8 ), aFile, aTarget, aEmpty, aEmpty );
rOut << (sal_uInt32)( ( EPP_InteractiveInfo << 16 ) | 0xf ) << (sal_uInt32)24
<< (sal_uInt32)( EPP_InteractiveInfoAtom << 16 ) << (sal_uInt32)16
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index dc938d4ce1ce..97087feaa6d1 100644..100755
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -430,6 +430,11 @@ sal_Bool ImplSdPPTImport::Import()
aPropItem >> pHyperlink->nInfo;
if ( !aPropItem.Read( pHyperlink->aTarget, VT_EMPTY ) )
break;
+
+ // #n382718# (and #n261623#) Convert '\\' notation to 'smb://'
+ INetURLObject aUrl( pHyperlink->aTarget, INET_PROT_FILE );
+ pHyperlink->aTarget = aUrl.GetMainURL( INetURLObject::NO_DECODE );
+
if ( !aPropItem.Read( pHyperlink->aSubAdress, VT_EMPTY ) )
break;
pHyperlink->nStartPos = pHyperlink->nEndPos = -1;