LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File split-icons-search-usr-share.diff of Package libreoffice-icon-themes (Project LibreOffice:Stable)

diff -urN libreoffice-4.1.0.0.beta1.old/vcl/inc/impimagetree.hxx libreoffice-4.1.0.0.beta1/vcl/inc/impimagetree.hxx
--- libreoffice-4.1.0.0.beta1.old/vcl/inc/impimagetree.hxx	2013-05-27 14:04:19.777304208 +0200
+++ libreoffice-4.1.0.0.beta1/vcl/inc/impimagetree.hxx	2013-05-27 14:14:07.409304138 +0200
@@ -76,6 +76,10 @@
     typedef boost::unordered_map<
         OUString, std::pair< bool, BitmapEx >, OUStringHash > IconCache;
 
+    // we want to search zip files (icons) also in /usr/share/
+    ::rtl::OUString m_datadir; // /usr/share/
+    ::rtl::OUString m_libdir;   // /usr/lib or /usr/lib64
+
     OUString m_style;
     Paths m_paths;
     CheckStyleCache m_checkStyleCache;
@@ -84,6 +88,7 @@
 
     void setStyle(OUString const & style );
 
+    void addUrlToPaths(const rtl::OUString &url);
     void resetPaths();
 
     bool checkStyleCacheLookup( OUString const & style, bool &exists );
diff -urN libreoffice-4.1.0.0.beta1.old/vcl/source/gdi/impimagetree.cxx libreoffice-4.1.0.0.beta1/vcl/source/gdi/impimagetree.cxx
--- libreoffice-4.1.0.0.beta1.old/vcl/source/gdi/impimagetree.cxx	2013-05-27 14:04:19.749304208 +0200
+++ libreoffice-4.1.0.0.beta1/vcl/source/gdi/impimagetree.cxx	2013-05-27 14:21:57.167304082 +0200
@@ -128,7 +128,16 @@
 
 }
 
-ImplImageTree::ImplImageTree() { m_cacheIcons = true; }
+ImplImageTree::ImplImageTree()
+{
+    m_cacheIcons = true;
+    m_datadir = ::rtl::OUString( "/usr/share/" );
+#if defined(X86_64)
+    m_libdir = ::rtl::OUString( "/usr/lib64/" );
+#else
+    m_libdir = ::rtl::OUString( "/usr/lib/" );
+#endif
+}
 
 ImplImageTree::~ImplImageTree() {}
 
@@ -253,6 +262,22 @@
     }
 }
 
+void ImplImageTree::addUrlToPaths(const rtl::OUString &url) {
+    if ( url.getLength() == 0 ) 
+        return; 
+    m_paths.push_back(
+        std::make_pair(
+        url,
+        css::uno::Reference< css::container::XNameAccess >()));
+    sal_Int32 nLibDirPos = url.indexOf( m_libdir ); 
+    if ( nLibDirPos >= 0 ) {
+    m_paths.push_back(
+            std::make_pair(
+            url.replaceAt( nLibDirPos, m_libdir.getLength(), m_datadir ),
+            css::uno::Reference< css::container::XNameAccess >()));
+    }
+} 
+
 void ImplImageTree::resetPaths() {
     m_paths.clear();
 
@@ -268,9 +293,7 @@
     }
     else
         url += "images";
-    m_paths.push_back(
-        std::make_pair(
-            url, css::uno::Reference< css::container::XNameAccess >()));
+    addUrlToPaths(url);
 }
 
 bool ImplImageTree::checkStyleCacheLookup(
diff -urN libreoffice-4.1.0.0.beta1.old/xmlhelp/source/cxxhelp/provider/provider.cxx libreoffice-4.1.0.0.beta1/xmlhelp/source/cxxhelp/provider/provider.cxx
--- libreoffice-4.1.0.0.beta1.old/xmlhelp/source/cxxhelp/provider/provider.cxx	2013-05-27 14:04:24.361304207 +0200
+++ libreoffice-4.1.0.0.beta1/xmlhelp/source/cxxhelp/provider/provider.cxx	2013-05-27 14:17:37.465304113 +0200
@@ -321,7 +321,7 @@
         OUString( " " ) +
         setupextension );
 
-    uno::Sequence< OUString > aImagesZipPaths( 2 );
+    uno::Sequence< OUString > aImagesZipPaths( 3 );
     xHierAccess = getHierAccess( sProvider,  "org.openoffice.Office.Common" );
 
     OUString aPath( getKey( xHierAccess, "Path/Current/UserConfig" ) );
@@ -330,6 +330,19 @@
 
     aPath = OUString("$BRAND_BASE_DIR/share/config");
     rtl::Bootstrap::expandMacros(aPath);
+    aImagesZipPaths[ 2 ] = aPath;
+
+    // try also /usr/share and even before /usr/lib
+    ::rtl::OUString aDataDir = ::rtl::OUString::createFromAscii ( "/usr/share/" ); 
+#if defined(X86_64)
+    ::rtl::OUString aLibDir = ::rtl::OUString::createFromAscii ( "/usr/lib64/" ); 
+#else
+    ::rtl::OUString aLibDir = ::rtl::OUString::createFromAscii ( "/usr/lib/" ); 
+#endif
+    sal_Int32 nLibDirPos = aPath.indexOf( aLibDir ); 
+ 
+    if ( nLibDirPos >= 0 ) 
+        aPath = aPath.replaceAt( nLibDirPos, aLibDir.getLength(), aDataDir ); 
     aImagesZipPaths[ 1 ] = aPath;
 
     sal_Bool showBasic = getBooleanKey(xHierAccess,"Help/ShowBasic");