diff options
author | Jan Holesovsky <kendy@suse.cz> | 2011-03-18 15:38:26 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2011-03-18 15:38:26 +0100 |
commit | 62abc842160313fbcdee8ff46c6b4fae6321f21d (patch) | |
tree | e64848c660027d77782a046e5da55d827c2e4b29 /writerfilter/inc | |
parent | af9cd95a2499e602887352c833d3ac52ce9670f2 (diff) | |
parent | c08aba6a410bd7e85095a485486dcfb5bb6612b8 (diff) |
Merge remote-tracking branch 'origin/integration/dev300_m101'
Conflicts:
binfilter/bf_forms/source/component/forms_Filter.cxx
binfilter/bf_sw/source/core/inc/node2lay.hxx
binfilter/bf_sw/source/filter/xml/sw_swxml.cxx
binfilter/inc/bf_sw/swdbtoolsclient.hxx
filter/source/xsltdialog/xmlfileview.cxx
oox/source/ole/axcontrol.cxx
oox/source/vml/vmlformatting.cxx
oox/source/xls/autofiltercontext.cxx
oox/source/xls/externallinkfragment.cxx
oox/source/xls/formulaparser.cxx
oox/source/xls/pivotcachebuffer.cxx
oox/source/xls/pivotcachefragment.cxx
oox/source/xls/sheetdatacontext.cxx
writerfilter/source/dmapper/GraphicImport.cxx
writerfilter/source/dmapper/SettingsTable.cxx
writerfilter/source/ooxml/model.xml
Diffstat (limited to 'writerfilter/inc')
-rw-r--r-- | writerfilter/inc/dmapper/DomainMapper.hxx | 62 | ||||
-rw-r--r-- | writerfilter/inc/resourcemodel/Fraction.hxx | 63 | ||||
-rw-r--r-- | writerfilter/inc/resourcemodel/LoggedResources.hxx | 128 | ||||
-rw-r--r-- | writerfilter/inc/resourcemodel/TagLogger.hxx | 3 | ||||
-rw-r--r-- | writerfilter/inc/resourcemodel/XPathLogger.hxx | 65 | ||||
-rw-r--r-- | writerfilter/inc/writerfilter.mk | 3 |
6 files changed, 291 insertions, 33 deletions
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx index b3ea929a30f7..d9d40aa32ad9 100644 --- a/writerfilter/inc/dmapper/DomainMapper.hxx +++ b/writerfilter/inc/dmapper/DomainMapper.hxx @@ -29,7 +29,7 @@ #define INCLUDED_DOMAINMAPPER_HXX #include <WriterFilterDllApi.hxx> -#include <resourcemodel/WW8ResourceModel.hxx> +#include <resourcemodel/LoggedResources.hxx> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/text/FontEmphasis.hpp> #include <com/sun/star/style/TabAlign.hpp> @@ -78,8 +78,8 @@ enum SourceDocumentType DOCUMENT_OOXML, DOCUMENT_RTF }; -class WRITERFILTER_DLLPUBLIC DomainMapper : public Properties, public Table, - public BinaryObj, public Stream +class WRITERFILTER_DLLPUBLIC DomainMapper : public LoggedProperties, public LoggedTable, + public BinaryObj, public LoggedStream { DomainMapper_Impl *m_pImpl; @@ -90,38 +90,14 @@ public: SourceDocumentType eDocumentType ); virtual ~DomainMapper(); - // Properties - virtual void attribute(Id Name, Value & val); - virtual void sprm(Sprm & sprm); - - // Table - virtual void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref); + // Stream + virtual void markLastParagraphInSection(); // BinaryObj virtual void data(const sal_uInt8* buf, size_t len, writerfilter::Reference<Properties>::Pointer_t ref); - // Stream - virtual void startSectionGroup(); - virtual void endSectionGroup(); - virtual void startParagraphGroup(); - virtual void endParagraphGroup(); - virtual void markLastParagraphInSection(); - virtual void startCharacterGroup(); - virtual void endCharacterGroup(); - virtual void startShape( ::com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape ); - virtual void endShape( ); - - virtual void text(const sal_uInt8 * data, size_t len); - virtual void utext(const sal_uInt8 * data, size_t len); - virtual void props(writerfilter::Reference<Properties>::Pointer_t ref); - virtual void table(Id name, - writerfilter::Reference<Table>::Pointer_t ref); - virtual void substream(Id name, - ::writerfilter::Reference<Stream>::Pointer_t ref); - virtual void info(const string & info); - - void sprm( Sprm& sprm, ::boost::shared_ptr<PropertyMap> pContext, SprmType = SPRM_DEFAULT ); + void sprmWithProps( Sprm& sprm, ::boost::shared_ptr<PropertyMap> pContext, SprmType = SPRM_DEFAULT ); void PushStyleSheetProperties( ::boost::shared_ptr<PropertyMap> pStyleProperties, bool bAffectTableMngr = false ); void PopStyleSheetProperties( bool bAffectTableMngr = false ); @@ -138,6 +114,32 @@ public: boost::shared_ptr< StyleSheetTable > GetStyleSheetTable( ); private: + // Stream + virtual void lcl_startSectionGroup(); + virtual void lcl_endSectionGroup(); + virtual void lcl_startParagraphGroup(); + virtual void lcl_endParagraphGroup(); + virtual void lcl_startCharacterGroup(); + virtual void lcl_endCharacterGroup(); + virtual void lcl_startShape( ::com::sun::star::uno::Reference< com::sun::star::drawing::XShape > xShape ); + virtual void lcl_endShape( ); + + virtual void lcl_text(const sal_uInt8 * data, size_t len); + virtual void lcl_utext(const sal_uInt8 * data, size_t len); + virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref); + virtual void lcl_table(Id name, + writerfilter::Reference<Table>::Pointer_t ref); + virtual void lcl_substream(Id name, + ::writerfilter::Reference<Stream>::Pointer_t ref); + virtual void lcl_info(const string & info); + + // Properties + virtual void lcl_attribute(Id Name, Value & val); + virtual void lcl_sprm(Sprm & sprm); + + // Table + virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref); + void handleUnderlineType(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext); void handleParaJustification(const sal_Int32 nIntValue, const ::boost::shared_ptr<PropertyMap> pContext, const bool bExchangeLeftRight); bool getColorFromIndex(const sal_Int32 nIndex, sal_Int32 &nColor); diff --git a/writerfilter/inc/resourcemodel/Fraction.hxx b/writerfilter/inc/resourcemodel/Fraction.hxx new file mode 100644 index 000000000000..65e5ef251d15 --- /dev/null +++ b/writerfilter/inc/resourcemodel/Fraction.hxx @@ -0,0 +1,63 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_FRACTION_HXX +#define INCLUDED_FRACTION_HXX + +#include <sal/types.h> + +namespace writerfilter { +namespace resourcemodel { + +class Fraction +{ +public: + explicit Fraction(sal_Int32 nNumerator, sal_Int32 nDenominator = 1); + explicit Fraction(const Fraction & a, const Fraction & b); + virtual ~Fraction(); + + void init(sal_Int32 nNumerator, sal_Int32 nDenominator); + void assign(const Fraction & rFraction); + + Fraction inverse() const; + + Fraction operator=(const Fraction & rFraction); + Fraction operator+(const Fraction & rFraction) const; + Fraction operator-(const Fraction & rFraction) const; + Fraction operator*(const Fraction & rFraction) const; + Fraction operator/(const Fraction & rFraction) const; + operator sal_Int32() const; + operator float() const; + +private: + sal_Int32 mnNumerator; + sal_Int32 mnDenominator; +}; +}} +#endif // INCLUDED_FRACTION_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/writerfilter/inc/resourcemodel/LoggedResources.hxx b/writerfilter/inc/resourcemodel/LoggedResources.hxx new file mode 100644 index 000000000000..be30c32fd85e --- /dev/null +++ b/writerfilter/inc/resourcemodel/LoggedResources.hxx @@ -0,0 +1,128 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef INCLUDED_LOGGED_RESOURCES_HXX +#define INCLUDED_LOGGED_RESOURCES_HXX + +#include "WW8ResourceModel.hxx" +#include "TagLogger.hxx" + +namespace writerfilter +{ + +class LoggedResourcesHelper +{ +public: + explicit LoggedResourcesHelper(TagLogger::Pointer_t pLogger, const string & sPrefix); + virtual ~LoggedResourcesHelper(); + + void startElement(const string & sElement); + void endElement(const string & sElement); + void chars(const ::rtl::OUString & rChars); + void chars(const string & rChars); + void attribute(const string & rName, const string & rValue); + void attribute(const string & rName, sal_uInt32 nValue); + + void setPrefix(const string & rPrefix); + +private: + TagLogger::Pointer_t mpLogger; + string msPrefix; +}; + +class LoggedStream : public Stream +{ +public: + explicit LoggedStream(TagLogger::Pointer_t pLogger, const string & sPrefix); + virtual ~LoggedStream(); + + void startSectionGroup(); + void endSectionGroup(); + void startParagraphGroup(); + void endParagraphGroup(); + void startCharacterGroup(); + void endCharacterGroup(); + void startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ); + void endShape(); + void text(const sal_uInt8 * data, size_t len); + void utext(const sal_uInt8 * data, size_t len); + void props(writerfilter::Reference<Properties>::Pointer_t ref); + void table(Id name, writerfilter::Reference<Table>::Pointer_t ref); + void substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref); + void info(const string & info); + +protected: + virtual void lcl_startSectionGroup() = 0; + virtual void lcl_endSectionGroup() = 0; + virtual void lcl_startParagraphGroup() = 0; + virtual void lcl_endParagraphGroup() = 0; + virtual void lcl_startCharacterGroup() = 0; + virtual void lcl_endCharacterGroup() = 0; + virtual void lcl_startShape( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape ) = 0; + virtual void lcl_endShape() = 0; + virtual void lcl_text(const sal_uInt8 * data, size_t len) = 0; + virtual void lcl_utext(const sal_uInt8 * data, size_t len) = 0; + virtual void lcl_props(writerfilter::Reference<Properties>::Pointer_t ref) = 0; + virtual void lcl_table(Id name, writerfilter::Reference<Table>::Pointer_t ref) = 0; + virtual void lcl_substream(Id name, writerfilter::Reference<Stream>::Pointer_t ref) = 0; + virtual void lcl_info(const string & info) = 0; + + LoggedResourcesHelper mHelper; +}; + +class LoggedProperties : public Properties +{ +public: + explicit LoggedProperties(TagLogger::Pointer_t pLogger, const string & sPrefix); + virtual ~LoggedProperties(); + + void attribute(Id name, Value & val); + void sprm(Sprm & sprm); + +protected: + virtual void lcl_attribute(Id name, Value & val) = 0; + virtual void lcl_sprm(Sprm & sprm) = 0; + + LoggedResourcesHelper mHelper; +}; + +class LoggedTable : public Table +{ +public: + explicit LoggedTable(TagLogger::Pointer_t pLogger, const string & sPrefix); + virtual ~LoggedTable(); + + void entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref); + +protected: + virtual void lcl_entry(int pos, writerfilter::Reference<Properties>::Pointer_t ref) = 0; + + LoggedResourcesHelper mHelper; +}; + +} +#endif // INCLUDED_LOGGED_RESOURCES_HXX diff --git a/writerfilter/inc/resourcemodel/TagLogger.hxx b/writerfilter/inc/resourcemodel/TagLogger.hxx index e6de7b8835fd..ffe3daca71e0 100644 --- a/writerfilter/inc/resourcemodel/TagLogger.hxx +++ b/writerfilter/inc/resourcemodel/TagLogger.hxx @@ -29,8 +29,6 @@ #ifndef INCLUDED_TAG_LOGGER_HXX #define INCLUDED_TAG_LOGGER_HXX -#if OSL_DEBUG_LEVEL > 1 - #include <rtl/ustring.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <WriterFilterDllApi.hxx> @@ -85,7 +83,6 @@ namespace writerfilter }; } -#endif // DEBUG #endif // INCLUDED_TAG_LOGGER_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/inc/resourcemodel/XPathLogger.hxx b/writerfilter/inc/resourcemodel/XPathLogger.hxx new file mode 100644 index 000000000000..0173e9c8cdde --- /dev/null +++ b/writerfilter/inc/resourcemodel/XPathLogger.hxx @@ -0,0 +1,65 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef INCLUDED_XPATH_LOGGER_HXX +#define INCLUDED_XPATH_LOGGER_HXX + +#include <stack> +#include <string> +#include <vector> +#include <boost/shared_ptr.hpp> +#include <boost/unordered_map.hpp> +#include <WriterFilterDllApi.hxx> + +namespace writerfilter +{ +using ::std::stack; +using ::std::string; +using ::std::vector; + +class WRITERFILTER_DLLPUBLIC XPathLogger +{ + typedef boost::unordered_map<string, unsigned int> TokenMap_t; + typedef boost::shared_ptr<TokenMap_t> TokenMapPointer_t; + + TokenMapPointer_t mp_tokenMap; + stack<TokenMapPointer_t> m_tokenMapStack; + vector<string> m_path; + string m_currentPath; + + void updateCurrentPath(); + +public: + explicit XPathLogger(); + virtual ~XPathLogger(); + + string getXPath() const; + void startElement(string _token); + void endElement(); +}; +} +#endif // INCLUDED_XPATH_LOGGER_HXX diff --git a/writerfilter/inc/writerfilter.mk b/writerfilter/inc/writerfilter.mk index 753850717b2b..0b0c5cae6292 100644 --- a/writerfilter/inc/writerfilter.mk +++ b/writerfilter/inc/writerfilter.mk @@ -31,3 +31,6 @@ CDEFS+=-DDEBUG_DOMAINMAPPER -DDEBUG_ELEMENT -DDEBUG_RESOLVE \ -DDEBUG_CONTEXT_STACK -DDEBUG_ATTRIBUTES -DDEBUG_PROPERTIES CFLAGS += $(LIBXML_CFLAGS) .ENDIF +.IF "$(SYSTEM_LIBXML)" == "YES" +CFLAGS+=-DSYSTEM_LIBXML $(LIBXML_CFLAGS) +.ENDIF |