Update ooo320-m1
[ooovba.git] / applied_patches / 0092-samba-hyperlinks-sc-sd.diff
blob1f9884a76f71f5156cd32375268fc2ef79ea151d
1 --- sc/source/filter/excel/xecontent.cxx 2008-05-13 15:26:02.000000000 +0200
2 +++ sc/source/filter/excel/xecontent.cxx 2008-05-13 15:59:33.000000000 +0200
3 @@ -350,12 +350,20 @@ XclExpHyperlink::XclExpHyperlink( const
6 // file link or URL
7 - if( eProtocol == INET_PROT_FILE )
8 + if( eProtocol == INET_PROT_FILE || eProtocol == INET_PROT_SMB )
10 sal_uInt16 nLevel;
11 bool bRel;
12 String aFileName( BuildFileName( nLevel, bRel, rUrl, rRoot ) );
14 + if( eProtocol == INET_PROT_SMB )
15 + {
16 + // #n382718# (and #n261623#) Convert smb notation to '\\'
17 + aFileName = aUrlObj.GetMainURL( INetURLObject::NO_DECODE );
18 + aFileName = String( aFileName.GetBuffer() + 4 ); // skip the 'smb:' part
19 + aFileName.SearchAndReplaceAll( '/', '\\' );
20 + }
22 if( !bRel )
23 mnFlags |= EXC_HLINK_ABS;
24 mnFlags |= EXC_HLINK_BODY;
25 --- sd/source/filter/ppt/pptin.cxx
26 +++ sd/source/filter/ppt/pptin.cxx
27 @@ -437,6 +437,11 @@ sal_Bool ImplSdPPTImport::Import()
28 aPropItem >> pHyperlink->nInfo;
29 if ( !aPropItem.Read( pHyperlink->aTarget, VT_EMPTY ) )
30 break;
32 + // #n382718# (and #n261623#) Convert '\\' notation to 'smb://'
33 + INetURLObject aUrl( pHyperlink->aTarget, INET_PROT_FILE );
34 + pHyperlink->aTarget = aUrl.GetMainURL( INetURLObject::NO_DECODE );
36 if ( !aPropItem.Read( pHyperlink->aSubAdress, VT_EMPTY ) )
37 break;
38 pHyperlink->nStartPos = pHyperlink->nEndPos = -1;
39 --- sd/source/filter/eppt/epptso.cxx 2008-05-13 16:07:26.000000000 +0200
40 +++ sd/source/filter/eppt/epptso.cxx 2008-05-14 10:34:01.000000000 +0200
41 @@ -3054,9 +3054,18 @@ void PPTWriter::ImplWriteTextStyleAtom(
42 String aPageUrl;
43 String aEmpty;
44 String aFile( pFieldEntry->aFieldUrl );
45 + String aTarget( pFieldEntry->aFieldUrl );
46 INetURLObject aUrl( pFieldEntry->aFieldUrl );
47 if ( INET_PROT_FILE == aUrl.GetProtocol() )
48 aFile = aUrl.PathToFileName();
49 + else if ( INET_PROT_SMB == aUrl.GetProtocol() )
50 + {
51 + // #n382718# (and #n261623#) Convert smb notation to '\\'
52 + aFile = aUrl.GetMainURL( INetURLObject::NO_DECODE );
53 + aFile = String( aFile.GetBuffer() + 4 ); // skip the 'smb:' part
54 + aFile.SearchAndReplaceAll( '/', '\\' );
55 + aTarget = aFile;
56 + }
57 else if ( pFieldEntry->aFieldUrl.GetChar( 0 ) == '#' )
59 String aPage( INetURLObject::decode( pFieldEntry->aFieldUrl, '%', INetURLObject::DECODE_WITH_CHARSET ) );
60 @@ -3077,7 +3086,7 @@ void PPTWriter::ImplWriteTextStyleAtom(
61 if ( aPageUrl.Len() )
62 nHyperId = ImplInsertBookmarkURL( aPageUrl, 1 | ( nPageIndex << 8 ) | ( 1 << 31 ), pFieldEntry->aRepresentation, aEmpty, aEmpty, aPageUrl );
63 else
64 - nHyperId = ImplInsertBookmarkURL( pFieldEntry->aFieldUrl, 2 | ( nHyperId << 8 ), aFile, pFieldEntry->aFieldUrl, aEmpty, aEmpty );
65 + nHyperId = ImplInsertBookmarkURL( pFieldEntry->aFieldUrl, 2 | ( nHyperId << 8 ), aFile, aTarget, aEmpty, aEmpty );
67 rOut << (sal_uInt32)( ( EPP_InteractiveInfo << 16 ) | 0xf ) << (sal_uInt32)24
68 << (sal_uInt32)( EPP_InteractiveInfoAtom << 16 ) << (sal_uInt32)16