[Libreoffice-commits] core.git: 3 commits - configure.ac vcl/source vcl/workben

Caolán McNamara caolanm at redhat.com
Mon Mar 6 11:07:51 UTC 2017


 configure.ac                 |    6 +++++-
 vcl/source/app/settings.cxx  |   17 +++++++++++------
 vcl/workben/commonfuzzer.hxx |   30 +++++++++++++++++++-----------
 3 files changed, 35 insertions(+), 18 deletions(-)

New commits:
commit 929358286c4a21c3f19284246ba1a99200b64bf2
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 6 10:11:26 2017 +0000

    add a oss-fuzz BRAND_BASE_DIR override
    
    Change-Id: I8878d5c35da6c9015420e54c4a82f80f5827ce5d

diff --git a/vcl/workben/commonfuzzer.hxx b/vcl/workben/commonfuzzer.hxx
index b18e033..d8c14b2 100644
--- a/vcl/workben/commonfuzzer.hxx
+++ b/vcl/workben/commonfuzzer.hxx
@@ -16,6 +16,7 @@
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <unotools/configmgr.hxx>
+#include <rtl/bootstrap.hxx>
 #include <rtl/strbuf.hxx>
 #include <osl/file.hxx>
 #include <vcl/print.hxx>
@@ -31,21 +32,26 @@ using namespace cppu;
 
 namespace
 {
-    void setFontConfigConf()
+    OUString getExecutableDir()
+    {
+        OUString uri;
+        if (osl_getExecutableFile(&uri.pData) != osl_Process_E_None) {
+            abort();
+        }
+        sal_Int32 lastDirSeperatorPos = uri.lastIndexOf('/');
+        if (lastDirSeperatorPos >= 0) {
+            uri = uri.copy(0, lastDirSeperatorPos + 1);
+        }
+        return uri;
+    }
+
+    void setFontConfigConf(const OUString &execdir)
     {
         osl::File aFontConfig("file:///tmp/wmffuzzerfonts.conf");
         if (aFontConfig.open(osl_File_OpenFlag_Create | osl_File_OpenFlag_Write) == osl::File::E_None)
         {
-            OUString uri;
-            if (osl_getExecutableFile(&uri.pData) != osl_Process_E_None) {
-                abort();
-            }
-            sal_Int32 lastDirSeperatorPos = uri.lastIndexOf('/');
-            if (lastDirSeperatorPos >= 0) {
-                uri = uri.copy(0, lastDirSeperatorPos + 1);
-            }
             OUString path;
-            osl::FileBase::getSystemPathFromFileURL(uri, path);
+            osl::FileBase::getSystemPathFromFileURL(execdir, path);
             OString sFontDir = OUStringToOString(path, osl_getThreadTextEncoding());
 
             rtl::OStringBuffer aBuffer("<?xml version=\"1.0\"?>\n<fontconfig><dir>");
@@ -77,7 +83,9 @@ extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
 
     osl_setCommandArgs(*argc, *argv);
 
-    setFontConfigConf();
+    OUString sExecDir = getExecutableDir();
+    rtl::Bootstrap::set("BRAND_BASE_DIR", sExecDir);
+    setFontConfigConf(sExecDir);
 
     tools::extendApplicationEnvironment();
 
commit 9aca0423ad4f882afb463558923dc59ed9e31eae
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 6 10:11:05 2017 +0000

    add a non-config fallback for theme
    
    Change-Id: I9fbd8b18510fb2ec8c6c48fb2be899f06f98fa30

diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 69971b5..e500d50 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -3013,14 +3013,19 @@ StyleSettings::DetermineIconTheme() const
     OUString sTheme(mxData->mIconTheme);
     if (sTheme.isEmpty())
     {
-        // read from the configuration, or fallback to what the desktop wants
-        uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
-        if (xContext.is())
+        if (utl::ConfigManager::IsAvoidConfig())
+            sTheme = "galaxy";
+        else
         {
-            sTheme = officecfg::Office::Common::Misc::SymbolStyle::get(xContext);
+            // read from the configuration, or fallback to what the desktop wants
+            uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
+            if (xContext.is())
+            {
+                sTheme = officecfg::Office::Common::Misc::SymbolStyle::get(xContext);
 
-            if (sTheme.isEmpty() || sTheme == "auto")
-                sTheme = GetAutomaticallyChosenIconTheme();
+                if (sTheme.isEmpty() || sTheme == "auto")
+                    sTheme = GetAutomaticallyChosenIconTheme();
+            }
         }
     }
 
commit fb4467b6ffc6d77ab79e11806f00cf30f33388fd
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 6 09:08:39 2017 +0000

    use a different resource dir for oss-fuzz
    
    Change-Id: Idb14cdbb3f1717e5d0aaa6fddbe39d2f46384d08

diff --git a/configure.ac b/configure.ac
index 57506a0..32c689e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3127,7 +3127,11 @@ else
     LIBO_SHARE_JAVA_FOLDER=program/classes
     LIBO_SHARE_PRESETS_FOLDER=presets
     LIBO_SHARE_READMES_FOLDER=readmes
-    LIBO_SHARE_RESOURCE_FOLDER=program/resource
+    if test "$enable_fuzzers" != yes; then
+        LIBO_SHARE_RESOURCE_FOLDER=program/resource
+    else
+        LIBO_SHARE_RESOURCE_FOLDER=resource
+    fi
     LIBO_SHARE_SHELL_FOLDER=program/shell
     LIBO_URE_BIN_FOLDER=program
     LIBO_URE_ETC_FOLDER=program


More information about the Libreoffice-commits mailing list