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
c7da07ad
Kaydet (Commit)
c7da07ad
authored
Ara 24, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
writerfilter: turn RTFInternalState into a C++11 scoped enumeration
Change-Id: I7407aeba6ddcfd783cee508faa6731c59d0b9759
üst
7bdb5894
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
19 deletions
+18
-19
rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
+10
-11
rtflistener.hxx
writerfilter/source/rtftok/rtflistener.hxx
+4
-4
rtflookahead.cxx
writerfilter/source/rtftok/rtflookahead.cxx
+1
-1
rtftokenizer.cxx
writerfilter/source/rtftok/rtftokenizer.cxx
+3
-3
No files found.
writerfilter/source/rtftok/rtfdocumentimpl.cxx
Dosyayı görüntüle @
c7da07ad
...
@@ -997,7 +997,7 @@ RTFError RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing
...
@@ -997,7 +997,7 @@ RTFError RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing
RTFError
RTFDocumentImpl
::
resolveChars
(
char
ch
)
RTFError
RTFDocumentImpl
::
resolveChars
(
char
ch
)
{
{
if
(
m_aStates
.
top
().
nInternalState
==
INTERNAL_
BIN
)
if
(
m_aStates
.
top
().
nInternalState
==
RTFInternalState
::
BIN
)
{
{
m_pBinaryData
.
reset
(
new
SvMemoryStream
());
m_pBinaryData
.
reset
(
new
SvMemoryStream
());
m_pBinaryData
->
WriteChar
(
ch
);
m_pBinaryData
->
WriteChar
(
ch
);
...
@@ -1006,7 +1006,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
...
@@ -1006,7 +1006,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
Strm
().
ReadChar
(
ch
);
Strm
().
ReadChar
(
ch
);
m_pBinaryData
->
WriteChar
(
ch
);
m_pBinaryData
->
WriteChar
(
ch
);
}
}
m_aStates
.
top
().
nInternalState
=
INTERNAL_
NORMAL
;
m_aStates
.
top
().
nInternalState
=
RTFInternalState
::
NORMAL
;
return
RTFError
::
OK
;
return
RTFError
::
OK
;
}
}
...
@@ -1016,10 +1016,9 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
...
@@ -1016,10 +1016,9 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
bool
bUnicodeChecked
=
false
;
bool
bUnicodeChecked
=
false
;
bool
bSkipped
=
false
;
bool
bSkipped
=
false
;
while
(
!
Strm
().
IsEof
()
&&
(
m_aStates
.
top
().
nInternalState
==
INTERNAL_HEX
while
(
!
Strm
().
IsEof
()
&&
(
m_aStates
.
top
().
nInternalState
==
RTFInternalState
::
HEX
||
(
ch
!=
'{'
&&
ch
!=
'}'
&&
ch
!=
'\\'
)))
||
(
ch
!=
'{'
&&
ch
!=
'}'
&&
ch
!=
'\\'
)))
{
{
if
(
m_aStates
.
top
().
nInternalState
==
INTERNAL_
HEX
||
(
ch
!=
0x0d
&&
ch
!=
0x0a
))
if
(
m_aStates
.
top
().
nInternalState
==
RTFInternalState
::
HEX
||
(
ch
!=
0x0d
&&
ch
!=
0x0a
))
{
{
if
(
m_aStates
.
top
().
nCharsToSkip
==
0
)
if
(
m_aStates
.
top
().
nCharsToSkip
==
0
)
{
{
...
@@ -1038,7 +1037,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
...
@@ -1038,7 +1037,7 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
}
}
// read a single char if we're in hex mode
// read a single char if we're in hex mode
if
(
m_aStates
.
top
().
nInternalState
==
INTERNAL_
HEX
)
if
(
m_aStates
.
top
().
nInternalState
==
RTFInternalState
::
HEX
)
break
;
break
;
if
(
RTL_TEXTENCODING_MS_932
==
m_aStates
.
top
().
nCurrentEncoding
)
if
(
RTL_TEXTENCODING_MS_932
==
m_aStates
.
top
().
nCurrentEncoding
)
...
@@ -1067,10 +1066,10 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
...
@@ -1067,10 +1066,10 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
Strm
().
ReadChar
(
ch
);
Strm
().
ReadChar
(
ch
);
}
}
if
(
m_aStates
.
top
().
nInternalState
!=
INTERNAL_
HEX
&&
!
Strm
().
IsEof
())
if
(
m_aStates
.
top
().
nInternalState
!=
RTFInternalState
::
HEX
&&
!
Strm
().
IsEof
())
Strm
().
SeekRel
(
-
1
);
Strm
().
SeekRel
(
-
1
);
if
(
m_aStates
.
top
().
nInternalState
==
INTERNAL_
HEX
&&
m_aStates
.
top
().
nDestinationState
!=
DESTINATION_LEVELNUMBERS
)
if
(
m_aStates
.
top
().
nInternalState
==
RTFInternalState
::
HEX
&&
m_aStates
.
top
().
nDestinationState
!=
DESTINATION_LEVELNUMBERS
)
{
{
if
(
!
bSkipped
)
if
(
!
bSkipped
)
m_aHexBuffer
.
append
(
ch
);
m_aHexBuffer
.
append
(
ch
);
...
@@ -2185,7 +2184,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
...
@@ -2185,7 +2184,7 @@ RTFError RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
}
}
break
;
break
;
case
RTF_HEXCHAR
:
case
RTF_HEXCHAR
:
m_aStates
.
top
().
nInternalState
=
INTERNAL_
HEX
;
m_aStates
.
top
().
nInternalState
=
RTFInternalState
::
HEX
;
break
;
break
;
case
RTF_CELL
:
case
RTF_CELL
:
case
RTF_NESTCELL
:
case
RTF_NESTCELL
:
...
@@ -4526,7 +4525,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
...
@@ -4526,7 +4525,7 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
break
;
break
;
case
RTF_BIN
:
case
RTF_BIN
:
{
{
m_aStates
.
top
().
nInternalState
=
INTERNAL_
BIN
;
m_aStates
.
top
().
nInternalState
=
RTFInternalState
::
BIN
;
m_aStates
.
top
().
nBinaryToRead
=
nParam
;
m_aStates
.
top
().
nBinaryToRead
=
nParam
;
}
}
break
;
break
;
...
@@ -6135,7 +6134,7 @@ void RTFDocumentImpl::checkUnicode(bool bUnicode, bool bHex)
...
@@ -6135,7 +6134,7 @@ void RTFDocumentImpl::checkUnicode(bool bUnicode, bool bHex)
RTFParserState
::
RTFParserState
(
RTFDocumentImpl
*
pDocumentImpl
)
RTFParserState
::
RTFParserState
(
RTFDocumentImpl
*
pDocumentImpl
)
:
m_pDocumentImpl
(
pDocumentImpl
),
:
m_pDocumentImpl
(
pDocumentImpl
),
nInternalState
(
INTERNAL_
NORMAL
),
nInternalState
(
RTFInternalState
::
NORMAL
),
nDestinationState
(
DESTINATION_NORMAL
),
nDestinationState
(
DESTINATION_NORMAL
),
nFieldStatus
(
FIELD_NONE
),
nFieldStatus
(
FIELD_NONE
),
nBorderState
(
BORDER_NONE
),
nBorderState
(
BORDER_NONE
),
...
...
writerfilter/source/rtftok/rtflistener.hxx
Dosyayı görüntüle @
c7da07ad
...
@@ -16,11 +16,11 @@ namespace writerfilter
...
@@ -16,11 +16,11 @@ namespace writerfilter
{
{
namespace
rtftok
namespace
rtftok
{
{
enum
RTFInternalState
enum
class
RTFInternalState
{
{
INTERNAL_
NORMAL
,
NORMAL
,
INTERNAL_
BIN
,
BIN
,
INTERNAL_
HEX
HEX
};
};
enum
class
RTFError
enum
class
RTFError
...
...
writerfilter/source/rtftok/rtflookahead.cxx
Dosyayı görüntüle @
c7da07ad
...
@@ -93,7 +93,7 @@ void RTFLookahead::setDestinationState(RTFDestinationState /*nDestinationState*/
...
@@ -93,7 +93,7 @@ void RTFLookahead::setDestinationState(RTFDestinationState /*nDestinationState*/
RTFInternalState
RTFLookahead
::
getInternalState
()
RTFInternalState
RTFLookahead
::
getInternalState
()
{
{
return
INTERNAL_
NORMAL
;
return
RTFInternalState
::
NORMAL
;
}
}
void
RTFLookahead
::
setInternalState
(
RTFInternalState
/*nInternalState*/
)
void
RTFLookahead
::
setInternalState
(
RTFInternalState
/*nInternalState*/
)
...
...
writerfilter/source/rtftok/rtftokenizer.cxx
Dosyayı görüntüle @
c7da07ad
...
@@ -88,7 +88,7 @@ RTFError RTFTokenizer::resolveParse()
...
@@ -88,7 +88,7 @@ RTFError RTFTokenizer::resolveParse()
if
(
m_nGroup
<
0
)
if
(
m_nGroup
<
0
)
return
RTFError
::
GROUP_UNDER
;
return
RTFError
::
GROUP_UNDER
;
if
(
m_nGroup
>
0
&&
m_rImport
.
getInternalState
()
==
INTERNAL_
BIN
)
if
(
m_nGroup
>
0
&&
m_rImport
.
getInternalState
()
==
RTFInternalState
::
BIN
)
{
{
ret
=
m_rImport
.
resolveChars
(
ch
);
ret
=
m_rImport
.
resolveChars
(
ch
);
if
(
ret
!=
RTFError
::
OK
)
if
(
ret
!=
RTFError
::
OK
)
...
@@ -129,7 +129,7 @@ RTFError RTFTokenizer::resolveParse()
...
@@ -129,7 +129,7 @@ RTFError RTFTokenizer::resolveParse()
default
:
default
:
if
(
m_nGroup
==
0
)
if
(
m_nGroup
==
0
)
return
RTFError
::
CHAR_OVER
;
return
RTFError
::
CHAR_OVER
;
if
(
m_rImport
.
getInternalState
()
==
INTERNAL_
NORMAL
)
if
(
m_rImport
.
getInternalState
()
==
RTFInternalState
::
NORMAL
)
{
{
ret
=
m_rImport
.
resolveChars
(
ch
);
ret
=
m_rImport
.
resolveChars
(
ch
);
if
(
ret
!=
RTFError
::
OK
)
if
(
ret
!=
RTFError
::
OK
)
...
@@ -151,7 +151,7 @@ RTFError RTFTokenizer::resolveParse()
...
@@ -151,7 +151,7 @@ RTFError RTFTokenizer::resolveParse()
return
ret
;
return
ret
;
count
=
2
;
count
=
2
;
b
=
0
;
b
=
0
;
m_rImport
.
setInternalState
(
INTERNAL_
NORMAL
);
m_rImport
.
setInternalState
(
RTFInternalState
::
NORMAL
);
}
}
}
}
break
;
break
;
...
...
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