[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Changes to koffice/lib/store
From:       montel laurent <montell () club-internet ! fr>
Date:       2000-11-12 10:58:50
[Download RAW message or body]

Le Dimanche 12 Novembre 2000 11:04, Shaheed Haque a écrit :
> Hi David,
>
> >Well, actually it was always said that parts could store stuff under
> >tar:/1/pictures/picture0.png - in fact, the parent gives "tar:/1/" and the
> >part appends its stuff without having to know that it's actually embedded.
>
> Right. This is my understanding: the numeric prefix is the mandated by the
> SPEC, the non-numeric suffix is the application's right to use.
>
> >But tar:/Table1 is indeed kspread doing things not really per the spec.
> >What's "Table1" in fact ? The name of an embedded object, in the table
> >named "Table", right ? If that's the case, we don't need to put the name
> >there,
> >kspread could do like any other koffice app (i.e. when saving the object,
> >it can save the table it's in, and still use the tar:/0 naming).
> >But read on, I'll contradict this below :)
>

Hi,

it's not me who implemented save chidren, but I find this code :
in kspread_table.cc :

bool KSpreadTable::saveChildren( KoStore* _store, const QString &_path )
{
    int i = 0;

    QListIterator<KoDocumentChild> it( m_pDoc->children() );
    for( ; it.current(); ++it )
    {
        if ( ((KSpreadChild*)it.current())->table() == this )
        {
            QString path = QString( "%1/%2" ).arg( _path ).arg( i++ );
            if ( !it.current()->document()->saveToStore( _store, path ) )
                return false;
        }
    }
    return true;
}


and 
bool KSpreadTable::loadChildren( KoStore* _store )
{
    QListIterator<KoDocumentChild> it( m_pDoc->children() );
    for( ; it.current(); ++it )
    {
        if ( ((KSpreadChild*)it.current())->table() == this )
        {
            if ( !it.current()->loadDocument( _store ) )
                return false;
        }
    }

    return true;
}



In kspread file is store in maindoc.xml :
   <chart mime="application/x-kchart" left-cell="2" url="tar:/Table1/0" 
bottom-cell="5" top-cell="1" right-cell="2" >
    <rect w="204" x="264" h="213" y="14" />
   </chart>
   <object mime="application/x-killustrator" url="tar:/Table1/1" >
    <rect w="314" x="62" h="105" y="427" />
   </object>


I don't know if it was what you want.


thanks
bye

> If Laurent can clarify an algorithm that can be used to check what a KDE
> 2.0 kspread stores for embedded parts, I will make sure that there is
> suitable backwards compatibility code. I just hope that not too many apps
> have used a non-standard way. BTW: this also implies the need for a tighter
> SPEC. I'll look at that too.
>
> >I think this double-naming thing turns out to suck big time. tar:/0/1
> > would look
> >nice if there was only main docs and parts. But there are pictures,
> >metafiles,
> >document info, etc., and all this doesn't really fit in a numbered spec.
> >Since you're redoing things, I would suggest that an embedded object
> >gets e.g. tar:/part0 as its base URL, and can do whatever it wants under
> >there,
> >like pictures, document info, or Table1, whatever that is. This also
> > means, no
> >hidden conversion in koStore. The path of the "tar" URL would be the exact
> >path
> >in the tar file.
>
> Well, insulating apps from the details of the storage was a good idea, so
> I'm not yet ready to throw the baby out with the bathwater. As you know
> (!!), the only thing controlled by koStore is the name of the part file
> (maindoc.xml) and the level at which it occurs using well-known directory
> names (part0/part1/part0). The new design simply makes the top level like
> the other levels.
>
> Besides, the regularisation of part names might one day enable certain
> things which are not thought of today.
>
> Thanks, Shaheed
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
> _______________________________________________
> Koffice-devel mailing list
> Koffice-devel@master.kde.org
> http://master.kde.org/mailman/listinfo/koffice-devel
_______________________________________________
Koffice-devel mailing list
Koffice-devel@master.kde.org
http://master.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic