summaryrefslogtreecommitdiff
path: root/sw/source/ui/uno
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2009-07-28 13:59:44 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2009-07-28 13:59:44 +0000
commit62ebbb006b4a11974e14dd61d3c453a98336f951 (patch)
tree64e2285bf19cb3bd7c7fd1cba9c66eb92472c512 /sw/source/ui/uno
parente32d93c404f611644b2f458b9a4c449635394c9c (diff)
CWS-TOOLING: integrate CWS os131
2009-07-14 15:57:33 +0200 os r273979 : #i103542# no access to members after deletion 2009-06-15 13:18:52 +0200 os r272980 : #i40827# wrong param in Copy() fixed 2009-06-15 10:09:27 +0200 os r272964 : #i40827# first document copied with storage, later only copy SwDoc 2009-06-11 10:37:51 +0200 os r272851 : CWS-TOOLING: rebase CWS os131 to trunk@272827 (milestone: DEV300:m50) 2009-06-08 10:07:50 +0200 os r272721 : #i40827# warnings fixed 2009-06-04 16:31:04 +0200 os r272644 : #i40827# enable document copies - inactive
Diffstat (limited to 'sw/source/ui/uno')
-rw-r--r--sw/source/ui/uno/unoatxt.cxx4
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx30
2 files changed, 22 insertions, 12 deletions
diff --git a/sw/source/ui/uno/unoatxt.cxx b/sw/source/ui/uno/unoatxt.cxx
index dfdbacab354b..0c67e24b8d10 100644
--- a/sw/source/ui/uno/unoatxt.cxx
+++ b/sw/source/ui/uno/unoatxt.cxx
@@ -416,7 +416,7 @@ sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextR
if(pxCursor)
{
SwPaM* pUnoCrsr = pxCursor->GetPaM();
- bRet |= (true == pxCursor->GetDoc()->Copy( *pUnoCrsr, aPos ));
+ bRet |= (true == pxCursor->GetDoc()->Copy( *pUnoCrsr, aPos, false ));
}
else
{
@@ -424,7 +424,7 @@ sal_Bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTextR
if(pBkmk && pBkmk->IsExpanded())
{
SwPaM aTmp(pBkmk->GetOtherMarkPos(), pBkmk->GetMarkPos());
- bRet |= (true == pxRange->GetDoc()->Copy(aTmp, aPos));
+ bRet |= (true == pxRange->GetDoc()->Copy(aTmp, aPos, false));
}
}
}
diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx
index ed997c6392ba..04a26d47b324 100644
--- a/sw/source/ui/uno/unotxdoc.cxx
+++ b/sw/source/ui/uno/unotxdoc.cxx
@@ -37,16 +37,12 @@
#include <vcl/virdev.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/viewfrm.hxx>
-#ifndef _TOOLKIT_UNOHLP_HXX
#include <toolkit/helper/vclunohelper.hxx>
-#endif
#include <wdocsh.hxx>
#include <wrtsh.hxx>
#include <view.hxx>
#include <pview.hxx>
-#ifndef _SRCVIEW_HXX
#include <srcview.hxx>
-#endif
#include <viewsh.hxx>
#include <pvprtdat.hxx>
#include <swprtopt.hxx>
@@ -84,9 +80,7 @@
#include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#ifndef _COM_SUN_STAR_BEANS_PropertyAttribute_HPP_
#include <com/sun/star/beans/PropertyAttribute.hpp>
-#endif
#include <com/sun/star/document/RedlineDisplayType.hpp>
#include <svx/linkmgr.hxx>
#include <svx/unofill.hxx>
@@ -94,13 +88,9 @@
#include <sfx2/progress.hxx>
#include <swmodule.hxx>
#include <docstat.hxx>
-#ifndef _MODOPT_HXX //
#include <modcfg.hxx>
-#endif
#include <ndtxt.hxx>
-#ifndef _UTLUI_HRC
#include <utlui.hrc>
-#endif
#include <swcont.hxx>
#include <unodefaults.hxx>
#include <SwXDocumentSettings.hxx>
@@ -2851,7 +2841,27 @@ uno::Reference< text::XFlatParagraphIterator > SAL_CALL SwXTextDocument::getFlat
{
return new SwXFlatParagraphIterator( *pDocShell->GetDoc(), nTextMarkupType, bAutomatic );
}
+/*-- 07.05.2009 09:21:12---------------------------------------------------
+ -----------------------------------------------------------------------*/
+uno::Reference< util::XCloneable > SwXTextDocument::createClone( ) throw (uno::RuntimeException)
+{
+ ::vos::OGuard aGuard(Application::GetSolarMutex());
+ if(!IsValid())
+ throw RuntimeException();
+ //create a new document - hidden - copy the storage and return it
+ SwDoc* pCopyDoc = pDocShell->GetDoc()->CreateCopy();
+ SfxObjectShell* pShell = new SwDocShell( pCopyDoc, SFX_CREATE_MODE_STANDARD );
+ pShell->DoInitNew();
+
+ uno::Reference< embed::XStorage > xSourceStorage = getDocumentStorage();
+ uno::Reference< frame::XModel > xNewModel = pShell->GetModel();
+ //copy this storage
+ uno::Reference< document::XStorageBasedDocument > xStorageDoc( xNewModel, uno::UNO_QUERY );
+ uno::Reference< embed::XStorage > xNewStorage = xStorageDoc->getDocumentStorage();
+ xSourceStorage->copyToStorage( xNewStorage );
+ return uno::Reference< util::XCloneable >( xNewModel, UNO_QUERY );
+}
/* -----------------------------20.06.00 09:54--------------------------------
---------------------------------------------------------------------------*/