[Libreoffice-commits] .: sd/source
Fridrich Strba
fridrich at kemper.freedesktop.org
Fri Nov 26 05:49:45 PST 2010
sd/source/filter/eppt/epptso.cxx | 11 ++++++++++-
sd/source/filter/ppt/pptin.cxx | 5 +++++
2 files changed, 15 insertions(+), 1 deletion(-)
New commits:
commit 7feb80dd04bd765029905ce1b846992f91e23f28
Author: Jan Holesovsky <kendy at suse.cz>
Date: Fri Nov 26 14:41:58 2010 +0100
samba-hyperlinks-sc-sd.diff: migrated
process relative SMB paths (in hyperlinks) correctly
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
old mode 100644
new mode 100755
index 91f0ae4..f324392
--- 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
old mode 100644
new mode 100755
index 038c307..043ae27
--- 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;
More information about the Libreoffice-commits
mailing list