Update ooo320-m1
[ooovba.git] / applied_patches / 0361-split-icons-search-usr-share-and-optional-icons.diff
bloba7d9be9d1b58c2e47bd5a8c8a47487e5638c3759
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,13 +73,18 @@ private:
4 typedef std::hash_map<
5 rtl::OUString, std::pair< bool, BitmapEx >, rtl::OUStringHash > IconCache;
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 CheckStyleCache m_checkStyleCache;
14 IconCache m_iconCache;
16 void setStyle(rtl::OUString const & style);
18 + void addUrlToZips(const rtl::OUString &url);
19 void resetZips();
21 bool checkStyleCacheLookup(
22 --- vcl/source/gdi/impimagetree.cxx.old 2009-02-12 14:52:12.000000000 +0100
23 +++ vcl/source/gdi/impimagetree.cxx 2009-02-13 19:48:54.000000000 +0100
24 @@ -111,7 +111,15 @@ void loadFromStream(
28 -ImplImageTree::ImplImageTree() {}
29 +ImplImageTree::ImplImageTree()
31 + m_datadir = ::rtl::OUString::createFromAscii ( "/usr/share/" );
32 +#ifdef X86_64
33 + m_libdir = ::rtl::OUString::createFromAscii ( "/usr/lib64/" );
34 +#else
35 + m_libdir = ::rtl::OUString::createFromAscii ( "/usr/lib/" );
36 +#endif
39 ImplImageTree::~ImplImageTree() {}
41 @@ -182,6 +190,22 @@ void ImplImageTree::setStyle(rtl::OUStri
45 +void ImplImageTree::addUrlToZips(const rtl::OUString &url) {
46 + if ( url.getLength() == 0 )
47 + return;
48 + m_zips.push_back(
49 + std::make_pair(
50 + url,
51 + css::uno::Reference< css::container::XNameAccess >()));
52 + sal_Int32 nLibDirPos = url.indexOf( m_libdir );
53 + if ( nLibDirPos >= 0 ) {
54 + m_zips.push_back(
55 + std::make_pair(
56 + url.replaceAt( nLibDirPos, m_libdir.getLength(), m_datadir ),
57 + css::uno::Reference< css::container::XNameAccess >()));
58 + }
59 +}
61 void ImplImageTree::resetZips() {
62 m_zips.clear();
64 @@ -196,19 +220,14 @@ void ImplImageTree::resetZips() {
65 b.appendAscii(RTL_CONSTASCII_STRINGPARAM("_brand.zip"));
66 bool ok = u.Append(b.makeStringAndClear(), INetURLObject::ENCODE_ALL);
67 OSL_ASSERT(ok); (void) ok;
68 - m_zips.push_back(
69 - std::make_pair(
70 - u.GetMainURL(INetURLObject::NO_DECODE),
71 - css::uno::Reference< css::container::XNameAccess >()));
72 + addUrlToZips(u.GetMainURL(INetURLObject::NO_DECODE));
75 rtl::OUString url(
76 RTL_CONSTASCII_USTRINGPARAM(
77 "$BRAND_BASE_DIR/share/config/images_brand.zip"));
78 rtl::Bootstrap::expandMacros(url);
79 - m_zips.push_back(
80 - std::make_pair(
81 - url, css::uno::Reference< css::container::XNameAccess >()));
82 + addUrlToZips(url);
85 rtl::OUString url(
86 @@ -222,20 +241,15 @@ void ImplImageTree::resetZips() {
87 b.appendAscii(RTL_CONSTASCII_STRINGPARAM(".zip"));
88 bool ok = u.Append(b.makeStringAndClear(), INetURLObject::ENCODE_ALL);
89 OSL_ASSERT(ok); (void) ok;
90 - m_zips.push_back(
91 - std::make_pair(
92 - u.GetMainURL(INetURLObject::NO_DECODE),
93 - css::uno::Reference< css::container::XNameAccess >()));
94 + addUrlToZips(u.GetMainURL(INetURLObject::NO_DECODE));
96 if ( m_style.equals(::rtl::OUString::createFromAscii("default")) )
98 rtl::OUString url(
99 RTL_CONSTASCII_USTRINGPARAM(
100 "$OOO_BASE_DIR/share/config/images.zip"));
101 rtl::Bootstrap::expandMacros(url);
102 - m_zips.push_back(
103 - std::make_pair(
104 - url, css::uno::Reference< css::container::XNameAccess >()));
105 + addUrlToZips(url);
109 diff --git xmlhelp/source/cxxhelp/provider/provider.cxx xmlhelp/source/cxxhelp/provider/provider.cxx
110 index 6d8240e..d31fdc9 100644
111 --- xmlhelp/source/cxxhelp/provider/provider.cxx
112 +++ xmlhelp/source/cxxhelp/provider/provider.cxx
113 @@ -348,7 +348,7 @@ void ContentProvider::init()
114 setupextension );
115 rtl::OUString vendorshort = vendorname;
117 - uno::Sequence< rtl::OUString > aImagesZipPaths( 2 );
118 + uno::Sequence< rtl::OUString > aImagesZipPaths( 3 );
119 xHierAccess = getHierAccess( sProvider, "org.openoffice.Office.Common" );
121 rtl::OUString aPath( getKey( xHierAccess, "Path/Current/UserConfig" ) );
122 @@ -357,6 +357,19 @@ void ContentProvider::init()
124 aPath = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("$OOO_BASE_DIR/share/config"));
125 rtl::Bootstrap::expandMacros(aPath);
126 + aImagesZipPaths[ 2 ] = aPath;
128 + // try also /usr/share and even before /usr/lib
129 + ::rtl::OUString aDataDir = ::rtl::OUString::createFromAscii ( "/usr/share/" );
130 +#ifdef X86_64
131 + ::rtl::OUString aLibDir = ::rtl::OUString::createFromAscii ( "/usr/lib64/" );
132 +#else
133 + ::rtl::OUString aLibDir = ::rtl::OUString::createFromAscii ( "/usr/lib/" );
134 +#endif
135 + sal_Int32 nLibDirPos = aPath.indexOf( aLibDir );
137 + if ( nLibDirPos >= 0 )
138 + aPath = aPath.replaceAt( nLibDirPos, aLibDir.getLength(), aDataDir );
139 aImagesZipPaths[ 1 ] = aPath;
141 uno::Reference< uno::XComponentContext > xContext;