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
1ccd386c
Kaydet (Commit)
1ccd386c
authored
Eki 25, 2014
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use USHRT_MAX consistently, minor cleanups
Change-Id: I1a2906a350baf7af7141aaa6124930485578a604
üst
ff61e912
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
19 deletions
+20
-19
SwXMLTextBlocks.cxx
sw/source/core/swg/SwXMLTextBlocks.cxx
+3
-3
swblocks.cxx
sw/source/core/swg/swblocks.cxx
+17
-16
No files found.
sw/source/core/swg/SwXMLTextBlocks.cxx
Dosyayı görüntüle @
1ccd386c
...
@@ -155,7 +155,7 @@ void SwXMLTextBlocks::AddName( const OUString& rShort, const OUString& rLong,
...
@@ -155,7 +155,7 @@ void SwXMLTextBlocks::AddName( const OUString& rShort, const OUString& rLong,
const
OUString
&
rPackageName
,
bool
bOnlyTxt
)
const
OUString
&
rPackageName
,
bool
bOnlyTxt
)
{
{
sal_uInt16
nIdx
=
GetIndex
(
rShort
);
sal_uInt16
nIdx
=
GetIndex
(
rShort
);
if
(
nIdx
!=
(
sal_uInt16
)
-
1
)
if
(
nIdx
!=
USHRT_MAX
)
{
{
delete
aNames
[
nIdx
];
delete
aNames
[
nIdx
];
aNames
.
erase
(
aNames
.
begin
()
+
nIdx
);
aNames
.
erase
(
aNames
.
begin
()
+
nIdx
);
...
@@ -500,7 +500,7 @@ void SwXMLTextBlocks::CloseFile()
...
@@ -500,7 +500,7 @@ void SwXMLTextBlocks::CloseFile()
void
SwXMLTextBlocks
::
SetIsTextOnly
(
const
OUString
&
rShort
,
bool
bNewValue
)
void
SwXMLTextBlocks
::
SetIsTextOnly
(
const
OUString
&
rShort
,
bool
bNewValue
)
{
{
sal_uInt16
nIdx
=
GetIndex
(
rShort
);
sal_uInt16
nIdx
=
GetIndex
(
rShort
);
if
(
nIdx
!=
(
sal_uInt16
)
-
1
&&
nIdx
!=
USHRT_MAX
)
if
(
nIdx
!=
USHRT_MAX
)
aNames
[
nIdx
]
->
bIsOnlyTxt
=
bNewValue
;
aNames
[
nIdx
]
->
bIsOnlyTxt
=
bNewValue
;
}
}
...
@@ -513,7 +513,7 @@ bool SwXMLTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const
...
@@ -513,7 +513,7 @@ bool SwXMLTextBlocks::IsOnlyTextBlock( const OUString& rShort ) const
{
{
sal_uInt16
nIdx
=
GetIndex
(
rShort
);
sal_uInt16
nIdx
=
GetIndex
(
rShort
);
bool
bRet
=
false
;
bool
bRet
=
false
;
if
(
nIdx
!=
(
sal_uInt16
)
-
1
&&
nIdx
!=
USHRT_MAX
)
if
(
nIdx
!=
USHRT_MAX
)
{
{
bRet
=
aNames
[
nIdx
]
->
bIsOnlyTxt
;
bRet
=
aNames
[
nIdx
]
->
bIsOnlyTxt
;
}
}
...
...
sw/source/core/swg/swblocks.cxx
Dosyayı görüntüle @
1ccd386c
...
@@ -90,7 +90,7 @@ SwImpBlocks::SwImpBlocks( const OUString& rFile, bool )
...
@@ -90,7 +90,7 @@ SwImpBlocks::SwImpBlocks( const OUString& rFile, bool )
:
aFile
(
rFile
),
:
aFile
(
rFile
),
aDateModified
(
Date
::
EMPTY
),
aDateModified
(
Date
::
EMPTY
),
aTimeModified
(
tools
::
Time
::
EMPTY
),
aTimeModified
(
tools
::
Time
::
EMPTY
),
pDoc
(
0
),
nCur
(
(
sal_uInt16
)
-
1
),
pDoc
(
0
),
nCur
(
USHRT_MAX
),
bReadOnly
(
true
),
bInPutMuchBlocks
(
false
),
bReadOnly
(
true
),
bInPutMuchBlocks
(
false
),
bInfoChanged
(
false
)
bInfoChanged
(
false
)
{
{
...
@@ -146,7 +146,7 @@ sal_uInt16 SwImpBlocks::GetIndex( const OUString& rShort ) const
...
@@ -146,7 +146,7 @@ sal_uInt16 SwImpBlocks::GetIndex( const OUString& rShort ) const
&&
pName
->
aShort
==
s
)
&&
pName
->
aShort
==
s
)
return
i
;
return
i
;
}
}
return
(
sal_uInt16
)
-
1
;
return
USHRT_MAX
;
}
}
sal_uInt16
SwImpBlocks
::
GetLongIndex
(
const
OUString
&
rLong
)
const
sal_uInt16
SwImpBlocks
::
GetLongIndex
(
const
OUString
&
rLong
)
const
...
@@ -159,7 +159,7 @@ sal_uInt16 SwImpBlocks::GetLongIndex( const OUString& rLong ) const
...
@@ -159,7 +159,7 @@ sal_uInt16 SwImpBlocks::GetLongIndex( const OUString& rLong ) const
&&
pName
->
aLong
==
rLong
)
&&
pName
->
aLong
==
rLong
)
return
i
;
return
i
;
}
}
return
(
sal_uInt16
)
-
1
;
return
USHRT_MAX
;
}
}
OUString
SwImpBlocks
::
GetShortName
(
sal_uInt16
n
)
const
OUString
SwImpBlocks
::
GetShortName
(
sal_uInt16
n
)
const
...
@@ -187,7 +187,7 @@ void SwImpBlocks::AddName( const OUString& rShort, const OUString& rLong,
...
@@ -187,7 +187,7 @@ void SwImpBlocks::AddName( const OUString& rShort, const OUString& rLong,
bool
bOnlyTxt
)
bool
bOnlyTxt
)
{
{
sal_uInt16
nIdx
=
GetIndex
(
rShort
);
sal_uInt16
nIdx
=
GetIndex
(
rShort
);
if
(
nIdx
!=
(
sal_uInt16
)
-
1
)
if
(
nIdx
!=
USHRT_MAX
)
{
{
delete
aNames
[
nIdx
];
delete
aNames
[
nIdx
];
aNames
.
erase
(
aNames
.
begin
()
+
nIdx
);
aNames
.
erase
(
aNames
.
begin
()
+
nIdx
);
...
@@ -280,12 +280,12 @@ sal_uInt16 SwTextBlocks::GetCount() const
...
@@ -280,12 +280,12 @@ sal_uInt16 SwTextBlocks::GetCount() const
sal_uInt16
SwTextBlocks
::
GetIndex
(
const
OUString
&
r
)
const
sal_uInt16
SwTextBlocks
::
GetIndex
(
const
OUString
&
r
)
const
{
{
return
pImp
?
pImp
->
GetIndex
(
r
)
:
(
sal_uInt16
)
-
1
;
return
pImp
?
pImp
->
GetIndex
(
r
)
:
USHRT_MAX
;
}
}
sal_uInt16
SwTextBlocks
::
GetLongIndex
(
const
OUString
&
r
)
const
sal_uInt16
SwTextBlocks
::
GetLongIndex
(
const
OUString
&
r
)
const
{
{
return
pImp
?
(
sal_uInt16
)(
pImp
->
GetLongIndex
(
r
))
:
(
sal_uInt16
)
-
1
;
return
pImp
?
pImp
->
GetLongIndex
(
r
)
:
USHRT_MAX
;
}
}
OUString
SwTextBlocks
::
GetShortName
(
sal_uInt16
n
)
const
OUString
SwTextBlocks
::
GetShortName
(
sal_uInt16
n
)
const
...
@@ -317,7 +317,7 @@ bool SwTextBlocks::Delete( sal_uInt16 n )
...
@@ -317,7 +317,7 @@ bool SwTextBlocks::Delete( sal_uInt16 n )
pImp
->
aNames
.
erase
(
pImp
->
aNames
.
begin
()
+
n
);
pImp
->
aNames
.
erase
(
pImp
->
aNames
.
begin
()
+
n
);
}
}
if
(
n
==
pImp
->
nCur
)
if
(
n
==
pImp
->
nCur
)
pImp
->
nCur
=
(
sal_uInt16
)
-
1
;
pImp
->
nCur
=
USHRT_MAX
;
if
(
!
nErr
)
if
(
!
nErr
)
nErr
=
pImp
->
MakeBlockList
();
nErr
=
pImp
->
MakeBlockList
();
}
}
...
@@ -331,7 +331,7 @@ bool SwTextBlocks::Delete( sal_uInt16 n )
...
@@ -331,7 +331,7 @@ bool SwTextBlocks::Delete( sal_uInt16 n )
sal_uInt16
SwTextBlocks
::
Rename
(
sal_uInt16
n
,
const
OUString
*
s
,
const
OUString
*
l
)
sal_uInt16
SwTextBlocks
::
Rename
(
sal_uInt16
n
,
const
OUString
*
s
,
const
OUString
*
l
)
{
{
sal_uInt16
nIdx
=
(
sal_uInt16
)
-
1
;
sal_uInt16
nIdx
=
USHRT_MAX
;
if
(
pImp
&&
!
pImp
->
bInPutMuchBlocks
)
if
(
pImp
&&
!
pImp
->
bInPutMuchBlocks
)
{
{
pImp
->
nCur
=
nIdx
;
pImp
->
nCur
=
nIdx
;
...
@@ -344,7 +344,8 @@ sal_uInt16 SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString
...
@@ -344,7 +344,8 @@ sal_uInt16 SwTextBlocks::Rename( sal_uInt16 n, const OUString* s, const OUString
if
(
aNew
.
isEmpty
()
)
if
(
aNew
.
isEmpty
()
)
{
{
OSL_ENSURE
(
false
,
"No short name provided in the rename"
);
OSL_ENSURE
(
false
,
"No short name provided in the rename"
);
nErr
=
ERR_SWG_INTERNAL_ERROR
;
return
(
sal_uInt16
)
-
1
;
nErr
=
ERR_SWG_INTERNAL_ERROR
;
return
USHRT_MAX
;
}
}
if
(
pImp
->
IsFileChanged
()
)
if
(
pImp
->
IsFileChanged
()
)
...
@@ -401,7 +402,7 @@ bool SwTextBlocks::BeginGetDoc( sal_uInt16 n )
...
@@ -401,7 +402,7 @@ bool SwTextBlocks::BeginGetDoc( sal_uInt16 n )
pImp
->
ClearDoc
();
pImp
->
ClearDoc
();
nErr
=
pImp
->
GetDoc
(
n
);
nErr
=
pImp
->
GetDoc
(
n
);
if
(
nErr
)
if
(
nErr
)
pImp
->
nCur
=
(
sal_uInt16
)
-
1
;
pImp
->
nCur
=
USHRT_MAX
;
else
else
pImp
->
nCur
=
n
;
pImp
->
nCur
=
n
;
}
}
...
@@ -442,14 +443,14 @@ bool SwTextBlocks::BeginPutDoc( const OUString& s, const OUString& l )
...
@@ -442,14 +443,14 @@ bool SwTextBlocks::BeginPutDoc( const OUString& s, const OUString& l )
sal_uInt16
SwTextBlocks
::
PutDoc
()
sal_uInt16
SwTextBlocks
::
PutDoc
()
{
{
sal_uInt16
nIdx
=
(
sal_uInt16
)
-
1
;
sal_uInt16
nIdx
=
USHRT_MAX
;
if
(
pImp
)
if
(
pImp
)
{
{
nErr
=
pImp
->
PutDoc
();
nErr
=
pImp
->
PutDoc
();
if
(
!
nErr
)
if
(
!
nErr
)
{
{
pImp
->
nCur
=
GetIndex
(
pImp
->
aShort
);
pImp
->
nCur
=
GetIndex
(
pImp
->
aShort
);
if
(
pImp
->
nCur
!=
(
sal_uInt16
)
-
1
)
if
(
pImp
->
nCur
!=
USHRT_MAX
)
pImp
->
aNames
[
pImp
->
nCur
]
->
aLong
=
pImp
->
aLong
;
pImp
->
aNames
[
pImp
->
nCur
]
->
aLong
=
pImp
->
aLong
;
else
else
{
{
...
@@ -472,7 +473,7 @@ sal_uInt16 SwTextBlocks::PutDoc()
...
@@ -472,7 +473,7 @@ sal_uInt16 SwTextBlocks::PutDoc()
sal_uInt16
SwTextBlocks
::
PutText
(
const
OUString
&
rShort
,
const
OUString
&
rName
,
sal_uInt16
SwTextBlocks
::
PutText
(
const
OUString
&
rShort
,
const
OUString
&
rName
,
const
OUString
&
rTxt
)
const
OUString
&
rTxt
)
{
{
sal_uInt16
nIdx
=
(
sal_uInt16
)
-
1
;
sal_uInt16
nIdx
=
USHRT_MAX
;
if
(
pImp
)
if
(
pImp
)
{
{
bool
bOk
=
pImp
->
bInPutMuchBlocks
;
bool
bOk
=
pImp
->
bInPutMuchBlocks
;
...
@@ -488,11 +489,11 @@ sal_uInt16 SwTextBlocks::PutText( const OUString& rShort, const OUString& rName,
...
@@ -488,11 +489,11 @@ sal_uInt16 SwTextBlocks::PutText( const OUString& rShort, const OUString& rName,
{
{
OUString
aNew
=
GetAppCharClass
().
uppercase
(
rShort
);
OUString
aNew
=
GetAppCharClass
().
uppercase
(
rShort
);
nErr
=
pImp
->
PutText
(
aNew
,
rName
,
rTxt
);
nErr
=
pImp
->
PutText
(
aNew
,
rName
,
rTxt
);
pImp
->
nCur
=
(
sal_uInt16
)
-
1
;
pImp
->
nCur
=
USHRT_MAX
;
if
(
!
nErr
)
if
(
!
nErr
)
{
{
nIdx
=
GetIndex
(
pImp
->
aShort
);
nIdx
=
GetIndex
(
pImp
->
aShort
);
if
(
nIdx
!=
(
sal_uInt16
)
-
1
)
if
(
nIdx
!=
USHRT_MAX
)
pImp
->
aNames
[
nIdx
]
->
aLong
=
rName
;
pImp
->
aNames
[
nIdx
]
->
aLong
=
rName
;
else
else
{
{
...
@@ -524,7 +525,7 @@ void SwTextBlocks::ClearDoc()
...
@@ -524,7 +525,7 @@ void SwTextBlocks::ClearDoc()
if
(
pImp
)
if
(
pImp
)
{
{
pImp
->
ClearDoc
();
pImp
->
ClearDoc
();
pImp
->
nCur
=
(
sal_uInt16
)
-
1
;
pImp
->
nCur
=
USHRT_MAX
;
}
}
}
}
...
...
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