summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2011-11-25 15:15:47 +0100
committerLuboš Luňák <l.lunak@suse.cz>2011-11-29 13:27:43 +0100
commit93be239c9512c27369e1134150610248e93d6157 (patch)
tree994785ca6ef1ca05980420310edab34d7737e951
parent86eccc72c502ed08938b4b2d2f4e0fdda17f82cb (diff)
the bit hackish addFormula() shortcut is no longer necessary
-rw-r--r--oox/inc/oox/mathml/import.hxx7
-rw-r--r--oox/source/mathml/import.cxx4
-rw-r--r--sw/inc/docsh.hxx2
-rw-r--r--sw/inc/unotxdoc.hxx5
-rw-r--r--sw/source/core/unocore/unoframe.cxx10
-rw-r--r--sw/source/ui/app/docsh2.cxx12
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx5
-rw-r--r--writerfilter/source/dmapper/DomainMapper_Impl.cxx4
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 <oox/mathml/import.hxx>
-
#include <DomainMapper_Impl.hxx>
#include <ConversionHelper.hxx>
#include <DomainMapperTableHandler.hxx>
@@ -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
{