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
c88ce903
Kaydet (Commit)
c88ce903
authored
Eyl 13, 2013
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert aCorrectedFormula in formula::FormulaCompiler to OUString
Change-Id: I048ec33effc33e94943f5110d6a9a0937a1dfdfe
üst
8f23a3b0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
21 deletions
+21
-21
FormulaCompiler.cxx
formula/source/core/api/FormulaCompiler.cxx
+16
-16
FormulaCompiler.hxx
include/formula/FormulaCompiler.hxx
+1
-1
compiler.hxx
sc/inc/compiler.hxx
+1
-1
compiler.cxx
sc/source/core/tool/compiler.cxx
+3
-3
No files found.
formula/source/core/api/FormulaCompiler.cxx
Dosyayı görüntüle @
c88ce903
...
@@ -1382,9 +1382,9 @@ void FormulaCompiler::Factor()
...
@@ -1382,9 +1382,9 @@ void FormulaCompiler::Factor()
{
{
if
(
eOp
==
ocStop
)
if
(
eOp
==
ocStop
)
{
// trailing operator w/o operand
{
// trailing operator w/o operand
xub_StrLen
nLen
=
aCorrectedFormula
.
Len
();
sal_Int32
nLen
=
aCorrectedFormula
.
getLength
();
if
(
nLen
)
if
(
nLen
)
aCorrectedFormula
.
Erase
(
nLen
-
1
);
aCorrectedFormula
=
aCorrectedFormula
.
copy
(
0
,
nLen
-
1
);
aCorrectedSymbol
=
""
;
aCorrectedSymbol
=
""
;
bCorrected
=
true
;
bCorrected
=
true
;
}
}
...
@@ -1592,7 +1592,7 @@ bool FormulaCompiler::CompileTokenArray()
...
@@ -1592,7 +1592,7 @@ bool FormulaCompiler::CompileTokenArray()
{
{
if
(
bAutoCorrect
)
if
(
bAutoCorrect
)
{
{
aCorrectedFormula
.
Erase
()
;
aCorrectedFormula
=
""
;
aCorrectedSymbol
=
""
;
aCorrectedSymbol
=
""
;
}
}
pArr
->
nRefs
=
0
;
// count from start
pArr
->
nRefs
=
0
;
// count from start
...
@@ -1604,7 +1604,7 @@ bool FormulaCompiler::CompileTokenArray()
...
@@ -1604,7 +1604,7 @@ bool FormulaCompiler::CompileTokenArray()
if
(
bWasForced
)
if
(
bWasForced
)
{
{
if
(
bAutoCorrect
)
if
(
bAutoCorrect
)
aCorrectedFormula
=
'='
;
aCorrectedFormula
=
"="
;
}
}
pArr
->
ClearRecalcMode
();
pArr
->
ClearRecalcMode
();
pArr
->
Reset
();
pArr
->
Reset
();
...
@@ -1947,18 +1947,18 @@ OpCode FormulaCompiler::NextToken()
...
@@ -1947,18 +1947,18 @@ OpCode FormulaCompiler::NextToken()
}
}
else
else
{
{
xub_StrLen
nPos
=
aCorrectedFormula
.
Len
();
sal_Int32
nPos
=
aCorrectedFormula
.
getLength
();
if
(
nPos
)
if
(
nPos
)
{
{
nPos
--
;
nPos
--
;
sal_Unicode
c
=
aCorrectedFormula
.
GetChar
(
nPos
)
;
sal_Unicode
c
=
aCorrectedFormula
[
nPos
]
;
switch
(
eOp
)
switch
(
eOp
)
{
// swap operators
{
// swap operators
case
ocGreater
:
case
ocGreater
:
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocEqual
)
)
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocEqual
)
)
{
// >= instead of =>
{
// >= instead of =>
aCorrectedFormula
.
SetChar
(
nPos
,
aCorrectedFormula
=
aCorrectedFormula
.
replaceAt
(
nPos
,
1
,
mxSymbols
->
getSymbolChar
(
ocGreater
)
);
OUString
(
mxSymbols
->
getSymbolChar
(
ocGreater
)
)
);
aCorrectedSymbol
=
OUString
(
c
);
aCorrectedSymbol
=
OUString
(
c
);
bCorrected
=
true
;
bCorrected
=
true
;
}
}
...
@@ -1966,15 +1966,15 @@ OpCode FormulaCompiler::NextToken()
...
@@ -1966,15 +1966,15 @@ OpCode FormulaCompiler::NextToken()
case
ocLess
:
case
ocLess
:
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocEqual
)
)
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocEqual
)
)
{
// <= instead of =<
{
// <= instead of =<
aCorrectedFormula
.
SetChar
(
nPos
,
aCorrectedFormula
=
aCorrectedFormula
.
replaceAt
(
nPos
,
1
,
mxSymbols
->
getSymbolChar
(
ocLess
)
);
OUString
(
mxSymbols
->
getSymbolChar
(
ocLess
)
)
);
aCorrectedSymbol
=
OUString
(
c
);
aCorrectedSymbol
=
OUString
(
c
);
bCorrected
=
true
;
bCorrected
=
true
;
}
}
else
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocGreater
)
)
else
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocGreater
)
)
{
// <> instead of ><
{
// <> instead of ><
aCorrectedFormula
.
SetChar
(
nPos
,
aCorrectedFormula
=
aCorrectedFormula
.
replaceAt
(
nPos
,
1
,
mxSymbols
->
getSymbolChar
(
ocLess
)
);
OUString
(
mxSymbols
->
getSymbolChar
(
ocLess
)
)
);
aCorrectedSymbol
=
OUString
(
c
);
aCorrectedSymbol
=
OUString
(
c
);
bCorrected
=
true
;
bCorrected
=
true
;
}
}
...
@@ -1982,8 +1982,8 @@ OpCode FormulaCompiler::NextToken()
...
@@ -1982,8 +1982,8 @@ OpCode FormulaCompiler::NextToken()
case
ocMul
:
case
ocMul
:
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocSub
)
)
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocSub
)
)
{
// *- instead of -*
{
// *- instead of -*
aCorrectedFormula
.
SetChar
(
nPos
,
aCorrectedFormula
=
aCorrectedFormula
.
replaceAt
(
nPos
,
1
,
mxSymbols
->
getSymbolChar
(
ocMul
)
);
OUString
(
mxSymbols
->
getSymbolChar
(
ocMul
)
)
);
aCorrectedSymbol
=
OUString
(
c
);
aCorrectedSymbol
=
OUString
(
c
);
bCorrected
=
true
;
bCorrected
=
true
;
}
}
...
@@ -1991,8 +1991,8 @@ OpCode FormulaCompiler::NextToken()
...
@@ -1991,8 +1991,8 @@ OpCode FormulaCompiler::NextToken()
case
ocDiv
:
case
ocDiv
:
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocSub
)
)
if
(
c
==
mxSymbols
->
getSymbolChar
(
ocSub
)
)
{
// /- instead of -/
{
// /- instead of -/
aCorrectedFormula
.
SetChar
(
nPos
,
aCorrectedFormula
=
aCorrectedFormula
.
replaceAt
(
nPos
,
1
,
mxSymbols
->
getSymbolChar
(
ocDiv
)
);
OUString
(
mxSymbols
->
getSymbolChar
(
ocDiv
)
)
);
aCorrectedSymbol
=
OUString
(
c
);
aCorrectedSymbol
=
OUString
(
c
);
bCorrected
=
true
;
bCorrected
=
true
;
}
}
...
...
include/formula/FormulaCompiler.hxx
Dosyayı görüntüle @
c88ce903
...
@@ -311,7 +311,7 @@ protected:
...
@@ -311,7 +311,7 @@ protected:
bool
MergeRangeReference
(
FormulaToken
*
*
const
pCode1
,
FormulaToken
*
const
*
const
pCode2
);
bool
MergeRangeReference
(
FormulaToken
*
*
const
pCode1
,
FormulaToken
*
const
*
const
pCode2
);
String
aCorrectedFormula
;
// autocorrected Formula
OUString
aCorrectedFormula
;
// autocorrected Formula
OUString
aCorrectedSymbol
;
// autocorrected Symbol
OUString
aCorrectedSymbol
;
// autocorrected Symbol
OpCodeMapPtr
mxSymbols
;
// which symbols are used
OpCodeMapPtr
mxSymbols
;
// which symbols are used
...
...
sc/inc/compiler.hxx
Dosyayı görüntüle @
c88ce903
...
@@ -425,7 +425,7 @@ public:
...
@@ -425,7 +425,7 @@ public:
void
SetExtendedErrorDetection
(
ExtendedErrorDetection
eVal
)
{
meExtendedErrorDetection
=
eVal
;
}
void
SetExtendedErrorDetection
(
ExtendedErrorDetection
eVal
)
{
meExtendedErrorDetection
=
eVal
;
}
bool
IsCorrected
()
{
return
bCorrected
;
}
bool
IsCorrected
()
{
return
bCorrected
;
}
const
String
&
GetCorrectedFormula
()
{
return
aCorrectedFormula
;
}
const
OUString
&
GetCorrectedFormula
()
{
return
aCorrectedFormula
;
}
// Use convention from this->aPos by default
// Use convention from this->aPos by default
ScTokenArray
*
CompileString
(
const
OUString
&
rFormula
);
ScTokenArray
*
CompileString
(
const
OUString
&
rFormula
);
...
...
sc/source/core/tool/compiler.cxx
Dosyayı görüntüle @
c88ce903
...
@@ -3664,7 +3664,7 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
...
@@ -3664,7 +3664,7 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
bCorrected
=
false
;
bCorrected
=
false
;
if
(
bAutoCorrect
)
if
(
bAutoCorrect
)
{
{
aCorrectedFormula
.
Erase
()
;
aCorrectedFormula
=
""
;
aCorrectedSymbol
=
""
;
aCorrectedSymbol
=
""
;
}
}
sal_uInt8
nForced
=
0
;
// ==formula forces recalc even if cell is not visible
sal_uInt8
nForced
=
0
;
// ==formula forces recalc even if cell is not visible
...
@@ -3673,14 +3673,14 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
...
@@ -3673,14 +3673,14 @@ ScTokenArray* ScCompiler::CompileString( const OUString& rFormula )
nSrcPos
++
;
nSrcPos
++
;
nForced
++
;
nForced
++
;
if
(
bAutoCorrect
)
if
(
bAutoCorrect
)
aCorrectedFormula
+=
'='
;
aCorrectedFormula
+=
"="
;
}
}
if
(
aFormula
.
GetChar
(
nSrcPos
)
==
'='
)
if
(
aFormula
.
GetChar
(
nSrcPos
)
==
'='
)
{
{
nSrcPos
++
;
nSrcPos
++
;
nForced
++
;
nForced
++
;
if
(
bAutoCorrect
)
if
(
bAutoCorrect
)
aCorrectedFormula
+=
'='
;
aCorrectedFormula
+=
"="
;
}
}
struct
FunctionStack
struct
FunctionStack
{
{
...
...
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