diff options
author | Michael Brauer <mib@openoffice.org> | 2001-06-19 14:21:16 +0000 |
---|---|---|
committer | Michael Brauer <mib@openoffice.org> | 2001-06-19 14:21:16 +0000 |
commit | dcd225e40cf4e881e495f33155f321d5b4b03e0c (patch) | |
tree | b2b933a8a83aee9443b8c4ccf2d6f05b2cc6f0cd /xmloff/source/style | |
parent | 10763f3a937772e924a9bb5198aa57921b3edaa5 (diff) |
#87313#: embedded images as base64
Diffstat (limited to 'xmloff/source/style')
-rw-r--r-- | xmloff/source/style/xmlnumi.cxx | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index 555218622c4f..6056e86996e5 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlnumi.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: mib $ $Date: 2001-06-19 07:05:49 $ + * last change: $Author: mib $ $Date: 2001-06-19 15:21:16 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -76,6 +76,9 @@ #include "nmspmap.hxx" #include "xmlnmspe.hxx" #include "xmlimp.hxx" +#ifndef _XMLOFF_XMLBASE64IMPORTCONTEXT_HXX +#include "XMLBase64ImportContext.hxx" +#endif #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ #include <com/sun/star/beans/PropertyValue.hpp> @@ -104,6 +107,9 @@ #ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_ #include <com/sun/star/style/XStyle.hpp> #endif +#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_ +#include <com/sun/star/io/XOutputStream.hpp> +#endif #include "xmlkywd.hxx" #include "i18nmap.hxx" @@ -136,6 +142,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::frame; using namespace ::xmloff::token; +using namespace ::com::sun::star::io; static sal_Char __READONLY_DATA XML_UNO_NAME_NRULE_SYMBOL_TEXT_DISTANCE[] = "SymbolTextDistance"; @@ -233,6 +240,8 @@ class SvxXMLListLevelStyleContext_Impl : public SvXMLImportContext OUString sBulletFontStyleName; OUString sImageURL; + Reference < XOutputStream > xBase64Stream; + sal_Int32 nLevel; sal_Int32 nSpaceBefore; sal_Int32 nMinLabelWidth; @@ -420,7 +429,19 @@ SvXMLImportContext *SvxXMLListLevelStyleContext_Impl::CreateChildContext( xAttrList, *this ); } - else + else if( xmloff::token::IsXMLToken( rLocalName, + xmloff::token::XML_BINARY_DATA ) ) + { + if( bImage && !sImageURL.getLength() && !xBase64Stream.is() ) + { + xBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64(); + if( xBase64Stream.is() ) + pContext = new XMLBase64ImportContext( GetImport(), nPrefix, + rLocalName, xAttrList, + xBase64Stream ); + } + } + if( !pContext ) { pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName ); } @@ -445,7 +466,7 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( nCount = 10L; } - if( bImage && sImageURL.getLength() > 0L && + if( bImage && (sImageURL.getLength() > 0L || xBase64Stream.is()) && nImageWidth > 0L && nImageHeight > 0L ) { eType = NumberingType::BITMAP; @@ -555,8 +576,19 @@ Sequence<beans::PropertyValue> SvxXMLListLevelStyleContext_Impl::GetProperties( if( bImage ) { + if( sImageURL.getLength() ) + { + sImageURL = GetImport().ResolveGraphicObjectURL( sImageURL, + sal_False ); + } + else if( xBase64Stream.is() ) + { + sImageURL = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream ); + xBase64Stream = 0; + } pProps[nPos].Name = OUString::createFromAscii( XML_UNO_NAME_NRULE_GRAPHICURL ); + pProps[nPos++].Value <<= sImageURL; pProps[nPos++].Value <<= GetImport().ResolveGraphicObjectURL( sImageURL, sal_False ); |