Kaydet (Commit) da139293 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

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
üst 86da0935
...@@ -11,10 +11,11 @@ ...@@ -11,10 +11,11 @@
#define SC_REFRESHTIMERPROTECTOR_HXX #define SC_REFRESHTIMERPROTECTOR_HXX
#include <sal/config.h> #include <sal/config.h>
#include "scdllapi.h"
class ScRefreshTimerControl; class ScRefreshTimerControl;
class ScRefreshTimerProtector class SC_DLLPUBLIC ScRefreshTimerProtector
{ {
ScRefreshTimerControl * const * ppControl; ScRefreshTimerControl * const * ppControl;
......
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
#include "compiler.hxx" #include "compiler.hxx"
#include "formulacell.hxx" #include "formulacell.hxx"
#include "tokenarray.hxx" #include "tokenarray.hxx"
#include "refreshtimerprotector.hxx"
#include "globstr.hrc"
#include <../../ui/inc/docsh.hxx> #include <../../ui/inc/docsh.hxx>
#include <../../ui/inc/viewdata.hxx> #include <../../ui/inc/viewdata.hxx>
...@@ -53,6 +55,8 @@ ...@@ -53,6 +55,8 @@
#include <sfx2/objsh.hxx> #include <sfx2/objsh.hxx>
#include <sfx2/app.hxx> #include <sfx2/app.hxx>
#include <com/sun/star/task/XStatusIndicator.hpp>
#define DEBUG_XL_ENCRYPTION 0 #define DEBUG_XL_ENCRYPTION 0
using ::com::sun::star::embed::XStorage; using ::com::sun::star::embed::XStorage;
...@@ -64,6 +68,7 @@ using ::com::sun::star::uno::XInterface; ...@@ -64,6 +68,7 @@ using ::com::sun::star::uno::XInterface;
using ::utl::OStreamWrapper; using ::utl::OStreamWrapper;
using ::std::vector; using ::std::vector;
using namespace com::sun::star;
using namespace ::com::sun::star::beans; using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::io; using namespace ::com::sun::star::io;
using namespace ::com::sun::star::lang; using namespace ::com::sun::star::lang;
...@@ -1089,6 +1094,12 @@ bool XclExpXmlStream::exportDocument() throw() ...@@ -1089,6 +1094,12 @@ bool XclExpXmlStream::exportDocument() throw()
{ {
ScDocShell* pShell = getDocShell(); ScDocShell* pShell = getDocShell();
ScDocument* pDoc = pShell->GetDocument(); 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 // NOTE: Don't use SotStorage or SvStream any more, and never call
// SfxMedium::GetOutStream() anywhere in the xlsx export filter code! // SfxMedium::GetOutStream() anywhere in the xlsx export filter code!
// Instead, write via XOutputStream instance. // Instead, write via XOutputStream instance.
...@@ -1120,10 +1131,13 @@ bool XclExpXmlStream::exportDocument() throw() ...@@ -1120,10 +1131,13 @@ bool XclExpXmlStream::exportDocument() throw()
// destruct at the end of the block // destruct at the end of the block
{ {
ExcDocument aDocRoot( aRoot ); ExcDocument aDocRoot( aRoot );
xStatusIndicator->setValue(10);
aDocRoot.ReadDoc(); aDocRoot.ReadDoc();
xStatusIndicator->setValue(40);
aDocRoot.WriteXml( *this ); aDocRoot.WriteXml( *this );
} }
xStatusIndicator->end();
mpRoot = NULL; mpRoot = NULL;
return true; return true;
} }
......
...@@ -108,6 +108,7 @@ ...@@ -108,6 +108,7 @@
#include "docparam.hxx" #include "docparam.hxx"
#include "docshimp.hxx" #include "docshimp.hxx"
#include "sizedev.hxx" #include "sizedev.hxx"
#include "refreshtimerprotector.hxx"
#include <officecfg/Office/Calc.hxx> #include <officecfg/Office/Calc.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
...@@ -3038,7 +3039,7 @@ void ScDocShell::UseSheetSaveEntries() ...@@ -3038,7 +3039,7 @@ void ScDocShell::UseSheetSaveEntries()
ScDocShellModificator::ScDocShellModificator( ScDocShell& rDS ) ScDocShellModificator::ScDocShellModificator( ScDocShell& rDS )
: :
rDocShell( rDS ), rDocShell( rDS ),
aProtector( rDS.GetDocument()->GetRefreshTimerControlAddress() ) mpProtector(new ScRefreshTimerProtector(rDS.GetDocument()->GetRefreshTimerControlAddress()))
{ {
ScDocument* pDoc = rDocShell.GetDocument(); ScDocument* pDoc = rDocShell.GetDocument();
bAutoCalcShellDisabled = pDoc->IsAutoCalcShellDisabled(); bAutoCalcShellDisabled = pDoc->IsAutoCalcShellDisabled();
......
...@@ -33,15 +33,16 @@ ...@@ -33,15 +33,16 @@
#include "appoptio.hxx" #include "appoptio.hxx"
#include "formulaopt.hxx" #include "formulaopt.hxx"
#include "shellids.hxx" #include "shellids.hxx"
#include "refreshtimerprotector.hxx"
#include "optutil.hxx" #include "optutil.hxx"
#include "docuno.hxx" #include "docuno.hxx"
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#include <boost/scoped_ptr.hpp>
#include <cppuhelper/implbase1.hxx> #include <cppuhelper/implbase1.hxx>
#include <config_telepathy.h> #include <config_telepathy.h>
class ScRefreshTimerProtector;
class ScEditEngineDefaulter; class ScEditEngineDefaulter;
class SfxStyleSheetBasePool; class SfxStyleSheetBasePool;
class SfxStyleSheetHint; class SfxStyleSheetHint;
...@@ -467,7 +468,7 @@ SV_IMPL_REF(ScDocShell) ...@@ -467,7 +468,7 @@ SV_IMPL_REF(ScDocShell)
class SC_DLLPUBLIC ScDocShellModificator class SC_DLLPUBLIC ScDocShellModificator
{ {
ScDocShell& rDocShell; ScDocShell& rDocShell;
ScRefreshTimerProtector aProtector; boost::scoped_ptr<ScRefreshTimerProtector> mpProtector;
bool bAutoCalcShellDisabled; bool bAutoCalcShellDisabled;
bool bIdleEnabled; bool bIdleEnabled;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment