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
b03eab35
Kaydet (Commit)
b03eab35
authored
Eyl 27, 2012
tarafından
Ivan Timofeev
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
String -> OUString
Change-Id: Icdb39e5b5ba38d48f5cc3a4ae371fb77cb981242
üst
77366748
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
18 deletions
+19
-18
visitors.hxx
starmath/inc/visitors.hxx
+7
-12
test_nodetotextvisitors.cxx
starmath/qa/cppunit/test_nodetotextvisitors.cxx
+5
-5
cursor.cxx
starmath/source/cursor.cxx
+1
-1
visitors.cxx
starmath/source/visitors.cxx
+6
-0
No files found.
starmath/inc/visitors.hxx
Dosyayı görüntüle @
b03eab35
...
...
@@ -453,11 +453,9 @@ private:
class
SmNodeToTextVisitor
:
public
SmVisitor
{
public
:
SmNodeToTextVisitor
(
SmNode
*
pNode
,
String
&
rText
)
:
rCmdText
(
rText
)
{
pNode
->
Accept
(
this
);
}
SmNodeToTextVisitor
(
SmNode
*
pNode
,
OUString
&
rText
);
virtual
~
SmNodeToTextVisitor
()
{}
void
Visit
(
SmTableNode
*
pNode
);
void
Visit
(
SmBraceNode
*
pNode
);
void
Visit
(
SmBracebodyNode
*
pNode
);
...
...
@@ -493,19 +491,16 @@ private:
pNode
->
Accept
(
this
);
Separate
(
);
}
inline
void
Append
(
const
sal_Char
*
pCharStr
)
{
rCmdText
.
AppendAscii
(
pCharStr
);
}
inline
void
Append
(
const
String
&
rText
)
{
rCmdText
.
Append
(
rText
);
void
Append
(
const
OUString
&
rText
)
{
aCmdText
.
append
(
rText
);
}
/** Append a blank for separation, if needed */
inline
void
Separate
(
){
if
(
!
rCmdText
.
Len
()
||
rCmdText
.
GetChar
(
rCmdText
.
Len
(
)
-
1
)
!=
' '
)
rCmdText
.
AppendAscii
(
RTL_CONSTASCII_STRINGPARAM
(
" "
)
);
if
(
!
aCmdText
.
getLength
()
||
aCmdText
[
aCmdText
.
getLength
()
-
1
]
!=
' '
)
aCmdText
.
append
(
' '
);
}
/** Output text generated from the pNodes */
String
&
r
CmdText
;
OUStringBuffer
a
CmdText
;
};
#endif
/* SMVISITORS_H */
...
...
starmath/qa/cppunit/test_nodetotextvisitors.cxx
Dosyayı görüntüle @
b03eab35
...
...
@@ -494,11 +494,11 @@ void Test::SimpleSpecialChars()
*/
void
Test
::
parseandparseagain
(
const
char
*
formula
,
const
char
*
test_name
)
{
String
input
,
output1
,
output2
;
OUString
output1
,
output2
;
SmNode
*
pNode1
,
*
pNode2
;
// parse 1
input
.
Append
Ascii
(
formula
);
OUString
input
=
OUString
::
createFrom
Ascii
(
formula
);
pNode1
=
SmParser
().
ParseExpression
(
input
);
pNode1
->
Prepare
(
xDocShRef
->
GetFormat
(),
*
xDocShRef
);
SmNodeToTextVisitor
(
pNode1
,
output1
);
...
...
@@ -519,17 +519,17 @@ void Test::parseandparseagain(const char *formula, const char *test_name)
void
Test
::
ParseAndCheck
(
const
char
*
formula
,
const
char
*
expected
,
const
char
*
test_name
)
{
String
sInput
,
sOutput
,
sExpected
;
OUString
sOutput
;
SmNode
*
pNode
;
// parse
sInput
.
Append
Ascii
(
formula
);
OUString
sInput
=
OUString
::
createFrom
Ascii
(
formula
);
pNode
=
SmParser
().
ParseExpression
(
sInput
);
pNode
->
Prepare
(
xDocShRef
->
GetFormat
(),
*
xDocShRef
);
SmNodeToTextVisitor
(
pNode
,
sOutput
);
// compare
sExpected
.
Append
Ascii
(
expected
);
OUString
sExpected
=
OUString
::
createFrom
Ascii
(
expected
);
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
test_name
,
sExpected
,
sOutput
);
...
...
starmath/source/cursor.cxx
Dosyayı görüntüle @
b03eab35
...
...
@@ -1462,7 +1462,7 @@ void SmCursor::EndEdit(){
RequestRepaint
();
//Update the edit engine and text of the document
String
formula
;
OU
String
formula
;
SmNodeToTextVisitor
(
pTree
,
formula
);
//pTree->CreateTextFromNode(formula);
pDocShell
->
aText
=
formula
;
...
...
starmath/source/visitors.cxx
Dosyayı görüntüle @
b03eab35
...
...
@@ -2117,6 +2117,12 @@ void SmSelectionDrawingVisitor::Visit( SmTextNode* pNode )
/////////////////////////////// SmNodeToTextVisitor ///////////////////////////////
SmNodeToTextVisitor
::
SmNodeToTextVisitor
(
SmNode
*
pNode
,
OUString
&
rText
)
{
pNode
->
Accept
(
this
);
rText
=
aCmdText
.
makeStringAndClear
();
}
void
SmNodeToTextVisitor
::
Visit
(
SmTableNode
*
pNode
)
{
if
(
pNode
->
GetToken
(
).
eType
==
TBINOM
)
{
...
...
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