Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include "ppttoxml.hxx"
31 : : #include <sot/storage.hxx>
32 : :
33 : 0 : PptToXml::PptToXml()
34 : : {
35 : 0 : }
36 : :
37 : 0 : PptToXml::~PptToXml()
38 : : {
39 : 0 : }
40 : :
41 : 0 : sal_Bool PptToXml::filter( const SEQ( NMSP_BEANS::PropertyValue )& aDescriptor,
42 : : REF( NMSP_SAX::XDocumentHandler ) xHandler )
43 : : {
44 : 0 : xHdl = xHandler;
45 : :
46 : 0 : sal_Bool bStatus = sal_False;
47 : : sal_Int32 i;
48 : 0 : for( i = 0; i < aDescriptor.getLength(); i++ )
49 : : {
50 : 0 : NMSP_RTL::OUString strTemp;
51 : 0 : aDescriptor[ i ].Value >>= strTemp;
52 : :
53 : 0 : if ( aDescriptor[ i ].Name == B2UCONST( "URL" ) )
54 : : {
55 : 0 : NMSP_RTL::OUString sURL;
56 : 0 : aDescriptor[ i ].Value >>= sURL;
57 : 0 : SotStorageRef xStg( new SotStorage( sURL, STREAM_STD_READ, 0 ) );
58 : 0 : if ( xStg.Is() )
59 : : {
60 : 0 : SotStorageStreamRef xDocStream( xStg->OpenSotStream( B2UCONST( "PowerPoint Document" ), STREAM_STD_READ ) );
61 : 0 : if( xDocStream.Is() )
62 : : {
63 : 0 : xDocStream->SetVersion( xStg->GetVersion() );
64 : 0 : xDocStream->SetCryptMaskKey(xStg->GetKey());
65 : :
66 : 0 : xHdl->startDocument();
67 : :
68 : :
69 : 0 : xHdl->endDocument();
70 : 0 : bStatus = sal_True;
71 : 0 : }
72 : 0 : }
73 : : }
74 : 0 : }
75 : 0 : return bStatus;
76 : : }
77 : :
78 : 0 : void PptToXml::cancel()
79 : : {
80 : :
81 : 0 : }
82 : :
83 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|