office-gobmx/ucb/Library_ucpfile1.mk
Stephan Bergmann 46c645bf4e Move dubious file: -> smb: conversion from INetURLObject to file UCP
The Linux-only conversion of file URLs with a non-empty (other than "localhost")
authority to smb URLs had been added in 2010 with
0b9ef81ba5 "tools-urlobj-smb-scheme-patch.diff:
migrated" (applying a Go-oo patch?) but giving no rationale beyond "process
relative SMB paths (in hyperlinks) correctly".  That makes it hard to tell
whether that patch is (still) actively useful for anything, or was just a
misguided hack from the beginning:

* Why make this Linux only?  What about other non-Windows OSs?  (On Windows,
  such URLs can be resolved as UNC pathnames.)  If the reason for Linux-only was
  that it is the only OS where LO can handle smb URLs via GIO, why not make it
  conditional on ENABLE_GIO?

* Why map to smb?  There are various remote file access protocols.  Hardcoding
  smb looks arbitrary here.

Anyway, INetURLObject is arguably at a wrong level for such a patch.  To not
drop the hack wholesale, reimplement it in the file UCP, forwarding to a
potential other UCP that can handle smb URLs any file://<host>/... URLs
(rewritten as smb URLs) that the file UCP cannot handle itself.
(file://localhost/... URLs will already have been normalized to file:///... by
INetURLObject when they reach the file UCP, and even if they were not, the
osl/file.hxx functionality underlying fileaccess::TaskManager::getUnqFromUrl
knows how to handle them, so they will not take the forward-to-smb code branch.)

(The corresponding #ifdef WIN code from 0b9ef81ba5
has already been removed with 82034b04e8
"tdf#119326 crash when adding "Windows Share" File resource".)

(I came across that 2010 patch while looking into
<https://bugs.documentfoundation.org/show_bug.cgi?id=107461> "Does not support
'file://' scheme with actual hostname".  A next step would be to make the file
UCP actually handle any file://<host>/... URLs that denote the local host.)

Change-Id: I77242705dc4c6c1e9cb3a4f32253224ac6cb13cb
Reviewed-on: https://gerrit.libreoffice.org/67372
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-05 19:55:04 +01:00

45 lines
1.2 KiB
Makefile

# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
$(eval $(call gb_Library_Library,ucpfile1))
$(eval $(call gb_Library_set_componentfile,ucpfile1,ucb/source/ucp/file/ucpfile1))
$(eval $(call gb_Library_use_external,ucpfile1,boost_headers))
$(eval $(call gb_Library_use_sdk_api,ucpfile1))
$(eval $(call gb_Library_use_libraries,ucpfile1,\
comphelper \
cppu \
cppuhelper \
sal \
tl \
ucbhelper \
))
$(eval $(call gb_Library_add_exception_objects,ucpfile1,\
ucb/source/ucp/file/bc \
ucb/source/ucp/file/filcmd \
ucb/source/ucp/file/filglob \
ucb/source/ucp/file/filid \
ucb/source/ucp/file/filinpstr \
ucb/source/ucp/file/filinsreq \
ucb/source/ucp/file/filnot \
ucb/source/ucp/file/filprp \
ucb/source/ucp/file/filrec \
ucb/source/ucp/file/filrow \
ucb/source/ucp/file/filrset \
ucb/source/ucp/file/filstr \
ucb/source/ucp/file/filtask \
ucb/source/ucp/file/prov \
))
# vim: set noet sw=4 ts=4: