Lines 89-94
Link Here
|
89 |
#ifndef _RTL_USTRBUF_HXX_ |
89 |
#ifndef _RTL_USTRBUF_HXX_ |
90 |
#include <rtl/ustrbuf.hxx> |
90 |
#include <rtl/ustrbuf.hxx> |
91 |
#endif |
91 |
#endif |
|
|
92 |
#ifndef INCLUDED_SVTOOLS_MISCOPT_HXX |
93 |
#include <svtools/miscopt.hxx> |
94 |
#endif |
92 |
#include "inputstream.hxx" |
95 |
#include "inputstream.hxx" |
93 |
#include <algorithm> |
96 |
#include <algorithm> |
94 |
|
97 |
|
Lines 102-108
using namespace com::sun::star::lang;
Link Here
|
102 |
|
105 |
|
103 |
|
106 |
|
104 |
Databases::Databases( const rtl::OUString& instPath, |
107 |
Databases::Databases( const rtl::OUString& instPath, |
105 |
const rtl::OUString& imageZip, |
108 |
const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths, |
106 |
const rtl::OUString& productName, |
109 |
const rtl::OUString& productName, |
107 |
const rtl::OUString& productVersion, |
110 |
const rtl::OUString& productVersion, |
108 |
const rtl::OUString& vendorName, |
111 |
const rtl::OUString& vendorName, |
Lines 116-127
Databases::Databases( const rtl::OUStrin
Link Here
|
116 |
m_nCustomCSSDocLength( 0 ), |
119 |
m_nCustomCSSDocLength( 0 ), |
117 |
m_pCustomCSSDoc( 0 ), |
120 |
m_pCustomCSSDoc( 0 ), |
118 |
m_aCSS(styleSheet.toAsciiLowerCase()), |
121 |
m_aCSS(styleSheet.toAsciiLowerCase()), |
119 |
m_aImagesZipFileURL(rtl::OUStringToOString( |
122 |
m_aImagesZipPaths( imagesZipPaths ), |
120 |
rtl::Uri::encode( |
123 |
m_aImagesZipFileURL(), |
121 |
imageZip, |
124 |
m_nSymbolsStyle( 0 ), |
122 |
rtl_UriCharClassPchar, |
|
|
123 |
rtl_UriEncodeIgnoreEscapes, |
124 |
RTL_TEXTENCODING_UTF8 ),RTL_TEXTENCODING_UTF8)), |
125 |
newProdName(rtl::OUString::createFromAscii( "$[officename]" ) ), |
125 |
newProdName(rtl::OUString::createFromAscii( "$[officename]" ) ), |
126 |
newProdVersion(rtl::OUString::createFromAscii( "$[officeversion]" ) ), |
126 |
newProdVersion(rtl::OUString::createFromAscii( "$[officeversion]" ) ), |
127 |
prodName( rtl::OUString::createFromAscii( "%PRODUCTNAME" ) ), |
127 |
prodName( rtl::OUString::createFromAscii( "%PRODUCTNAME" ) ), |
Lines 198-206
Databases::~Databases()
Link Here
|
198 |
|
197 |
|
199 |
} |
198 |
} |
200 |
|
199 |
|
|
|
200 |
static bool impl_getZipFile( |
201 |
Sequence< rtl::OUString > & rImagesZipPaths, |
202 |
const rtl::OUString & rZipName, |
203 |
rtl::OUString & rFileName ) |
204 |
{ |
205 |
const rtl::OUString *pPathArray = rImagesZipPaths.getArray(); |
206 |
for ( int i = 0; i < rImagesZipPaths.getLength(); ++i ) |
207 |
{ |
208 |
rFileName = pPathArray[ i ]; |
209 |
if ( rFileName.getLength() ) |
210 |
{ |
211 |
if ( 1 + rFileName.lastIndexOf( '/' ) != rFileName.getLength() ) |
212 |
{ |
213 |
rFileName += rtl::OUString::createFromAscii( "/" ); |
214 |
} |
215 |
rFileName += rZipName; |
216 |
|
217 |
// test existence |
218 |
osl::DirectoryItem aDirItem; |
219 |
if ( osl::DirectoryItem::get( rFileName, aDirItem ) == osl::FileBase::E_None ) |
220 |
return true; |
221 |
} |
222 |
} |
223 |
} |
201 |
|
224 |
|
202 |
rtl::OString Databases::getImagesZipFileURL() |
225 |
rtl::OString Databases::getImagesZipFileURL() |
203 |
{ |
226 |
{ |
|
|
227 |
sal_Int16 nSymbolsStyle = SvtMiscOptions().GetCurrentSymbolsStyle(); |
228 |
if ( !m_aImagesZipFileURL.getLength() || ( m_nSymbolsStyle != nSymbolsStyle ) ) |
229 |
{ |
230 |
m_nSymbolsStyle = nSymbolsStyle; |
231 |
|
232 |
rtl::OUString aImageZip; |
233 |
rtl::OUString aSymbolsStyleName = SvtMiscOptions().GetCurrentSymbolsStyleName(); |
234 |
bool bFound = false; |
235 |
|
236 |
if ( aSymbolsStyleName.getLength() != 0 ) |
237 |
{ |
238 |
rtl::OUString aZipName = rtl::OUString::createFromAscii( "images_" ); |
239 |
aZipName += aSymbolsStyleName; |
240 |
aZipName += rtl::OUString::createFromAscii( ".zip" ); |
241 |
|
242 |
bFound = impl_getZipFile( m_aImagesZipPaths, aZipName, aImageZip ); |
243 |
} |
244 |
|
245 |
if ( ! bFound ) |
246 |
bFound = impl_getZipFile( m_aImagesZipPaths, rtl::OUString::createFromAscii( "images.zip" ), aImageZip ); |
247 |
|
248 |
if ( ! bFound ) |
249 |
aImageZip = rtl::OUString(); |
250 |
|
251 |
m_aImagesZipFileURL = rtl::OUStringToOString( |
252 |
rtl::Uri::encode( |
253 |
aImageZip, |
254 |
rtl_UriCharClassPchar, |
255 |
rtl_UriEncodeIgnoreEscapes, |
256 |
RTL_TEXTENCODING_UTF8 ), RTL_TEXTENCODING_UTF8 ); |
257 |
} |
258 |
|
204 |
return m_aImagesZipFileURL; |
259 |
return m_aImagesZipFileURL; |
205 |
} |
260 |
} |
206 |
|
261 |
|