Review Request 119527: Added feature of creating report's items of specific size at adding time

Jarosław Staniek staniek at kde.org
Tue Jul 29 17:19:30 BST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119527/#review63448
-----------------------------------------------------------


Thanks!


libs/koreport/items/check/KoReportDesignerItemCheck.cpp
<https://git.reviewboard.kde.org/r/119527/#comment44226>

    1. How about moving this code to KoReportDesignerItemRectBase ctor?
    
    And add virtual QSizeF KoReportDesignerItemRectBase::minimumSize() const = 0; which you'll implement in subclasses. There, sometimes you want to return getTextRect().size(), sometimes yoyu want to return QSizeF(5, 5), etc.
    
    2. m_userWidth/m_userHeight are not needed if you can just use r->countHeight() and r->countWidth(). That's typical overuse of member variables.
    
    3. Give the fixes I propsed below, m_user* members can be equal to -1. Check this and if either is -1, use default size.



libs/koreport/items/image/KoReportDesignerItemImage.cpp
<https://git.reviewboard.kde.org/r/119527/#comment44232>

    setSceneRect() not needed here?



libs/koreport/wrtembed/KoReportDesigner.h
<https://git.reviewboard.kde.org/r/119527/#comment44231>

    1. Add some dox comment explaining why do you need these members.
    
    2. Isn't it enough to make them private?
    
    3. All of them should be initialized ideally to -1, else countHeight()/Width will return random values when no events happened.



libs/koreport/wrtembed/KoReportDesigner.cpp
<https://git.reviewboard.kde.org/r/119527/#comment44229>

    1. The name sugest it's some height of the designer. I propose selectionHeight() / Width.
    
    2. Make the methods const.
    
    3. Coding style...
    
    4. Return -1 here if m_release* or m_press is -1 (i.e. uninitialized).



libs/koreport/wrtembed/KoReportDesignerItemLine.cpp
<https://git.reviewboard.kde.org/r/119527/#comment44227>

    cannot this line be moved to init() for both ctors?



libs/koreport/wrtembed/KoReportDesignerItemRectBase.h
<https://git.reviewboard.kde.org/r/119527/#comment44228>

    It's safer to make these members 'const qreal'.


- Jarosław Staniek


On July 29, 2014, 12:24 a.m., Wojciech Kosowicz wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119527/
> -----------------------------------------------------------
> 
> (Updated July 29, 2014, 12:24 a.m.)
> 
> 
> Review request for Calligra, Adam Pigg and Jarosław Staniek.
> 
> 
> Bugs: 334967
>     http://bugs.kde.org/show_bug.cgi?id=334967
> 
> 
> Repository: calligra
> 
> 
> Description
> -------
> 
> If the specified dimensions are improper or too small elements get their defaults size
> 
> 
> Diffs
> -----
> 
>   libs/koreport/items/check/KoReportDesignerItemCheck.cpp 5bebc6c 
>   libs/koreport/items/field/KoReportDesignerItemField.cpp 0dc9325 
>   libs/koreport/items/image/KoReportDesignerItemImage.cpp 87e46a1 
>   libs/koreport/items/label/KoReportDesignerItemLabel.cpp 8974a80 
>   libs/koreport/items/text/KoReportDesignerItemText.cpp 51e12d3 
>   libs/koreport/wrtembed/KoReportDesigner.h adc712a 
>   libs/koreport/wrtembed/KoReportDesigner.cpp 63152a7 
>   libs/koreport/wrtembed/KoReportDesignerItemLine.h 894cec9 
>   libs/koreport/wrtembed/KoReportDesignerItemLine.cpp 1b0474d 
>   libs/koreport/wrtembed/KoReportDesignerItemRectBase.h b53a58e 
>   libs/koreport/wrtembed/KoReportDesignerItemRectBase.cpp 53c3727 
>   libs/koreport/wrtembed/reportsceneview.h cc3ab9f 
>   libs/koreport/wrtembed/reportsceneview.cpp 2b679a4 
>   plugins/reporting/barcode/KoReportDesignerItemBarcode.cpp b4fb621 
>   plugins/reporting/maps/KoReportDesignerItemMaps.cpp f624db3 
>   plugins/reporting/web/KoReportDesignerItemWeb.cpp 63e1cc9 
> 
> Diff: https://git.reviewboard.kde.org/r/119527/diff/
> 
> 
> Testing
> -------
> 
> When adding any element in kexi report it will the same size as specified by the user at the moment of adding
> 
> 
> Thanks,
> 
> Wojciech Kosowicz
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20140729/447c76d2/attachment.htm>


More information about the calligra-devel mailing list