1*f6e50924SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*f6e50924SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*f6e50924SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*f6e50924SAndrew Rist * distributed with this work for additional information 6*f6e50924SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*f6e50924SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*f6e50924SAndrew Rist * "License"); you may not use this file except in compliance 9*f6e50924SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*f6e50924SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*f6e50924SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*f6e50924SAndrew Rist * software distributed under the License is distributed on an 15*f6e50924SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*f6e50924SAndrew Rist * KIND, either express or implied. See the License for the 17*f6e50924SAndrew Rist * specific language governing permissions and limitations 18*f6e50924SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*f6e50924SAndrew Rist *************************************************************/ 21*f6e50924SAndrew Rist 22*f6e50924SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_svx.hxx" 26cdf0e10cSrcweir #include <tools/debug.hxx> 27cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp> 28cdf0e10cSrcweir #include <com/sun/star/xml/sax/XDocumentHandler.hpp> 29cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 30cdf0e10cSrcweir #include <com/sun/star/drawing/PolyPolygonBezierCoords.hpp> 31cdf0e10cSrcweir #include <com/sun/star/drawing/LineDash.hpp> 32cdf0e10cSrcweir #include <com/sun/star/awt/Gradient.hpp> 33cdf0e10cSrcweir #include <com/sun/star/drawing/Hatch.hpp> 34cdf0e10cSrcweir #include <com/sun/star/io/XActiveDataSource.hpp> 35cdf0e10cSrcweir #include <com/sun/star/embed/ElementModes.hpp> 36cdf0e10cSrcweir #include <sfx2/docfile.hxx> 37cdf0e10cSrcweir #include <rtl/ustrbuf.hxx> 38cdf0e10cSrcweir #include <xmloff/xmluconv.hxx> 39cdf0e10cSrcweir #include "xmloff/xmlnmspe.hxx" 40cdf0e10cSrcweir #include "xmloff/nmspmap.hxx" 41cdf0e10cSrcweir 42cdf0e10cSrcweir #include "xmloff/xmltoken.hxx" 43cdf0e10cSrcweir #include "xmloff/xmlmetae.hxx" 44cdf0e10cSrcweir #include "xmloff/DashStyle.hxx" 45cdf0e10cSrcweir #include "xmloff/GradientStyle.hxx" 46cdf0e10cSrcweir #include "xmloff/HatchStyle.hxx" 47cdf0e10cSrcweir #include "xmloff/ImageStyle.hxx" 48cdf0e10cSrcweir #include "xmloff/MarkerStyle.hxx" 49cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp> 50cdf0e10cSrcweir #include <com/sun/star/embed/XTransactedObject.hpp> 51cdf0e10cSrcweir #include <comphelper/processfactory.hxx> 52cdf0e10cSrcweir #include <unotools/streamwrap.hxx> 53cdf0e10cSrcweir #include "svx/xmlgrhlp.hxx" 54cdf0e10cSrcweir 55cdf0e10cSrcweir #include "xmlxtexp.hxx" 56cdf0e10cSrcweir 57cdf0e10cSrcweir #include <comphelper/storagehelper.hxx> 58cdf0e10cSrcweir 59cdf0e10cSrcweir using namespace com::sun::star; 60cdf0e10cSrcweir using namespace com::sun::star::container; 61cdf0e10cSrcweir using namespace com::sun::star::document; 62cdf0e10cSrcweir using namespace com::sun::star::uno; 63cdf0e10cSrcweir using namespace com::sun::star::awt; 64cdf0e10cSrcweir using namespace com::sun::star::lang; 65cdf0e10cSrcweir using namespace com::sun::star::xml::sax; 66cdf0e10cSrcweir using namespace ::xmloff::token; 67cdf0e10cSrcweir using namespace ::rtl; 68cdf0e10cSrcweir using namespace cppu; 69cdf0e10cSrcweir 70cdf0e10cSrcweir using com::sun::star::embed::XTransactedObject; 71cdf0e10cSrcweir 72cdf0e10cSrcweir class SvxXMLTableEntryExporter 73cdf0e10cSrcweir { 74cdf0e10cSrcweir public: 75cdf0e10cSrcweir SvxXMLTableEntryExporter( SvXMLExport& rExport ) : mrExport( rExport ) {} 76cdf0e10cSrcweir virtual ~SvxXMLTableEntryExporter(); 77cdf0e10cSrcweir 78cdf0e10cSrcweir virtual void exportEntry( const OUString& rStrName, const Any& rValue ) = 0; 79cdf0e10cSrcweir 80cdf0e10cSrcweir protected: 81cdf0e10cSrcweir SvXMLExport& mrExport; 82cdf0e10cSrcweir }; 83cdf0e10cSrcweir 84cdf0e10cSrcweir class SvxXMLColorEntryExporter : public SvxXMLTableEntryExporter 85cdf0e10cSrcweir { 86cdf0e10cSrcweir public: 87cdf0e10cSrcweir SvxXMLColorEntryExporter( SvXMLExport& rExport ); 88cdf0e10cSrcweir virtual ~SvxXMLColorEntryExporter(); 89cdf0e10cSrcweir 90cdf0e10cSrcweir virtual void exportEntry( const OUString& rStrName, const Any& rValue ); 91cdf0e10cSrcweir }; 92cdf0e10cSrcweir 93cdf0e10cSrcweir class SvxXMLLineEndEntryExporter : public SvxXMLTableEntryExporter 94cdf0e10cSrcweir { 95cdf0e10cSrcweir public: 96cdf0e10cSrcweir SvxXMLLineEndEntryExporter( SvXMLExport& rExport ); 97cdf0e10cSrcweir SvxXMLLineEndEntryExporter(); 98cdf0e10cSrcweir virtual ~SvxXMLLineEndEntryExporter(); 99cdf0e10cSrcweir 100cdf0e10cSrcweir virtual void exportEntry( const OUString& rStrName, const Any& rValue ); 101cdf0e10cSrcweir private: 102cdf0e10cSrcweir XMLMarkerStyleExport maMarkerStyle; 103cdf0e10cSrcweir }; 104cdf0e10cSrcweir 105cdf0e10cSrcweir class SvxXMLDashEntryExporter : public SvxXMLTableEntryExporter 106cdf0e10cSrcweir { 107cdf0e10cSrcweir public: 108cdf0e10cSrcweir SvxXMLDashEntryExporter( SvXMLExport& rExport ); 109cdf0e10cSrcweir virtual ~SvxXMLDashEntryExporter(); 110cdf0e10cSrcweir 111cdf0e10cSrcweir virtual void exportEntry( const OUString& rStrName, const Any& rValue ); 112cdf0e10cSrcweir 113cdf0e10cSrcweir private: 114cdf0e10cSrcweir XMLDashStyleExport maDashStyle; 115cdf0e10cSrcweir }; 116cdf0e10cSrcweir 117cdf0e10cSrcweir class SvxXMLHatchEntryExporter : public SvxXMLTableEntryExporter 118cdf0e10cSrcweir { 119cdf0e10cSrcweir public: 120cdf0e10cSrcweir SvxXMLHatchEntryExporter( SvXMLExport& rExport ); 121cdf0e10cSrcweir virtual ~SvxXMLHatchEntryExporter(); 122cdf0e10cSrcweir 123cdf0e10cSrcweir virtual void exportEntry( const OUString& rStrName, const Any& rValue ); 124cdf0e10cSrcweir private: 125cdf0e10cSrcweir XMLHatchStyleExport maHatchStyle; 126cdf0e10cSrcweir }; 127cdf0e10cSrcweir 128cdf0e10cSrcweir class SvxXMLGradientEntryExporter : public SvxXMLTableEntryExporter 129cdf0e10cSrcweir { 130cdf0e10cSrcweir public: 131cdf0e10cSrcweir SvxXMLGradientEntryExporter( SvXMLExport& rExport ); 132cdf0e10cSrcweir virtual ~SvxXMLGradientEntryExporter(); 133cdf0e10cSrcweir 134cdf0e10cSrcweir virtual void exportEntry( const OUString& rStrName, const Any& rValue ); 135cdf0e10cSrcweir private: 136cdf0e10cSrcweir XMLGradientStyleExport maGradientStyle; 137cdf0e10cSrcweir }; 138cdf0e10cSrcweir 139cdf0e10cSrcweir class SvxXMLBitmapEntryExporter : public SvxXMLTableEntryExporter 140cdf0e10cSrcweir { 141cdf0e10cSrcweir public: 142cdf0e10cSrcweir SvxXMLBitmapEntryExporter( SvXMLExport& rExport ); 143cdf0e10cSrcweir virtual ~SvxXMLBitmapEntryExporter(); 144cdf0e10cSrcweir 145cdf0e10cSrcweir virtual void exportEntry( const OUString& rStrName, const Any& rValue ); 146cdf0e10cSrcweir 147cdf0e10cSrcweir private: 148cdf0e10cSrcweir XMLImageStyle maImageStyle; 149cdf0e10cSrcweir }; 150cdf0e10cSrcweir 151cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////// 152cdf0e10cSrcweir 153cdf0e10cSrcweir // #110680# 154cdf0e10cSrcweir SvxXMLXTableExportComponent::SvxXMLXTableExportComponent( 155cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, 156cdf0e10cSrcweir const OUString& rFileName, 157cdf0e10cSrcweir const uno::Reference<xml::sax::XDocumentHandler> & rHandler, 158cdf0e10cSrcweir const uno::Reference<container::XNameContainer >& xTable, 159cdf0e10cSrcweir uno::Reference<document::XGraphicObjectResolver >& xGrfResolver ) 160cdf0e10cSrcweir : SvXMLExport( xServiceFactory, rFileName, rHandler, NULL, MAP_100TH_MM), 161cdf0e10cSrcweir mxTable( xTable ) 162cdf0e10cSrcweir { 163cdf0e10cSrcweir 164cdf0e10cSrcweir _GetNamespaceMap().Add( GetXMLToken(XML_NP_OOO), GetXMLToken(XML_N_OOO), XML_NAMESPACE_OOO ); 165cdf0e10cSrcweir _GetNamespaceMap().Add( GetXMLToken(XML_NP_OFFICE), GetXMLToken(XML_N_OFFICE), XML_NAMESPACE_OFFICE ); 166cdf0e10cSrcweir _GetNamespaceMap().Add( GetXMLToken(XML_NP_DRAW), GetXMLToken(XML_N_DRAW), XML_NAMESPACE_DRAW ); 167cdf0e10cSrcweir _GetNamespaceMap().Add( GetXMLToken(XML_NP_XLINK), GetXMLToken(XML_N_XLINK), XML_NAMESPACE_XLINK ); 168cdf0e10cSrcweir _GetNamespaceMap().Add( GetXMLToken(XML_NP_SVG), GetXMLToken(XML_N_SVG), XML_NAMESPACE_SVG ); 169cdf0e10cSrcweir SetGraphicResolver( xGrfResolver ); 170cdf0e10cSrcweir setExportFlags( 0 ); 171cdf0e10cSrcweir } 172cdf0e10cSrcweir 173cdf0e10cSrcweir SvxXMLXTableExportComponent::~SvxXMLXTableExportComponent() 174cdf0e10cSrcweir { 175cdf0e10cSrcweir } 176cdf0e10cSrcweir 177cdf0e10cSrcweir sal_Bool SvxXMLXTableExportComponent::save( const OUString& rURL, const uno::Reference<container::XNameContainer >& xTable ) throw() 178cdf0e10cSrcweir { 179cdf0e10cSrcweir uno::Reference < embed::XStorage > xStorage; 180cdf0e10cSrcweir SfxMedium* pMedium = NULL; 181cdf0e10cSrcweir sal_Bool bRet = sal_False; 182cdf0e10cSrcweir 183cdf0e10cSrcweir uno::Reference< XGraphicObjectResolver > xGrfResolver; 184cdf0e10cSrcweir SvXMLGraphicHelper* pGraphicHelper = 0; 185cdf0e10cSrcweir 186cdf0e10cSrcweir try 187cdf0e10cSrcweir { 188cdf0e10cSrcweir do 189cdf0e10cSrcweir { 190cdf0e10cSrcweir uno::Reference < io::XOutputStream > xOut; 191cdf0e10cSrcweir uno::Reference < io::XStream > xStream; 192cdf0e10cSrcweir 193cdf0e10cSrcweir sal_Bool bNeedStorage = xTable->getElementType() == ::getCppuType((const OUString*)0); 194cdf0e10cSrcweir 195cdf0e10cSrcweir uno::Reference< lang::XMultiServiceFactory> xServiceFactory( ::comphelper::getProcessServiceFactory() ); 196cdf0e10cSrcweir if( !xServiceFactory.is() ) 197cdf0e10cSrcweir { 198cdf0e10cSrcweir DBG_ERROR( "got no service manager" ); 199cdf0e10cSrcweir return sal_False; 200cdf0e10cSrcweir } 201cdf0e10cSrcweir 202cdf0e10cSrcweir uno::Reference< uno::XInterface > xWriter( xServiceFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" ) ) ) ); 203cdf0e10cSrcweir if( !xWriter.is() ) 204cdf0e10cSrcweir { 205cdf0e10cSrcweir DBG_ERROR( "com.sun.star.xml.sax.Writer service missing" ); 206cdf0e10cSrcweir return sal_False; 207cdf0e10cSrcweir } 208cdf0e10cSrcweir 209cdf0e10cSrcweir uno::Reference<xml::sax::XDocumentHandler> xHandler( xWriter, uno::UNO_QUERY ); 210cdf0e10cSrcweir 211cdf0e10cSrcweir if( bNeedStorage ) 212cdf0e10cSrcweir { 213cdf0e10cSrcweir xStorage = 214cdf0e10cSrcweir ::comphelper::OStorageHelper::GetStorageFromURL( rURL, embed::ElementModes::WRITE | embed::ElementModes::TRUNCATE ); 215cdf0e10cSrcweir 216cdf0e10cSrcweir if( !xStorage.is() ) 217cdf0e10cSrcweir { 218cdf0e10cSrcweir DBG_ERROR( "no storage!" ); 219cdf0e10cSrcweir break; 220cdf0e10cSrcweir } 221cdf0e10cSrcweir 222cdf0e10cSrcweir OUString sMetaName( RTL_CONSTASCII_USTRINGPARAM( "Content.xml" ) ); 223cdf0e10cSrcweir xStream = xStorage->openStreamElement( sMetaName, embed::ElementModes::WRITE ); 224cdf0e10cSrcweir pGraphicHelper = SvXMLGraphicHelper::Create( xStorage, GRAPHICHELPER_MODE_WRITE ); 225cdf0e10cSrcweir xGrfResolver = pGraphicHelper; 226cdf0e10cSrcweir xOut = xStream->getOutputStream(); 227cdf0e10cSrcweir } 228cdf0e10cSrcweir else 229cdf0e10cSrcweir { 230cdf0e10cSrcweir pMedium = new SfxMedium( rURL, STREAM_WRITE | STREAM_TRUNC, sal_True ); 231cdf0e10cSrcweir pMedium->IsRemote(); 232cdf0e10cSrcweir 233cdf0e10cSrcweir SvStream* pStream = pMedium->GetOutStream(); 234cdf0e10cSrcweir if( NULL == pStream ) 235cdf0e10cSrcweir { 236cdf0e10cSrcweir DBG_ERROR( "no output stream!" ); 237cdf0e10cSrcweir break; 238cdf0e10cSrcweir } 239cdf0e10cSrcweir 240cdf0e10cSrcweir xOut = new utl::OOutputStreamWrapper( *pStream ); 241cdf0e10cSrcweir } 242cdf0e10cSrcweir 243cdf0e10cSrcweir uno::Reference<io::XActiveDataSource> xMetaSrc( xWriter, uno::UNO_QUERY ); 244cdf0e10cSrcweir xMetaSrc->setOutputStream( xOut ); 245cdf0e10cSrcweir 246cdf0e10cSrcweir const OUString aName; 247cdf0e10cSrcweir 248cdf0e10cSrcweir // #110680# 249cdf0e10cSrcweir // SvxXMLXTableExportComponent aExporter( aName, xHandler, xTable, xGrfResolver ); 250cdf0e10cSrcweir SvxXMLXTableExportComponent aExporter( xServiceFactory, aName, xHandler, xTable, xGrfResolver ); 251cdf0e10cSrcweir 252cdf0e10cSrcweir bRet = aExporter.exportTable(); 253cdf0e10cSrcweir 254cdf0e10cSrcweir } 255cdf0e10cSrcweir while( 0 ); 256cdf0e10cSrcweir 257cdf0e10cSrcweir if( pGraphicHelper ) 258cdf0e10cSrcweir SvXMLGraphicHelper::Destroy( pGraphicHelper ); 259cdf0e10cSrcweir 260cdf0e10cSrcweir if( xStorage.is() ) 261cdf0e10cSrcweir { 262cdf0e10cSrcweir uno::Reference< XTransactedObject > xTrans( xStorage, UNO_QUERY ); 263cdf0e10cSrcweir if( xTrans.is() ) 264cdf0e10cSrcweir xTrans->commit(); 265cdf0e10cSrcweir 266cdf0e10cSrcweir uno::Reference< XComponent > xComp( xStorage, UNO_QUERY ); 267cdf0e10cSrcweir if( xComp.is() ) 268cdf0e10cSrcweir xStorage->dispose(); 269cdf0e10cSrcweir } 270cdf0e10cSrcweir } 271cdf0e10cSrcweir catch( uno::Exception& ) 272cdf0e10cSrcweir { 273cdf0e10cSrcweir bRet = sal_False; 274cdf0e10cSrcweir } 275cdf0e10cSrcweir 276cdf0e10cSrcweir if( pMedium ) 277cdf0e10cSrcweir { 278cdf0e10cSrcweir pMedium->Commit(); 279cdf0e10cSrcweir delete pMedium; 280cdf0e10cSrcweir } 281cdf0e10cSrcweir 282cdf0e10cSrcweir return bRet; 283cdf0e10cSrcweir } 284cdf0e10cSrcweir 285cdf0e10cSrcweir sal_Bool SvxXMLXTableExportComponent::exportTable() throw() 286cdf0e10cSrcweir { 287cdf0e10cSrcweir sal_Bool bRet = sal_False; 288cdf0e10cSrcweir 289cdf0e10cSrcweir try 290cdf0e10cSrcweir { 291cdf0e10cSrcweir GetDocHandler()->startDocument(); 292cdf0e10cSrcweir 293cdf0e10cSrcweir // export namespaces 294cdf0e10cSrcweir sal_uInt16 nPos = GetNamespaceMap().GetFirstKey(); 295cdf0e10cSrcweir while( USHRT_MAX != nPos ) 296cdf0e10cSrcweir { 297cdf0e10cSrcweir GetAttrList().AddAttribute( GetNamespaceMap().GetAttrNameByKey( nPos ), GetNamespaceMap().GetNameByKey( nPos ) ); 298cdf0e10cSrcweir nPos = GetNamespaceMap().GetNextKey( nPos ); 299cdf0e10cSrcweir } 300cdf0e10cSrcweir 301cdf0e10cSrcweir do 302cdf0e10cSrcweir { 303cdf0e10cSrcweir if( !mxTable.is() ) 304cdf0e10cSrcweir break; 305cdf0e10cSrcweir 306cdf0e10cSrcweir char const* pEleName; 307cdf0e10cSrcweir Type aExportType = mxTable->getElementType(); 308cdf0e10cSrcweir SvxXMLTableEntryExporter* pExporter = NULL; 309cdf0e10cSrcweir 310cdf0e10cSrcweir if( aExportType == ::getCppuType((const sal_Int32*)0) ) 311cdf0e10cSrcweir { 312cdf0e10cSrcweir pExporter = new SvxXMLColorEntryExporter(*this); 313cdf0e10cSrcweir pEleName = "color-table"; 314cdf0e10cSrcweir } 315cdf0e10cSrcweir else if( aExportType == ::getCppuType((const drawing::PolyPolygonBezierCoords*)0) ) 316cdf0e10cSrcweir { 317cdf0e10cSrcweir pExporter = new SvxXMLLineEndEntryExporter(*this); 318cdf0e10cSrcweir pEleName = "marker-table"; 319cdf0e10cSrcweir } 320cdf0e10cSrcweir else if( aExportType == ::getCppuType((const drawing::LineDash*)0) ) 321cdf0e10cSrcweir { 322cdf0e10cSrcweir pExporter = new SvxXMLDashEntryExporter(*this); 323cdf0e10cSrcweir pEleName = "dash-table"; 324cdf0e10cSrcweir } 325cdf0e10cSrcweir else if( aExportType == ::getCppuType((const drawing::Hatch*)0) ) 326cdf0e10cSrcweir { 327cdf0e10cSrcweir pExporter = new SvxXMLHatchEntryExporter(*this); 328cdf0e10cSrcweir pEleName = "hatch-table"; 329cdf0e10cSrcweir } 330cdf0e10cSrcweir else if( aExportType == ::getCppuType((const awt::Gradient*)0)) 331cdf0e10cSrcweir { 332cdf0e10cSrcweir pExporter = new SvxXMLGradientEntryExporter(*this); 333cdf0e10cSrcweir pEleName = "gradient-table"; 334cdf0e10cSrcweir } 335cdf0e10cSrcweir else if( aExportType == ::getCppuType((const OUString*)0)) 336cdf0e10cSrcweir { 337cdf0e10cSrcweir pExporter = new SvxXMLBitmapEntryExporter(*this); 338cdf0e10cSrcweir pEleName = "bitmap-table"; 339cdf0e10cSrcweir } 340cdf0e10cSrcweir else 341cdf0e10cSrcweir { 342cdf0e10cSrcweir DBG_ERROR( "unknown type for export"); 343cdf0e10cSrcweir break; 344cdf0e10cSrcweir } 345cdf0e10cSrcweir 346cdf0e10cSrcweir SvXMLElementExport aElem( *this, XML_NAMESPACE_OOO, pEleName, sal_True, sal_True ); 347cdf0e10cSrcweir 348cdf0e10cSrcweir Sequence< OUString > aNames = mxTable->getElementNames(); 349cdf0e10cSrcweir const sal_Int32 nCount = aNames.getLength(); 350cdf0e10cSrcweir const OUString* pNames = aNames.getConstArray(); 351cdf0e10cSrcweir Any aAny; 352cdf0e10cSrcweir 353cdf0e10cSrcweir sal_Int32 nIndex; 354cdf0e10cSrcweir for( nIndex = 0; nIndex < nCount; nIndex++, pNames++ ) 355cdf0e10cSrcweir { 356cdf0e10cSrcweir aAny = mxTable->getByName( *pNames ); 357cdf0e10cSrcweir pExporter->exportEntry( *pNames, aAny ); 358cdf0e10cSrcweir } 359cdf0e10cSrcweir 360cdf0e10cSrcweir bRet = sal_True; 361cdf0e10cSrcweir } 362cdf0e10cSrcweir while(0); 363cdf0e10cSrcweir 364cdf0e10cSrcweir GetDocHandler()->endDocument(); 365cdf0e10cSrcweir } 366cdf0e10cSrcweir catch( Exception e ) 367cdf0e10cSrcweir { 368cdf0e10cSrcweir bRet = sal_False; 369cdf0e10cSrcweir } 370cdf0e10cSrcweir 371cdf0e10cSrcweir return bRet; 372cdf0e10cSrcweir } 373cdf0e10cSrcweir 374cdf0e10cSrcweir // methods without content: 375cdf0e10cSrcweir void SvxXMLXTableExportComponent::_ExportAutoStyles() {} 376cdf0e10cSrcweir void SvxXMLXTableExportComponent::_ExportMasterStyles() {} 377cdf0e10cSrcweir void SvxXMLXTableExportComponent::_ExportContent() {} 378cdf0e10cSrcweir 379cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////// 380cdf0e10cSrcweir 381cdf0e10cSrcweir SvxXMLTableEntryExporter::~SvxXMLTableEntryExporter() 382cdf0e10cSrcweir { 383cdf0e10cSrcweir } 384cdf0e10cSrcweir 385cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////// 386cdf0e10cSrcweir 387cdf0e10cSrcweir SvxXMLColorEntryExporter::SvxXMLColorEntryExporter( SvXMLExport& rExport ) 388cdf0e10cSrcweir : SvxXMLTableEntryExporter( rExport ) 389cdf0e10cSrcweir { 390cdf0e10cSrcweir } 391cdf0e10cSrcweir 392cdf0e10cSrcweir SvxXMLColorEntryExporter::~SvxXMLColorEntryExporter() 393cdf0e10cSrcweir { 394cdf0e10cSrcweir } 395cdf0e10cSrcweir 396cdf0e10cSrcweir void SvxXMLColorEntryExporter::exportEntry( const OUString& rStrName, const Any& rValue ) 397cdf0e10cSrcweir { 398cdf0e10cSrcweir mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_NAME, rStrName ); 399cdf0e10cSrcweir 400cdf0e10cSrcweir sal_Int32 nColor = 0; 401cdf0e10cSrcweir rValue >>= nColor; 402cdf0e10cSrcweir 403cdf0e10cSrcweir OUStringBuffer aOut; 404cdf0e10cSrcweir mrExport.GetMM100UnitConverter().convertColor( aOut, nColor ); 405cdf0e10cSrcweir mrExport.AddAttribute( XML_NAMESPACE_DRAW, XML_COLOR, aOut.makeStringAndClear() ); 406cdf0e10cSrcweir 407cdf0e10cSrcweir SvXMLElementExport aElem( mrExport, XML_NAMESPACE_DRAW, XML_COLOR, sal_True, sal_True ); 408cdf0e10cSrcweir } 409cdf0e10cSrcweir 410cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////// 411cdf0e10cSrcweir 412cdf0e10cSrcweir SvxXMLLineEndEntryExporter::SvxXMLLineEndEntryExporter( SvXMLExport& rExport ) 413cdf0e10cSrcweir : SvxXMLTableEntryExporter( rExport ), maMarkerStyle( rExport ) 414cdf0e10cSrcweir { 415cdf0e10cSrcweir } 416cdf0e10cSrcweir 417cdf0e10cSrcweir SvxXMLLineEndEntryExporter::~SvxXMLLineEndEntryExporter() 418cdf0e10cSrcweir { 419cdf0e10cSrcweir } 420cdf0e10cSrcweir 421cdf0e10cSrcweir void SvxXMLLineEndEntryExporter::exportEntry( const OUString& rStrName, const Any& rValue ) 422cdf0e10cSrcweir { 423cdf0e10cSrcweir maMarkerStyle.exportXML( rStrName, rValue ); 424cdf0e10cSrcweir } 425cdf0e10cSrcweir 426cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////// 427cdf0e10cSrcweir 428cdf0e10cSrcweir SvxXMLDashEntryExporter::SvxXMLDashEntryExporter( SvXMLExport& rExport ) 429cdf0e10cSrcweir : SvxXMLTableEntryExporter( rExport ), maDashStyle( rExport ) 430cdf0e10cSrcweir { 431cdf0e10cSrcweir } 432cdf0e10cSrcweir 433cdf0e10cSrcweir SvxXMLDashEntryExporter::~SvxXMLDashEntryExporter() 434cdf0e10cSrcweir { 435cdf0e10cSrcweir } 436cdf0e10cSrcweir 437cdf0e10cSrcweir void SvxXMLDashEntryExporter::exportEntry( const OUString& rStrName, const Any& rValue ) 438cdf0e10cSrcweir { 439cdf0e10cSrcweir maDashStyle.exportXML( rStrName, rValue ); 440cdf0e10cSrcweir } 441cdf0e10cSrcweir 442cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////// 443cdf0e10cSrcweir 444cdf0e10cSrcweir SvxXMLHatchEntryExporter::SvxXMLHatchEntryExporter( SvXMLExport& rExport ) 445cdf0e10cSrcweir : SvxXMLTableEntryExporter( rExport ), maHatchStyle( rExport ) 446cdf0e10cSrcweir { 447cdf0e10cSrcweir } 448cdf0e10cSrcweir 449cdf0e10cSrcweir SvxXMLHatchEntryExporter::~SvxXMLHatchEntryExporter() 450cdf0e10cSrcweir { 451cdf0e10cSrcweir } 452cdf0e10cSrcweir 453cdf0e10cSrcweir void SvxXMLHatchEntryExporter::exportEntry( const OUString& rStrName, const Any& rValue ) 454cdf0e10cSrcweir { 455cdf0e10cSrcweir maHatchStyle.exportXML( rStrName, rValue ); 456cdf0e10cSrcweir } 457cdf0e10cSrcweir 458cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////// 459cdf0e10cSrcweir 460cdf0e10cSrcweir SvxXMLGradientEntryExporter::SvxXMLGradientEntryExporter( SvXMLExport& rExport ) 461cdf0e10cSrcweir : SvxXMLTableEntryExporter( rExport ), maGradientStyle( rExport ) 462cdf0e10cSrcweir { 463cdf0e10cSrcweir } 464cdf0e10cSrcweir 465cdf0e10cSrcweir SvxXMLGradientEntryExporter::~SvxXMLGradientEntryExporter() 466cdf0e10cSrcweir { 467cdf0e10cSrcweir } 468cdf0e10cSrcweir 469cdf0e10cSrcweir void SvxXMLGradientEntryExporter::exportEntry( const OUString& rStrName, const Any& rValue ) 470cdf0e10cSrcweir { 471cdf0e10cSrcweir maGradientStyle.exportXML( rStrName, rValue ); 472cdf0e10cSrcweir } 473cdf0e10cSrcweir 474cdf0e10cSrcweir /////////////////////////////////////////////////////////////////////// 475cdf0e10cSrcweir 476cdf0e10cSrcweir SvxXMLBitmapEntryExporter::SvxXMLBitmapEntryExporter( SvXMLExport& rExport ) 477cdf0e10cSrcweir : SvxXMLTableEntryExporter( rExport ) 478cdf0e10cSrcweir { 479cdf0e10cSrcweir } 480cdf0e10cSrcweir 481cdf0e10cSrcweir SvxXMLBitmapEntryExporter::~SvxXMLBitmapEntryExporter() 482cdf0e10cSrcweir { 483cdf0e10cSrcweir } 484cdf0e10cSrcweir 485cdf0e10cSrcweir void SvxXMLBitmapEntryExporter::exportEntry( const OUString& rStrName, const Any& rValue ) 486cdf0e10cSrcweir { 487cdf0e10cSrcweir maImageStyle.exportXML( rStrName, rValue, mrExport ); 488cdf0e10cSrcweir } 489