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
1a4c6931
Kaydet (Commit)
1a4c6931
authored
Agu 18, 2011
tarafından
Luboš Luňák
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
implement sub/sup support for ooxml math export
üst
efb9c900
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
76 additions
and
3 deletions
+76
-3
node.hxx
starmath/inc/node.hxx
+1
-0
ooxml.cxx
starmath/source/ooxml.cxx
+73
-3
ooxml.hxx
starmath/source/ooxml.hxx
+2
-0
No files found.
starmath/inc/node.hxx
Dosyayı görüntüle @
1a4c6931
...
...
@@ -964,6 +964,7 @@ public:
* @remarks this method may return NULL.
*/
SmNode
*
GetSubSup
(
SmSubSup
eSubSup
)
{
return
GetSubNode
(
sal
::
static_int_cast
<
sal_uInt16
>
(
1
+
eSubSup
)
);
};
const
SmNode
*
GetSubSup
(
SmSubSup
eSubSup
)
const
{
return
const_cast
<
SmSubSupNode
*
>
(
this
)
->
GetSubSup
(
eSubSup
);
}
/** Set the body */
void
SetBody
(
SmNode
*
pBody
)
{
SetSubNode
(
0
,
pBody
);
}
...
...
starmath/source/ooxml.cxx
Dosyayı görüntüle @
1a4c6931
...
...
@@ -140,11 +140,9 @@ void SmOoxml::HandleNode( const SmNode* pNode, int nLevel )
case
NMATH
:
HandleMath
(
pNode
,
nLevel
);
break
;
#if 0
case
NSUBSUP
:
HandleSubSupScript(
pNode,nLevel
);
HandleSubSupScript
(
static_cast
<
const
SmSubSupNode
*
>
(
pNode
),
nLevel
);
break
;
#endif
case
NEXPRESSION
:
HandleAllSubNodes
(
pNode
,
nLevel
);
break
;
...
...
@@ -423,4 +421,76 @@ void SmOoxml::HandleRoot( const SmRootNode* pNode, int nLevel )
m_pSerializer
->
endElementNS
(
XML_m
,
XML_rad
);
}
void
SmOoxml
::
HandleSubSupScript
(
const
SmSubSupNode
*
pNode
,
int
nLevel
)
{
// set flags to a bitfield of which sub/sup items exists
int
flags
=
(
pNode
->
GetSubSup
(
CSUB
)
!=
NULL
?
(
1
<<
CSUB
)
:
0
)
|
(
pNode
->
GetSubSup
(
CSUP
)
!=
NULL
?
(
1
<<
CSUP
)
:
0
)
|
(
pNode
->
GetSubSup
(
RSUB
)
!=
NULL
?
(
1
<<
RSUB
)
:
0
)
|
(
pNode
->
GetSubSup
(
RSUP
)
!=
NULL
?
(
1
<<
RSUP
)
:
0
)
|
(
pNode
->
GetSubSup
(
LSUB
)
!=
NULL
?
(
1
<<
RSUB
)
:
0
)
|
(
pNode
->
GetSubSup
(
LSUP
)
!=
NULL
?
(
1
<<
LSUP
)
:
0
);
if
(
flags
==
0
)
// none
return
;
HandleSubSupScriptInternal
(
pNode
,
nLevel
,
flags
);
}
void
SmOoxml
::
HandleSubSupScriptInternal
(
const
SmSubSupNode
*
pNode
,
int
nLevel
,
int
flags
)
{
if
(
flags
==
(
1
<<
RSUP
|
1
<<
RSUB
))
{
// m:sSubSup
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sSubSup
,
FSEND
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_e
,
FSEND
);
HandleNode
(
pNode
->
GetBody
(),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_e
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sub
,
FSEND
);
HandleNode
(
pNode
->
GetSubSup
(
RSUB
),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sub
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sup
,
FSEND
);
HandleNode
(
pNode
->
GetSubSup
(
RSUP
),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sup
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sSubSup
);
}
else
if
(
flags
==
1
<<
RSUB
)
{
// m:sSub
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sSub
,
FSEND
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_e
,
FSEND
);
HandleNode
(
pNode
->
GetBody
(),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_e
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sub
,
FSEND
);
HandleNode
(
pNode
->
GetSubSup
(
RSUB
),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sub
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sSub
);
}
else
if
(
flags
==
1
<<
RSUP
)
{
// m:sSup
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sSup
,
FSEND
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_e
,
FSEND
);
HandleNode
(
pNode
->
GetBody
(),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_e
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sup
,
FSEND
);
HandleNode
(
pNode
->
GetSubSup
(
RSUP
),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sup
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sSup
);
}
else
if
(
flags
==
(
1
<<
LSUP
|
1
<<
LSUB
))
{
// m:sPre
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sPre
,
FSEND
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sub
,
FSEND
);
HandleNode
(
pNode
->
GetSubSup
(
LSUB
),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sub
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_sup
,
FSEND
);
HandleNode
(
pNode
->
GetSubSup
(
LSUP
),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sup
);
m_pSerializer
->
startElementNS
(
XML_m
,
XML_e
,
FSEND
);
HandleNode
(
pNode
->
GetBody
(),
nLevel
+
1
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_e
);
m_pSerializer
->
endElementNS
(
XML_m
,
XML_sSubSup
);
}
else
{
OSL_FAIL
(
"Unhandled sub/sup combination"
);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
starmath/source/ooxml.hxx
Dosyayı görüntüle @
1a4c6931
...
...
@@ -54,6 +54,8 @@ private:
void
HandleBinaryOperation
(
const
SmBinHorNode
*
pNode
,
int
nLevel
);
void
HandleRoot
(
const
SmRootNode
*
pNode
,
int
nLevel
);
void
HandleAttribute
(
const
SmAttributNode
*
pNode
,
int
nLevel
);
void
HandleSubSupScript
(
const
SmSubSupNode
*
pNode
,
int
nLevel
);
void
HandleSubSupScriptInternal
(
const
SmSubSupNode
*
pNode
,
int
nLevel
,
int
flags
);
String
str
;
const
SmNode
*
const
pTree
;
::
sax_fastparser
::
FSHelperPtr
m_pSerializer
;
...
...
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