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
db9a73d5
Kaydet (Commit)
db9a73d5
authored
Kas 06, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Allow non-pooled instance of SvNumberFormatter inside ScCompiler.
Change-Id: I645079254621c2f2684a69116b094e37e46f46f4
üst
4efc5fa3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
29 deletions
+36
-29
compiler.hxx
sc/inc/compiler.hxx
+3
-0
compiler.cxx
sc/source/core/tool/compiler.cxx
+33
-29
No files found.
sc/inc/compiler.hxx
Dosyayı görüntüle @
db9a73d5
...
@@ -312,6 +312,8 @@ private:
...
@@ -312,6 +312,8 @@ private:
ScDocument
*
pDoc
;
ScDocument
*
pDoc
;
ScAddress
aPos
;
ScAddress
aPos
;
SvNumberFormatter
*
mpFormatter
;
// For CONV_XL_OOX, may be set via API by MOOXML filter.
// For CONV_XL_OOX, may be set via API by MOOXML filter.
::
com
::
sun
::
star
::
uno
::
Sequence
<
const
::
com
::
sun
::
star
::
sheet
::
ExternalLinkInfo
>
maExternalLinks
;
::
com
::
sun
::
star
::
uno
::
Sequence
<
const
::
com
::
sun
::
star
::
sheet
::
ExternalLinkInfo
>
maExternalLinks
;
...
@@ -400,6 +402,7 @@ public:
...
@@ -400,6 +402,7 @@ public:
void
SetGrammar
(
const
formula
::
FormulaGrammar
::
Grammar
eGrammar
);
void
SetGrammar
(
const
formula
::
FormulaGrammar
::
Grammar
eGrammar
);
void
SetNumberFormatter
(
SvNumberFormatter
*
pFormatter
);
EncodeUrlMode
GetEncodeUrlMode
()
const
;
EncodeUrlMode
GetEncodeUrlMode
()
const
;
private
:
private
:
/** Set grammar and reference convention from within SetFormulaLanguage()
/** Set grammar and reference convention from within SetFormulaLanguage()
...
...
sc/source/core/tool/compiler.cxx
Dosyayı görüntüle @
db9a73d5
...
@@ -239,6 +239,11 @@ void ScCompiler::SetGrammar( const FormulaGrammar::Grammar eGrammar )
...
@@ -239,6 +239,11 @@ void ScCompiler::SetGrammar( const FormulaGrammar::Grammar eGrammar )
}
}
}
}
void
ScCompiler
::
SetNumberFormatter
(
SvNumberFormatter
*
pFormatter
)
{
mpFormatter
=
pFormatter
;
}
ScCompiler
::
EncodeUrlMode
ScCompiler
::
GetEncodeUrlMode
()
const
ScCompiler
::
EncodeUrlMode
ScCompiler
::
GetEncodeUrlMode
()
const
{
{
return
meEncodeUrlMode
;
return
meEncodeUrlMode
;
...
@@ -1640,6 +1645,7 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos,ScTokenArra
...
@@ -1640,6 +1645,7 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos,ScTokenArra
:
FormulaCompiler
(
rArr
),
:
FormulaCompiler
(
rArr
),
pDoc
(
pDocument
),
pDoc
(
pDocument
),
aPos
(
rPos
),
aPos
(
rPos
),
mpFormatter
(
pDoc
->
GetFormatTable
()),
pCharClass
(
ScGlobal
::
pCharClass
),
pCharClass
(
ScGlobal
::
pCharClass
),
mnPredetectedReference
(
0
),
mnPredetectedReference
(
0
),
mnRangeOpPosInSymbol
(
-
1
),
mnRangeOpPosInSymbol
(
-
1
),
...
@@ -1656,6 +1662,7 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos)
...
@@ -1656,6 +1662,7 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos)
:
:
pDoc
(
pDocument
),
pDoc
(
pDocument
),
aPos
(
rPos
),
aPos
(
rPos
),
mpFormatter
(
pDoc
->
GetFormatTable
()),
pCharClass
(
ScGlobal
::
pCharClass
),
pCharClass
(
ScGlobal
::
pCharClass
),
mnPredetectedReference
(
0
),
mnPredetectedReference
(
0
),
mnRangeOpPosInSymbol
(
-
1
),
mnRangeOpPosInSymbol
(
-
1
),
...
@@ -2517,40 +2524,37 @@ bool ScCompiler::IsOpCode2( const OUString& rName )
...
@@ -2517,40 +2524,37 @@ bool ScCompiler::IsOpCode2( const OUString& rName )
bool
ScCompiler
::
IsValue
(
const
OUString
&
rSym
)
bool
ScCompiler
::
IsValue
(
const
OUString
&
rSym
)
{
{
double
fVal
;
double
fVal
;
sal_uInt32
nIndex
=
(
mxSymbols
->
isEnglish
()
?
sal_uInt32
nIndex
=
mxSymbols
->
isEnglish
()
?
mpFormatter
->
GetStandardIndex
(
LANGUAGE_ENGLISH_US
)
:
0
;
pDoc
->
GetFormatTable
()
->
GetStandardIndex
(
LANGUAGE_ENGLISH_US
)
:
0
);
if
(
pDoc
->
GetFormatTable
()
->
IsNumberFormat
(
rSym
,
nIndex
,
fVal
)
)
if
(
!
mpFormatter
->
IsNumberFormat
(
rSym
,
nIndex
,
fVal
))
{
return
false
;
sal_uInt16
nType
=
pDoc
->
GetFormatTable
()
->
GetType
(
nIndex
);
// Don't accept 3:3 as time, it is a reference to entire row 3 instead.
sal_uInt16
nType
=
mpFormatter
->
GetType
(
nIndex
);
// Dates should never be entered directly and automatically converted
// to serial, because the serial would be wrong if null-date changed.
// Usually it wouldn't be accepted anyway because the date separator
// clashed with other separators or operators.
if
(
nType
&
(
NUMBERFORMAT_TIME
|
NUMBERFORMAT_DATE
))
return
false
;
if
(
nType
==
NUMBERFORMAT_LOGICAL
)
// Don't accept 3:3 as time, it is a reference to entire row 3 instead.
{
// Dates should never be entered directly and automatically converted
const
sal_Unicode
*
p
=
aFormula
.
getStr
()
+
nSrcPos
;
// to serial, because the serial would be wrong if null-date changed.
while
(
*
p
==
' '
)
// Usually it wouldn't be accepted anyway because the date separator
p
++
;
// clashed with other separators or operators.
if
(
*
p
==
'('
)
if
(
nType
&
(
NUMBERFORMAT_TIME
|
NUMBERFORMAT_DATE
))
return
false
;
// Boolean function instead.
return
false
;
}
if
(
nType
==
NUMBERFORMAT_TEXT
)
if
(
nType
==
NUMBERFORMAT_LOGICAL
)
// HACK: number too big!
{
SetError
(
errIllegalArgument
)
;
const
sal_Unicode
*
p
=
aFormula
.
getStr
()
+
nSrcPos
;
ScRawToken
aToken
;
while
(
*
p
==
' '
)
aToken
.
SetDouble
(
fVal
)
;
p
++
;
pRawToken
=
aToken
.
Clone
();
if
(
*
p
==
'('
)
return
true
;
return
false
;
// Boolean function instead.
}
}
else
return
false
;
if
(
nType
==
NUMBERFORMAT_TEXT
)
// HACK: number too big!
SetError
(
errIllegalArgument
);
ScRawToken
aToken
;
aToken
.
SetDouble
(
fVal
);
pRawToken
=
aToken
.
Clone
();
return
true
;
}
}
bool
ScCompiler
::
IsString
()
bool
ScCompiler
::
IsString
()
...
...
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