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
7b3f9c73
Kaydet (Commit)
7b3f9c73
authored
Eyl 06, 2013
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert SvxAutocorrWord from String to OUString
Change-Id: If06144ebd511653bc7bcf51b2a408e5e1732cb83
üst
11986b61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
svxacorr.cxx
editeng/source/misc/svxacorr.cxx
+15
-13
svxacorr.hxx
include/editeng/svxacorr.hxx
+3
-3
No files found.
editeng/source/misc/svxacorr.cxx
Dosyayı görüntüle @
7b3f9c73
...
...
@@ -2646,7 +2646,7 @@ bool SvxAutocorrWordList::Insert(SvxAutocorrWord *pWord) const
return
maSet
.
insert
(
pWord
).
second
;
}
void
SvxAutocorrWordList
::
LoadEntry
(
String
sWrong
,
String
sRight
,
sal_Bool
bOnlyTxt
)
void
SvxAutocorrWordList
::
LoadEntry
(
const
OUString
&
sWrong
,
const
OUString
&
sRight
,
sal_Bool
bOnlyTxt
)
{
SvxAutocorrWord
*
pNew
=
new
SvxAutocorrWord
(
sWrong
,
sRight
,
bOnlyTxt
);
if
(
!
Insert
(
pNew
)
)
...
...
@@ -2703,7 +2703,7 @@ SvxAutocorrWordList::Content SvxAutocorrWordList::getSortedContent() const
}
const
SvxAutocorrWord
*
SvxAutocorrWordList
::
WordMatches
(
const
SvxAutocorrWord
*
pFnd
,
const
String
&
rTxt
,
const
OU
String
&
rTxt
,
xub_StrLen
&
rStt
,
xub_StrLen
nEndPos
)
const
{
...
...
@@ -2717,19 +2717,19 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
xub_StrLen
nCalcStt
=
nEndPos
-
rChk
.
Len
()
+
left_wildcard
;
if
(
(
!
nCalcStt
||
nCalcStt
==
rStt
||
left_wildcard
||
(
nCalcStt
<
rStt
&&
IsWordDelim
(
rTxt
.
GetChar
(
nCalcStt
-
1
)
)))
)
IsWordDelim
(
rTxt
[
nCalcStt
-
1
]
)))
)
{
TransliterationWrapper
&
rCmp
=
GetIgnoreTranslWrapper
();
OUString
sWord
(
rTxt
.
GetBuffer
()
+
nCalcStt
,
rChk
.
Len
()
-
left_wildcard
);
OUString
sWord
=
rTxt
.
copy
(
nCalcStt
,
rChk
.
Len
()
-
left_wildcard
);
if
(
(
!
left_wildcard
&&
rCmp
.
isEqual
(
rChk
,
sWord
))
||
(
left_wildcard
&&
rCmp
.
isEqual
(
rChk
.
Copy
(
1
),
sWord
)
))
{
rStt
=
nCalcStt
;
if
(
!
left_wildcard
)
return
pFnd
;
// get the first word delimiter position before the matching "*word" pattern
while
(
rStt
&&
!
(
bWasWordDelim
=
IsWordDelim
(
rTxt
.
GetChar
(
--
rStt
)
)))
while
(
rStt
&&
!
(
bWasWordDelim
=
IsWordDelim
(
rTxt
[
--
rStt
]
)))
;
if
(
bWasWordDelim
)
rStt
++
;
SvxAutocorrWord
*
pNew
=
new
SvxAutocorrWord
(
OUString
(
rTxt
.
GetBuffer
()
+
rStt
,
nEndPos
-
rStt
),
OUString
(
rTxt
.
GetBuffer
()
+
rStt
,
nEndPos
-
rStt
-
rChk
.
Len
()
+
1
)
+
OUString
(
pFnd
->
GetLong
()
));
SvxAutocorrWord
*
pNew
=
new
SvxAutocorrWord
(
rTxt
.
copy
(
rStt
,
nEndPos
-
rStt
),
rTxt
.
copy
(
rStt
,
nEndPos
-
rStt
-
rChk
.
Len
()
+
1
)
+
pFnd
->
GetLong
(
));
if
(
Insert
(
pNew
)
)
return
pNew
;
else
delete
pNew
;
}
}
...
...
@@ -2739,18 +2739,20 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
String
sTmp
(
rChk
.
Copy
(
0
,
rChk
.
Len
()
-
1
)
);
// Get the last word delimiter position
bool
not_suffix
;
while
(
nSttWdPos
&&
!
(
bWasWordDelim
=
IsWordDelim
(
rTxt
.
GetChar
(
--
nSttWdPos
)
)))
while
(
nSttWdPos
&&
!
(
bWasWordDelim
=
IsWordDelim
(
rTxt
[
--
nSttWdPos
]
)))
;
// search the first occurance with a left word delimitation
xub_StrLen
nFndPos
=
-
1
;
sal_Int32
nFndPos
=
-
1
;
do
{
nFndPos
=
rTxt
.
Search
(
sTmp
,
nFndPos
+
1
);
nFndPos
=
rTxt
.
indexOf
(
sTmp
,
nFndPos
+
1
);
not_suffix
=
(
bWasWordDelim
&&
(
nSttWdPos
>=
nFndPos
+
sTmp
.
Len
()));
}
while
(
nFndPos
!=
STRING_NOTFOUND
&&
(
!
(
!
nFndPos
||
IsWordDelim
(
rTxt
.
GetChar
(
nFndPos
-
1
)
))
||
not_suffix
));
if
(
nFndPos
!=
STRING_NOTFOUND
)
}
while
(
nFndPos
!=
-
1
&&
(
!
(
!
nFndPos
||
IsWordDelim
(
rTxt
[
nFndPos
-
1
]
))
||
not_suffix
));
if
(
nFndPos
!=
-
1
)
{
// store matching pattern and its replacement as a new list item, eg. "i18ns" -> "internationalizations"
SvxAutocorrWord
*
pNew
=
new
SvxAutocorrWord
(
OUString
(
rTxt
.
GetBuffer
()
+
nFndPos
,
nEndPos
-
nFndPos
+
((
rTxt
.
GetChar
(
nEndPos
)
!=
0x20
)
?
1
:
0
)),
pFnd
->
GetLong
()
+
OUString
(
rTxt
.
GetBuffer
()
+
nFndPos
+
sTmp
.
Len
(),
nEndPos
-
nFndPos
-
sTmp
.
Len
()));
OUString
aShort
=
rTxt
.
copy
(
nFndPos
,
nEndPos
-
nFndPos
+
((
rTxt
[
nEndPos
]
!=
0x20
)
?
1
:
0
));
OUString
aLong
=
pFnd
->
GetLong
()
+
rTxt
.
copy
(
nFndPos
+
sTmp
.
Len
(),
nEndPos
-
nFndPos
-
sTmp
.
Len
());
SvxAutocorrWord
*
pNew
=
new
SvxAutocorrWord
(
aShort
,
aLong
);
if
(
Insert
(
pNew
)
)
{
rStt
=
nFndPos
;
...
...
@@ -2762,7 +2764,7 @@ const SvxAutocorrWord* SvxAutocorrWordList::WordMatches(const SvxAutocorrWord *p
return
NULL
;
}
const
SvxAutocorrWord
*
SvxAutocorrWordList
::
SearchWordsInList
(
const
String
&
rTxt
,
xub_StrLen
&
rStt
,
const
SvxAutocorrWord
*
SvxAutocorrWordList
::
SearchWordsInList
(
const
OU
String
&
rTxt
,
xub_StrLen
&
rStt
,
xub_StrLen
nEndPos
)
const
{
for
(
SvxAutocorrWordList_Hash
::
const_iterator
it
=
maHash
.
begin
();
it
!=
maHash
.
end
();
++
it
)
...
...
include/editeng/svxacorr.hxx
Dosyayı görüntüle @
7b3f9c73
...
...
@@ -150,7 +150,7 @@ class EDITENG_DLLPUBLIC SvxAutocorrWordList
mutable
SvxAutocorrWordList_Hash
maHash
;
// key is 'Short'
const
SvxAutocorrWord
*
WordMatches
(
const
SvxAutocorrWord
*
pFnd
,
const
String
&
rTxt
,
const
OU
String
&
rTxt
,
xub_StrLen
&
rStt
,
xub_StrLen
nEndPos
)
const
;
public
:
...
...
@@ -159,13 +159,13 @@ public:
void
DeleteAndDestroyAll
();
bool
Insert
(
SvxAutocorrWord
*
pWord
)
const
;
SvxAutocorrWord
*
FindAndRemove
(
SvxAutocorrWord
*
pWord
);
void
LoadEntry
(
String
sWrong
,
String
sRight
,
sal_Bool
bOnlyTxt
);
void
LoadEntry
(
const
OUString
&
sWrong
,
const
OUString
&
sRight
,
sal_Bool
bOnlyTxt
);
bool
empty
()
const
;
typedef
std
::
vector
<
SvxAutocorrWord
*>
Content
;
Content
getSortedContent
()
const
;
const
SvxAutocorrWord
*
SearchWordsInList
(
const
String
&
rTxt
,
xub_StrLen
&
rStt
,
xub_StrLen
nEndPos
)
const
;
const
SvxAutocorrWord
*
SearchWordsInList
(
const
OU
String
&
rTxt
,
xub_StrLen
&
rStt
,
xub_StrLen
nEndPos
)
const
;
};
class
EDITENG_DLLPUBLIC
SvxAutoCorrectLanguageLists
...
...
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