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
c49faa14
Kaydet (Commit)
c49faa14
authored
Agu 31, 2014
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Use enumeration directly
Change-Id: I5b537bb863eafa9e508c7298c611b0d1c0145d77
üst
a048b088
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
14 deletions
+16
-14
scriptinfo.hxx
sw/source/core/inc/scriptinfo.hxx
+10
-8
porlay.cxx
sw/source/core/text/porlay.cxx
+6
-6
No files found.
sw/source/core/inc/scriptinfo.hxx
Dosyayı görüntüle @
c49faa14
...
@@ -35,6 +35,9 @@ typedef std::list< sal_Int32 > PositionList;
...
@@ -35,6 +35,9 @@ typedef std::list< sal_Int32 > PositionList;
// encapsultes information about script changes
// encapsultes information about script changes
class
SwScriptInfo
class
SwScriptInfo
{
{
public
:
enum
CompType
{
KANA
,
SPECIAL_LEFT
,
SPECIAL_RIGHT
,
NONE
};
private
:
private
:
//! Records a single change in script type.
//! Records a single change in script type.
struct
ScriptChangeInfo
struct
ScriptChangeInfo
...
@@ -64,10 +67,14 @@ private:
...
@@ -64,10 +67,14 @@ private:
{
{
sal_Int32
position
;
//!< Character position where the change occurs.
sal_Int32
position
;
//!< Character position where the change occurs.
sal_Int32
length
;
//!< Length of the segment.
sal_Int32
length
;
//!< Length of the segment.
sal_uInt8
type
;
//!< Type of compression that we change to.
CompType
type
;
//!< Type of compression that we change to.
inline
CompressionChangeInfo
(
sal_Int32
pos
,
sal_Int32
len
,
sal_uInt8
typ
)
:
position
(
pos
),
length
(
len
),
type
(
typ
)
{};
inline
CompressionChangeInfo
(
sal_Int32
pos
,
sal_Int32
len
,
CompType
typ
)
:
position
(
pos
),
length
(
len
),
type
(
typ
)
{};
};
};
std
::
vector
<
CompressionChangeInfo
>
aCompressionChanges
;
std
::
vector
<
CompressionChangeInfo
>
aCompressionChanges
;
#ifdef DBG_UTIL
CompType
DbgCompType
(
const
sal_Int32
nPos
)
const
;
#endif
sal_Int32
nInvalidityPos
;
sal_Int32
nInvalidityPos
;
sal_uInt8
nDefaultDir
;
sal_uInt8
nDefaultDir
;
...
@@ -83,7 +90,6 @@ private:
...
@@ -83,7 +90,6 @@ private:
size_t
HasKana
(
sal_Int32
nStart
,
const
sal_Int32
nEnd
)
const
;
size_t
HasKana
(
sal_Int32
nStart
,
const
sal_Int32
nEnd
)
const
;
public
:
public
:
enum
CompType
{
KANA
,
SPECIAL_LEFT
,
SPECIAL_RIGHT
,
NONE
};
SwScriptInfo
();
SwScriptInfo
();
~
SwScriptInfo
();
~
SwScriptInfo
();
...
@@ -153,7 +159,7 @@ public:
...
@@ -153,7 +159,7 @@ public:
OSL_ENSURE
(
nCnt
<
aCompressionChanges
.
size
(),
"No CompressionLen today!"
);
OSL_ENSURE
(
nCnt
<
aCompressionChanges
.
size
(),
"No CompressionLen today!"
);
return
aCompressionChanges
[
nCnt
].
length
;
return
aCompressionChanges
[
nCnt
].
length
;
}
}
sal_uInt8
GetCompType
(
const
size_t
nCnt
)
const
CompType
GetCompType
(
const
size_t
nCnt
)
const
{
{
OSL_ENSURE
(
nCnt
<
aCompressionChanges
.
size
(),
"No CompressionType today!"
);
OSL_ENSURE
(
nCnt
<
aCompressionChanges
.
size
(),
"No CompressionType today!"
);
return
aCompressionChanges
[
nCnt
].
type
;
return
aCompressionChanges
[
nCnt
].
type
;
...
@@ -181,10 +187,6 @@ public:
...
@@ -181,10 +187,6 @@ public:
const
sal_uInt8
*
pLevel
=
0
)
const
;
const
sal_uInt8
*
pLevel
=
0
)
const
;
sal_uInt8
DirType
(
const
sal_Int32
nPos
)
const
;
sal_uInt8
DirType
(
const
sal_Int32
nPos
)
const
;
#ifdef DBG_UTIL
sal_uInt8
CompType
(
const
sal_Int32
nPos
)
const
;
#endif
// HIDDEN TEXT STUFF START
// HIDDEN TEXT STUFF START
/** Hidden text range information - static and non-version
/** Hidden text range information - static and non-version
...
...
sw/source/core/text/porlay.cxx
Dosyayı görüntüle @
c49faa14
...
@@ -856,8 +856,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, bool bRTL )
...
@@ -856,8 +856,8 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, bool bRTL )
if
(
CHARCOMPRESS_NONE
!=
aCompEnum
&&
if
(
CHARCOMPRESS_NONE
!=
aCompEnum
&&
i18n
::
ScriptType
::
ASIAN
==
nScript
)
i18n
::
ScriptType
::
ASIAN
==
nScript
)
{
{
sal_uInt8
ePrevState
=
NONE
;
CompType
ePrevState
=
NONE
;
sal_uInt8
eState
;
CompType
eState
=
NONE
;
sal_Int32
nPrevChg
=
nLastCompression
;
sal_Int32
nPrevChg
=
nLastCompression
;
while
(
nLastCompression
<
nChg
)
while
(
nLastCompression
<
nChg
)
...
@@ -881,7 +881,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, bool bRTL )
...
@@ -881,7 +881,7 @@ void SwScriptInfo::InitScriptInfo( const SwTxtNode& rNode, bool bRTL )
eState
=
SPECIAL_RIGHT
;
eState
=
SPECIAL_RIGHT
;
break
;
break
;
default
:
default
:
eState
=
static_cast
<
sal_uInt8
>
(
(
0x3040
<=
cChar
&&
0x3100
>
cChar
)
?
KANA
:
NONE
)
;
eState
=
(
0x3040
<=
cChar
&&
0x3100
>
cChar
)
?
KANA
:
NONE
;
}
}
// insert range of compressable characters
// insert range of compressable characters
...
@@ -1468,7 +1468,7 @@ bool SwScriptInfo::IsInHiddenRange( const SwTxtNode& rNode, sal_Int32 nPos )
...
@@ -1468,7 +1468,7 @@ bool SwScriptInfo::IsInHiddenRange( const SwTxtNode& rNode, sal_Int32 nPos )
#ifdef DBG_UTIL
#ifdef DBG_UTIL
// returns the type of the compressed character
// returns the type of the compressed character
sal_uInt8
SwScriptInfo
::
CompType
(
const
sal_Int32
nPos
)
const
SwScriptInfo
::
CompType
SwScriptInfo
::
Dbg
CompType
(
const
sal_Int32
nPos
)
const
{
{
const
size_t
nEnd
=
CountCompChg
();
const
size_t
nEnd
=
CountCompChg
();
for
(
size_t
nX
=
0
;
nX
<
nEnd
;
++
nX
)
for
(
size_t
nX
=
0
;
nX
<
nEnd
;
++
nX
)
...
@@ -1545,9 +1545,9 @@ long SwScriptInfo::Compress( long* pKernArray, sal_Int32 nIdx, sal_Int32 nLen,
...
@@ -1545,9 +1545,9 @@ long SwScriptInfo::Compress( long* pKernArray, sal_Int32 nIdx, sal_Int32 nLen,
long
nLast
=
nI
?
pKernArray
[
nI
-
1
]
:
0
;
long
nLast
=
nI
?
pKernArray
[
nI
-
1
]
:
0
;
do
do
{
{
const
sal_uInt8
nType
=
GetCompType
(
nCompIdx
);
const
CompType
nType
=
GetCompType
(
nCompIdx
);
#ifdef DBG_UTIL
#ifdef DBG_UTIL
SAL_WARN_IF
(
nType
!=
CompType
(
nIdx
),
"sw.core"
,
"Gimme the right type!"
);
SAL_WARN_IF
(
nType
!=
Dbg
CompType
(
nIdx
),
"sw.core"
,
"Gimme the right type!"
);
#endif
#endif
nCompLen
+=
nIdx
;
nCompLen
+=
nIdx
;
if
(
nCompLen
>
nLen
)
if
(
nCompLen
>
nLen
)
...
...
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