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
aa85497d
Kaydet (Commit)
aa85497d
authored
Ock 19, 2011
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
xmlfix3: unoxml: fix CChildList: member pointer does not keep document alive
üst
cb42fe10
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
24 deletions
+39
-24
childlist.cxx
unoxml/source/dom/childlist.cxx
+21
-10
childlist.hxx
unoxml/source/dom/childlist.hxx
+17
-11
node.cxx
unoxml/source/dom/node.cxx
+1
-3
No files found.
unoxml/source/dom/childlist.cxx
Dosyayı görüntüle @
aa85497d
...
...
@@ -25,11 +25,17 @@
*
************************************************************************/
#include "childlist.hxx"
#include <childlist.hxx>
#include <libxml/tree.h>
#include <node.hxx>
namespace
DOM
{
CChildList
::
CChildList
(
CNode
const
&
r
Base
)
:
m_pNode
(
rBase
.
m_aNodePtr
)
CChildList
::
CChildList
(
::
rtl
::
Reference
<
CNode
>
const
&
p
Base
)
:
m_pNode
(
pBase
)
{
}
...
...
@@ -41,7 +47,10 @@ namespace DOM
sal_Int32
length
=
0
;
if
(
m_pNode
!=
NULL
)
{
xmlNodePtr
cur
=
m_pNode
->
children
;
xmlNodePtr
cur
=
m_pNode
->
m_aNodePtr
;
if
(
0
!=
cur
)
{
cur
=
cur
->
children
;
}
while
(
cur
!=
NULL
)
{
length
++
;
...
...
@@ -54,21 +63,23 @@ namespace DOM
/**
Returns the indexth item in the collection.
*/
Reference
<
XNode
>
SAL_CALL
CChildList
::
item
(
sal_Int32
index
)
throw
(
RuntimeException
)
Reference
<
XNode
>
SAL_CALL
CChildList
::
item
(
sal_Int32
index
)
throw
(
RuntimeException
)
{
Reference
<
XNode
>
aNode
;
if
(
m_pNode
!=
NULL
)
{
xmlNodePtr
cur
=
m_pNode
->
children
;
xmlNodePtr
cur
=
m_pNode
->
m_aNodePtr
;
if
(
0
!=
cur
)
{
cur
=
cur
->
children
;
}
while
(
cur
!=
NULL
)
{
if
(
index
--
==
0
)
{
aNode
=
Reference
<
XNode
>
(
CNode
::
getCNode
(
cur
).
get
());
break
;
return
Reference
<
XNode
>
(
CNode
::
getCNode
(
cur
).
get
());
}
cur
=
cur
->
next
;
}
}
return
aNode
;
return
0
;
}
}
unoxml/source/dom/childlist.hxx
Dosyayı görüntüle @
aa85497d
...
...
@@ -25,18 +25,18 @@
*
************************************************************************/
#ifndef _CHILDLIST_HXX
#define _CHILDLIST_HXX
#ifndef
DOM
_CHILDLIST_HXX
#define
DOM
_CHILDLIST_HXX
#include <map>
#include <sal/types.h>
#include <cppuhelper/implbase1.hxx>
#include <rtl/ref.hxx>
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/xml/dom/XNode.hpp>
#include <com/sun/star/xml/dom/XNodeList.hpp>
#include "node.hxx"
#include "libxml/tree.h"
#include <cppuhelper/implbase1.hxx>
using
::
rtl
::
OUString
;
using
namespace
com
::
sun
::
star
::
uno
;
...
...
@@ -44,12 +44,17 @@ using namespace com::sun::star::xml::dom;
namespace
DOM
{
class
CChildList
:
public
cppu
::
WeakImplHelper1
<
XNodeList
>
class
CNode
;
class
CChildList
:
public
cppu
::
WeakImplHelper1
<
XNodeList
>
{
private
:
const
xmlNodePtr
m_pNode
;
::
rtl
::
Reference
<
CNode
>
const
m_pNode
;
public
:
CChildList
(
CNode
const
&
rBase
);
CChildList
(
::
rtl
::
Reference
<
CNode
>
const
&
pBase
);
/**
The number of nodes in the list.
*/
...
...
@@ -57,7 +62,8 @@ namespace DOM
/**
Returns the indexth item in the collection.
*/
virtual
Reference
<
XNode
>
SAL_CALL
item
(
sal_Int32
index
)
throw
(
RuntimeException
);
virtual
Reference
<
XNode
>
SAL_CALL
item
(
sal_Int32
index
)
throw
(
RuntimeException
);
};
}
...
...
unoxml/source/dom/node.cxx
Dosyayı görüntüle @
aa85497d
...
...
@@ -562,9 +562,7 @@ namespace DOM
if
(
0
==
m_aNodePtr
)
{
return
0
;
}
Reference
<
XNodeList
>
const
xNodeList
(
new
CChildList
(
*
CNode
::
getCNode
(
m_aNodePtr
)));
// XXX check for errors?
Reference
<
XNodeList
>
const
xNodeList
(
new
CChildList
(
this
));
return
xNodeList
;
}
...
...
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