List Info

Thread: A question about destructor




A question about destructor
user name
2007-07-24 03:43:15
Hello all,

I am absorbed in modularization of ODFToolkit project about
2 months.
For the modularization, I need to move the member
"SwRootFrm  *pLayout" from 
class "SwDoc" to class "ViewShell". Then
we should pass a parameter "SwRootFrm&
rLayout"
at where "pLayout" was used originally. So, I
should modify many functions by passing a reference 
paremeter "rLayout".
But now I face a question as follows:

in file swsourcecoredocdocredln.cxx
the destructor :
SwRedline::~SwRedline()
{
......
if( !GetDoc()->IsInDtor() )
   GetDoc()->DeleteSection(
&pCntntSect->GetNode(),rLayout );
......
}

The parameter "rLayout" in function DeleteSection
is added by me and this parameter is passed from the view
class "ViewShell".
That means the destructor don't know this patameter.but the
modularization work require me to add this parameter.
Then I wonder how to deal with it and make the destructor
can dispose this function.

Looking forward to hearing from you!
Best wishes,



lijian
2007-07-24
Re: A question about destructor
user name
2007-07-24 11:11:51
lijian,

no chance to pass it to the DTOR, of course.
We must figure out how to deal with DeleteSection() when not
having a Layout...

I didn't look into the code right now - maybe someone from
Writer team has a suggestion at hand? ;)

Malte. 



lijian wrote:
> Hello all,
>
> I am absorbed in modularization of ODFToolkit project
about 2 months.
> For the modularization, I need to move the member
"SwRootFrm  *pLayout" from 
> class "SwDoc" to class "ViewShell".
Then we should pass a parameter "SwRootFrm&
rLayout"
> at where "pLayout" was used originally. So, I
should modify many functions by passing a reference 
> paremeter "rLayout".
> But now I face a question as follows:
>
> in file swsourcecoredocdocredln.cxx
> the destructor :
> SwRedline::~SwRedline()
> {
> ......
> if( !GetDoc()->IsInDtor() )
>    GetDoc()->DeleteSection(
&pCntntSect->GetNode(),rLayout );
> ......
> }
>
> The parameter "rLayout" in function
DeleteSection is added by me and this parameter is passed
from the view class "ViewShell".
> That means the destructor don't know this patameter.but
the modularization work require me to add this parameter.
> Then I wonder how to deal with it and make the
destructor can dispose this function.
>
> Looking forward to hearing from you!
> Best wishes,
>
>
>
> lijian
> 2007-07-24
>
>   

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeodftoolkit.openoffice.org
For additional commands, e-mail: dev-helpodftoolkit.openoffice.org


about the modularization in SW
user name
2007-08-21 01:30:22
Hello Malte,
I know that Andreas Martens will come back today.I wish you
could discuss with him about the modularization in SW as
soon as possible,because we face the choke point and have no
idea.
Recently I face a problem that many of the "const
SwRootFrm &rLayout"should be modified as
"SwRootFrm &rLayout" .
We eager to know the result of the discussion.
I am waiting for your reply.
Best Regards,
LiuTao
Re: about the modularization in SW
user name
2007-08-21 03:32:25
LiuTao,

this is not related to the discussions with Andreas.

If you introduced some const& parameters, where non
const references where needed, then simply change them to
non const...

Malte.



liutao wrote:
> Hello Malte,
> I know that Andreas Martens will come back today.I wish
you could discuss with him about the modularization in SW as
soon as possible,because we face the choke point and have no
idea.
> Recently I face a problem that many of the "const
SwRootFrm &rLayout"should be modified as
"SwRootFrm &rLayout" .
> We eager to know the result of the discussion.
> I am waiting for your reply.
> Best Regards,
> LiuTao
>   

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribeodftoolkit.openoffice.org
For additional commands, e-mail: dev-helpodftoolkit.openoffice.org


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )