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
6bbca348
Kaydet (Commit)
6bbca348
authored
Kas 29, 2011
tarafından
Luboš Luňák
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
make debug output print tags as strings rather than id numbers
üst
eb31865c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
15 deletions
+56
-15
importutils.hxx
oox/inc/oox/mathml/importutils.hxx
+1
-1
importutils.cxx
oox/source/mathml/importutils.cxx
+55
-14
No files found.
oox/inc/oox/mathml/importutils.hxx
Dosyayı görüntüle @
6bbca348
...
@@ -162,7 +162,7 @@ public:
...
@@ -162,7 +162,7 @@ public:
*/
*/
void
handleUnexpectedTag
();
void
handleUnexpectedTag
();
protected
:
protected
:
Tag
checkTag
(
int
token
,
bool
optional
,
const
char
*
txt
);
Tag
checkTag
(
int
token
,
bool
optional
);
std
::
vector
<
Tag
>
tags
;
std
::
vector
<
Tag
>
tags
;
unsigned
int
pos
;
unsigned
int
pos
;
};
};
...
...
oox/source/mathml/importutils.cxx
Dosyayı görüntüle @
6bbca348
...
@@ -31,10 +31,19 @@
...
@@ -31,10 +31,19 @@
#include <assert.h>
#include <assert.h>
#include <stdio.h>
#include <stdio.h>
#include <oox/token/namespacemap.hxx>
#include <oox/token/tokenmap.hxx>
#include <oox/token/tokens.hxx>
#include <oox/token/tokens.hxx>
#include <oox/token/namespaces.hxx>
#include <oox/token/namespaces.hxx>
#include <rtl/string.hxx>
// *sigh*
#define STR( str ) OUString( RTL_CONSTASCII_USTRINGPARAM( str ))
#define CSTR( str ) ( rtl::OUStringToOString( str, RTL_TEXTENCODING_UTF8 ).getStr())
using
namespace
com
::
sun
::
star
;
using
namespace
com
::
sun
::
star
;
using
rtl
::
OUString
;
namespace
oox
namespace
oox
{
{
...
@@ -67,6 +76,40 @@ AttributeListBuilder::AttributeListBuilder( const uno::Reference< xml::sax::XFas
...
@@ -67,6 +76,40 @@ AttributeListBuilder::AttributeListBuilder( const uno::Reference< xml::sax::XFas
attrs
[
pFastAttr
[
i
].
Token
]
=
pFastAttr
[
i
].
Value
;
attrs
[
pFastAttr
[
i
].
Token
]
=
pFastAttr
[
i
].
Value
;
}
}
}
}
static
OUString
tokenToString
(
int
token
)
{
OUString
tokenname
=
StaticTokenMap
::
get
().
getUnicodeTokenName
(
token
&
TOKEN_MASK
);
if
(
tokenname
.
isEmpty
())
tokenname
=
STR
(
"???"
);
int
nmsp
=
(
token
&
NMSP_MASK
&
~
(
TAG_OPENING
|
TAG_CLOSING
));
#if 0 // this is awfully long
OUString namespacename = StaticNamespaceMap::get().count( nmsp ) != 0
? StaticNamespaceMap::get()[ nmsp ] : STR( "???" );
#else
OUString
namespacename
;
// only few are needed actually
switch
(
nmsp
)
{
case
NMSP_officeMath
:
namespacename
=
STR
(
"m"
);
break
;
case
NMSP_doc
:
namespacename
=
STR
(
"w"
);
break
;
default
:
namespacename
=
STR
(
"?"
);
break
;
}
#endif
if
(
token
==
OPENING
(
token
))
return
STR
(
"<"
)
+
namespacename
+
STR
(
":"
)
+
tokenname
+
STR
(
">"
);
if
(
token
==
CLOSING
(
token
))
return
STR
(
"</"
)
+
namespacename
+
STR
(
":"
)
+
tokenname
+
STR
(
">"
);
// just the name itself, not specified whether opening or closing
return
namespacename
+
STR
(
":"
)
+
tokenname
;
}
}
// namespace
}
// namespace
bool
XmlStream
::
AttributeList
::
hasAttribute
(
int
token
)
const
bool
XmlStream
::
AttributeList
::
hasAttribute
(
int
token
)
const
...
@@ -93,8 +136,7 @@ bool XmlStream::AttributeList::attribute( int token, bool def ) const
...
@@ -93,8 +136,7 @@ bool XmlStream::AttributeList::attribute( int token, bool def ) const
if
(
find
->
second
.
equalsIgnoreAsciiCaseAscii
(
"false"
)
||
find
->
second
.
equalsIgnoreAsciiCaseAscii
(
"off"
)
if
(
find
->
second
.
equalsIgnoreAsciiCaseAscii
(
"false"
)
||
find
->
second
.
equalsIgnoreAsciiCaseAscii
(
"off"
)
||
find
->
second
.
equalsIgnoreAsciiCaseAscii
(
"f"
)
||
find
->
second
.
equalsIgnoreAsciiCaseAscii
(
"0"
))
||
find
->
second
.
equalsIgnoreAsciiCaseAscii
(
"f"
)
||
find
->
second
.
equalsIgnoreAsciiCaseAscii
(
"0"
))
return
false
;
return
false
;
fprintf
(
stderr
,
"Cannot convert
\'
%s
\'
to bool.
\n
"
,
fprintf
(
stderr
,
"Cannot convert
\'
%s
\'
to bool.
\n
"
,
CSTR
(
find
->
second
));
rtl
::
OUStringToOString
(
find
->
second
,
RTL_TEXTENCODING_UTF8
).
getStr
());
}
}
return
def
;
return
def
;
}
}
...
@@ -107,8 +149,7 @@ sal_Unicode XmlStream::AttributeList::attribute( int token, sal_Unicode def ) co
...
@@ -107,8 +149,7 @@ sal_Unicode XmlStream::AttributeList::attribute( int token, sal_Unicode def ) co
if
(
find
->
second
.
getLength
()
>=
1
)
if
(
find
->
second
.
getLength
()
>=
1
)
{
{
if
(
find
->
second
.
getLength
()
!=
1
)
if
(
find
->
second
.
getLength
()
!=
1
)
fprintf
(
stderr
,
"Cannot convert
\'
%s
\'
to sal_Unicode, stripping.
\n
"
,
fprintf
(
stderr
,
"Cannot convert
\'
%s
\'
to sal_Unicode, stripping.
\n
"
,
CSTR
(
find
->
second
));
rtl
::
OUStringToOString
(
find
->
second
,
RTL_TEXTENCODING_UTF8
).
getStr
());
return
find
->
second
[
0
];
return
find
->
second
[
0
];
}
}
}
}
...
@@ -162,20 +203,20 @@ void XmlStream::moveToNextTag()
...
@@ -162,20 +203,20 @@ void XmlStream::moveToNextTag()
XmlStream
::
Tag
XmlStream
::
ensureOpeningTag
(
int
token
)
XmlStream
::
Tag
XmlStream
::
ensureOpeningTag
(
int
token
)
{
{
return
checkTag
(
OPENING
(
token
),
false
,
"opening"
);
return
checkTag
(
OPENING
(
token
),
false
);
}
}
XmlStream
::
Tag
XmlStream
::
checkOpeningTag
(
int
token
)
XmlStream
::
Tag
XmlStream
::
checkOpeningTag
(
int
token
)
{
{
return
checkTag
(
OPENING
(
token
),
true
,
"opening"
);
return
checkTag
(
OPENING
(
token
),
true
);
}
}
void
XmlStream
::
ensureClosingTag
(
int
token
)
void
XmlStream
::
ensureClosingTag
(
int
token
)
{
{
checkTag
(
CLOSING
(
token
),
false
,
"closing"
);
checkTag
(
CLOSING
(
token
),
false
);
}
}
XmlStream
::
Tag
XmlStream
::
checkTag
(
int
token
,
bool
optional
,
const
char
*
txt
)
XmlStream
::
Tag
XmlStream
::
checkTag
(
int
token
,
bool
optional
)
{
{
// either it's the following tag, or find it
// either it's the following tag, or find it
int
savedPos
=
pos
;
int
savedPos
=
pos
;
...
@@ -190,7 +231,7 @@ XmlStream::Tag XmlStream::checkTag( int token, bool optional, const char* txt )
...
@@ -190,7 +231,7 @@ XmlStream::Tag XmlStream::checkTag( int token, bool optional, const char* txt )
pos
=
savedPos
;
pos
=
savedPos
;
return
Tag
();
return
Tag
();
}
}
fprintf
(
stderr
,
"Expected
%s tag %d not found.
\n
"
,
txt
,
token
);
fprintf
(
stderr
,
"Expected
tag %s not found.
\n
"
,
CSTR
(
tokenToString
(
token
))
);
return
Tag
();
return
Tag
();
}
}
...
@@ -205,17 +246,17 @@ bool XmlStream::recoverAndFindTag( int token )
...
@@ -205,17 +246,17 @@ bool XmlStream::recoverAndFindTag( int token )
{
{
if
(
currentToken
()
==
OPENING
(
currentToken
()))
if
(
currentToken
()
==
OPENING
(
currentToken
()))
{
{
fprintf
(
stderr
,
"Skipping
opening tag %d
\n
"
,
currentToken
(
));
fprintf
(
stderr
,
"Skipping
tag %s
\n
"
,
CSTR
(
tokenToString
(
currentToken
())
));
++
depth
;
++
depth
;
}
}
else
if
(
currentToken
()
==
CLOSING
(
currentToken
()))
else
if
(
currentToken
()
==
CLOSING
(
currentToken
()))
{
// TODO debug output without the OPENING/CLOSING bits set
{
// TODO debug output without the OPENING/CLOSING bits set
fprintf
(
stderr
,
"Skipping
closing tag %d
\n
"
,
currentToken
(
));
fprintf
(
stderr
,
"Skipping
tag %s
\n
"
,
CSTR
(
tokenToString
(
currentToken
())
));
--
depth
;
--
depth
;
}
}
else
else
{
{
fprintf
(
stderr
,
"Malformed token %d
\n
"
,
currentToken
(
));
fprintf
(
stderr
,
"Malformed token %d
(%s)
\n
"
,
currentToken
(),
CSTR
(
tokenToString
(
currentToken
())
));
abort
();
abort
();
}
}
continue
;
continue
;
...
@@ -226,7 +267,7 @@ bool XmlStream::recoverAndFindTag( int token )
...
@@ -226,7 +267,7 @@ bool XmlStream::recoverAndFindTag( int token )
return
false
;
// that would be leaving current element, so not found
return
false
;
// that would be leaving current element, so not found
if
(
currentToken
()
==
OPENING
(
currentToken
()))
if
(
currentToken
()
==
OPENING
(
currentToken
()))
{
{
fprintf
(
stderr
,
"Skipping
opening tag %d
\n
"
,
currentToken
(
));
fprintf
(
stderr
,
"Skipping
tag %s
\n
"
,
CSTR
(
tokenToString
(
currentToken
())
));
++
depth
;
++
depth
;
}
}
else
else
...
@@ -247,7 +288,7 @@ void XmlStream::skipElement( int token )
...
@@ -247,7 +288,7 @@ void XmlStream::skipElement( int token )
moveToNextTag
();
// and skip it too
moveToNextTag
();
// and skip it too
return
;
return
;
}
}
fprintf
(
stderr
,
"Expected end of element %
d not found.
\n
"
,
token
);
fprintf
(
stderr
,
"Expected end of element %
s not found.
\n
"
,
CSTR
(
tokenToString
(
token
))
);
}
}
void
XmlStream
::
handleUnexpectedTag
()
void
XmlStream
::
handleUnexpectedTag
()
...
...
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