diff options
Diffstat (limited to 'sw')
-rw-r--r-- | sw/CppunitTest_sw_globalfilter.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_odfexport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_odfimport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_ooxmlfieldexport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_ooxmlimport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_ooxmlw14export.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_rtfexport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_rtfimport.mk | 1 | ||||
-rw-r--r-- | sw/CppunitTest_sw_ww8import.mk | 1 | ||||
-rw-r--r-- | sw/inc/dbmgr.hxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/dbui/dbmgr.cxx | 109 |
11 files changed, 57 insertions, 68 deletions
diff --git a/sw/CppunitTest_sw_globalfilter.mk b/sw/CppunitTest_sw_globalfilter.mk index a74cb66abf0d..66502663862c 100644 --- a/sw/CppunitTest_sw_globalfilter.mk +++ b/sw/CppunitTest_sw_globalfilter.mk @@ -39,7 +39,6 @@ $(eval $(call gb_CppunitTest_set_include,sw_globalfilter,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/qa/extras/inc \ - -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/CppunitTest_sw_odfexport.mk b/sw/CppunitTest_sw_odfexport.mk index aa5a40ada328..c6434ac1574e 100644 --- a/sw/CppunitTest_sw_odfexport.mk +++ b/sw/CppunitTest_sw_odfexport.mk @@ -38,7 +38,6 @@ $(eval $(call gb_CppunitTest_set_include,sw_odfexport,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/qa/extras/inc \ - -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/CppunitTest_sw_odfimport.mk b/sw/CppunitTest_sw_odfimport.mk index c5937d3f2ef5..eaa3542993d4 100644 --- a/sw/CppunitTest_sw_odfimport.mk +++ b/sw/CppunitTest_sw_odfimport.mk @@ -40,7 +40,6 @@ $(eval $(call gb_CppunitTest_set_include,sw_odfimport,\ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/source/uibase/inc \ -I$(SRCDIR)/sw/qa/extras/inc \ - -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/CppunitTest_sw_ooxmlfieldexport.mk b/sw/CppunitTest_sw_ooxmlfieldexport.mk index 086e53ea115e..ae67c2087438 100644 --- a/sw/CppunitTest_sw_ooxmlfieldexport.mk +++ b/sw/CppunitTest_sw_ooxmlfieldexport.mk @@ -30,7 +30,6 @@ $(eval $(call gb_CppunitTest_set_include,sw_ooxmlfieldexport,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/qa/extras/inc \ - -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/CppunitTest_sw_ooxmlimport.mk b/sw/CppunitTest_sw_ooxmlimport.mk index 1a275bfcfbab..4074255a7cf3 100644 --- a/sw/CppunitTest_sw_ooxmlimport.mk +++ b/sw/CppunitTest_sw_ooxmlimport.mk @@ -39,7 +39,6 @@ $(eval $(call gb_CppunitTest_set_include,sw_ooxmlimport,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/qa/extras/inc \ - -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/CppunitTest_sw_ooxmlw14export.mk b/sw/CppunitTest_sw_ooxmlw14export.mk index d6bcd07be9ee..5958019b8820 100644 --- a/sw/CppunitTest_sw_ooxmlw14export.mk +++ b/sw/CppunitTest_sw_ooxmlw14export.mk @@ -30,7 +30,6 @@ $(eval $(call gb_CppunitTest_set_include,sw_ooxmlw14export,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/qa/extras/inc \ - -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/CppunitTest_sw_rtfexport.mk b/sw/CppunitTest_sw_rtfexport.mk index 0228ee00112b..b47c9068a705 100644 --- a/sw/CppunitTest_sw_rtfexport.mk +++ b/sw/CppunitTest_sw_rtfexport.mk @@ -37,7 +37,6 @@ $(eval $(call gb_CppunitTest_set_include,sw_rtfexport,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/qa/extras/inc \ - -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/CppunitTest_sw_rtfimport.mk b/sw/CppunitTest_sw_rtfimport.mk index 9cfa5b4aea25..3eafcea38e58 100644 --- a/sw/CppunitTest_sw_rtfimport.mk +++ b/sw/CppunitTest_sw_rtfimport.mk @@ -39,7 +39,6 @@ $(eval $(call gb_CppunitTest_set_include,sw_rtfimport,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/qa/extras/inc \ - -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/CppunitTest_sw_ww8import.mk b/sw/CppunitTest_sw_ww8import.mk index 80cde283bcc2..ed28ae9d641c 100644 --- a/sw/CppunitTest_sw_ww8import.mk +++ b/sw/CppunitTest_sw_ww8import.mk @@ -36,7 +36,6 @@ $(eval $(call gb_CppunitTest_set_include,sw_ww8import,\ -I$(SRCDIR)/sw/inc \ -I$(SRCDIR)/sw/source/core/inc \ -I$(SRCDIR)/sw/qa/extras/inc \ - -I$(SRCDIR)/sw/source/uibase/inc \ $$(INCLUDE) \ )) diff --git a/sw/inc/dbmgr.hxx b/sw/inc/dbmgr.hxx index fb4ec0def8ba..5218faf4231d 100644 --- a/sw/inc/dbmgr.hxx +++ b/sw/inc/dbmgr.hxx @@ -34,7 +34,6 @@ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <unotools/tempfile.hxx> #include <sfx2/objsh.hxx> -#include <dbui.hxx> #include <memory> #include <vector> @@ -257,9 +256,6 @@ friend class SwConnectionDisposedListener_Impl; std::unique_ptr< utl::TempFile > &aTempFile, const SwMergeDescriptor& rMergeDescriptor, const SfxFilter* pStoreToFilter); - SAL_DLLPRIVATE void UpdateProgressDlg(bool bMergeShell, VclPtr<CancelableDialog> pProgressDlg, bool createTempFile, - std::unique_ptr< INetURLObject > &aTempFileURL, - SwDocShell *pSourceDocSh, sal_Int32 nDocNo); SAL_DLLPRIVATE bool CreateTargetDocShell(sal_Int32 nMaxDumpDocs, bool bMergeShell, vcl::Window *pSourceWindow, SwWrtShell *pSourceShell, SwDocShell *pSourceDocSh, @@ -269,9 +265,6 @@ friend class SwConnectionDisposedListener_Impl; SAL_DLLPRIVATE void LockUnlockDisp(bool bLock, SwDocShell *pSourceDocSh); - SAL_DLLPRIVATE void CreateProgessDlg(vcl::Window *&pSourceWindow, VclPtr<CancelableDialog> &pProgressDlg, - bool bMergeShell, SwWrtShell *pSourceShell, vcl::Window *pParent); - SAL_DLLPRIVATE void CreateWorkDoc(SfxObjectShellLock &xWorkDocSh, SwView *&pWorkView, SwDoc *&pWorkDoc, SwDBManager *&pOldDBManager, SwDocShell *pSourceDocSh, sal_Int32 nMaxDumpDocs, sal_Int32 nDocNo); diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index ab1544c53e32..395b3d3bf270 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -80,6 +80,7 @@ #include <IDocumentFieldsAccess.hxx> #include <swwait.hxx> #include <swunohelper.hxx> +#include <dbui.hxx> #include <dbui.hrc> #include <globals.hrc> #include <statstr.hrc> @@ -892,6 +893,52 @@ static void lcl_SaveDoc( SfxObjectShell *xTargetDocShell, delete pDstMed; } +static void lcl_CreateProgessDlg(Link<Button*, void> const& rPrtCancelHdl, + vcl::Window *&pSourceWindow, VclPtr<CancelableDialog> &pProgressDlg, + bool bMergeShell, SwWrtShell *pSourceShell, vcl::Window *pParent) +{ + pSourceWindow = &pSourceShell->GetView().GetEditWin(); + if (!pParent) + pParent = pSourceWindow; + if (bMergeShell) + pProgressDlg = VclPtr<CreateMonitor>::Create(pParent, pParent != pSourceWindow); + else + { + pProgressDlg = VclPtr<PrintMonitor>::Create(pParent, pParent != pSourceWindow, PrintMonitor::MONITOR_TYPE_PRINT); + static_cast<PrintMonitor*>( pProgressDlg.get() )->SetText(pSourceShell->GetView().GetDocShell()->GetTitle(22)); + } + pProgressDlg->SetCancelHdl(rPrtCancelHdl); + pProgressDlg->Show(); + + for (sal_uInt16 i = 0; i < 25; ++i) + Application::Reschedule(); +} + +static void lcl_UpdateProgressDlg( + bool bMergeShell, VclPtr<CancelableDialog> pProgressDlg, + bool createTempFile, std::unique_ptr<INetURLObject> & pTempFileURL, + SwDocShell *pSourceDocSh, sal_Int32 nDocNo) +{ + if (bMergeShell) + static_cast<CreateMonitor*>( pProgressDlg.get() )->SetCurrentPosition( nDocNo ); + else + { + PrintMonitor *pPrintMonDlg = static_cast<PrintMonitor*>(pProgressDlg.get()); + pPrintMonDlg->m_pPrinter->SetText(createTempFile ? pTempFileURL->GetBase() : OUString(pSourceDocSh->GetTitle(22))); + OUString sStat(SW_RES(STR_STATSTR_LETTER)); + sStat += " "; + sStat += OUString::number( nDocNo ); + pPrintMonDlg->m_pPrintInfo->SetText( sStat ); + } + + pProgressDlg->Update(); + + // Computation time for the GUI + for (sal_uInt16 i = 0; i < 25; ++i) + Application::Reschedule(); +} + + bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, const SwMergeDescriptor& rMergeDescriptor, vcl::Window* pParent) @@ -995,7 +1042,11 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, vcl::Window *pSourceWindow = nullptr; VclPtr<CancelableDialog> pProgressDlg; - CreateProgessDlg(pSourceWindow, pProgressDlg, bMergeShell, pSourceShell, pParent); + if (!IsMergeSilent()) + { + lcl_CreateProgessDlg(LINK(this, SwDBManager, PrtCancelHdl), + pSourceWindow, pProgressDlg, bMergeShell, pSourceShell, pParent); + } if(bCreateSingleFile) { @@ -1055,8 +1106,11 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, if( createTempFile ) aTempFileURL.reset( new INetURLObject(aTempFile->GetURL())); - UpdateProgressDlg(bMergeShell, pProgressDlg, createTempFile, aTempFileURL, pSourceDocSh, nDocNo); - + if (!IsMergeSilent()) + { + lcl_UpdateProgressDlg(bMergeShell, pProgressDlg, + createTempFile, aTempFileURL, pSourceDocSh, nDocNo); + } // Create a copy of the source document and work with that one instead of the source. // If we're not in the single file mode (which requires modifying the document for the merging), @@ -1330,32 +1384,6 @@ bool SwDBManager::CreateNewTemp(OUString &sPath, const OUString &sAddress, return bErr; } -void SwDBManager::UpdateProgressDlg(bool bMergeShell, VclPtr<CancelableDialog> pProgressDlg, bool createTempFile, - std::unique_ptr< INetURLObject > &aTempFileURL, - SwDocShell *pSourceDocSh, sal_Int32 nDocNo) -{ - if (!IsMergeSilent()) - { - if( bMergeShell ) - static_cast<CreateMonitor*>( pProgressDlg.get() )->SetCurrentPosition( nDocNo ); - else - { - PrintMonitor *pPrintMonDlg = static_cast<PrintMonitor*>( pProgressDlg.get() ); - pPrintMonDlg->m_pPrinter->SetText( createTempFile ? aTempFileURL->GetBase() : OUString( pSourceDocSh->GetTitle( 22 ))); - OUString sStat(SW_RES(STR_STATSTR_LETTER)); // Brief - sStat += " "; - sStat += OUString::number( nDocNo ); - pPrintMonDlg->m_pPrintInfo->SetText( sStat ); - } - - pProgressDlg->Update(); - - // Computation time for the GUI - for( sal_uInt16 i = 0; i < 25; i++ ) - Application::Reschedule(); - } -} - bool SwDBManager::CreateTargetDocShell(sal_Int32 nMaxDumpDocs, bool bMergeShell, vcl::Window *pSourceWindow, SwWrtShell *pSourceShell, SwDocShell *pSourceDocSh, SfxObjectShellRef &xTargetDocShell, SwDoc *&pTargetDoc, @@ -1418,29 +1446,6 @@ void SwDBManager::LockUnlockDisp(bool bLock, SwDocShell *pSourceDocSh) } } -void SwDBManager::CreateProgessDlg(vcl::Window *&pSourceWindow, VclPtr<CancelableDialog> &pProgressDlg, bool bMergeShell, - SwWrtShell *pSourceShell, vcl::Window *pParent) -{ - if (!IsMergeSilent()) - { - pSourceWindow = &pSourceShell->GetView().GetEditWin(); - if( ! pParent ) - pParent = pSourceWindow; - if( bMergeShell ) - pProgressDlg = VclPtr<CreateMonitor>::Create( pParent, pParent != pSourceWindow ); - else - { - pProgressDlg = VclPtr<PrintMonitor>::Create( pParent, pParent != pSourceWindow, PrintMonitor::MONITOR_TYPE_PRINT ); - static_cast<PrintMonitor*>( pProgressDlg.get() )->SetText(pSourceShell->GetView().GetDocShell()->GetTitle(22)); - } - pProgressDlg->SetCancelHdl( LINK(this, SwDBManager, PrtCancelHdl) ); - pProgressDlg->Show(); - - for( sal_uInt16 i = 0; i < 25; i++) - Application::Reschedule(); - } -} - void SwDBManager::CreateWorkDoc(SfxObjectShellLock &xWorkDocSh, SwView *&pWorkView, SwDoc *&pWorkDoc, SwDBManager *&pOldDBManager, SwDocShell *pSourceDocSh, sal_Int32 nMaxDumpDocs, sal_Int32 nDocNo) { |