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
54ec7849
Kaydet (Commit)
54ec7849
authored
Ara 31, 2013
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
starmath: whitespace fixes in wordexportbase
Change-Id: Ie0756d882347912f4beb38dde25ff6d598766a7b
üst
19b99af0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
48 deletions
+48
-48
wordexportbase.cxx
starmath/source/wordexportbase.cxx
+48
-48
No files found.
starmath/source/wordexportbase.cxx
Dosyayı görüntüle @
54ec7849
...
@@ -12,8 +12,8 @@
...
@@ -12,8 +12,8 @@
#include <rtl/ustring.hxx>
#include <rtl/ustring.hxx>
SmWordExportBase
::
SmWordExportBase
(
const
SmNode
*
pIn
)
SmWordExportBase
::
SmWordExportBase
(
const
SmNode
*
pIn
)
:
m_pTree
(
pIn
)
:
m_pTree
(
pIn
)
{
{
}
}
...
@@ -21,41 +21,41 @@ SmWordExportBase::~SmWordExportBase()
...
@@ -21,41 +21,41 @@ SmWordExportBase::~SmWordExportBase()
{
{
}
}
void
SmWordExportBase
::
HandleNode
(
const
SmNode
*
pNode
,
int
nLevel
)
void
SmWordExportBase
::
HandleNode
(
const
SmNode
*
pNode
,
int
nLevel
)
{
{
SAL_INFO
(
"starmath.wordbase"
,
"Node: "
<<
nLevel
<<
" "
<<
int
(
pNode
->
GetType
())
<<
" "
<<
pNode
->
GetNumSubNodes
());
SAL_INFO
(
"starmath.wordbase"
,
"Node: "
<<
nLevel
<<
" "
<<
int
(
pNode
->
GetType
())
<<
" "
<<
pNode
->
GetNumSubNodes
());
switch
(
pNode
->
GetType
())
switch
(
pNode
->
GetType
())
{
{
case
NATTRIBUT
:
case
NATTRIBUT
:
HandleAttribute
(
static_cast
<
const
SmAttributNode
*
>
(
pNode
),
nLevel
);
HandleAttribute
(
static_cast
<
const
SmAttributNode
*
>
(
pNode
),
nLevel
);
break
;
break
;
case
NTEXT
:
case
NTEXT
:
HandleText
(
pNode
,
nLevel
);
HandleText
(
pNode
,
nLevel
);
break
;
break
;
case
NVERTICAL_BRACE
:
case
NVERTICAL_BRACE
:
HandleVerticalBrace
(
static_cast
<
const
SmVerticalBraceNode
*
>
(
pNode
),
nLevel
);
HandleVerticalBrace
(
static_cast
<
const
SmVerticalBraceNode
*
>
(
pNode
),
nLevel
);
break
;
break
;
case
NBRACE
:
case
NBRACE
:
HandleBrace
(
static_cast
<
const
SmBraceNode
*
>
(
pNode
),
nLevel
);
HandleBrace
(
static_cast
<
const
SmBraceNode
*
>
(
pNode
),
nLevel
);
break
;
break
;
case
NOPER
:
case
NOPER
:
HandleOperator
(
static_cast
<
const
SmOperNode
*
>
(
pNode
),
nLevel
);
HandleOperator
(
static_cast
<
const
SmOperNode
*
>
(
pNode
),
nLevel
);
break
;
break
;
case
NUNHOR
:
case
NUNHOR
:
HandleUnaryOperation
(
static_cast
<
const
SmUnHorNode
*
>
(
pNode
),
nLevel
);
HandleUnaryOperation
(
static_cast
<
const
SmUnHorNode
*
>
(
pNode
),
nLevel
);
break
;
break
;
case
NBINHOR
:
case
NBINHOR
:
HandleBinaryOperation
(
static_cast
<
const
SmBinHorNode
*
>
(
pNode
),
nLevel
);
HandleBinaryOperation
(
static_cast
<
const
SmBinHorNode
*
>
(
pNode
),
nLevel
);
break
;
break
;
case
NBINVER
:
case
NBINVER
:
HandleFractions
(
pNode
,
nLevel
);
HandleFractions
(
pNode
,
nLevel
);
break
;
break
;
case
NROOT
:
case
NROOT
:
HandleRoot
(
static_cast
<
const
SmRootNode
*
>
(
pNode
),
nLevel
);
HandleRoot
(
static_cast
<
const
SmRootNode
*
>
(
pNode
),
nLevel
);
break
;
break
;
case
NSPECIAL
:
case
NSPECIAL
:
{
{
const
SmTextNode
*
pText
=
static_cast
<
const
SmTextNode
*
>
(
pNode
);
const
SmTextNode
*
pText
=
static_cast
<
const
SmTextNode
*
>
(
pNode
);
//if the token str and the result text are the same then this
//if the token str and the result text are the same then this
//is to be seen as text, else assume it's a mathchar
//is to be seen as text, else assume it's a mathchar
if
(
pText
->
GetText
()
==
pText
->
GetToken
().
aText
)
if
(
pText
->
GetText
()
==
pText
->
GetToken
().
aText
)
...
@@ -69,22 +69,22 @@ void SmWordExportBase::HandleNode( const SmNode* pNode, int nLevel )
...
@@ -69,22 +69,22 @@ void SmWordExportBase::HandleNode( const SmNode* pNode, int nLevel )
HandleMath
(
pNode
,
nLevel
);
HandleMath
(
pNode
,
nLevel
);
break
;
break
;
case
NSUBSUP
:
case
NSUBSUP
:
HandleSubSupScript
(
static_cast
<
const
SmSubSupNode
*
>
(
pNode
),
nLevel
);
HandleSubSupScript
(
static_cast
<
const
SmSubSupNode
*
>
(
pNode
),
nLevel
);
break
;
break
;
case
NEXPRESSION
:
case
NEXPRESSION
:
HandleAllSubNodes
(
pNode
,
nLevel
);
HandleAllSubNodes
(
pNode
,
nLevel
);
break
;
break
;
case
NTABLE
:
case
NTABLE
:
//Root Node, PILE equivalent, i.e. vertical stack
//Root Node, PILE equivalent, i.e. vertical stack
HandleTable
(
pNode
,
nLevel
);
HandleTable
(
pNode
,
nLevel
);
break
;
break
;
case
NMATRIX
:
case
NMATRIX
:
HandleMatrix
(
static_cast
<
const
SmMatrixNode
*
>
(
pNode
),
nLevel
);
HandleMatrix
(
static_cast
<
const
SmMatrixNode
*
>
(
pNode
),
nLevel
);
break
;
break
;
case
NLINE
:
case
NLINE
:
{
{
// TODO
// TODO
HandleAllSubNodes
(
pNode
,
nLevel
);
HandleAllSubNodes
(
pNode
,
nLevel
);
}
}
break
;
break
;
#if 0
#if 0
...
@@ -99,13 +99,13 @@ void SmWordExportBase::HandleNode( const SmNode* pNode, int nLevel )
...
@@ -99,13 +99,13 @@ void SmWordExportBase::HandleNode( const SmNode* pNode, int nLevel )
HandleBlank
();
HandleBlank
();
break
;
break
;
default
:
default
:
HandleAllSubNodes
(
pNode
,
nLevel
);
HandleAllSubNodes
(
pNode
,
nLevel
);
break
;
break
;
}
}
}
}
//Root Node, PILE equivalent, i.e. vertical stack
//Root Node, PILE equivalent, i.e. vertical stack
void
SmWordExportBase
::
HandleTable
(
const
SmNode
*
pNode
,
int
nLevel
)
void
SmWordExportBase
::
HandleTable
(
const
SmNode
*
pNode
,
int
nLevel
)
{
{
//The root of the starmath is a table, if
//The root of the starmath is a table, if
//we convert this them each iteration of
//we convert this them each iteration of
...
@@ -113,82 +113,82 @@ void SmWordExportBase::HandleTable( const SmNode* pNode, int nLevel )
...
@@ -113,82 +113,82 @@ void SmWordExportBase::HandleTable( const SmNode* pNode, int nLevel )
//add an extra unnecessary level to the
//add an extra unnecessary level to the
//Word output stack which would grow
//Word output stack which would grow
//without bound in a multi step conversion
//without bound in a multi step conversion
if
(
nLevel
||
pNode
->
GetNumSubNodes
()
>
1
)
if
(
nLevel
||
pNode
->
GetNumSubNodes
()
>
1
)
HandleVerticalStack
(
pNode
,
nLevel
);
HandleVerticalStack
(
pNode
,
nLevel
);
else
else
HandleAllSubNodes
(
pNode
,
nLevel
);
HandleAllSubNodes
(
pNode
,
nLevel
);
}
}
void
SmWordExportBase
::
HandleAllSubNodes
(
const
SmNode
*
pNode
,
int
nLevel
)
void
SmWordExportBase
::
HandleAllSubNodes
(
const
SmNode
*
pNode
,
int
nLevel
)
{
{
int
size
=
pNode
->
GetNumSubNodes
();
int
size
=
pNode
->
GetNumSubNodes
();
for
(
int
i
=
0
;
for
(
int
i
=
0
;
i
<
size
;
i
<
size
;
++
i
)
++
i
)
{
{
// TODO remove when all types of nodes are handled properly
// TODO remove when all types of nodes are handled properly
if
(
pNode
->
GetSubNode
(
i
)
==
NULL
)
if
(
pNode
->
GetSubNode
(
i
)
==
NULL
)
{
{
SAL_WARN
(
"starmath.wordbase"
,
"Subnode is NULL, parent node not handled properly"
);
SAL_WARN
(
"starmath.wordbase"
,
"Subnode is NULL, parent node not handled properly"
);
continue
;
continue
;
}
}
HandleNode
(
pNode
->
GetSubNode
(
i
),
nLevel
+
1
);
HandleNode
(
pNode
->
GetSubNode
(
i
),
nLevel
+
1
);
}
}
}
}
void
SmWordExportBase
::
HandleUnaryOperation
(
const
SmUnHorNode
*
pNode
,
int
nLevel
)
void
SmWordExportBase
::
HandleUnaryOperation
(
const
SmUnHorNode
*
pNode
,
int
nLevel
)
{
{
// update HandleMath() when adding new items
// update HandleMath() when adding new items
SAL_INFO
(
"starmath.wordbase"
,
"Unary: "
<<
int
(
pNode
->
GetToken
().
eType
));
SAL_INFO
(
"starmath.wordbase"
,
"Unary: "
<<
int
(
pNode
->
GetToken
().
eType
));
// Avoid MSVC warning C4065: switch statement contains 'default' but no 'case' labels
// Avoid MSVC warning C4065: switch statement contains 'default' but no 'case' labels
// switch( pNode->GetToken().eType )
// switch( pNode->GetToken().eType )
// {
// {
// default:
// default:
HandleAllSubNodes
(
pNode
,
nLevel
);
HandleAllSubNodes
(
pNode
,
nLevel
);
// break;
// break;
// }
// }
}
}
void
SmWordExportBase
::
HandleBinaryOperation
(
const
SmBinHorNode
*
pNode
,
int
nLevel
)
void
SmWordExportBase
::
HandleBinaryOperation
(
const
SmBinHorNode
*
pNode
,
int
nLevel
)
{
{
SAL_INFO
(
"starmath.wordbase"
,
"Binary: "
<<
int
(
pNode
->
Symbol
()
->
GetToken
().
eType
));
SAL_INFO
(
"starmath.wordbase"
,
"Binary: "
<<
int
(
pNode
->
Symbol
()
->
GetToken
().
eType
));
// update HandleMath() when adding new items
// update HandleMath() when adding new items
switch
(
pNode
->
Symbol
()
->
GetToken
().
eType
)
switch
(
pNode
->
Symbol
()
->
GetToken
().
eType
)
{
{
case
TDIVIDEBY
:
case
TDIVIDEBY
:
return
HandleFractions
(
pNode
,
nLevel
,
"lin"
);
return
HandleFractions
(
pNode
,
nLevel
,
"lin"
);
default
:
default
:
HandleAllSubNodes
(
pNode
,
nLevel
);
HandleAllSubNodes
(
pNode
,
nLevel
);
break
;
break
;
}
}
}
}
void
SmWordExportBase
::
HandleMath
(
const
SmNode
*
pNode
,
int
nLevel
)
void
SmWordExportBase
::
HandleMath
(
const
SmNode
*
pNode
,
int
nLevel
)
{
{
SAL_INFO
(
"starmath.wordbase"
,
"Math: "
<<
int
(
pNode
->
GetToken
().
eType
));
SAL_INFO
(
"starmath.wordbase"
,
"Math: "
<<
int
(
pNode
->
GetToken
().
eType
));
switch
(
pNode
->
GetToken
().
eType
)
switch
(
pNode
->
GetToken
().
eType
)
{
{
case
TDIVIDEBY
:
case
TDIVIDEBY
:
case
TACUTE
:
case
TACUTE
:
// these are handled elsewhere, e.g. when handling BINHOR
// these are handled elsewhere, e.g. when handling BINHOR
OSL_ASSERT
(
false
);
OSL_ASSERT
(
false
);
default
:
default
:
HandleText
(
pNode
,
nLevel
);
HandleText
(
pNode
,
nLevel
);
break
;
break
;
}
}
}
}
void
SmWordExportBase
::
HandleSubSupScript
(
const
SmSubSupNode
*
pNode
,
int
nLevel
)
void
SmWordExportBase
::
HandleSubSupScript
(
const
SmSubSupNode
*
pNode
,
int
nLevel
)
{
{
// set flags to a bitfield of which sub/sup items exists
// set flags to a bitfield of which sub/sup items exists
int
flags
=
(
pNode
->
GetSubSup
(
CSUB
)
!=
NULL
?
(
1
<<
CSUB
)
:
0
)
int
flags
=
(
pNode
->
GetSubSup
(
CSUB
)
!=
NULL
?
(
1
<<
CSUB
)
:
0
)
|
(
pNode
->
GetSubSup
(
CSUP
)
!=
NULL
?
(
1
<<
CSUP
)
:
0
)
|
(
pNode
->
GetSubSup
(
CSUP
)
!=
NULL
?
(
1
<<
CSUP
)
:
0
)
|
(
pNode
->
GetSubSup
(
RSUB
)
!=
NULL
?
(
1
<<
RSUB
)
:
0
)
|
(
pNode
->
GetSubSup
(
RSUB
)
!=
NULL
?
(
1
<<
RSUB
)
:
0
)
|
(
pNode
->
GetSubSup
(
RSUP
)
!=
NULL
?
(
1
<<
RSUP
)
:
0
)
|
(
pNode
->
GetSubSup
(
RSUP
)
!=
NULL
?
(
1
<<
RSUP
)
:
0
)
|
(
pNode
->
GetSubSup
(
LSUB
)
!=
NULL
?
(
1
<<
LSUB
)
:
0
)
|
(
pNode
->
GetSubSup
(
LSUB
)
!=
NULL
?
(
1
<<
LSUB
)
:
0
)
|
(
pNode
->
GetSubSup
(
LSUP
)
!=
NULL
?
(
1
<<
LSUP
)
:
0
);
|
(
pNode
->
GetSubSup
(
LSUP
)
!=
NULL
?
(
1
<<
LSUP
)
:
0
);
HandleSubSupScriptInternal
(
pNode
,
nLevel
,
flags
);
HandleSubSupScriptInternal
(
pNode
,
nLevel
,
flags
);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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