[Libreoffice-commits] core.git: 6 commits - include/ucbhelper package/inc package/source svl/source ucbhelper/Library_ucbhelper.mk ucbhelper/source unotools/inc unotools/source vcl/unx

Stephan Bergmann sbergman at redhat.com
Tue Aug 18 06:32:38 PDT 2015


 include/ucbhelper/fileidentifierconverter.hxx       |   97 --------------------
 package/inc/pch/precompiled_package2.hxx            |    1 
 package/source/zippackage/ZipPackage.cxx            |   15 ---
 svl/source/fsstor/fsfactory.cxx                     |    1 
 svl/source/fsstor/fsstorage.cxx                     |   17 ---
 ucbhelper/Library_ucbhelper.mk                      |    1 
 ucbhelper/source/client/fileidentifierconverter.cxx |   77 ---------------
 unotools/inc/pch/precompiled_utl.hxx                |    1 
 unotools/source/ucbhelper/localfilehelper.cxx       |   76 ++++-----------
 unotools/source/ucbhelper/tempfile.cxx              |   12 --
 vcl/unx/kde/fpicker/kdefilepicker.cxx               |    2 
 11 files changed, 28 insertions(+), 272 deletions(-)

New commits:
commit c4fe12406040b3395d3964406073027bd4006243
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Aug 18 15:31:59 2015 +0200

    Remove mention of long-gone vnd.sun.star.wfs
    
    Change-Id: I534da08398504697aa4ecff7838c6bd702dc8ea0

diff --git a/vcl/unx/kde/fpicker/kdefilepicker.cxx b/vcl/unx/kde/fpicker/kdefilepicker.cxx
index 757433a..a5c8092 100644
--- a/vcl/unx/kde/fpicker/kdefilepicker.cxx
+++ b/vcl/unx/kde/fpicker/kdefilepicker.cxx
@@ -97,7 +97,7 @@ bool isSupportedProtocol( const QString &rProtocol )
     const char * pOOoProtocols[] = { "", "smb", "ftp", "http", "file", "mailto",
         "vnd.sun.star.webdav", "news", "private", "vnd.sun.star.help",
         "https", "slot", "macro", "javascript", "imap", "pop3", "data",
-        "cid", "out", "vnd.sun.star.wfs", "vnd.sun.star.hier", "vim",
+        "cid", "out", "vnd.sun.star.hier", "vim",
         ".uno", ".component", "vnd.sun.star.pkg", "ldap", "db",
         "vnd.sun.star.cmd", "vnd.sun.star.script",
         "telnet",
commit 3d1e29c55b4322f6113842123e5c0ee43df03a16
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Aug 18 15:29:50 2015 +0200

    Remove newly unused ucbhelper/fileidentifierconverter.hxx
    
    Change-Id: I7c272383ecb115e19699ed96bf5622d979403a01

diff --git a/include/ucbhelper/fileidentifierconverter.hxx b/include/ucbhelper/fileidentifierconverter.hxx
deleted file mode 100644
index 27e7c8e..0000000
--- a/include/ucbhelper/fileidentifierconverter.hxx
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#ifndef INCLUDED_UCBHELPER_FILEIDENTIFIERCONVERTER_HXX
-#define INCLUDED_UCBHELPER_FILEIDENTIFIERCONVERTER_HXX
-
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/RuntimeException.hpp>
-#include <sal/types.h>
-#include <ucbhelper/ucbhelperdllapi.h>
-
-namespace com { namespace sun { namespace star { namespace ucb {
-    class XUniversalContentBroker;
-} } } }
-
-namespace ucbhelper {
-
-/** Using a specific content provider manager, convert a file path in system
-    dependent notation to a (file) URL.
-
-    @param rManager
-    A content provider manager.  Must not be null.
-
-    @param rBaseURL
-    See the corresponding parameter of
-    com::sun::star::ucb::XFileIdentifierConverter::getFileURLFromSystemPath().
-
-    @param rURL
-    See the corresponding parameter of
-    com::sun::star::ucb::XFileIdentifierConverter::getFileURLFromSystemPath().
-
-    @returns
-    a URL, if the content provider registered at the content provider manager
-    that is responsible for the base URL returns a URL when calling
-    com::sun::star::ucb::XFileIdentiferConverter::getFileURLFromSystemPath()
-    on it.  Otherwise, an empty string is returned.
-
-    @see
-    com::sun::star::ucb::XFileIdentiferConverter::getFileURLFromSystemPath().
- */
-UCBHELPER_DLLPUBLIC OUString
-getFileURLFromSystemPath(
-    com::sun::star::uno::Reference<
-            com::sun::star::ucb::XUniversalContentBroker > const &
-        rUcb,
-    OUString const & rBaseURL,
-    OUString const & rSystemPath);
-
-
-/** Using a specific content provider manager, convert a (file) URL to a
-    file path in system dependent notation.
-
-    @param rManager
-    A content provider manager.  Must not be null.
-
-    @param rURL
-    See the corresponding parameter of
-    com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL().
-
-    @returns
-    a system path, if the content provider registered at the content provider
-    manager that is responsible for the base URL returns a system path when
-    calling
-    com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL()
-    on it.  Otherwise, an empty string is returned.
-
-    @see
-    com::sun::star::ucb::XFileIdentiferConverter::getSystemPathFromFileURL().
- */
-UCBHELPER_DLLPUBLIC OUString
-getSystemPathFromFileURL(
-    com::sun::star::uno::Reference<
-            com::sun::star::ucb::XUniversalContentBroker > const &
-        rUcb,
-    OUString const & rURL);
-
-}
-
-#endif // INCLUDED_UCBHELPER_FILEIDENTIFIERCONVERTER_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/package/inc/pch/precompiled_package2.hxx b/package/inc/pch/precompiled_package2.hxx
index 8c5fff9..4d7b85a 100644
--- a/package/inc/pch/precompiled_package2.hxx
+++ b/package/inc/pch/precompiled_package2.hxx
@@ -94,7 +94,6 @@
 #include <sax/tools/converter.hxx>
 #include <string.h>
 #include <ucbhelper/content.hxx>
-#include <ucbhelper/fileidentifierconverter.hxx>
 #include <vector>
 #include <zlib.h>
 
diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx
index 5fa5339..c9ad983 100644
--- a/svl/source/fsstor/fsfactory.cxx
+++ b/svl/source/fsstor/fsfactory.cxx
@@ -26,7 +26,6 @@
 #include <comphelper/processfactory.hxx>
 #include <cppuhelper/supportsservice.hxx>
 
-#include <ucbhelper/fileidentifierconverter.hxx>
 #include <ucbhelper/content.hxx>
 
 #include <unotools/tempfile.hxx>
diff --git a/ucbhelper/Library_ucbhelper.mk b/ucbhelper/Library_ucbhelper.mk
index 6787db1..6c33850 100644
--- a/ucbhelper/Library_ucbhelper.mk
+++ b/ucbhelper/Library_ucbhelper.mk
@@ -30,7 +30,6 @@ $(eval $(call gb_Library_add_exception_objects,ucbhelper,\
     ucbhelper/source/client/activedatastreamer \
     ucbhelper/source/client/commandenvironment \
     ucbhelper/source/client/content \
-    ucbhelper/source/client/fileidentifierconverter \
     ucbhelper/source/client/interceptedinteraction \
     ucbhelper/source/client/proxydecider \
 	ucbhelper/source/provider/authenticationfallback \
diff --git a/ucbhelper/source/client/fileidentifierconverter.cxx b/ucbhelper/source/client/fileidentifierconverter.cxx
deleted file mode 100644
index 4916975..0000000
--- a/ucbhelper/source/client/fileidentifierconverter.cxx
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <ucbhelper/fileidentifierconverter.hxx>
-#include <com/sun/star/ucb/ContentProviderInfo.hpp>
-#include <com/sun/star/ucb/XFileIdentifierConverter.hpp>
-#include <com/sun/star/ucb/XUniversalContentBroker.hpp>
-#include <com/sun/star/uno/Reference.hxx>
-#include <com/sun/star/uno/Sequence.hxx>
-#include <osl/diagnose.h>
-#include <rtl/ustring.hxx>
-#include <sal/types.h>
-
-using namespace com::sun::star;
-
-namespace ucbhelper {
-
-//  getFileURLFromSystemPath
-
-
-
-OUString
-getFileURLFromSystemPath(
-    uno::Reference< ucb::XUniversalContentBroker > const & rUcb,
-    OUString const & rBaseURL,
-    OUString const & rSystemPath)
-{
-    OSL_ASSERT(rUcb.is());
-
-    uno::Reference< ucb::XFileIdentifierConverter >
-        xConverter(rUcb->queryContentProvider(rBaseURL), uno::UNO_QUERY);
-    if (xConverter.is())
-        return xConverter->getFileURLFromSystemPath(rBaseURL, rSystemPath);
-    else
-        return OUString();
-}
-
-
-
-//  getSystemPathFromFileURL
-
-
-
-OUString
-getSystemPathFromFileURL(
-    uno::Reference< ucb::XUniversalContentBroker > const & rUcb,
-    OUString const & rURL)
-{
-    OSL_ASSERT(rUcb.is());
-
-    uno::Reference< ucb::XFileIdentifierConverter >
-        xConverter(rUcb->queryContentProvider(rURL), uno::UNO_QUERY);
-    if (xConverter.is())
-        return xConverter->getSystemPathFromFileURL(rURL);
-    else
-        return OUString();
-}
-
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotools/inc/pch/precompiled_utl.hxx b/unotools/inc/pch/precompiled_utl.hxx
index 14761a5..dd498fc 100644
--- a/unotools/inc/pch/precompiled_utl.hxx
+++ b/unotools/inc/pch/precompiled_utl.hxx
@@ -189,7 +189,6 @@
 #include <ucbhelper/activedatasink.hxx>
 #include <ucbhelper/commandenvironment.hxx>
 #include <ucbhelper/content.hxx>
-#include <ucbhelper/fileidentifierconverter.hxx>
 #include <ucbhelper/interactionrequest.hxx>
 #include <ucbhelper/interceptedinteraction.hxx>
 #include <uno/data.h>
commit 7f8a4db4e387cbbde7cbcd9bd4d341817c0669cc
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Aug 18 15:24:24 2015 +0200

    Simplify from ucbhelper::getSystemPathFromFileURL & v. v. to osl::FileBase
    
    (vnd.sun.star.wfs is long gone); pending further clean up
    
    Change-Id: Ie532c1d945c20a31f7758fbc0438e6b1f5d5c843

diff --git a/unotools/source/ucbhelper/localfilehelper.cxx b/unotools/source/ucbhelper/localfilehelper.cxx
index d5ff1e4..3efc99b 100644
--- a/unotools/source/ucbhelper/localfilehelper.cxx
+++ b/unotools/source/ucbhelper/localfilehelper.cxx
@@ -20,11 +20,9 @@
 #include <com/sun/star/sdbc/XResultSet.hpp>
 #include <com/sun/star/ucb/XContentAccess.hpp>
 #include <com/sun/star/ucb/CommandAbortedException.hpp>
-#include <com/sun/star/ucb/UniversalContentBroker.hpp>
 #include <comphelper/processfactory.hxx>
 #include <sal/log.hxx>
 #include <unotools/localfilehelper.hxx>
-#include <ucbhelper/fileidentifierconverter.hxx>
 #include <rtl/ustring.hxx>
 #include <osl/file.hxx>
 #include <tools/urlobj.hxx>
@@ -38,76 +36,44 @@ using namespace ::com::sun::star::ucb;
 namespace utl
 {
 
-bool LocalFileHelper::ConvertSystemPathToURL( const OUString& rName, const OUString& rBaseURL, OUString& rReturn )
+bool LocalFileHelper::ConvertSystemPathToURL( const OUString& rName, const OUString&, OUString& rReturn )
 {
-    rReturn.clear();
-
-    Reference< XUniversalContentBroker > pBroker(
-        UniversalContentBroker::create(
-            comphelper::getProcessComponentContext() ) );
-    try
-    {
-        rReturn = ::ucbhelper::getFileURLFromSystemPath( pBroker, rBaseURL, rName );
+    bool ok = osl::FileBase::getFileURLFromSystemPath(rName, rReturn)
+        == osl::FileBase::E_None;
+    if (!ok) {
+        rReturn.clear();
     }
-    catch ( ::com::sun::star::uno::RuntimeException& )
-    {
-        return false;
-    }
-
-    return !rReturn.isEmpty();
+    return ok;
 }
 
 bool LocalFileHelper::ConvertURLToSystemPath( const OUString& rName, OUString& rReturn )
 {
-    rReturn.clear();
-    Reference< XUniversalContentBroker > pBroker(
-        UniversalContentBroker::create(
-            comphelper::getProcessComponentContext() ) );
-    try
-    {
-        rReturn = ::ucbhelper::getSystemPathFromFileURL( pBroker, rName );
+    bool ok = osl::FileBase::getSystemPathFromFileURL(rName, rReturn)
+        == osl::FileBase::E_None;
+    if (!ok) {
+        rReturn.clear();
     }
-    catch ( ::com::sun::star::uno::RuntimeException& )
-    {
-    }
-
-    return !rReturn.isEmpty();
+    return ok;
 }
 
 bool LocalFileHelper::ConvertPhysicalNameToURL(const OUString& rName, OUString& rReturn)
 {
-    rReturn.clear();
-    Reference< XUniversalContentBroker > pBroker(
-        UniversalContentBroker::create(
-            comphelper::getProcessComponentContext() ) );
-    try
-    {
-        rReturn = ::ucbhelper::getFileURLFromSystemPath( pBroker, "file:///", rName );
+    bool ok = osl::FileBase::getFileURLFromSystemPath(rName, rReturn)
+        == osl::FileBase::E_None;
+    if (!ok) {
+        rReturn.clear();
     }
-    catch (const ::com::sun::star::uno::RuntimeException&)
-    {
-    }
-
-    return !rReturn.isEmpty();
+    return ok;
 }
 
 bool LocalFileHelper::ConvertURLToPhysicalName(const OUString& rName, OUString& rReturn)
 {
-    rReturn.clear();
-    Reference< XUniversalContentBroker > pBroker(
-        UniversalContentBroker::create(
-            comphelper::getProcessComponentContext() ) );
-    try
-    {
-        INetURLObject aObj( rName );
-        if ( aObj.GetProtocol() == INetProtocol::File )
-            rReturn = ::ucbhelper::getSystemPathFromFileURL( pBroker, rName );
+    bool ok = osl::FileBase::getSystemPathFromFileURL(rName, rReturn)
+        == osl::FileBase::E_None;
+    if (!ok) {
+        rReturn.clear();
     }
-    catch (const ::com::sun::star::uno::RuntimeException&)
-    {
-    }
-
-    return !rReturn.isEmpty();
+    return ok;
 }
 
 bool LocalFileHelper::IsLocalFile(const OUString& rName)
commit 1ce99678e5647076da3c152f0b7350e5ddd410e4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Aug 18 15:23:03 2015 +0200

    Simplify from ucbhelper::getSystemPathFromFileURL to osl::FileBase
    
    (vnd.sun.star.wfs is long gone)
    
    Change-Id: Ica7d972c04cc065ffbd5debf72e1ec3eeb5c6c64

diff --git a/unotools/source/ucbhelper/tempfile.cxx b/unotools/source/ucbhelper/tempfile.cxx
index 4f6628d..83c3b85 100644
--- a/unotools/source/ucbhelper/tempfile.cxx
+++ b/unotools/source/ucbhelper/tempfile.cxx
@@ -26,7 +26,6 @@
 #include <unotools/tempfile.hxx>
 #include <unotools/localfilehelper.hxx>
 #include <unotools/ucbstreamhelper.hxx>
-#include <ucbhelper/fileidentifierconverter.hxx>
 #include <rtl/ustring.hxx>
 #include <rtl/instance.hxx>
 #include <osl/detail/file.h>
@@ -120,15 +119,12 @@ OUString ConstructTempDir_Impl( const OUString* pParent )
                 com::sun::star::ucb::UniversalContentBroker::create(
                     comphelper::getProcessComponentContext() ) );
 
-        // if parent given try to use it
-        OUString aTmp( *pParent );
-
         // test for valid filename
         OUString aRet;
-        ::osl::FileBase::getFileURLFromSystemPath(
-            ::ucbhelper::getSystemPathFromFileURL( pBroker, aTmp ),
-            aRet );
-        if ( !aRet.isEmpty() )
+        if ((osl::FileBase::getSystemPathFromFileURL(*pParent, aRet)
+             == osl::FileBase::E_None)
+            && (osl::FileBase::getFileURLFromSystemPath(aRet, aRet)
+                == osl::FileBase::E_None))
         {
             ::osl::DirectoryItem aItem;
             sal_Int32 i = aRet.getLength();
commit 428586623cbcc4cee9f930db5980a63e6f9ec6e8
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Aug 18 15:11:56 2015 +0200

    Simplify isLocalFile_Impl check
    
    (vnd.sun.star.wfs is long gone)
    
    Change-Id: I5e6659302d9ff3cd4e2ae4bb09066b73f842f17f

diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index c463f96..625cd95 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -21,7 +21,6 @@
 #include <com/sun/star/embed/ElementModes.hpp>
 #include <com/sun/star/embed/XTransactedObject.hpp>
 #include <com/sun/star/ucb/NameClash.hpp>
-#include <com/sun/star/ucb/UniversalContentBroker.hpp>
 #include <com/sun/star/ucb/XProgressHandler.hpp>
 #include <com/sun/star/ucb/XContentAccess.hpp>
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
@@ -54,7 +53,6 @@
 #include <unotools/ucbhelper.hxx>
 #include <unotools/ucbstreamhelper.hxx>
 #include <unotools/streamwrap.hxx>
-#include <ucbhelper/fileidentifierconverter.hxx>
 #include <ucbhelper/content.hxx>
 
 #include "fsstorage.hxx"
@@ -67,20 +65,7 @@ using namespace ::com::sun::star;
 // TODO: move to a standard helper
 bool isLocalFile_Impl( const OUString& aURL )
 {
-    OUString aSystemPath;
-
-    try
-    {
-        aSystemPath = ::ucbhelper::getSystemPathFromFileURL(
-            ucb::UniversalContentBroker::create(
-                comphelper::getProcessComponentContext() ),
-            aURL );
-    }
-    catch ( uno::Exception& )
-    {
-    }
-
-    return ( !aSystemPath.isEmpty() );
+    return aURL.startsWithIgnoreAsciiCase("file:");
 }
 
 struct FSStorage_Impl
commit 0b9b5f833cd8bb85437f2f89dcd3190eee1c161a
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Aug 18 15:11:16 2015 +0200

    Simplify ZipPackage::isLocalFile check
    
    (vnd.sun.star.wfs is long gone)
    
    Change-Id: I3e25f1728504cbad07bb97187a7bac23b33695dc

diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx
index 1304e0b..95a638a 100644
--- a/package/source/zippackage/ZipPackage.cxx
+++ b/package/source/zippackage/ZipPackage.cxx
@@ -50,7 +50,6 @@
 #include <com/sun/star/ucb/OpenMode.hpp>
 #include <com/sun/star/ucb/XProgressHandler.hpp>
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <com/sun/star/ucb/UniversalContentBroker.hpp>
 #include <com/sun/star/io/XActiveDataStreamer.hpp>
 #include <com/sun/star/embed/XTransactedObject.hpp>
 #include <com/sun/star/embed/UseBackupException.hpp>
@@ -72,7 +71,6 @@
 #include <boost/scoped_ptr.hpp>
 #include <vector>
 
-#include <ucbhelper/fileidentifierconverter.hxx>
 #include <comphelper/processfactory.hxx>
 #include <comphelper/seekableinput.hxx>
 #include <comphelper/storagehelper.hxx>
@@ -175,18 +173,7 @@ ZipPackage::~ZipPackage()
 
 bool ZipPackage::isLocalFile() const
 {
-    OUString aSystemPath;
-    uno::Reference< XUniversalContentBroker > xUcb(
-        UniversalContentBroker::create(
-            m_xContext ) );
-    try
-    {
-        aSystemPath = getSystemPathFromFileURL( xUcb, m_aURL );
-    }
-    catch ( Exception& )
-    {
-    }
-    return !aSystemPath.isEmpty();
+    return m_aURL.startsWithIgnoreAsciiCase("file:");
 }
 
 void ZipPackage::parseManifest()


More information about the Libreoffice-commits mailing list