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
d7baacd8
Kaydet (Commit)
d7baacd8
authored
Şub 13, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#45543 fix RTF import of ms932-encoded characters
üst
8963cc01
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
+21
-6
rtfdocumentimpl.hxx
writerfilter/source/rtftok/rtfdocumentimpl.hxx
+4
-2
No files found.
writerfilter/source/rtftok/rtfdocumentimpl.cxx
Dosyayı görüntüle @
d7baacd8
...
@@ -297,7 +297,8 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
...
@@ -297,7 +297,8 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_bWasInFrame
(
false
),
m_bWasInFrame
(
false
),
m_bIsInFrame
(
false
),
m_bIsInFrame
(
false
),
m_bHasPage
(
false
),
m_bHasPage
(
false
),
m_aUnicodeBuffer
()
m_aUnicodeBuffer
(),
m_aHexBuffer
()
{
{
OSL_ASSERT
(
xInputStream
.
is
());
OSL_ASSERT
(
xInputStream
.
is
());
m_pInStream
.
reset
(
utl
::
UcbStreamHelper
::
CreateStream
(
xInputStream
,
sal_True
));
m_pInStream
.
reset
(
utl
::
UcbStreamHelper
::
CreateStream
(
xInputStream
,
sal_True
));
...
@@ -727,6 +728,9 @@ int RTFDocumentImpl::resolvePict(bool bInline)
...
@@ -727,6 +728,9 @@ int RTFDocumentImpl::resolvePict(bool bInline)
int
RTFDocumentImpl
::
resolveChars
(
char
ch
)
int
RTFDocumentImpl
::
resolveChars
(
char
ch
)
{
{
if
(
m_aStates
.
top
().
nInternalState
!=
INTERNAL_HEX
)
checkUnicode
(
false
,
true
);
OStringBuffer
aBuf
;
OStringBuffer
aBuf
;
bool
bUnicodeChecked
=
false
;
bool
bUnicodeChecked
=
false
;
...
@@ -738,7 +742,7 @@ int RTFDocumentImpl::resolveChars(char ch)
...
@@ -738,7 +742,7 @@ int RTFDocumentImpl::resolveChars(char ch)
{
{
if
(
!
bUnicodeChecked
)
if
(
!
bUnicodeChecked
)
{
{
checkUnicode
();
checkUnicode
(
true
,
false
);
bUnicodeChecked
=
true
;
bUnicodeChecked
=
true
;
}
}
aBuf
.
append
(
ch
);
aBuf
.
append
(
ch
);
...
@@ -753,6 +757,13 @@ int RTFDocumentImpl::resolveChars(char ch)
...
@@ -753,6 +757,13 @@ int RTFDocumentImpl::resolveChars(char ch)
}
}
if
(
m_aStates
.
top
().
nInternalState
!=
INTERNAL_HEX
&&
!
Strm
().
IsEof
())
if
(
m_aStates
.
top
().
nInternalState
!=
INTERNAL_HEX
&&
!
Strm
().
IsEof
())
Strm
().
SeekRel
(
-
1
);
Strm
().
SeekRel
(
-
1
);
if
(
m_aStates
.
top
().
nInternalState
==
INTERNAL_HEX
)
{
m_aHexBuffer
.
append
(
ch
);
return
0
;
}
if
(
m_aStates
.
top
().
nDestinationState
==
DESTINATION_SKIP
)
if
(
m_aStates
.
top
().
nDestinationState
==
DESTINATION_SKIP
)
return
0
;
return
0
;
OString
aStr
=
aBuf
.
makeStringAndClear
();
OString
aStr
=
aBuf
.
makeStringAndClear
();
...
@@ -1980,8 +1991,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
...
@@ -1980,8 +1991,7 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
int
RTFDocumentImpl
::
dispatchValue
(
RTFKeyword
nKeyword
,
int
nParam
)
int
RTFDocumentImpl
::
dispatchValue
(
RTFKeyword
nKeyword
,
int
nParam
)
{
{
if
(
nKeyword
!=
RTF_U
)
checkUnicode
(
nKeyword
!=
RTF_U
,
true
);
checkUnicode
();
RTFSkipDestination
aSkip
(
*
this
);
RTFSkipDestination
aSkip
(
*
this
);
int
nSprm
=
0
;
int
nSprm
=
0
;
RTFValue
::
Pointer_t
pIntValue
(
new
RTFValue
(
nParam
));
RTFValue
::
Pointer_t
pIntValue
(
new
RTFValue
(
nParam
));
...
@@ -3290,13 +3300,18 @@ void RTFDocumentImpl::setSkipUnknown(bool bSkipUnknown)
...
@@ -3290,13 +3300,18 @@ void RTFDocumentImpl::setSkipUnknown(bool bSkipUnknown)
m_bSkipUnknown
=
bSkipUnknown
;
m_bSkipUnknown
=
bSkipUnknown
;
}
}
void
RTFDocumentImpl
::
checkUnicode
()
void
RTFDocumentImpl
::
checkUnicode
(
bool
bUnicode
,
bool
bHex
)
{
{
if
(
m_aUnicodeBuffer
.
getLength
()
>
0
)
if
(
bUnicode
&&
m_aUnicodeBuffer
.
getLength
()
>
0
)
{
{
OUString
aString
=
m_aUnicodeBuffer
.
makeStringAndClear
();
OUString
aString
=
m_aUnicodeBuffer
.
makeStringAndClear
();
text
(
aString
);
text
(
aString
);
}
}
if
(
bHex
&&
m_aHexBuffer
.
getLength
()
>
0
)
{
OUString
aString
=
OStringToOUString
(
m_aHexBuffer
.
makeStringAndClear
(),
m_aStates
.
top
().
nCurrentEncoding
);
text
(
aString
);
}
}
}
RTFParserState
::
RTFParserState
()
RTFParserState
::
RTFParserState
()
...
...
writerfilter/source/rtftok/rtfdocumentimpl.hxx
Dosyayı görüntüle @
d7baacd8
...
@@ -352,8 +352,8 @@ namespace writerfilter {
...
@@ -352,8 +352,8 @@ namespace writerfilter {
void
replayBuffer
(
RTFBuffer_t
&
rBuffer
);
void
replayBuffer
(
RTFBuffer_t
&
rBuffer
);
/// If we got tokens indicating we're in a frame.
/// If we got tokens indicating we're in a frame.
bool
inFrame
();
bool
inFrame
();
/// If we have some unicode characters to send.
/// If we have some unicode
or hex
characters to send.
void
checkUnicode
();
void
checkUnicode
(
bool
bUnicode
=
true
,
bool
bHex
=
true
);
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
m_xContext
;
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
m_xContext
;
uno
::
Reference
<
io
::
XInputStream
>
const
&
m_xInputStream
;
uno
::
Reference
<
io
::
XInputStream
>
const
&
m_xInputStream
;
...
@@ -442,6 +442,8 @@ namespace writerfilter {
...
@@ -442,6 +442,8 @@ namespace writerfilter {
bool
m_bHasPage
;
bool
m_bHasPage
;
// Unicode characters are collected here so we don't have to send them one by one.
// Unicode characters are collected here so we don't have to send them one by one.
rtl
::
OUStringBuffer
m_aUnicodeBuffer
;
rtl
::
OUStringBuffer
m_aUnicodeBuffer
;
/// Same for hex characters.
rtl
::
OStringBuffer
m_aHexBuffer
;
};
};
}
// namespace rtftok
}
// namespace rtftok
}
// namespace writerfilter
}
// namespace writerfilter
...
...
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