Sergey Khodych wrote:
From a2bf101f7ede3937373b7b8f9e2a8ea032b7790d Mon Sep 17 00:00:00 2001 From: Sergey Khodych khodych@gmail.com Date: Mon, 25 May 2009 02:21:39 +0300 Subject: comctl32:rebar: Don't store an empty string in REBAR_InsertBandT.
dlls/comctl32/rebar.c | 12 ++++++++---- dlls/comctl32/tests/rebar.c | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-)
Where did you test that it isn't stored?
Nikolay Sivov пишет:
Where did you test that it isn't stored?
The patch fixes a bug when wine allocates an extra space for a band with an empty string. I replaced NULL by "" in the size test to show the native realization doesn't change its behavior unlike wine in this case.
Sergey Khodych wrote:
Nikolay Sivov пишет:
Where did you test that it isn't stored?
The patch fixes a bug when wine allocates an extra space for a band with an empty string. I replaced NULL by "" in the size test to show the native realization doesn't change its behavior unlike wine in this case.
Ok. All todos for Rebar tests are about colors. You could check it at test.winehq.org. So there's no reason to touch tests that already pass.
It looks like you need to add a simple test like that: - add band with empty string and RBBIM_TEXT mask of course; - query band data back with RB_GETBANDINFO and check this lpText field.
If it's really NULL (e.g. your buffer didn't change) instead of empty string you should test RB_SETBARINFO for the same case.
What you mean saying extra space? Some offset during drawing or what?
Nikolay Sivov пишет:
It looks like you need to add a simple test like that:
- add band with empty string and RBBIM_TEXT mask of course;
- query band data back with RB_GETBANDINFO and check this lpText field.
If it's really NULL (e.g. your buffer didn't change) instead of empty string you should test RB_SETBARINFO for the same case.
It returns an empty string in both case.
What you mean saying extra space? Some offset during drawing or what?
If a band has an empty string, wine allocates a padding space in lpBand->rcCapText that causes an offset in a band.
Sergey Khodych wrote:
Nikolay Sivov пишет:
It looks like you need to add a simple test like that:
- add band with empty string and RBBIM_TEXT mask of course;
- query band data back with RB_GETBANDINFO and check this lpText field.
If it's really NULL (e.g. your buffer didn't change) instead of empty string you should test RB_SETBARINFO for the same case.
It returns an empty string in both case.
So adding a band with NULL text OR empty string always returned empty string to getter? Provide a test case for that please.
If it already returns empty when needed there's no point to change storing code.
What you mean saying extra space? Some offset during drawing or what?
If a band has an empty string, wine allocates a padding space in lpBand->rcCapText that causes an offset in a band.
It looks like a workaround, if get/set text behaves ok now (no tests exist I suppose) then the only place to be changed is this rectangle dimensions.
Nikolay Sivov пишет:
If a band has an empty string, wine allocates a padding space in lpBand->rcCapText that causes an offset in a band.
It looks like a workaround, if get/set text behaves ok now (no tests exist I suppose) then the only place to be changed is this rectangle dimensions.
Why does wine need to keep an empty string when native realization doesn't distinguish "" and NULL (according to tests)?
Sergey Khodych wrote:
Nikolay Sivov пишет:
If a band has an empty string, wine allocates a padding space in lpBand->rcCapText that causes an offset in a band.
It looks like a workaround, if get/set text behaves ok now (no tests exist I suppose) then the only place to be changed is this rectangle dimensions.
Why does wine need to keep an empty string when native realization doesn't distinguish "" and NULL (according to tests)?
If it's indistinguishable at all - invisible for get/set and has no side effect on drawing for example - we don't need to store it of course. That's why I'm asking you about tests. Just add 2 tests as a first patch:
- set/get (to prevent regressions here if somebody will try later to adjust rectangle and still store empty strings); it should include both InsertBand and SetBandInfo. - dimension check.
And a fix for them as a second patch.
Nikolay S.