ooo-build r14198 - in trunk: . patches/dev300



Author: mloiseleur
Date: Fri Oct  3 12:33:18 2008
New Revision: 14198
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14198&view=rev

Log:
2008-10-03 Michel Loiseleur  <mloiseleur linagora com>

        * patches/dev300/apply:
        * sw-remove-csv-lock.patch: Fix annoying lock after a mail merge
        operation
        * sw-mailmerge-faster.patch: 7 times faster

Added:
   trunk/patches/dev300/sw-mailmerge-faster.patch
   trunk/patches/dev300/sw-remove-csv-lock.patch
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Fri Oct  3 12:33:18 2008
@@ -619,6 +619,10 @@
 [ WriterFixes ]
 # Allows to copy/paste html text which is between 2 unknown tags.
 sw-html-insert-unknown-tags.diff, i#59064, mloiseleur
+# Allows to edit a csv data source after a mail merge
+sw-remove-csv-lock.patch, i#85133, mloiseleur
+# Provides a great speed-up for a mail merge operation : 7x faster
+sw-mailmerge-faster.patch, i#40287, mloiseleur
 
 
 [ CalcFixes ]
@@ -721,9 +725,9 @@
 # load, store and save the sheet protection options from and to an Excel file,
 # and use that information to constrain cell cursor movement when the sheet is
 # protected.  Also to support encryption on Excel file export.
-cws-scsheetprotection02-sc.diff,   i#60305, i#71468, i#84766, kohei  
-cws-scsheetprotection02-sfx2.diff, i#60305, i#71468, i#84766, kohei  
-cws-scsheetprotection02-svx.diff,  i#60305, i#71468, i#84766, kohei   
+cws-scsheetprotection02-sc.diff,   i#60305, i#71468, i#84766, kohei
+cws-scsheetprotection02-sfx2.diff, i#60305, i#71468, i#84766, kohei
+cws-scsheetprotection02-svx.diff,  i#60305, i#71468, i#84766, kohei
 
 # Ensure that Print Preview is consistent with Print output.
 sc-print-selected-sheets.diff, n#335684, i#45497, jonp
@@ -794,7 +798,7 @@
 # fixed change track export to xls files wrt cell change records.
 calc-change-track-xls-export-fix.diff, n#416045, i#93839, kohei
 
-# correctly evaluate the visibility of dimension members when generating a 
+# correctly evaluate the visibility of dimension members when generating a
 # drill-down sheet & also reduce memory use on cache tables.
 calc-dp-drilldown-hidden-items.diff i#93918, i#93998, kohei
 
@@ -1322,7 +1326,7 @@
 # enable vcl to load bitmaps when height it negative
 vcl-bitmap2-negative-height.diff
 
-# Make sure that the colors between selected and unselected tabs can be 
+# Make sure that the colors between selected and unselected tabs can be
 # distinguished by using appropriate theme colors.
 native-theme-tab-colors-svtools.diff, n#396386, i#94452, kohei
 native-theme-tab-colors-vcl.diff, n#396386, i#94452, kohei
@@ -1559,7 +1563,7 @@
 # leave here for a while 'till we are sure all is ok
 #vba-keep-codenames-in-sync.diff
 
-# always get non-filtered range selection when querying for current selection 
+# always get non-filtered range selection when querying for current selection
 # address.
 vba-get-nonfiltered-range-selection.diff, n#415002, kohei
 
@@ -1614,11 +1618,11 @@
 #make properties available for non class modules
 #also allow paramaters to be supported for Get properties
 vba-support-properties-inmodules.diff
-controls-with-images-in-document.diff, i#38215, noelpwer 
+controls-with-images-in-document.diff, i#38215, noelpwer
 # import graphic for image control
 controls-with-images-import.diff, Fong
 #use of form control models in userforms/dialogs, additionally
-#enables use of document embedded images in image control for 
+#enables use of document embedded images in image control for
 #userforms/dialogs ( note: depends on controls-with-images-in-document.diff )
 enhanced-form-userform-controls.diff, noelpwer
 # object module support... getting there
@@ -1647,7 +1651,7 @@
 # Add Worksheet.EnableSelection ( depends on cws-scsheetprotection02-sc.diff )
 vba-worksheet-enableselection.diff, n#405312, Fong
 
-# keywords (including NAME, LINE, TEXT) can be used as variable 
+# keywords (including NAME, LINE, TEXT) can be used as variable
 vba-keyword-fix.diff, n#403586, Fong
 
 #some userform import issues including improved identification
@@ -1677,7 +1681,7 @@
 vba-variant-fix.diff, Fong
 # fix for variant get/set properties
 variant-property.diff, i#93214
-# fix for image import for userform 
+# fix for image import for userform
 userform-image-import-fix.diff
 # spinbutton change wasn't imported correctly
 spinbutton-import-valuechange.diff
@@ -1796,11 +1800,11 @@
 
 scsolver-config-option.diff
 scsolver-config-set-soenv.diff
-scsolver-lpsolve.diff      
-scsolver-sc-build-lst.diff 
+scsolver-lpsolve.diff
+scsolver-sc-build-lst.diff
 scsolver-sc-remove-menu.diff
-scsolver-scp2.diff         
-scsolver-setup_native.diff 
+scsolver-scp2.diff
+scsolver-setup_native.diff
 
 #[ OOXSTLport5 ]
 #
@@ -1896,7 +1900,7 @@
 buildfix-openjdk-6-no-rhino.diff
 
 [ UbuntuOnly ]
-human-icons-add.diff, mklose
+# human-icons-add.diff, mklose
 
 [ UbuntuL10nOnly ]
 human-icons-i18n.diff, mklose
@@ -2701,4 +2705,3 @@
 # depend on it.
 
 unused-methods-removal-sc.diff, i#85185, kohei
-

Added: trunk/patches/dev300/sw-mailmerge-faster.patch
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/sw-mailmerge-faster.patch	Fri Oct  3 12:33:18 2008
@@ -0,0 +1,160 @@
+diff --git a/sw/source/ui/dbui/dbmgr.cxx b/sw/source/ui/dbui/dbmgr.cxx
+index 34ad7f2..6e0c1c2 100644
+--- a/sw/source/ui/dbui/dbmgr.cxx
++++ b/sw/source/ui/dbui/dbmgr.cxx
+@@ -3127,27 +3127,28 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
+     pImpl->pMergeData = new SwDSParam(
+                 rMMConfig.GetCurrentDBData(), xResultSet, rMMConfig.GetSelection());
+ 
++    SwDSParam* pMergeData = pImpl->pMergeData;
+     try{
+         //set to start position
+-        if(pImpl->pMergeData->aSelection.getLength())
++        if(pMergeData->aSelection.getLength())
+         {
+             sal_Int32 nPos = 0;
+-            pImpl->pMergeData->aSelection.getConstArray()[ pImpl->pMergeData->nSelectionIndex++ ] >>= nPos;
+-            pImpl->pMergeData->bEndOfDB = !pImpl->pMergeData->xResultSet->absolute( nPos );
+-            pImpl->pMergeData->CheckEndOfDB();
+-            if(pImpl->pMergeData->nSelectionIndex >= pImpl->pMergeData->aSelection.getLength())
+-                pImpl->pMergeData->bEndOfDB = TRUE;
++            pMergeData->aSelection.getConstArray()[ pMergeData->nSelectionIndex++ ] >>= nPos;
++            pMergeData->bEndOfDB = !pMergeData->xResultSet->absolute( nPos );
++            pMergeData->CheckEndOfDB();
++            if(pMergeData->nSelectionIndex >= pMergeData->aSelection.getLength())
++                pMergeData->bEndOfDB = TRUE;
+         }
+         else
+         {
+-            pImpl->pMergeData->bEndOfDB = !pImpl->pMergeData->xResultSet->first();
+-            pImpl->pMergeData->CheckEndOfDB();
++            pMergeData->bEndOfDB = !pMergeData->xResultSet->first();
++            pMergeData->CheckEndOfDB();
+         }
+     }
+     catch(Exception&)
+     {
+-        pImpl->pMergeData->bEndOfDB = TRUE;
+-        pImpl->pMergeData->CheckEndOfDB();
++        pMergeData->bEndOfDB = TRUE;
++        pMergeData->CheckEndOfDB();
+         DBG_ERROR("exception in MergeNew()")
+     }
+ 
+@@ -3226,44 +3227,41 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
+         long nStartRow, nEndRow;
+         ULONG nDocNo = 1;
+         sal_Int32 nDocCount = 0;
+-        if( !IsMergeSilent() && lcl_getCountFromResultSet( nDocCount, pImpl->pMergeData->xResultSet ) )
++        if( !IsMergeSilent() && lcl_getCountFromResultSet( nDocCount, pMergeData->xResultSet ) )
+             aMonitorDlg.SetTotalCount( nDocCount );
+ 
+-        do
++        // 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)
+         {
+-            nStartRow = pImpl->pMergeData->xResultSet->getRow();
+-            if (!IsMergeSilent())
++            SfxViewFrameItem* pVItem = (SfxViewFrameItem*)pReturnValue;
++            SwView* pWorkView = (SwView*) pVItem->GetFrame()->GetViewShell();
++            SwWrtShell& rWorkShell = pWorkView->GetWrtShell();
++            pWorkView->AttrChangedNotify( &rWorkShell );//Damit SelectShell gerufen wird.
++
++            // prepare workind document
++            SwDoc* pWorkDoc = rWorkShell.GetDoc();
++            SwNewDBMgr* pWorkDBMgr = pWorkDoc->GetNewDBMgr();
++            pWorkDoc->SetNewDBMgr( this );
++            pWorkDoc->EmbedAllLinks();
++            if(UNDO_UI_DELETE_INVISIBLECNTNT == rWorkShell.GetUndoIds())
++                rWorkShell.Undo();
++            do
+             {
+-                aMonitorDlg.SetCurrentPosition( nDocNo );
+-                aMonitorDlg.Invalidate();
+-                aMonitorDlg.Update();
+-                // the print monitor needs some time to act
+-                for( USHORT i = 0; i < 25; i++)
+-                    Application::Reschedule();
+-            }
++                nStartRow = pMergeData->xResultSet->getRow();
++                if (!IsMergeSilent())
++                {
++                    aMonitorDlg.SetCurrentPosition( nDocNo );
++                    aMonitorDlg.Update();
++                }
+ 
+-            // 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)
+-            {
+-                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()));
+@@ -3342,21 +3340,28 @@ sal_Int32 SwNewDBMgr::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
+                 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 &&
++                // Undo everything on current workshell allows to loop for a
++                // merge action within the same document. It saves _loads_
++                // of times : 7 times faster than the previous way.
++                // see i40827 for more information
++                const SwNodes *pUndoNds = pWorkDoc->GetUndoNds();
++                if (pUndoNds)
++                {
++                    for( USHORT j = 0; j < pUndoNds->Count(); j++)
++                        rWorkShell.Undo();
++                }
++                nEndRow = pMergeData->xResultSet->getRow();
++                ++nDocNo;
++            } while( !bCancel &&
+                 (bSynchronizedDoc && (nStartRow != nEndRow)? ExistsNextRecord() : ToNextMergeRecord()));
+ 
++            //restore the ole DBMgr
++            pWorkDoc->SetNewDBMgr( pWorkDBMgr );
++
++            //now the temporary document should be closed
++            SfxObjectShellRef xDocSh(pWorkView->GetDocShell());
++            xDocSh->DoClose();
++        }
+         //deselect all, go out of the frame and go to the beginning of the document
+         Point aPt(LONG_MIN, LONG_MIN);
+         pTargetShell->SelectObj(aPt, SW_LEAVE_FRAME);

Added: trunk/patches/dev300/sw-remove-csv-lock.patch
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/sw-remove-csv-lock.patch	Fri Oct  3 12:33:18 2008
@@ -0,0 +1,14 @@
+diff --git a/sw/source/core/fields/dbfld.cxx b/sw/source/core/fields/dbfld.cxx
+index f403d1a..8bb23ec 100644
+--- a/sw/source/core/fields/dbfld.cxx
++++ b/sw/source/core/fields/dbfld.cxx
+@@ -351,9 +351,6 @@ void SwDBField::Evaluate()
+ 
+ 	SvNumberFormatter* pDocFormatter = GetDoc()->GetNumberFormatter();
+ 	pMgr->GetMergeColumnCnt(aColNm, GetLanguage(), aContent, &nValue, &nFmt);
+-	if( !( nSubType & nsSwExtendedSubType::SUB_OWN_FMT ) )
+-		SetFormat( nFmt = pMgr->GetColumnFmt( aTmpData.sDataSource, aTmpData.sCommand,
+-										aColNm, pDocFormatter, GetLanguage() ));
+ 
+ 	if( DBL_MAX != nValue )
+ 	{



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]