From 23a6bdea655896c01ce21862f4e714b9ba3d4f0e Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Mon, 7 Sep 2009 15:38:19 +0000 Subject: CWS-TOOLING: integrate CWS calcsheetdata 2009-08-13 16:18:48 +0200 nn r274950 : #i102616# shared/remote files, better handling of formula results 2009-08-12 11:17:30 +0200 nn r274884 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274622 (milestone: DEV300:m54) 2009-08-12 10:30:47 +0200 nn r274881 : #i102616# some clean-up 2009-08-11 19:01:18 +0200 nn r274876 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-11 19:00:49 +0200 nn r274875 : #i102616# store loaded namespaces, so prefixes remain valid 2009-08-10 19:12:04 +0200 nn r274835 : #i102616# detective, notes, encoding, error handling 2009-08-07 11:18:46 +0200 nn r274751 : #i102616# use new method SvXMLAutoStylePoolP::AddNamed 2009-08-07 11:18:15 +0200 nn r274750 : #i102616# new method SvXMLAutoStylePoolP::AddNamed 2009-08-06 18:02:42 +0200 nn r274740 : #i102616# modification: shapes, notes, pending row heights; skip sheets in export iterator 2009-08-05 18:41:59 +0200 nn r274694 : #i102616# handle text styles in notes 2009-08-03 18:55:59 +0200 nn r274594 : #i102616# handle text styles in cells 2009-07-31 19:00:06 +0200 nn r274548 : #i102616# handle styles for notes 2009-07-28 16:46:20 +0200 nn r274414 : missed a conflict 2009-07-28 14:01:56 +0200 nn r274404 : CWS-TOOLING: rebase CWS calcsheetdata to trunk@274203 (milestone: DEV300:m53) 2009-07-23 18:28:47 +0200 nn r274278 : #i102616# handle table styles 2009-07-22 15:40:24 +0200 nn r274244 : #i102616# handle row styles 2009-07-21 20:09:37 +0200 nn r274211 : #i102616# handle column styles 2009-07-16 13:00:18 +0200 nn r274043 : #i102616# invalidate all stream positions when inserting/deleting sheets 2009-07-15 17:41:15 +0200 nn r274021 : #i102616# don't collect cell styles twice for copied sheets 2009-07-14 18:36:11 +0200 nn r273985 : #i102616# allow to query stream position, clear buffer 2009-07-14 18:32:10 +0200 nn r273984 : #i102616# allow to specify a name for an autostyle 2009-07-09 22:01:23 +0200 nn r273870 : #i102616# copy stream for unchanged sheets 2009-07-08 18:11:42 +0200 nn r273844 : #i102616# store stream positions of sheets 2009-06-24 19:08:18 +0200 nn r273363 : #i102616# detect changed sheets since loading 2009-06-09 15:53:32 +0200 nn r272774 : #i102616# store automatic cell style information after loading --- sax/source/expatwrap/sax_expat.cxx | 18 +++++++++++++++++- sax/source/expatwrap/saxwriter.cxx | 21 +++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) (limited to 'sax') diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx index d9553113c759..662d58d3f28a 100644 --- a/sax/source/expatwrap/sax_expat.cxx +++ b/sax/source/expatwrap/sax_expat.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #include #include @@ -374,7 +375,8 @@ extern "C" // LocatorImpl //--------------------------------------------- class LocatorImpl : - public WeakImplHelper1< XLocator > + public WeakImplHelper2< XLocator, com::sun::star::io::XSeekable > + // should use a different interface for stream positions! { public: LocatorImpl( SaxExpatParser_Impl *p ) @@ -400,6 +402,20 @@ public: //XLocator return m_pParser->getEntity().structSource.sSystemId; } + // XSeekable (only for getPosition) + + virtual void SAL_CALL seek( sal_Int64 ) throw() + { + } + virtual sal_Int64 SAL_CALL getPosition() throw() + { + return XML_GetCurrentByteIndex( m_pParser->getEntity().pParser ); + } + virtual ::sal_Int64 SAL_CALL getLength() throw() + { + return 0; + } + private: SaxExpatParser_Impl *m_pParser; diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx index 9be52cdd24c3..b3fba10cc911 100644 --- a/sax/source/expatwrap/saxwriter.cxx +++ b/sax/source/expatwrap/saxwriter.cxx @@ -208,6 +208,8 @@ public: // If there are invalid characters in the string it returns sal_False. // Than the calling method has to throw the needed Exception. inline sal_Bool comment(const rtl::OUString& rComment) throw( SAXException ); + + inline void clearBuffer() throw( SAXException ); }; const sal_Bool g_bValidCharsBelow32[32] = @@ -693,6 +695,17 @@ inline void SaxWriterHelper::endDocument() throw( SAXException ) } } +inline void SaxWriterHelper::clearBuffer() throw( SAXException ) +{ + FinishStartElement(); + if (nCurrentPos > 0) + { + m_Sequence.realloc(nCurrentPos); + nCurrentPos = writeSequence(); + m_Sequence.realloc(SEQUENCESIZE); + } +} + inline sal_Bool SaxWriterHelper::processingInstruction(const rtl::OUString& rTarget, const rtl::OUString& rData) throw( SAXException ) { FinishStartElement(); @@ -927,12 +940,20 @@ public: // XActiveDataSource virtual void SAL_CALL setOutputStream(const Reference< XOutputStream > & aStream) throw (RuntimeException) { + // temporary: set same stream again to clear buffer + if ( m_out == aStream && mp_SaxWriterHelper && m_bDocStarted ) + mp_SaxWriterHelper->clearBuffer(); + else + { + m_out = aStream; delete mp_SaxWriterHelper; mp_SaxWriterHelper = new SaxWriterHelper(m_out); m_bDocStarted = sal_False; m_nLevel = 0; m_bIsCDATA = sal_False; + + } } virtual Reference< XOutputStream > SAL_CALL getOutputStream(void) throw(RuntimeException) -- cgit