rename and move mathml oox support classes in oox to better places

This commit is contained in:
Luboš Luňák 2011-11-18 21:06:54 +01:00
parent 0ac48a4a06
commit f8f1ccbaf9
19 changed files with 197 additions and 68 deletions

View file

@ -203,7 +203,6 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
oox/source/export/ColorPropertySet \
oox/source/export/drawingml \
oox/source/export/SchXMLSeriesHelper \
oox/source/export/ooxmlexport \
oox/source/export/shapes \
oox/source/export/vmlexport \
oox/source/helper/attributelist \
@ -219,6 +218,9 @@ $(eval $(call gb_Library_add_exception_objects,oox,\
oox/source/helper/storagebase \
oox/source/helper/textinputstream \
oox/source/helper/zipstorage \
oox/source/mathml/export \
oox/source/mathml/import \
oox/source/mathml/importutils \
oox/source/ole/axbinaryreader \
oox/source/ole/axbinarywriter \
oox/source/ole/axfontdata \

View file

@ -41,8 +41,6 @@ $(eval $(call gb_Package_add_file,oox_inc,inc/oox/export/drawingml.hxx,oox/expor
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/export/shapes.hxx,oox/export/shapes.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/export/utils.hxx,oox/export/utils.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/export/vmlexport.hxx,oox/export/vmlexport.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/export/ooxmlexport.hxx,oox/export/ooxmlexport.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/export/starmathimport.hxx,oox/export/starmathimport.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/binarystreambase.hxx,oox/helper/binarystreambase.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/containerhelper.hxx,oox/helper/containerhelper.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/graphichelper.hxx,oox/helper/graphichelper.hxx))
@ -51,6 +49,9 @@ $(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/refmap.hxx,oox/helper/r
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/refvector.hxx,oox/helper/refvector.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/storagebase.hxx,oox/helper/storagebase.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/helper/zipstorage.hxx,oox/helper/zipstorage.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/mathml/export.hxx,oox/mathml/export.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/mathml/import.hxx,oox/mathml/import.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/mathml/importutils.hxx,oox/mathml/importutils.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/ole/olehelper.hxx,oox/ole/olehelper.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/ole/oleobjecthelper.hxx,oox/ole/oleobjecthelper.hxx))
$(eval $(call gb_Package_add_file,oox_inc,inc/oox/ole/olestorage.hxx,oox/ole/olestorage.hxx))

View file

@ -32,17 +32,22 @@
#include <oox/core/filterbase.hxx>
#include <oox/dllapi.h>
namespace oox
{
/**
Interface class, StarMath will implement writeFormulaOoxml() to write out OOXML
representing the formula.
*/
class OOX_DLLPUBLIC OoxmlFormulaExportBase
class OOX_DLLPUBLIC FormulaExportBase
{
public:
OoxmlFormulaExportBase();
FormulaExportBase();
virtual void writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer, oox::core::OoxmlVersion version ) = 0;
};
} // namespace
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -0,0 +1,61 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2011 Lubos Lunak <l.lunak@suse.cz> (initial developer)
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#ifndef _STARMATHIMPORT_HXX
#define _STARMATHIMPORT_HXX
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <oox/dllapi.h>
namespace oox
{
namespace formulaimport
{
class XmlStream;
}
class OOX_DLLPUBLIC FormulaImportHelper
{
public:
FormulaImportHelper();
virtual void addFormula( com::sun::star::uno::Reference< com::sun::star::embed::XEmbeddedObject > ) = 0;
};
class OOX_DLLPUBLIC FormulaImportBase
{
public:
FormulaImportBase();
virtual void readFormulaOoxml( oox::formulaimport::XmlStream& stream ) = 0;
};
} // namespace
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -25,17 +25,19 @@
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#ifndef _STARMATHIMPORT_HXX
#define _STARMATHIMPORT_HXX
#ifndef _STARMATHIMPORTUTILS_HXX
#define _STARMATHIMPORTUTILS_HXX
#include <com/sun/star/embed/XEmbeddedObject.hpp>
#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
#include <oox/helper/attributelist.hxx>
#include <vector>
#include <oox/dllapi.h>
namespace ooxmlformulaimport
namespace oox
{
namespace formulaimport
{
const int TAG_OPENING = 1 << 29;
@ -78,21 +80,7 @@ public:
};
} // namespace
class OOX_DLLPUBLIC OoxmlFormulaImportHelper
{
public:
OoxmlFormulaImportHelper();
virtual void addFormula( com::sun::star::uno::Reference< com::sun::star::embed::XEmbeddedObject > ) = 0;
};
class OOX_DLLPUBLIC OoxmlFormulaImportBase
{
public:
OoxmlFormulaImportBase();
virtual void readFormulaOoxml( ooxmlformulaimport::XmlStream& stream ) = 0;
};
} // namespace
#endif

View file

@ -0,0 +1,40 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2011 Tor Lillqvist <tlillqvist@suse.com> (initial developer)
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#include "oox/mathml/export.hxx"
namespace oox
{
FormulaExportBase::FormulaExportBase()
{
}
} // namespace
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -0,0 +1,44 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Version: MPL 1.1 / GPLv3+ / LGPLv3+
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License or as specified alternatively below. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* Major Contributor(s):
* Copyright (C) 2011 Tor Lillqvist <tlillqvist@suse.com> (initial developer)
*
* All Rights Reserved.
*
* For minor contributions see the git repository.
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 3 or later (the "GPLv3+"), or
* the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
* in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
* instead of those above.
*/
#include "oox/mathml/import.hxx"
namespace oox
{
FormulaImportBase::FormulaImportBase()
{
}
FormulaImportHelper::FormulaImportHelper()
{
}
} // namespace
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -26,29 +26,18 @@
* instead of those above.
*/
#include <oox/export/ooxmlexport.hxx>
#include <oox/export/starmathimport.hxx>
#include "oox/mathml/importutils.hxx"
#include <assert.h>
#include <oox/token/tokens.hxx>
#include <oox/token/namespaces.hxx>
using namespace oox;
using namespace oox::core;
using namespace com::sun::star;
OoxmlFormulaExportBase::OoxmlFormulaExportBase()
namespace oox
{
}
OoxmlFormulaImportBase::OoxmlFormulaImportBase()
{
}
OoxmlFormulaImportHelper::OoxmlFormulaImportHelper()
{
}
namespace ooxmlformulaimport
namespace formulaimport
{
XmlStream::XmlStream()
@ -110,6 +99,7 @@ void XmlStreamBuilder::appendCharacters( const rtl::OUString& chars )
characters.back() = chars;
}
} // namespace
} // namespace
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View file

@ -41,6 +41,7 @@
#include <vcl/virdev.hxx>
#include <sax/fshelper.hxx>
#include <oox/core/filterbase.hxx>
#include <oox/mathml/import.hxx>
#include <set>
@ -53,10 +54,6 @@ class SfxMenuBarManager;
class SfxPrinter;
class Printer;
class SmCursor;
namespace ooxmlformulaimport
{
class XmlStream;
}
#define HINT_DATACHANGED 1004
@ -179,7 +176,7 @@ class SmDocShell : public SfxObjectShell, public SfxListener
void InvalidateCursor();
bool writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer, oox::core::OoxmlVersion version );
bool readFormulaOoxml( ooxmlformulaimport::XmlStream& stream );
bool readFormulaOoxml( oox::formulaimport::XmlStream& stream );
public:
TYPEINFO();

View file

@ -37,8 +37,8 @@
#include <sfx2/sfxbasemodel.hxx>
#include <comphelper/propertysethelper.hxx>
#include <vcl/print.hxx>
#include <oox/export/ooxmlexport.hxx>
#include <oox/export/starmathimport.hxx>
#include <oox/mathml/export.hxx>
#include <oox/mathml/import.hxx>
class SmFormat;
@ -66,8 +66,8 @@ class SmModel : public SfxBaseModel,
public comphelper::PropertySetHelper,
public com::sun::star::lang::XServiceInfo,
public com::sun::star::view::XRenderable,
public OoxmlFormulaExportBase,
public OoxmlFormulaImportBase
public oox::FormulaExportBase,
public oox::FormulaImportBase
{
SmPrintUIOptions* m_pPrintUIOptions;
protected:
@ -104,10 +104,10 @@ public:
virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xParent ) throw( ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException );
// OoxmlFormulaExportBase
// oox::FormulaExportBase
virtual void writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer, oox::core::OoxmlVersion version );
// OoxmlFormulaImportBase
virtual void readFormulaOoxml( ooxmlformulaimport::XmlStream& stream );
// oox::FormulaImportBase
virtual void readFormulaOoxml( oox::formulaimport::XmlStream& stream );
static ::com::sun::star::uno::Sequence< rtl::OUString > getSupportedServiceNames_Static();
static ::rtl::OUString getImplementationName_Static();

View file

@ -999,7 +999,7 @@ bool SmDocShell::writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer,
return aEquation.ConvertFromStarMath( m_pSerializer );
}
bool SmDocShell::readFormulaOoxml( ooxmlformulaimport::XmlStream& stream )
bool SmDocShell::readFormulaOoxml( oox::formulaimport::XmlStream& stream )
{
RTL_LOGFILE_CONTEXT( aLog, "starmath: SmDocShell::readFormulaOoxml" );

View file

@ -35,7 +35,7 @@
#include <oox/token/namespaces.hxx>
using namespace oox;
using namespace ooxmlformulaimport;
using namespace oox::formulaimport;
using rtl::OUString;
/*
@ -52,7 +52,7 @@ The primary internal data structure for the formula is the text representation
// TODO create IS_OPENING(), IS_CLOSING() instead of doing 'next == OPENING( next )' ?
SmOoxmlImport::SmOoxmlImport( ooxmlformulaimport::XmlStream& s )
SmOoxmlImport::SmOoxmlImport( oox::formulaimport::XmlStream& s )
: stream( s )
{
}

View file

@ -29,7 +29,7 @@
#ifndef SM_OOXMLIMPORT_HXX
#define SM_OOXMLIMPORT_HXX
#include <oox/export/starmathimport.hxx>
#include <oox/mathml/importutils.hxx>
#include "node.hxx"
@ -40,7 +40,7 @@
class SmOoxmlImport
{
public:
SmOoxmlImport( ooxmlformulaimport::XmlStream& stream );
SmOoxmlImport( oox::formulaimport::XmlStream& stream );
rtl::OUString ConvertToStarMath();
private:
rtl::OUString handleStream();
@ -70,7 +70,7 @@ private:
Handle the current (unexpected) tag.
*/
void handleUnexpectedTag();
ooxmlformulaimport::XmlStream& stream;
oox::formulaimport::XmlStream& stream;
};
#endif

View file

@ -1137,7 +1137,7 @@ void SmModel::writeFormulaOoxml( ::sax_fastparser::FSHelperPtr m_pSerializer, oo
static_cast< SmDocShell* >( GetObjectShell())->writeFormulaOoxml( m_pSerializer, version );
}
void SmModel::readFormulaOoxml( ooxmlformulaimport::XmlStream& stream )
void SmModel::readFormulaOoxml( oox::formulaimport::XmlStream& stream )
{
static_cast< SmDocShell* >( GetObjectShell())->readFormulaOoxml( stream );
}

View file

@ -78,7 +78,7 @@
#include <cppuhelper/implbase2.hxx> // helper for implementations
#include <cppuhelper/implbase4.hxx> // helper for implementations
#include <RefreshListenerContainer.hxx>
#include <oox/export/starmathimport.hxx>
#include <oox/mathml/import.hxx>
#include <viewopt.hxx>
@ -182,7 +182,7 @@ SwXTextDocumentBaseClass;
class SW_DLLPUBLIC SwXTextDocument : public SwXTextDocumentBaseClass,
public SvxFmMSFactory,
public SfxBaseModel,
public OoxmlFormulaImportHelper
public oox::FormulaImportHelper
{
ActionContextArr aActionArr;
SwRefreshListenerContainer aRefreshCont;

View file

@ -45,7 +45,7 @@
#include <oox/export/drawingml.hxx>
#include <oox/export/utils.hxx>
#include <oox/export/vmlexport.hxx>
#include <oox/export/ooxmlexport.hxx>
#include <oox/mathml/export.hxx>
#include <i18npool/mslangid.hxx>
@ -2314,7 +2314,7 @@ void DocxAttributeOutput::WritePostponedMath()
return;
uno::Reference < embed::XEmbeddedObject > xObj(const_cast<SwOLENode*>(m_postponedMath)->GetOLEObj().GetOleRef());
uno::Reference< uno::XInterface > xInterface( xObj->getComponent(), uno::UNO_QUERY );
if( OoxmlFormulaExportBase* formulaexport = dynamic_cast< OoxmlFormulaExportBase* >( xInterface.get()))
if( oox::FormulaExportBase* formulaexport = dynamic_cast< oox::FormulaExportBase* >( xInterface.get()))
formulaexport->writeFormulaOoxml( m_pSerializer, GetExport().GetFilter().getVersion());
else
OSL_FAIL( "Math OLE object cannot write out OOXML" );

View file

@ -26,7 +26,7 @@
*
************************************************************************/
#include <oox/export/starmathimport.hxx>
#include <oox/mathml/import.hxx>
#include <DomainMapper_Impl.hxx>
#include <ConversionHelper.hxx>
@ -1096,7 +1096,7 @@ void DomainMapper_Impl::appendStarMath( const Value& val )
val.getAny() >>= formula;
if( formula.is() )
{
if( OoxmlFormulaImportHelper* import = dynamic_cast< OoxmlFormulaImportHelper* >( GetTextDocument().get()))
if( oox::FormulaImportHelper* import = dynamic_cast< oox::FormulaImportHelper* >( GetTextDocument().get()))
import->addFormula( formula );
static const rtl::OUString sEmbeddedService(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.text.TextEmbeddedObject"));
try

View file

@ -2382,7 +2382,7 @@ OOXMLFastContextHandlerMath::~OOXMLFastContextHandlerMath()
rtl::OUString aName; // TODO?
uno::Reference< embed::XEmbeddedObject > ref = container.CreateEmbeddedObject( name.GetByteSequence(), aName );
uno::Reference< uno::XInterface > component( ref->getComponent(), uno::UNO_QUERY );
if( OoxmlFormulaImportBase* import = dynamic_cast< OoxmlFormulaImportBase* >( component.get()))
if( oox::FormulaImportBase* import = dynamic_cast< oox::FormulaImportBase* >( component.get()))
import->readFormulaOoxml( buffer );
if (isForwardEvents())
{

View file

@ -44,7 +44,8 @@
#include <ooxml/OOXMLFastTokens.hxx>
#include <svtools/embedhlp.hxx>
#include <oox/export/starmathimport.hxx>
#include <oox/mathml/import.hxx>
#include <oox/mathml/importutils.hxx>
namespace writerfilter {
namespace ooxml
@ -662,7 +663,7 @@ protected:
virtual void lcl_characters(const ::rtl::OUString & aChars) throw (uno::RuntimeException, xml::sax::SAXException);
private:
ooxmlformulaimport::XmlStreamBuilder buffer;
oox::formulaimport::XmlStreamBuilder buffer;
};