Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
1fa23989
Kaydet (Commit)
1fa23989
authored
Eyl 18, 2015
tarafından
Michael Meeks
Kaydeden (comit)
Tor Lillqvist
Eyl 18, 2015
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Tentative performance improvement.
Change-Id: Iec3a6a6869a4546f3d10928470361716d7b10243
üst
ec765242
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
24 deletions
+25
-24
calcconfig.hxx
sc/inc/calcconfig.hxx
+3
-2
calcconfig.cxx
sc/source/core/tool/calcconfig.cxx
+9
-9
formulaopt.cxx
sc/source/core/tool/formulaopt.cxx
+3
-3
token.cxx
sc/source/core/tool/token.cxx
+2
-2
calcoptionsdlg.cxx
sc/source/ui/optdlg/calcoptionsdlg.cxx
+8
-8
No files found.
sc/inc/calcconfig.hxx
Dosyayı görüntüle @
1fa23989
...
...
@@ -12,6 +12,7 @@
#include "scdllapi.h"
#include <memory>
#include <ostream>
#include <set>
...
...
@@ -50,9 +51,9 @@ struct SC_DLLPUBLIC ScCalcConfig
OUString
maOpenCLDevice
;
sal_Int32
mnOpenCLMinimumFormulaGroupSize
;
typedef
std
::
s
et
<
OpCode
>
OpCodeSet
;
typedef
std
::
s
hared_ptr
<
std
::
set
<
OpCode
>
>
OpCodeSet
;
OpCodeSet
m
a
OpenCLSubsetOpCodes
;
OpCodeSet
m
p
OpenCLSubsetOpCodes
;
ScCalcConfig
();
...
...
sc/source/core/tool/calcconfig.cxx
Dosyayı görüntüle @
1fa23989
...
...
@@ -35,7 +35,7 @@ void ScCalcConfig::setOpenCLConfigToDefault()
{
// Keep in order of opcode value, is that clearest? (Random order,
// at least, would make no sense at all.)
static
const
OpCodeSet
aDefaultOpenCLSubsetOpCodes
{
static
const
std
::
set
<
OpCode
>
aDefaultOpenCLSubsetOpCodes
{
ocAdd
,
ocSub
,
ocMul
,
...
...
@@ -74,7 +74,7 @@ void ScCalcConfig::setOpenCLConfigToDefault()
mbOpenCLSubsetOnly
=
true
;
mbOpenCLAutoSelect
=
true
;
mnOpenCLMinimumFormulaGroupSize
=
100
;
m
aOpenCLSubsetOpCodes
=
aDefaultOpenCLSubsetOpCodes
;
m
pOpenCLSubsetOpCodes
.
reset
(
new
std
::
set
<
OpCode
>
(
aDefaultOpenCLSubsetOpCodes
))
;
}
void
ScCalcConfig
::
reset
()
...
...
@@ -108,7 +108,7 @@ bool ScCalcConfig::operator== (const ScCalcConfig& r) const
mbOpenCLAutoSelect
==
r
.
mbOpenCLAutoSelect
&&
maOpenCLDevice
==
r
.
maOpenCLDevice
&&
mnOpenCLMinimumFormulaGroupSize
==
r
.
mnOpenCLMinimumFormulaGroupSize
&&
maOpenCLSubsetOpCodes
==
r
.
ma
OpenCLSubsetOpCodes
&&
*
mpOpenCLSubsetOpCodes
==
*
r
.
mp
OpenCLSubsetOpCodes
&&
true
;
}
...
...
@@ -144,7 +144,7 @@ std::ostream& operator<<(std::ostream& rStream, const ScCalcConfig& rConfig)
"OpenCLAutoSelect="
<<
(
rConfig
.
mbOpenCLAutoSelect
?
"Y"
:
"N"
)
<<
","
"OpenCLDevice='"
<<
rConfig
.
maOpenCLDevice
<<
"',"
"OpenCLMinimumFormulaGroupSize="
<<
rConfig
.
mnOpenCLMinimumFormulaGroupSize
<<
","
"OpenCLSubsetOpCodes={"
<<
ScOpCodeSetToSymbolicString
(
rConfig
.
m
a
OpenCLSubsetOpCodes
)
<<
"},"
"OpenCLSubsetOpCodes={"
<<
ScOpCodeSetToSymbolicString
(
rConfig
.
m
p
OpenCLSubsetOpCodes
)
<<
"},"
"}"
;
return
rStream
;
}
...
...
@@ -155,9 +155,9 @@ OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet& rOpCodes)
formula
::
FormulaCompiler
aCompiler
;
formula
::
FormulaCompiler
::
OpCodeMapPtr
pOpCodeMap
(
aCompiler
.
GetOpCodeMap
(
css
::
sheet
::
FormulaLanguage
::
ENGLISH
));
for
(
auto
i
=
rOpCodes
.
cbegin
();
i
!=
rOpCodes
.
cend
();
++
i
)
for
(
auto
i
=
rOpCodes
->
cbegin
();
i
!=
rOpCodes
->
cend
();
++
i
)
{
if
(
i
!=
rOpCodes
.
cbegin
())
if
(
i
!=
rOpCodes
->
cbegin
())
result
.
append
(
';'
);
result
.
append
(
pOpCodeMap
->
getSymbol
(
*
i
));
}
...
...
@@ -167,7 +167,7 @@ OUString ScOpCodeSetToSymbolicString(const ScCalcConfig::OpCodeSet& rOpCodes)
ScCalcConfig
::
OpCodeSet
ScStringToOpCodeSet
(
const
OUString
&
rOpCodes
)
{
ScCalcConfig
::
OpCodeSet
result
;
ScCalcConfig
::
OpCodeSet
result
(
new
std
::
set
<
OpCode
>
())
;
formula
::
FormulaCompiler
aCompiler
;
formula
::
FormulaCompiler
::
OpCodeMapPtr
pOpCodeMap
(
aCompiler
.
GetOpCodeMap
(
css
::
sheet
::
FormulaLanguage
::
ENGLISH
));
...
...
@@ -184,12 +184,12 @@ ScCalcConfig::OpCodeSet ScStringToOpCodeSet(const OUString& rOpCodes)
OUString
element
(
s
.
copy
(
fromIndex
,
semicolon
-
fromIndex
));
sal_Int32
n
=
element
.
toInt32
();
if
(
n
>
0
||
(
n
==
0
&&
element
==
"0"
))
result
.
insert
(
static_cast
<
OpCode
>
(
n
));
result
->
insert
(
static_cast
<
OpCode
>
(
n
));
else
{
auto
opcode
(
pHashMap
->
find
(
element
));
if
(
opcode
!=
pHashMap
->
end
())
result
.
insert
(
static_cast
<
OpCode
>
(
opcode
->
second
));
result
->
insert
(
static_cast
<
OpCode
>
(
opcode
->
second
));
else
SAL_WARN
(
"sc.opencl"
,
"Unrecognized OpCode "
<<
element
<<
" in OpCode set string"
);
}
...
...
sc/source/core/tool/formulaopt.cxx
Dosyayı görüntüle @
1fa23989
...
...
@@ -491,9 +491,9 @@ void ScFormulaCfg::UpdateFromProperties( const Sequence<OUString>& aNames )
break
;
case
SCFORMULAOPT_OPENCL_SUBSET_OPS
:
{
OUString
sVal
=
ScOpCodeSetToSymbolicString
(
GetCalcConfig
().
m
a
OpenCLSubsetOpCodes
);
OUString
sVal
=
ScOpCodeSetToSymbolicString
(
GetCalcConfig
().
m
p
OpenCLSubsetOpCodes
);
pValues
[
nProp
]
>>=
sVal
;
GetCalcConfig
().
m
a
OpenCLSubsetOpCodes
=
ScStringToOpCodeSet
(
sVal
);
GetCalcConfig
().
m
p
OpenCLSubsetOpCodes
=
ScStringToOpCodeSet
(
sVal
);
}
break
;
}
...
...
@@ -638,7 +638,7 @@ void ScFormulaCfg::ImplCommit()
break
;
case
SCFORMULAOPT_OPENCL_SUBSET_OPS
:
{
OUString
sVal
=
ScOpCodeSetToSymbolicString
(
GetCalcConfig
().
m
a
OpenCLSubsetOpCodes
);
OUString
sVal
=
ScOpCodeSetToSymbolicString
(
GetCalcConfig
().
m
p
OpenCLSubsetOpCodes
);
pValues
[
nProp
]
<<=
sVal
;
}
break
;
...
...
sc/source/core/tool/token.cxx
Dosyayı görüntüle @
1fa23989
...
...
@@ -1315,7 +1315,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
if
(
SC_OPCODE_START_FUNCTION
<=
eOp
&&
eOp
<
SC_OPCODE_STOP_FUNCTION
)
{
if
(
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLSubsetOnly
&&
ScInterpreter
::
GetGlobalConfig
().
m
aOpenCLSubsetOpCodes
.
find
(
eOp
)
==
ScInterpreter
::
GetGlobalConfig
().
maOpenCLSubsetOpCodes
.
end
())
if
(
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLSubsetOnly
&&
ScInterpreter
::
GetGlobalConfig
().
m
pOpenCLSubsetOpCodes
->
find
(
eOp
)
==
ScInterpreter
::
GetGlobalConfig
().
mpOpenCLSubsetOpCodes
->
end
())
{
meVectorState
=
FormulaVectorDisabled
;
return
;
...
...
@@ -1556,7 +1556,7 @@ void ScTokenArray::CheckToken( const FormulaToken& r )
if
(
eOp
>=
SC_OPCODE_START_BIN_OP
&&
eOp
<=
SC_OPCODE_STOP_UN_OP
&&
ScInterpreter
::
GetGlobalConfig
().
mbOpenCLSubsetOnly
&&
ScInterpreter
::
GetGlobalConfig
().
m
aOpenCLSubsetOpCodes
.
find
(
eOp
)
==
ScInterpreter
::
GetGlobalConfig
().
maOpenCLSubsetOpCodes
.
end
())
ScInterpreter
::
GetGlobalConfig
().
m
pOpenCLSubsetOpCodes
->
find
(
eOp
)
==
ScInterpreter
::
GetGlobalConfig
().
mpOpenCLSubsetOpCodes
->
end
())
{
meVectorState
=
FormulaVectorDisabled
;
return
;
...
...
sc/source/ui/optdlg/calcoptionsdlg.cxx
Dosyayı görüntüle @
1fa23989
...
...
@@ -111,7 +111,7 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi
mpSpinButton
->
SetModifyHdl
(
LINK
(
this
,
ScCalcOptionsDialog
,
SpinOpenCLMinSizeHdl
));
get
(
mpEditField
,
"entry"
);
mpEditField
->
SetText
(
ScOpCodeSetToSymbolicString
(
maConfig
.
m
a
OpenCLSubsetOpCodes
));
mpEditField
->
SetText
(
ScOpCodeSetToSymbolicString
(
maConfig
.
m
p
OpenCLSubsetOpCodes
));
mpEditField
->
set_height_request
(
4
*
mpEditField
->
GetTextHeight
());
mpEditField
->
SetModifyHdl
(
LINK
(
this
,
ScCalcOptionsDialog
,
EditModifiedHdl
));
...
...
@@ -252,7 +252,7 @@ IMPL_LINK_NOARG_TYPED(ScCalcOptionsDialog, DeviceSelHdl, SvTreeListBox*, void)
IMPL_LINK
(
ScCalcOptionsDialog
,
EditModifiedHdl
,
Edit
*
,
pCtrl
)
{
maConfig
.
m
a
OpenCLSubsetOpCodes
=
ScStringToOpCodeSet
(
pCtrl
->
GetText
());
maConfig
.
m
p
OpenCLSubsetOpCodes
=
ScStringToOpCodeSet
(
pCtrl
->
GetText
());
return
0
;
}
...
...
@@ -286,7 +286,7 @@ struct OpenCLTester
ScDocShell
*
mpDocShell
;
ScDocument
*
mpDoc
;
bool
mbOldAutoCalc
;
ScCalcConfig
m
a
OldCalcConfig
;
ScCalcConfig
m
p
OldCalcConfig
;
OpenCLTester
()
:
mnTestAreas
(
0
)
...
...
@@ -305,10 +305,10 @@ struct OpenCLTester
mbOldAutoCalc
=
mpDoc
->
GetAutoCalc
();
mpDoc
->
SetAutoCalc
(
false
);
m
a
OldCalcConfig
=
ScInterpreter
::
GetGlobalConfig
();
ScCalcConfig
aConfig
(
ma
OldCalcConfig
);
a
Config
.
mnOpenCLMinimumFormulaGroupSize
=
20
;
ScInterpreter
::
SetGlobalConfig
(
a
Config
);
m
p
OldCalcConfig
=
ScInterpreter
::
GetGlobalConfig
();
ScCalcConfig
pConfig
(
mp
OldCalcConfig
);
p
Config
.
mnOpenCLMinimumFormulaGroupSize
=
20
;
ScInterpreter
::
SetGlobalConfig
(
p
Config
);
mpDoc
->
SetString
(
ScAddress
(
0
,
0
,
0
),
"Result:"
);
}
...
...
@@ -815,7 +815,7 @@ IMPL_STATIC_LINK_TYPED(ScCalcOptionsDialog, TestClickHdl, Button*, pButton, void
}));
xTestDocument
->
mpDoc
->
CalcAll
();
ScInterpreter
::
SetGlobalConfig
(
xTestDocument
->
m
a
OldCalcConfig
);
ScInterpreter
::
SetGlobalConfig
(
xTestDocument
->
m
p
OldCalcConfig
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment