[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: koffice/libs/kotext/opendocument
From: Thomas Zander <zander () kde ! org>
Date: 2010-11-13 15:18:39
Message-ID: 201011131618.39727.zander () kde ! org
[Download RAW message or body]
On Friday 12. November 2010 13.14.51 Thorsten Zachmann wrote:
> Hello Thomas,
>
> looks like you might have not got this mail. Therefore I send it again.
> Would be nice if you could fix the problems pointed out in your commit.
Must have gotten lost somewhere. I'll attach it here.
--
Thomas Zander
["forwarded message" (message/rfc822)]
Return-Path: <commitfilter@new.kstuff.org>
Received: from ktown.kde.org (ktown.kde.org [131.246.120.250])
by mail24.nsc.no (8.14.3/8.14.3) with SMTP id oA89XcUQ006239
for <tzander@online.no>; Mon, 8 Nov 2010 10:33:42 +0100 (MET)
Received: (qmail 21588 invoked by uid 1055); 8 Nov 2010 09:33:38 -0000
Delivered-To: kde.org-zander@kde.org
Received: (qmail 21585 invoked from network); 8 Nov 2010 09:33:38 -0000
X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on ktown.kde.org
Received: from unknown (HELO kdeget.osuosl.org) (140.211.166.77)
by ktown.kde.org with SMTP; 8 Nov 2010 09:33:36 -0000
Received: from ktown.kde.org ([131.246.120.250])
by kdeget.osuosl.org with smtp (Exim 4.69)
(envelope-from <kde-commits-bounces-+commitfilter=new.kstuff.org@kde.org>)
id 1PFO6K-0000xx-Pc
for commitfilter@new.kstuff.org; Mon, 08 Nov 2010 10:33:21 +0100
Received: (qmail 21062 invoked by uid 72); 8 Nov 2010 09:32:53 -0000
Received: (qmail 21053 invoked from network); 8 Nov 2010 09:32:51 -0000
Received: from unknown (HELO smtp-gw11.han.skanova.net) (81.236.55.20)
by ktown.kde.org with SMTP; 8 Nov 2010 09:32:50 -0000
Received: from mac.localnet (213.65.152.103) by smtp-gw11.han.skanova.net
(8.5.124.10) id 4C7CB7ED0250A12C; Mon, 8 Nov 2010 10:32:18 +0100
From: Thomas Zander <zander@kde.org>
To: Thorsten Zachmann <t.zachmann@zagge.de>
Subject: Re: koffice/libs/kotext/opendocument
Date: Mon, 8 Nov 2010 10:32:17 +0100
User-Agent: KMail/1.13.5 (Linux/2.6.31-14-generic; KDE/4.5.0; x86_64;
svn-1145547; 2010-06-22)
References: <20101107180418.33E65AC89B@svn.kde.org>
<201011080433.34121.t.zachmann@zagge.de>
In-Reply-To: <201011080433.34121.t.zachmann@zagge.de>
MIME-Version: 1.0
Content-Type: Text/Plain;
charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201011081032.18235.zander@kde.org>
Cc: kde-commits@kde.org
X-BeenThere: kde-commits@kde.org
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: kde-commits@kde.org
List-Id: Notification of KDE commits <kde-commits.kde.org>
List-Unsubscribe: <https://mail.kde.org/mailman/listinfo/kde-commits>,
<mailto:kde-commits-request@kde.org?subject=unsubscribe>
List-Post: <mailto:kde-commits@kde.org>
List-Help: <mailto:kde-commits-request@kde.org?subject=help>
List-Subscribe: <https://mail.kde.org/mailman/listinfo/kde-commits>,
<mailto:kde-commits-request@kde.org?subject=subscribe>
X-Xxroufqwki: sw=gld ver=1.2 d=0s tld=org st=wip
X-XClient-IP-Addr: 131.246.120.250
On Monday 8. November 2010 04.33.33 Thorsten Zachmann wrote:
> Hello Thomas,
>
> On Sunday, November 07, 2010 07:04:18 pm Thomas Zander wrote:
> > if (styleManager) {
> >
> > - styleManager->add(it->second);
> > + styleManager->add(odfStyle.style);
> >
> > } else {
> >
> > - d->characterStylesToDelete.append(it->second);
> > + if (!odfStyle.parentStyle.isEmpty()) { // an auto style with
> > a parent. + // lets find the parent and set the styleId
> > of that one on the auto-style too. + // this will have
> > the effect that whereever the autostyle is applied, it will
> > + // cause the parent style-id to be applied. So we don't
> > loose this info. + KoCharacterStyle *parent =
> > characterStyle(odfStyle.parentStyle, false); + if
> > (!parent) + parent =
> > characterStyle(odfStyle.parentStyle, true); // try harder +
> > if (parent)
> > + odfStyle.style->setStyleId(parent->styleId());
> >
> > }
> >
> > + d->characterStylesToDelete.append(odfStyle.style);
>
> there is a problem with the above code. If a style is in content.xml and
> it is a automatic style its parent can be a automatic style in content.xml
> or a document style in styles.xml. If it is a automatic style and it is in
> styles.xml its parent can only be a automatic style in styles.xml or a
> document style in styles.xml. Also a document style can never have an
> automatic style as parent.
There is a paragraph in the ODF spec (at least in 1.2) that says automatic
styles can only have as parent non-automatic styles, aka document styles.
So, the code makes the assumption that this is the case, if the document is not
following the spec then indeed funny things may happen ;)
> The above code is problematic as automatic styles in content.xml and
> styles.xml can have the same name.
That you can name a style in the content and a diffrent style in the styles xml
the same is new too me, so lets see if that works...
Hmm, if a document style in styles.xml has an odf name that is a duplicate of
another document style in content.xml, then the design as it was before can't
work because the line;
addCharacterStyles(shapeContext,
context.stylesReader().customStyles("text").values(), ContentDotXml |
StylesDotXml, styleManager);
adds each of those styles to both collections, and it would drop one style from
those collections (but add it to the styleManager)
So, maybe I misundestood? Can we really have two document styles with the same
odf name in content.xml and styles.xml?
If I understood correctly, do you agree I found a problem?
--
Thomas Zander
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.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