lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Direct use of wx data members [Was: Is this wxXRC change safe?]


From: Greg Chicares
Subject: [lmi] Direct use of wx data members [Was: Is this wxXRC change safe?]
Date: Sat, 24 Feb 2018 02:47:21 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

On 2018-02-24 02:14, Greg Chicares wrote:
> It seems odd that a wx data member is accessed directly here:

...and also here:

$grep '\<m_' ledger_pdf_generator_wx.cpp
[...]
        m_Width  = wxRound(image.GetWidth () / scale_factor);
        m_Height = wxRound(image.GetHeight() / scale_factor);
        x += m_PosX;
        int pos_y = y + m_PosY;
            m_WParser->GetContainer()->InsertCell
        m_Height = render_or_measure(0, oe_only_measure);
        render_or_measure(y + m_PosY, oe_render);
        m_WParser->GetContainer()->InsertCell(new numeric_summary_table_cell());

Ideally we'd use only public, documented getters and setters,
which don't seem to be provided yet. E.g., here:
  http://docs.wxwidgets.org/3.1/classwx_html_cell.html
I see GetWidth() const, but the first line of code above needs to
modify the width. This is unlikely to be a real issue today, but
in the long term it seems fragile.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]