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
3d1360ba
Kaydet (Commit)
3d1360ba
authored
Tem 26, 2013
tarafından
Ivan Timofeev
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String -> OUString, sal_Bool -> bool
Change-Id: I078599f1c109f85ff6ba5895c31912d5def98c27
üst
35b64000
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
38 deletions
+33
-38
gloslst.hxx
sw/source/ui/inc/gloslst.hxx
+8
-8
gloslst.cxx
sw/source/ui/utlui/gloslst.cxx
+25
-30
No files found.
sw/source/ui/inc/gloslst.hxx
Dosyayı görüntüle @
3d1360ba
...
@@ -30,11 +30,11 @@ class vector;
...
@@ -30,11 +30,11 @@ class vector;
struct
AutoTextGroup
struct
AutoTextGroup
{
{
sal_uInt16
nCount
;
sal_uInt16
nCount
;
String
sName
;
OUString
sName
;
String
sTitle
;
OUString
sTitle
;
String
sLongNames
;
// by 0x0A separated long names
OUString
sLongNames
;
// by 0x0A separated long names
String
sShortNames
;
// by 0x0A separated short names
OUString
sShortNames
;
// by 0x0A separated short names
DateTime
aDateModified
;
DateTime
aDateModified
;
AutoTextGroup
()
:
aDateModified
(
DateTime
::
EMPTY
)
{}
AutoTextGroup
()
:
aDateModified
(
DateTime
::
EMPTY
)
{}
...
@@ -46,10 +46,10 @@ typedef std::vector<AutoTextGroup*> AutoTextGroups;
...
@@ -46,10 +46,10 @@ typedef std::vector<AutoTextGroup*> AutoTextGroups;
class
SwGlossaryList
:
public
AutoTimer
class
SwGlossaryList
:
public
AutoTimer
{
{
AutoTextGroups
aGroupArr
;
AutoTextGroups
aGroupArr
;
String
sPath
;
OUString
sPath
;
sal_B
ool
bFilled
;
b
ool
bFilled
;
AutoTextGroup
*
FindGroup
(
const
String
&
rGroupName
);
AutoTextGroup
*
FindGroup
(
const
OU
String
&
rGroupName
);
void
FillGroup
(
AutoTextGroup
*
pGroup
,
SwGlossaries
*
pGloss
);
void
FillGroup
(
AutoTextGroup
*
pGroup
,
SwGlossaries
*
pGloss
);
public
:
public
:
...
...
sw/source/ui/utlui/gloslst.cxx
Dosyayı görüntüle @
3d1360ba
...
@@ -94,7 +94,7 @@ IMPL_LINK_NOARG(SwGlossDecideDlg, SelectHdl)
...
@@ -94,7 +94,7 @@ IMPL_LINK_NOARG(SwGlossDecideDlg, SelectHdl)
}
}
SwGlossaryList
::
SwGlossaryList
()
:
SwGlossaryList
::
SwGlossaryList
()
:
bFilled
(
sal_F
alse
)
bFilled
(
f
alse
)
{
{
SvtPathOptions
aPathOpt
;
SvtPathOptions
aPathOpt
;
sPath
=
aPathOpt
.
GetAutoTextPath
();
sPath
=
aPathOpt
.
GetAutoTextPath
();
...
@@ -128,14 +128,14 @@ sal_Bool SwGlossaryList::GetShortName(const String& rLongName,
...
@@ -128,14 +128,14 @@ sal_Bool SwGlossaryList::GetShortName(const String& rLongName,
for
(
sal_uInt16
j
=
0
;
j
<
pGroup
->
nCount
;
j
++
)
for
(
sal_uInt16
j
=
0
;
j
<
pGroup
->
nCount
;
j
++
)
{
{
String
sLong
=
pGroup
->
sLongNames
.
G
etToken
(
j
,
STRING_DELIM
);
OUString
sLong
=
pGroup
->
sLongNames
.
g
etToken
(
j
,
STRING_DELIM
);
if
(
rLongName
!=
sLong
)
if
(
rLongName
!=
sLong
)
continue
;
continue
;
TripleString
pTriple
;
TripleString
pTriple
;
pTriple
.
sGroup
=
pGroup
->
sName
;
pTriple
.
sGroup
=
pGroup
->
sName
;
pTriple
.
sBlock
=
sLong
;
pTriple
.
sBlock
=
sLong
;
pTriple
.
sShort
=
pGroup
->
sShortNames
.
G
etToken
(
j
,
STRING_DELIM
);
pTriple
.
sShort
=
pGroup
->
sShortNames
.
g
etToken
(
j
,
STRING_DELIM
);
aTripleStrings
.
push_back
(
pTriple
);
aTripleStrings
.
push_back
(
pTriple
);
++
nFound
;
++
nFound
;
}
}
...
@@ -153,9 +153,7 @@ sal_Bool SwGlossaryList::GetShortName(const String& rLongName,
...
@@ -153,9 +153,7 @@ sal_Bool SwGlossaryList::GetShortName(const String& rLongName,
else
if
(
1
<
nCount
)
else
if
(
1
<
nCount
)
{
{
SwGlossDecideDlg
aDlg
(
0
);
SwGlossDecideDlg
aDlg
(
0
);
String
sTitle
=
aDlg
.
GetText
();
OUString
sTitle
=
aDlg
.
GetText
()
+
" "
+
aTripleStrings
.
front
().
sBlock
;
sTitle
+=
' '
;
sTitle
+=
aTripleStrings
.
front
().
sBlock
;
aDlg
.
SetText
(
sTitle
);
aDlg
.
SetText
(
sTitle
);
ListBox
&
rLB
=
aDlg
.
GetListBox
();
ListBox
&
rLB
=
aDlg
.
GetListBox
();
...
@@ -226,7 +224,7 @@ OUString SwGlossaryList::GetBlockLongName(sal_uInt16 nGroup, sal_uInt16 nBlock)
...
@@ -226,7 +224,7 @@ OUString SwGlossaryList::GetBlockLongName(sal_uInt16 nGroup, sal_uInt16 nBlock)
if
(
nGroup
<
aGroupArr
.
size
())
if
(
nGroup
<
aGroupArr
.
size
())
{
{
AutoTextGroup
*
pGroup
=
aGroupArr
[
nGroup
];
AutoTextGroup
*
pGroup
=
aGroupArr
[
nGroup
];
return
pGroup
->
sLongNames
.
G
etToken
(
nBlock
,
STRING_DELIM
);
return
pGroup
->
sLongNames
.
g
etToken
(
nBlock
,
STRING_DELIM
);
}
}
return
OUString
();
return
OUString
();
}
}
...
@@ -237,7 +235,7 @@ OUString SwGlossaryList::GetBlockShortName(sal_uInt16 nGroup, sal_uInt16 nBlock)
...
@@ -237,7 +235,7 @@ OUString SwGlossaryList::GetBlockShortName(sal_uInt16 nGroup, sal_uInt16 nBlock)
if
(
nGroup
<
aGroupArr
.
size
())
if
(
nGroup
<
aGroupArr
.
size
())
{
{
AutoTextGroup
*
pGroup
=
aGroupArr
[
nGroup
];
AutoTextGroup
*
pGroup
=
aGroupArr
[
nGroup
];
return
pGroup
->
sShortNames
.
G
etToken
(
nBlock
,
STRING_DELIM
);
return
pGroup
->
sShortNames
.
g
etToken
(
nBlock
,
STRING_DELIM
);
}
}
return
OUString
();
return
OUString
();
}
}
...
@@ -248,11 +246,11 @@ void SwGlossaryList::Update()
...
@@ -248,11 +246,11 @@ void SwGlossaryList::Update()
Start
();
Start
();
SvtPathOptions
aPathOpt
;
SvtPathOptions
aPathOpt
;
String
sTemp
(
aPathOpt
.
GetAutoTextPath
()
);
OU
String
sTemp
(
aPathOpt
.
GetAutoTextPath
()
);
if
(
sTemp
!=
sPath
)
if
(
sTemp
!=
sPath
)
{
{
sPath
=
sTemp
;
sPath
=
sTemp
;
bFilled
=
sal_F
alse
;
bFilled
=
f
alse
;
ClearGroups
();
ClearGroups
();
}
}
SwGlossaries
*
pGlossaries
=
::
GetGlossaries
();
SwGlossaries
*
pGlossaries
=
::
GetGlossaries
();
...
@@ -263,19 +261,16 @@ void SwGlossaryList::Update()
...
@@ -263,19 +261,16 @@ void SwGlossaryList::Update()
sal_uInt16
nGroupCount
=
pGlossaries
->
GetGroupCnt
();
sal_uInt16
nGroupCount
=
pGlossaries
->
GetGroupCnt
();
for
(
sal_uInt16
i
=
0
;
i
<
nGroupCount
;
i
++
)
for
(
sal_uInt16
i
=
0
;
i
<
nGroupCount
;
i
++
)
{
{
String
sGrpName
=
pGlossaries
->
GetGroupName
(
i
);
OU
String
sGrpName
=
pGlossaries
->
GetGroupName
(
i
);
sal_uInt16
nPath
=
(
sal_uInt16
)
sGrpName
.
GetToken
(
1
,
GLOS_DELIM
).
T
oInt32
();
sal_uInt16
nPath
=
(
sal_uInt16
)
sGrpName
.
getToken
(
1
,
GLOS_DELIM
).
t
oInt32
();
if
(
static_cast
<
size_t
>
(
nPath
)
<
rPathArr
.
size
()
)
if
(
static_cast
<
size_t
>
(
nPath
)
<
rPathArr
.
size
()
)
{
{
AutoTextGroup
*
pGroup
=
new
AutoTextGroup
;
AutoTextGroup
*
pGroup
=
new
AutoTextGroup
;
pGroup
->
sName
=
sGrpName
;
pGroup
->
sName
=
sGrpName
;
FillGroup
(
pGroup
,
pGlossaries
);
FillGroup
(
pGroup
,
pGlossaries
);
String
sName
=
rPathArr
[
nPath
];
OUString
sName
=
rPathArr
[
nPath
]
+
OUString
(
INET_PATH_TOKEN
)
+
sName
+=
INET_PATH_TOKEN
;
pGroup
->
sName
.
getToken
(
0
,
GLOS_DELIM
)
+
sExt
;
sName
+=
pGroup
->
sName
.
GetToken
(
0
,
GLOS_DELIM
);
sName
+=
sExt
;
FStatHelper
::
GetModifiedDateTimeOfFile
(
sName
,
FStatHelper
::
GetModifiedDateTimeOfFile
(
sName
,
&
pGroup
->
aDateModified
,
&
pGroup
->
aDateModified
,
&
pGroup
->
aDateModified
);
&
pGroup
->
aDateModified
);
...
@@ -283,7 +278,7 @@ void SwGlossaryList::Update()
...
@@ -283,7 +278,7 @@ void SwGlossaryList::Update()
aGroupArr
.
insert
(
aGroupArr
.
begin
(),
pGroup
);
aGroupArr
.
insert
(
aGroupArr
.
begin
(),
pGroup
);
}
}
}
}
bFilled
=
sal_T
rue
;
bFilled
=
t
rue
;
}
}
else
else
{
{
...
@@ -300,10 +295,10 @@ void SwGlossaryList::Update()
...
@@ -300,10 +295,10 @@ void SwGlossaryList::Update()
String
*
pTitle
=
aFiles
[
nFiles
];
String
*
pTitle
=
aFiles
[
nFiles
];
::
DateTime
*
pDT
=
(
::
DateTime
*
)
aDateTimeArr
[
static_cast
<
sal_uInt16
>
(
nFiles
)
];
::
DateTime
*
pDT
=
(
::
DateTime
*
)
aDateTimeArr
[
static_cast
<
sal_uInt16
>
(
nFiles
)
];
String
sName
(
pTitle
->
Copy
(
0
,
pTitle
->
Len
()
-
sExt
.
Len
()
));
OU
String
sName
(
pTitle
->
Copy
(
0
,
pTitle
->
Len
()
-
sExt
.
Len
()
));
aFoundGroupNames
.
push_back
(
sName
);
aFoundGroupNames
.
push_back
(
sName
);
sName
+=
GLOS_DELIM
;
sName
+=
OUString
(
GLOS_DELIM
)
;
sName
+=
OUString
::
number
(
static_cast
<
sal_uInt16
>
(
nPath
)
);
sName
+=
OUString
::
number
(
static_cast
<
sal_uInt16
>
(
nPath
)
);
AutoTextGroup
*
pFound
=
FindGroup
(
sName
);
AutoTextGroup
*
pFound
=
FindGroup
(
sName
);
if
(
!
pFound
)
if
(
!
pFound
)
...
@@ -331,14 +326,14 @@ void SwGlossaryList::Update()
...
@@ -331,14 +326,14 @@ void SwGlossaryList::Update()
{
{
// maybe remove deleted groups
// maybe remove deleted groups
AutoTextGroup
*
pGroup
=
aGroupArr
[
i
-
1
];
AutoTextGroup
*
pGroup
=
aGroupArr
[
i
-
1
];
sal_uInt16
nGroupPath
=
(
sal_uInt16
)
pGroup
->
sName
.
G
etToken
(
1
,
sal_uInt16
nGroupPath
=
(
sal_uInt16
)
pGroup
->
sName
.
g
etToken
(
1
,
GLOS_DELIM
).
T
oInt32
();
GLOS_DELIM
).
t
oInt32
();
// Only the groups will be checked which are registered
// Only the groups will be checked which are registered
// for the current subpath.
// for the current subpath.
if
(
nGroupPath
==
static_cast
<
sal_uInt16
>
(
nPath
)
)
if
(
nGroupPath
==
static_cast
<
sal_uInt16
>
(
nPath
)
)
{
{
bool
bFound
=
false
;
bool
bFound
=
false
;
String
sCompareGroup
=
pGroup
->
sName
.
G
etToken
(
0
,
GLOS_DELIM
);
OUString
sCompareGroup
=
pGroup
->
sName
.
g
etToken
(
0
,
GLOS_DELIM
);
for
(
std
::
vector
<
String
>::
const_iterator
j
=
aFoundGroupNames
.
begin
();
j
!=
aFoundGroupNames
.
end
()
&&
!
bFound
;
++
j
)
for
(
std
::
vector
<
String
>::
const_iterator
j
=
aFoundGroupNames
.
begin
();
j
!=
aFoundGroupNames
.
end
()
&&
!
bFound
;
++
j
)
bFound
=
(
sCompareGroup
==
*
j
);
bFound
=
(
sCompareGroup
==
*
j
);
...
@@ -360,7 +355,7 @@ void SwGlossaryList::Timeout()
...
@@ -360,7 +355,7 @@ void SwGlossaryList::Timeout()
Update
();
Update
();
}
}
AutoTextGroup
*
SwGlossaryList
::
FindGroup
(
const
String
&
rGroupName
)
AutoTextGroup
*
SwGlossaryList
::
FindGroup
(
const
OU
String
&
rGroupName
)
{
{
for
(
sal_uInt16
i
=
0
;
i
<
aGroupArr
.
size
();
i
++
)
for
(
sal_uInt16
i
=
0
;
i
<
aGroupArr
.
size
();
i
++
)
{
{
...
@@ -382,9 +377,9 @@ void SwGlossaryList::FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGlossaries)
...
@@ -382,9 +377,9 @@ void SwGlossaryList::FillGroup(AutoTextGroup* pGroup, SwGlossaries* pGlossaries)
for
(
sal_uInt16
j
=
0
;
j
<
pGroup
->
nCount
;
j
++
)
for
(
sal_uInt16
j
=
0
;
j
<
pGroup
->
nCount
;
j
++
)
{
{
pGroup
->
sLongNames
+=
pBlock
->
GetLongName
(
j
);
pGroup
->
sLongNames
+=
pBlock
->
GetLongName
(
j
);
pGroup
->
sLongNames
+=
STRING_DELIM
;
pGroup
->
sLongNames
+=
OUString
(
STRING_DELIM
)
;
pGroup
->
sShortNames
+=
pBlock
->
GetShortName
(
j
);
pGroup
->
sShortNames
+=
pBlock
->
GetShortName
(
j
);
pGroup
->
sShortNames
+=
STRING_DELIM
;
pGroup
->
sShortNames
+=
OUString
(
STRING_DELIM
)
;
}
}
pGlossaries
->
PutGroupDoc
(
pBlock
);
pGlossaries
->
PutGroupDoc
(
pBlock
);
}
}
...
@@ -406,9 +401,9 @@ bool SwGlossaryList::HasLongName(const String& rBegin, std::vector<String> *pLon
...
@@ -406,9 +401,9 @@ bool SwGlossaryList::HasLongName(const String& rBegin, std::vector<String> *pLon
AutoTextGroup
*
pGroup
=
aGroupArr
[
i
];
AutoTextGroup
*
pGroup
=
aGroupArr
[
i
];
for
(
sal_uInt16
j
=
0
;
j
<
pGroup
->
nCount
;
j
++
)
for
(
sal_uInt16
j
=
0
;
j
<
pGroup
->
nCount
;
j
++
)
{
{
String
sBlock
=
pGroup
->
sLongNames
.
G
etToken
(
j
,
STRING_DELIM
);
OUString
sBlock
=
pGroup
->
sLongNames
.
g
etToken
(
j
,
STRING_DELIM
);
if
(
rSCmp
.
isEqual
(
sBlock
.
Copy
(
0
,
nBeginLen
),
rBegin
)
&&
if
(
nBeginLen
+
1
<
sBlock
.
getLength
(
)
&&
nBeginLen
+
1
<
sBlock
.
Len
(
))
rSCmp
.
isEqual
(
sBlock
.
copy
(
0
,
nBeginLen
),
rBegin
))
{
{
pLongNames
->
push_back
(
sBlock
);
pLongNames
->
push_back
(
sBlock
);
nFound
++
;
nFound
++
;
...
@@ -427,7 +422,7 @@ void SwGlossaryList::ClearGroups()
...
@@ -427,7 +422,7 @@ void SwGlossaryList::ClearGroups()
delete
aGroupArr
[
i
];
delete
aGroupArr
[
i
];
aGroupArr
.
clear
();
aGroupArr
.
clear
();
bFilled
=
sal_F
alse
;
bFilled
=
f
alse
;
}
}
...
...
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