sc/Module_sc.mk | 2 - sc/source/ui/docshell/datastream.cxx | 52 ++++++++------------------------ sc/source/ui/inc/datastream.hxx | 7 +++- sc/source/ui/miscdlgs/datastreamdlg.cxx | 5 +-- 4 files changed, 24 insertions(+), 42 deletions(-)
New commits: commit be100cd56aaf4fd761ed9b7131e5b6e6c754133e Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Mon Dec 30 17:58:00 2013 -0500 Move this opencl test to slowcheck. It's too slow. Change-Id: I0386f03c1893fed82bdf7df11dbea93bbad05dd2 diff --git a/sc/Module_sc.mk b/sc/Module_sc.mk index 6730163..094290a 100644 --- a/sc/Module_sc.mk +++ b/sc/Module_sc.mk @@ -54,12 +54,12 @@ $(eval $(call gb_Module_add_check_targets,sc,\ CppunitTest_sc_ucalc \ CppunitTest_sc_filters_test \ CppunitTest_sc_rangelst_test \ - CppunitTest_sc_opencl_test \ )) $(eval $(call gb_Module_add_slowcheck_targets,sc, \ CppunitTest_sc_subsequent_filters_test \ CppunitTest_sc_subsequent_export_test \ + CppunitTest_sc_opencl_test \ )) # Disabled to allow the check tinderbox execute the sd tests commit 85a358c0d0b8665cc95be467198dc2297294e02a Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Mon Dec 30 16:50:02 2013 -0500 Display 3D address & honor current reference address convension. Change-Id: I0c0f03807ddfadb5b9c17c81eeb86d51c877d4b4 diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx b/sc/source/ui/miscdlgs/datastreamdlg.cxx index 8a3bee5..b0cc2b0 100644 --- a/sc/source/ui/miscdlgs/datastreamdlg.cxx +++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx @@ -100,7 +100,7 @@ ScRange DataStreamDlg::GetStartRange() OUString aStr = m_pEdRange->GetText(); ScDocument* pDoc = mpDocShell->GetDocument(); ScRange aRange; - sal_uInt16 nRes = aRange.Parse(aStr, pDoc); + sal_uInt16 nRes = aRange.Parse(aStr, pDoc, pDoc->GetAddressConvention()); if ((nRes & SCA_VALID) != SCA_VALID || !aRange.IsValid()) { // Invalid range. @@ -118,11 +118,12 @@ ScRange DataStreamDlg::GetStartRange() void DataStreamDlg::Init( const DataStream& rStrm ) { m_pCbUrl->SetText(rStrm.GetURL()); + ScDocument* pDoc = mpDocShell->GetDocument(); ScRange aRange = rStrm.GetRange(); ScRange aTopRange = aRange; aTopRange.aEnd.SetRow(aTopRange.aStart.Row()); - OUString aStr = aTopRange.Format(SCA_VALID); + OUString aStr = aTopRange.Format(SCR_ABS_3D, pDoc, pDoc->GetAddressConvention()); m_pEdRange->SetText(aStr); SCROW nRows = aRange.aEnd.Row() - aRange.aStart.Row() + 1; commit a757bf33def84703bd9b494e03ff1df6e5b376ff Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Mon Dec 30 15:43:21 2013 -0500 Remove CallerThread and use Timer to do the same, on the main thread. This makes the UI more responsive in general. Change-Id: I5f8a4fab84a73812af868262cc7daa9d92cb3777 diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index 45bc637..c060660 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -111,37 +111,6 @@ public: namespace datastreams { -class CallerThread : public salhelper::Thread -{ - DataStream *mpDataStream; -public: - osl::Condition maStart; - bool mbTerminate; - - CallerThread(DataStream *pData): - Thread("CallerThread") - ,mpDataStream(pData) - ,mbTerminate(false) - {} - -private: - virtual void execute() - { - while (!mbTerminate) - { - // wait for a small amount of time, so that - // painting methods have a chance to be called. - // And also to make UI more responsive. - TimeValue const aTime = {0, 1000}; - maStart.wait(); - maStart.reset(); - if (!mbTerminate) - while (mpDataStream->ImportData()) - wait(aTime); - }; - } -}; - void emptyLineQueue( std::queue<DataStream::LinesType*>& rQueue ) { while (!rQueue.empty()) @@ -371,8 +340,8 @@ DataStream::DataStream(ScDocShell *pShell, const OUString& rURL, const ScRange& mfLastRefreshTime(0.0), mnCurRow(0) { - mxThread = new datastreams::CallerThread( this ); - mxThread->launch(); + maImportTimer.SetTimeout(0); + maImportTimer.SetTimeoutHdl( LINK(this, DataStream, ImportTimerHdl) ); Decode(rURL, rRange, nLimit, eMove, nSettings); } @@ -381,9 +350,7 @@ DataStream::~DataStream() { if (mbRunning) StopImport(); - mxThread->mbTerminate = true; - mxThread->maStart.set(); - mxThread->join(); + if (mxReaderThread.is()) { mxReaderThread->endThread(); @@ -487,7 +454,8 @@ void DataStream::StartImport() } mbRunning = true; maDocAccess.reset(); - mxThread->maStart.set(); + + maImportTimer.Start(); } void DataStream::StopImport() @@ -497,6 +465,7 @@ void DataStream::StopImport() mbRunning = false; Refresh(); + maImportTimer.Stop(); } void DataStream::SetRefreshOnEmptyLine( bool bVal ) @@ -614,7 +583,6 @@ void DataStream::Text2Doc() {} bool DataStream::ImportData() { - SolarMutexGuard aGuard; if (!mbValuesInLine) // We no longer support this mode. To be deleted later. return false; @@ -626,6 +594,14 @@ bool DataStream::ImportData() return mbRunning; } +IMPL_LINK_NOARG(DataStream, ImportTimerHdl) +{ + if (ImportData()) + maImportTimer.Start(); + + return 0; +} + } // namespace sc /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/ui/inc/datastream.hxx b/sc/source/ui/inc/datastream.hxx index 5af2dc7..5600a09 100644 --- a/sc/source/ui/inc/datastream.hxx +++ b/sc/source/ui/inc/datastream.hxx @@ -14,6 +14,7 @@ #include <rtl/ref.hxx> #include <rtl/ustring.hxx> +#include <vcl/timer.hxx> #include <address.hxx> #include <boost/noncopyable.hpp> @@ -102,6 +103,8 @@ private: void Text2Doc(); void Refresh(); + DECL_LINK( ImportTimerHdl, void* ); + private: ScDocShell* mpDocShell; ScDocument* mpDoc; @@ -121,7 +124,9 @@ private: SCROW mnCurRow; ScRange maStartRange; ScRange maEndRange; - rtl::Reference<datastreams::CallerThread> mxThread; + + Timer maImportTimer; + rtl::Reference<datastreams::ReaderThread> mxReaderThread; }; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits