1 --- tools/inc/tools/urlobj.hxx 2006-07-20 18:09:51.000000000 +0200
2 +++ tools/inc/tools/urlobj.hxx 2007-06-14 11:36:58.000000000 +0200
3 @@ -1557,6 +1557,9 @@ private:
5 TOOLS_DLLPRIVATE static bool scanIPv6reference(
6 sal_Unicode const *& rBegin, sal_Unicode const * pEnd);
9 + void changeScheme(INetProtocol eTargetScheme);
13 --- tools/source/fsys/urlobj.cxx.old 2006-09-17 02:54:24.000000000 +0200
14 +++ tools/source/fsys/urlobj.cxx 2007-06-14 11:36:58.000000000 +0200
15 @@ -1460,10 +1460,48 @@ bool INetURLObject::setAbsURIRef(rtl::OU
17 m_aAbsURIRef = aSynAbsURIRef;
19 + // At this point references of type "\\server\paths" have
20 + // been converted to file:://server/path".
22 + if (m_eScheme==INET_PROT_FILE && !m_aHost.isEmpty()) {
23 + // Change "file:://server/path" URIs to "smb:://server/path" on
25 + // Leave "file::path" URIs unchanged.
26 + changeScheme(INET_PROT_SMB);
31 + if (m_eScheme==INET_PROT_SMB) {
32 + // Change "smb://server/path" URIs to "file://server/path"
33 + // URIs on Windows, since Windows doesn't understand the
35 + changeScheme(INET_PROT_FILE);
42 //============================================================================
43 +void INetURLObject::changeScheme(INetProtocol eTargetScheme) {
44 + ::rtl::OUString aTmpStr=m_aAbsURIRef.makeStringAndClear();
45 + int oldSchemeLen=strlen(getSchemeInfo().m_pScheme);
46 + m_eScheme=eTargetScheme;
47 + int newSchemeLen=strlen(getSchemeInfo().m_pScheme);
48 + m_aAbsURIRef.appendAscii(getSchemeInfo().m_pScheme);
49 + m_aAbsURIRef.append(aTmpStr.getStr()+oldSchemeLen);
50 + int delta=newSchemeLen-oldSchemeLen;
60 +//============================================================================
61 bool INetURLObject::convertRelToAbs(rtl::OUString const & rTheRelURIRef,
63 INetURLObject & rTheAbsURIRef,
64 --- sw/source/filter/ww8/wrtw8nds.cxx 26 Jun 2007 10:44:02 -0000 1.100
65 +++ sw/source/filter/ww8/wrtw8nds.cxx 8 Oct 2007 10:18:08 -0000
67 SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, nFlag );
69 INetProtocol eProto = aURL.GetProtocol();
70 - if ( eProto == INET_PROT_FILE )
71 + if ( eProto == INET_PROT_FILE || eProto == INET_PROT_SMB )
73 // version 1 (for a document)
77 // save the links to files as relative
78 sURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), sURL );
79 - if ( sURL.EqualsAscii( "/", 0, 1 ) )
80 + if ( eProto == INET_PROT_FILE && sURL.EqualsAscii( "/", 0, 1 ) )
81 sURL = aURL.PathToFileName();
83 // special case for the absolute windows names
85 sURL.SearchAndReplaceAll( '/', '\\' );
88 + // n#261623 convert smb notation to '\\'
89 + const char pSmb[] = "smb://";
90 + if ( eProto == INET_PROT_SMB &&
91 + sURL.EqualsAscii( pSmb, 0, sizeof( pSmb ) - 1 ) )
93 + sURL.Erase( 0, sizeof( pSmb ) - 3 );
94 + sURL.SearchAndReplaceAll( '/', '\\' );
97 m_rWW8Export.pDataStrm->Write( MAGIC_C, sizeof(MAGIC_C) );
98 SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, sURL.Len()+1 );
99 SwWW8Writer::WriteString8( *m_rWW8Export.pDataStrm, sURL, true,