diff options
author | Christoph Lutz <christoph.lutz_ml@cib.de> | 2015-04-08 14:57:28 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-09 09:00:05 +0000 |
commit | 59ef67e03bcf5b87f3dda12e89a97dc9bdcd0bb6 (patch) | |
tree | 47f3f224abfd1bf2c4ca14587d05507194bb5686 /sw | |
parent | 8dd46ca71dd8dcdb7fe52421392f02cde0d77f8a (diff) |
MM: fixed invalid UNO-Reference as return value of UNO MailMergeService
This fix is regarding 9835bb562 "MM: export the SwDocShell mail merge via UNO":
In case of using the new output type MailMergeType.SHELL, the UNO
MailMergeService returned a XTextDocument instance that was not
correctly initialized. In particular after calling doc.getCurrentController()
(with doc = the returned instance) we recieved NULL. The reason was, that the
previous implementation used to create a new SwXTextDocument instance
instead of just returning the BaseModel that is already associated with
the internal SwDocShell. This is fixed in this patch.
I also tested this patch with the unit test sw/CppunitTest_sw_mailmerge
and everything seems to be fine now. doc.getCurrentController() no longer
returns NULL.
Change-Id: Ic116f8f25ab9686ef56950e97ba202a55ab81fb8
Reviewed-on: https://gerrit.libreoffice.org/15207
Tested-by: Michael Stahl <mstahl@redhat.com>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
(cherry picked from commit 098d08d6af951afa4f20f6f7883f6c9d34e87e11)
Reviewed-on: https://gerrit.libreoffice.org/15209
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/uno/unomailmerge.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index 4687312d9a7b..dfd199f41264 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -826,8 +826,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( if (DBMGR_MERGE_SHELL == nMergeType) { - SwXTextDocument *xTextDoc = new SwXTextDocument( aMergeDesc.pMailMergeConfigItem->GetTargetView()->GetDocShell() ); - return makeAny( Reference< XComponent >( xTextDoc->queryInterface( XComponent::static_type() ), css::uno::UNO_QUERY) ); + return makeAny( aMergeDesc.pMailMergeConfigItem->GetTargetView()->GetDocShell()->GetBaseModel() ); } else return makeAny( true ); |