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
571e8eba
Kaydet (Commit)
571e8eba
authored
Eyl 28, 2013
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String to OUString + helper function
Change-Id: I9a318c50bc2427f55f58a13f96cbcb68fbc66f21
üst
92caee2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
docfld.cxx
sw/source/core/doc/docfld.cxx
+16
-12
No files found.
sw/source/core/doc/docfld.cxx
Dosyayı görüntüle @
571e8eba
...
...
@@ -1922,35 +1922,39 @@ void SwDoc::ChangeDBFields( const std::vector<String>& rOldNames,
SetModified
();
}
namespace
{
inline
OUString
lcl_CutOffDBCommandType
(
const
OUString
&
rName
)
{
return
rName
.
replaceFirst
(
OUString
(
DB_DELIM
),
"."
).
getToken
(
0
,
DB_DELIM
);
}
}
void
SwDoc
::
ReplaceUsedDBs
(
const
std
::
vector
<
String
>&
rUsedDBNames
,
const
String
&
rNewName
,
OUString
&
rFormel
)
{
const
CharClass
&
rCC
=
GetAppCharClass
();
String
sNewName
(
rNewName
);
sNewName
.
SearchAndReplace
(
DB_DELIM
,
'.'
);
//the command type is not part of the condition
sNewName
=
sNewName
.
GetToken
(
0
,
DB_DELIM
);
const
OUString
sNewName
(
lcl_CutOffDBCommandType
(
rNewName
)
);
for
(
sal_uInt16
i
=
0
;
i
<
rUsedDBNames
.
size
();
++
i
)
{
String
sDBName
(
rUsedDBNames
[
i
]
);
const
OUString
sDBName
(
lcl_CutOffDBCommandType
(
rUsedDBNames
[
i
])
);
sDBName
.
SearchAndReplace
(
DB_DELIM
,
'.'
);
//cut off command type
sDBName
=
sDBName
.
GetToken
(
0
,
DB_DELIM
);
if
(
!
sDBName
.
Equals
(
sNewName
))
if
(
sDBName
!=
sNewName
)
{
sal_Int32
nPos
=
0
;
while
((
nPos
=
rFormel
.
indexOf
(
sDBName
,
nPos
))
>=
0
)
{
if
(
rFormel
[
nPos
+
sDBName
.
Len
()]
==
'.'
&&
if
(
rFormel
[
nPos
+
sDBName
.
getLength
()]
==
'.'
&&
(
!
nPos
||
!
rCC
.
isLetterNumeric
(
rFormel
,
nPos
-
1
)))
{
rFormel
=
rFormel
.
replaceAt
(
nPos
,
sDBName
.
Len
(),
sNewName
);
rFormel
=
rFormel
.
replaceAt
(
nPos
,
sDBName
.
getLength
(),
sNewName
);
//prevent re-searching - this is useless and provokes
//endless loops when names containing each other and numbers are exchanged
//e.g.: old ?12345.12345 new: i12345.12345
nPos
=
nPos
+
sNewName
.
Len
();
nPos
=
nPos
+
sNewName
.
getLength
();
}
}
}
...
...
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