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
f8c14e81
Kaydet (Commit)
f8c14e81
authored
Eyl 04, 2015
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
TablreRef: always use SetTableColumnName() to prevent duplicates
Change-Id: Ifbdd9b0c3d8e6f41c4d1eb4d0e62053a8788e05d
üst
bc77f2c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
13 deletions
+19
-13
dbdata.cxx
sc/source/core/tool/dbdata.cxx
+19
-13
No files found.
sc/source/core/tool/dbdata.cxx
Dosyayı görüntüle @
f8c14e81
...
...
@@ -738,12 +738,21 @@ private:
};
/** Set a numbered table column name at given nIndex, preventing duplicates,
numbering starting at nCount. No check whether nIndex is valid. */
void
SetTableColumnName
(
::
std
::
vector
<
OUString
>&
rVec
,
size_t
nIndex
,
const
OUString
&
rName
,
sal_Int32
nCount
)
numbering starting at nCount. If nCount==0 then the first attempt is made
with an unnumbered name and if already present the next attempt with
nCount=2, so "Original" and "Original2". No check whether nIndex is valid. */
void
SetTableColumnName
(
::
std
::
vector
<
OUString
>&
rVec
,
size_t
nIndex
,
const
OUString
&
rName
,
size_t
nCount
)
{
OUString
aStr
;
do
{
OUString
aStr
(
rName
+
OUString
::
number
(
nCount
));
if
(
nCount
)
aStr
=
rName
+
OUString
::
number
(
nCount
);
else
{
aStr
=
rName
;
++
nCount
;
}
auto
it
(
::
std
::
find_if
(
rVec
.
begin
(),
rVec
.
end
(),
TableColumnNameSearch
(
aStr
)));
if
(
it
==
rVec
.
end
())
{
...
...
@@ -773,11 +782,14 @@ void ScDBData::RefreshTableColumnNames( ScDocument* pDoc )
if
(
pCell
->
hasString
())
{
const
OUString
&
rStr
=
pCell
->
getString
(
pDoc
);
aNewNames
[
nCol
-
nStartCol
]
=
rStr
;
if
(
rStr
.
isEmpty
())
bHaveEmpty
=
true
;
else
if
(
nLastColFilled
<
nCol
-
1
)
bHaveEmpty
=
true
;
else
{
SetTableColumnName
(
aNewNames
,
nCol
-
nStartCol
,
rStr
,
0
);
if
(
nLastColFilled
<
nCol
-
1
)
bHaveEmpty
=
true
;
}
nLastColFilled
=
nCol
;
}
else
...
...
@@ -799,13 +811,7 @@ void ScDBData::RefreshTableColumnNames( ScDocument* pDoc )
if
(
rStr
.
isEmpty
())
bHaveEmpty
=
true
;
else
{
auto
it
(
::
std
::
find_if
(
aNewNames
.
begin
(),
aNewNames
.
end
(),
TableColumnNameSearch
(
rStr
)));
if
(
it
==
aNewNames
.
end
())
aNewNames
[
i
]
=
rStr
;
else
bHaveEmpty
=
true
;
}
SetTableColumnName
(
aNewNames
,
i
,
rStr
,
0
);
}
}
}
...
...
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