[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - compilerplugins/clang include/vcl ucb/source vcl/backendtest vcl/inc vcl/Library_vcl.mk vcl/osx vcl/source vcl/workben

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Mon Dec 19 21:38:27 UTC 2016


 compilerplugins/clang/badstatics.cxx  |    4 
 include/vcl/BitmapTools.hxx           |    2 
 include/vcl/ImageTree.hxx             |   78 +++++++++++++++++
 include/vcl/implimagetree.hxx         |  151 ----------------------------------
 ucb/source/ucp/image/ucpimage.cxx     |    6 -
 vcl/Library_vcl.mk                    |    1 
 vcl/backendtest/VisualBackendTest.cxx |    1 
 vcl/inc/implimagetree.hxx             |  136 ++++++++++++++++++++++++++++++
 vcl/inc/pch/precompiled_vcl.hxx       |    2 
 vcl/inc/vcldemo-debug.hxx             |   25 -----
 vcl/osx/vclnsapp.mm                   |   16 +--
 vcl/source/app/settings.cxx           |    2 
 vcl/source/app/svmain.cxx             |    4 
 vcl/source/bitmap/BitmapTools.cxx     |    2 
 vcl/source/control/fixed.cxx          |    2 
 vcl/source/gdi/bitmapex.cxx           |    4 
 vcl/source/image/Image.cxx            |    2 
 vcl/source/image/ImageArrayData.cxx   |    4 
 vcl/source/image/ImageList.cxx        |    2 
 vcl/source/image/ImageRepository.cxx  |    6 -
 vcl/source/image/ImageTree.cxx        |   56 ++++++++++++
 vcl/source/image/ImplImageTree.cxx    |   19 ----
 vcl/workben/vcldemo.cxx               |    9 +-
 23 files changed, 310 insertions(+), 224 deletions(-)

New commits:
commit a538162b8b9c437ccd0f47bdb042317914118c6d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Sun Dec 18 14:31:14 2016 +0100

    vcl: separate ImplImageTree - ImageTree singleton and public iface
    
    ImplImageTree was used outside of VCL which is not consistent with
    the name and the header also contains a lot of implementation
    detail. This separates the implementation to ImplImageTree and
    the public interface and singleton to ImageTree only.
    
    Change-Id: I3a26444f0f6971a6b1d83472e9cef19c93192d3e
    Reviewed-on: https://gerrit.libreoffice.org/32134
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>
    (cherry picked from commit bf5f6df9e47bd31dc052c6411f6f88ec2d4e3cea)
    Reviewed-on: https://gerrit.libreoffice.org/32165

diff --git a/compilerplugins/clang/badstatics.cxx b/compilerplugins/clang/badstatics.cxx
index 7ac7820..f10200a 100644
--- a/compilerplugins/clang/badstatics.cxx
+++ b/compilerplugins/clang/badstatics.cxx
@@ -177,8 +177,8 @@ public:
                 || name == "g_pHyphIter" // SwEditShell::HyphEnd()
                 || name == "pFieldEditEngine" // ScGlobal::Clear()
                 || name == "xDrawClipDocShellRef" // ScGlobal::Clear()
-                || name == "s_ImplImageTree"
-                    // ImplImageTree::get(), ImplImageTree::shutDown()
+                || name == "s_ImageTree"
+                    // ImageTree::get(), ImageTree::shutDown()
                 || name == "s_pMouseFrame"
                     // vcl/osx/salframeview.mm, mouseEntered/Exited, not owning
                 || name == "pCurrentMenuBar"
diff --git a/include/vcl/BitmapTools.hxx b/include/vcl/BitmapTools.hxx
index 51ae59a..e2777d8 100644
--- a/include/vcl/BitmapTools.hxx
+++ b/include/vcl/BitmapTools.hxx
@@ -13,7 +13,7 @@
 #include <vcl/bitmapex.hxx>
 #include <tools/stream.hxx>
 
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 
 namespace vcl {
 namespace bitmap {
diff --git a/include/vcl/ImageTree.hxx b/include/vcl/ImageTree.hxx
new file mode 100644
index 0000000..80a6f3b
--- /dev/null
+++ b/include/vcl/ImageTree.hxx
@@ -0,0 +1,78 @@
+/* -*- 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_INCLUDE_VCL_IMAGETREE_HXX
+#define INCLUDED_INCLUDE_VCL_IMAGETREE_HXX
+
+#include <sal/config.h>
+#include <vcl/dllapi.h>
+#include <vcl/bitmapex.hxx>
+
+enum class ImageLoadFlags : sal_uInt16
+{
+    NONE                = 0,
+    IgnoreScalingFactor = 1,
+    IgnoreDarkTheme     = 2,
+};
+
+namespace o3tl {
+template<> struct typed_flags<ImageLoadFlags>: is_typed_flags<ImageLoadFlags, 0x3> {};
+}
+
+namespace com { namespace sun { namespace star { namespace container {
+    class XNameAccess;
+}}}}
+
+class ImplImageTree;
+
+class ImageTree
+{
+private:
+    std::unique_ptr<ImplImageTree> mpImplImageTree;
+
+public:
+    ImageTree();
+
+    VCL_DLLPUBLIC static ImageTree & get();
+
+    VCL_DLLPUBLIC OUString getImageUrl(
+        OUString const & name, OUString const & style, OUString const & lang);
+
+    bool loadImage(
+        OUString const & name, OUString const & style,
+        BitmapEx & bitmap, bool localized,
+        const ImageLoadFlags eFlags = ImageLoadFlags::NONE);
+
+    bool loadDefaultImage(
+        OUString const & style,
+        BitmapEx& bitmap,
+        const ImageLoadFlags eFlags = ImageLoadFlags::NONE);
+
+    VCL_DLLPUBLIC css::uno::Reference<css::container::XNameAccess> getNameAccess();
+
+
+    /** a crude form of life cycle control (called from DeInitVCL; otherwise,
+     *  if the ImplImageTree singleton were destroyed during exit that would
+     *  be too late for the destructors of the bitmaps in maIconCache)*/
+    void shutdown();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/image/ucpimage.cxx b/ucb/source/ucp/image/ucpimage.cxx
index fb3acff..723e7a2 100644
--- a/ucb/source/ucp/image/ucpimage.cxx
+++ b/ucb/source/ucp/image/ucpimage.cxx
@@ -20,13 +20,13 @@
 #include <osl/mutex.hxx>
 #include <rtl/uri.hxx>
 #include <rtl/ustrbuf.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/svapp.hxx>
 #include <ucbhelper/content.hxx>
 
 // A LO-private ("implementation detail") UCP used to access images from help
 // content, with theme fallback and localization support as provided by VCL's
-// ImplImageTree.
+// ImageTree.
 //
 // The URL scheme is
 //
@@ -133,7 +133,7 @@ private:
         OUString newUrl;
         {
             SolarMutexGuard g;
-            newUrl = ImplImageTree::get().getImageUrl(decPath, auth, lang);
+            newUrl = ImageTree::get().getImageUrl(decPath, auth, lang);
         }
         ucbhelper::Content content;
         return
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index b8cb2574..f552b55 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -313,6 +313,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
     vcl/source/image/Image \
     vcl/source/image/ImageArrayData \
     vcl/source/image/ImageList \
+    vcl/source/image/ImageTree \
     vcl/source/image/ImageRepository \
     vcl/source/image/ImplImage \
     vcl/source/image/ImplImageList \
diff --git a/vcl/backendtest/VisualBackendTest.cxx b/vcl/backendtest/VisualBackendTest.cxx
index ced23d9..fd6f27b 100644
--- a/vcl/backendtest/VisualBackendTest.cxx
+++ b/vcl/backendtest/VisualBackendTest.cxx
@@ -41,7 +41,6 @@
 
 #include <basegfx/numeric/ftools.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
-#include <vcldemo-debug.hxx>
 
 #include <rtl/math.hxx>
 
diff --git a/include/vcl/implimagetree.hxx b/vcl/inc/implimagetree.hxx
similarity index 89%
rename from include/vcl/implimagetree.hxx
rename to vcl/inc/implimagetree.hxx
index 3064e57..a229177 100644
--- a/include/vcl/implimagetree.hxx
+++ b/vcl/inc/implimagetree.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_INCLUDE_VCL_IMPLIMAGETREE_HXX
-#define INCLUDED_INCLUDE_VCL_IMPLIMAGETREE_HXX
+#ifndef INCLUDED_VCL_INC_IMPLIMAGETREE_HXX
+#define INCLUDED_VCL_INC_IMPLIMAGETREE_HXX
 
 #include <sal/config.h>
 
@@ -32,30 +32,19 @@
 #include <vcl/bitmapex.hxx>
 #include <vcl/dllapi.h>
 #include <i18nlangtag/languagetag.hxx>
+#include <vcl/ImageTree.hxx>
 
 namespace com { namespace sun { namespace star { namespace container {
     class XNameAccess;
-} } } }
+}}}}
 
-enum class ImageLoadFlags : sal_uInt16
+class ImplImageTree
 {
-    NONE                = 0,
-    IgnoreScalingFactor = 1,
-    IgnoreDarkTheme     = 2,
-};
-
-namespace o3tl {
-
-template<> struct typed_flags<ImageLoadFlags>: is_typed_flags<ImageLoadFlags, 0x3> {};
-
-}
-
-
-class ImplImageTree {
 public:
-    VCL_DLLPUBLIC static ImplImageTree & get();
+    ImplImageTree();
+    ~ImplImageTree();
 
-    VCL_DLLPUBLIC OUString getImageUrl(
+    OUString getImageUrl(
         OUString const & name, OUString const & style, OUString const & lang);
 
     bool loadImage(
@@ -71,15 +60,11 @@ public:
     /** a crude form of life cycle control (called from DeInitVCL; otherwise,
      *  if the ImplImageTree singleton were destroyed during exit that would
      *  be too late for the destructors of the bitmaps in maIconCache)*/
-    void shutDown();
+    void shutdown();
 
     css::uno::Reference< css::container::XNameAccess > getNameAccess();
 
 private:
-    ImplImageTree();
-
-    ~ImplImageTree();
-
     ImplImageTree(const ImplImageTree&) = delete;
     ImplImageTree& operator=(const ImplImageTree&) = delete;
 
diff --git a/vcl/inc/pch/precompiled_vcl.hxx b/vcl/inc/pch/precompiled_vcl.hxx
index e283e03..6ef9e2a 100644
--- a/vcl/inc/pch/precompiled_vcl.hxx
+++ b/vcl/inc/pch/precompiled_vcl.hxx
@@ -151,7 +151,7 @@
 #include <vcl/help.hxx>
 #include <vcl/i18nhelp.hxx>
 #include <vcl/image.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/keycod.hxx>
 #include <vcl/keycodes.hxx>
 #include <vcl/layout.hxx>
diff --git a/vcl/inc/vcldemo-debug.hxx b/vcl/inc/vcldemo-debug.hxx
deleted file mode 100644
index 37dae24..0000000
--- a/vcl/inc/vcldemo-debug.hxx
+++ /dev/null
@@ -1,25 +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/.
- */
-
-#ifndef INCLUDED_VCL_INC_VCLDEMO_DEBUG_HXX
-#define INCLUDED_VCL_INC_VCLDEMO_DEBUG_HXX
-
-#include <sal/config.h>
-
-#include <com/sun/star/uno/Sequence.hxx>
-#include <rtl/ustring.hxx>
-#include <sal/types.h>
-#include <vcl/dllapi.h>
-
-// For vcldemo / debugging
-VCL_DLLPUBLIC css::uno::Sequence< OUString > ImageTree_getAllImageNames();
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/osx/vclnsapp.mm b/vcl/osx/vclnsapp.mm
index a8eb84a..4c38466 100644
--- a/vcl/osx/vclnsapp.mm
+++ b/vcl/osx/vclnsapp.mm
@@ -24,7 +24,7 @@
 
 #include <sal/main.h>
 #include <vcl/commandevent.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/window.hxx>
 
@@ -374,8 +374,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     (void)app;
     std::vector<OUString> aFile;
     aFile.push_back( GetOUString( pFile ) );
-	const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::Type::Print, aFile);
-	AquaSalInstance::aAppEventList.push_back( pAppEvent );
+    const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::Type::Print, aFile);
+    AquaSalInstance::aAppEventList.push_back( pAppEvent );
     return YES;
 }
 -(NSApplicationPrintReply)application: (NSApplication *) app printFiles:(NSArray *)files withSettings: (NSDictionary *)printSettings showPrintPanels:(BOOL)bShowPrintPanels
@@ -393,8 +393,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     {
         aFileList.push_back( GetOUString( pFile ) );
     }
-	const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::Type::Print, aFileList);
-	AquaSalInstance::aAppEventList.push_back( pAppEvent );
+    const ApplicationEvent* pAppEvent = new ApplicationEvent(ApplicationEvent::Type::Print, aFileList);
+    AquaSalInstance::aAppEventList.push_back( pAppEvent );
     // we have no back channel here, we have to assume success
     // correct handling would be NSPrintingReplyLater and then send [app replyToOpenOrPrint]
     return NSPrintingSuccess;
@@ -425,7 +425,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
         {
             ApplicationEvent aEv(ApplicationEvent::Type::PrivateDoShutdown);
             GetpApp()->AppEvent( aEv );
-            ImplImageTree::get().shutDown();
+            ImageTree::get().shutdown();
             // DeInitVCL should be called in ImplSVMain - unless someon _exits first which
             // can occur in Desktop::doShutdown for example
         }
@@ -440,8 +440,8 @@ SAL_WNODEPRECATED_DECLARATIONS_POP
     SolarMutexGuard aGuard;
 
     const SalData* pSalData = GetSalData();
-	if( !pSalData->maFrames.empty() )
-		pSalData->maFrames.front()->CallCallback( SalEvent::SettingsChanged, nullptr );
+    if( !pSalData->maFrames.empty() )
+        pSalData->maFrames.front()->CallCallback( SalEvent::SettingsChanged, nullptr );
 }
 
 -(void)screenParametersChanged: (NSNotification*) pNotification
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index d9dbe57..e4d90f9 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -42,7 +42,7 @@
 #include <vcl/event.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/i18nhelp.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/configsettings.hxx>
 #include <vcl/gradient.hxx>
 #include <vcl/outdev.hxx>
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 2012764b..2cd6137 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -38,7 +38,7 @@
 #include <vcl/cvtgrf.hxx>
 #include <vcl/scheduler.hxx>
 #include <vcl/image.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/unowrap.hxx>
 #include <vcl/commandinfoprovider.hxx>
@@ -403,7 +403,7 @@ void DeInitVCL()
     SAL_WARN_IF( nBadTopWindows!=0, "vcl", aBuf.getStr() );
 #endif
 
-    ImplImageTree::get().shutDown();
+    ImageTree::get().shutdown();
 
     osl_removeSignalHandler( pExceptionHandler);
     pExceptionHandler = nullptr;
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx
index 1016a78..40e79b7 100644
--- a/vcl/source/bitmap/BitmapTools.cxx
+++ b/vcl/source/bitmap/BitmapTools.cxx
@@ -42,7 +42,7 @@ BitmapEx loadFromName(const OUString& rFileName, const ImageLoadFlags eFlags)
 
     OUString aIconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme();
 
-    ImplImageTree::get().loadImage(rFileName, aIconTheme, aBitmapEx, true, eFlags);
+    ImageTree::get().loadImage(rFileName, aIconTheme, aBitmapEx, true, eFlags);
 
     return aBitmapEx;
 }
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index dae1d42..688c778 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -23,7 +23,7 @@
 #include <vcl/dialog.hxx>
 #include <vcl/event.hxx>
 #include <vcl/fixed.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/settings.hxx>
 
diff --git a/vcl/source/gdi/bitmapex.cxx b/vcl/source/gdi/bitmapex.cxx
index 7bde2ff..808886f 100644
--- a/vcl/source/gdi/bitmapex.cxx
+++ b/vcl/source/gdi/bitmapex.cxx
@@ -25,7 +25,7 @@
 #include <tools/stream.hxx>
 #include <tools/debug.hxx>
 #include <tools/rc.h>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/salbtype.hxx>
 #include <vcl/outdev.hxx>
 #include <vcl/alpha.hxx>
@@ -110,7 +110,7 @@ void BitmapEx::loadFromIconTheme( const OUString& rIconName )
 {
     OUString aIconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme();
 
-    if( !ImplImageTree::get().loadImage( rIconName, aIconTheme, *this, true ) )
+    if (!ImageTree::get().loadImage(rIconName, aIconTheme, *this, true))
     {
 #ifdef DBG_UTIL
         OStringBuffer aErrorStr(
diff --git a/vcl/source/image/Image.cxx b/vcl/source/image/Image.cxx
index 22b6fbc..51dcca4 100644
--- a/vcl/source/image/Image.cxx
+++ b/vcl/source/image/Image.cxx
@@ -30,7 +30,7 @@
 #include <vcl/svapp.hxx>
 #include <vcl/image.hxx>
 #include <vcl/imagerepository.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <sal/types.h>
 #include <image.h>
 
diff --git a/vcl/source/image/ImageArrayData.cxx b/vcl/source/image/ImageArrayData.cxx
index bd2f1df..5435438 100644
--- a/vcl/source/image/ImageArrayData.cxx
+++ b/vcl/source/image/ImageArrayData.cxx
@@ -26,7 +26,7 @@
 #include <vcl/image.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/svapp.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 
 #include <image.h>
 #include <memory>
@@ -70,7 +70,7 @@ void ImageAryData::Load(const OUString &rPrefix)
     OUString aFileName = rPrefix;
     aFileName += maName;
 
-    bool bSuccess = ImplImageTree::get().loadImage(aFileName, aIconTheme, maBitmapEx, true);
+    bool bSuccess = ImageTree::get().loadImage(aFileName, aIconTheme, maBitmapEx, true);
 
     if (bSuccess)
     {}
diff --git a/vcl/source/image/ImageList.cxx b/vcl/source/image/ImageList.cxx
index 29bdbc0..3dadd14 100644
--- a/vcl/source/image/ImageList.cxx
+++ b/vcl/source/image/ImageList.cxx
@@ -30,7 +30,7 @@
 #include <vcl/svapp.hxx>
 #include <vcl/image.hxx>
 #include <vcl/imagerepository.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <image.h>
 
 ImageList::ImageList()
diff --git a/vcl/source/image/ImageRepository.cxx b/vcl/source/image/ImageRepository.cxx
index 855ae80..7b9255f 100644
--- a/vcl/source/image/ImageRepository.cxx
+++ b/vcl/source/image/ImageRepository.cxx
@@ -19,7 +19,7 @@
 
 #include <vcl/bitmapex.hxx>
 #include <vcl/imagerepository.hxx>
-#include <vcl/implimagetree.hxx>
+#include <vcl/ImageTree.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/svapp.hxx>
 
@@ -29,13 +29,13 @@ namespace vcl
     {
         OUString sIconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme();
 
-        return ImplImageTree::get().loadImage( _rName, sIconTheme, _out_rImage, _bSearchLanguageDependent );
+        return ImageTree::get().loadImage( _rName, sIconTheme, _out_rImage, _bSearchLanguageDependent );
     }
 
     bool ImageRepository::loadDefaultImage( BitmapEx& _out_rImage)
     {
         OUString sIconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme();
-        return ImplImageTree::get().loadDefaultImage( sIconTheme,_out_rImage);
+        return ImageTree::get().loadDefaultImage( sIconTheme,_out_rImage);
     }
 
 } // namespace vcl
diff --git a/vcl/source/image/ImageTree.cxx b/vcl/source/image/ImageTree.cxx
new file mode 100644
index 0000000..0c9dcac
--- /dev/null
+++ b/vcl/source/image/ImageTree.cxx
@@ -0,0 +1,56 @@
+/* -*- 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/.
+ *
+ */
+
+#include <vcl/ImageTree.hxx>
+#include "implimagetree.hxx"
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/container/XNameAccess.hpp>
+
+ImageTree & ImageTree::get() {
+    static ImageTree s_ImageTree;
+    return s_ImageTree;
+}
+
+ImageTree::ImageTree()
+    : mpImplImageTree(new ImplImageTree)
+{
+}
+
+OUString ImageTree::getImageUrl(OUString const & rName, OUString const & rStyle, OUString const & rLang)
+
+{
+    return mpImplImageTree->getImageUrl(rName, rStyle, rLang);
+}
+
+bool ImageTree::loadImage(OUString const & rName, OUString const & rStyle,
+                          BitmapEx & rBitmap, bool bLocalized,
+                          const ImageLoadFlags eFlags)
+{
+    return mpImplImageTree->loadImage(rName, rStyle, rBitmap, bLocalized, eFlags);
+}
+
+bool ImageTree::loadDefaultImage(OUString const & rStyle, BitmapEx& rBitmap,
+                                 const ImageLoadFlags eFlags)
+{
+    return mpImplImageTree->loadDefaultImage(rStyle, rBitmap, eFlags);
+}
+
+css::uno::Reference<css::container::XNameAccess> ImageTree::getNameAccess()
+{
+    return mpImplImageTree->getNameAccess();
+}
+
+void ImageTree::shutdown()
+{
+    mpImplImageTree->shutdown();
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/image/ImplImageTree.cxx b/vcl/source/image/ImplImageTree.cxx
index bd36080..744d487 100644
--- a/vcl/source/image/ImplImageTree.cxx
+++ b/vcl/source/image/ImplImageTree.cxx
@@ -37,13 +37,13 @@
 
 #include "tools/stream.hxx"
 #include "tools/urlobj.hxx"
+#include "implimagetree.hxx"
+
 #include <vcl/bitmapex.hxx>
 #include <vcl/dibtools.hxx>
-#include <vcl/implimagetree.hxx>
 #include <vcl/pngread.hxx>
 #include <vcl/settings.hxx>
 #include <vcl/svapp.hxx>
-#include <vcldemo-debug.hxx>
 
 #include <vcl/BitmapProcessor.hxx>
 #include <vcl/BitmapTools.hxx>
@@ -171,11 +171,6 @@ void loadImageFromStream(std::shared_ptr<SvStream> const & xStream, OUString con
 
 }
 
-ImplImageTree & ImplImageTree::get() {
-    static ImplImageTree s_ImplImageTree;
-    return s_ImplImageTree;
-}
-
 ImplImageTree::ImplImageTree()
 {
 }
@@ -368,7 +363,7 @@ bool ImplImageTree::doLoadImage(OUString const & name, OUString const & style, B
     return found;
 }
 
-void ImplImageTree::shutDown()
+void ImplImageTree::shutdown()
 {
     maCurrentStyle.clear();
     maIconSets.clear();
@@ -545,12 +540,4 @@ css::uno::Reference<css::container::XNameAccess> ImplImageTree::getNameAccess()
     return getCurrentIconSet().maNameAccess;
 }
 
-/// Recursively dump all names ...
-css::uno::Sequence<OUString> ImageTree_getAllImageNames()
-{
-    css::uno::Reference<css::container::XNameAccess> xRef(ImplImageTree::get().getNameAccess());
-
-    return xRef->getElementNames();
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 5458bb4..964904f 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -17,6 +17,9 @@
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/registry/XSimpleRegistry.hpp>
 #include <com/sun/star/ucb/UniversalContentBroker.hpp>
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/uno/Sequence.hxx>
+#include <com/sun/star/container/XNameAccess.hpp>
 
 #include <osl/time.h>
 #include <vcl/vclmain.hxx>
@@ -38,10 +41,10 @@
 #include <vcl/bitmapaccess.hxx>
 #include <vcl/help.hxx>
 #include <vcl/menu.hxx>
+#include <vcl/ImageTree.hxx>
 
 #include <basegfx/numeric/ftools.hxx>
 #include <basegfx/matrix/b2dhommatrix.hxx>
-#include <vcldemo-debug.hxx>
 #include <opengl/zone.hxx>
 
 // internal headers for OpenGLTests class.
@@ -1211,7 +1214,9 @@ public:
                 return;
             bHasLoadedAll = true;
 
-            css::uno::Sequence< OUString > aAllIcons = ImageTree_getAllImageNames();
+            css::uno::Reference<css::container::XNameAccess> xRef(ImageTree::get().getNameAccess());
+            css::uno::Sequence< OUString > aAllIcons = xRef->getElementNames();
+
             for (sal_Int32 i = 0; i < aAllIcons.getLength(); i++)
             {
                 if (aAllIcons[i].endsWithIgnoreAsciiCase("svg"))


More information about the Libreoffice-commits mailing list