rpms/openoffice.org/F-10 workspace.os131.patch, NONE, 1.1 openoffice.org.spec, 1.1736, 1.1737

David Tardon dtardon at fedoraproject.org
Fri Aug 21 05:10:23 UTC 2009


Author: dtardon

Update of /cvs/extras/rpms/openoffice.org/F-10
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv25606

Modified Files:
	openoffice.org.spec 
Added Files:
	workspace.os131.patch 
Log Message:
Resolves: rbhz#501141 Images and Frames disappear in sequential printing

workspace.os131.patch:
 inc/IDocumentContentOperations.hxx |    2 
 inc/doc.hxx                        |   10 
 inc/unotxdoc.hxx                   |   32 +--
 source/core/doc/doccomp.cxx        |    6 
 source/core/doc/docfmt.cxx         |    2 
 source/core/doc/docglbl.cxx        |    2 
 source/core/doc/docglos.cxx        |    2 
 source/core/doc/doclay.cxx         |    4 
 source/core/doc/docnew.cxx         |  385 +++++++++++++++++++++++++++++++++++--
 source/core/doc/docnum.cxx         |    2 
 source/core/doc/docredln.cxx       |    6 
 source/core/doc/tblcpy.cxx         |    2 
 source/core/doc/tblrwcl.cxx        |    2 
 source/core/docnode/ndcopy.cxx     |   73 +++++--
 source/core/docnode/section.cxx    |    4 
 source/core/edit/eddel.cxx         |    2 
 source/core/edit/edglss.cxx        |    6 
 source/core/frmedt/fecopy.cxx      |    4 
 source/core/txtnode/atrftn.cxx     |    2 
 source/core/undo/untblk.cxx        |    2 
 source/filter/ww8/ww8glsy.cxx      |    2 
 source/filter/xml/xmltbli.cxx      |    2 
 source/ui/dbui/dbmgr.cxx           |   49 ++--
 source/ui/uno/unoatxt.cxx          |    4 
 source/ui/uno/unotxdoc.cxx         |   30 +-
 25 files changed, 530 insertions(+), 107 deletions(-)

--- NEW FILE workspace.os131.patch ---
Index: sw/source/filter/xml/xmltbli.cxx
===================================================================
--- sw/source/filter/xml/xmltbli.cxx	(revision 272643)
+++ sw/source/filter/xml/xmltbli.cxx	(revision 272644)
@@ -662,7 +662,7 @@
 					SwPaM aSrcPaM( *pSrcPaM->GetPoint(),
 								   *pSrcPaM->GetMark() );
 					SwPosition aDstPos( *pDstTxtCrsr->GetPaM()->GetPoint() );
-					pDoc->Copy( aSrcPaM, aDstPos );
+                    pDoc->Copy( aSrcPaM, aDstPos, false );
 
 					nColRepeat--;
 				}
Index: sw/source/filter/ww8/ww8glsy.cxx
===================================================================
--- sw/source/filter/ww8/ww8glsy.cxx	(revision 272643)
+++ sw/source/filter/ww8/ww8glsy.cxx	(revision 272644)
@@ -187,7 +187,7 @@
                         -1 );
                     pCNd = aIdx.GetNode().GetCntntNode();
                     SwPosition aPos( aIdx, SwIndex( pCNd, pCNd->Len() ));
-                    pD->Copy( aPam, aPos );
+                    pD->Copy( aPam, aPos, false );
                     rBlocks.PutDoc();
                 }
             }
Index: sw/source/core/frmedt/fecopy.cxx
===================================================================
--- sw/source/core/frmedt/fecopy.cxx	(revision 272643)
+++ sw/source/core/frmedt/fecopy.cxx	(revision 272644)
@@ -840,7 +840,7 @@
             {
                 SwNodeIndex aIndexBefore(rInsPos.nNode);
                 aIndexBefore--;
-                pClpDoc->Copy( rCopy, rInsPos );
+                pClpDoc->Copy( rCopy, rInsPos, false );
                 {
                     aIndexBefore++;
                     SwPaM aPaM(SwPosition(aIndexBefore, 0),
@@ -1069,7 +1069,7 @@
 
                 aIndexBefore--;
 
-                pClpDoc->Copy( aCpyPam, rInsPos );
+                pClpDoc->Copy( aCpyPam, rInsPos, false );
 
                 {
                     aIndexBefore++;
Index: sw/source/core/txtnode/atrftn.cxx
===================================================================
--- sw/source/core/txtnode/atrftn.cxx	(revision 272643)
+++ sw/source/core/txtnode/atrftn.cxx	(revision 272644)
@@ -303,7 +303,7 @@
 		SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() );
 		ULONG  nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
 
-		pMyTxtNd->GetDoc()->CopyWithFlyInFly( aRg, aEnd, TRUE );
+        pMyTxtNd->GetDoc()->CopyWithFlyInFly( aRg, 0, aEnd, TRUE );
 
 		// Wenn die Dest-Sektion nicht leer war, so muessen die alten
 		// Nodes geloescht werden:
Index: sw/source/core/edit/edglss.cxx
===================================================================
--- sw/source/core/edit/edglss.cxx	(revision 272643)
+++ sw/source/core/edit/edglss.cxx	(revision 272644)
@@ -168,7 +168,7 @@
 			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 @@
 				{
 					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, true ) || bRet;
 
 		FOREACHPAM_END()
         }
Index: sw/source/core/edit/eddel.cxx
===================================================================
--- sw/source/core/edit/eddel.cxx	(revision 272643)
+++ sw/source/core/edit/eddel.cxx	(revision 272644)
@@ -253,7 +253,7 @@
 			bFirstMove = FALSE;
 		}
 
-		if( !GetDoc()->Copy( *PCURCRSR, *pPos ))
+        if( !GetDoc()->Copy( *PCURCRSR, *pPos, false ))
 			continue;
 
         SwPaM aInsertPaM(*pPos, aSttNdIdx);
Index: sw/source/core/doc/docnew.cxx
===================================================================
--- sw/source/core/doc/docnew.cxx	(revision 272643)
+++ sw/source/core/doc/docnew.cxx	(revision 272644)
@@ -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>
@@ -46,12 +47,9 @@
 #include <sfx2/docfile.hxx>
 #include <sfx2/frame.hxx>
 
-#ifndef _SFXMACITEM_HXX //autogen
-	#include <svtools/macitem.hxx>
-#endif
-#ifndef _SVX_SVXIDS_HRC
+#include <svtools/macitem.hxx>
 #include <svx/svxids.hrc>
-#endif
+#include <svx/svdogrp.hxx>
 #include <svx/linkmgr.hxx>
 #include <svx/forbiddencharacterstable.hxx>
 #include <svtools/zforlist.hxx>
@@ -79,18 +77,12 @@
 #include <frmfmt.hxx>
 #include <rolbck.hxx>           // Undo-Attr, SwHistory
 #include <poolfmt.hxx>          // fuer die Pool-Vorlage
-#ifndef _DBMGR_HXX
 #include <dbmgr.hxx>
-#endif
-#ifndef _DOCSH_HXX
 #include <docsh.hxx>
-#endif
 #include <acorrect.hxx>			// fuer die autom. Aufnahme von Ausnahmen
 #include <visiturl.hxx>			// fuer die URL-Change Benachrichtigung
 #include <docary.hxx>
-#ifndef _LINEINFO_HXX
 #include <lineinfo.hxx>
-#endif
 #include <drawdoc.hxx>
 #include <linkenum.hxx>
 #include <fldupde.hxx>
@@ -105,12 +97,10 @@
 #include <istyleaccess.hxx>
 #include <swstylemanager.hxx>
 #include <IGrammarContact.hxx>
-
+#include <tblsel.hxx>
 #include <unochart.hxx>
 
-#ifndef _CMDID_H
 #include <cmdid.h>              // fuer den dflt - Printer in SetJob
-#endif
 
 
 // --> OD 2006-04-19 #b6375613#
@@ -1056,3 +1046,370 @@
     }
 }
 // <--
+/*-- 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 );
+
+    BOOL bRet = TRUE, bDelTbl = TRUE;
+    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);
+}
Index: sw/source/core/doc/doccomp.cxx
===================================================================
--- sw/source/core/doc/doccomp.cxx	(revision 272643)
+++ sw/source/core/doc/doccomp.cxx	(revision 272644)
@@ -1196,7 +1196,7 @@
 					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 @@
 	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 @@
 		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 );
Index: sw/source/core/doc/docnum.cxx
===================================================================
--- sw/source/core/doc/docnum.cxx	(revision 272643)
+++ sw/source/core/doc/docnum.cxx	(revision 272644)
@@ -2273,7 +2273,7 @@
                 }
             }
 
-			Copy( aPam, aInsPos );
+            Copy( aPam, aInsPos, false );
 			if( bDelLastPara )
 			{
 				// dann muss der letzte leere Node wieder entfernt werden
Index: sw/source/core/doc/docredln.cxx
===================================================================
--- sw/source/core/doc/docredln.cxx	(revision 272643)
+++ sw/source/core/doc/docredln.cxx	(revision 272644)
@@ -3418,7 +3418,7 @@
 			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
@@ -3443,13 +3443,13 @@
 			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 );
Index: sw/source/core/doc/docglos.cxx
===================================================================
--- sw/source/core/doc/docglos.cxx	(revision 272643)
+++ sw/source/core/doc/docglos.cxx	(revision 272644)
@@ -183,7 +183,7 @@
                 SwDontExpandItem aACD;
 				aACD.SaveDontExpandItems( rInsPos );
 
-                pGDoc->Copy( aCpyPam, rInsPos );
+                pGDoc->Copy( aCpyPam, rInsPos, false );
 
 				aACD.RestoreDontExpandItems( rInsPos );
 				if( pShell )
Index: sw/source/core/doc/tblcpy.cxx
===================================================================
--- sw/source/core/doc/tblcpy.cxx	(revision 272643)
+++ sw/source/core/doc/tblcpy.cxx	(revision 272644)
@@ -567,7 +567,7 @@
 
 	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++;
Index: sw/source/core/doc/docglbl.cxx
===================================================================
--- sw/source/core/doc/docglbl.cxx	(revision 272643)
+++ sw/source/core/doc/docglbl.cxx	(revision 272644)
@@ -307,7 +307,7 @@
 						pDoc->GetNodes().Delete( aIdx, 1 );
 
 					// alle Flys in dem Bereich
-					_CopyFlyInFly( aRg, aIdx );
+                    _CopyFlyInFly( aRg, 0, aIdx );
 
 
 					// und noch alle Bookmarks
Index: sw/source/core/doc/tblrwcl.cxx
===================================================================
--- sw/source/core/doc/tblrwcl.cxx	(revision 272643)
+++ sw/source/core/doc/tblrwcl.cxx	(revision 272644)
@@ -2103,7 +2103,7 @@
                             *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 );
             }
Index: sw/source/core/doc/doclay.cxx
===================================================================
--- sw/source/core/doc/doclay.cxx	(revision 272643)
+++ sw/source/core/doc/doclay.cxx	(revision 272644)
@@ -507,7 +507,7 @@
 
 		// 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 @@
 				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;
Index: sw/source/core/doc/docfmt.cxx
===================================================================
--- sw/source/core/doc/docfmt.cxx	(revision 272643)
+++ sw/source/core/doc/docfmt.cxx	(revision 272644)
@@ -2126,7 +2126,7 @@
 				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
Index: sw/source/core/undo/untblk.cxx
===================================================================
--- sw/source/core/undo/untblk.cxx	(revision 272643)
+++ sw/source/core/undo/untblk.cxx	(revision 272644)
@@ -346,7 +346,7 @@
 
 	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;
 }
Index: sw/source/core/docnode/ndcopy.cxx
===================================================================
--- sw/source/core/docnode/ndcopy.cxx	(revision 272643)
+++ sw/source/core/docnode/ndcopy.cxx	(revision 272644)
@@ -659,7 +659,7 @@
 
 // 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();
 
@@ -698,13 +698,13 @@
 	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
 	{
@@ -728,7 +728,7 @@
 		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();
@@ -803,7 +803,7 @@
 }
 
 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();
@@ -1087,7 +1087,7 @@
 			}
 		}
 
-		if( aRg.aStart != aRg.aEnd )
+		if( bCopyAll || aRg.aStart != aRg.aEnd )
 		{
 			SfxItemSet aBrkSet( pDoc->GetAttrPool(), aBreakSetRange );
             if( pSttNd && bCopyCollFmt && pDestNd->HasSwAttrSet() )
@@ -1102,13 +1102,13 @@
 			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;
 
@@ -1167,7 +1167,7 @@
 
 //  ----- 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
 {
@@ -1206,7 +1206,7 @@
 	// 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 );
@@ -1242,7 +1242,7 @@
 	}
 }
 
-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
@@ -1259,7 +1259,8 @@
 		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()) &&
@@ -1268,9 +1269,53 @@
 					: ( 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() ));
 		}
 	}
 
Index: sw/source/core/docnode/section.cxx
===================================================================
--- sw/source/core/docnode/section.cxx	(revision 272643)
+++ sw/source/core/docnode/section.cxx	(revision 272644)
@@ -1415,7 +1415,7 @@
 						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 &&
@@ -1444,7 +1444,7 @@
 
 					SwTblNumFmtMerge aTNFM( *pSrcDoc, *pDoc );
 
-					pSrcDoc->CopyWithFlyInFly( *pCpyRg, rInsPos, bCreateFrm );
+                    pSrcDoc->CopyWithFlyInFly( *pCpyRg, 0, rInsPos, bCreateFrm );
 					aSave++;
 
 					if( !bCreateFrm )
Index: sw/source/ui/dbui/dbmgr.cxx
===================================================================
--- sw/source/ui/dbui/dbmgr.cxx	(revision 272643)
+++ sw/source/ui/dbui/dbmgr.cxx	(revision 272644)
@@ -35,7 +35,9 @@
 #endif
 
 #include <stdio.h>
-
+#ifdef SW_COPY_DOC_IN_MEMORY
+#include <unotxdoc.hxx>
+#endif
 #include <com/sun/star/text/NotePrintMode.hpp>
 #include <sfx2/app.hxx>
 #include <com/sun/star/sdb/CommandType.hpp>
@@ -43,17 +45,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 +63,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 +82,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>
@@ -3182,7 +3164,10 @@
 
     SwWrtShell& rSourceShell = rSourceView.GetWrtShell();
     BOOL bSynchronizedDoc = rSourceShell.IsLabelDoc() && rSourceShell.GetSectionFmtCount() > 1;
+#ifdef SW_COPY_DOC_IN_MEMORY
+#else
     String sSourceDocURL;
+#endif
     //save the settings of the first
     rSourceShell.SttEndDoc(TRUE);
     USHORT nStartingPageNo = rSourceShell.GetVirtPageNum();
@@ -3192,6 +3177,8 @@
 
     try
     {
+#ifdef SW_COPY_DOC_IN_MEMORY
+#else
         // save the working document into a temporary location
         sSourceDocURL = URIHelper::SmartRel2Abs(
             INetURLObject(), utl::TempFile::CreateTempName(),
@@ -3207,7 +3194,7 @@
         pValues[0].Value <<= ::rtl::OUString(pSfxFlt->GetFilterName());
         uno::Reference< frame::XStorable > xStore( rSourceView.GetDocShell()->GetModel(), uno::UNO_QUERY);
         xStore->storeToURL( sSourceDocURL, aValues );
-
+#endif
         // create a target docshell to put the merged document into
         SfxObjectShellRef xTargetDocShell( new SwDocShell( SFX_CREATE_MODE_STANDARD ) );
         xTargetDocShell->DoInitNew( 0 );
@@ -3256,6 +3243,15 @@
                     Application::Reschedule();
             }
 
+#ifdef SW_COPY_DOC_IN_MEMORY
+            // copy the source document
+            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()));
+            //create a ViewFrame
+            SfxObjectShellRef xWorkDocSh = pWorkModel->GetDocShell();
+            SwView* pWorkView = static_cast< SwView* >( SfxViewFrame::CreateViewFrame( *xWorkDocSh, 0, sal_True )->GetViewShell() );
+#else
             // create a new docshell from the temporary document
             SfxBoolItem aHidden( SID_HIDDEN, TRUE );
             SfxStringItem aReferer( SID_REFERER, String::CreateFromAscii(URL_PREFIX_PRIV_SOFFICE ));
@@ -3265,9 +3261,13 @@
                             rSourceView.GetViewFrame()->GetDispatcher()->Execute( SID_OPENDOC, SFX_CALLMODE_SYNCHRON,
                                     &aURL, &aFilterName, &aHidden, &aReferer, &aTarget, 0L);
             if(pReturnValue)
+#endif
             {
+#ifdef SW_COPY_DOC_IN_MEMORY
+#else                
                 SfxViewFrameItem* pVItem = (SfxViewFrameItem*)pReturnValue;
                 SwView* pWorkView = (SwView*) pVItem->GetFrame()->GetViewShell();
+#endif
                 SwWrtShell& rWorkShell = pWorkView->GetWrtShell();
                 pWorkView->AttrChangedNotify( &rWorkShell );//Damit SelectShell gerufen wird.
 
@@ -3387,8 +3387,11 @@
     {
         DBG_ERROR("exception caught in SwNewDBMgr::MergeDocuments");
     }
+#ifdef SW_COPY_DOC_IN_MEMORY
+#else
     if(sSourceDocURL.Len())
         File::remove( sSourceDocURL );
+#endif
     DELETEZ(pImpl->pMergeData);
     bInMerge = FALSE;
     return nRet;
Index: sw/source/ui/uno/unoatxt.cxx
===================================================================
--- sw/source/ui/uno/unoatxt.cxx	(revision 272643)
+++ sw/source/ui/uno/unoatxt.cxx	(revision 272644)
@@ -417,7 +417,7 @@
 		if(pxCursor)
 		{
 			SwPaM* pUnoCrsr = pxCursor->GetPaM();
-            bRet |= (true == pxCursor->GetDoc()->Copy( *pUnoCrsr, aPos ));
+            bRet |= (true == pxCursor->GetDoc()->Copy( *pUnoCrsr, aPos, false ));
 		}
 		else
 		{
@@ -425,7 +425,7 @@
             if(pBkm && pBkm->GetOtherBookmarkPos())
 			{
                 SwPaM aTmp(*pBkm->GetOtherBookmarkPos(), pBkm->GetBookmarkPos());
-                bRet |= (true == pxRange->GetDoc()->Copy(aTmp, aPos));
+                bRet |= (true == pxRange->GetDoc()->Copy(aTmp, aPos, false));
 			}
 		}
 	}
Index: sw/source/ui/uno/unotxdoc.cxx
===================================================================
--- sw/source/ui/uno/unotxdoc.cxx	(revision 272643)
+++ sw/source/ui/uno/unotxdoc.cxx	(revision 272644)
@@ -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>
@@ -2856,7 +2846,27 @@
 {
     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--------------------------------
 
  ---------------------------------------------------------------------------*/
Index: sw/inc/doc.hxx
===================================================================
--- sw/inc/doc.hxx	(revision 272643)
+++ sw/inc/doc.hxx	(revision 272644)
@@ -636,7 +636,7 @@
 		// 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,
@@ -648,7 +648,8 @@
 								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 );
 
@@ -720,6 +721,7 @@
      SwFmt *_MakeFrmFmt(const String &, SwFmt *, BOOL, BOOL );
      SwFmt *_MakeTxtFmtColl(const String &, SwFmt *, BOOL, BOOL );
 
+     void   Paste( const SwDoc& );
 public:
 
     /** Life cycle
@@ -915,7 +917,7 @@
 
     /** 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&);
@@ -1118,6 +1120,7 @@
 								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,
@@ -2117,6 +2120,7 @@
 	{
 		return n32DummyCompatabilityOptions2;
 	}
+    SwDoc* CreateCopy() const;
 };
 
 
Index: sw/inc/unotxdoc.hxx
===================================================================
--- sw/inc/unotxdoc.hxx	(revision 272643)
+++ sw/inc/unotxdoc.hxx	(revision 272644)
@@ -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 @@
     __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 @@
  ******************************************************************************/
 
 
-typedef cppu::WeakImplHelper31
+typedef cppu::WeakImplHelper32
 <
 	::com::sun::star::text::XTextDocument,
 	::com::sun::star::text::XLineNumberingProperties,
@@ -164,7 +163,8 @@
     ::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,7 +402,11 @@
     // ::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);
 	SwXDocumentPropertyHelper * GetPropertyHelper ();
Index: sw/inc/IDocumentContentOperations.hxx
===================================================================
--- sw/inc/IDocumentContentOperations.hxx	(revision 272643)
+++ sw/inc/IDocumentContentOperations.hxx	(revision 272644)
@@ -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.
     */


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/extras/rpms/openoffice.org/F-10/openoffice.org.spec,v
retrieving revision 1.1736
retrieving revision 1.1737
diff -u -p -r1.1736 -r1.1737
--- openoffice.org.spec	21 Aug 2009 05:08:22 -0000	1.1736
+++ openoffice.org.spec	21 Aug 2009 05:10:23 -0000	1.1737
@@ -3808,6 +3808,7 @@ fi
 - Resolves: rhbz#506039 workspace.pdfextfix02.patch upsidedown images in pdf import
 - Resolves: rhbz#514683 add openoffice.org-3.1.1.ooo104329.dbaccess.primarykeys.patch
 - make the last three patches applicable
+- Resolves: rbhz#501141 Images and Frames disappear in sequential printing
 
 * Fri May 01 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.0.1-15.4
 - Resolves: rhbz#494643 EMF polypolygons issue




More information about the fedora-extras-commits mailing list