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
f59e350d
Kaydet (Commit)
f59e350d
authored
Eyl 16, 2010
tarafından
Kohei Yoshida
Kaydeden (comit)
Fridrich Štrba
Eyl 16, 2010
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
calc-filter-dbf-precision.diff: import/export precision of value cells fix
n#479025, i#101045
üst
b592eb99
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
3 deletions
+71
-3
column3.cxx
sc/source/core/data/column3.cxx
+12
-2
docsh8.cxx
sc/source/ui/docshell/docsh8.cxx
+59
-1
No files found.
sc/source/core/data/column3.cxx
Dosyayı görüntüle @
f59e350d
...
...
@@ -1968,8 +1968,18 @@ xub_StrLen ScColumn::GetMaxNumberStringLen(
if
(
nLen
)
{
if
(
nFormat
)
{
// more decimals than standard?
sal_uInt16
nPrec
=
pNumFmt
->
GetFormatPrecision
(
nFormat
);
{
const
SvNumberformat
*
pEntry
=
pNumFmt
->
GetEntry
(
nFormat
);
sal_uInt16
nPrec
;
if
(
pEntry
)
{
BOOL
bThousand
,
bNegRed
;
USHORT
nLeading
;
pEntry
->
GetFormatSpecialInfo
(
bThousand
,
bNegRed
,
nPrec
,
nLeading
);
}
else
nPrec
=
pNumFmt
->
GetFormatPrecision
(
nFormat
);
if
(
nPrec
!=
SvNumberFormatter
::
UNLIMITED_PRECISION
&&
nPrec
>
nPrecision
)
nPrecision
=
nPrec
;
}
...
...
sc/source/ui/docshell/docsh8.cxx
Dosyayı görüntüle @
f59e350d
...
...
@@ -78,8 +78,16 @@
#include "dbdocutl.hxx"
#include "dociter.hxx"
#include "globstr.hrc"
#include "svl/zformat.hxx"
#include "svl/intitem.hxx"
#include "patattr.hxx"
#include "scitems.hxx"
#include "docpool.hxx"
#include <vector>
using
namespace
com
::
sun
::
star
;
using
::
std
::
vector
;
// -----------------------------------------------------------------------
...
...
@@ -246,6 +254,53 @@ BOOL ScDocShell::IsDocument( const INetURLObject& rURL )
// -----------------------------------------------------------------------
static
void
lcl_setScalesToColumns
(
ScDocument
&
rDoc
,
const
vector
<
long
>&
rScales
)
{
SvNumberFormatter
*
pFormatter
=
rDoc
.
GetFormatTable
();
if
(
!
pFormatter
)
return
;
SCCOL
nColCount
=
static_cast
<
SCCOL
>
(
rScales
.
size
());
for
(
SCCOL
i
=
0
;
i
<
nColCount
;
++
i
)
{
if
(
rScales
[
i
]
<
0
)
continue
;
sal_uInt32
nOldFormat
;
rDoc
.
GetNumberFormat
(
static_cast
<
SCCOL
>
(
i
),
0
,
0
,
nOldFormat
);
const
SvNumberformat
*
pOldEntry
=
pFormatter
->
GetEntry
(
nOldFormat
);
if
(
!
pOldEntry
)
continue
;
LanguageType
eLang
=
pOldEntry
->
GetLanguage
();
BOOL
bThousand
,
bNegRed
;
USHORT
nPrecision
,
nLeading
;
pOldEntry
->
GetFormatSpecialInfo
(
bThousand
,
bNegRed
,
nPrecision
,
nLeading
);
nPrecision
=
static_cast
<
USHORT
>
(
rScales
[
i
]);
String
aNewPicture
;
pFormatter
->
GenerateFormat
(
aNewPicture
,
nOldFormat
,
eLang
,
bThousand
,
bNegRed
,
nPrecision
,
nLeading
);
sal_uInt32
nNewFormat
=
pFormatter
->
GetEntryKey
(
aNewPicture
,
eLang
);
if
(
nNewFormat
==
NUMBERFORMAT_ENTRY_NOT_FOUND
)
{
xub_StrLen
nErrPos
=
0
;
short
nNewType
=
0
;
bool
bOk
=
pFormatter
->
PutEntry
(
aNewPicture
,
nErrPos
,
nNewType
,
nNewFormat
,
eLang
);
if
(
!
bOk
)
continue
;
}
ScPatternAttr
aNewAttrs
(
rDoc
.
GetPool
()
);
SfxItemSet
&
rSet
=
aNewAttrs
.
GetItemSet
();
rSet
.
Put
(
SfxUInt32Item
(
ATTR_VALUE_FORMAT
,
nNewFormat
)
);
rDoc
.
ApplyPatternAreaTab
(
static_cast
<
SCCOL
>
(
i
),
0
,
static_cast
<
SCCOL
>
(
i
),
MAXROW
,
0
,
aNewAttrs
);
}
}
ULONG
ScDocShell
::
DBaseImport
(
const
String
&
rFullFileName
,
CharSet
eCharSet
,
BOOL
bSimpleColWidth
[
MAXCOLCOUNT
]
)
{
...
...
@@ -327,6 +382,7 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
// read column names
//! add type descriptions
vector
<
long
>
aScales
(
nColCount
,
-
1
);
for
(
i
=
0
;
i
<
nColCount
;
i
++
)
{
String
aHeader
=
xMeta
->
getColumnLabel
(
i
+
1
);
...
...
@@ -356,6 +412,7 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
nPrec
,
nScale
)
);
aHeader
+=
','
;
aHeader
+=
String
::
CreateFromInt32
(
nScale
);
aScales
[
i
]
=
nScale
;
}
break
;
}
...
...
@@ -363,6 +420,8 @@ ULONG ScDocShell::DBaseImport( const String& rFullFileName, CharSet eCharSet,
aDocument
.
SetString
(
static_cast
<
SCCOL
>
(
i
),
0
,
0
,
aHeader
);
}
lcl_setScalesToColumns
(
aDocument
,
aScales
);
SCROW
nRow
=
1
;
// 0 is column titles
BOOL
bEnd
=
FALSE
;
while
(
!
bEnd
&&
xRowSet
->
next
()
)
...
...
@@ -486,7 +545,6 @@ void lcl_GetColumnTypes( ScDocShell& rDocShell,
break
;
case
'N'
:
nDbType
=
sdbc
::
DataType
::
DECIMAL
;
bTypeDefined
=
TRUE
;
break
;
}
if
(
bTypeDefined
&&
!
nFieldLen
&&
nToken
>
2
)
...
...
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