[Libreoffice-commits] core.git: shell/source

Stephan Bergmann sbergman at redhat.com
Tue Aug 23 08:22:09 UTC 2016


 shell/source/backends/kde4be/kde4access.cxx  |   11 +++++++++++
 shell/source/backends/kde4be/kde4backend.cxx |    4 ++--
 shell/source/backends/kdebe/kdeaccess.cxx    |   11 +++++++++++
 shell/source/backends/kdebe/kdebackend.cxx   |    4 ++--
 4 files changed, 26 insertions(+), 4 deletions(-)

New commits:
commit 21385d204995b5c8f5d5fbdfd8a845785e916595
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Aug 23 10:19:40 2016 +0200

    Revert "Remove WorkPathVariable support from KDE backends"
    
    This reverts commit 8da1d7869a2bdbe006265f584e0d9af5046ef723.
    
    plus:
    
    Revert "Revert "KDE: don't throw on TemplatePathVariable""
    
    This reverts commit 72812a380c0d9587670bae1d1efa8700c874634e.
    
    I had misread the code and thought that handling of those two properties in
    shell/source/backends/desktopbe/desktopbackend.cxx would hide handling them in the
    specific KDE backends, but that is not actually the case.
    
    Change-Id: I32fae5ba34cc934ceca2f574d50fc327b506b001

diff --git a/shell/source/backends/kde4be/kde4access.cxx b/shell/source/backends/kde4be/kde4access.cxx
index 914daba..5d962b7 100644
--- a/shell/source/backends/kde4be/kde4access.cxx
+++ b/shell/source/backends/kde4be/kde4access.cxx
@@ -86,6 +86,17 @@ css::beans::Optional< css::uno::Any > getValue(OUString const & id) {
         bool ATToolSupport = false;
         return css::beans::Optional< css::uno::Any >(
             true, uno::makeAny( OUString::boolean( ATToolSupport ) ) );
+    } else if (id == "WorkPathVariable")
+    {
+        QString aDocumentsDir( KGlobalSettings::documentPath() );
+        OUString sDocumentsDir;
+        OUString sDocumentsURL;
+        if ( aDocumentsDir.endsWith(QChar('/')) )
+            aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
+        sDocumentsDir = reinterpret_cast<const sal_Unicode *>(aDocumentsDir.utf16());
+        osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
+        return css::beans::Optional< css::uno::Any >(
+            true, uno::makeAny( sDocumentsURL ) );
     } else if (id == "ooInetFTPProxyName")
     {
         QString aFTPProxy;
diff --git a/shell/source/backends/kde4be/kde4backend.cxx b/shell/source/backends/kde4be/kde4backend.cxx
index fd049a2..013e532 100644
--- a/shell/source/backends/kde4be/kde4backend.cxx
+++ b/shell/source/backends/kde4be/kde4backend.cxx
@@ -167,10 +167,10 @@ css::uno::Any Service::getPropertyValue(OUString const & PropertyName)
         css::uno::RuntimeException, std::exception)
 {
     if (PropertyName == "EnableATToolSupport" || PropertyName == "ExternalMailer" || PropertyName == "SourceViewFontHeight"
-     || PropertyName == "SourceViewFontName" || PropertyName == "ooInetFTPProxyName"
+     || PropertyName == "SourceViewFontName" || PropertyName == "WorkPathVariable" || PropertyName == "ooInetFTPProxyName"
      || PropertyName == "ooInetFTPProxyPort" || PropertyName == "ooInetHTTPProxyName" || PropertyName == "ooInetHTTPProxyPort"
      || PropertyName == "ooInetHTTPSProxyName" || PropertyName == "ooInetHTTPSProxyPort" || PropertyName == "ooInetNoProxy"
-     || PropertyName == "ooInetProxyType" )
+     || PropertyName == "ooInetProxyType" || PropertyName == "TemplatePathVariable" )
     {
         return css::uno::makeAny(
             enabled_
diff --git a/shell/source/backends/kdebe/kdeaccess.cxx b/shell/source/backends/kdebe/kdeaccess.cxx
index 116ae97..a0a5156 100644
--- a/shell/source/backends/kdebe/kdeaccess.cxx
+++ b/shell/source/backends/kdebe/kdeaccess.cxx
@@ -82,6 +82,17 @@ css::beans::Optional< css::uno::Any > getValue(OUString const & id) {
         bool ATToolSupport = false;
         return css::beans::Optional< css::uno::Any >(
             true, uno::makeAny( OUString::boolean( ATToolSupport ) ) );
+    } else if (id == "WorkPathVariable")
+    {
+        QString aDocumentsDir( KGlobalSettings::documentPath() );
+        OUString sDocumentsDir;
+        OUString sDocumentsURL;
+        if ( aDocumentsDir.endsWith(QChar('/')) )
+            aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
+        sDocumentsDir = reinterpret_cast<const sal_Unicode *>(aDocumentsDir.ucs2());
+        osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
+        return css::beans::Optional< css::uno::Any >(
+            true, uno::makeAny( sDocumentsURL ) );
     } else if (id == "ooInetFTPProxyName")
     {
         QString aFTPProxy;
diff --git a/shell/source/backends/kdebe/kdebackend.cxx b/shell/source/backends/kdebe/kdebackend.cxx
index aca29de..7381131 100644
--- a/shell/source/backends/kdebe/kdebackend.cxx
+++ b/shell/source/backends/kdebe/kdebackend.cxx
@@ -169,10 +169,10 @@ css::uno::Any Service::getPropertyValue(OUString const & PropertyName)
         css::uno::RuntimeException, std::exception)
 {
     if ( PropertyName == "EnableATToolSupport" || PropertyName == "ExternalMailer" || PropertyName == "SourceViewFontHeight"
-      || PropertyName == "SourceViewFontName" || PropertyName == "ooInetFTPProxyName"
+      || PropertyName == "SourceViewFontName" || PropertyName == "WorkPathVariable" || PropertyName == "ooInetFTPProxyName"
       || PropertyName == "ooInetFTPProxyPort" || PropertyName == "ooInetHTTPProxyName" || PropertyName == "ooInetHTTPProxyPort"
       || PropertyName == "ooInetHTTPSProxyName" || PropertyName == "ooInetHTTPSProxyPort" || PropertyName == "ooInetNoProxy"
-      || PropertyName == "ooInetProxyType" )
+      || PropertyName == "ooInetProxyType" || PropertyName == "TemplatePathVariable" )
     {
         return css::uno::makeAny(
             enabled_


More information about the Libreoffice-commits mailing list