update dev300-m58
[ooovba.git] / applied_patches / 0222-split-icons-search-usr-share.diff
blobd3950cac50bf0088f58c0e9e6fc8af860122f6a2
1 --- vcl/inc/vcl/impimagetree.hxx.old 2009-02-13 19:31:58.000000000 +0100
2 +++ vcl/inc/vcl/impimagetree.hxx 2009-02-13 19:42:39.000000000 +0100
3 @@ -73,12 +73,17 @@ private:
4 typedef std::hash_map<
5 rtl::OUString, std::pair< bool, BitmapEx >, rtl::OUStringHash > Cache;
7 + // we want to search zip files (icons) also in /usr/share/
8 + ::rtl::OUString m_datadir; // /usr/share/
9 + ::rtl::OUString m_libdir; // /usr/lib or /usr/lib64
11 rtl::OUString m_style;
12 Zips m_zips;
13 Cache m_cache;
15 void setStyle(rtl::OUString const & style);
17 + void addUrlToZips(const rtl::OUString &url);
18 void resetZips();
20 bool cacheLookup(
21 --- vcl/source/gdi/impimagetree.cxx.old 2009-02-12 14:52:12.000000000 +0100
22 +++ vcl/source/gdi/impimagetree.cxx 2009-02-13 19:48:54.000000000 +0100
23 @@ -111,7 +111,15 @@ void loadFromStream(
27 -ImplImageTree::ImplImageTree() {}
28 +ImplImageTree::ImplImageTree()
30 + m_datadir = ::rtl::OUString::createFromAscii ( "/usr/share/" );
31 +#ifdef X86_64
32 + m_libdir = ::rtl::OUString::createFromAscii ( "/usr/lib64/" );
33 +#else
34 + m_libdir = ::rtl::OUString::createFromAscii ( "/usr/lib/" );
35 +#endif
38 ImplImageTree::~ImplImageTree() {}
40 @@ -182,6 +190,22 @@ void ImplImageTree::setStyle(rtl::OUStri
44 +void ImplImageTree::addUrlToZips(const rtl::OUString &url) {
45 + if ( url.getLength() == 0 )
46 + return;
47 + m_zips.push_back(
48 + std::make_pair(
49 + url,
50 + css::uno::Reference< css::container::XNameAccess >()));
51 + sal_Int32 nLibDirPos = url.indexOf( m_libdir );
52 + if ( nLibDirPos >= 0 ) {
53 + m_zips.push_back(
54 + std::make_pair(
55 + url.replaceAt( nLibDirPos, m_libdir.getLength(), m_datadir ),
56 + css::uno::Reference< css::container::XNameAccess >()));
57 + }
58 +}
60 void ImplImageTree::resetZips() {
61 m_zips.clear();
63 @@ -196,19 +220,14 @@ void ImplImageTree::resetZips() {
64 b.appendAscii(RTL_CONSTASCII_STRINGPARAM("_brand.zip"));
65 bool ok = u.Append(b.makeStringAndClear(), INetURLObject::ENCODE_ALL);
66 OSL_ASSERT(ok); (void) ok;
67 - m_zips.push_back(
68 - std::make_pair(
69 - u.GetMainURL(INetURLObject::NO_DECODE),
70 - css::uno::Reference< css::container::XNameAccess >()));
71 + addUrlToZips(u.GetMainURL(INetURLObject::NO_DECODE));
74 rtl::OUString url(
75 RTL_CONSTASCII_USTRINGPARAM(
76 "$BRAND_BASE_DIR/share/config/images_brand.zip"));
77 rtl::Bootstrap::expandMacros(url);
78 - m_zips.push_back(
79 - std::make_pair(
80 - url, css::uno::Reference< css::container::XNameAccess >()));
81 + addUrlToZips(url);
84 rtl::OUString url(
85 @@ -222,19 +241,14 @@ void ImplImageTree::resetZips() {
86 b.appendAscii(RTL_CONSTASCII_STRINGPARAM(".zip"));
87 bool ok = u.Append(b.makeStringAndClear(), INetURLObject::ENCODE_ALL);
88 OSL_ASSERT(ok); (void) ok;
89 - m_zips.push_back(
90 - std::make_pair(
91 - u.GetMainURL(INetURLObject::NO_DECODE),
92 - css::uno::Reference< css::container::XNameAccess >()));
93 + addUrlToZips(u.GetMainURL(INetURLObject::NO_DECODE));
96 rtl::OUString url(
97 RTL_CONSTASCII_USTRINGPARAM(
98 "$OOO_BASE_DIR/share/config/images.zip"));
99 rtl::Bootstrap::expandMacros(url);
100 - m_zips.push_back(
101 - std::make_pair(
102 - url, css::uno::Reference< css::container::XNameAccess >()));
103 + addUrlToZips(url);
107 diff --git xmlhelp/source/cxxhelp/provider/provider.cxx xmlhelp/source/cxxhelp/provider/provider.cxx
108 index 6d8240e..d31fdc9 100644
109 --- xmlhelp/source/cxxhelp/provider/provider.cxx
110 +++ xmlhelp/source/cxxhelp/provider/provider.cxx
111 @@ -348,7 +348,7 @@ void ContentProvider::init()
112 setupextension );
113 rtl::OUString vendorshort = vendorname;
115 - uno::Sequence< rtl::OUString > aImagesZipPaths( 2 );
116 + uno::Sequence< rtl::OUString > aImagesZipPaths( 3 );
117 xHierAccess = getHierAccess( sProvider, "org.openoffice.Office.Common" );
119 rtl::OUString aPath( getKey( xHierAccess, "Path/Current/UserConfig" ) );
120 @@ -357,6 +357,19 @@ void ContentProvider::init()
122 aPath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/share/config"));
123 rtl::Bootstrap::expandMacros(aPath);
124 + aImagesZipPaths[ 2 ] = aPath;
126 + // try also /usr/share and even before /usr/lib
127 + ::rtl::OUString aDataDir = ::rtl::OUString::createFromAscii ( "/usr/share/" );
128 +#ifdef X86_64
129 + ::rtl::OUString aLibDir = ::rtl::OUString::createFromAscii ( "/usr/lib64/" );
130 +#else
131 + ::rtl::OUString aLibDir = ::rtl::OUString::createFromAscii ( "/usr/lib/" );
132 +#endif
133 + sal_Int32 nLibDirPos = aPath.indexOf( aLibDir );
135 + if ( nLibDirPos >= 0 )
136 + aPath = aPath.replaceAt( nLibDirPos, aLibDir.getLength(), aDataDir );
137 aImagesZipPaths[ 1 ] = aPath;
139 uno::Reference< uno::XComponentContext > xContext;