diff options
author | Michael Brauer <mib@openoffice.org> | 2001-05-18 12:58:34 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2001-05-18 12:58:34 +0000 |
commit | d5715eb99a1000375db43db792dedcabb4295988 (patch) | |
tree | f91b8c6dcd8da759538b19606b1ce59d2057a096 | |
parent | af816c5daeb4f361252682cf37cba18ceb02a217 (diff) |
#87246#: OLE object support through SAX interface
-rw-r--r-- | svx/source/xml/xmleohlp.cxx | 6 | ||||
-rw-r--r-- | xmloff/prj/d.lst | 1 | ||||
-rw-r--r-- | xmloff/source/core/makefile.mk | 8 | ||||
-rw-r--r-- | xmloff/source/core/xmlexp.cxx | 38 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 28 | ||||
-rw-r--r-- | xmloff/source/core/xmluconv.cxx | 151 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 54 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.hxx | 15 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 8 | ||||
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 5 |
10 files changed, 217 insertions, 97 deletions
diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index 134c3bed1917..63578eff5c97 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -2,7 +2,7 @@ * * $RCSfile: xmleohlp.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * * last change: $Author: mib $ * @@ -499,8 +499,8 @@ sal_Bool SvXMLEmbeddedObjectHelper::ImplReadObject( { SvInfoObject* pTst = mpDocPersist->GetObjectList()->GetObject(i); // TODO: unicode: is this correct? - if( rObjName.equalsIgnoreCase( pTst->GetObjName() ) || - rObjName.equalsIgnoreCase( pTst->GetStorageName() ) ) + if( rObjName.equalsIgnoreAsciiCase( pTst->GetObjName() ) || + rObjName.equalsIgnoreAsciiCase( pTst->GetStorageName() ) ) { rObjName = ImplGetUniqueName( xDocStor, "Obj" ); break; diff --git a/xmloff/prj/d.lst b/xmloff/prj/d.lst index 51311192be8e..bceb722a8094 100644 --- a/xmloff/prj/d.lst +++ b/xmloff/prj/d.lst @@ -103,6 +103,7 @@ hedabu: ..\inc\DocumentSettingsContext.hxx %_DEST%\inc%_EXT%\xmloff\DocumentSett hedabu: ..\inc\XMLGraphicsDefaultStyle.hxx %_DEST%\inc%_EXT%\xmloff\XMLGraphicsDefaultStyle.hxx hedabu: ..\inc\XMLEmbeddedObjectExportFilter.hxx %_DEST%\inc%_EXT%\xmloff\XMLEmbeddedObjectExportFilter.hxx hedabu: ..\inc\XMLFilterServiceNames.h %_DEST%\inc%_EXT%\xmloff\XMLFilterServiceNames.h +hedabu: ..\inc\XMLBase64Export.hxx %_DEST%\inc%_EXT%\xmloff\XMLBase64Export.hxx hedabu: ..\inc\xmltoken.hxx %_DEST%\inc%_EXT%\xmloff\xmltoken.hxx ..\%__SRC%\lib\lib*static*.dylib %_DEST%\lib%_EXT%\lib*static*.dylib diff --git a/xmloff/source/core/makefile.mk b/xmloff/source/core/makefile.mk index 804fbeeec038..7ad9d8ffa341 100644 --- a/xmloff/source/core/makefile.mk +++ b/xmloff/source/core/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.13 $ +# $Revision: 1.14 $ # -# last change: $Author: dvo $ $Date: 2001-05-17 08:47:06 $ +# last change: $Author: mib $ $Date: 2001-05-18 13:46:50 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -102,8 +102,8 @@ SLOFILES = \ $(SLO)$/SettingsExportHelper.obj \ $(SLO)$/DocumentSettingsContext.obj \ $(SLO)$/XMLEmbeddedObjectExportFilter.obj \ - $(SLO)$/XMLEmbeddedObjectImportContext.obj -# --- UNO stuff --------------------------------------------------- + $(SLO)$/XMLEmbeddedObjectImportContext.obj \ + $(SLO)$/XMLBase64Export.obj CPPUMAKERFLAGS= UNOUCRDEP= $(SOLARBINDIR)$/offapi.rdb diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 83cf80fc0651..a4ecdccfb499 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlexp.cxx,v $ * - * $Revision: 1.65 $ + * $Revision: 1.66 $ * - * last change: $Author: sab $ $Date: 2001-05-17 14:07:36 $ + * last change: $Author: mib $ $Date: 2001-05-18 13:46:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,12 @@ #ifndef _COMPHELPER_PROCESSFACTORY_HXX_ #include <comphelper/processfactory.hxx> #endif +#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_ +#include <com/sun/star/container/XNameAccess.hpp> +#endif +#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_ +#include <com/sun/star/io/XInputStream.hpp> +#endif #ifndef _XMLOFF_ATTRLIST_HXX #include "attrlist.hxx" @@ -171,6 +177,9 @@ #ifndef _XMLOFF_XMLIMAGEMAPEXPORT_HXX_ #include "XMLImageMapExport.hxx" #endif +#ifndef _XMLOFF_XMLBASE64EXPORT_HXX_ +#include "XMLBase64Export.hxx" +#endif #ifndef _COM_SUN_STAR_LANG_SERVICENOTREGISTEREDEXCEPTION_HPP_ #include <com/sun/star/lang/ServiceNotRegisteredException.hpp> @@ -192,6 +201,7 @@ using namespace ::com::sun::star::lang; using namespace ::com::sun::star::document; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::xml::sax; +using namespace ::com::sun::star::io; using namespace ::xmloff::token; sal_Char __READONLY_DATA sXML_1_0[] = "1.0"; @@ -1228,6 +1238,30 @@ OUString SvXMLExport::AddEmbeddedObject( const OUString& rEmbeddedObjectURL ) return sRet; } +sal_Bool SvXMLExport::AddEmbeddedObjectAsBase64( const OUString& rEmbeddedObjectURL ) +{ + sal_Bool bRet = sal_False; + if( 0 == rEmbeddedObjectURL.compareTo( sEmbeddedObjectProtocol, + sEmbeddedObjectProtocol.getLength() ) && + xEmbeddedResolver.is() ) + { + Reference < XNameAccess > xNA( xEmbeddedResolver, UNO_QUERY ); + if( xNA.is() ) + { + Any aAny = xNA->getByName( rEmbeddedObjectURL ); + Reference < XInputStream > xIn; + aAny >>= xIn; + if( xIn.is() ) + { + XMLBase64Export aBase64Exp( *this ); + bRet = aBase64Exp.exportXML( xIn ); + } + } + } + + return bRet; +} + ProgressBarHelper* SvXMLExport::GetProgressBarHelper() { if (!pProgressBarHelper) diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index a60450e0462d..e73d3d3479fe 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlimp.cxx,v $ * - * $Revision: 1.38 $ + * $Revision: 1.39 $ * - * last change: $Author: sab $ $Date: 2001-05-17 14:07:36 $ + * last change: $Author: mib $ $Date: 2001-05-18 13:46:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -121,6 +121,9 @@ #ifndef _COM_SUN_STAR_LANG_SERVICENOTREGISTEREDEXCEPTION_HPP_ #include <com/sun/star/lang/ServiceNotRegisteredException.hpp> #endif +#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_ +#include <com/sun/star/io/XOutputStream.hpp> +#endif #ifndef _COMPHELPER_NAMECONTAINER_HXX_ #include <comphelper/namecontainer.hxx> @@ -132,6 +135,8 @@ using namespace ::com::sun::star; using namespace ::com::sun::star::frame; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::util; +using namespace ::com::sun::star::io; +using namespace ::com::sun::star::container; sal_Char __READONLY_DATA sXML_np__office[] = "_office"; sal_Char __READONLY_DATA sXML_np__style[] = "_style"; @@ -844,6 +849,25 @@ const Reference< container::XNameContainer > & SvXMLImport::GetDashHelper() return sRet; } +Reference < XOutputStream > SvXMLImport::ResolveEmbeddedObjectURLFromBase64( + const ::rtl::OUString& rURL ) +{ + Reference < XOutputStream > xOLEStream; + + if( 0 == rURL.compareTo( ::rtl::OUString( '#' ), 1 ) && + xEmbeddedResolver.is() ) + { + Reference< XNameAccess > xNA( xEmbeddedResolver, UNO_QUERY ); + if( xNA.is() ) + { + Any aAny = xNA->getByName( rURL ); + aAny >>= xOLEStream; + } + } + + return xOLEStream; +} + void SvXMLImport::SetViewSettings(const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aViewProps) { } diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index 856bda9bf312..5ead806548bf 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmluconv.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: th $ $Date: 2001-05-14 08:42:39 $ + * last change: $Author: mib $ $Date: 2001-05-18 13:46:50 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1524,36 +1524,24 @@ const const sal_uInt8 aBase64DecodeTable[] = - { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0-15 - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16-31 - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, 0, 0, 0, 63, // 32-47 + { 62,255,255,255, 63, // 43-47 // + / - 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 0, 0, 0, 0, 0, 0, // 48-63 + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,255,255,255, 0,255,255, // 48-63 // 0 1 2 3 4 5 6 7 8 9 = - 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 64-79 + 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, // 64-79 // A B C D E F G H I J K L M N O - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 0, 0, 0, 0, 0, // 80-95 + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,255,255,255,255,255, // 80-95 // P Q R S T U V W X Y Z 0, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, // 96-111 // a b c d e f g h i j k l m n o - 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 0, 0, 0, 0, 0, // 112-127 + 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51 }; // 112-123 // p q r s t u v w x y z - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; void ThreeByteToFourByte (const sal_Int8* pBuffer, const sal_Int32 nStart, const sal_Int32 nFullLen, rtl::OUStringBuffer& sBuffer) @@ -1623,69 +1611,82 @@ void SvXMLUnitConverter::encodeBase64(rtl::OUStringBuffer& aStrBuffer, const uno } } -const rtl::OUString s2equal(RTL_CONSTASCII_USTRINGPARAM("==")); -const rtl::OUString s1equal(RTL_CONSTASCII_USTRINGPARAM("=")); - -void FourByteToThreeByte (sal_Int8* pBuffer, sal_Int32& nLength, const sal_Int32 nStart, const rtl::OUString& sString) +void SvXMLUnitConverter::decodeBase64(uno::Sequence<sal_Int8>& aBuffer, const rtl::OUString& sBuffer) { - nLength = 0; - sal_Int32 nLen (sString.getLength()); - - if (nLen != 4) - { - DBG_ERROR("wrong length"); - return; - } - - - if (sString.indexOf(s2equal) == 2) - nLength = 1; - else if (sString.indexOf(s1equal) == 3) - nLength = 2; - else - nLength = 3; - - sal_Int32 nBinaer ((aBase64DecodeTable [sString [0]] << 18) + - (aBase64DecodeTable [sString [1]] << 12) + - (aBase64DecodeTable [sString [2]] << 6) + - (aBase64DecodeTable [sString [3]])); - - sal_uInt8 OneByte ((nBinaer & 0xFF0000) >> 16); - pBuffer[nStart + 0] = (sal_Int8)OneByte; - - if (nLength == 1) - return; - - OneByte = (nBinaer & 0xFF00) >> 8; - pBuffer[nStart + 1] = (sal_Int8)OneByte; - - if (nLength == 2) - return; - - OneByte = nBinaer & 0xFF; - pBuffer[nStart + 2] = (sal_Int8)OneByte; + sal_Int32 nCharsDecoded = decodeBase64SomeChars( aBuffer, sBuffer ); + OSL_ENSURE( nCharsDecoded == sBuffer.getLength(), + "some bytes left in base64 decoding!" ); } -void SvXMLUnitConverter::decodeBase64(uno::Sequence<sal_Int8>& aBuffer, const rtl::OUString& sBuffer) +sal_Int32 SvXMLUnitConverter::decodeBase64SomeChars( + uno::Sequence<sal_Int8>& rOutBuffer, + const rtl::OUString& rInBuffer) { - sal_Int32 nFirstLength((sBuffer.getLength() / 4) * 3); - sal_Int8* pBuffer = new sal_Int8[nFirstLength]; - sal_Int32 nSecondLength(0); - sal_Int32 nLength(0); - sal_Int32 i = 0; - sal_Int32 k = 0; - while (i < sBuffer.getLength()) + sal_Int32 nInBufferLen = rInBuffer.getLength(); + sal_Int32 nMinOutBufferLen = (nInBufferLen / 4) * 3; + if( rOutBuffer.getLength() < nMinOutBufferLen ) + rOutBuffer.realloc( nMinOutBufferLen ); + + const sal_Unicode *pInBuffer = rInBuffer.getStr(); + sal_Int8 *pOutBuffer = rOutBuffer.getArray(); + sal_Int8 *pOutBufferStart = pOutBuffer; + sal_Int32 nCharsDecoded = 0; + + sal_uInt8 aDecodeBuffer[4]; + sal_Int32 nBytesToDecode = 0; + sal_Int32 nBytesGotFromDecoding = 3; + sal_Int32 nInBufferPos= 0; + while( nInBufferPos < nInBufferLen ) { - FourByteToThreeByte (pBuffer, nLength, k, sBuffer.copy(i, 4)); - nSecondLength += nLength; - nLength = 0; - i += 4; - k += 3; + sal_Unicode cChar = *pInBuffer; + if( cChar >= '+' && cChar <= 'z' ) + { + sal_uInt8 nByte = aBase64DecodeTable[cChar-'+']; + if( nByte != 255 ) + { + // We have found a valid character! + aDecodeBuffer[nBytesToDecode++] = nByte; + + // One '=' character at the end means 2 out bytes + // Two '=' characters at the end mean 1 out bytes + if( '=' == cChar && nBytesToDecode > 2 ) + nBytesGotFromDecoding--; + if( 4 == nBytesToDecode ) + { + // Four characters found, so we may convert now! + sal_uInt32 nOut = (aDecodeBuffer[0] << 18) + + (aDecodeBuffer[1] << 12) + + (aDecodeBuffer[2] << 6) + + aDecodeBuffer[3]; + + *pOutBuffer++ = (sal_Int8)((nOut & 0xff0000) >> 16); + if( nBytesGotFromDecoding > 1 ) + *pOutBuffer++ = (sal_Int8)((nOut & 0xff00) >> 8); + if( nBytesGotFromDecoding > 2 ) + *pOutBuffer++ = (sal_Int8)(nOut & 0xff); + nCharsDecoded = nInBufferPos + 1; + nBytesToDecode = 0; + nBytesGotFromDecoding = 3; + } + } + else + { + nCharsDecoded++; + } + } + else + { + nCharsDecoded++; + } + + nInBufferPos++; + pInBuffer++; } - aBuffer = uno::Sequence<sal_Int8>(pBuffer, nSecondLength); - delete[] pBuffer; -} + if( (pOutBuffer - pOutBufferStart) != rOutBuffer.getLength() ) + rOutBuffer.realloc( pOutBuffer - pOutBufferStart ); + return nCharsDecoded; +} sal_Bool SvXMLUnitConverter::convertNumFormat( sal_Int16& rType, diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 64fc617ee51a..c2b231907579 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextFrameContext.cxx,v $ * - * $Revision: 1.41 $ + * $Revision: 1.42 $ * - * last change: $Author: mib $ $Date: 2001-05-09 12:17:14 $ + * last change: $Author: mib $ $Date: 2001-05-18 13:50:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -90,6 +90,9 @@ #ifndef _COM_SUN_STAR_DOCUMENT_XEMBEDDEDOBJECTSUPPLIER_HPP_ #include <com/sun/star/document/XEmbeddedObjectSupplier.hpp> #endif +#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_ +#include <com/sun/star/io/XOutputStream.hpp> +#endif #ifndef _XMLOFF_XMLIMP_HXX #include "xmlimp.hxx" #endif @@ -652,6 +655,7 @@ XMLTextFrameContext::XMLTextFrameContext( bMinHeight = sal_False; bSyncWidth = sal_False; bSyncHeight = sal_False; + bCreateOLEStreamFailed = sal_False; UniReference < XMLTextImportHelper > xTxtImport = GetImport().GetTextImport(); @@ -843,7 +847,7 @@ XMLTextFrameContext::XMLTextFrameContext( if( (XML_TEXT_FRAME_APPLET == nType || XML_TEXT_FRAME_PLUGIN == nType || XML_TEXT_FRAME_GRAPHIC == nType || XML_TEXT_FRAME_OBJECT == nType || - XML_TEXT_FRAME_OBJECT_OLE == nType) + XML_TEXT_FRAME_OBJECT_OLE == nType) && !sHRef.getLength() ) return; // no URL: no image or OLE object @@ -856,6 +860,13 @@ XMLTextFrameContext::~XMLTextFrameContext() void XMLTextFrameContext::EndElement() { + if( XML_TEXT_FRAME_OBJECT_OLE == nType && !xPropSet.is() && + xOLEStream.is() ) + { + xOLEStream->closeOutput(); + Create( sal_True ); + } + // alternative text if( sDesc.getLength() ) { @@ -981,6 +992,43 @@ SvXMLImportContext *XMLTextFrameContext::CreateChildContext( return pContext; } +void XMLTextFrameContext::Characters( const OUString& rChars ) +{ + if( XML_TEXT_FRAME_OBJECT_OLE == nType && !xPropSet.is() ) + { + OUString sTrimmedChars( rChars. trim() ); + if( sTrimmedChars.getLength() ) + { + if( !xOLEStream.is() && !bCreateOLEStreamFailed ) + { + sHRef = OUString( RTL_CONSTASCII_USTRINGPARAM( "#Obj12345678" ) ); + xOLEStream = + GetImport().ResolveEmbeddedObjectURLFromBase64( sHRef ); + } + if( xOLEStream.is() ) + { + OUString sChars; + if( sBase64CharsLeft ) + { + sChars = sBase64CharsLeft; + sChars += sTrimmedChars; + sBase64CharsLeft = OUString(); + } + else + { + sChars = sTrimmedChars; + } + Sequence< sal_Int8 > aBuffer( (sChars.getLength() / 4) * 3 ); + sal_Int32 nCharsDecoded = + GetImport().GetMM100UnitConverter(). + decodeBase64SomeChars( aBuffer, sChars ); + xOLEStream->writeBytes( aBuffer ); + if( nCharsDecoded != sChars.getLength() ) + sBase64CharsLeft = sChars.copy( nCharsDecoded ); + } + } + } +} void XMLTextFrameContext::SetHyperlink( const OUString& rHRef, const OUString& rName, diff --git a/xmloff/source/text/XMLTextFrameContext.hxx b/xmloff/source/text/XMLTextFrameContext.hxx index 96d9a9db5f73..2a8659f76b82 100644 --- a/xmloff/source/text/XMLTextFrameContext.hxx +++ b/xmloff/source/text/XMLTextFrameContext.hxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextFrameContext.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: dvo $ $Date: 2001-05-17 14:27:40 $ + * last change: $Author: mib $ $Date: 2001-05-18 13:54:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,6 +62,10 @@ #ifndef _XMLTEXTFRAMECONTEXT_HXX #define _XMLTEXTFRAMECONTEXT_HXX +#ifndef __SGI_STL_MAP +#include <map> +#endif + #ifndef _COM_SUN_STAR_TEXT_TEXTCONTENTANCHORTYPE_HPP #include <com/sun/star/text/TextContentAnchorType.hpp> #endif @@ -84,6 +88,7 @@ namespace com { namespace sun { namespace star { namespace text { class XTextCursor; class XTextContent; } namespace beans { class XPropertySet; } + namespace io { class XOutputStream; } } } } #define XML_TEXT_FRAME_TEXTBOX 1 @@ -106,6 +111,8 @@ class XMLTextFrameContext : public SvXMLImportContext ::com::sun::star::text::XTextCursor > xOldTextCursor; ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > xPropSet; + ::com::sun::star::uno::Reference < + ::com::sun::star::io::XOutputStream > xOLEStream; const ::rtl::OUString sWidth; const ::rtl::OUString sRelativeWidth; @@ -140,6 +147,7 @@ class XMLTextFrameContext : public SvXMLImportContext ::rtl::OUString sAppletName; ::rtl::OUString sDesc; ::rtl::OUString sFilterService; + ::rtl::OUString sBase64CharsLeft; ParamMap aParamMap; @@ -160,6 +168,7 @@ class XMLTextFrameContext : public SvXMLImportContext sal_Bool bMinHeight : 1; sal_Bool bSyncWidth : 1; sal_Bool bSyncHeight : 1; + sal_Bool bCreateOLEStreamFailed : 1; void Create( sal_Bool bLinked ); @@ -178,6 +187,8 @@ public: virtual void EndElement(); + virtual void Characters( const ::rtl::OUString& rChars ); + SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, const ::com::sun::star::uno::Reference< diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 46cb4baf9d78..65d1ece2c394 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtimp.cxx,v $ * - * $Revision: 1.73 $ + * $Revision: 1.74 $ * - * last change: $Author: dvo $ $Date: 2001-05-17 14:27:40 $ + * last change: $Author: mib $ $Date: 2001-05-18 13:50:59 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1504,8 +1504,8 @@ SvXMLImportContext *XMLTextImportHelper::CreateTextChildContext( : TextContentAnchorType_AT_PAGE; pContext = new XMLTextFrameContext( rImport, nPrefix, rLocalName, xAttrList, eAnchorType, - bObjectOLE ? XML_TEXT_FRAME_OBJECT - : XML_TEXT_FRAME_OBJECT_OLE ); + bObjectOLE ? XML_TEXT_FRAME_OBJECT_OLE + : XML_TEXT_FRAME_OBJECT ); bContent = sal_False; } break; diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index 471be198ce2b..1bc5b462cc45 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtparai.cxx,v $ * - * $Revision: 1.23 $ + * $Revision: 1.24 $ * - * last change: $Author: mib $ $Date: 2001-04-25 13:35:19 $ + * last change: $Author: mib $ $Date: 2001-05-18 13:52:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1634,6 +1634,7 @@ SvXMLImportContext *XMLImpSpanContext_Impl::CreateChildContext( case XML_TOK_TEXT_OBJECT_OLE: bInsertTextFrame = sal_True; nTextFrameType = XML_TEXT_FRAME_OBJECT_OLE; + break; case XML_TOK_TEXT_OBJECT: bInsertTextFrame = sal_True; nTextFrameType = XML_TEXT_FRAME_OBJECT; |