summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-08-10 01:06:43 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-08-10 18:53:47 +0200
commit84c2297b48fb5d37dd2db4695e669e8e67801e18 (patch)
treeba855047b30de32f5d3b36c92acadffeaee3ddfa /sc
parent95c25102aeefbc0082ba467755b91a483775e193 (diff)
external data: remove some unnecessary concepts from the csv thread
Change-Id: Ie0299307b32808f91f1043794a149eb8f8d4f948 Reviewed-on: https://gerrit.libreoffice.org/40959 Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/dataprovider.cxx50
-rw-r--r--sc/source/ui/inc/dataprovider.hxx10
2 files changed, 0 insertions, 60 deletions
diff --git a/sc/source/ui/docshell/dataprovider.cxx b/sc/source/ui/docshell/dataprovider.cxx
index 9cafe70e94f5..fac1e2947544 100644
--- a/sc/source/ui/docshell/dataprovider.cxx
+++ b/sc/source/ui/docshell/dataprovider.cxx
@@ -291,34 +291,6 @@ void CSVFetchThread::execute()
mpIdle->Start();
}
-osl::Mutex& CSVFetchThread::GetLinesMutex()
-{
- return maMtxLines;
-}
-
-bool CSVFetchThread::HasNewLines()
-{
- return !maPendingLines.empty();
-}
-
-void CSVFetchThread::WaitForNewLines()
-{
- maCondConsume.wait();
- maCondConsume.reset();
-}
-
-LinesType* CSVFetchThread::GetNewLines()
-{
- LinesType* pLines = maPendingLines.front();
- maPendingLines.pop();
- return pLines;
-}
-
-void CSVFetchThread::ResumeFetchStream()
-{
- maCondReadStream.set();
-}
-
CSVDataProvider::CSVDataProvider(ScDocument* pDoc, const OUString& rURL, ScDBDataManager* pBDDataManager):
maURL(rURL),
mpDocument(pDoc),
@@ -364,28 +336,6 @@ void CSVDataProvider::Refresh()
pDocShell->SetDocumentModified();
}
-Line CSVDataProvider::GetLine()
-{
- if (!mpLines || mnLineCount >= mpLines->size())
- {
- if (mxCSVFetchThread->IsRequestedTerminate())
- return Line();
-
- osl::ResettableMutexGuard aGuard(mxCSVFetchThread->GetLinesMutex());
- while (!mxCSVFetchThread->HasNewLines() && !mxCSVFetchThread->IsRequestedTerminate())
- {
- aGuard.clear();
- mxCSVFetchThread->WaitForNewLines();
- aGuard.reset();
- }
-
- mpLines = mxCSVFetchThread->GetNewLines();
- mxCSVFetchThread->ResumeFetchStream();
- }
-
- return mpLines->at(mnLineCount++);
-}
-
// TODO: why don't we use existing copy functionality
void ScDBDataManager::WriteToDoc(ScDocument& rDoc, ScDBData* pDBData)
{
diff --git a/sc/source/ui/inc/dataprovider.hxx b/sc/source/ui/inc/dataprovider.hxx
index 6f203889fb37..e3d25317578d 100644
--- a/sc/source/ui/inc/dataprovider.hxx
+++ b/sc/source/ui/inc/dataprovider.hxx
@@ -78,10 +78,6 @@ class CSVFetchThread : public salhelper::Thread
osl::Mutex maMtxTerminate;
std::queue<LinesType*> maPendingLines;
- osl::Mutex maMtxLines;
-
- osl::Condition maCondReadStream;
- osl::Condition maCondConsume;
orcus::csv::parser_config maConfig;
@@ -96,12 +92,6 @@ public:
bool IsRequestedTerminate();
void Terminate();
void EndThread();
- void EmptyLineQueue(std::queue<LinesType*>& );
- osl::Mutex& GetLinesMutex();
- bool HasNewLines();
- void WaitForNewLines();
- LinesType* GetNewLines();
- void ResumeFetchStream();
virtual void execute() override;
};