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
dba6b515
Kaydet (Commit)
dba6b515
authored
Tem 27, 2012
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix import of nested RTF_MF groups
Change-Id: Ibd4f93663d27d997c44f73e201c355a34d6452d3
üst
fb66fd63
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
13 deletions
+39
-13
math-runs.rtf
sw/qa/extras/rtfexport/data/math-runs.rtf
+12
-0
rtfexport.cxx
sw/qa/extras/rtfexport/rtfexport.cxx
+9
-0
rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
+18
-13
No files found.
sw/qa/extras/rtfexport/data/math-runs.rtf
0 → 100644
Dosyayı görüntüle @
dba6b515
{\rtf1
{\mmath
{\*\moMath
{\rtlch\fcs1 \af31507 \ltrch\fcs0 \i\loch\af34\hich\af34\dbch\af31505\insrsid7024409 \{\hich\af34\dbch\af31505\loch\f34
{\mr\mscr0\msty2
[]()}
}
{\rtlch\fcs1 \af31507 \ltrch\fcs0 \i\f34\insrsid7024409 \}}
}
}
\par
}
sw/qa/extras/rtfexport/rtfexport.cxx
Dosyayı görüntüle @
dba6b515
...
...
@@ -67,6 +67,7 @@ public:
void
testMathSepchr
();
void
testMathSubscripts
();
void
testMathVerticalstacks
();
void
testMathRuns
();
CPPUNIT_TEST_SUITE
(
Test
);
#if !defined(MACOSX) && !defined(WNT)
...
...
@@ -96,6 +97,7 @@ public:
CPPUNIT_TEST
(
testMathSepchr
);
CPPUNIT_TEST
(
testMathSubscripts
);
CPPUNIT_TEST
(
testMathVerticalstacks
);
CPPUNIT_TEST
(
testMathRuns
);
#endif
#endif
CPPUNIT_TEST_SUITE_END
();
...
...
@@ -397,6 +399,13 @@ void Test::testMathVerticalstacks()
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"stack { a # stack { b # c } }"
),
getFormula
(
getRun
(
getParagraph
(
4
),
1
)));
}
void
Test
::
testMathRuns
()
{
roundtrip
(
"math-runs.rtf"
);
// was [](){}, i.e. first curly bracket had an incorrect position
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"
\\
{ left [ right ] left ( right )
\\
}"
),
getFormula
(
getRun
(
getParagraph
(
1
),
1
)));
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
writerfilter/source/rtftok/rtfdocumentimpl.cxx
Dosyayı görüntüle @
dba6b515
...
...
@@ -202,6 +202,19 @@ static util::DateTime lcl_getDateTime(std::stack<RTFParserState>& aStates)
aStates
.
top
().
nDay
,
aStates
.
top
().
nMonth
,
aStates
.
top
().
nYear
);
}
static
void
lcl_DestinationToMath
(
OUStringBuffer
&
rDestinationText
,
oox
::
formulaimport
::
XmlStreamBuilder
&
rMathBuffer
)
{
OUString
aStr
=
rDestinationText
.
makeStringAndClear
();
if
(
!
aStr
.
isEmpty
())
{
rMathBuffer
.
appendOpeningTag
(
M_TOKEN
(
r
));
rMathBuffer
.
appendOpeningTag
(
M_TOKEN
(
t
));
rMathBuffer
.
appendCharacters
(
aStr
);
rMathBuffer
.
appendClosingTag
(
M_TOKEN
(
t
));
rMathBuffer
.
appendClosingTag
(
M_TOKEN
(
r
));
}
}
RTFDocumentImpl
::
RTFDocumentImpl
(
uno
::
Reference
<
uno
::
XComponentContext
>
const
&
xContext
,
uno
::
Reference
<
io
::
XInputStream
>
const
&
xInputStream
,
uno
::
Reference
<
lang
::
XComponent
>
const
&
xDstDoc
,
...
...
@@ -3131,7 +3144,11 @@ int RTFDocumentImpl::pushState()
if
(
m_aStates
.
empty
())
aState
=
m_aDefaultState
;
else
{
if
(
m_aStates
.
top
().
nDestinationState
==
DESTINATION_MR
)
lcl_DestinationToMath
(
m_aStates
.
top
().
aDestinationText
,
m_aMathBuffer
);
aState
=
m_aStates
.
top
();
}
m_aStates
.
push
(
aState
);
m_aStates
.
top
().
aDestinationText
.
setLength
(
0
);
...
...
@@ -3616,19 +3633,7 @@ int RTFDocumentImpl::popState()
m_aMathBuffer
=
oox
::
formulaimport
::
XmlStreamBuilder
();
}
break
;
case
DESTINATION_MR
:
{
OUString
aStr
=
m_aStates
.
top
().
aDestinationText
.
makeStringAndClear
();
if
(
!
aStr
.
isEmpty
())
{
m_aMathBuffer
.
appendOpeningTag
(
M_TOKEN
(
r
));
m_aMathBuffer
.
appendOpeningTag
(
M_TOKEN
(
t
));
m_aMathBuffer
.
appendCharacters
(
aStr
);
m_aMathBuffer
.
appendClosingTag
(
M_TOKEN
(
t
));
m_aMathBuffer
.
appendClosingTag
(
M_TOKEN
(
r
));
}
}
break
;
case
DESTINATION_MR
:
lcl_DestinationToMath
(
m_aStates
.
top
().
aDestinationText
,
m_aMathBuffer
);
break
;
case
DESTINATION_MF
:
m_aMathBuffer
.
appendClosingTag
(
M_TOKEN
(
f
));
break
;
case
DESTINATION_MFPR
:
m_aMathBuffer
.
appendClosingTag
(
M_TOKEN
(
fPr
));
break
;
case
DESTINATION_MCTRLPR
:
m_aMathBuffer
.
appendClosingTag
(
M_TOKEN
(
ctrlPr
));
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