Kaydet (Commit) 2c1c6df2 authored tarafından Eike Rathke's avatar Eike Rathke

number format keys are sal_uInt32, so use it

Change-Id: I0adf5f443ed3348ca0b975bd64bd4a293ff30f79
üst 111f34ac
...@@ -1373,7 +1373,7 @@ XclExpNumFmtBuffer::~XclExpNumFmtBuffer() ...@@ -1373,7 +1373,7 @@ XclExpNumFmtBuffer::~XclExpNumFmtBuffer()
{ {
} }
sal_uInt16 XclExpNumFmtBuffer::Insert( sal_uLong nScNumFmt ) sal_uInt16 XclExpNumFmtBuffer::Insert( sal_uInt32 nScNumFmt )
{ {
XclExpNumFmtVec::const_iterator aIt = XclExpNumFmtVec::const_iterator aIt =
::std::find_if( maFormatMap.begin(), maFormatMap.end(), XclExpNumFmtPred( nScNumFmt ) ); ::std::find_if( maFormatMap.begin(), maFormatMap.end(), XclExpNumFmtPred( nScNumFmt ) );
...@@ -1433,14 +1433,14 @@ void XclExpNumFmtBuffer::WriteFormatRecord( XclExpStream& rStrm, const XclExpNum ...@@ -1433,14 +1433,14 @@ void XclExpNumFmtBuffer::WriteFormatRecord( XclExpStream& rStrm, const XclExpNum
namespace { namespace {
OUString GetNumberFormatCode(XclRoot& rRoot, const sal_uInt16 nScNumFmt, SvNumberFormatter* pFormatter, NfKeywordTable* pKeywordTable) OUString GetNumberFormatCode(XclRoot& rRoot, const sal_uInt32 nScNumFmt, SvNumberFormatter* pFormatter, NfKeywordTable* pKeywordTable)
{ {
return rRoot.GetFormatter().GetFormatStringForExcel( nScNumFmt, *pKeywordTable, *pFormatter); return rRoot.GetFormatter().GetFormatStringForExcel( nScNumFmt, *pKeywordTable, *pFormatter);
} }
} }
OUString XclExpNumFmtBuffer::GetFormatCode( sal_uInt16 nScNumFmt ) OUString XclExpNumFmtBuffer::GetFormatCode( sal_uInt32 nScNumFmt )
{ {
return GetNumberFormatCode( *this, nScNumFmt, mxFormatter.get(), mpKeywordTable.get() ); return GetNumberFormatCode( *this, nScNumFmt, mxFormatter.get(), mpKeywordTable.get() );
} }
...@@ -3027,7 +3027,7 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot ) ...@@ -3027,7 +3027,7 @@ XclExpDxfs::XclExpDxfs( const XclExpRoot& rRoot )
const SfxPoolItem *pPoolItem = nullptr; const SfxPoolItem *pPoolItem = nullptr;
if( rSet.GetItemState( ATTR_VALUE_FORMAT, true, &pPoolItem ) == SfxItemState::SET ) if( rSet.GetItemState( ATTR_VALUE_FORMAT, true, &pPoolItem ) == SfxItemState::SET )
{ {
sal_uLong nScNumFmt = static_cast< const SfxUInt32Item* >(pPoolItem)->GetValue(); sal_uInt32 nScNumFmt = static_cast< const SfxUInt32Item* >(pPoolItem)->GetValue();
sal_Int32 nXclNumFmt = GetRoot().GetNumFmtBuffer().Insert(nScNumFmt); sal_Int32 nXclNumFmt = GetRoot().GetNumFmtBuffer().Insert(nScNumFmt);
pNumFormat = new XclExpNumFmt( nScNumFmt, nXclNumFmt, GetNumberFormatCode( *this, nScNumFmt, mxFormatter.get(), mpKeywordTable.get() )); pNumFormat = new XclExpNumFmt( nScNumFmt, nXclNumFmt, GetNumberFormatCode( *this, nScNumFmt, mxFormatter.get(), mpKeywordTable.get() ));
} }
......
...@@ -821,12 +821,12 @@ XclExpFormulaCell::XclExpFormulaCell( ...@@ -821,12 +821,12 @@ XclExpFormulaCell::XclExpFormulaCell(
XclExpNumFmtBuffer& rNumFmtBfr = rRoot.GetNumFmtBuffer(); XclExpNumFmtBuffer& rNumFmtBfr = rRoot.GetNumFmtBuffer();
// current cell number format // current cell number format
sal_uLong nScNumFmt = pPattern ? sal_uInt32 nScNumFmt = pPattern ?
GETITEMVALUE( pPattern->GetItemSet(), SfxUInt32Item, ATTR_VALUE_FORMAT, sal_uLong ) : GETITEMVALUE( pPattern->GetItemSet(), SfxUInt32Item, ATTR_VALUE_FORMAT, sal_uLong ) :
rNumFmtBfr.GetStandardFormat(); rNumFmtBfr.GetStandardFormat();
// alternative number format passed to XF buffer // alternative number format passed to XF buffer
sal_uLong nAltScNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND; sal_uInt32 nAltScNumFmt = NUMBERFORMAT_ENTRY_NOT_FOUND;
/* Xcl doesn't know Boolean number formats, we write /* Xcl doesn't know Boolean number formats, we write
"TRUE";"FALSE" (language dependent). Don't do it for automatic "TRUE";"FALSE" (language dependent). Don't do it for automatic
formula formats, because Excel gets them right. */ formula formats, because Excel gets them right. */
......
...@@ -268,11 +268,11 @@ private: ...@@ -268,11 +268,11 @@ private:
/** Stores a core number format index with corresponding Excel format index. */ /** Stores a core number format index with corresponding Excel format index. */
struct XclExpNumFmt struct XclExpNumFmt
{ {
sal_uLong mnScNumFmt; /// Core index of the number format. sal_uInt32 mnScNumFmt; /// Core index of the number format.
sal_uInt16 mnXclNumFmt; /// Resulting Excel format index. sal_uInt16 mnXclNumFmt; /// Resulting Excel format index.
OUString maNumFmtString; /// format string OUString maNumFmtString; /// format string
inline explicit XclExpNumFmt( sal_uLong nScNumFmt, sal_uInt16 nXclNumFmt, const OUString& rFrmt ) : inline explicit XclExpNumFmt( sal_uInt32 nScNumFmt, sal_uInt16 nXclNumFmt, const OUString& rFrmt ) :
mnScNumFmt( nScNumFmt ), mnXclNumFmt( nXclNumFmt ), maNumFmtString( rFrmt ) {} mnScNumFmt( nScNumFmt ), mnXclNumFmt( nXclNumFmt ), maNumFmtString( rFrmt ) {}
void SaveXml( XclExpXmlStream& rStrm ); void SaveXml( XclExpXmlStream& rStrm );
...@@ -289,12 +289,12 @@ public: ...@@ -289,12 +289,12 @@ public:
virtual ~XclExpNumFmtBuffer(); virtual ~XclExpNumFmtBuffer();
/** Returns the core index of the current standard number format. */ /** Returns the core index of the current standard number format. */
inline sal_uLong GetStandardFormat() const { return mnStdFmt; } inline sal_uInt32 GetStandardFormat() const { return mnStdFmt; }
/** Inserts a number format into the format buffer. /** Inserts a number format into the format buffer.
@param nScNumFmt The core index of the number format. @param nScNumFmt The core index of the number format.
@return The resulting Excel format index. */ @return The resulting Excel format index. */
sal_uInt16 Insert( sal_uLong nScNumFmt ); sal_uInt16 Insert( sal_uInt32 nScNumFmt );
/** Writes all FORMAT records contained in this buffer. */ /** Writes all FORMAT records contained in this buffer. */
virtual void Save( XclExpStream& rStrm ) override; virtual void Save( XclExpStream& rStrm ) override;
...@@ -306,7 +306,7 @@ private: ...@@ -306,7 +306,7 @@ private:
/** Writes the FORMAT record represented by rFormat. */ /** Writes the FORMAT record represented by rFormat. */
void WriteFormatRecord( XclExpStream& rStrm, const XclExpNumFmt& rFormat ); void WriteFormatRecord( XclExpStream& rStrm, const XclExpNumFmt& rFormat );
OUString GetFormatCode ( sal_uInt16 nScNumFmt ); OUString GetFormatCode ( sal_uInt32 nScNumFmt );
private: private:
typedef ::std::vector< XclExpNumFmt > XclExpNumFmtVec; typedef ::std::vector< XclExpNumFmt > XclExpNumFmtVec;
...@@ -314,7 +314,7 @@ private: ...@@ -314,7 +314,7 @@ private:
SvNumberFormatterPtr mxFormatter; /// Special number formatter for conversion. SvNumberFormatterPtr mxFormatter; /// Special number formatter for conversion.
XclExpNumFmtVec maFormatMap; /// Maps core formats to Excel indexes. XclExpNumFmtVec maFormatMap; /// Maps core formats to Excel indexes.
std::unique_ptr<NfKeywordTable> mpKeywordTable; /// Replacement table. std::unique_ptr<NfKeywordTable> mpKeywordTable; /// Replacement table.
sal_uLong mnStdFmt; /// Key for standard number format. sal_uInt32 mnStdFmt; /// Key for standard number format.
sal_uInt16 mnXclOffset; /// Offset to first user defined format. sal_uInt16 mnXclOffset; /// Offset to first user defined format.
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment