summaryrefslogtreecommitdiff
path: root/sd/source/filter
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
commit7feb80dd04bd765029905ce1b846992f91e23f28 (patch)
treed75942f9ce53ce95135a74c29f77fc8b9e455c01 /sd/source/filter
parentacdbff57f1082423629ea7370442bfc473167f13 (diff)
samba-hyperlinks-sc-sd.diff: migrated
process relative SMB paths (in hyperlinks) correctly
Diffstat (limited to 'sd/source/filter')
-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 91f0ae42d..f3243920e 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 038c307a1..043ae2716 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;