From 93be239c9512c27369e1134150610248e93d6157 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 25 Nov 2011 15:15:47 +0100 Subject: the bit hackish addFormula() shortcut is no longer necessary --- oox/inc/oox/mathml/import.hxx | 7 ------- oox/source/mathml/import.cxx | 4 ---- sw/inc/docsh.hxx | 2 -- sw/inc/unotxdoc.hxx | 5 +---- sw/source/core/unocore/unoframe.cxx | 10 ++++++++++ sw/source/ui/app/docsh2.cxx | 12 ------------ sw/source/ui/uno/unotxdoc.cxx | 5 ----- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 4 ---- 8 files changed, 11 insertions(+), 38 deletions(-) diff --git a/oox/inc/oox/mathml/import.hxx b/oox/inc/oox/mathml/import.hxx index 961a4f6bcd4e..715426405dba 100644 --- a/oox/inc/oox/mathml/import.hxx +++ b/oox/inc/oox/mathml/import.hxx @@ -40,13 +40,6 @@ 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: diff --git a/oox/source/mathml/import.cxx b/oox/source/mathml/import.cxx index 45530060b288..bb13db3976c6 100644 --- a/oox/source/mathml/import.cxx +++ b/oox/source/mathml/import.cxx @@ -35,10 +35,6 @@ FormulaImportBase::FormulaImportBase() { } -FormulaImportHelper::FormulaImportHelper() -{ -} - } // namespace /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index e62699abf896..96a1eaa9f3a4 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -143,8 +143,6 @@ protected: public: using SotObject::GetInterface; - void addFormula( com::sun::star::uno::Reference< com::sun::star::embed::XEmbeddedObject > p); - // but we implement this ourselves. SFX_DECL_INTERFACE(SW_DOCSHELL) SFX_DECL_OBJECTFACTORY() diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index ca21090f1f93..5d61a9a60b5e 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -181,8 +181,7 @@ SwXTextDocumentBaseClass; class SW_DLLPUBLIC SwXTextDocument : public SwXTextDocumentBaseClass, public SvxFmMSFactory, - public SfxBaseModel, - public oox::FormulaImportHelper + public SfxBaseModel { ActionContextArr aActionArr; SwRefreshListenerContainer aRefreshCont; @@ -254,8 +253,6 @@ public: virtual void SAL_CALL acquire( ) throw(); virtual void SAL_CALL release( ) throw(); - virtual void addFormula( com::sun::star::uno::Reference< com::sun::star::embed::XEmbeddedObject > p ); - //XWeak virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter( ) throw(css::uno::RuntimeException); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 7de6a3658347..c86c2a2acde5 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2310,6 +2310,16 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan pDoc->GetIDocumentUndoRedo().StartUndo(UNDO_INSERT, NULL); + // Not sure if these setParent() and InsertEmbeddedObject() calls are really + // needed, it seems to work without, but logic from code elsewhere suggests + // they should be done. + SfxObjectShell& mrPers = *pDoc->GetPersist(); + uno::Reference < container::XChild > xChild( obj, uno::UNO_QUERY ); + if ( xChild.is() ) + xChild->setParent( mrPers.GetModel() ); + ::rtl::OUString rName; + mrPers.GetEmbeddedObjectContainer().InsertEmbeddedObject( obj, rName ); + SwFlyFrmFmt* pFrmFmt = 0; pFrmFmt = pDoc->Insert( aPam, xObj, &aFrmSet, NULL, NULL ); pDoc->GetIDocumentUndoRedo().EndUndo(UNDO_INSERT, NULL); diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index 47a064f2bb5f..4903ff8db5bb 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -155,18 +155,6 @@ SfxDocumentInfoDialog* SwDocShell::CreateDocumentInfoDialog( return pDlg; } -void SwDocShell::addFormula( uno::Reference< embed::XEmbeddedObject > p ) -{ - SfxObjectShell& mrPers = *GetDoc()->GetPersist(); - uno::Reference < container::XChild > xChild( p, uno::UNO_QUERY ); - if ( xChild.is() ) - xChild->setParent( mrPers.GetModel() ); - ::rtl::OUString rName; - bool bSuccess = mrPers.GetEmbeddedObjectContainer().InsertEmbeddedObject( p, rName ); - if (bSuccess) - {} -} - // Disable "multiple layout" void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView ) diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 8d63654affd4..6ac980825173 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -407,11 +407,6 @@ SwXTextDocument::~SwXTextDocument() delete m_pRenderData; } -void SwXTextDocument::addFormula( uno::Reference< embed::XEmbeddedObject > p ) -{ - pDocShell->addFormula(p); -} - SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper () { if(!xPropertyHelper.is()) diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 4833bba34aad..58928646e575 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -26,8 +26,6 @@ * ************************************************************************/ -#include - #include #include #include @@ -1096,8 +1094,6 @@ void DomainMapper_Impl::appendStarMath( const Value& val ) val.getAny() >>= formula; if( formula.is() ) { - 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 { -- cgit