summaryrefslogtreecommitdiff
path: root/sw
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 /sw
parent86eccc72c502ed08938b4b2d2f4e0fdda17f82cb (diff)
the bit hackish addFormula() shortcut is no longer necessary
Diffstat (limited to 'sw')
-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
5 files changed, 11 insertions, 23 deletions
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())