summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-12-11 12:19:44 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-12-11 15:07:44 -0500
commit3e2dff3a18e52c153b3bebd2fa0f4aee7f3f671b (patch)
tree579590b097d9724e82e008130edeafcd54a45a3d
parentdd8c33799ecc243f7c3626e8d146e9dbd78b3e09 (diff)
Let's use a status indicator while exporting to xlsx.
And reduce header dependency on docsh.hxx which a lot of files include directly or indirectly... Change-Id: I2de25380f8b634456e0add940fbb775ac11414cd (cherry picked from commit da1392934e043bfd12b94dab7b874ddf940f097b)
-rw-r--r--sc/inc/refreshtimerprotector.hxx3
-rw-r--r--sc/source/filter/excel/xestream.cxx14
-rw-r--r--sc/source/ui/docshell/docsh.cxx3
-rw-r--r--sc/source/ui/inc/docsh.hxx5
4 files changed, 21 insertions, 4 deletions
diff --git a/sc/inc/refreshtimerprotector.hxx b/sc/inc/refreshtimerprotector.hxx
index d2169cdc090d..679586d22d46 100644
--- a/sc/inc/refreshtimerprotector.hxx
+++ b/sc/inc/refreshtimerprotector.hxx
@@ -11,10 +11,11 @@
#define SC_REFRESHTIMERPROTECTOR_HXX
#include <sal/config.h>
+#include "scdllapi.h"
class ScRefreshTimerControl;
-class ScRefreshTimerProtector
+class SC_DLLPUBLIC ScRefreshTimerProtector
{
ScRefreshTimerControl * const * ppControl;
diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx
index 2232f2cc1ef3..af7aa7846fc3 100644
--- a/sc/source/filter/excel/xestream.cxx
+++ b/sc/source/filter/excel/xestream.cxx
@@ -39,6 +39,8 @@
#include "compiler.hxx"
#include "formulacell.hxx"
#include "tokenarray.hxx"
+#include "refreshtimerprotector.hxx"
+#include "globstr.hrc"
#include <../../ui/inc/docsh.hxx>
#include <../../ui/inc/viewdata.hxx>
@@ -53,6 +55,8 @@
#include <sfx2/objsh.hxx>
#include <sfx2/app.hxx>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+
#define DEBUG_XL_ENCRYPTION 0
using ::com::sun::star::embed::XStorage;
@@ -64,6 +68,7 @@ using ::com::sun::star::uno::XInterface;
using ::utl::OStreamWrapper;
using ::std::vector;
+using namespace com::sun::star;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::lang;
@@ -1089,6 +1094,12 @@ bool XclExpXmlStream::exportDocument() throw()
{
ScDocShell* pShell = getDocShell();
ScDocument* pDoc = pShell->GetDocument();
+ ScRefreshTimerProtector aProt(pDoc->GetRefreshTimerControlAddress());
+
+ uno::Reference<task::XStatusIndicator> xStatusIndicator = getStatusIndicator();
+
+ xStatusIndicator->start(ScGlobal::GetRscString(STR_SAVE_DOC), 100);
+
// NOTE: Don't use SotStorage or SvStream any more, and never call
// SfxMedium::GetOutStream() anywhere in the xlsx export filter code!
// Instead, write via XOutputStream instance.
@@ -1120,10 +1131,13 @@ bool XclExpXmlStream::exportDocument() throw()
// destruct at the end of the block
{
ExcDocument aDocRoot( aRoot );
+ xStatusIndicator->setValue(10);
aDocRoot.ReadDoc();
+ xStatusIndicator->setValue(40);
aDocRoot.WriteXml( *this );
}
+ xStatusIndicator->end();
mpRoot = NULL;
return true;
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 0760425ab6b0..1904f1b03d5b 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -108,6 +108,7 @@
#include "docshimp.hxx"
#include "sizedev.hxx"
+#include "refreshtimerprotector.hxx"
#include <officecfg/Office/Calc.hxx>
#include <comphelper/processfactory.hxx>
@@ -3024,7 +3025,7 @@ void ScDocShell::UseSheetSaveEntries()
ScDocShellModificator::ScDocShellModificator( ScDocShell& rDS )
:
rDocShell( rDS ),
- aProtector( rDS.GetDocument()->GetRefreshTimerControlAddress() )
+ mpProtector(new ScRefreshTimerProtector(rDS.GetDocument()->GetRefreshTimerControlAddress()))
{
ScDocument* pDoc = rDocShell.GetDocument();
bAutoCalcShellDisabled = pDoc->IsAutoCalcShellDisabled();
diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx
index 818a63f502f6..7e103902fb1f 100644
--- a/sc/source/ui/inc/docsh.hxx
+++ b/sc/source/ui/inc/docsh.hxx
@@ -33,15 +33,16 @@
#include "appoptio.hxx"
#include "formulaopt.hxx"
#include "shellids.hxx"
-#include "refreshtimerprotector.hxx"
#include "optutil.hxx"
#include "docuno.hxx"
#include <boost/unordered_map.hpp>
+#include <boost/scoped_ptr.hpp>
#include <cppuhelper/implbase1.hxx>
#include <config_telepathy.h>
+class ScRefreshTimerProtector;
class ScEditEngineDefaulter;
class SfxStyleSheetBasePool;
class SfxStyleSheetHint;
@@ -462,7 +463,7 @@ SV_IMPL_REF(ScDocShell)
class SC_DLLPUBLIC ScDocShellModificator
{
ScDocShell& rDocShell;
- ScRefreshTimerProtector aProtector;
+ boost::scoped_ptr<ScRefreshTimerProtector> mpProtector;
bool bAutoCalcShellDisabled;
bool bIdleEnabled;