summaryrefslogtreecommitdiff
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
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
-rw-r--r--sw/inc/IDocumentContentOperations.hxx2
-rw-r--r--sw/inc/doc.hxx10
-rw-r--r--sw/inc/unotxdoc.hxx30
-rw-r--r--sw/source/core/doc/doccomp.cxx6
-rw-r--r--sw/source/core/doc/docfmt.cxx2
-rw-r--r--sw/source/core/doc/docglbl.cxx4
-rw-r--r--sw/source/core/doc/docglos.cxx2
-rw-r--r--sw/source/core/doc/doclay.cxx4
-rw-r--r--sw/source/core/doc/docnew.cxx370
-rw-r--r--sw/source/core/doc/docnum.cxx2
-rw-r--r--sw/source/core/doc/docredln.cxx6
-rw-r--r--sw/source/core/doc/swserv.cxx7
-rw-r--r--sw/source/core/doc/tblcpy.cxx2
-rw-r--r--sw/source/core/doc/tblrwcl.cxx2
-rw-r--r--sw/source/core/docnode/ndcopy.cxx73
-rw-r--r--sw/source/core/docnode/section.cxx4
-rw-r--r--sw/source/core/edit/acorrect.cxx2
-rw-r--r--sw/source/core/edit/eddel.cxx2
-rw-r--r--sw/source/core/edit/edglss.cxx6
-rw-r--r--sw/source/core/frmedt/fecopy.cxx4
-rw-r--r--sw/source/core/txtnode/atrftn.cxx2
-rw-r--r--sw/source/core/undo/untblk.cxx2
-rw-r--r--sw/source/filter/ww8/ww8glsy.cxx2
-rw-r--r--sw/source/filter/xml/xmltbli.cxx2
-rw-r--r--sw/source/ui/dbui/dbmgr.cxx253
-rw-r--r--sw/source/ui/uno/unoatxt.cxx4
-rw-r--r--sw/source/ui/uno/unotxdoc.cxx30
27 files changed, 617 insertions, 218 deletions
diff --git a/sw/inc/IDocumentContentOperations.hxx b/sw/inc/IDocumentContentOperations.hxx
index 40f96985d6aa..55a0ca4082f1 100644
--- a/sw/inc/IDocumentContentOperations.hxx
+++ b/sw/inc/IDocumentContentOperations.hxx
@@ -71,7 +71,7 @@
/** Kopieren eines Bereiches im oder in ein anderes Dokument !
Die Position kann auch im Bereich liegen !!
*/
- virtual bool Copy(SwPaM&, SwPosition&) const = 0;
+ virtual bool Copy(SwPaM&, SwPosition&, bool bCopyAll ) const = 0;
/** Loesche die Section, in der der Node steht.
*/
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index bbe0dc951ac3..6e03d1a417a5 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -616,7 +616,7 @@ private:
// Kopieren eines Bereiches im oder in ein anderes Dokument !
// Die Position darf nicht im Bereich liegen !!
sal_Bool _Copy( SwPaM&, SwPosition&,
- sal_Bool MakeNewFrms = sal_True, SwPaM* pCpyRng = 0 ) const; // in ndcopy.cxx
+ sal_Bool MakeNewFrms /*= sal_True*/, bool bCopyAll, SwPaM* pCpyRng /*= 0*/ ) const; // in ndcopy.cxx
SwFlyFrmFmt* _MakeFlySection( const SwPosition& rAnchPos,
const SwCntntNode& rNode, RndStdIds eRequestId,
@@ -628,7 +628,8 @@ private:
const SfxItemSet* pGrfAttrSet,
SwFrmFmt* = 0 );
- void _CopyFlyInFly( const SwNodeRange& rRg, const SwNodeIndex& rSttIdx,
+ void _CopyFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex,
+ const SwNodeIndex& rSttIdx,
sal_Bool bCopyFlyAtFly = sal_False ) const; // steht im ndcopy.cxx
sal_Int8 SetFlyFrmAnchor( SwFrmFmt& rFlyFmt, SfxItemSet& rSet, sal_Bool bNewFrms );
@@ -701,6 +702,7 @@ private:
SwFmt *_MakeTxtFmtColl(const String &, SwFmt *, BOOL, BOOL );
void InitTOXTypes();
+ void Paste( const SwDoc& );
public:
/** Life cycle
@@ -877,7 +879,7 @@ public:
/** IDocumentContentOperations
*/
- virtual bool Copy(SwPaM&, SwPosition&) const;
+ virtual bool Copy(SwPaM&, SwPosition&, bool bCopyAll) const;
virtual void DeleteSection(SwNode* pNode);
virtual bool Delete(SwPaM&);
virtual bool DelFullPara(SwPaM&);
@@ -1080,6 +1082,7 @@ public:
SwFrmFmt *pParent = 0 );
void CopyWithFlyInFly( const SwNodeRange& rRg,
+ const xub_StrLen nEndContentIndex,
const SwNodeIndex& rInsPos,
sal_Bool bMakeNewFrms = sal_True,
sal_Bool bDelRedlines = sal_True,
@@ -2082,6 +2085,7 @@ public:
}
::sfx2::IXmlIdRegistry& GetXmlIdRegistry();
+ SwDoc* CreateCopy() const;
};
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index d2f251bcf295..62b83c0ed5a9 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -68,9 +68,8 @@
#include <com/sun/star/xforms/XFormsSupplier.hpp>
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/text/XFlatParagraphIteratorProvider.hpp>
-#ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTLANGUAGES_HPP
#include <com/sun/star/document/XDocumentLanguages.hpp>
-#endif
+#include <com/sun/star/util/XCloneable.hpp>
#include <svtools/itemprop.hxx>
#include <svx/fmdmod.hxx>
#include <svx/UnoForbiddenCharsTable.hxx>
@@ -79,22 +78,22 @@
#include <cppuhelper/implbase4.hxx> // helper for implementations
#include <RefreshListenerContainer.hxx>
-#define __IFC31 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13, Ifc14, Ifc15, Ifc16, \
-Ifc17, Ifc18, Ifc19, Ifc20, Ifc21, Ifc22, Ifc23, Ifc24, Ifc25, Ifc26, Ifc27, Ifc28, Ifc29, Ifc30, Ifc31
+#define __IFC32 Ifc1, Ifc2, Ifc3, Ifc4, Ifc5, Ifc6, Ifc7, Ifc8, Ifc9, Ifc10, Ifc11, Ifc12, Ifc13, Ifc14, Ifc15, Ifc16, \
+Ifc17, Ifc18, Ifc19, Ifc20, Ifc21, Ifc22, Ifc23, Ifc24, Ifc25, Ifc26, Ifc27, Ifc28, Ifc29, Ifc30, Ifc31, Ifc32
-#define __CLASS_IFC31 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, \
+#define __CLASS_IFC32 class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, \
class Ifc8, class Ifc9, class Ifc10, class Ifc11, class Ifc12, class Ifc13, class Ifc14, class Ifc15, class Ifc16, \
class Ifc17, class Ifc18, class Ifc19, class Ifc20, class Ifc21, class Ifc22, class Ifc23, class Ifc24,\
-class Ifc25, class Ifc26, class Ifc27, class Ifc28, class Ifc29, class Ifc30, class Ifc31
+class Ifc25, class Ifc26, class Ifc27, class Ifc28, class Ifc29, class Ifc30, class Ifc31 , class Ifc32
-#define __PUBLIC_IFC31 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12, \
+#define __PUBLIC_IFC32 public Ifc1, public Ifc2, public Ifc3, public Ifc4, public Ifc5, public Ifc6, public Ifc7, public Ifc8, public Ifc9, public Ifc10, public Ifc11, public Ifc12, \
public Ifc13, public Ifc14, public Ifc15, public Ifc16, public Ifc17, public Ifc18, \
public Ifc19, public Ifc20, public Ifc21, public Ifc22, public Ifc23, public Ifc24, \
public Ifc25, public Ifc26, public Ifc27, public Ifc28, public Ifc29, public Ifc30, \
-public Ifc31
+public Ifc31, public Ifc32
#include <cppuhelper/implbase_ex.hxx>
#include <cppuhelper/implbase_ex_pre.hxx>
-#define __IFC_EX_TYPE_INIT31( class_cast ) \
+#define __IFC_EX_TYPE_INIT32( class_cast ) \
__IFC_EX_TYPE_INIT( class_cast, 1 ), __IFC_EX_TYPE_INIT( class_cast, 2 ), \
__IFC_EX_TYPE_INIT( class_cast, 3 ), __IFC_EX_TYPE_INIT( class_cast, 4 ), \
__IFC_EX_TYPE_INIT( class_cast, 5 ), __IFC_EX_TYPE_INIT( class_cast, 6 ), \
@@ -110,10 +109,10 @@ public Ifc31
__IFC_EX_TYPE_INIT( class_cast, 25 ), __IFC_EX_TYPE_INIT( class_cast, 26 ), \
__IFC_EX_TYPE_INIT( class_cast, 27 ), __IFC_EX_TYPE_INIT( class_cast, 28 ), \
__IFC_EX_TYPE_INIT( class_cast, 29 ), __IFC_EX_TYPE_INIT( class_cast, 30 ), \
- __IFC_EX_TYPE_INIT( class_cast, 31)
+ __IFC_EX_TYPE_INIT( class_cast, 31 ), __IFC_EX_TYPE_INIT( class_cast, 32)
#include <cppuhelper/implbase_ex_post.hxx>
-__DEF_IMPLHELPER_EX( 31 )
+__DEF_IMPLHELPER_EX( 32 )
class SwDoc;
class SwDocShell;
@@ -132,7 +131,7 @@ SV_DECL_PTRARR(ActionContextArr, UnoActionContextPtr, 4, 4)
******************************************************************************/
-typedef cppu::WeakImplHelper31
+typedef cppu::WeakImplHelper32
<
::com::sun::star::text::XTextDocument,
::com::sun::star::text::XLineNumberingProperties,
@@ -164,7 +163,8 @@ typedef cppu::WeakImplHelper31
::com::sun::star::view::XRenderable,
::com::sun::star::xforms::XFormsSupplier,
::com::sun::star::text::XFlatParagraphIteratorProvider,
- ::com::sun::star::document::XDocumentLanguages
+ ::com::sun::star::document::XDocumentLanguages,
+ ::com::sun::star::util::XCloneable
>
SwXTextDocumentBaseClass;
@@ -402,6 +402,10 @@ public:
// ::com::sun::star::text::XFlatParagraphIteratorProvider:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XFlatParagraphIterator > SAL_CALL getFlatParagraphIterator(::sal_Int32 nTextMarkupType, sal_Bool bAutomatic ) throw (::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::util::XCloneable
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException);
+
+
//
void Invalidate();
void Reactivate(SwDocShell* pNewDocShell);
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index fe513d51e4da..fb94d433d14f 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1196,7 +1196,7 @@ BOOL SwCompareLine::ChangesInLine( const SwCompareLine& rLine,
SwPaM aCpyPam( rSrcNd, nStt );
aCpyPam.SetMark();
aCpyPam.GetPoint()->nContent = nSEnd;
- aCpyPam.GetDoc()->Copy( aCpyPam, *aPam.GetPoint() );
+ aCpyPam.GetDoc()->Copy( aCpyPam, *aPam.GetPoint(), false );
pDoc->DoUndo( bUndo );
}
@@ -1367,7 +1367,7 @@ void SwCompareData::ShowDelete( const CompareData& rData, ULONG nStt,
SwNodeIndex aInsPos( *pLineNd, nOffset );
SwNodeIndex aSavePos( aInsPos, -1 );
- ((SwCompareData&)rData).rDoc.CopyWithFlyInFly( aRg, aInsPos );
+ ((SwCompareData&)rData).rDoc.CopyWithFlyInFly( aRg, 0, aInsPos );
rDoc.SetModified();
aSavePos++;
@@ -1624,7 +1624,7 @@ USHORT _SaveMergeRedlines::InsertRedline( FNInsUndo pFn )
RedlineMode_t eOld = pDoc->GetRedlineMode();
pDoc->SetRedlineMode_intern((RedlineMode_t)(eOld | nsRedlineMode_t::REDLINE_IGNORE));
- pSrcRedl->GetDoc()->Copy( *(SwPaM*)pSrcRedl, *pDestRedl->GetPoint() );
+ pSrcRedl->GetDoc()->Copy( *(SwPaM*)pSrcRedl, *pDestRedl->GetPoint(), false );
pDoc->SetRedlineMode_intern( eOld );
pDoc->DoUndo( bUndo );
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index bb9f24db8fb0..9db1c98685f3 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -2139,7 +2139,7 @@ void SwDoc::_CopyPageDescHeaderFooter( BOOL bCpyHeader,
aTmpIdx = *pSttNd->EndOfSectionNode();
rSrcNds._Copy( aRg, aTmpIdx );
aTmpIdx = *pSttNd;
- rSrcFmt.GetDoc()->_CopyFlyInFly( aRg, aTmpIdx );
+ rSrcFmt.GetDoc()->_CopyFlyInFly( aRg, 0, aTmpIdx );
pNewFmt->SetFmtAttr( SwFmtCntnt( pSttNd ));
}
else
diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx
index a4bfb749174c..b340b1ce45fb 100644
--- a/sw/source/core/doc/docglbl.cxx
+++ b/sw/source/core/doc/docglbl.cxx
@@ -307,7 +307,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath,
pDoc->GetNodes().Delete( aIdx, 1 );
// alle Flys in dem Bereich
- _CopyFlyInFly( aRg, aIdx );
+ _CopyFlyInFly( aRg, 0, aIdx );
// und noch alle Bookmarks
@@ -653,7 +653,7 @@ BOOL SwDoc::SplitDoc( USHORT eDocType, const String& rPath, int nOutlineLevel )
pDoc->GetNodes().Delete( aIdx, 1 );
// alle Flys in dem Bereich
- _CopyFlyInFly( aRg, aIdx );
+ _CopyFlyInFly( aRg, 0, aIdx );
// und noch alle Bookmarks
diff --git a/sw/source/core/doc/docglos.cxx b/sw/source/core/doc/docglos.cxx
index 4dac390ece46..2f3f58e76f3b 100644
--- a/sw/source/core/doc/docglos.cxx
+++ b/sw/source/core/doc/docglos.cxx
@@ -183,7 +183,7 @@ BOOL SwDoc::InsertGlossary( SwTextBlocks& rBlock, const String& rEntry,
SwDontExpandItem aACD;
aACD.SaveDontExpandItems( rInsPos );
- pGDoc->Copy( aCpyPam, rInsPos );
+ pGDoc->Copy( aCpyPam, rInsPos, false );
aACD.RestoreDontExpandItems( rInsPos );
if( pShell )
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 29258f9de72e..77df07dcb2d3 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -507,7 +507,7 @@ SwFrmFmt *SwDoc::CopyLayoutFmt( const SwFrmFmt& rSource,
// sorge dafuer das auch Fly's in Fly's kopiert werden
aIdx = *pSttNd->EndOfSectionNode();
- pSrcDoc->CopyWithFlyInFly( aRg, aIdx, sal_False, sal_True, sal_True );
+ pSrcDoc->CopyWithFlyInFly( aRg, 0, aIdx, sal_False, sal_True, sal_True );
}
else
{
@@ -885,7 +885,7 @@ if( DoesUndo() ) // werden erstmal alle Undo - Objecte geloescht.
do {
if( pTmp->HasMark() &&
*pTmp->GetPoint() != *pTmp->GetMark() )
- Copy( *pTmp, aPos );
+ Copy( *pTmp, aPos, false );
} while( &rPam != ( pTmp = (SwPaM*)pTmp->GetNext() ) );
mbCopyIsMove = bOldFlag;
mbUndo = bOldUndo;
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index e810d55d97c9..aa7227746ba1 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -32,6 +32,7 @@
#include "precompiled_sw.hxx"
#define ROLBCK_HISTORY_ONLY // Der Kampf gegen die CLOOK's
#include <doc.hxx>
+#include <dcontact.hxx>
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
#include <com/sun/star/document/UpdateDocMode.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
@@ -48,6 +49,7 @@
#include <svtools/macitem.hxx>
#include <svx/svxids.hrc>
+#include <svx/svdogrp.hxx>
#include <svx/linkmgr.hxx>
#include <svx/forbiddencharacterstable.hxx>
#include <svtools/zforlist.hxx>
@@ -95,8 +97,8 @@
#include <istyleaccess.hxx>
#include <swstylemanager.hxx>
#include <IGrammarContact.hxx>
+#include <tblsel.hxx>
#include <MarkManager.hxx>
-
#include <unochart.hxx>
#include <cmdid.h> // fuer den dflt - Printer in SetJob
@@ -1057,3 +1059,369 @@ void SwDoc::InitTOXTypes()
pTOXTypes->Insert( pNew, pTOXTypes->Count() );
}
+/*-- 08.05.2009 10:07:57---------------------------------------------------
+
+ -----------------------------------------------------------------------*/
+SwDoc* SwDoc::CreateCopy() const
+{
+ SwDoc* pRet = new SwDoc;
+ //copy settings
+/*
+ //aNodes( this ),
+ //aUndoNodes( this ),
+ mpAttrPool(new SwAttrPool(this)),*/
+ USHORT __FAR_DATA aRangeOfDefaults[] = {
+ RES_FRMATR_BEGIN, RES_FRMATR_END-1,
+ RES_CHRATR_BEGIN, RES_CHRATR_END-1,
+ RES_PARATR_BEGIN, RES_PARATR_END-1,
+ // --> OD 2008-02-25 #refactorlists##
+ RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
+ // <--
+ RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
+ 0
+ };
+
+ SfxItemSet aNewDefaults( pRet->GetAttrPool(), aRangeOfDefaults );
+
+ USHORT nWhich;
+ USHORT nRange = 0;
+ while( aRangeOfDefaults[nRange] != 0)
+ {
+ for( nWhich = aRangeOfDefaults[nRange]; nWhich < aRangeOfDefaults[nRange + 1]; ++nWhich )
+ {
+ const SfxPoolItem& rSourceAttr = mpAttrPool->GetDefaultItem( nWhich );
+ if( rSourceAttr != pRet->mpAttrPool->GetDefaultItem( nWhich ) )
+ aNewDefaults.Put( rSourceAttr );
+ }
+ nRange += 2;
+ }
+ if( aNewDefaults.Count() )
+ pRet->SetDefault( aNewDefaults );
+
+ /*
+ pDfltFrmFmt( new SwFrmFmt( GetAttrPool(), sFrmFmtStr, 0 ) ),
+ pEmptyPageFmt( new SwFrmFmt( GetAttrPool(), sEmptyPageStr, pDfltFrmFmt ) ),
+ pColumnContFmt( new SwFrmFmt( GetAttrPool(), sColumnCntStr, pDfltFrmFmt ) ),
+ pDfltCharFmt( new SwCharFmt( GetAttrPool(), sCharFmtStr, 0 ) ),
+ pDfltTxtFmtColl( new SwTxtFmtColl( GetAttrPool(), sTxtCollStr ) ),
+ pDfltGrfFmtColl( new SwGrfFmtColl( GetAttrPool(), sGrfCollStr ) ),
+ pFrmFmtTbl( new SwFrmFmts() ),
+ pCharFmtTbl( new SwCharFmts() ),
+ pSpzFrmFmtTbl( new SwSpzFrmFmts() ),
+ pSectionFmtTbl( new SwSectionFmts() ),
+ pTblFrmFmtTbl( new SwFrmFmts() ),
+ pTxtFmtCollTbl( new SwTxtFmtColls() ),
+ pGrfFmtCollTbl( new SwGrfFmtColls() ),
+ pBookmarkTbl( new SwBookmarks( 0, 16 ) ),
+ pTOXTypes( new SwTOXTypes() ),
+ pDefTOXBases( new SwDefTOXBase_Impl() ),
+ pLayout( 0 ), // Rootframe des spezifischen Layouts.
+ pDrawModel( 0 ),
+ pUndos( new SwUndos( 0, 20 ) ),
+ pUpdtFlds( new SwDocUpdtFld() ),
+ pFldTypes( new SwFldTypes() ),
+ pVirDev( 0 ),
+ pPrt( 0 ),
+ pPrtData( 0 ),
+ pGlossaryDoc( 0 ),
+ pOutlineRule( 0 ),
+ pFtnInfo( new SwFtnInfo ),
+ pEndNoteInfo( new SwEndNoteInfo ),
+ pLineNumberInfo( new SwLineNumberInfo ),
+ pFtnIdxs( new SwFtnIdxs ),
+ pDocStat( new SwDocStat ),
+ pDocShell( 0 ),
+ pDocShRef( 0 ),
+ pLinkMgr( new SvxLinkManager( 0 ) ),
+ pACEWord( 0 ),
+ pURLStateChgd( 0 ),
+ pNumberFormatter( 0 ),
+ pNumRuleTbl( new SwNumRuleTbl ),
+ // --> OD 2008-03-26 #refactorlists#
+ maLists(),
+ maListStyleLists(),
+ // <--
+ pRedlineTbl( new SwRedlineTbl ),
+ pAutoFmtRedlnComment( 0 ),
+ pUnoCrsrTbl( new SwUnoCrsrTbl( 0, 16 ) ),
+ pPgPViewPrtData( 0 ),
+ pExtInputRing( 0 ),
+ pLayouter( 0 ),
+ // --> OD 2008-03-07 #refactorlists#
+ pStyleAccess( 0 ),
+ // <--
+ pLayoutCache( 0 ),
+ pUnoCallBack(new SwUnoCallBack(0)),
+ mpGrammarContact( 0 ),
+ aChartDataProviderImplRef(),
+ pChartControllerHelper( 0 ),
+ // --> OD 2007-10-31 #i83479#
+ mpListItemsList( new tImplSortedNodeNumList() ),
+ // <--
+ nUndoPos( 0 ),
+ nUndoSavePos( 0 ),
+ nUndoCnt( 0 ),
+ nUndoSttEnd( 0 ),
+ nAutoFmtRedlnCommentNo( 0 ),
+ nLinkUpdMode( GLOBALSETTING ),
+ eFldUpdMode( AUTOUPD_GLOBALSETTING ),
+ eRedlineMode((RedlineMode_t)(nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE)),
+ eChrCmprType( CHARCOMPRESS_NONE ),
+ mReferenceCount(0),
+ mIdleBlockCount(0),
+ nLockExpFld( 0 ),
+ mbReadlineChecked(false),
+ mbWinEncryption(sal_False),
+ // --> OD 2005-02-11 #i38810#
+ mbLinksUpdated( sal_False ),
+ mbClipBoard( false ),
+ mbColumnSelection( false ),
+ // i#78591#
+ mbProtectForm(false),*/
+ pRet->n32DummyCompatabilityOptions1 = n32DummyCompatabilityOptions1;
+ pRet->n32DummyCompatabilityOptions2 = n32DummyCompatabilityOptions2;
+ /*
+ mbStartIdleTimer(sal_False)
+{
+ RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDoc::SwDoc" );
+
+ mbGlossDoc =
+ mbModified =
+ mbDtor =
+ mbUndo =
+ mbPageNums =
+ mbLoaded =
+ mbUpdateExpFld =
+ mbNewDoc =
+ mbCopyIsMove =
+ mbNoDrawUndoObj =
+ mbBrowseMode =
+ mbInReading =
+ mbInXMLImport =
+ mbUpdateTOX =
+ mbInLoadAsynchron =
+ mbHTMLMode =
+ mbInCallModified =
+ mbIsGlobalDoc =
+ mbGlblDocSaveLinks =
+ mbIsLabelDoc =
+ mbIsAutoFmtRedline =
+ mbOLEPrtNotifyPending =
+ mbAllOLENotify =
+ mbIsRedlineMove =
+ mbInsOnlyTxtGlssry =
+ mbContains_MSVBasic =
+ mbKernAsianPunctuation =
+#ifndef PRODUCT
+ mbXMLExport =
+#endif
+ // --> OD 2006-03-21 #b6375613#
+ mbApplyWorkaroundForB6375613 =
+ // <--
+ false;
+
+ mbGroupUndo =
+ mbNewFldLst =
+ mbVisibleLinks =
+ mbPurgeOLE =
+ true;
+
+ //
+ // COMPATIBILITY FLAGS START
+ //
+
+ // Note: Any non-hidden compatibility flag should obtain its default
+ // by asking SvtCompatibilityOptions, see below.
+ //
+ const SvtCompatibilityOptions aOptions;
+ */
+ pRet->mbParaSpaceMax = mbParaSpaceMax ;
+ pRet->mbParaSpaceMaxAtPages = mbParaSpaceMaxAtPages ;
+ pRet->mbTabCompat = mbTabCompat ;
+ pRet->mbUseVirtualDevice = mbUseVirtualDevice ;
+ pRet->mbAddExternalLeading = mbAddExternalLeading ;
+ pRet->mbOldLineSpacing = mbOldLineSpacing ;
+ pRet->mbAddParaSpacingToTableCells = mbAddParaSpacingToTableCells ;
+ pRet->mbUseFormerObjectPos = mbUseFormerObjectPos ;
+ pRet->mbUseFormerTextWrapping = mbUseFormerTextWrapping ;
+ pRet->mbConsiderWrapOnObjPos = mbConsiderWrapOnObjPos ;
+ pRet->mbAddFlyOffsets = mbAddFlyOffsets ;
+ pRet->mbOldNumbering = mbOldNumbering ;
+ pRet->mbUseHiResolutionVirtualDevice = mbUseHiResolutionVirtualDevice ;
+ pRet->mbIgnoreFirstLineIndentInNumbering = mbIgnoreFirstLineIndentInNumbering ;
+ pRet->mbDoNotJustifyLinesWithManualBreak = mbDoNotJustifyLinesWithManualBreak ;
+ pRet->mbDoNotResetParaAttrsForNumFont = mbDoNotResetParaAttrsForNumFont ;
+ pRet->mbOutlineLevelYieldsOutlineRule = mbOutlineLevelYieldsOutlineRule ;
+ pRet->mbTableRowKeep = mbTableRowKeep ;
+ pRet->mbIgnoreTabsAndBlanksForLineCalculation = mbIgnoreTabsAndBlanksForLineCalculation ;
+ pRet->mbDoNotCaptureDrawObjsOnPage = mbDoNotCaptureDrawObjsOnPage ;
+ pRet->mbClipAsCharacterAnchoredWriterFlyFrames= mbClipAsCharacterAnchoredWriterFlyFrames;
+ pRet->mbUnixForceZeroExtLeading = mbUnixForceZeroExtLeading ;
+ pRet->mbOldPrinterMetrics = mbOldPrinterMetrics ;
+ pRet->mbTabRelativeToIndent = mbTabRelativeToIndent ;
+ pRet->mbTabAtLeftIndentForParagraphsInList = mbTabAtLeftIndentForParagraphsInList ;
+
+ //
+ // COMPATIBILITY FLAGS END
+ //
+ /*
+ pMacroTable = new SvxMacroTableDtor;
+
+ mpGrammarContact = ::createGrammarContact();
+
+ // Formate
+ pFrmFmtTbl->Insert(pDfltFrmFmt, 0 );
+ pCharFmtTbl->Insert(pDfltCharFmt, 0 );
+
+ // FmtColls
+ // TXT
+ pTxtFmtCollTbl->Insert(pDfltTxtFmtColl, 0 );
+ // GRF
+ pGrfFmtCollTbl->Insert(pDfltGrfFmtColl, 0 );
+
+ // PageDesc, EmptyPageFmt und ColumnFmt anlegen
+ if ( !aPageDescs.Count() )
+ GetPageDescFromPool( RES_POOLPAGE_STANDARD );
+
+ //Leere Seite Einstellen.
+ pEmptyPageFmt->SetFmtAttr( SwFmtFrmSize( ATT_FIX_SIZE ) );
+ //BodyFmt fuer Spalten Einstellen.
+ pColumnContFmt->SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
+
+ _InitFieldTypes();
+
+ // lege (fuer die Filter) eine Default-OutlineNumRule an
+ // --> OD 2008-02-11 #newlistlevelattrs#
+ pOutlineRule = new SwNumRule( String::CreateFromAscii( SwNumRule::GetOutlineRuleName() ),
+ // --> OD 2008-06-06 #i89178#
+ numfunc::GetDefaultPositionAndSpaceMode(),
+ // <--
+ OUTLINE_RULE );
+ // <--
+ // #115901#
+ AddNumRule(pOutlineRule);
+ // --> OD 2005-10-21 - counting of phantoms depends on <IsOldNumbering()>
+ pOutlineRule->SetCountPhantoms( !get(IDocumentSettingAccess::OLD_NUMBERING) );
+ // <--
+
+ new SwTxtNode( SwNodeIndex( aUndoNodes.GetEndOfContent() ), pDfltTxtFmtColl );
+ new SwTxtNode( SwNodeIndex( aNodes.GetEndOfContent() ),
+ GetTxtCollFromPool( RES_POOLCOLL_STANDARD ));
+
+ // den eigenen IdleTimer setzen
+ aIdleTimer.SetTimeout( 600 );
+ aIdleTimer.SetTimeoutHdl( LINK(this, SwDoc, DoIdleJobs) );
+
+ aOLEModifiedTimer.SetTimeout( 1000 );
+ aOLEModifiedTimer.SetTimeoutHdl( LINK( this, SwDoc, DoUpdateModifiedOLE ));
+
+ // DBMgr anlegen
+ pNewDBMgr = new SwNewDBMgr;
+
+ // create TOXTypes
+ ShellResource* pShellRes = ViewShell::GetShellRes();
+
+ SwTOXType * pNew = new SwTOXType(TOX_CONTENT, pShellRes->aTOXContentName );
+ pTOXTypes->Insert( pNew, pTOXTypes->Count() );
+ pNew = new SwTOXType(TOX_INDEX, pShellRes->aTOXIndexName );
+ pTOXTypes->Insert( pNew, pTOXTypes->Count() );
+ pNew = new SwTOXType(TOX_USER, pShellRes->aTOXUserName );
+ pTOXTypes->Insert( pNew, pTOXTypes->Count() );
+ pNew = new SwTOXType(TOX_ILLUSTRATIONS, pShellRes->aTOXIllustrationsName );
+ pTOXTypes->Insert( pNew, pTOXTypes->Count() );
+ pNew = new SwTOXType(TOX_OBJECTS, pShellRes->aTOXObjectsName );
+ pTOXTypes->Insert( pNew, pTOXTypes->Count() );
+ pNew = new SwTOXType(TOX_TABLES, pShellRes->aTOXTablesName );
+ pTOXTypes->Insert( pNew, pTOXTypes->Count() );
+ pNew = new SwTOXType(TOX_AUTHORITIES, pShellRes->aTOXAuthoritiesName );
+ pTOXTypes->Insert( pNew, pTOXTypes->Count() );
+
+ {
+ SfxItemSet aIgnorableParagraphItems( GetAttrPool(),
+ RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END-1,
+ 0 );
+ pStyleAccess = createStyleManager( &aIgnorableParagraphItems );
+ }
+
+ ResetModified();
+
+*/
+ //copy content
+ pRet->Paste( *this );
+ return pRet;
+}
+/*-- 08.05.2009 10:52:40---------------------------------------------------
+ copy document content - code from SwFEShell::Paste( SwDoc* , BOOL )
+ -----------------------------------------------------------------------*/
+void SwDoc::Paste( const SwDoc& rSource )
+{
+// this has to be empty const USHORT nStartPageNumber = GetPhyPageNum();
+ // until the end of the NodesArray
+ SwNodeIndex aSourceIdx( rSource.GetNodes().GetEndOfExtras(), 2 );
+ SwPaM aCpyPam( aSourceIdx ); //DocStart
+ SwNodeIndex aTargetIdx( GetNodes().GetEndOfExtras(), 2 );
+ SwPaM aInsertPam( aTargetIdx ); //replaces PCURCRSR from SwFEShell::Paste()
+
+
+ aCpyPam.SetMark();
+ aCpyPam.Move( fnMoveForward, fnGoDoc );
+
+ this->StartUndo( UNDO_INSGLOSSARY, NULL );
+ this->LockExpFlds();
+
+ {
+ SwPosition& rInsPos = *aInsertPam.GetPoint();
+ //find out if the clipboard document starts with a table
+ bool bStartWithTable = 0 != aCpyPam.Start()->nNode.GetNode().FindTableNode();
+ SwPosition aInsertPosition( rInsPos );
+
+ {
+ SwNodeIndex aIndexBefore(rInsPos.nNode);
+
+ aIndexBefore--;
+
+ rSource.Copy( aCpyPam, rInsPos, true );
+
+ {
+ aIndexBefore++;
+ SwPaM aPaM(SwPosition(aIndexBefore, 0),
+ SwPosition(rInsPos.nNode, 0));
+
+ MakeUniqueNumRules(aPaM);
+ }
+ }
+
+ //TODO: Is this necessary here? SaveTblBoxCntnt( &rInsPos );
+ if(/*bIncludingPageFrames && */bStartWithTable)
+ {
+ //remove the paragraph in front of the table
+ SwPaM aPara(aInsertPosition);
+ this->DelFullPara(aPara);
+ }
+ //additionally copy page bound frames
+ if( /*bIncludingPageFrames && */rSource.GetSpzFrmFmts()->Count() )
+ {
+ for ( USHORT i = 0; i < rSource.GetSpzFrmFmts()->Count(); ++i )
+ {
+ BOOL bInsWithFmt = TRUE;
+ const SwFrmFmt& rCpyFmt = *(*rSource.GetSpzFrmFmts())[i];
+ if( bInsWithFmt )
+ {
+ SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() );
+ if( FLY_PAGE == aAnchor.GetAnchorId() )
+ {
+ aAnchor.SetPageNum( aAnchor.GetPageNum() + /*nStartPageNumber - */1 );
+ }
+ else
+ continue;
+ this->CopyLayoutFmt( rCpyFmt, aAnchor, true, true );
+ }
+ }
+ }
+ }
+
+ this->EndUndo( UNDO_INSGLOSSARY, NULL );
+
+ UnlockExpFlds();
+ UpdateFlds(NULL, false);
+}
diff --git a/sw/source/core/doc/docnum.cxx b/sw/source/core/doc/docnum.cxx
index 81cc7dc72239..4720bcd6fef8 100644
--- a/sw/source/core/doc/docnum.cxx
+++ b/sw/source/core/doc/docnum.cxx
@@ -2277,7 +2277,7 @@ BOOL SwDoc::MoveParagraph( const SwPaM& rPam, long nOffset, BOOL bIsOutlMv )
}
}
- Copy( aPam, aInsPos );
+ Copy( aPam, aInsPos, false );
if( bDelLastPara )
{
// dann muss der letzte leere Node wieder entfernt werden
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx
index 77268d3e318a..a1dc2e7c7e9d 100644
--- a/sw/source/core/doc/docredln.cxx
+++ b/sw/source/core/doc/docredln.cxx
@@ -3419,7 +3419,7 @@ void SwRedline::CopyToSection()
SwNodeIndex aNdIdx( *pSttNd, 1 );
SwTxtNode* pTxtNd = aNdIdx.GetNode().GetTxtNode();
SwPosition aPos( aNdIdx, SwIndex( pTxtNd ));
- pDoc->Copy( *this, aPos );
+ pDoc->Copy( *this, aPos, false );
// JP 08.10.98: die Vorlage vom EndNode ggfs. mit uebernehmen
// - ist im Doc::Copy nicht erwuenscht
@@ -3444,13 +3444,13 @@ void SwRedline::CopyToSection()
if( pCEndNd )
{
SwPosition aPos( *pSttNd->EndOfSectionNode() );
- pDoc->Copy( *this, aPos );
+ pDoc->Copy( *this, aPos, false );
}
else
{
SwNodeIndex aInsPos( *pSttNd->EndOfSectionNode() );
SwNodeRange aRg( pStt->nNode, 0, pEnd->nNode, 1 );
- pDoc->CopyWithFlyInFly( aRg, aInsPos );
+ pDoc->CopyWithFlyInFly( aRg, 0, aInsPos );
}
}
pCntntSect = new SwNodeIndex( *pSttNd );
diff --git a/sw/source/core/doc/swserv.cxx b/sw/source/core/doc/swserv.cxx
index 5df20bfa2a74..8e0469fe5d87 100644
--- a/sw/source/core/doc/swserv.cxx
+++ b/sw/source/core/doc/swserv.cxx
@@ -299,9 +299,12 @@ void SwServerObject::SetNoServer()
if(eType == BOOKMARK_SERVER && CNTNT_TYPE.pBkmk)
{
::sw::mark::DdeBookmark* const pDdeBookmark = dynamic_cast< ::sw::mark::DdeBookmark* >(CNTNT_TYPE.pBkmk);
- if(pDdeBookmark) pDdeBookmark->SetRefObject(NULL);
+ if(pDdeBookmark)
+ {
+ CNTNT_TYPE.pBkmk = 0, eType = NONE_SERVER;
+ pDdeBookmark->SetRefObject(NULL);
+ }
}
- CNTNT_TYPE.pBkmk = 0, eType = NONE_SERVER;
}
void SwServerObject::SetDdeBookmark( ::sw::mark::IMark& rBookmark)
diff --git a/sw/source/core/doc/tblcpy.cxx b/sw/source/core/doc/tblcpy.cxx
index 741911c743b0..5eea4c33247c 100644
--- a/sw/source/core/doc/tblcpy.cxx
+++ b/sw/source/core/doc/tblcpy.cxx
@@ -567,7 +567,7 @@ void lcl_CpyBox( const SwTable& rCpyTbl, const SwTableBox* pCpyBox,
SwNodeIndex aSavePos( aInsIdx, -1 );
if( pRg.get() )
- pCpyDoc->CopyWithFlyInFly( *pRg, aInsIdx, FALSE );
+ pCpyDoc->CopyWithFlyInFly( *pRg, 0, aInsIdx, FALSE );
else
pDoc->GetNodes().MakeTxtNode( aInsIdx, (SwTxtFmtColl*)pDoc->GetDfltTxtFmtColl() );
aSavePos++;
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 7712bd125720..2d6738fd915f 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -2103,7 +2103,7 @@ BOOL lcl_CopyBoxToDoc( const _FndBox*& rpFndBox, void* pPara )
*rpFndBox->GetBox()->GetSttNd()->EndOfSectionNode() );
SwNodeIndex aInsIdx( *pBox->GetSttNd(), 1 );
- pFromDoc->CopyWithFlyInFly( aCpyRg, aInsIdx, FALSE );
+ pFromDoc->CopyWithFlyInFly( aCpyRg, 0, aInsIdx, FALSE );
// den initialen TextNode loeschen
pCpyPara->pDoc->GetNodes().Delete( aInsIdx, 1 );
}
diff --git a/sw/source/core/docnode/ndcopy.cxx b/sw/source/core/docnode/ndcopy.cxx
index 4022c0d82e1b..2534dc6da659 100644
--- a/sw/source/core/docnode/ndcopy.cxx
+++ b/sw/source/core/docnode/ndcopy.cxx
@@ -673,7 +673,7 @@ void lcl_DeleteRedlines( const SwNodeRange& rRg, SwNodeRange& rCpyRg )
// Kopieren eines Bereiches im oder in ein anderes Dokument !
-bool SwDoc::Copy( SwPaM& rPam, SwPosition& rPos ) const
+bool SwDoc::Copy( SwPaM& rPam, SwPosition& rPos, bool bCopyAll ) const
{
const SwPosition *pStt = rPam.Start(), *pEnd = rPam.End();
@@ -712,13 +712,13 @@ bool SwDoc::Copy( SwPaM& rPam, SwPosition& rPos ) const
BOOL bRet = FALSE;
if( pDoc != this )
- bRet = _Copy( rPam, rPos, TRUE, pRedlineRange ); // nur normales Kopieren
+ bRet = _Copy( rPam, rPos, TRUE, bCopyAll, pRedlineRange ); // nur normales Kopieren
// Copy in sich selbst (ueber mehrere Nodes wird hier gesondert
// behandelt; in einem TextNode wird normal behandelt)
else if( ! ( *pStt <= rPos && rPos < *pEnd &&
( pStt->nNode != pEnd->nNode ||
!pStt->nNode.GetNode().IsTxtNode() )) )
- bRet = _Copy( rPam, rPos, TRUE, pRedlineRange ); // nur normales Kopieren
+ bRet = _Copy( rPam, rPos, TRUE, bCopyAll, pRedlineRange ); // nur normales Kopieren
else
{
@@ -742,7 +742,7 @@ bool SwDoc::Copy( SwPaM& rPam, SwPosition& rPos ) const
SwStartNode* pSttNd = pDoc->GetNodes().MakeEmptySection(
SwNodeIndex( GetNodes().GetEndOfAutotext() ));
aPam.GetPoint()->nNode = *pSttNd->EndOfSectionNode();
- pDoc->_Copy( rPam, *aPam.GetPoint(), FALSE ); // kopieren ohne Frames
+ pDoc->_Copy( rPam, *aPam.GetPoint(), FALSE, bCopyAll, 0 ); // kopieren ohne Frames
aPam.GetPoint()->nNode = pDoc->GetNodes().GetEndOfAutotext();
aPam.SetMark();
@@ -817,7 +817,7 @@ BOOL lcl_MarksWholeNode(const SwPaM & rPam)
}
BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
- BOOL bMakeNewFrms, SwPaM* pCpyRange ) const
+ BOOL bMakeNewFrms, bool bCopyAll, SwPaM* pCpyRange ) const
{
SwDoc* pDoc = rPos.nNode.GetNode().GetDoc();
bool bColumnSel = pDoc->IsClipBoard() && pDoc->IsColumnSelection();
@@ -1101,7 +1101,7 @@ BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
}
}
- if( aRg.aStart != aRg.aEnd )
+ if( bCopyAll || aRg.aStart != aRg.aEnd )
{
SfxItemSet aBrkSet( pDoc->GetAttrPool(), aBreakSetRange );
if( pSttNd && bCopyCollFmt && pDestNd->HasSwAttrSet() )
@@ -1116,13 +1116,13 @@ BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
if( aInsPos == pEnd->nNode )
{
SwNodeIndex aSaveIdx( aInsPos, -1 );
- CopyWithFlyInFly( aRg, aInsPos, bMakeNewFrms, FALSE );
+ CopyWithFlyInFly( aRg, 0,aInsPos, bMakeNewFrms, FALSE );
aSaveIdx++;
pEnd->nNode = aSaveIdx;
pEnd->nContent.Assign( aSaveIdx.GetNode().GetTxtNode(), 0 );
}
else
- CopyWithFlyInFly( aRg, aInsPos, bMakeNewFrms, FALSE );
+ CopyWithFlyInFly( aRg, pEnd->nContent.GetIndex(), aInsPos, bMakeNewFrms, FALSE );
bCopyBookmarks = FALSE;
@@ -1181,7 +1181,7 @@ BOOL SwDoc::_Copy( SwPaM& rPam, SwPosition& rPos,
// ----- Copy-Methode vom SwDoc - "kopiere Fly's in Fly's" ------
-void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg,
+void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex,
const SwNodeIndex& rInsPos, BOOL bMakeNewFrms,
BOOL bDelRedlines, BOOL bCopyFlyAtFly ) const
{
@@ -1220,7 +1220,7 @@ void SwDoc::CopyWithFlyInFly( const SwNodeRange& rRg,
// Undo abschalten
BOOL bUndo = pDest->DoesUndo();
pDest->DoUndo( FALSE );
- _CopyFlyInFly( rRg, aSavePos, bCopyFlyAtFly );
+ _CopyFlyInFly( rRg, nEndContentIndex, aSavePos, bCopyFlyAtFly );
pDest->DoUndo( bUndo );
SwNodeRange aCpyRange( aSavePos, rInsPos );
@@ -1256,7 +1256,7 @@ void lcl_ChainFmts( SwFlyFrmFmt *pSrc, SwFlyFrmFmt *pDest )
}
}
-void SwDoc::_CopyFlyInFly( const SwNodeRange& rRg, const SwNodeIndex& rSttIdx,
+void SwDoc::_CopyFlyInFly( const SwNodeRange& rRg, const xub_StrLen nEndContentIndex, const SwNodeIndex& rSttIdx,
BOOL bCopyFlyAtFly ) const
{
// Bug 22727: suche erst mal alle Flys zusammen, sortiere sie entsprechend
@@ -1273,7 +1273,8 @@ void SwDoc::_CopyFlyInFly( const SwNodeRange& rRg, const SwNodeIndex& rSttIdx,
const SwFrmFmt* pFmt = (*GetSpzFrmFmts())[n];
const SwFmtAnchor* pAnchor = &pFmt->GetAnchor();
const SwPosition* pAPos;
- if ( ( pAnchor->GetAnchorId() == FLY_AT_CNTNT ||
+ bool bAtCntnt = pAnchor->GetAnchorId() == FLY_AT_CNTNT;
+ if ( ( bAtCntnt ||
pAnchor->GetAnchorId() == FLY_AT_FLY ||
pAnchor->GetAnchorId() == FLY_AUTO_CNTNT ) &&
0 != ( pAPos = pAnchor->GetCntntAnchor()) &&
@@ -1282,9 +1283,53 @@ void SwDoc::_CopyFlyInFly( const SwNodeRange& rRg, const SwNodeIndex& rSttIdx,
: ( IsRedlineMove()
? rRg.aStart < pAPos->nNode
: rRg.aStart <= pAPos->nNode )) &&
- pAPos->nNode < rRg.aEnd )
+ pAPos->nNode <= rRg.aEnd )
{
- aArr.Insert( _ZSortFly( pFmt, pAnchor, nArrLen + aArr.Count() ));
+ //frames at the last source node are not always copied:
+ //- if the node is empty and is the last node of the document or a table cell
+ // or a text frame then tey have to be copied
+ //- if the content index in this node is > 0 then paragph and frame bound objects are copied
+ //- to-character bound objects are copied if their index is <= nEndContentIndex
+ bool bAdd = false;
+ if( pAPos->nNode < rRg.aEnd )
+ bAdd = true;
+ if( !bAdd )
+ {
+ bool bEmptyNode = false;
+ bool bLastNode = false;
+ // is the node empty?
+ const SwNodes& rNodes = pAPos->nNode.GetNodes();
+ SwTxtNode* pTxtNode;
+ if( 0 != ( pTxtNode = pAPos->nNode.GetNode().GetTxtNode() ))
+ {
+ bEmptyNode = !pTxtNode->GetTxt().Len();
+ if( bEmptyNode )
+ {
+ //last node information is only necessary to know for the last TextNode
+ SwNodeIndex aTmp( pAPos->nNode );
+ ++aTmp;//goto next node
+ while( rNodes[aTmp ]->IsEndNode() )
+ {
+ if( aTmp == rNodes.GetEndOfContent().GetIndex() )
+ {
+ bLastNode = true;
+ break;
+ }
+ ++aTmp;
+ }
+ }
+ }
+ bAdd = bLastNode && bEmptyNode;
+ if( !bAdd )
+ {
+ if( bAtCntnt )
+ bAdd = nEndContentIndex > 0;
+ else
+ bAdd = pAPos->nContent <= nEndContentIndex;
+ }
+ }
+ if( bAdd )
+ aArr.Insert( _ZSortFly( pFmt, pAnchor, nArrLen + aArr.Count() ));
}
}
diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx
index 3ce045994b80..33cd325c669a 100644
--- a/sw/source/core/docnode/section.cxx
+++ b/sw/source/core/docnode/section.cxx
@@ -1414,7 +1414,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
if( pSrcDoc != pDoc ||
pCpyPam->Start()->nNode > rInsPos ||
rInsPos >= pCpyPam->End()->nNode )
- pSrcDoc->Copy( *pCpyPam, *pPam->GetPoint() );
+ pSrcDoc->Copy( *pCpyPam, *pPam->GetPoint(), false );
delete pCpyPam;
}
if( pCpyRg && pSrcDoc == pDoc &&
@@ -1443,7 +1443,7 @@ void SwIntrnlSectRefLink::DataChanged( const String& rMimeType,
SwTblNumFmtMerge aTNFM( *pSrcDoc, *pDoc );
- pSrcDoc->CopyWithFlyInFly( *pCpyRg, rInsPos, bCreateFrm );
+ pSrcDoc->CopyWithFlyInFly( *pCpyRg, 0, rInsPos, bCreateFrm );
aSave++;
if( !bCreateFrm )
diff --git a/sw/source/core/edit/acorrect.cxx b/sw/source/core/edit/acorrect.cxx
index 665139b95844..3867d0a4a891 100644
--- a/sw/source/core/edit/acorrect.cxx
+++ b/sw/source/core/edit/acorrect.cxx
@@ -374,7 +374,7 @@ BOOL SwAutoCorrDoc::ChgAutoCorrWord( xub_StrLen & rSttPos, xub_StrLen nEndPos,
SwDontExpandItem aExpItem;
aExpItem.SaveDontExpandItems( *aPam.GetPoint() );
- pAutoDoc->Copy( aCpyPam, *aPam.GetPoint() );
+ pAutoDoc->Copy( aCpyPam, *aPam.GetPoint(), false );
aExpItem.RestoreDontExpandItems( *aPam.GetPoint() );
diff --git a/sw/source/core/edit/eddel.cxx b/sw/source/core/edit/eddel.cxx
index 4787877023f0..384aa414895a 100644
--- a/sw/source/core/edit/eddel.cxx
+++ b/sw/source/core/edit/eddel.cxx
@@ -249,7 +249,7 @@ long SwEditShell::Copy( SwEditShell* pDestShell )
bFirstMove = FALSE;
}
- if( !GetDoc()->Copy( *PCURCRSR, *pPos ))
+ if( !GetDoc()->Copy( *PCURCRSR, *pPos, false ))
continue;
SwPaM aInsertPaM(*pPos, SwPosition(aSttNdIdx));
diff --git a/sw/source/core/edit/edglss.cxx b/sw/source/core/edit/edglss.cxx
index f1d781e4080b..b408a1c33c81 100644
--- a/sw/source/core/edit/edglss.cxx
+++ b/sw/source/core/edit/edglss.cxx
@@ -168,7 +168,7 @@ USHORT SwEditShell::SaveGlossaryDoc( SwTextBlocks& rBlock,
aStt = pGDoc->GetNodes().GetEndOfExtras();
pCntntNd = pGDoc->GetNodes().GoNext( &aStt );
SwPosition aInsPos( aStt, SwIndex( pCntntNd ));
- pMyDoc->Copy( aCpyPam, aInsPos );
+ pMyDoc->Copy( aCpyPam, aInsPos, false );
nRet = rBlock.PutDoc();
}
@@ -250,13 +250,13 @@ BOOL SwEditShell::_CopySelToDoc( SwDoc* pInsDoc, SwNodeIndex* pSttNd )
{
PCURCRSR->SetMark();
PCURCRSR->Move( fnMoveForward, fnGoCntnt );
- bRet = GetDoc()->Copy( *PCURCRSR, aPos ) || bRet;
+ bRet = GetDoc()->Copy( *PCURCRSR, aPos, false ) || bRet;
PCURCRSR->Exchange();
PCURCRSR->DeleteMark();
}
}
else
- bRet = GetDoc()->Copy( *PCURCRSR, aPos ) || bRet;
+ bRet = GetDoc()->Copy( *PCURCRSR, aPos, false ) || bRet;
FOREACHPAM_END()
}
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index 186174d28c9a..07c8a0911080 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -840,7 +840,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
{
SwNodeIndex aIndexBefore(rInsPos.nNode);
aIndexBefore--;
- pClpDoc->Copy( rCopy, rInsPos );
+ pClpDoc->Copy( rCopy, rInsPos, false );
{
aIndexBefore++;
SwPaM aPaM(SwPosition(aIndexBefore, 0),
@@ -1069,7 +1069,7 @@ BOOL SwFEShell::Paste( SwDoc* pClpDoc, BOOL bIncludingPageFrames )
aIndexBefore--;
- pClpDoc->Copy( aCpyPam, rInsPos );
+ pClpDoc->Copy( aCpyPam, rInsPos, false );
{
aIndexBefore++;
diff --git a/sw/source/core/txtnode/atrftn.cxx b/sw/source/core/txtnode/atrftn.cxx
index 9c4728042d34..4b51e94e3404 100644
--- a/sw/source/core/txtnode/atrftn.cxx
+++ b/sw/source/core/txtnode/atrftn.cxx
@@ -310,7 +310,7 @@ void SwTxtFtn::CopyFtn( SwTxtFtn *pDest )
SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() );
ULONG nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
- m_pTxtNode->GetDoc()->CopyWithFlyInFly( aRg, aEnd, TRUE );
+ m_pTxtNode->GetDoc()->CopyWithFlyInFly( aRg, 0, aEnd, TRUE );
// Wenn die Dest-Sektion nicht leer war, so muessen die alten
// Nodes geloescht werden:
diff --git a/sw/source/core/undo/untblk.cxx b/sw/source/core/undo/untblk.cxx
index dbe76f8a16fd..581e2185907e 100644
--- a/sw/source/core/undo/untblk.cxx
+++ b/sw/source/core/undo/untblk.cxx
@@ -346,7 +346,7 @@ void SwUndoInserts::Repeat( SwUndoIter& rUndoIter )
SwPaM aPam( *rUndoIter.pAktPam->GetPoint() );
SetPaM( aPam );
- aPam.GetDoc()->Copy( aPam, *rUndoIter.pAktPam->GetPoint() );
+ aPam.GetDoc()->Copy( aPam, *rUndoIter.pAktPam->GetPoint(), false );
rUndoIter.pLastUndoObj = this;
}
diff --git a/sw/source/filter/ww8/ww8glsy.cxx b/sw/source/filter/ww8/ww8glsy.cxx
index df036b03318c..81d605457e9c 100644
--- a/sw/source/filter/ww8/ww8glsy.cxx
+++ b/sw/source/filter/ww8/ww8glsy.cxx
@@ -187,7 +187,7 @@ bool WW8Glossary::MakeEntries(SwDoc *pD, SwTextBlocks &rBlocks,
-1 );
pCNd = aIdx.GetNode().GetCntntNode();
SwPosition aPos( aIdx, SwIndex( pCNd, pCNd->Len() ));
- pD->Copy( aPam, aPos );
+ pD->Copy( aPam, aPos, false );
rBlocks.PutDoc();
}
}
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 444646a6281d..a25bfbb45659 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -699,7 +699,7 @@ void SwXMLTableCellContext_Impl::EndElement()
SwPaM aSrcPaM( *pSrcPaM->GetPoint(),
*pSrcPaM->GetMark() );
SwPosition aDstPos( *pDstTxtCrsr->GetPaM()->GetPoint() );
- pDoc->Copy( aSrcPaM, aDstPos );
+ pDoc->Copy( aSrcPaM, aDstPos, false );
nColRepeat--;
}
diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
index cbc77678e84e..98a5f8416185 100644
--- a/sw/source/ui/dbui/dbmgr.cxx
+++ b/sw/source/ui/dbui/dbmgr.cxx
@@ -35,7 +35,7 @@
#endif
#include <stdio.h>
-
+#include <unotxdoc.hxx>
#include <com/sun/star/text/NotePrintMode.hpp>
#include <sfx2/app.hxx>
#include <com/sun/star/sdb/CommandType.hpp>
@@ -43,17 +43,13 @@
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
-#ifndef _COM_SUN_STAR_UTIL_iXNUMBERFORMATTER_HPP_
#include <com/sun/star/util/XNumberFormatter.hpp>
-#endif
#include <com/sun/star/sdb/XCompletedConnection.hpp>
#include <com/sun/star/sdb/XCompletedExecution.hpp>
#include <com/sun/star/container/XChild.hpp>
-#ifndef _COM_SUN_STAR_TEXT_MAILMERGEEVENT_
#include <com/sun/star/text/MailMergeEvent.hpp>
-#endif
#include <com/sun/star/frame/XStorable.hpp>
-#include "com/sun/star/ui/dialogs/TemplateDescription.hpp"
+#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
#include <com/sun/star/uno/XNamingService.hpp>
@@ -65,9 +61,7 @@
#include <dbconfig.hxx>
#include <swdbtoolsclient.hxx>
#include <pagedesc.hxx>
-#ifndef _LSTBOX_HXX //autogen
#include <vcl/lstbox.hxx>
-#endif
#include <unotools/tempfile.hxx>
#include <svtools/pathoptions.hxx>
#include <svtools/urihelper.hxx>
@@ -86,39 +80,25 @@
#include <goodies/mailenum.hxx>
#include <cmdid.h>
#include <swmodule.hxx>
-#ifndef _VIEW_HXX
#include <view.hxx>
-#endif
-#ifndef _DOCSH_HXX
#include <docsh.hxx>
-#endif
#include <edtwin.hxx>
#include <wrtsh.hxx>
#include <fldbas.hxx>
#include <initui.hxx>
#include <swundo.hxx>
#include <flddat.hxx>
-#ifndef _MODCFG_HXX
#include <modcfg.hxx>
-#endif
#include <swprtopt.hxx>
#include <shellio.hxx>
#include <dbui.hxx>
-#ifndef _DBMGR_HXX
#include <dbmgr.hxx>
-#endif
#include <doc.hxx>
#include <swwait.hxx>
#include <swunohelper.hxx>
-#ifndef _DBUI_HRC
#include <dbui.hrc>
-#endif
-#ifndef _GLOBALS_HRC
#include <globals.hrc>
-#endif
-#ifndef _STATSTR_HRC
#include <statstr.hrc>
-#endif
#include <mmconfigitem.hxx>
#include <sfx2/request.hxx>
#include <hintids.hxx>
@@ -3185,7 +3165,6 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
SwWrtShell& rSourceShell = rSourceView.GetWrtShell();
BOOL bSynchronizedDoc = rSourceShell.IsLabelDoc() && rSourceShell.GetSectionFmtCount() > 1;
- String sSourceDocURL;
//save the settings of the first
rSourceShell.SttEndDoc(TRUE);
USHORT nStartingPageNo = rSourceShell.GetVirtPageNum();
@@ -3195,22 +3174,6 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
try
{
- // save the working document into a temporary location
- sSourceDocURL = URIHelper::SmartRel2Abs(
- INetURLObject(), utl::TempFile::CreateTempName(),
- URIHelper::GetMaybeFileHdl());
- const SfxFilter *pSfxFlt = SwIoSystem::GetFilterOfFormat(
- String::CreateFromAscii( FILTER_XML ),
- SwDocShell::Factory().GetFilterContainer() );
-
- SfxStringItem aFilterName( SID_FILTER_NAME, pSfxFlt->GetFilterName());
- uno::Sequence< beans::PropertyValue > aValues(1);
- beans::PropertyValue* pValues = aValues.getArray();
- pValues[0].Name = C2U("FilterName");
- pValues[0].Value <<= ::rtl::OUString(pSfxFlt->GetFilterName());
- uno::Reference< frame::XStorable > xStore( rSourceView.GetDocShell()->GetModel(), uno::UNO_QUERY);
- xStore->storeToURL( sSourceDocURL, aValues );
-
// create a target docshell to put the merged document into
SfxObjectShellRef xTargetDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
xTargetDocShell->DoInitNew( 0 );
@@ -3259,116 +3222,120 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
Application::Reschedule();
}
- // create a new docshell from the temporary document
- SfxBoolItem aHidden( SID_HIDDEN, TRUE );
- SfxStringItem aReferer( SID_REFERER, String::CreateFromAscii(URL_PREFIX_PRIV_SOFFICE ));
- SfxStringItem aTarget( SID_TARGETNAME, String::CreateFromAscii("_blank") );
- SfxStringItem aURL( SID_FILE_NAME, sSourceDocURL );
- const SfxPoolItem* pReturnValue =
- rSourceView.GetViewFrame()->GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON,
- &aURL, &aFilterName, &aHidden, &aReferer, &aTarget, 0L);
- if(pReturnValue)
+ // copy the source document
+ SfxObjectShellRef xWorkDocSh;
+ if(nDocNo == 1 )
{
- SfxViewFrameItem* pVItem = (SfxViewFrameItem*)pReturnValue;
- SwView* pWorkView = (SwView*) pVItem->GetFrame()->GetViewShell();
- SwWrtShell& rWorkShell = pWorkView->GetWrtShell();
- pWorkView->AttrChangedNotify( &rWorkShell );//Damit SelectShell gerufen wird.
-
- // merge the data
- SwDoc* pWorkDoc = rWorkShell.GetDoc();
- SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr();
- pWorkDoc->SetNewDBMgr( this );
- pWorkDoc->EmbedAllLinks();
- if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds())
- rWorkShell.Undo();
- // create a layout
- rWorkShell.CalcLayout();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
- rWorkShell.ViewShell::UpdateFlds();
- SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
-
- // strip invisible content and convert fields to text
- rWorkShell.RemoveInvisibleContent();
- rWorkShell.ConvertFieldsToText();
- rWorkShell.SetNumberingRestart();
-
-
- // insert the document into the target document
- rWorkShell.SttEndDoc(FALSE);
- rWorkShell.SttEndDoc(TRUE);
- rWorkShell.SelAll();
- pTargetShell->SttEndDoc(FALSE);
-
- //#i63806# put the styles to the target document
- //if the source uses headers or footers each new copy need to copy a new page styles
- if(bPageStylesWithHeaderFooter)
- {
- //create a new pagestyle
- //copy the pagedesc from the current document to the new document and change the name of the to-be-applied style
-
- SwDoc* pTargetDoc = pTargetShell->GetDoc();
- String sNewPageDescName = lcl_FindUniqueName(pTargetShell, sStartingPageDesc, nDocNo );
- pTargetShell->GetDoc()->MakePageDesc( sNewPageDescName );
- SwPageDesc* pTargetPageDesc = pTargetShell->FindPageDescByName( sNewPageDescName );
- if(pSourcePageDesc && pTargetPageDesc)
- {
- pTargetDoc->CopyPageDesc( *pSourcePageDesc, *pTargetPageDesc, sal_False );
- sModifiedStartingPageDesc = sNewPageDescName;
- lcl_CopyFollowPageDesc( *pTargetShell, *pSourcePageDesc, *pTargetPageDesc, nDocNo );
- }
- }
- if(nDocNo == 1 || bPageStylesWithHeaderFooter)
- {
- pTargetView->GetDocShell()->_LoadStyles( *pWorkView->GetDocShell(), sal_True );
- }
- if(nDocNo > 1)
- {
- pTargetShell->InsertPageBreak( &sModifiedStartingPageDesc, nStartingPageNo );
- }
- else
- {
- pTargetShell->SetPageStyle(sModifiedStartingPageDesc);
- }
- USHORT nPageCountBefore = pTargetShell->GetPageCnt();
- DBG_ASSERT(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended");
- //#i51359# add a second paragraph in case there's only one
+ uno::Reference< util::XCloneable > xClone( rSourceView.GetDocShell()->GetModel(), uno::UNO_QUERY);
+ uno::Reference< lang::XUnoTunnel > xWorkDocShell( xClone->createClone(), uno::UNO_QUERY);
+ SwXTextDocument* pWorkModel = reinterpret_cast<SwXTextDocument*>(xWorkDocShell->getSomething(SwXTextDocument::getUnoTunnelId()));
+ xWorkDocSh = pWorkModel->GetDocShell();
+ }
+ else
+ {
+ SwDoc* pNewDoc = rSourceView.GetDocShell()->GetDoc()->CreateCopy();
+ xWorkDocSh = new SwDocShell( pNewDoc, SFX_CREATE_MODE_STANDARD );
+ xWorkDocSh->DoInitNew();
+ }
+ //create a ViewFrame
+ SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::CreateViewFrame( *xWorkDocSh, 0, sal_True )->GetViewShell() );
+ SwWrtShell& rWorkShell = pWorkView->GetWrtShell();
+ pWorkView->AttrChangedNotify( &rWorkShell );//Damit SelectShell gerufen wird.
+
+ // merge the data
+ SwDoc* pWorkDoc = rWorkShell.GetDoc();
+ SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr();
+ pWorkDoc->SetNewDBMgr( this );
+ pWorkDoc->EmbedAllLinks();
+ if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds())
+ rWorkShell.Undo();
+ // create a layout
+ rWorkShell.CalcLayout();
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
+ rWorkShell.ViewShell::UpdateFlds();
+ SFX_APP()->NotifyEvent(SfxEventHint(SW_EVENT_FIELD_MERGE_FINISHED, rWorkShell.GetView().GetViewFrame()->GetObjectShell()));
+
+ // strip invisible content and convert fields to text
+ rWorkShell.RemoveInvisibleContent();
+ rWorkShell.ConvertFieldsToText();
+ rWorkShell.SetNumberingRestart();
+
+
+ // insert the document into the target document
+ rWorkShell.SttEndDoc(FALSE);
+ rWorkShell.SttEndDoc(TRUE);
+ rWorkShell.SelAll();
+ pTargetShell->SttEndDoc(FALSE);
+
+ //#i63806# put the styles to the target document
+ //if the source uses headers or footers each new copy need to copy a new page styles
+ if(bPageStylesWithHeaderFooter)
+ {
+ //create a new pagestyle
+ //copy the pagedesc from the current document to the new document and change the name of the to-be-applied style
+
+ SwDoc* pTargetDoc = pTargetShell->GetDoc();
+ String sNewPageDescName = lcl_FindUniqueName(pTargetShell, sStartingPageDesc, nDocNo );
+ pTargetShell->GetDoc()->MakePageDesc( sNewPageDescName );
+ SwPageDesc* pTargetPageDesc = pTargetShell->FindPageDescByName( sNewPageDescName );
+ if(pSourcePageDesc && pTargetPageDesc)
{
- SwNodeIndex aIdx( pWorkDoc->GetNodes().GetEndOfExtras(), 2 );
- SwPosition aTestPos( aIdx );
- SwCursor aTestCrsr(aTestPos,0,false);
- if(!aTestCrsr.MovePara(fnParaNext, fnParaStart))
- {
- //append a paragraph
- pWorkDoc->AppendTxtNode( aTestPos );
- }
+ pTargetDoc->CopyPageDesc( *pSourcePageDesc, *pTargetPageDesc, sal_False );
+ sModifiedStartingPageDesc = sNewPageDescName;
+ lcl_CopyFollowPageDesc( *pTargetShell, *pSourcePageDesc, *pTargetPageDesc, nDocNo );
}
- pTargetShell->Paste( rWorkShell.GetDoc(), sal_True );
- //convert fields in page styles (header/footer - has to be done after the first document has been pasted
- if(1 == nDocNo)
+ }
+ if(nDocNo == 1 || bPageStylesWithHeaderFooter)
+ {
+ pTargetView->GetDocShell()->_LoadStyles( *pWorkView->GetDocShell(), sal_True );
+ }
+ if(nDocNo > 1)
+ {
+ pTargetShell->InsertPageBreak( &sModifiedStartingPageDesc, nStartingPageNo );
+ }
+ else
+ {
+ pTargetShell->SetPageStyle(sModifiedStartingPageDesc);
+ }
+ USHORT nPageCountBefore = pTargetShell->GetPageCnt();
+ DBG_ASSERT(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended");
+ //#i51359# add a second paragraph in case there's only one
+ {
+ SwNodeIndex aIdx( pWorkDoc->GetNodes().GetEndOfExtras(), 2 );
+ SwPosition aTestPos( aIdx );
+ SwCursor aTestCrsr(aTestPos,0,false);
+ if(!aTestCrsr.MovePara(fnParaNext, fnParaStart))
{
- pTargetShell->CalcLayout();
- pTargetShell->ConvertFieldsToText();
+ //append a paragraph
+ pWorkDoc->AppendTxtNode( aTestPos );
}
- //add the document info to the config item
- SwDocMergeInfo aMergeInfo;
- aMergeInfo.nStartPageInTarget = nPageCountBefore;
- //#i72820# calculate layout to be able to find the correct page index
+ }
+ pTargetShell->Paste( rWorkShell.GetDoc(), sal_True );
+ //convert fields in page styles (header/footer - has to be done after the first document has been pasted
+ if(1 == nDocNo)
+ {
pTargetShell->CalcLayout();
- aMergeInfo.nEndPageInTarget = pTargetShell->GetPageCnt();
- aMergeInfo.nDBRow = nStartRow;
- rMMConfig.AddMergedDocument( aMergeInfo );
- ++nRet;
-
- // the print monitor needs some time to act
- for( USHORT i = 0; i < 25; i++)
- Application::Reschedule();
-
- //restore the ole DBMgr
- pWorkDoc->SetNewDBMgr( pWorkDBMgr );
- //now the temporary document should be closed
- SfxObjectShellRef xDocSh(pWorkView->GetDocShell());
- xDocSh->DoClose();
+ pTargetShell->ConvertFieldsToText();
}
+ //add the document info to the config item
+ SwDocMergeInfo aMergeInfo;
+ aMergeInfo.nStartPageInTarget = nPageCountBefore;
+ //#i72820# calculate layout to be able to find the correct page index
+ pTargetShell->CalcLayout();
+ aMergeInfo.nEndPageInTarget = pTargetShell->GetPageCnt();
+ aMergeInfo.nDBRow = nStartRow;
+ rMMConfig.AddMergedDocument( aMergeInfo );
+ ++nRet;
+
+ // the print monitor needs some time to act
+ for( USHORT i = 0; i < 25; i++)
+ Application::Reschedule();
+
+ //restore the ole DBMgr
+ pWorkDoc->SetNewDBMgr( pWorkDBMgr );
+ //now the temporary document should be closed
+ SfxObjectShellRef xDocSh(pWorkView->GetDocShell());
+ xDocSh->DoClose();
nEndRow = pImpl->pMergeData->xResultSet->getRow();
++nDocNo;
} while( !bCancel &&
@@ -3390,8 +3357,6 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
{
DBG_ERROR("exception caught in SwNewDBMgr::MergeDocuments");
}
- if(sSourceDocURL.Len())
- File::remove( sSourceDocURL );
DELETEZ(pImpl->pMergeData);
bInMerge = FALSE;
return nRet;
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--------------------------------
---------------------------------------------------------------------------*/