View | Details | Raw Unified | Return to issue 46511
Collapse All | Expand All

(-)svtools/inc/svtools/zforlist.hxx (+5 lines)
Lines 492-502 public: Link Here
492
    void GetOutputString( String& sString, sal_uInt32 nFIndex,
492
    void GetOutputString( String& sString, sal_uInt32 nFIndex,
493
                          String& sOutString, Color** ppColor );
493
                          String& sOutString, Color** ppColor );
494
494
495
    void GetStringColor( sal_uInt32 nFIndex, Color** ppColor );
496
495
    /** Format a number according to the standard default format matching
497
    /** Format a number according to the standard default format matching
496
        the given format index */
498
        the given format index */
497
    void GetInputLineString( const double& fOutNumber,
499
    void GetInputLineString( const double& fOutNumber,
498
                            sal_uInt32 nFIndex, String& sOutString );
500
                            sal_uInt32 nFIndex, String& sOutString );
499
501
502
    void GetInputLineString( const double& fOutNumber,
503
                             sal_uInt32 nFIndex, String& sOutString, Color** ppColor );
504
500
    /** Format a number according to a format code string to be scanned.
505
    /** Format a number according to a format code string to be scanned.
501
        @return
506
        @return
502
            <FALSE/> if format code contains an error
507
            <FALSE/> if format code contains an error
(-)svtools/inc/svtools/zformat.hxx (+1 lines)
Lines 241-246 public: Link Here
241
241
242
    BOOL GetOutputString( double fNumber, String& OutString, Color** ppColor );
242
    BOOL GetOutputString( double fNumber, String& OutString, Color** ppColor );
243
    BOOL GetOutputString( String& sString, String& OutString, Color** ppColor );
243
    BOOL GetOutputString( String& sString, String& OutString, Color** ppColor );
244
    void GetStringColor( Color** ppColor );
244
245
245
    // True if type text
246
    // True if type text
246
    BOOL IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; }
247
    BOOL IsTextFormat() const { return (eType & NUMBERFORMAT_TEXT) != 0; }
(-)svtools/source/numbers/zforlist.cxx (-2 / +30 lines)
Lines 1488-1496 void SvNumberFormatter::GetInputLineString(const double& fOutNumber, Link Here
1488
                                           sal_uInt32 nFIndex,
1488
                                           sal_uInt32 nFIndex,
1489
                                           String& sOutString)
1489
                                           String& sOutString)
1490
{
1490
{
1491
    Color* pColor;
1492
    GetInputLineString(fOutNumber, nFIndex, sOutString, &pColor);
1493
}
1494
1495
void SvNumberFormatter::GetInputLineString(const double& fOutNumber,
1496
                                           sal_uInt32 nFIndex,
1497
                                           String& sOutString, Color** ppColor)
1498
{
1491
    SvNumberformat* pFormat;
1499
    SvNumberformat* pFormat;
1492
    short nOldPrec;
1500
    short nOldPrec;
1493
    Color* pColor;
1494
    pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
1501
    pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
1495
    if (!pFormat)
1502
    if (!pFormat)
1496
        pFormat = aFTable.Get(ZF_STANDARD);
1503
        pFormat = aFTable.Get(ZF_STANDARD);
Lines 1531-1537 void SvNumberFormatter::GetInputLineString(const double& fOutNumber, Link Here
1531
            nOldPrec = pFormatScanner->GetStandardPrec();
1538
            nOldPrec = pFormatScanner->GetStandardPrec();
1532
            ChangeStandardPrec(300);						// Merkwert
1539
            ChangeStandardPrec(300);						// Merkwert
1533
        }
1540
        }
1534
        pFormat->GetOutputString(fOutNumber, sOutString, &pColor);
1541
        if (ppColor)
1542
            pFormat->GetOutputString(fOutNumber, sOutString, ppColor);
1543
        else
1544
        {
1545
            Color* pColor; // throw away the color info.
1546
            pFormat->GetOutputString(fOutNumber, sOutString, &pColor);
1547
        }
1535
    }
1548
    }
1536
    if (nOldPrec != -1)
1549
    if (nOldPrec != -1)
1537
        ChangeStandardPrec(nOldPrec);
1550
        ChangeStandardPrec(nOldPrec);
Lines 1574-1579 void SvNumberFormatter::GetOutputString(String& sString, Link Here
1574
    }
1587
    }
1575
}
1588
}
1576
1589
1590
void SvNumberFormatter::GetStringColor( sal_uInt32 nFIndex, Color** ppColor)
1591
{
1592
    if (!ppColor)
1593
        return;
1594
1595
    SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
1596
    if (!pFormat)
1597
        pFormat = aFTable.Get(ZF_STANDARD_TEXT);
1598
1599
    if (pFormat->IsTextFormat() || pFormat->HasTextFormat())
1600
        pFormat->GetStringColor(ppColor);
1601
    else
1602
        *ppColor = NULL;
1603
}
1604
1577
BOOL SvNumberFormatter::GetPreviewString(const String& sFormatString,
1605
BOOL SvNumberFormatter::GetPreviewString(const String& sFormatString,
1578
                                         double fPreviewNumber,
1606
                                         double fPreviewNumber,
1579
                                         String& sOutString,
1607
                                         String& sOutString,
(-)svtools/source/numbers/zformat.cxx (+19 lines)
Lines 1915-1920 BOOL SvNumberformat::GetOutputString(String& sString, Link Here
1915
    }
1915
    }
1916
    return FALSE;
1916
    return FALSE;
1917
}
1917
}
1918
1919
void SvNumberformat::GetStringColor( Color** ppColor )
1920
{
1921
    if (!ppColor)
1922
        return;
1923
1924
    USHORT nIx;
1925
    if (eType & NUMBERFORMAT_TEXT)
1926
        nIx = 0;
1927
    else if (NumFor[3].GetnAnz() > 0)
1928
        nIx = 3;
1929
    else
1930
    {
1931
        *ppColor = NULL;        // no change of color
1932
        return;
1933
    }
1934
    *ppColor = NumFor[nIx].GetColor();
1935
}
1936
1918
/*
1937
/*
1919
void SvNumberformat::GetNextFareyNumber(ULONG nPrec, ULONG x0, ULONG x1,
1938
void SvNumberformat::GetNextFareyNumber(ULONG nPrec, ULONG x0, ULONG x1,
1920
                                        ULONG y0, ULONG y1,
1939
                                        ULONG y0, ULONG y1,

Return to issue 46511