[Libreoffice-commits] core.git: include/registry stoc/source

Noel Grandin noel at peralex.com
Mon Jul 4 06:48:55 UTC 2016


 include/registry/registry.hxx                 |   53 --------------------------
 stoc/source/simpleregistry/simpleregistry.cxx |   48 +++++------------------
 2 files changed, 11 insertions(+), 90 deletions(-)

New commits:
commit 70bfe5f71c1d45c14ce831051480a11c58ffc34d
Author: Noel Grandin <noel at peralex.com>
Date:   Fri Jul 1 14:58:43 2016 +0200

    remove deprecated Link functions from Registry
    
    Change-Id: Id678d4b6263df86993b289e8439faac847dd7c5f
    Reviewed-on: https://gerrit.libreoffice.org/26855
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/registry/registry.hxx b/include/registry/registry.hxx
index 9309e7f..c110b3b 100644
--- a/include/registry/registry.hxx
+++ b/include/registry/registry.hxx
@@ -528,32 +528,6 @@ public:
     inline RegError getUnicodeListValue(const rtl::OUString& keyName,
                                               RegistryValueList<sal_Unicode*>& rValueList);
 
-    /** used to create a link.
-
-        @deprecated Links are no longer supported.
-
-        @return RegError::INVALID_LINK
-     */
-    inline RegError createLink(const rtl::OUString& linkName,
-                               const rtl::OUString& linkTarget);
-
-    /** used to delete a link.
-
-        @deprecated Links are no longer supported.
-
-        @return RegError::INVALID_LINK
-     */
-    inline RegError deleteLink(const rtl::OUString& linkName);
-
-    /** used to return the target of a link.
-
-        @deprecated Links are no longer supported.
-
-        @return RegError::INVALID_LINK
-     */
-    inline RegError getLinkTarget(const rtl::OUString& linkName,
-                                    rtl::OUString& rLinkTarget) const;
-
     /** resolves a keyname.
 
         @param[in]  keyName specifies the name of the key which will be resolved relative to this key.
@@ -964,33 +938,6 @@ inline RegError RegistryKey::getUnicodeListValue(const rtl::OUString& keyName,
             return RegError::INVALID_KEY;
     }
 
-inline RegError RegistryKey::createLink(const rtl::OUString& ,
-                                        const rtl::OUString& )
-    {
-        if (m_registry.isValid())
-            return RegError::INVALID_LINK; // links are no longer supported
-        else
-            return RegError::INVALID_KEY;
-    }
-
-inline RegError RegistryKey::deleteLink(const rtl::OUString& )
-    {
-        if (m_registry.isValid())
-            return RegError::INVALID_LINK; // links are no longer supported
-        else
-            return RegError::INVALID_KEY;
-    }
-
-inline RegError RegistryKey::getLinkTarget(const rtl::OUString& ,
-                                                 rtl::OUString& ) const
-    {
-        if (m_registry.isValid())
-            return RegError::INVALID_LINK; // links are no longer supported
-        else
-            return RegError::INVALID_KEY;
-    }
-
-
 inline RegError RegistryKey::getResolvedKeyName(const rtl::OUString& keyName,
                                                       rtl::OUString& rResolvedName) const
     {
diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx
index eeef536..1c279ba 100644
--- a/stoc/source/simpleregistry/simpleregistry.cxx
+++ b/stoc/source/simpleregistry/simpleregistry.cxx
@@ -920,54 +920,28 @@ css::uno::Sequence< OUString > Key::getKeyNames()
 }
 
 sal_Bool Key::createLink(
-    OUString const & aLinkName, OUString const & aLinkTarget)
+    OUString const & /*aLinkName*/, OUString const & /*aLinkTarget*/)
     throw (css::registry::InvalidRegistryException, css::uno::RuntimeException, std::exception)
 {
-    osl::MutexGuard guard(registry_->mutex_);
-    RegError err = key_.createLink(aLinkName, aLinkTarget);
-    switch (err) {
-    case RegError::NO_ERROR:
-        return true;
-    case RegError::INVALID_KEY:
-    case RegError::DETECT_RECURSION:
-        throw css::registry::InvalidRegistryException(
-            (("com.sun.star.registry.SimpleRegistry key createLink:"
-                      " underlying RegistryKey::createLink() = ") +
-             OUString::number(static_cast<int>(err))),
+    throw css::registry::InvalidRegistryException(
+            "com.sun.star.registry.SimpleRegistry key createLink: links are no longer supported",
             static_cast< OWeakObject * >(this));
-    default:
-        return false;
-    }
 }
 
-void Key::deleteLink(OUString const & rLinkName)
+void Key::deleteLink(OUString const & /*rLinkName*/)
     throw (css::registry::InvalidRegistryException, css::uno::RuntimeException, std::exception)
 {
-    osl::MutexGuard guard(registry_->mutex_);
-    RegError err = key_.deleteLink(rLinkName);
-    if (err != RegError::NO_ERROR) {
-        throw css::registry::InvalidRegistryException(
-            (("com.sun.star.registry.SimpleRegistry key deleteLink:"
-                      " underlying RegistryKey::deleteLink() = ") +
-             OUString::number(static_cast<int>(err))),
-            static_cast< OWeakObject * >(this));
-    }
+    throw css::registry::InvalidRegistryException(
+        "com.sun.star.registry.SimpleRegistry key deleteLink: links are no longer supported",
+        static_cast< OWeakObject * >(this));
 }
 
-OUString Key::getLinkTarget(OUString const & rLinkName)
+OUString Key::getLinkTarget(OUString const & /*rLinkName*/)
     throw (css::registry::InvalidRegistryException, css::uno::RuntimeException, std::exception)
 {
-    osl::MutexGuard guard(registry_->mutex_);
-    OUString target;
-    RegError err = key_.getLinkTarget(rLinkName, target);
-    if (err != RegError::NO_ERROR) {
-        throw css::registry::InvalidRegistryException(
-            (("com.sun.star.registry.SimpleRegistry key getLinkTarget:"
-                      " underlying RegistryKey::getLinkTarget() = ") +
-             OUString::number(static_cast<int>(err))),
-            static_cast< OWeakObject * >(this));
-    }
-    return target;
+    throw css::registry::InvalidRegistryException(
+        "com.sun.star.registry.SimpleRegistry key getLinkTarget: links are no longer supported",
+        static_cast< OWeakObject * >(this));
 }
 
 OUString Key::getResolvedName(OUString const & aKeyName)


More information about the Libreoffice-commits mailing list