[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: Re: Review Request: KoGenStyle(s) cleanup
From: "Thorsten Zachmann" <t.zachmann () zagge ! de>
Date: 2010-03-08 14:05:22
Message-ID: 20100308140522.13572.10248 () localhost
[Download RAW message or body]
> On 2010-03-04 08:14:56, Thorsten Zachmann wrote:
> > trunk/koffice/libs/odf/KoGenStyles.h, line 94
> > <http://reviewboard.kde.org/r/3090/diff/1/?file=20296#file20296line94>
> >
> > ForceNumbering is used quite a lot by the apps so it should not be removed.
>
> Jaroslaw Staniek wrote:
> Yes ForceNumbering is used a lot and is removed because of this reason; default \
> value does not require us to express it in the API, only special (a bit more rare) \
> case do, which is DontForceNumbering.
I think we should keep the default so it is known what is happening instead of \
passing a 0 here:
+ QString insert(const KoGenStyle& style, const QString& baseName = QString(), \
InsertionFlags flags = 0);
It is one of the options so it should not be removed.
> On 2010-03-04 08:14:56, Thorsten Zachmann wrote:
> > trunk/koffice/libs/odf/KoGenStyles.h, line 115
> > <http://reviewboard.kde.org/r/3090/diff/1/?file=20296#file20296line115>
> >
> > This should not be changed as it really is more a lookup then a insert. It \
> > returns the name of the style. It looks up the style name as the description \
> > tells.
>
> Jaroslaw Staniek wrote:
> Could you exaplain what metrics say this? insert/add/append indicates non-constness \
> of the operation. Lookup doesn't.
> There's nothing wrong about returning infromation about the inserted element. To \
> just mention equvalent in Qt, please let me say about QAction* QMenuBar::addAction( \
> const QString & text ).
Lookup is what describes the functionality better. It looks up the name of the style.
I think the example of addAction is not a really good one here as it always adds the \
action when you call it twice.
- Thorsten
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.kde.org/r/3090/#review4366
-----------------------------------------------------------
On 2010-03-03 13:22:46, Jaroslaw Staniek wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/3090/
> -----------------------------------------------------------
>
> (Updated 2010-03-03 13:22:46)
>
>
> Review request for KOffice.
>
>
> Summary
> -------
>
> NOTE: the patch only contains changes to KoGenStyle*.* files. Required updates for \
> other KOffice code shall be provided after this patch is approved.
> * KoGenStyle::Type cleanup:
> - renamed StyleUser to StyleParagraph
> - renamed StyleAuto to StyleParagraphAuto
> - move the 'Auto' to the end for the table style families
>
> * KoGenStyles::Flags made QFlags
>
> * KoGenStyles::lookup() -> KoGenStyles::insert()
>
> * move KoGenStyle::isEmpty() code to .cpp
>
> * use constFind(), constBegin(), constEnd() for iterators if possible
>
> * made some methods const
>
> * introduced KoGenStyles::StylesPlacement for saving odf and inserting raw styles.
>
> * insertRawStyles() replaces 4 methods. saveOdfStyles() replaces 4 other methods.
>
> * KoGenStyle::N_NumTypes -> KoGenStyle::N_NumPropertyTypes
>
> * added KoGenStyle::N_NumTypes
>
> * KoGenStyles: StyleArray -> QList<KoGenStyles::NamedStyle>
>
> * KoGenStyles: NameMap typedef removed, using just QSet<QString> is clear
>
> * To minimize size of the patch, I am noting down remaining possible TODOs:
>
> TODO 1: make KoGenStyle implicitly shared: optimizes and fixes risk of BIC changes \
> because of m_properties
> TODO 2: add QList<KoGenStyles::NamedStyle> \
> KoGenStyles::Private::stylesForTypes[KoGenStyle::N_NumTypes] for optimizing static \
> QList<KoGenStyles::NamedStyle> styles(const QSet<QString>& names, KoGenStyle::Type \
> type)
> TODO 3: replace QSet<QString> KoGenStyles::Private::styleNames with QMap<QString, \
> KoGenStyle*> KoGenStyles::Private::styles for optimizing const KoGenStyle* \
> KoGenStyles::style(const QString& name) const
> TODO 4: implement qDebug() for KoGenStyles instead of dump()
>
> TODO 5: implement qDebug() for KoGenStyle instead of printDebug()
>
> TODO 6: rename to KoOdfStyle(s)
>
>
> Diffs
> -----
>
> trunk/koffice/libs/odf/KoGenStyle.h 1097689
> trunk/koffice/libs/odf/KoGenStyle.cpp 1097689
> trunk/koffice/libs/odf/KoGenStyles.h 1097689
> trunk/koffice/libs/odf/KoGenStyles.cpp 1097689
>
> Diff: http://reviewboard.kde.org/r/3090/diff
>
>
> Testing
> -------
>
> builds, checked if there's no change in semantics
>
>
> Thanks,
>
> Jaroslaw
>
>
_______________________________________________
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