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
28bf2062
Kaydet (Commit)
28bf2062
authored
Agu 16, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Sync oox -> writerfilter namespace prefixes
Change-Id: Ifbcb7716640cd05d4b98eef22f9ddf49f3bd79aa
üst
63fa1a7b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
29 deletions
+29
-29
OOXMLFastContextHandler.cxx
writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
+25
-25
factoryimpl.py
writerfilter/source/ooxml/factoryimpl.py
+2
-2
factoryimpl_ns.py
writerfilter/source/ooxml/factoryimpl_ns.py
+1
-1
namespaceids.py
writerfilter/source/ooxml/namespaceids.py
+1
-1
No files found.
writerfilter/source/ooxml/OOXMLFastContextHandler.cxx
Dosyayı görüntüle @
28bf2062
...
@@ -217,7 +217,7 @@ void SAL_CALL OOXMLFastContextHandler::startFastElement
...
@@ -217,7 +217,7 @@ void SAL_CALL OOXMLFastContextHandler::startFastElement
const
uno
::
Reference
<
xml
::
sax
::
XFastAttributeList
>
&
Attribs
)
const
uno
::
Reference
<
xml
::
sax
::
XFastAttributeList
>
&
Attribs
)
throw
(
uno
::
RuntimeException
,
xml
::
sax
::
SAXException
,
std
::
exception
)
throw
(
uno
::
RuntimeException
,
xml
::
sax
::
SAXException
,
std
::
exception
)
{
{
if
(
oox
::
getNamespace
(
Element
)
==
static_cast
<
sal_Int32
>
(
N
S
_mce
))
if
(
oox
::
getNamespace
(
Element
)
==
static_cast
<
sal_Int32
>
(
N
MSP
_mce
))
m_bDiscardChildren
=
prepareMceContext
(
Element
,
Attribs
);
m_bDiscardChildren
=
prepareMceContext
(
Element
,
Attribs
);
else
if
(
!
m_bDiscardChildren
)
else
if
(
!
m_bDiscardChildren
)
...
@@ -237,9 +237,9 @@ throw (uno::RuntimeException, xml::sax::SAXException, std::exception)
...
@@ -237,9 +237,9 @@ throw (uno::RuntimeException, xml::sax::SAXException, std::exception)
void
SAL_CALL
OOXMLFastContextHandler
::
endFastElement
(
Token_t
Element
)
void
SAL_CALL
OOXMLFastContextHandler
::
endFastElement
(
Token_t
Element
)
throw
(
uno
::
RuntimeException
,
xml
::
sax
::
SAXException
,
std
::
exception
)
throw
(
uno
::
RuntimeException
,
xml
::
sax
::
SAXException
,
std
::
exception
)
{
{
if
(
Element
==
(
N
S_mce
|
XML_Choice
)
||
Element
==
(
NS
_mce
|
XML_Fallback
))
if
(
Element
==
(
N
MSP_mce
|
XML_Choice
)
||
Element
==
(
NMSP
_mce
|
XML_Fallback
))
m_bDiscardChildren
=
false
;
m_bDiscardChildren
=
false
;
else
if
(
Element
==
(
N
S
_mce
|
XML_AlternateContent
))
else
if
(
Element
==
(
N
MSP
_mce
|
XML_AlternateContent
))
{
{
SavedAlternateState
aState
(
mpParserState
->
getSavedAlternateStates
().
back
());
SavedAlternateState
aState
(
mpParserState
->
getSavedAlternateStates
().
back
());
mpParserState
->
getSavedAlternateStates
().
pop_back
();
mpParserState
->
getSavedAlternateStates
().
pop_back
();
...
@@ -256,9 +256,9 @@ void OOXMLFastContextHandler::lcl_startFastElement
...
@@ -256,9 +256,9 @@ void OOXMLFastContextHandler::lcl_startFastElement
throw
(
uno
::
RuntimeException
,
xml
::
sax
::
SAXException
)
throw
(
uno
::
RuntimeException
,
xml
::
sax
::
SAXException
)
{
{
OOXMLFactory
::
getInstance
()
->
startAction
(
this
,
Element
);
OOXMLFactory
::
getInstance
()
->
startAction
(
this
,
Element
);
if
(
Element
==
(
N
S
_wordprocessingDrawing
|
XML_positionV
)
)
if
(
Element
==
(
N
MSP
_wordprocessingDrawing
|
XML_positionV
)
)
inPositionV
=
true
;
inPositionV
=
true
;
else
if
(
Element
==
(
N
S
_wordprocessingDrawing
|
XML_positionH
)
)
else
if
(
Element
==
(
N
MSP
_wordprocessingDrawing
|
XML_positionH
)
)
inPositionV
=
false
;
inPositionV
=
false
;
}
}
...
@@ -283,9 +283,9 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
...
@@ -283,9 +283,9 @@ uno::Reference< xml::sax::XFastContextHandler > SAL_CALL
throw
(
uno
::
RuntimeException
,
xml
::
sax
::
SAXException
,
std
::
exception
)
throw
(
uno
::
RuntimeException
,
xml
::
sax
::
SAXException
,
std
::
exception
)
{
{
uno
::
Reference
<
xml
::
sax
::
XFastContextHandler
>
xResult
;
uno
::
Reference
<
xml
::
sax
::
XFastContextHandler
>
xResult
;
if
((
Element
&
0xffff0000
)
!=
N
S
_mce
&&
!
m_bDiscardChildren
)
if
((
Element
&
0xffff0000
)
!=
N
MSP
_mce
&&
!
m_bDiscardChildren
)
xResult
.
set
(
lcl_createFastChildContext
(
Element
,
Attribs
));
xResult
.
set
(
lcl_createFastChildContext
(
Element
,
Attribs
));
else
if
((
Element
&
0xffff0000
)
==
N
S
_mce
)
else
if
((
Element
&
0xffff0000
)
==
N
MSP
_mce
)
xResult
=
this
;
xResult
=
this
;
return
xResult
;
return
xResult
;
...
@@ -1143,13 +1143,13 @@ void OOXMLFastContextHandlerProperties::handleXNotes()
...
@@ -1143,13 +1143,13 @@ void OOXMLFastContextHandlerProperties::handleXNotes()
{
{
switch
(
mnToken
)
switch
(
mnToken
)
{
{
case
N
S
_doc
|
XML_footnoteReference
:
case
N
MSP
_doc
|
XML_footnoteReference
:
{
{
OOXMLFootnoteHandler
aFootnoteHandler
(
this
);
OOXMLFootnoteHandler
aFootnoteHandler
(
this
);
mpPropertySet
->
resolve
(
aFootnoteHandler
);
mpPropertySet
->
resolve
(
aFootnoteHandler
);
}
}
break
;
break
;
case
N
S
_doc
|
XML_endnoteReference
:
case
N
MSP
_doc
|
XML_endnoteReference
:
{
{
OOXMLEndnoteHandler
aEndnoteHandler
(
this
);
OOXMLEndnoteHandler
aEndnoteHandler
(
this
);
mpPropertySet
->
resolve
(
aEndnoteHandler
);
mpPropertySet
->
resolve
(
aEndnoteHandler
);
...
@@ -1164,13 +1164,13 @@ void OOXMLFastContextHandlerProperties::handleHdrFtr()
...
@@ -1164,13 +1164,13 @@ void OOXMLFastContextHandlerProperties::handleHdrFtr()
{
{
switch
(
mnToken
)
switch
(
mnToken
)
{
{
case
N
S
_doc
|
XML_footerReference
:
case
N
MSP
_doc
|
XML_footerReference
:
{
{
OOXMLFooterHandler
aFooterHandler
(
this
);
OOXMLFooterHandler
aFooterHandler
(
this
);
mpPropertySet
->
resolve
(
aFooterHandler
);
mpPropertySet
->
resolve
(
aFooterHandler
);
}
}
break
;
break
;
case
N
S
_doc
|
XML_headerReference
:
case
N
MSP
_doc
|
XML_headerReference
:
{
{
OOXMLHeaderHandler
aHeaderHandler
(
this
);
OOXMLHeaderHandler
aHeaderHandler
(
this
);
mpPropertySet
->
resolve
(
aHeaderHandler
);
mpPropertySet
->
resolve
(
aHeaderHandler
);
...
@@ -1748,7 +1748,7 @@ void OOXMLFastContextHandlerShape::sendShape( Token_t Element )
...
@@ -1748,7 +1748,7 @@ void OOXMLFastContextHandlerShape::sendShape( Token_t Element )
newProperty
(
NS_ooxml
::
LN_shape
,
pValue
);
newProperty
(
NS_ooxml
::
LN_shape
,
pValue
);
m_bShapeSent
=
true
;
m_bShapeSent
=
true
;
bool
bIsPicture
=
Element
==
(
N
S
_picture
|
XML_pic
);
bool
bIsPicture
=
Element
==
(
N
MSP
_picture
|
XML_pic
);
// Notify the dmapper that the shape is ready to use
// Notify the dmapper that the shape is ready to use
if
(
!
bIsPicture
)
if
(
!
bIsPicture
)
...
@@ -1773,7 +1773,7 @@ void OOXMLFastContextHandlerShape::lcl_endFastElement
...
@@ -1773,7 +1773,7 @@ void OOXMLFastContextHandlerShape::lcl_endFastElement
OOXMLFastContextHandlerProperties
::
lcl_endFastElement
(
Element
);
OOXMLFastContextHandlerProperties
::
lcl_endFastElement
(
Element
);
// Ending the shape should be the last thing to do
// Ending the shape should be the last thing to do
bool
bIsPicture
=
Element
==
(
N
S
_picture
|
XML_pic
);
bool
bIsPicture
=
Element
==
(
N
MSP
_picture
|
XML_pic
);
if
(
!
bIsPicture
&&
m_bShapeStarted
)
if
(
!
bIsPicture
&&
m_bShapeStarted
)
mpStream
->
endShape
(
);
mpStream
->
endShape
(
);
}
}
...
@@ -1795,16 +1795,16 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
...
@@ -1795,16 +1795,16 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
{
{
uno
::
Reference
<
xml
::
sax
::
XFastContextHandler
>
xContextHandler
;
uno
::
Reference
<
xml
::
sax
::
XFastContextHandler
>
xContextHandler
;
bool
bGroupShape
=
Element
==
Token_t
(
N
S
_vml
|
XML_group
);
bool
bGroupShape
=
Element
==
Token_t
(
N
MSP
_vml
|
XML_group
);
// drawingML version also counts as a group shape.
// drawingML version also counts as a group shape.
bGroupShape
|=
mrShapeContext
->
getStartToken
()
==
Token_t
(
N
S
_wpg
|
XML_wgp
);
bGroupShape
|=
mrShapeContext
->
getStartToken
()
==
Token_t
(
N
MSP
_wpg
|
XML_wgp
);
sal_uInt32
nNamespace
=
Element
&
0xffff0000
;
sal_uInt32
nNamespace
=
Element
&
0xffff0000
;
switch
(
nNamespace
)
switch
(
nNamespace
)
{
{
case
N
S
_doc
:
case
N
MSP
_doc
:
case
N
S
_vml_wordprocessingDrawing
:
case
N
MSP
_vml_wordprocessingDrawing
:
case
N
S
_office
:
case
N
MSP
_office
:
if
(
!
bGroupShape
)
if
(
!
bGroupShape
)
xContextHandler
.
set
(
OOXMLFactory
::
getInstance
()
->
createFastChildContextFromStart
(
this
,
Element
));
xContextHandler
.
set
(
OOXMLFactory
::
getInstance
()
->
createFastChildContextFromStart
(
this
,
Element
));
// no break;
// no break;
...
@@ -1821,10 +1821,10 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
...
@@ -1821,10 +1821,10 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
if
(
!
bGroupShape
)
if
(
!
bGroupShape
)
{
{
pWrapper
->
addNamespace
(
N
S
_doc
);
pWrapper
->
addNamespace
(
N
MSP
_doc
);
pWrapper
->
addNamespace
(
N
S
_vml_wordprocessingDrawing
);
pWrapper
->
addNamespace
(
N
MSP
_vml_wordprocessingDrawing
);
pWrapper
->
addNamespace
(
N
S
_office
);
pWrapper
->
addNamespace
(
N
MSP
_office
);
pWrapper
->
addToken
(
N
S
_vml
|
XML_textbox
);
pWrapper
->
addToken
(
N
MSP
_vml
|
XML_textbox
);
}
}
xContextHandler
.
set
(
pWrapper
);
xContextHandler
.
set
(
pWrapper
);
...
@@ -1839,8 +1839,8 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
...
@@ -1839,8 +1839,8 @@ OOXMLFastContextHandlerShape::lcl_createFastChildContext
// OOXMLFastContextHandlerWrapper::lcl_createFastChildContext(), here we
// OOXMLFastContextHandlerWrapper::lcl_createFastChildContext(), here we
// handle the WPS import of shape text, as there the parent context is a
// handle the WPS import of shape text, as there the parent context is a
// Shape one, so a different situation.
// Shape one, so a different situation.
if
(
Element
==
static_cast
<
sal_Int32
>
(
N
S
_wps
|
XML_txbx
)
||
if
(
Element
==
static_cast
<
sal_Int32
>
(
N
MSP
_wps
|
XML_txbx
)
||
Element
==
static_cast
<
sal_Int32
>
(
N
S
_wps
|
XML_linkedTxbx
)
)
Element
==
static_cast
<
sal_Int32
>
(
N
MSP
_wps
|
XML_linkedTxbx
)
)
sendShape
(
Element
);
sendShape
(
Element
);
return
xContextHandler
;
return
xContextHandler
;
...
@@ -1989,7 +1989,7 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext
...
@@ -1989,7 +1989,7 @@ OOXMLFastContextHandlerWrapper::lcl_createFastChildContext
// processed by writerfilter (instead of oox), but we have no method to
// processed by writerfilter (instead of oox), but we have no method to
// filter out a single token. Just hardwire the wrap token here till we
// filter out a single token. Just hardwire the wrap token here till we
// need a more generic solution.
// need a more generic solution.
bool
bIsWrap
=
Element
==
static_cast
<
sal_Int32
>
(
N
S
_vml_wordprocessingDrawing
|
XML_wrap
);
bool
bIsWrap
=
Element
==
static_cast
<
sal_Int32
>
(
N
MSP
_vml_wordprocessingDrawing
|
XML_wrap
);
if
(
bInNamespaces
&&
((
pShapeCtx
->
isShapeSent
()
&&
bIsWrap
)
||
!
bIsWrap
)
)
if
(
bInNamespaces
&&
((
pShapeCtx
->
isShapeSent
()
&&
bIsWrap
)
||
!
bIsWrap
)
)
xResult
.
set
(
OOXMLFactory
::
getInstance
()
->
createFastChildContextFromStart
(
this
,
Element
));
xResult
.
set
(
OOXMLFactory
::
getInstance
()
->
createFastChildContextFromStart
(
this
,
Element
));
else
if
(
mxContext
.
is
())
else
if
(
mxContext
.
is
())
...
...
writerfilter/source/ooxml/factoryimpl.py
Dosyayı görüntüle @
28bf2062
...
@@ -129,7 +129,7 @@ string fastTokenToId(sal_uInt32 nToken)
...
@@ -129,7 +129,7 @@ string fastTokenToId(sal_uInt32 nToken)
for
alias
in
[
a
.
getAttribute
(
"alias"
)
for
a
in
model
.
getElementsByTagName
(
"namespace-alias"
)]:
for
alias
in
[
a
.
getAttribute
(
"alias"
)
for
a
in
model
.
getElementsByTagName
(
"namespace-alias"
)]:
if
not
alias
in
aliases
:
if
not
alias
in
aliases
:
aliases
.
append
(
alias
)
aliases
.
append
(
alias
)
print
(
""" case N
S
_
%
s:
print
(
""" case N
MSP
_
%
s:
sResult += "
%
s:";
sResult += "
%
s:";
break;"""
%
(
alias
,
alias
))
break;"""
%
(
alias
,
alias
))
print
(
""" }
print
(
""" }
...
@@ -161,7 +161,7 @@ def getFastParser(model):
...
@@ -161,7 +161,7 @@ def getFastParser(model):
mxFastParser = css::xml::sax::FastParser::create(mxContext);
mxFastParser = css::xml::sax::FastParser::create(mxContext);
"""
)
"""
)
for
alias
in
model
.
getElementsByTagName
(
"namespace-alias"
):
for
alias
in
model
.
getElementsByTagName
(
"namespace-alias"
):
print
(
""" mxFastParser->registerNamespace("
%
s", N
S
_
%
s);"""
%
(
alias
.
getAttribute
(
"name"
),
alias
.
getAttribute
(
"alias"
)))
print
(
""" mxFastParser->registerNamespace("
%
s", N
MSP
_
%
s);"""
%
(
alias
.
getAttribute
(
"name"
),
alias
.
getAttribute
(
"alias"
)))
print
(
""" }
print
(
""" }
return mxFastParser;
return mxFastParser;
...
...
writerfilter/source/ooxml/factoryimpl_ns.py
Dosyayı görüntüle @
28bf2062
...
@@ -110,7 +110,7 @@ def idForDefine(nsNode, defineNode):
...
@@ -110,7 +110,7 @@ def idForDefine(nsNode, defineNode):
def
fastNamespace
(
attrNode
):
def
fastNamespace
(
attrNode
):
return
"N
S
_
%
s"
%
attrNode
.
getAttribute
(
"prefix"
)
return
"N
MSP
_
%
s"
%
attrNode
.
getAttribute
(
"prefix"
)
def
fastLocalName
(
attrNode
):
def
fastLocalName
(
attrNode
):
...
...
writerfilter/source/ooxml/namespaceids.py
Dosyayı görüntüle @
28bf2062
...
@@ -41,7 +41,7 @@ using namespace ::com::sun::star;
...
@@ -41,7 +41,7 @@ using namespace ::com::sun::star;
def
startElement
(
self
,
name
,
attrs
):
def
startElement
(
self
,
name
,
attrs
):
if
name
==
"namespace-alias"
:
if
name
==
"namespace-alias"
:
token
=
"""const sal_
uInt32 NS
_
%
s =
%
s;"""
%
(
attrs
[
"alias"
],
attrs
[
"id"
])
token
=
"""const sal_
Int32 NMSP
_
%
s =
%
s;"""
%
(
attrs
[
"alias"
],
attrs
[
"id"
])
if
token
not
in
self
.
tokens
:
if
token
not
in
self
.
tokens
:
self
.
tokens
.
append
(
token
)
self
.
tokens
.
append
(
token
)
print
(
token
)
print
(
token
)
...
...
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