Kaydet (Commit) efd83d43 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Andras Timar

tdf#119326 crash when adding "Windows Share" File resource

this was a regression from

    commit ce43d0ae
    use consistent #define checks for the Windows platform

where I converted
    #ifdef WIN
to
    #ifdef _WIN32

But that was already dead code at that point since we did not define
that preprocessor constant anywhere.

Change-Id: Ieadafd61fada05fc19d04d83992fba7c42969daa
Reviewed-on: https://gerrit.libreoffice.org/59402Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
(cherry picked from commit 82034b04)
Reviewed-on: https://gerrit.libreoffice.org/59415
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
(cherry picked from commit 49e522f3)
üst 0d618f2a
...@@ -53,11 +53,6 @@ namespace tools_urlobj ...@@ -53,11 +53,6 @@ namespace tools_urlobj
CPPUNIT_ASSERT_EQUAL(OUString("smb://10.10.1.1/sampledir/sample.file"), CPPUNIT_ASSERT_EQUAL(OUString("smb://10.10.1.1/sampledir/sample.file"),
aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE)); aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE));
CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol()); CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol());
#endif
#ifdef _WIN32
CPPUNIT_ASSERT_EQUAL( OUString("file://10.10.1.1/sampledir/sample.file"),
aUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
CPPUNIT_ASSERT_EQUAL( INetProtocol::File, aUrl.GetProtocol( ) );
#endif #endif
CPPUNIT_ASSERT_EQUAL(OUString("10.10.1.1"), CPPUNIT_ASSERT_EQUAL(OUString("10.10.1.1"),
aUrl.GetHost(INetURLObject::DecodeMechanism::NONE)); aUrl.GetHost(INetURLObject::DecodeMechanism::NONE));
...@@ -79,11 +74,6 @@ namespace tools_urlobj ...@@ -79,11 +74,6 @@ namespace tools_urlobj
CPPUNIT_ASSERT_EQUAL(OUString("smb://137.65.170.24/c$/Img0001.jpg"), CPPUNIT_ASSERT_EQUAL(OUString("smb://137.65.170.24/c$/Img0001.jpg"),
aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE)); aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE));
CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol()); CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol());
#endif
#ifdef _WIN32
CPPUNIT_ASSERT_EQUAL( OUString("file://137.65.170.24/c$/Img0001.jpg"),
aUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
CPPUNIT_ASSERT_EQUAL( INetProtocol::File, aUrl.GetProtocol( ) );
#endif #endif
CPPUNIT_ASSERT_EQUAL(OUString("137.65.170.24"), CPPUNIT_ASSERT_EQUAL(OUString("137.65.170.24"),
aUrl.GetHost(INetURLObject::DecodeMechanism::NONE)); aUrl.GetHost(INetURLObject::DecodeMechanism::NONE));
...@@ -105,11 +95,6 @@ namespace tools_urlobj ...@@ -105,11 +95,6 @@ namespace tools_urlobj
CPPUNIT_ASSERT_EQUAL(OUString("smb://hive-winxp-x86/pmladek/test2.odt"), CPPUNIT_ASSERT_EQUAL(OUString("smb://hive-winxp-x86/pmladek/test2.odt"),
aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE)); aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE));
CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol()); CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol());
#endif
#ifdef _WIN32
CPPUNIT_ASSERT_EQUAL( OUString("file://hive-winxp-x86/pmladek/test2.odt"),
aUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
CPPUNIT_ASSERT_EQUAL( INetProtocol::File, aUrl.GetProtocol( ) );
#endif #endif
CPPUNIT_ASSERT_EQUAL(OUString("hive-winxp-x86"), CPPUNIT_ASSERT_EQUAL(OUString("hive-winxp-x86"),
aUrl.GetHost(INetURLObject::DecodeMechanism::NONE)); aUrl.GetHost(INetURLObject::DecodeMechanism::NONE));
...@@ -124,11 +109,6 @@ namespace tools_urlobj ...@@ -124,11 +109,6 @@ namespace tools_urlobj
CPPUNIT_ASSERT_EQUAL(OUString("smb://10.10.1.1/sampledir/sample.file"), CPPUNIT_ASSERT_EQUAL(OUString("smb://10.10.1.1/sampledir/sample.file"),
aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE)); aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE));
CPPUNIT_ASSERT_EQUAL( INetProtocol::Smb, aUrl.GetProtocol( ) ); CPPUNIT_ASSERT_EQUAL( INetProtocol::Smb, aUrl.GetProtocol( ) );
#endif
#ifdef _WIN32
CPPUNIT_ASSERT_EQUAL( OUString("file://10.10.1.1/sampledir/sample.file"),
aUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
CPPUNIT_ASSERT_EQUAL( INetProtocol::File, aUrl.GetProtocol( ) );
#endif #endif
CPPUNIT_ASSERT_EQUAL(OUString("10.10.1.1"), CPPUNIT_ASSERT_EQUAL(OUString("10.10.1.1"),
aUrl.GetHost(INetURLObject::DecodeMechanism::NONE)); aUrl.GetHost(INetURLObject::DecodeMechanism::NONE));
...@@ -148,11 +128,6 @@ namespace tools_urlobj ...@@ -148,11 +128,6 @@ namespace tools_urlobj
CPPUNIT_ASSERT_EQUAL(OUString("smb://137.65.170.24/c$/Img0001.jpg"), CPPUNIT_ASSERT_EQUAL(OUString("smb://137.65.170.24/c$/Img0001.jpg"),
aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE)); aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE));
CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol()); CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol());
#endif
#ifdef _WIN32
CPPUNIT_ASSERT_EQUAL( OUString("file://137.65.170.24/c$/Img0001.jpg"),
aUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
CPPUNIT_ASSERT_EQUAL( INetProtocol::File, aUrl.GetProtocol( ) );
#endif #endif
CPPUNIT_ASSERT_EQUAL(OUString("137.65.170.24"), CPPUNIT_ASSERT_EQUAL(OUString("137.65.170.24"),
aUrl.GetHost(INetURLObject::DecodeMechanism::NONE)); aUrl.GetHost(INetURLObject::DecodeMechanism::NONE));
...@@ -173,11 +148,6 @@ namespace tools_urlobj ...@@ -173,11 +148,6 @@ namespace tools_urlobj
CPPUNIT_ASSERT_EQUAL(OUString("smb://hive-winxp-x86/pmladek/test2.odt"), CPPUNIT_ASSERT_EQUAL(OUString("smb://hive-winxp-x86/pmladek/test2.odt"),
aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE)); aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE));
CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol()); CPPUNIT_ASSERT_EQUAL(INetProtocol::Smb, aUrl.GetProtocol());
#endif
#ifdef _WIN32
CPPUNIT_ASSERT_EQUAL( OUString("file://hive-winxp-x86/pmladek/test2.odt"),
aUrl.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
CPPUNIT_ASSERT_EQUAL( INetProtocol::File, aUrl.GetProtocol( ) );
#endif #endif
CPPUNIT_ASSERT_EQUAL(OUString("hive-winxp-x86"), CPPUNIT_ASSERT_EQUAL(OUString("hive-winxp-x86"),
aUrl.GetHost(INetURLObject::DecodeMechanism::NONE)); aUrl.GetHost(INetURLObject::DecodeMechanism::NONE));
......
...@@ -1454,15 +1454,6 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef, ...@@ -1454,15 +1454,6 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef,
} }
#endif #endif
#ifdef _WIN32
if (m_eScheme==INetProtocol::Smb) {
// Change "smb://server/path" URIs to "file://server/path"
// URIs on Windows, since Windows doesn't understand the
// SMB scheme.
changeScheme(INetProtocol::File);
}
#endif
return true; return true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment