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
f7f4d985
Kaydet (Commit)
f7f4d985
authored
Tem 10, 2015
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: tdf#92457 handle trailing text subformat if others omitted
Change-Id: I597a5019540cef4700355df4d170c103e973797e
üst
12d1a2a0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
3 deletions
+49
-3
zformat.hxx
include/svl/zformat.hxx
+6
-0
zforfind.cxx
svl/source/numbers/zforfind.cxx
+19
-2
zforlist.cxx
svl/source/numbers/zforlist.cxx
+5
-1
zformat.cxx
svl/source/numbers/zformat.cxx
+16
-0
zforscan.hxx
svl/source/numbers/zforscan.hxx
+3
-0
No files found.
include/svl/zformat.hxx
Dosyayı görüntüle @
f7f4d985
...
@@ -277,6 +277,12 @@ public:
...
@@ -277,6 +277,12 @@ public:
return
false
;
return
false
;
}
}
/** Get the scanned type of the specified subformat. */
short
GetNumForInfoScannedType
(
sal_uInt16
nNumFor
)
const
{
return
(
nNumFor
<
4
)
?
NumFor
[
nNumFor
].
Info
().
eScannedType
:
css
::
util
::
NumberFormat
::
UNDEFINED
;
}
// Whether the second subformat code is really for negative numbers
// Whether the second subformat code is really for negative numbers
// or another limit set.
// or another limit set.
bool
IsSecondSubformatRealNegative
()
const
bool
IsSecondSubformatRealNegative
()
const
...
...
svl/source/numbers/zforfind.cxx
Dosyayı görüntüle @
f7f4d985
...
@@ -3222,7 +3222,16 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, /
...
@@ -3222,7 +3222,16 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, /
}
}
if
(
nMatchedAllStrings
)
if
(
nMatchedAllStrings
)
{
{
eScannedType
=
eSetType
;
// A type DEFINED means that no category could be assigned to the
// overall format because of mixed type subformats. Use the scan
// matched subformat's type if any.
short
eForType
=
eSetType
;
if
((
eForType
==
css
::
util
::
NumberFormat
::
UNDEFINED
||
eForType
==
css
::
util
::
NumberFormat
::
DEFINED
)
&&
pFormat
)
eForType
=
pFormat
->
GetNumForInfoScannedType
(
nStringScanNumFor
);
if
(
eForType
!=
css
::
util
::
NumberFormat
::
UNDEFINED
&&
eForType
!=
css
::
util
::
NumberFormat
::
DEFINED
)
eScannedType
=
eForType
;
else
eScannedType
=
css
::
util
::
NumberFormat
::
NUMBER
;
}
}
else
if
(
bDidMatch
)
else
if
(
bDidMatch
)
{
{
...
@@ -3250,7 +3259,15 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, /
...
@@ -3250,7 +3259,15 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, /
}
}
if
(
nMatchedAllStrings
)
if
(
nMatchedAllStrings
)
{
{
eScannedType
=
eSetType
;
// A type DEFINED means that no category could be assigned to the
// overall format because of mixed type subformats. Do not override
// the scanned type in this case. Otherwise in IsNumberFormat() the
// first numeric particle would be accepted as number.
short
eForType
=
eSetType
;
if
((
eForType
==
css
::
util
::
NumberFormat
::
UNDEFINED
||
eForType
==
css
::
util
::
NumberFormat
::
DEFINED
)
&&
pFormat
)
eForType
=
pFormat
->
GetNumForInfoScannedType
(
nStringScanNumFor
);
if
(
eForType
!=
css
::
util
::
NumberFormat
::
UNDEFINED
&&
eForType
!=
css
::
util
::
NumberFormat
::
DEFINED
)
eScannedType
=
eForType
;
}
}
else
if
(
bWasReturn
)
else
if
(
bWasReturn
)
{
{
...
...
svl/source/numbers/zforlist.cxx
Dosyayı görüntüle @
f7f4d985
...
@@ -1322,7 +1322,11 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber,
...
@@ -1322,7 +1322,11 @@ void SvNumberFormatter::GetInputLineString(const double& fOutNumber,
short
eType
=
pFormat
->
GetType
()
&
~
css
::
util
::
NumberFormat
::
DEFINED
;
short
eType
=
pFormat
->
GetType
()
&
~
css
::
util
::
NumberFormat
::
DEFINED
;
if
(
eType
==
0
)
if
(
eType
==
0
)
{
{
eType
=
css
::
util
::
NumberFormat
::
DEFINED
;
// Mixed types in subformats, use first.
/* XXX we could choose a subformat according to fOutNumber and
* subformat conditions, but they may exist to suppress 0 or negative
* numbers so wouldn't be a safe bet. */
eType
=
pFormat
->
GetNumForInfoScannedType
(
0
);
}
}
sal_uInt16
nOldPrec
=
pFormatScanner
->
GetStandardPrec
();
sal_uInt16
nOldPrec
=
pFormatScanner
->
GetStandardPrec
();
...
...
svl/source/numbers/zformat.cxx
Dosyayı görüntüle @
f7f4d985
...
@@ -943,6 +943,22 @@ SvNumberformat::SvNumberformat(OUString& rString,
...
@@ -943,6 +943,22 @@ SvNumberformat::SvNumberformat(OUString& rString,
sBuff
.
insert
(
nPos
,
";"
);
sBuff
.
insert
(
nPos
,
";"
);
nPos
++
;
nPos
++
;
}
}
else
{
// The last subformat. If it is a trailing text
// format the omitted subformats act like they were
// not specified and "inherited" the first format,
// e.g. 0;@ behaves like 0;-0;0;@
if
(
pSc
->
GetScannedType
()
==
css
::
util
::
NumberFormat
::
TEXT
)
{
// Reset conditions, reverting any set above.
if
(
nIndex
==
1
)
eOp1
=
NUMBERFORMAT_OP_NO
;
else
if
(
nIndex
==
2
)
eOp2
=
NUMBERFORMAT_OP_NO
;
nIndex
=
3
;
}
}
NumFor
[
nIndex
].
Enlarge
(
nAnz
);
NumFor
[
nIndex
].
Enlarge
(
nAnz
);
pSc
->
CopyInfo
(
&
(
NumFor
[
nIndex
].
Info
()),
nAnz
);
pSc
->
CopyInfo
(
&
(
NumFor
[
nIndex
].
Info
()),
nAnz
);
// type check
// type check
...
...
svl/source/numbers/zforscan.hxx
Dosyayı görüntüle @
f7f4d985
...
@@ -144,6 +144,9 @@ public:
...
@@ -144,6 +144,9 @@ public:
SvNumberFormatter
*
GetNumberformatter
()
{
return
pFormatter
;
}
// Access to formatter (for zformat.cxx)
SvNumberFormatter
*
GetNumberformatter
()
{
return
pFormatter
;
}
// Access to formatter (for zformat.cxx)
/// Get type scanned (so far).
short
GetScannedType
()
const
{
return
eScannedType
;
}
private
:
// Private section
private
:
// Private section
NfKeywordTable
sKeyword
;
// Syntax keywords
NfKeywordTable
sKeyword
;
// Syntax keywords
Color
StandardColor
[
NF_MAX_DEFAULT_COLORS
];
// Standard color array
Color
StandardColor
[
NF_MAX_DEFAULT_COLORS
];
// Standard color array
...
...
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