Files
libreoffice/xmlhelp/source/cxxhelp/provider/urlparameter.cxx

1153 lines
33 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
2001-05-16 13:53:27 +00:00
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
2001-05-16 13:53:27 +00:00
*
* This file incorporates work covered by the following license notice:
2001-05-16 13:53:27 +00:00
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2001-05-16 13:53:27 +00:00
#include "bufferedinputstream.hxx"
2002-03-28 11:38:08 +00:00
#include <string.h>
2010-10-10 19:46:48 -05:00
#include <osl/diagnose.hxx>
#include <osl/thread.h>
2001-05-23 13:15:56 +00:00
#include <osl/file.hxx>
2001-05-22 13:57:13 +00:00
#include <cppuhelper/weak.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <comphelper/processfactory.hxx>
#include <rtl/uri.hxx>
#include <rtl/ustrbuf.hxx>
#include <libxslt/xslt.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
#include "db.hxx"
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <com/sun/star/io/XInputStream.hpp>
2001-05-22 13:57:13 +00:00
#include <com/sun/star/io/XSeekable.hpp>
#include <com/sun/star/ucb/OpenCommandArgument2.hpp>
2001-05-23 13:15:56 +00:00
#include <com/sun/star/ucb/OpenMode.hpp>
#include <com/sun/star/ucb/XCommandProcessor.hpp>
2001-05-23 13:15:56 +00:00
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
#include <com/sun/star/ucb/XContentIdentifier.hpp>
#include <com/sun/star/ucb/XContentProvider.hpp>
#include <com/sun/star/ucb/XContentIdentifierFactory.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
2001-05-16 06:36:23 +00:00
#include "urlparameter.hxx"
#include "databases.hxx"
2001-05-16 06:36:23 +00:00
namespace chelp {
inline bool ascii_isDigit( sal_Unicode ch )
{
return ((ch >= 0x0030) && (ch <= 0x0039));
}
inline bool ascii_isLetter( sal_Unicode ch )
{
return ( ( (ch >= 0x0041) && (ch <= 0x005A) ) ||
( (ch >= 0x0061) && (ch <= 0x007A) ) );
2001-05-16 06:36:23 +00:00
}
inline bool isLetterOrDigit( sal_Unicode ch )
{
return ascii_isLetter( ch ) || ascii_isDigit( ch );
}
}
2001-05-22 13:57:13 +00:00
using namespace cppu;
using namespace com::sun::star::io;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
using namespace com::sun::star::beans;
using namespace com::sun::star::container;
2001-05-16 06:36:23 +00:00
using namespace chelp;
URLParameter::URLParameter( const OUString& aURL,
Databases* pDatabases )
throw( com::sun::star::ucb::IllegalIdentifierException )
: m_pDatabases( pDatabases ),
m_aURL( aURL )
2001-05-16 06:36:23 +00:00
{
init( false );
parse();
}
bool URLParameter::isErrorDocument()
{
bool bErrorDoc = false;
if( isFile() )
{
Reference< XHierarchicalNameAccess > xNA =
m_pDatabases->findJarFileForPath( get_jar(), get_language(), get_path() );
bErrorDoc = !xNA.is();
}
return bErrorDoc;
}
OString URLParameter::getByName( const char* par )
2001-06-13 08:10:13 +00:00
{
OUString val;
2001-06-13 08:10:13 +00:00
if( strcmp( par,"Program" ) == 0 )
val = get_program();
else if( strcmp( par,"Database" ) == 0 )
val = get_module();
else if( strcmp( par,"DatabasePar" ) == 0 )
val = get_dbpar();
2001-06-13 08:10:13 +00:00
else if( strcmp( par,"Id" ) == 0 )
val = get_id();
else if( strcmp( par,"Path" ) == 0 )
val = get_path();
else if( strcmp( par,"Language" ) == 0 )
val = get_language();
else if( strcmp( par,"System" ) == 0 )
val = get_system();
else if( strcmp( par,"HelpPrefix" ) == 0 )
val = get_prefix();
2001-06-13 08:10:13 +00:00
return OString( val.getStr(),val.getLength(),RTL_TEXTENCODING_UTF8 );
2001-06-13 08:10:13 +00:00
}
OUString URLParameter::get_id()
2001-05-16 06:36:23 +00:00
{
if( m_aId.compareToAscii("start") == 0 )
2001-05-16 06:36:23 +00:00
{ // module is set
StaticModuleInformation* inf =
m_pDatabases->getStaticInformationForModule( get_module(),
get_language() );
2001-05-16 06:36:23 +00:00
if( inf )
m_aId = inf->get_id();
m_bStart = true;
}
return m_aId;
}
OUString URLParameter::get_tag()
2001-05-16 06:36:23 +00:00
{
if( isFile() )
return get_the_tag();
else
return m_aTag;
}
OUString URLParameter::get_title()
2001-05-16 06:36:23 +00:00
{
if( isFile() )
return get_the_title();
else if( m_aModule.compareToAscii("") != 0 )
{
StaticModuleInformation* inf =
m_pDatabases->getStaticInformationForModule( get_module(),
get_language() );
2001-05-16 06:36:23 +00:00
if( inf )
m_aTitle = inf->get_title();
}
else // This must be the root
m_aTitle = OUString("root");
2001-05-16 06:36:23 +00:00
return m_aTitle;
}
OUString URLParameter::get_language()
2001-05-16 06:36:23 +00:00
{
if( m_aLanguage.isEmpty() )
2001-05-16 13:53:27 +00:00
return m_aDefaultLanguage;
2001-05-16 06:36:23 +00:00
return m_aLanguage;
}
OUString URLParameter::get_program()
2001-05-16 06:36:23 +00:00
{
if( m_aProgram.isEmpty() )
2001-05-16 06:36:23 +00:00
{
StaticModuleInformation* inf =
m_pDatabases->getStaticInformationForModule( get_module(),
get_language() );
2001-05-16 06:36:23 +00:00
if( inf )
m_aProgram = inf->get_program();
}
return m_aProgram;
}
void URLParameter::init( bool bDefaultLanguageIsInitialized )
{
(void)bDefaultLanguageIsInitialized;
m_bHelpDataFileRead = false;
2001-05-16 06:36:23 +00:00
m_bStart = false;
m_bUseDB = true;
2001-05-17 08:58:55 +00:00
m_nHitCount = 100; // The default maximum hitcount
2001-05-16 06:36:23 +00:00
}
OUString URLParameter::get_the_tag()
2001-05-16 06:36:23 +00:00
{
if(m_bUseDB) {
if( ! m_bHelpDataFileRead )
readHelpDataFile();
2001-05-16 06:36:23 +00:00
m_bHelpDataFileRead = true;
2001-05-16 06:36:23 +00:00
return m_aTag;
}
else
return OUString();
2001-05-16 06:36:23 +00:00
}
OUString URLParameter::get_the_path()
2001-05-16 06:36:23 +00:00
{
if(m_bUseDB) {
if( ! m_bHelpDataFileRead )
readHelpDataFile();
m_bHelpDataFileRead = true;
2001-05-16 06:36:23 +00:00
return m_aPath;
}
else
return get_id();
2001-05-16 06:36:23 +00:00
}
OUString URLParameter::get_the_title()
2001-05-16 06:36:23 +00:00
{
if(m_bUseDB) {
if( ! m_bHelpDataFileRead )
readHelpDataFile();
m_bHelpDataFileRead = true;
2001-05-16 06:36:23 +00:00
return m_aTitle;
}
else
return OUString();
2001-05-16 06:36:23 +00:00
}
OUString URLParameter::get_the_jar()
2001-05-16 06:36:23 +00:00
{
if(m_bUseDB) {
if( ! m_bHelpDataFileRead )
readHelpDataFile();
m_bHelpDataFileRead = true;
2001-05-16 06:36:23 +00:00
return m_aJar;
}
else
return get_module() + OUString(".jar");
2001-05-16 06:36:23 +00:00
}
void URLParameter::readHelpDataFile()
2001-05-16 13:53:27 +00:00
{
if( get_id().compareToAscii("") == 0 )
return;
OUString aModule = get_module();
OUString aLanguage = get_language();
DataBaseIterator aDbIt( *m_pDatabases, aModule, aLanguage, false );
bool bSuccess = false;
const sal_Char* pData = NULL;
helpdatafileproxy::HDFData aHDFData;
OUString aExtensionPath;
OUString aExtensionRegistryPath;
while( true )
{
helpdatafileproxy::Hdf* pHdf = aDbIt.nextHdf( &aExtensionPath, &aExtensionRegistryPath );
if( !pHdf )
break;
OString keyStr( m_aId.getStr(),m_aId.getLength(),RTL_TEXTENCODING_UTF8 );
bSuccess = pHdf->getValueForKey( keyStr, aHDFData );
if( bSuccess )
{
pData = aHDFData.getData();
break;
}
}
if( bSuccess )
{
DbtToStringConverter converter( pData );
m_aTitle = converter.getTitle();
m_pDatabases->replaceName( m_aTitle );
m_aPath = converter.getFile();
m_aJar = converter.getDatabase();
if( !aExtensionPath.isEmpty() )
{
m_aJar = "?" + aExtensionPath + "?" + m_aJar;
m_aExtensionRegistryPath = aExtensionRegistryPath;
}
m_aTag = converter.getHash();
}
2001-05-16 06:36:23 +00:00
}
2001-05-22 13:57:13 +00:00
// Class encapsulating the transformation of the XInputStream to XHTML
class InputStreamTransformer
: public OWeakObject,
public XInputStream,
public XSeekable
{
public:
2001-06-13 08:10:13 +00:00
InputStreamTransformer( URLParameter* urlParam,
Databases* pDatatabases,
bool isRoot = false );
2001-05-23 13:15:56 +00:00
2001-05-22 13:57:13 +00:00
~InputStreamTransformer();
virtual Any SAL_CALL queryInterface( const Type& rType ) throw( RuntimeException );
2001-10-24 10:17:19 +00:00
virtual void SAL_CALL acquire( void ) throw();
virtual void SAL_CALL release( void ) throw();
2001-05-22 13:57:13 +00:00
2001-05-23 13:15:56 +00:00
virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData,sal_Int32 nBytesToRead )
throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException);
2001-05-22 13:57:13 +00:00
2001-05-23 13:15:56 +00:00
virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >& aData,sal_Int32 nMaxBytesToRead )
throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException);
2001-05-22 13:57:13 +00:00
virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException );
virtual sal_Int32 SAL_CALL available( void ) throw( NotConnectedException,
IOException,
RuntimeException );
virtual void SAL_CALL closeInput( void ) throw( NotConnectedException,
IOException,
RuntimeException );
virtual void SAL_CALL seek( sal_Int64 location ) throw( IllegalArgumentException,
IOException,
RuntimeException );
virtual sal_Int64 SAL_CALL getPosition( void ) throw( IOException,RuntimeException );
virtual sal_Int64 SAL_CALL getLength( void ) throw( IOException,RuntimeException );
2001-05-23 13:15:56 +00:00
void addToBuffer( const char* buffer,int len );
sal_Int8* getData() const { return (sal_Int8*) buffer; }
sal_Int32 getLen() const { return sal_Int32( len ); }
2001-05-22 13:57:13 +00:00
private:
osl::Mutex m_aMutex;
2001-05-23 13:15:56 +00:00
int len,pos;
char *buffer;
2001-05-22 13:57:13 +00:00
};
void URLParameter::open( const Command& aCommand,
sal_Int32 CommandId,
const Reference< XCommandEnvironment >& Environment,
const Reference< XOutputStream >& xDataSink )
{
(void)aCommand;
(void)CommandId;
(void)Environment;
if( ! xDataSink.is() )
return;
if( isPicture() )
{
Reference< XInputStream > xStream;
Reference< XHierarchicalNameAccess > xNA =
m_pDatabases->jarFile( OUString( "picture.jar" ),
get_language() );
OUString path = get_path();
if( xNA.is() )
{
try
{
Any aEntry = xNA->getByHierarchicalName( path );
Reference< XActiveDataSink > xSink;
if( ( aEntry >>= xSink ) && xSink.is() )
xStream = xSink->getInputStream();
}
catch ( NoSuchElementException & )
{
}
}
if( xStream.is() )
{
sal_Int32 ret;
Sequence< sal_Int8 > aSeq( 4096 );
while( true )
{
try
{
ret = xStream->readBytes( aSeq,4096 );
xDataSink->writeBytes( aSeq );
if( ret < 4096 )
break;
}
catch( const Exception& )
{
break;
}
}
}
}
else
{
// a standard document or else an active help text, plug in the new input stream
InputStreamTransformer* p = new InputStreamTransformer( this,m_pDatabases,isRoot() );
try
{
xDataSink->writeBytes( Sequence< sal_Int8 >( p->getData(),p->getLen() ) );
}
catch( const Exception& )
{
}
delete p;
}
xDataSink->closeOutput();
}
2001-05-22 13:57:13 +00:00
void URLParameter::open( const Command& aCommand,
sal_Int32 CommandId,
2001-05-22 13:57:13 +00:00
const Reference< XCommandEnvironment >& Environment,
const Reference< XActiveDataSink >& xDataSink )
{
(void)aCommand;
(void)CommandId;
(void)Environment;
if( isPicture() )
{
Reference< XInputStream > xStream;
Reference< XHierarchicalNameAccess > xNA =
m_pDatabases->jarFile( OUString( "picture.jar" ),
get_language() );
2001-05-25 12:46:25 +00:00
OUString path = get_path();
if( xNA.is() )
{
try
{
Any aEntry = xNA->getByHierarchicalName( path );
Reference< XActiveDataSink > xSink;
if( ( aEntry >>= xSink ) && xSink.is() )
xStream = xSink->getInputStream();
}
catch ( NoSuchElementException & )
{
}
2001-05-29 14:14:49 +00:00
}
2002-03-28 11:38:08 +00:00
xDataSink->setInputStream( turnToSeekable(xStream) );
}
else
2001-06-13 08:10:13 +00:00
// a standard document or else an active help text, plug in the new input stream
xDataSink->setInputStream( new InputStreamTransformer( this,m_pDatabases,isRoot() ) );
}
2001-05-16 06:36:23 +00:00
void URLParameter::parse() throw( com::sun::star::ucb::IllegalIdentifierException )
{
m_aExpr = m_aURL;
sal_Int32 lstIdx = m_aExpr.lastIndexOf( sal_Unicode( '#' ) );
if( lstIdx != -1 )
m_aExpr = m_aExpr.copy( 0,lstIdx );
if( ! scheme() ||
! name( module() ) ||
! query() ||
m_aLanguage.isEmpty() ||
m_aSystem.isEmpty() )
2001-05-16 06:36:23 +00:00
throw com::sun::star::ucb::IllegalIdentifierException();
}
bool URLParameter::scheme()
{
// Correct extension help links as sometimes the
// module is missing resulting in a misformed URL
if( m_aExpr.startsWith("vnd.sun.star.help:///") )
2001-05-16 06:36:23 +00:00
{
sal_Int32 nLen = m_aExpr.getLength();
OUString aLastStr =
m_aExpr.copy(sal::static_int_cast<sal_uInt32>(nLen) - 6);
if( aLastStr.compareToAscii( "DbPAR=" ) == 0 )
{
OUString aNewExpr = m_aExpr.copy( 0, 20 );
OUString aSharedStr("shared");
aNewExpr += aSharedStr;
aNewExpr += m_aExpr.copy( 20 );
aNewExpr += aSharedStr;
m_aExpr = aNewExpr;
}
2001-05-16 06:36:23 +00:00
}
for( sal_Int32 nPrefixLen = 20 ; nPrefixLen >= 18 ; --nPrefixLen )
2001-05-16 06:36:23 +00:00
{
if( m_aExpr.matchAsciiL( "vnd.sun.star.help://", nPrefixLen ) )
{
m_aExpr = m_aExpr.copy( nPrefixLen );
return true;
}
2001-05-16 06:36:23 +00:00
}
return false;
2001-05-16 06:36:23 +00:00
}
bool URLParameter::module()
{
sal_Int32 idx = 0,length = m_aExpr.getLength();
while( idx < length && isLetterOrDigit( (m_aExpr.getStr())[idx] ) )
++idx;
if( idx != 0 )
{
m_aModule = m_aExpr.copy( 0,idx );
m_aExpr = m_aExpr.copy( idx );
return true;
}
else
return false;
}
bool URLParameter::name( bool modulePresent )
{
// if modulepresent, a name may be present, but must not
sal_Int32 length = m_aExpr.getLength();
if( length != 0 && (m_aExpr.getStr())[0] == sal_Unicode( '/' ) )
{
sal_Int32 idx = 1;
while( idx < length && (m_aExpr.getStr())[idx] != '?' )
2001-05-16 06:36:23 +00:00
++idx;
if( idx != 1 && ! modulePresent )
return false;
else
{
2001-05-17 08:58:55 +00:00
m_aId = m_aExpr.copy( 1,idx-1 );
2001-05-16 06:36:23 +00:00
m_aExpr = m_aExpr.copy( idx );
}
}
return true;
}
bool URLParameter::query()
{
OUString query_;
2001-05-16 06:36:23 +00:00
if( m_aExpr.isEmpty() )
2001-05-16 06:36:23 +00:00
return true;
else if( (m_aExpr.getStr())[0] == sal_Unicode( '?' ) )
query_ = m_aExpr.copy( 1 ).trim();
2001-05-16 06:36:23 +00:00
else
return false;
bool ret = true;
sal_Int32 delimIdx,equalIdx;
OUString parameter,value;
2001-05-16 06:36:23 +00:00
while( !query_.isEmpty() )
2001-05-16 06:36:23 +00:00
{
delimIdx = query_.indexOf( sal_Unicode( '&' ) );
equalIdx = query_.indexOf( sal_Unicode( '=' ) );
parameter = query_.copy( 0,equalIdx ).trim();
2001-05-16 06:36:23 +00:00
if( delimIdx == -1 )
{
value = query_.copy( equalIdx + 1 ).trim();
query_ = OUString();
2001-05-16 06:36:23 +00:00
}
else
{
value = query_.copy( equalIdx+1,delimIdx - equalIdx - 1 ).trim();
query_ = query_.copy( delimIdx+1 ).trim();
2001-05-16 06:36:23 +00:00
}
if( parameter.compareToAscii( "Language" ) == 0 )
m_aLanguage = value;
else if( parameter.compareToAscii( "Device" ) == 0 )
m_aDevice = value;
else if( parameter.compareToAscii( "Program" ) == 0 )
m_aProgram = value;
else if( parameter.compareToAscii( "Eid" ) == 0 )
m_aEid = value;
else if( parameter.compareToAscii( "UseDB" ) == 0 )
m_bUseDB = ! ( value.compareToAscii("no") == 0 );
else if( parameter.compareToAscii( "DbPAR" ) == 0 )
m_aDbPar = value;
2001-05-16 06:36:23 +00:00
else if( parameter.compareToAscii( "Query" ) == 0 )
{
if( m_aQuery.isEmpty() )
2001-05-16 06:36:23 +00:00
m_aQuery = value;
else
m_aQuery += ( OUString( " " ) + value );
2001-05-16 06:36:23 +00:00
}
else if( parameter.compareToAscii( "Scope" ) == 0 )
m_aScope = value;
else if( parameter.compareToAscii( "System" ) == 0 )
m_aSystem = value;
else if( parameter.compareToAscii( "HelpPrefix" ) == 0 )
m_aPrefix = rtl::Uri::decode(
value,
rtl_UriDecodeWithCharset,
RTL_TEXTENCODING_UTF8 );
2001-05-16 06:36:23 +00:00
else if( parameter.compareToAscii( "HitCount" ) == 0 )
m_nHitCount = value.toInt32();
else if( parameter.compareToAscii( "Active" ) == 0 )
m_aActive = value;
else if( parameter.compareToAscii( "Version" ) == 0 )
; // ignored (but accepted) in the build-in help, useful only for the online help
2001-05-16 06:36:23 +00:00
else
ret = false;
}
return ret;
}
2001-05-22 13:57:13 +00:00
2001-05-23 13:15:56 +00:00
struct UserData {
2001-06-13 08:10:13 +00:00
UserData( InputStreamTransformer* pTransformer,
URLParameter* pInitial,
Databases* pDatabases )
2001-06-13 08:10:13 +00:00
: m_pTransformer( pTransformer ),
m_pDatabases( pDatabases ),
m_pInitial( pInitial )
{
}
InputStreamTransformer* m_pTransformer;
Databases* m_pDatabases;
URLParameter* m_pInitial;
2001-05-23 13:15:56 +00:00
};
2001-05-22 13:57:13 +00:00
UserData *ugblData = 0;
extern "C" {
static int
fileMatch(const char * URI) {
if ((URI != NULL) && !strncmp(URI, "file:/", 6))
return 1;
return 0;
}
static int
CWS-TOOLING: integrate CWS encsig09 2009-09-14 15:11:29 +0200 oc r276125 : #i105049# MacroSignatur needs Macro 2009-09-09 17:09:46 +0200 jl r276005 : #i103989# could not signe encrypted doc containing a formular object 2009-09-09 13:11:24 +0200 jl r275985 : #i103989# could not signe encrypted doc containing a formular object 2009-09-08 15:54:02 +0200 mav r275934 : #i103906# fix the automation test scenario ( tempfile should be writable for the user ) 2009-09-07 14:01:39 +0200 mav r275895 : #i103906# fix the problem with reload 2009-09-07 09:34:48 +0200 mav r275871 : #i104786# do the ODF version check only for ODF documents 2009-09-07 08:19:06 +0200 mav r275870 : #i104389# fix text 2009-09-06 22:24:21 +0200 mav r275867 : #i104786# check the consistency of ODF version 2009-09-06 22:23:24 +0200 mav r275866 : #i104786# check the consistency of ODF version 2009-09-06 22:23:00 +0200 mav r275865 : #i104786# check the consistency of ODF version 2009-09-06 22:22:36 +0200 mav r275864 : #i104786# check the consistency of ODF version 2009-09-06 22:22:03 +0200 mav r275863 : #i104786# check the consistency of ODF version 2009-09-02 17:09:30 +0200 mav r275722 : #i104715# let repairing mechanics use the streams correctly 2009-09-01 16:52:49 +0200 mav r275670 : #i104389# notify user not to trust the corrupted document 2009-09-01 16:31:37 +0200 mav r275668 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:30:32 +0200 mav r275667 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:22:13 +0200 jl r275666 : #i104339# small content change 2009-09-01 14:20:42 +0200 jl r275660 : #i103519# remove some debug output 2009-09-01 13:51:52 +0200 jl r275659 : #i103519# NSS uses '\' for escaping in distinguished names 2009-09-01 12:49:47 +0200 mav r275655 : #i104389# use zip-mode to read from jar files 2009-09-01 12:40:22 +0200 mav r275653 : #i104389# use zip-mode to read from jar files 2009-09-01 12:32:29 +0200 mav r275652 : #i104389# use constants 2009-08-31 21:58:00 +0200 mav r275637 : #i10000# fix warning 2009-08-31 21:11:17 +0200 mav r275636 : #i104227# adding of scripting signature removes the document signature 2009-08-31 20:55:05 +0200 mav r275635 : #i103905# ZipStorage supports Compressed property 2009-08-31 20:53:55 +0200 mav r275634 : #i103905# adjust macro signature transfer to usage of ZipStorage 2009-08-31 15:30:49 +0200 jl r275609 : #i103989# warning is shown as long the user does not click 'OK' 2009-08-31 14:36:10 +0200 jl r275608 : #i103989# changed warning text when signing macro and there is a document signature. This warning is only displayed once 2009-08-31 13:34:41 +0200 mav r275603 : #i104452# disable macros in repaired documents 2009-08-31 13:33:42 +0200 mav r275602 : #i104452# disable macros in repaired documents 2009-08-31 13:03:56 +0200 jl r275600 : #i45212# signature dialog could not be started when using read-only documents 2009-08-31 09:26:13 +0200 mav r275583 : #i104578# store the additional entry as the last one to workaround parsing problem in OOo3.1 and later 2009-08-30 20:54:25 +0200 mav r275562 : #i10000# adopt for unix 2009-08-30 10:56:00 +0200 mav r275561 : CWS-TOOLING: rebase CWS encsig09 to trunk@275331 (milestone: DEV300:m56) 2009-08-28 16:34:00 +0200 mav r275539 : #i104578# write necessary info in manifest.xml for ODF1.2 encrypted document 2009-08-28 14:04:22 +0200 mav r275533 : #104587# fix handling of readonly streams 2009-08-28 13:58:10 +0200 mav r275531 : #i104389# fix the broken document handling 2009-08-28 11:40:39 +0200 mav r275522 : #i104389# fix the signature streams check 2009-08-27 21:48:12 +0200 mav r275509 : #i103927# show the warning 2009-08-27 21:47:48 +0200 mav r275508 : #i103927# show the warning 2009-08-27 16:45:59 +0200 jl r275495 : #i45212# remove unused variable 2009-08-27 16:34:00 +0200 jl r275494 : #i103989# 2009-08-27 13:54:28 +0200 jl r275482 : #i103519# fixed replacement of 'S' by 'ST' 2009-08-27 12:32:21 +0200 mav r275472 : #i10000# fix warning 2009-08-27 11:58:11 +0200 mav r275467 : #i104389# handle the entry path correctly 2009-08-26 17:18:35 +0200 jl r275438 : #i103519# subject and issuer distinguished names were not properly displayed. The strings were obtained by system functions (Windows, NSS), which use quotes to escape the values, when they contain special characters 2009-08-26 11:00:20 +0200 mav r275403 : #i10000# fix warnings 2009-08-26 08:25:45 +0200 mav r275392 : #i10000# fix warning 2009-08-26 08:02:22 +0200 mav r275391 : #i10000# adopt for linux 2009-08-26 07:40:30 +0200 mav r275390 : #i10000# fix warning 2009-08-26 07:35:28 +0200 mav r275389 : #i10000# use correct include file name 2009-08-25 15:01:41 +0200 jl r275356 : #i103989# better check for mimetype of streams 2009-08-25 09:07:09 +0200 mav r275335 : CWS-TOOLING: rebase CWS encsig09 to trunk@274622 (milestone: DEV300:m54) 2009-08-24 18:17:02 +0200 mav r275329 : #i103927# check the nonencrypted streams 2009-08-24 18:14:14 +0200 mav r275328 : #i103927# check the nonencrypted streams 2009-08-24 17:59:34 +0200 mav r275327 : #i103927#,#i104389# check the package consistency and nonencrypted streams 2009-08-24 16:18:28 +0200 jl r275323 : #i103989# added comment 2009-08-24 13:08:47 +0200 jl r275305 : #i45212# #i66276# only write the X509Certificate element once and allow to add remove several certificates at a time 2009-08-21 12:57:28 +0200 ufi r275239 : 104339 2009-08-21 08:39:05 +0200 jl r275213 : #i10398# comparing URIs of signed files with the 'element list' 2009-08-20 13:39:47 +0200 jl r275178 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:35:39 +0200 jl r275177 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:29:06 +0200 jl r275176 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:26:21 +0200 jl r275175 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 12:05:09 +0200 ufi r275170 : i104339 2009-08-19 12:24:54 +0200 jl r275146 : #i10398# displaying 'old signature' icon and status in signature dialog 2009-08-18 15:18:48 +0200 jl r275111 : #i103989# document signatures containing manifest.xml are now validated according to the final ODF1.2 spec 2009-08-18 11:41:06 +0200 mav r275087 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-18 11:35:13 +0200 mav r275085 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-14 17:32:41 +0200 jl r274999 : #i103989# using c14n tranformation for XML streams 2009-08-14 15:27:43 +0200 jl r274987 : #i103989# remove special handling for encrypted document streams in UriBindingHelper::OpenInputStream, since we use zip storage this is not necessary anymore 2009-08-14 15:08:10 +0200 jl r274983 : #i103989# Showing a message when adding or removing a macro signature, that the document signature will be removed 2009-08-14 14:57:27 +0200 jl r274982 : #i103989# accesing Sequence at invalid index 2009-08-11 08:55:02 +0200 mav r274846 : #i103905# let signing service know if there is already a valid document signature 2009-08-10 11:33:37 +0200 jl r274799 : #i103905# do not truncate the stream 2009-08-10 10:43:47 +0200 mav r274797 : #i103905# provide the storage version 2009-08-07 16:58:46 +0200 jl r274780 : #i103989# 2009-08-07 16:56:19 +0200 jl r274779 : #i103989# using odf version string etc. 2009-08-07 15:20:53 +0200 mav r274771 : #i103905# provide the storage version 2009-08-07 15:19:12 +0200 mav r274770 : #i103905# provide the storage version 2009-08-07 12:41:45 +0200 mav r274758 : #103930# do not store thumbnail in case of encrypted document 2009-08-07 12:36:52 +0200 mav r274757 : #i103905# provide the storage version 2009-08-07 12:15:54 +0200 mav r274754 : #i103760# the signed state is not lost on saving 2009-08-07 12:06:19 +0200 mav r274753 : #i103760# avoid warning regarding signature removal on export 2009-08-07 12:06:01 +0200 mav r274752 : #i103760# avoid warning regarding signature removal on export 2009-08-06 08:47:34 +0200 mav r274703 : #i103905# allow to transport ODF version to the signing component 2009-08-05 21:34:42 +0200 mav r274701 : #i103905# allow to transport ODF version to the signing component 2009-08-05 15:48:17 +0200 mav r274683 : #i103905# allow to transport ODF version to the signing component 2009-08-05 14:58:12 +0200 jl r274673 : #i103989# documentsignature now signes all streams except documentsignatures.xml, all streams are processed as binary files 2009-08-05 12:00:32 +0200 mav r274648 : #i103905# allow to transport ODF version to the signing component 2009-08-04 10:57:04 +0200 jl r274612 : #i103989# added XInitialization 2009-07-31 10:32:27 +0200 mav r274516 : #i103905# use zip storage to sign documents 2009-07-30 14:01:33 +0200 mav r274489 : #i103906# optimize the usage of temporary medium 2009-07-30 14:00:28 +0200 mav r274488 : #i103906# optimize the usage of temporary medium 2009-07-30 13:59:09 +0200 mav r274487 : #i103906# optimize the usage of temporary medium 2009-07-30 13:50:44 +0200 mav r274485 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:53 +0200 mav r274484 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:13 +0200 mav r274483 : #i103906# optimize the usage of temporary medium 2009-07-30 13:47:09 +0200 mav r274482 : #i103905#,#i103906# let the signing process use zip-storage; optimize the usage of temporary medium 2009-07-21 09:10:31 +0200 mav r274159 : CWS-TOOLING: rebase CWS encsig09 to trunk@273468 (milestone: DEV300:m51) 2009-05-05 08:39:01 +0200 mav r271496 : #i100832# allow to sign macros only when there are any
2009-09-17 13:53:54 +00:00
zipMatch(const char * URI) {
if ((URI != NULL) && !strncmp(URI, "vnd.sun.star.zip:/", 18))
return 1;
return 0;
}
static int
helpMatch(const char * URI) {
if ((URI != NULL) && !strncmp(URI, "vnd.sun.star.help:/", 19))
return 1;
return 0;
}
static void *
fileOpen(const char *URI) {
osl::File *pRet = new osl::File(OUString(URI, strlen(URI), RTL_TEXTENCODING_UTF8));
2010-12-11 18:02:43 +00:00
pRet->open(osl_File_OpenFlag_Read);
return pRet;
}
static void *
zipOpen(SAL_UNUSED_PARAMETER const char *) {
OUString language,jar,path;
if( !ugblData->m_pInitial->get_eid().isEmpty() )
return (void*)(new Reference< XHierarchicalNameAccess >);
else
{
jar = ugblData->m_pInitial->get_jar();
language = ugblData->m_pInitial->get_language();
path = ugblData->m_pInitial->get_path();
}
Reference< XHierarchicalNameAccess > xNA =
ugblData->m_pDatabases->findJarFileForPath( jar, language, path );
Reference< XInputStream > xInputStream;
if( xNA.is() )
{
try
{
Any aEntry = xNA->getByHierarchicalName( path );
Reference< XActiveDataSink > xSink;
if( ( aEntry >>= xSink ) && xSink.is() )
xInputStream = xSink->getInputStream();
}
catch ( NoSuchElementException & )
{
}
}
if( xInputStream.is() )
{
return new Reference<XInputStream>(xInputStream);
}
return 0;
}
static void *
helpOpen(const char * URI) {
OUString language,jar,path;
URLParameter urlpar( OUString::createFromAscii( URI ),
ugblData->m_pDatabases );
jar = urlpar.get_jar();
language = urlpar.get_language();
path = urlpar.get_path();
Reference< XHierarchicalNameAccess > xNA =
ugblData->m_pDatabases->findJarFileForPath( jar, language, path );
Reference< XInputStream > xInputStream;
if( xNA.is() )
{
try
{
Any aEntry = xNA->getByHierarchicalName( path );
Reference< XActiveDataSink > xSink;
if( ( aEntry >>= xSink ) && xSink.is() )
xInputStream = xSink->getInputStream();
}
catch ( NoSuchElementException & )
{
}
}
if( xInputStream.is() )
return new Reference<XInputStream>(xInputStream);
return 0;
}
static int
helpRead(void * context, char * buffer, int len) {
Reference< XInputStream > *pRef = (Reference< XInputStream >*)context;
Sequence< sal_Int8 > aSeq;
len = (*pRef)->readBytes( aSeq,len);
memcpy(buffer, aSeq.getConstArray(), len);
return len;
}
static int
CWS-TOOLING: integrate CWS encsig09 2009-09-14 15:11:29 +0200 oc r276125 : #i105049# MacroSignatur needs Macro 2009-09-09 17:09:46 +0200 jl r276005 : #i103989# could not signe encrypted doc containing a formular object 2009-09-09 13:11:24 +0200 jl r275985 : #i103989# could not signe encrypted doc containing a formular object 2009-09-08 15:54:02 +0200 mav r275934 : #i103906# fix the automation test scenario ( tempfile should be writable for the user ) 2009-09-07 14:01:39 +0200 mav r275895 : #i103906# fix the problem with reload 2009-09-07 09:34:48 +0200 mav r275871 : #i104786# do the ODF version check only for ODF documents 2009-09-07 08:19:06 +0200 mav r275870 : #i104389# fix text 2009-09-06 22:24:21 +0200 mav r275867 : #i104786# check the consistency of ODF version 2009-09-06 22:23:24 +0200 mav r275866 : #i104786# check the consistency of ODF version 2009-09-06 22:23:00 +0200 mav r275865 : #i104786# check the consistency of ODF version 2009-09-06 22:22:36 +0200 mav r275864 : #i104786# check the consistency of ODF version 2009-09-06 22:22:03 +0200 mav r275863 : #i104786# check the consistency of ODF version 2009-09-02 17:09:30 +0200 mav r275722 : #i104715# let repairing mechanics use the streams correctly 2009-09-01 16:52:49 +0200 mav r275670 : #i104389# notify user not to trust the corrupted document 2009-09-01 16:31:37 +0200 mav r275668 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:30:32 +0200 mav r275667 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:22:13 +0200 jl r275666 : #i104339# small content change 2009-09-01 14:20:42 +0200 jl r275660 : #i103519# remove some debug output 2009-09-01 13:51:52 +0200 jl r275659 : #i103519# NSS uses '\' for escaping in distinguished names 2009-09-01 12:49:47 +0200 mav r275655 : #i104389# use zip-mode to read from jar files 2009-09-01 12:40:22 +0200 mav r275653 : #i104389# use zip-mode to read from jar files 2009-09-01 12:32:29 +0200 mav r275652 : #i104389# use constants 2009-08-31 21:58:00 +0200 mav r275637 : #i10000# fix warning 2009-08-31 21:11:17 +0200 mav r275636 : #i104227# adding of scripting signature removes the document signature 2009-08-31 20:55:05 +0200 mav r275635 : #i103905# ZipStorage supports Compressed property 2009-08-31 20:53:55 +0200 mav r275634 : #i103905# adjust macro signature transfer to usage of ZipStorage 2009-08-31 15:30:49 +0200 jl r275609 : #i103989# warning is shown as long the user does not click 'OK' 2009-08-31 14:36:10 +0200 jl r275608 : #i103989# changed warning text when signing macro and there is a document signature. This warning is only displayed once 2009-08-31 13:34:41 +0200 mav r275603 : #i104452# disable macros in repaired documents 2009-08-31 13:33:42 +0200 mav r275602 : #i104452# disable macros in repaired documents 2009-08-31 13:03:56 +0200 jl r275600 : #i45212# signature dialog could not be started when using read-only documents 2009-08-31 09:26:13 +0200 mav r275583 : #i104578# store the additional entry as the last one to workaround parsing problem in OOo3.1 and later 2009-08-30 20:54:25 +0200 mav r275562 : #i10000# adopt for unix 2009-08-30 10:56:00 +0200 mav r275561 : CWS-TOOLING: rebase CWS encsig09 to trunk@275331 (milestone: DEV300:m56) 2009-08-28 16:34:00 +0200 mav r275539 : #i104578# write necessary info in manifest.xml for ODF1.2 encrypted document 2009-08-28 14:04:22 +0200 mav r275533 : #104587# fix handling of readonly streams 2009-08-28 13:58:10 +0200 mav r275531 : #i104389# fix the broken document handling 2009-08-28 11:40:39 +0200 mav r275522 : #i104389# fix the signature streams check 2009-08-27 21:48:12 +0200 mav r275509 : #i103927# show the warning 2009-08-27 21:47:48 +0200 mav r275508 : #i103927# show the warning 2009-08-27 16:45:59 +0200 jl r275495 : #i45212# remove unused variable 2009-08-27 16:34:00 +0200 jl r275494 : #i103989# 2009-08-27 13:54:28 +0200 jl r275482 : #i103519# fixed replacement of 'S' by 'ST' 2009-08-27 12:32:21 +0200 mav r275472 : #i10000# fix warning 2009-08-27 11:58:11 +0200 mav r275467 : #i104389# handle the entry path correctly 2009-08-26 17:18:35 +0200 jl r275438 : #i103519# subject and issuer distinguished names were not properly displayed. The strings were obtained by system functions (Windows, NSS), which use quotes to escape the values, when they contain special characters 2009-08-26 11:00:20 +0200 mav r275403 : #i10000# fix warnings 2009-08-26 08:25:45 +0200 mav r275392 : #i10000# fix warning 2009-08-26 08:02:22 +0200 mav r275391 : #i10000# adopt for linux 2009-08-26 07:40:30 +0200 mav r275390 : #i10000# fix warning 2009-08-26 07:35:28 +0200 mav r275389 : #i10000# use correct include file name 2009-08-25 15:01:41 +0200 jl r275356 : #i103989# better check for mimetype of streams 2009-08-25 09:07:09 +0200 mav r275335 : CWS-TOOLING: rebase CWS encsig09 to trunk@274622 (milestone: DEV300:m54) 2009-08-24 18:17:02 +0200 mav r275329 : #i103927# check the nonencrypted streams 2009-08-24 18:14:14 +0200 mav r275328 : #i103927# check the nonencrypted streams 2009-08-24 17:59:34 +0200 mav r275327 : #i103927#,#i104389# check the package consistency and nonencrypted streams 2009-08-24 16:18:28 +0200 jl r275323 : #i103989# added comment 2009-08-24 13:08:47 +0200 jl r275305 : #i45212# #i66276# only write the X509Certificate element once and allow to add remove several certificates at a time 2009-08-21 12:57:28 +0200 ufi r275239 : 104339 2009-08-21 08:39:05 +0200 jl r275213 : #i10398# comparing URIs of signed files with the 'element list' 2009-08-20 13:39:47 +0200 jl r275178 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:35:39 +0200 jl r275177 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:29:06 +0200 jl r275176 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:26:21 +0200 jl r275175 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 12:05:09 +0200 ufi r275170 : i104339 2009-08-19 12:24:54 +0200 jl r275146 : #i10398# displaying 'old signature' icon and status in signature dialog 2009-08-18 15:18:48 +0200 jl r275111 : #i103989# document signatures containing manifest.xml are now validated according to the final ODF1.2 spec 2009-08-18 11:41:06 +0200 mav r275087 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-18 11:35:13 +0200 mav r275085 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-14 17:32:41 +0200 jl r274999 : #i103989# using c14n tranformation for XML streams 2009-08-14 15:27:43 +0200 jl r274987 : #i103989# remove special handling for encrypted document streams in UriBindingHelper::OpenInputStream, since we use zip storage this is not necessary anymore 2009-08-14 15:08:10 +0200 jl r274983 : #i103989# Showing a message when adding or removing a macro signature, that the document signature will be removed 2009-08-14 14:57:27 +0200 jl r274982 : #i103989# accesing Sequence at invalid index 2009-08-11 08:55:02 +0200 mav r274846 : #i103905# let signing service know if there is already a valid document signature 2009-08-10 11:33:37 +0200 jl r274799 : #i103905# do not truncate the stream 2009-08-10 10:43:47 +0200 mav r274797 : #i103905# provide the storage version 2009-08-07 16:58:46 +0200 jl r274780 : #i103989# 2009-08-07 16:56:19 +0200 jl r274779 : #i103989# using odf version string etc. 2009-08-07 15:20:53 +0200 mav r274771 : #i103905# provide the storage version 2009-08-07 15:19:12 +0200 mav r274770 : #i103905# provide the storage version 2009-08-07 12:41:45 +0200 mav r274758 : #103930# do not store thumbnail in case of encrypted document 2009-08-07 12:36:52 +0200 mav r274757 : #i103905# provide the storage version 2009-08-07 12:15:54 +0200 mav r274754 : #i103760# the signed state is not lost on saving 2009-08-07 12:06:19 +0200 mav r274753 : #i103760# avoid warning regarding signature removal on export 2009-08-07 12:06:01 +0200 mav r274752 : #i103760# avoid warning regarding signature removal on export 2009-08-06 08:47:34 +0200 mav r274703 : #i103905# allow to transport ODF version to the signing component 2009-08-05 21:34:42 +0200 mav r274701 : #i103905# allow to transport ODF version to the signing component 2009-08-05 15:48:17 +0200 mav r274683 : #i103905# allow to transport ODF version to the signing component 2009-08-05 14:58:12 +0200 jl r274673 : #i103989# documentsignature now signes all streams except documentsignatures.xml, all streams are processed as binary files 2009-08-05 12:00:32 +0200 mav r274648 : #i103905# allow to transport ODF version to the signing component 2009-08-04 10:57:04 +0200 jl r274612 : #i103989# added XInitialization 2009-07-31 10:32:27 +0200 mav r274516 : #i103905# use zip storage to sign documents 2009-07-30 14:01:33 +0200 mav r274489 : #i103906# optimize the usage of temporary medium 2009-07-30 14:00:28 +0200 mav r274488 : #i103906# optimize the usage of temporary medium 2009-07-30 13:59:09 +0200 mav r274487 : #i103906# optimize the usage of temporary medium 2009-07-30 13:50:44 +0200 mav r274485 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:53 +0200 mav r274484 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:13 +0200 mav r274483 : #i103906# optimize the usage of temporary medium 2009-07-30 13:47:09 +0200 mav r274482 : #i103905#,#i103906# let the signing process use zip-storage; optimize the usage of temporary medium 2009-07-21 09:10:31 +0200 mav r274159 : CWS-TOOLING: rebase CWS encsig09 to trunk@273468 (milestone: DEV300:m51) 2009-05-05 08:39:01 +0200 mav r271496 : #i100832# allow to sign macros only when there are any
2009-09-17 13:53:54 +00:00
zipRead(void * context, char * buffer, int len) {
return helpRead(context, buffer, len);
}
static int
fileRead(void * context, char * buffer, int len) {
int nRead = 0;
osl::File *pFile = (osl::File*)context;
if (pFile)
{
sal_uInt64 uRead = 0;
if (osl::FileBase::E_None == pFile->read(buffer, len, uRead))
nRead = static_cast<int>(uRead);
}
return nRead;
}
static int
uriClose(void * context) {
Reference< XInputStream > *pRef = (Reference< XInputStream >*)context;
delete pRef;
return 0;
}
static int
fileClose(void * context) {
osl::File *pFile = (osl::File*)context;
if (pFile)
{
pFile->close();
delete pFile;
}
return 0;
}
2001-05-22 13:57:13 +00:00
} // extern "C"
2001-06-13 08:10:13 +00:00
InputStreamTransformer::InputStreamTransformer( URLParameter* urlParam,
Databases* pDatabases,
bool isRoot )
2001-05-23 13:15:56 +00:00
: len( 0 ),
pos( 0 ),
buffer( new char[1] ) // Initializing with one element to avoid gcc compiler warning
2001-05-22 13:57:13 +00:00
{
if( isRoot )
{
delete[] buffer;
pDatabases->cascadingStylesheet( urlParam->get_language(),
&buffer,
&len );
}
else if( urlParam->isActive() )
2001-06-13 08:10:13 +00:00
{
delete[] buffer;
pDatabases->setActiveText( urlParam->get_module(),
urlParam->get_language(),
urlParam->get_id(),
&buffer,
&len );
}
else
{
UserData userData( this,urlParam,pDatabases );
// Uses the implementation detail, that OString::getStr returns a zero terminated character-array
2001-06-13 08:10:13 +00:00
const char* parameter[47];
OString parString[46];
int last = 0;
parString[last++] = "Program";
OString aPureProgramm( urlParam->getByName( "Program" ) );
parString[last++] = OString('\'') + aPureProgramm + OString('\'');
parString[last++] = "Database";
parString[last++] = OString('\'') + urlParam->getByName( "DatabasePar" ) + OString('\'');
parString[last++] = "Id";
parString[last++] = OString('\'') + urlParam->getByName( "Id" ) + OString('\'');
parString[last++] = "Path";
OString aPath( urlParam->getByName( "Path" ) );
parString[last++] = OString('\'') + aPath + OString('\'');
OString aPureLanguage = urlParam->getByName( "Language" );
parString[last++] = "Language";
parString[last++] = OString('\'') + aPureLanguage + OString('\'');
parString[last++] = "System";
parString[last++] = OString('\'') + urlParam->getByName( "System" ) + OString('\'');
parString[last++] = "productname";
parString[last++] = OString('\'') + OString(
pDatabases->getProductName().getStr(),
pDatabases->getProductName().getLength(),
RTL_TEXTENCODING_UTF8 ) + OString('\'');
parString[last++] = "productversion";
parString[last++] = OString('\'') +
OString( pDatabases->getProductVersion().getStr(),
pDatabases->getProductVersion().getLength(),
RTL_TEXTENCODING_UTF8 ) + OString('\'');
parString[last++] = "imgrepos";
parString[last++] = OString('\'') + pDatabases->getImagesZipFileURL() + OString('\'');
parString[last++] = "hp";
parString[last++] = OString('\'') + urlParam->getByName( "HelpPrefix" ) + OString('\'');
if( !parString[last-1].isEmpty() )
{
parString[last++] = "sm";
parString[last++] = "'vnd.sun.star.help%3A%2F%2F'";
parString[last++] = "qm";
parString[last++] = "'%3F'";
parString[last++] = "es";
parString[last++] = "'%3D'";
parString[last++] = "am";
parString[last++] = "'%26'";
parString[last++] = "cl";
parString[last++] = "'%3A'";
parString[last++] = "sl";
parString[last++] = "'%2F'";
parString[last++] = "hm";
parString[last++] = "'%23'";
parString[last++] = "cs";
parString[last++] = "'css'";
parString[last++] = "vendorname";
parString[last++] = OString("''");
parString[last++] = "vendorversion";
parString[last++] = OString("''");
parString[last++] = "vendorshort";
parString[last++] = OString("''");
}
// Do we need to add extension path?
OUString aExtensionPath;
OUString aJar = urlParam->get_jar();
bool bAddExtensionPath = false;
OUString aExtensionRegistryPath;
sal_Int32 nQuestionMark1 = aJar.indexOf( sal_Unicode('?') );
sal_Int32 nQuestionMark2 = aJar.lastIndexOf( sal_Unicode('?') );
if( nQuestionMark1 != -1 && nQuestionMark2 != -1 && nQuestionMark1 != nQuestionMark2 )
{
aExtensionPath = aJar.copy( nQuestionMark1 + 1, nQuestionMark2 - nQuestionMark1 - 1 );
aExtensionRegistryPath = urlParam->get_ExtensionRegistryPath();
bAddExtensionPath = true;
}
else
{
// Path not yet specified, search directly
Reference< XHierarchicalNameAccess > xNA = pDatabases->findJarFileForPath
( aJar, urlParam->get_language(), urlParam->get_path(), &aExtensionPath, &aExtensionRegistryPath );
if( xNA.is() && !aExtensionPath.isEmpty() )
bAddExtensionPath = true;
}
if( bAddExtensionPath )
{
Reference< XComponentContext > xContext(
comphelper::getProcessComponentContext() );
OUString aOUExpandedExtensionPath = Databases::expandURL( aExtensionRegistryPath, xContext );
OString aExpandedExtensionPath = OUStringToOString( aOUExpandedExtensionPath, osl_getThreadTextEncoding() );
parString[last++] = "ExtensionPath";
parString[last++] = OString('\'') + aExpandedExtensionPath + OString('\'');
// ExtensionId
OString aPureExtensionId;
sal_Int32 iSlash = aPath.indexOf( '/' );
if( iSlash != -1 )
aPureExtensionId = aPath.copy( 0, iSlash );
parString[last++] = "ExtensionId";
parString[last++] = OString('\'') + aPureExtensionId + OString('\'');
}
for( int i = 0; i < last; ++i )
2001-06-13 08:10:13 +00:00
parameter[i] = parString[i].getStr();
parameter[last] = 0;
2001-06-13 08:10:13 +00:00
OUString xslURL = pDatabases->getInstallPathAsURL();
OString xslURLascii(
xslURL.getStr(),
xslURL.getLength(),
RTL_TEXTENCODING_UTF8);
2001-06-13 08:10:13 +00:00
xslURLascii += "main_transform.xsl";
ugblData = &userData;
xmlInitParser();
CWS-TOOLING: integrate CWS encsig09 2009-09-14 15:11:29 +0200 oc r276125 : #i105049# MacroSignatur needs Macro 2009-09-09 17:09:46 +0200 jl r276005 : #i103989# could not signe encrypted doc containing a formular object 2009-09-09 13:11:24 +0200 jl r275985 : #i103989# could not signe encrypted doc containing a formular object 2009-09-08 15:54:02 +0200 mav r275934 : #i103906# fix the automation test scenario ( tempfile should be writable for the user ) 2009-09-07 14:01:39 +0200 mav r275895 : #i103906# fix the problem with reload 2009-09-07 09:34:48 +0200 mav r275871 : #i104786# do the ODF version check only for ODF documents 2009-09-07 08:19:06 +0200 mav r275870 : #i104389# fix text 2009-09-06 22:24:21 +0200 mav r275867 : #i104786# check the consistency of ODF version 2009-09-06 22:23:24 +0200 mav r275866 : #i104786# check the consistency of ODF version 2009-09-06 22:23:00 +0200 mav r275865 : #i104786# check the consistency of ODF version 2009-09-06 22:22:36 +0200 mav r275864 : #i104786# check the consistency of ODF version 2009-09-06 22:22:03 +0200 mav r275863 : #i104786# check the consistency of ODF version 2009-09-02 17:09:30 +0200 mav r275722 : #i104715# let repairing mechanics use the streams correctly 2009-09-01 16:52:49 +0200 mav r275670 : #i104389# notify user not to trust the corrupted document 2009-09-01 16:31:37 +0200 mav r275668 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:30:32 +0200 mav r275667 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:22:13 +0200 jl r275666 : #i104339# small content change 2009-09-01 14:20:42 +0200 jl r275660 : #i103519# remove some debug output 2009-09-01 13:51:52 +0200 jl r275659 : #i103519# NSS uses '\' for escaping in distinguished names 2009-09-01 12:49:47 +0200 mav r275655 : #i104389# use zip-mode to read from jar files 2009-09-01 12:40:22 +0200 mav r275653 : #i104389# use zip-mode to read from jar files 2009-09-01 12:32:29 +0200 mav r275652 : #i104389# use constants 2009-08-31 21:58:00 +0200 mav r275637 : #i10000# fix warning 2009-08-31 21:11:17 +0200 mav r275636 : #i104227# adding of scripting signature removes the document signature 2009-08-31 20:55:05 +0200 mav r275635 : #i103905# ZipStorage supports Compressed property 2009-08-31 20:53:55 +0200 mav r275634 : #i103905# adjust macro signature transfer to usage of ZipStorage 2009-08-31 15:30:49 +0200 jl r275609 : #i103989# warning is shown as long the user does not click 'OK' 2009-08-31 14:36:10 +0200 jl r275608 : #i103989# changed warning text when signing macro and there is a document signature. This warning is only displayed once 2009-08-31 13:34:41 +0200 mav r275603 : #i104452# disable macros in repaired documents 2009-08-31 13:33:42 +0200 mav r275602 : #i104452# disable macros in repaired documents 2009-08-31 13:03:56 +0200 jl r275600 : #i45212# signature dialog could not be started when using read-only documents 2009-08-31 09:26:13 +0200 mav r275583 : #i104578# store the additional entry as the last one to workaround parsing problem in OOo3.1 and later 2009-08-30 20:54:25 +0200 mav r275562 : #i10000# adopt for unix 2009-08-30 10:56:00 +0200 mav r275561 : CWS-TOOLING: rebase CWS encsig09 to trunk@275331 (milestone: DEV300:m56) 2009-08-28 16:34:00 +0200 mav r275539 : #i104578# write necessary info in manifest.xml for ODF1.2 encrypted document 2009-08-28 14:04:22 +0200 mav r275533 : #104587# fix handling of readonly streams 2009-08-28 13:58:10 +0200 mav r275531 : #i104389# fix the broken document handling 2009-08-28 11:40:39 +0200 mav r275522 : #i104389# fix the signature streams check 2009-08-27 21:48:12 +0200 mav r275509 : #i103927# show the warning 2009-08-27 21:47:48 +0200 mav r275508 : #i103927# show the warning 2009-08-27 16:45:59 +0200 jl r275495 : #i45212# remove unused variable 2009-08-27 16:34:00 +0200 jl r275494 : #i103989# 2009-08-27 13:54:28 +0200 jl r275482 : #i103519# fixed replacement of 'S' by 'ST' 2009-08-27 12:32:21 +0200 mav r275472 : #i10000# fix warning 2009-08-27 11:58:11 +0200 mav r275467 : #i104389# handle the entry path correctly 2009-08-26 17:18:35 +0200 jl r275438 : #i103519# subject and issuer distinguished names were not properly displayed. The strings were obtained by system functions (Windows, NSS), which use quotes to escape the values, when they contain special characters 2009-08-26 11:00:20 +0200 mav r275403 : #i10000# fix warnings 2009-08-26 08:25:45 +0200 mav r275392 : #i10000# fix warning 2009-08-26 08:02:22 +0200 mav r275391 : #i10000# adopt for linux 2009-08-26 07:40:30 +0200 mav r275390 : #i10000# fix warning 2009-08-26 07:35:28 +0200 mav r275389 : #i10000# use correct include file name 2009-08-25 15:01:41 +0200 jl r275356 : #i103989# better check for mimetype of streams 2009-08-25 09:07:09 +0200 mav r275335 : CWS-TOOLING: rebase CWS encsig09 to trunk@274622 (milestone: DEV300:m54) 2009-08-24 18:17:02 +0200 mav r275329 : #i103927# check the nonencrypted streams 2009-08-24 18:14:14 +0200 mav r275328 : #i103927# check the nonencrypted streams 2009-08-24 17:59:34 +0200 mav r275327 : #i103927#,#i104389# check the package consistency and nonencrypted streams 2009-08-24 16:18:28 +0200 jl r275323 : #i103989# added comment 2009-08-24 13:08:47 +0200 jl r275305 : #i45212# #i66276# only write the X509Certificate element once and allow to add remove several certificates at a time 2009-08-21 12:57:28 +0200 ufi r275239 : 104339 2009-08-21 08:39:05 +0200 jl r275213 : #i10398# comparing URIs of signed files with the 'element list' 2009-08-20 13:39:47 +0200 jl r275178 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:35:39 +0200 jl r275177 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:29:06 +0200 jl r275176 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:26:21 +0200 jl r275175 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 12:05:09 +0200 ufi r275170 : i104339 2009-08-19 12:24:54 +0200 jl r275146 : #i10398# displaying 'old signature' icon and status in signature dialog 2009-08-18 15:18:48 +0200 jl r275111 : #i103989# document signatures containing manifest.xml are now validated according to the final ODF1.2 spec 2009-08-18 11:41:06 +0200 mav r275087 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-18 11:35:13 +0200 mav r275085 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-14 17:32:41 +0200 jl r274999 : #i103989# using c14n tranformation for XML streams 2009-08-14 15:27:43 +0200 jl r274987 : #i103989# remove special handling for encrypted document streams in UriBindingHelper::OpenInputStream, since we use zip storage this is not necessary anymore 2009-08-14 15:08:10 +0200 jl r274983 : #i103989# Showing a message when adding or removing a macro signature, that the document signature will be removed 2009-08-14 14:57:27 +0200 jl r274982 : #i103989# accesing Sequence at invalid index 2009-08-11 08:55:02 +0200 mav r274846 : #i103905# let signing service know if there is already a valid document signature 2009-08-10 11:33:37 +0200 jl r274799 : #i103905# do not truncate the stream 2009-08-10 10:43:47 +0200 mav r274797 : #i103905# provide the storage version 2009-08-07 16:58:46 +0200 jl r274780 : #i103989# 2009-08-07 16:56:19 +0200 jl r274779 : #i103989# using odf version string etc. 2009-08-07 15:20:53 +0200 mav r274771 : #i103905# provide the storage version 2009-08-07 15:19:12 +0200 mav r274770 : #i103905# provide the storage version 2009-08-07 12:41:45 +0200 mav r274758 : #103930# do not store thumbnail in case of encrypted document 2009-08-07 12:36:52 +0200 mav r274757 : #i103905# provide the storage version 2009-08-07 12:15:54 +0200 mav r274754 : #i103760# the signed state is not lost on saving 2009-08-07 12:06:19 +0200 mav r274753 : #i103760# avoid warning regarding signature removal on export 2009-08-07 12:06:01 +0200 mav r274752 : #i103760# avoid warning regarding signature removal on export 2009-08-06 08:47:34 +0200 mav r274703 : #i103905# allow to transport ODF version to the signing component 2009-08-05 21:34:42 +0200 mav r274701 : #i103905# allow to transport ODF version to the signing component 2009-08-05 15:48:17 +0200 mav r274683 : #i103905# allow to transport ODF version to the signing component 2009-08-05 14:58:12 +0200 jl r274673 : #i103989# documentsignature now signes all streams except documentsignatures.xml, all streams are processed as binary files 2009-08-05 12:00:32 +0200 mav r274648 : #i103905# allow to transport ODF version to the signing component 2009-08-04 10:57:04 +0200 jl r274612 : #i103989# added XInitialization 2009-07-31 10:32:27 +0200 mav r274516 : #i103905# use zip storage to sign documents 2009-07-30 14:01:33 +0200 mav r274489 : #i103906# optimize the usage of temporary medium 2009-07-30 14:00:28 +0200 mav r274488 : #i103906# optimize the usage of temporary medium 2009-07-30 13:59:09 +0200 mav r274487 : #i103906# optimize the usage of temporary medium 2009-07-30 13:50:44 +0200 mav r274485 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:53 +0200 mav r274484 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:13 +0200 mav r274483 : #i103906# optimize the usage of temporary medium 2009-07-30 13:47:09 +0200 mav r274482 : #i103905#,#i103906# let the signing process use zip-storage; optimize the usage of temporary medium 2009-07-21 09:10:31 +0200 mav r274159 : CWS-TOOLING: rebase CWS encsig09 to trunk@273468 (milestone: DEV300:m51) 2009-05-05 08:39:01 +0200 mav r271496 : #i100832# allow to sign macros only when there are any
2009-09-17 13:53:54 +00:00
xmlRegisterInputCallbacks(zipMatch, zipOpen, zipRead, uriClose);
xmlRegisterInputCallbacks(helpMatch, helpOpen, helpRead, uriClose);
xmlRegisterInputCallbacks(fileMatch, fileOpen, fileRead, fileClose);
xsltStylesheetPtr cur =
xsltParseStylesheetFile((const xmlChar *)xslURLascii.getStr());
CWS-TOOLING: integrate CWS encsig09 2009-09-14 15:11:29 +0200 oc r276125 : #i105049# MacroSignatur needs Macro 2009-09-09 17:09:46 +0200 jl r276005 : #i103989# could not signe encrypted doc containing a formular object 2009-09-09 13:11:24 +0200 jl r275985 : #i103989# could not signe encrypted doc containing a formular object 2009-09-08 15:54:02 +0200 mav r275934 : #i103906# fix the automation test scenario ( tempfile should be writable for the user ) 2009-09-07 14:01:39 +0200 mav r275895 : #i103906# fix the problem with reload 2009-09-07 09:34:48 +0200 mav r275871 : #i104786# do the ODF version check only for ODF documents 2009-09-07 08:19:06 +0200 mav r275870 : #i104389# fix text 2009-09-06 22:24:21 +0200 mav r275867 : #i104786# check the consistency of ODF version 2009-09-06 22:23:24 +0200 mav r275866 : #i104786# check the consistency of ODF version 2009-09-06 22:23:00 +0200 mav r275865 : #i104786# check the consistency of ODF version 2009-09-06 22:22:36 +0200 mav r275864 : #i104786# check the consistency of ODF version 2009-09-06 22:22:03 +0200 mav r275863 : #i104786# check the consistency of ODF version 2009-09-02 17:09:30 +0200 mav r275722 : #i104715# let repairing mechanics use the streams correctly 2009-09-01 16:52:49 +0200 mav r275670 : #i104389# notify user not to trust the corrupted document 2009-09-01 16:31:37 +0200 mav r275668 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:30:32 +0200 mav r275667 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:22:13 +0200 jl r275666 : #i104339# small content change 2009-09-01 14:20:42 +0200 jl r275660 : #i103519# remove some debug output 2009-09-01 13:51:52 +0200 jl r275659 : #i103519# NSS uses '\' for escaping in distinguished names 2009-09-01 12:49:47 +0200 mav r275655 : #i104389# use zip-mode to read from jar files 2009-09-01 12:40:22 +0200 mav r275653 : #i104389# use zip-mode to read from jar files 2009-09-01 12:32:29 +0200 mav r275652 : #i104389# use constants 2009-08-31 21:58:00 +0200 mav r275637 : #i10000# fix warning 2009-08-31 21:11:17 +0200 mav r275636 : #i104227# adding of scripting signature removes the document signature 2009-08-31 20:55:05 +0200 mav r275635 : #i103905# ZipStorage supports Compressed property 2009-08-31 20:53:55 +0200 mav r275634 : #i103905# adjust macro signature transfer to usage of ZipStorage 2009-08-31 15:30:49 +0200 jl r275609 : #i103989# warning is shown as long the user does not click 'OK' 2009-08-31 14:36:10 +0200 jl r275608 : #i103989# changed warning text when signing macro and there is a document signature. This warning is only displayed once 2009-08-31 13:34:41 +0200 mav r275603 : #i104452# disable macros in repaired documents 2009-08-31 13:33:42 +0200 mav r275602 : #i104452# disable macros in repaired documents 2009-08-31 13:03:56 +0200 jl r275600 : #i45212# signature dialog could not be started when using read-only documents 2009-08-31 09:26:13 +0200 mav r275583 : #i104578# store the additional entry as the last one to workaround parsing problem in OOo3.1 and later 2009-08-30 20:54:25 +0200 mav r275562 : #i10000# adopt for unix 2009-08-30 10:56:00 +0200 mav r275561 : CWS-TOOLING: rebase CWS encsig09 to trunk@275331 (milestone: DEV300:m56) 2009-08-28 16:34:00 +0200 mav r275539 : #i104578# write necessary info in manifest.xml for ODF1.2 encrypted document 2009-08-28 14:04:22 +0200 mav r275533 : #104587# fix handling of readonly streams 2009-08-28 13:58:10 +0200 mav r275531 : #i104389# fix the broken document handling 2009-08-28 11:40:39 +0200 mav r275522 : #i104389# fix the signature streams check 2009-08-27 21:48:12 +0200 mav r275509 : #i103927# show the warning 2009-08-27 21:47:48 +0200 mav r275508 : #i103927# show the warning 2009-08-27 16:45:59 +0200 jl r275495 : #i45212# remove unused variable 2009-08-27 16:34:00 +0200 jl r275494 : #i103989# 2009-08-27 13:54:28 +0200 jl r275482 : #i103519# fixed replacement of 'S' by 'ST' 2009-08-27 12:32:21 +0200 mav r275472 : #i10000# fix warning 2009-08-27 11:58:11 +0200 mav r275467 : #i104389# handle the entry path correctly 2009-08-26 17:18:35 +0200 jl r275438 : #i103519# subject and issuer distinguished names were not properly displayed. The strings were obtained by system functions (Windows, NSS), which use quotes to escape the values, when they contain special characters 2009-08-26 11:00:20 +0200 mav r275403 : #i10000# fix warnings 2009-08-26 08:25:45 +0200 mav r275392 : #i10000# fix warning 2009-08-26 08:02:22 +0200 mav r275391 : #i10000# adopt for linux 2009-08-26 07:40:30 +0200 mav r275390 : #i10000# fix warning 2009-08-26 07:35:28 +0200 mav r275389 : #i10000# use correct include file name 2009-08-25 15:01:41 +0200 jl r275356 : #i103989# better check for mimetype of streams 2009-08-25 09:07:09 +0200 mav r275335 : CWS-TOOLING: rebase CWS encsig09 to trunk@274622 (milestone: DEV300:m54) 2009-08-24 18:17:02 +0200 mav r275329 : #i103927# check the nonencrypted streams 2009-08-24 18:14:14 +0200 mav r275328 : #i103927# check the nonencrypted streams 2009-08-24 17:59:34 +0200 mav r275327 : #i103927#,#i104389# check the package consistency and nonencrypted streams 2009-08-24 16:18:28 +0200 jl r275323 : #i103989# added comment 2009-08-24 13:08:47 +0200 jl r275305 : #i45212# #i66276# only write the X509Certificate element once and allow to add remove several certificates at a time 2009-08-21 12:57:28 +0200 ufi r275239 : 104339 2009-08-21 08:39:05 +0200 jl r275213 : #i10398# comparing URIs of signed files with the 'element list' 2009-08-20 13:39:47 +0200 jl r275178 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:35:39 +0200 jl r275177 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:29:06 +0200 jl r275176 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:26:21 +0200 jl r275175 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 12:05:09 +0200 ufi r275170 : i104339 2009-08-19 12:24:54 +0200 jl r275146 : #i10398# displaying 'old signature' icon and status in signature dialog 2009-08-18 15:18:48 +0200 jl r275111 : #i103989# document signatures containing manifest.xml are now validated according to the final ODF1.2 spec 2009-08-18 11:41:06 +0200 mav r275087 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-18 11:35:13 +0200 mav r275085 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-14 17:32:41 +0200 jl r274999 : #i103989# using c14n tranformation for XML streams 2009-08-14 15:27:43 +0200 jl r274987 : #i103989# remove special handling for encrypted document streams in UriBindingHelper::OpenInputStream, since we use zip storage this is not necessary anymore 2009-08-14 15:08:10 +0200 jl r274983 : #i103989# Showing a message when adding or removing a macro signature, that the document signature will be removed 2009-08-14 14:57:27 +0200 jl r274982 : #i103989# accesing Sequence at invalid index 2009-08-11 08:55:02 +0200 mav r274846 : #i103905# let signing service know if there is already a valid document signature 2009-08-10 11:33:37 +0200 jl r274799 : #i103905# do not truncate the stream 2009-08-10 10:43:47 +0200 mav r274797 : #i103905# provide the storage version 2009-08-07 16:58:46 +0200 jl r274780 : #i103989# 2009-08-07 16:56:19 +0200 jl r274779 : #i103989# using odf version string etc. 2009-08-07 15:20:53 +0200 mav r274771 : #i103905# provide the storage version 2009-08-07 15:19:12 +0200 mav r274770 : #i103905# provide the storage version 2009-08-07 12:41:45 +0200 mav r274758 : #103930# do not store thumbnail in case of encrypted document 2009-08-07 12:36:52 +0200 mav r274757 : #i103905# provide the storage version 2009-08-07 12:15:54 +0200 mav r274754 : #i103760# the signed state is not lost on saving 2009-08-07 12:06:19 +0200 mav r274753 : #i103760# avoid warning regarding signature removal on export 2009-08-07 12:06:01 +0200 mav r274752 : #i103760# avoid warning regarding signature removal on export 2009-08-06 08:47:34 +0200 mav r274703 : #i103905# allow to transport ODF version to the signing component 2009-08-05 21:34:42 +0200 mav r274701 : #i103905# allow to transport ODF version to the signing component 2009-08-05 15:48:17 +0200 mav r274683 : #i103905# allow to transport ODF version to the signing component 2009-08-05 14:58:12 +0200 jl r274673 : #i103989# documentsignature now signes all streams except documentsignatures.xml, all streams are processed as binary files 2009-08-05 12:00:32 +0200 mav r274648 : #i103905# allow to transport ODF version to the signing component 2009-08-04 10:57:04 +0200 jl r274612 : #i103989# added XInitialization 2009-07-31 10:32:27 +0200 mav r274516 : #i103905# use zip storage to sign documents 2009-07-30 14:01:33 +0200 mav r274489 : #i103906# optimize the usage of temporary medium 2009-07-30 14:00:28 +0200 mav r274488 : #i103906# optimize the usage of temporary medium 2009-07-30 13:59:09 +0200 mav r274487 : #i103906# optimize the usage of temporary medium 2009-07-30 13:50:44 +0200 mav r274485 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:53 +0200 mav r274484 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:13 +0200 mav r274483 : #i103906# optimize the usage of temporary medium 2009-07-30 13:47:09 +0200 mav r274482 : #i103905#,#i103906# let the signing process use zip-storage; optimize the usage of temporary medium 2009-07-21 09:10:31 +0200 mav r274159 : CWS-TOOLING: rebase CWS encsig09 to trunk@273468 (milestone: DEV300:m51) 2009-05-05 08:39:01 +0200 mav r271496 : #i100832# allow to sign macros only when there are any
2009-09-17 13:53:54 +00:00
xmlDocPtr doc = xmlParseFile("vnd.sun.star.zip:/");
2001-06-13 08:10:13 +00:00
xmlDocPtr res = xsltApplyStylesheet(cur, doc, parameter);
if (res)
{
xmlChar *doc_txt_ptr=0;
int doc_txt_len;
xsltSaveResultToString(&doc_txt_ptr, &doc_txt_len, res, cur);
addToBuffer((const char*)doc_txt_ptr, doc_txt_len);
xmlFree(doc_txt_ptr);
}
xmlPopInputCallbacks(); //filePatch
xmlPopInputCallbacks(); //helpPatch
CWS-TOOLING: integrate CWS encsig09 2009-09-14 15:11:29 +0200 oc r276125 : #i105049# MacroSignatur needs Macro 2009-09-09 17:09:46 +0200 jl r276005 : #i103989# could not signe encrypted doc containing a formular object 2009-09-09 13:11:24 +0200 jl r275985 : #i103989# could not signe encrypted doc containing a formular object 2009-09-08 15:54:02 +0200 mav r275934 : #i103906# fix the automation test scenario ( tempfile should be writable for the user ) 2009-09-07 14:01:39 +0200 mav r275895 : #i103906# fix the problem with reload 2009-09-07 09:34:48 +0200 mav r275871 : #i104786# do the ODF version check only for ODF documents 2009-09-07 08:19:06 +0200 mav r275870 : #i104389# fix text 2009-09-06 22:24:21 +0200 mav r275867 : #i104786# check the consistency of ODF version 2009-09-06 22:23:24 +0200 mav r275866 : #i104786# check the consistency of ODF version 2009-09-06 22:23:00 +0200 mav r275865 : #i104786# check the consistency of ODF version 2009-09-06 22:22:36 +0200 mav r275864 : #i104786# check the consistency of ODF version 2009-09-06 22:22:03 +0200 mav r275863 : #i104786# check the consistency of ODF version 2009-09-02 17:09:30 +0200 mav r275722 : #i104715# let repairing mechanics use the streams correctly 2009-09-01 16:52:49 +0200 mav r275670 : #i104389# notify user not to trust the corrupted document 2009-09-01 16:31:37 +0200 mav r275668 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:30:32 +0200 mav r275667 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:22:13 +0200 jl r275666 : #i104339# small content change 2009-09-01 14:20:42 +0200 jl r275660 : #i103519# remove some debug output 2009-09-01 13:51:52 +0200 jl r275659 : #i103519# NSS uses '\' for escaping in distinguished names 2009-09-01 12:49:47 +0200 mav r275655 : #i104389# use zip-mode to read from jar files 2009-09-01 12:40:22 +0200 mav r275653 : #i104389# use zip-mode to read from jar files 2009-09-01 12:32:29 +0200 mav r275652 : #i104389# use constants 2009-08-31 21:58:00 +0200 mav r275637 : #i10000# fix warning 2009-08-31 21:11:17 +0200 mav r275636 : #i104227# adding of scripting signature removes the document signature 2009-08-31 20:55:05 +0200 mav r275635 : #i103905# ZipStorage supports Compressed property 2009-08-31 20:53:55 +0200 mav r275634 : #i103905# adjust macro signature transfer to usage of ZipStorage 2009-08-31 15:30:49 +0200 jl r275609 : #i103989# warning is shown as long the user does not click 'OK' 2009-08-31 14:36:10 +0200 jl r275608 : #i103989# changed warning text when signing macro and there is a document signature. This warning is only displayed once 2009-08-31 13:34:41 +0200 mav r275603 : #i104452# disable macros in repaired documents 2009-08-31 13:33:42 +0200 mav r275602 : #i104452# disable macros in repaired documents 2009-08-31 13:03:56 +0200 jl r275600 : #i45212# signature dialog could not be started when using read-only documents 2009-08-31 09:26:13 +0200 mav r275583 : #i104578# store the additional entry as the last one to workaround parsing problem in OOo3.1 and later 2009-08-30 20:54:25 +0200 mav r275562 : #i10000# adopt for unix 2009-08-30 10:56:00 +0200 mav r275561 : CWS-TOOLING: rebase CWS encsig09 to trunk@275331 (milestone: DEV300:m56) 2009-08-28 16:34:00 +0200 mav r275539 : #i104578# write necessary info in manifest.xml for ODF1.2 encrypted document 2009-08-28 14:04:22 +0200 mav r275533 : #104587# fix handling of readonly streams 2009-08-28 13:58:10 +0200 mav r275531 : #i104389# fix the broken document handling 2009-08-28 11:40:39 +0200 mav r275522 : #i104389# fix the signature streams check 2009-08-27 21:48:12 +0200 mav r275509 : #i103927# show the warning 2009-08-27 21:47:48 +0200 mav r275508 : #i103927# show the warning 2009-08-27 16:45:59 +0200 jl r275495 : #i45212# remove unused variable 2009-08-27 16:34:00 +0200 jl r275494 : #i103989# 2009-08-27 13:54:28 +0200 jl r275482 : #i103519# fixed replacement of 'S' by 'ST' 2009-08-27 12:32:21 +0200 mav r275472 : #i10000# fix warning 2009-08-27 11:58:11 +0200 mav r275467 : #i104389# handle the entry path correctly 2009-08-26 17:18:35 +0200 jl r275438 : #i103519# subject and issuer distinguished names were not properly displayed. The strings were obtained by system functions (Windows, NSS), which use quotes to escape the values, when they contain special characters 2009-08-26 11:00:20 +0200 mav r275403 : #i10000# fix warnings 2009-08-26 08:25:45 +0200 mav r275392 : #i10000# fix warning 2009-08-26 08:02:22 +0200 mav r275391 : #i10000# adopt for linux 2009-08-26 07:40:30 +0200 mav r275390 : #i10000# fix warning 2009-08-26 07:35:28 +0200 mav r275389 : #i10000# use correct include file name 2009-08-25 15:01:41 +0200 jl r275356 : #i103989# better check for mimetype of streams 2009-08-25 09:07:09 +0200 mav r275335 : CWS-TOOLING: rebase CWS encsig09 to trunk@274622 (milestone: DEV300:m54) 2009-08-24 18:17:02 +0200 mav r275329 : #i103927# check the nonencrypted streams 2009-08-24 18:14:14 +0200 mav r275328 : #i103927# check the nonencrypted streams 2009-08-24 17:59:34 +0200 mav r275327 : #i103927#,#i104389# check the package consistency and nonencrypted streams 2009-08-24 16:18:28 +0200 jl r275323 : #i103989# added comment 2009-08-24 13:08:47 +0200 jl r275305 : #i45212# #i66276# only write the X509Certificate element once and allow to add remove several certificates at a time 2009-08-21 12:57:28 +0200 ufi r275239 : 104339 2009-08-21 08:39:05 +0200 jl r275213 : #i10398# comparing URIs of signed files with the 'element list' 2009-08-20 13:39:47 +0200 jl r275178 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:35:39 +0200 jl r275177 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:29:06 +0200 jl r275176 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:26:21 +0200 jl r275175 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 12:05:09 +0200 ufi r275170 : i104339 2009-08-19 12:24:54 +0200 jl r275146 : #i10398# displaying 'old signature' icon and status in signature dialog 2009-08-18 15:18:48 +0200 jl r275111 : #i103989# document signatures containing manifest.xml are now validated according to the final ODF1.2 spec 2009-08-18 11:41:06 +0200 mav r275087 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-18 11:35:13 +0200 mav r275085 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-14 17:32:41 +0200 jl r274999 : #i103989# using c14n tranformation for XML streams 2009-08-14 15:27:43 +0200 jl r274987 : #i103989# remove special handling for encrypted document streams in UriBindingHelper::OpenInputStream, since we use zip storage this is not necessary anymore 2009-08-14 15:08:10 +0200 jl r274983 : #i103989# Showing a message when adding or removing a macro signature, that the document signature will be removed 2009-08-14 14:57:27 +0200 jl r274982 : #i103989# accesing Sequence at invalid index 2009-08-11 08:55:02 +0200 mav r274846 : #i103905# let signing service know if there is already a valid document signature 2009-08-10 11:33:37 +0200 jl r274799 : #i103905# do not truncate the stream 2009-08-10 10:43:47 +0200 mav r274797 : #i103905# provide the storage version 2009-08-07 16:58:46 +0200 jl r274780 : #i103989# 2009-08-07 16:56:19 +0200 jl r274779 : #i103989# using odf version string etc. 2009-08-07 15:20:53 +0200 mav r274771 : #i103905# provide the storage version 2009-08-07 15:19:12 +0200 mav r274770 : #i103905# provide the storage version 2009-08-07 12:41:45 +0200 mav r274758 : #103930# do not store thumbnail in case of encrypted document 2009-08-07 12:36:52 +0200 mav r274757 : #i103905# provide the storage version 2009-08-07 12:15:54 +0200 mav r274754 : #i103760# the signed state is not lost on saving 2009-08-07 12:06:19 +0200 mav r274753 : #i103760# avoid warning regarding signature removal on export 2009-08-07 12:06:01 +0200 mav r274752 : #i103760# avoid warning regarding signature removal on export 2009-08-06 08:47:34 +0200 mav r274703 : #i103905# allow to transport ODF version to the signing component 2009-08-05 21:34:42 +0200 mav r274701 : #i103905# allow to transport ODF version to the signing component 2009-08-05 15:48:17 +0200 mav r274683 : #i103905# allow to transport ODF version to the signing component 2009-08-05 14:58:12 +0200 jl r274673 : #i103989# documentsignature now signes all streams except documentsignatures.xml, all streams are processed as binary files 2009-08-05 12:00:32 +0200 mav r274648 : #i103905# allow to transport ODF version to the signing component 2009-08-04 10:57:04 +0200 jl r274612 : #i103989# added XInitialization 2009-07-31 10:32:27 +0200 mav r274516 : #i103905# use zip storage to sign documents 2009-07-30 14:01:33 +0200 mav r274489 : #i103906# optimize the usage of temporary medium 2009-07-30 14:00:28 +0200 mav r274488 : #i103906# optimize the usage of temporary medium 2009-07-30 13:59:09 +0200 mav r274487 : #i103906# optimize the usage of temporary medium 2009-07-30 13:50:44 +0200 mav r274485 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:53 +0200 mav r274484 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:13 +0200 mav r274483 : #i103906# optimize the usage of temporary medium 2009-07-30 13:47:09 +0200 mav r274482 : #i103905#,#i103906# let the signing process use zip-storage; optimize the usage of temporary medium 2009-07-21 09:10:31 +0200 mav r274159 : CWS-TOOLING: rebase CWS encsig09 to trunk@273468 (milestone: DEV300:m51) 2009-05-05 08:39:01 +0200 mav r271496 : #i100832# allow to sign macros only when there are any
2009-09-17 13:53:54 +00:00
xmlPopInputCallbacks(); //zipMatch
xmlFreeDoc(res);
xmlFreeDoc(doc);
xsltFreeStylesheet(cur);
2001-06-13 08:10:13 +00:00
}
2001-05-22 13:57:13 +00:00
}
InputStreamTransformer::~InputStreamTransformer()
{
2001-05-23 13:15:56 +00:00
delete[] buffer;
2001-05-22 13:57:13 +00:00
}
Any SAL_CALL InputStreamTransformer::queryInterface( const Type& rType ) throw( RuntimeException )
{
2001-05-23 13:15:56 +00:00
Any aRet = ::cppu::queryInterface( rType,
(static_cast< XInputStream* >(this)),
(static_cast< XSeekable* >(this)) );
2001-05-22 13:57:13 +00:00
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
2001-10-24 10:17:19 +00:00
void SAL_CALL InputStreamTransformer::acquire( void ) throw()
2001-05-22 13:57:13 +00:00
{
OWeakObject::acquire();
}
2001-10-24 10:17:19 +00:00
void SAL_CALL InputStreamTransformer::release( void ) throw()
2001-05-22 13:57:13 +00:00
{
OWeakObject::release();
}
sal_Int32 SAL_CALL InputStreamTransformer::readBytes( Sequence< sal_Int8 >& aData,sal_Int32 nBytesToRead )
throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException)
2001-05-22 13:57:13 +00:00
{
osl::MutexGuard aGuard( m_aMutex );
int curr,available_ = len-pos;
if( nBytesToRead <= available_ )
2001-05-23 13:15:56 +00:00
curr = nBytesToRead;
else
curr = available_;
2001-05-23 13:15:56 +00:00
if( 0 <= curr && aData.getLength() < curr )
aData.realloc( curr );
2001-05-22 13:57:13 +00:00
2001-05-23 13:15:56 +00:00
for( int k = 0; k < curr; ++k )
aData[k] = buffer[pos++];
return curr > 0 ? curr : 0;
}
2001-05-22 13:57:13 +00:00
sal_Int32 SAL_CALL InputStreamTransformer::readSomeBytes( Sequence< sal_Int8 >& aData,sal_Int32 nMaxBytesToRead )
throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException)
{
2001-05-23 13:15:56 +00:00
return readBytes( aData,nMaxBytesToRead );
2001-05-22 13:57:13 +00:00
}
void SAL_CALL InputStreamTransformer::skipBytes( sal_Int32 nBytesToSkip ) throw( NotConnectedException,
BufferSizeExceededException,
IOException,
RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
2001-05-23 13:15:56 +00:00
while( nBytesToSkip-- ) ++pos;
2001-05-22 13:57:13 +00:00
}
sal_Int32 SAL_CALL InputStreamTransformer::available( void ) throw( NotConnectedException,
IOException,
RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
2001-05-23 13:15:56 +00:00
return len-pos > 0 ? len - pos : 0 ;
2001-05-22 13:57:13 +00:00
}
void SAL_CALL InputStreamTransformer::closeInput( void ) throw( NotConnectedException,
IOException,
RuntimeException )
{
}
void SAL_CALL InputStreamTransformer::seek( sal_Int64 location ) throw( IllegalArgumentException,
IOException,
RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
2001-05-23 13:15:56 +00:00
if( location < 0 )
throw IllegalArgumentException();
else
pos = sal::static_int_cast<sal_Int32>( location );
2001-05-23 13:15:56 +00:00
if( pos > len )
pos = len;
2001-05-22 13:57:13 +00:00
}
sal_Int64 SAL_CALL InputStreamTransformer::getPosition( void ) throw( IOException,
RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
2001-05-23 13:15:56 +00:00
return sal_Int64( pos );
2001-05-22 13:57:13 +00:00
}
sal_Int64 SAL_CALL InputStreamTransformer::getLength( void ) throw( IOException,RuntimeException )
{
osl::MutexGuard aGuard( m_aMutex );
2001-05-23 13:15:56 +00:00
return len;
}
void InputStreamTransformer::addToBuffer( const char* buffer_,int len_ )
{
osl::MutexGuard aGuard( m_aMutex );
2001-05-23 13:15:56 +00:00
char* tmp = buffer;
buffer = new char[ len+len_ ];
memcpy( (void*)(buffer),(void*)(tmp),sal_uInt32( len ) );
memcpy( (void*)(buffer+len),(void*)(buffer_),sal_uInt32( len_ ) );
delete[] tmp;
2001-05-23 13:15:56 +00:00
len += len_;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */