summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-10-14 17:52:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-10-14 17:52:32 +0200
commitb44b76746d8834a4c32f704273a8b7b7547a9328 (patch)
tree449f26a406431eb2467749f310991f729c6a856f /sc
parent83210e28aeb0ba1faa809dbe705ce780cdd6fb4e (diff)
Use C++11 std::thread::hardware_concurrency()
...and hope it gets past our various tinderboxes. Change-Id: I4dd95e77c4a74ae58e66f98753fcf5e438080146
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 1ce43769dfa5..bacbc65b1efb 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -60,7 +60,9 @@
#include <salhelper/thread.hxx>
#include <osl/conditn.hxx>
+#include <algorithm>
#include <queue>
+#include <thread>
#include <boost/scoped_ptr.hpp>
#include <oox/ole/vbaproject.hxx>
@@ -296,7 +298,7 @@ public:
void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVector& rSheets )
{
- sal_Int32 nThreads = std::min( rSheets.size(), (size_t) 4 /* FIXME: ncpus/2 */ );
+ sal_Int32 nThreads = std::min( rSheets.size(), (size_t) std::max(std::thread::hardware_concurrency(), 1U) );
Reference< XComponentContext > xContext = comphelper::getProcessComponentContext();