diff options
author | Florian Reuter <freuter@novell.com> | 2010-11-26 14:40:04 +0100 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2010-11-26 14:40:04 +0100 |
commit | 3cec70e3ea40ce552e5d0303aee528ef78d0ae67 (patch) | |
tree | 3756835f1008e9948c26cbe9d97657bf4db20c94 | |
parent | 2b37c29994f62256d5f628b023f6871777a09214 (diff) |
tools-urlobj-smb-scheme-patch.diff: migrated
process relative SMB paths (in hyperlinks) correctly
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 907a408e43..eea153d284 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -923,7 +923,7 @@ bool WW8AttributeOutput::StartURL( const String &rUrl, const String &rTarget ) SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, nFlag ); INetProtocol eProto = aURL.GetProtocol(); - if ( eProto == INET_PROT_FILE ) + if ( eProto == INET_PROT_FILE || eProto == INET_PROT_SMB ) { // version 1 (for a document) @@ -941,7 +941,7 @@ bool WW8AttributeOutput::StartURL( const String &rUrl, const String &rTarget ) // save the links to files as relative sURL = URIHelper::simpleNormalizedMakeRelative( m_rWW8Export.GetWriter().GetBaseURL(), sURL ); - if ( sURL.EqualsAscii( "/", 0, 1 ) ) + if ( eProto == INET_PROT_FILE && sURL.EqualsAscii( "/", 0, 1 ) ) sURL = aURL.PathToFileName(); // special case for the absolute windows names @@ -955,6 +955,15 @@ bool WW8AttributeOutput::StartURL( const String &rUrl, const String &rTarget ) sURL.SearchAndReplaceAll( '/', '\\' ); } + // n#261623 convert smb notation to '\\' + const char pSmb[] = "smb://"; + if ( eProto == INET_PROT_SMB && + sURL.EqualsAscii( pSmb, 0, sizeof( pSmb ) - 1 ) ) + { + sURL.Erase( 0, sizeof( pSmb ) - 3 ); + sURL.SearchAndReplaceAll( '/', '\\' ); + } + m_rWW8Export.pDataStrm->Write( MAGIC_C, sizeof(MAGIC_C) ); SwWW8Writer::WriteLong( *m_rWW8Export.pDataStrm, sURL.Len()+1 ); SwWW8Writer::WriteString8( *m_rWW8Export.pDataStrm, sURL, true, |