https://issues.apache.org/ooo/show_bug.cgi?id=122927

Oliver-Rainer Wittmann <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|[email protected] |[email protected]
                   |g                           |

--- Comment #18 from Oliver-Rainer Wittmann <[email protected]> ---
I had a look at the proposed solution.

The patch tries to restrict the changed formatting behavior (introduced by bug
121126) to cells whose set formatting code category
(<SvNumberformat::GetType()>) is not one of the number, date, currency one.
Return value of <SvNumberformat::GetType()> is checked.

While playing around having the proposed patch applied I figured out the
following.
- The definition NUMBERFORMAT_DEFINED (= 0x0001) has two purposes:
(1) Used for user-defined formatting code which could not be categories.
(2) Used as a flag for the other categories to indicate that it is a
user-defined one. E.g., for a user-defined currency formatting code the return
value of <SvNumberformat::GetType()> is 9 - "0x0008 | 0x0001"
(NUMBERFORMAT_CURRENCY is defined as 0x0008

Thus, I decided to adjust the proposed conditions accordingly:
...
const short nFmtType = (pNumFmt->GetType() & ~NUMBERFORMAT_DEFINED);
if ( nFmtType == NUMBERFORMAT_DATE
     || nFmtType == NUMBERFORMAT_TIME
     || nFmtType == NUMBERFORMAT_CURRENCY
     || nFmtType == NUMBERFORMAT_NUMBER
     || nFmtType == NUMBERFORMAT_SCIENTIFIC
     || nFmtType == NUMBERFORMAT_FRACTION
     || nFmtType == NUMBERFORMAT_PERCENT
     || nFmtType == NUMBERFORMAT_DATETIME
     || pNumFmt->GetType() == NUMBERFORMAT_DEFINED )
...

But afterwards, Microsoft Excel document attached to bug 121126 shows wrong
display for cells A5:A7. These cells have a user-defined number format -
NUMBERFORMAT_NUMBER | NUMBERFORMAT_DEFINED - set.

The idea of Clarence' solution makes sense, but does not provide the expected
result.

I think we need to search for another resp. improved solution.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.
You are watching all bug changes.

Reply via email to