View | Details | Raw Unified | Return to issue 36518
Collapse All | Expand All

(-)xmlhelp/inc/provider/databases.hxx (-1 / +3 lines)
Lines 233-239 namespace chelp { Link Here
233
		 */
233
		 */
234
234
235
		Databases( const rtl::OUString& instPath,
235
		Databases( const rtl::OUString& instPath,
236
                   const rtl::OUString& imageZip,
236
                   const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
237
                   const rtl::OUString& productName,
237
                   const rtl::OUString& productName,
238
				   const rtl::OUString& productVersion,
238
				   const rtl::OUString& productVersion,
239
				   const rtl::OUString& vendorName,
239
				   const rtl::OUString& vendorName,
Lines 386-392 namespace chelp { Link Here
386
            prodName,prodVersion,vendName,vendVersion,vendShort;
386
            prodName,prodVersion,vendName,vendVersion,vendShort;
387
		
387
		
388
		rtl::OUString          m_aInstallDirectory;                // Installation directory
388
		rtl::OUString          m_aInstallDirectory;                // Installation directory
389
		com::sun::star::uno::Sequence< rtl::OUString > m_aImagesZipPaths;
389
        rtl::OString           m_aImagesZipFileURL;
390
        rtl::OString           m_aImagesZipFileURL;
391
		sal_Int16              m_nSymbolsStyle;
390
		rtl::OUString          m_aInstallDirectoryWithoutEncoding; // a work around for a Sablot bug.
392
		rtl::OUString          m_aInstallDirectoryWithoutEncoding; // a work around for a Sablot bug.
391
		rtl::OUString          m_aInstallDirectoryAsSystemPath;    // Installation directory
393
		rtl::OUString          m_aInstallDirectoryAsSystemPath;    // Installation directory
392
		
394
		
(-)xmlhelp/source/cxxhelp/provider/databases.cxx (-7 / +63 lines)
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
(-)xmlhelp/source/cxxhelp/provider/provider.cxx (-23 / +10 lines)
Lines 396-428 void ContentProvider::init() Link Here
396
	rtl::OUString vendorshort = vendorname;
396
	rtl::OUString vendorshort = vendorname;
397
397
398
	
398
	
399
    bool found = false;
399
    Sequence< rtl::OUString > aImagesZipPaths( 2 );
400
    xHierAccess = getHierAccess( sProvider,
400
    xHierAccess = getHierAccess( sProvider,
401
								 "org.openoffice.Office.Common" );
401
								 "org.openoffice.Office.Common" );
402
    rtl::OUString imageZip(getKey(xHierAccess,"Path/Current/UserConfig"));
402
	
403
    subst(imageZip);
403
    rtl::OUString aPath( getKey( xHierAccess, "Path/Current/UserConfig" ) );
404
    if(imageZip.getLength()) {
404
    subst( aPath );
405
        // test existence
405
    aImagesZipPaths[ 0 ] = aPath;
406
        if(1+imageZip.lastIndexOf('/') == imageZip.getLength())
406
407
            imageZip += rtl::OUString::createFromAscii("images.zip");
407
    aPath = getKey( xHierAccess, "Path/Current/Config" );
408
        else
408
    subst( aPath );
409
            imageZip += rtl::OUString::createFromAscii("/images.zip");
409
    aImagesZipPaths[ 1 ] = aPath;
410
        osl::DirectoryItem aDirItem;
411
        if(osl::DirectoryItem::get(imageZip,aDirItem) == osl::FileBase::E_None)
412
            found = true;
413
    }
414
    
415
    if(!found) {
416
        imageZip = getKey(xHierAccess,"Path/Current/Config");
417
        subst(imageZip);
418
        if(1+imageZip.lastIndexOf('/') == imageZip.getLength())
419
            imageZip += rtl::OUString::createFromAscii("images.zip");
420
        else
421
            imageZip += rtl::OUString::createFromAscii("/images.zip");        
422
    }
423
	
410
	
424
    m_pDatabases = new Databases( instPath,
411
    m_pDatabases = new Databases( instPath,
425
                                  imageZip,
412
                                  aImagesZipPaths,
426
                                  productname,
413
                                  productname,
427
								  productversion,
414
								  productversion,
428
								  vendorname,
415
								  vendorname,
(-)xmlhelp/util/makefile.mk (+1 lines)
Lines 105-110 SHL1STDLIBS= \ Link Here
105
	$(SABLOT3RDLIB)          \
105
	$(SABLOT3RDLIB)          \
106
	$(EXPATASCII3RDLIB)      \
106
	$(EXPATASCII3RDLIB)      \
107
	$(UCBHELPERLIB)          \
107
	$(UCBHELPERLIB)          \
108
	$(SVTOOLLIB)             \
108
	$(BERKELEYLIB)
109
	$(BERKELEYLIB)
109
#	$(BERKELEYCPPLIB)
110
#	$(BERKELEYCPPLIB)
110
111

Return to issue 36518