summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-06-13 11:35:14 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-06-13 11:43:07 +0100
commitceadb769db5e0d203b8366018133a0b614055cd0 (patch)
treee774ef189a546c2615e59f0c80c2d498fc0d8165 /editeng
parent67bc85682d8a585121844d9cc10e8268587aa1a5 (diff)
lets make this sal_Int32 on all platforms
Diffstat (limited to 'editeng')
-rw-r--r--editeng/inc/editeng/tstpitem.hxx17
-rw-r--r--editeng/source/editeng/impedit.hxx2
-rw-r--r--editeng/source/editeng/impedit4.cxx9
-rw-r--r--editeng/source/items/paraitem.cxx18
4 files changed, 19 insertions, 27 deletions
diff --git a/editeng/inc/editeng/tstpitem.hxx b/editeng/inc/editeng/tstpitem.hxx
index a95825e33e01..f15a5d194347 100644
--- a/editeng/inc/editeng/tstpitem.hxx
+++ b/editeng/inc/editeng/tstpitem.hxx
@@ -45,7 +45,7 @@
class EDITENG_DLLPUBLIC SvxTabStop
{
private:
- long nTabPos;
+ sal_Int32 nTabPos;
SvxTabAdjust eAdjustment;
mutable sal_Unicode m_cDecimal;
@@ -57,20 +57,13 @@ private:
public:
SvxTabStop();
-#if (_MSC_VER < 1300)
- SvxTabStop( const long nPos,
+ SvxTabStop( const sal_Int32 nPos,
const SvxTabAdjust eAdjst = SVX_TAB_ADJUST_LEFT,
const sal_Unicode cDec = cDfltDecimalChar,
const sal_Unicode cFil = cDfltFillChar );
-#else
- SvxTabStop::SvxTabStop( const long nPos,
- const SvxTabAdjust eAdjst = SVX_TAB_ADJUST_LEFT,
- const sal_Unicode cDec = cDfltDecimalChar,
- const sal_Unicode cFil = cDfltFillChar );
-#endif
- long& GetTabPos() { return nTabPos; }
- long GetTabPos() const { return nTabPos; }
+ sal_Int32& GetTabPos() { return nTabPos; }
+ sal_Int32 GetTabPos() const { return nTabPos; }
SvxTabAdjust& GetAdjustment() { return eAdjustment; }
SvxTabAdjust GetAdjustment() const { return eAdjustment; }
@@ -135,7 +128,7 @@ public:
sal_uInt16 GetPos( const SvxTabStop& rTab ) const;
// Returns index of the tab at nPos, or TAB_NOTFOUND
- sal_uInt16 GetPos( const long nPos ) const;
+ sal_uInt16 GetPos( const sal_Int32 nPos ) const;
// unprivatized:
sal_uInt16 Count() const { return SvxTabStopArr::Count(); }
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 8b74795e875a..108c2f4d2add 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -650,7 +650,7 @@ private:
SvxFontTable& rFontTable, SvxColorList& rColorList );
sal_Bool WriteItemListAsRTF( ItemList& rLst, SvStream& rOutput, sal_uInt16 nPara, sal_uInt16 nPos,
SvxFontTable& rFontTable, SvxColorList& rColorList );
- long LogicToTwips( long n );
+ sal_Int32 LogicToTwips( sal_Int32 n );
inline short GetXValue( short nXValue ) const;
inline sal_uInt16 GetXValue( sal_uInt16 nXValue ) const;
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 871b34ebbffa..d6906b1fc7b2 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -761,7 +761,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
case EE_PARA_SBL:
{
rOutput << OOO_STRING_SVTOOLS_RTF_SL;
- long nVal = ((const SvxLineSpacingItem&)rItem).GetLineHeight();
+ sal_Int32 nVal = ((const SvxLineSpacingItem&)rItem).GetLineHeight();
char cMult = '0';
if ( ((const SvxLineSpacingItem&)rItem).GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP )
{
@@ -822,7 +822,7 @@ void ImpEditEngine::WriteItemAsRTF( const SfxPoolItem& rItem, SvStream& rOutput,
case EE_CHAR_FONTHEIGHT_CTL:
{
rOutput << OOO_STRING_SVTOOLS_RTF_FS;
- long nHeight = ((const SvxFontHeightItem&)rItem).GetHeight();
+ sal_Int32 nHeight = ((const SvxFontHeightItem&)rItem).GetHeight();
nHeight = LogicToTwips( nHeight );
// Twips => HalfPoints
nHeight /= 10;
@@ -3082,13 +3082,12 @@ sal_Bool ImpEditEngine::ImplHasText() const
return ( ( GetEditDoc().Count() > 1 ) || GetEditDoc().GetObject(0)->Len() );
}
-long ImpEditEngine::LogicToTwips( long n )
+sal_Int32 ImpEditEngine::LogicToTwips(sal_Int32 n)
{
- Size aSz( n, 0 );
+ Size aSz(n, 0);
MapMode aTwipsMode( MAP_TWIP );
aSz = pRefDev->LogicToLogic( aSz, NULL, &aTwipsMode );
return aSz.Width();
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx
index b35c9657098f..066d2da7667d 100644
--- a/editeng/source/items/paraitem.cxx
+++ b/editeng/source/items/paraitem.cxx
@@ -869,7 +869,7 @@ SvxTabStop::SvxTabStop()
// -----------------------------------------------------------------------
-SvxTabStop::SvxTabStop( const long nPos, const SvxTabAdjust eAdjst,
+SvxTabStop::SvxTabStop( const sal_Int32 nPos, const SvxTabAdjust eAdjst,
const sal_Unicode cDec, const sal_Unicode cFil )
{
nTabPos = nPos;
@@ -961,7 +961,7 @@ sal_uInt16 SvxTabStopItem::GetPos( const SvxTabStop& rTab ) const
// -----------------------------------------------------------------------
-sal_uInt16 SvxTabStopItem::GetPos( const long nPos ) const
+sal_uInt16 SvxTabStopItem::GetPos( const sal_Int32 nPos ) const
{
sal_uInt16 nFound;
return Seek_Entry( SvxTabStop( nPos ), &nFound ) ? nFound : SVX_TAB_NOTFOUND;
@@ -1158,7 +1158,7 @@ SfxItemPresentation SvxTabStopItem::GetPresentation
if ( bComma )
rText += sal_Unicode(',');
rText += GetMetricText(
- (long)((*this)[i]).GetTabPos(), eCoreUnit, ePresUnit, pIntl );
+ ((*this)[i]).GetTabPos(), eCoreUnit, ePresUnit, pIntl );
if ( SFX_ITEM_PRESENTATION_COMPLETE == ePres )
rText += EE_RESSTR(GetMetricId(ePresUnit));
bComma = sal_True;
@@ -1179,7 +1179,7 @@ SfxPoolItem* SvxTabStopItem::Create( SvStream& rStrm, sal_uInt16 ) const
for ( sal_Int8 i = 0; i < nTabs; i++ )
{
- long nPos;
+ sal_Int32 nPos(0);
sal_Int8 eAdjust;
unsigned char cDecimal, cFill;
rStrm >> nPos >> eAdjust >> cDecimal >> cFill;
@@ -1205,21 +1205,21 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ )
const short nTabs = Count();
sal_uInt16 nCount = 0, nDefDist = 0;
- long nNew = 0;
+ sal_Int32 nNew = 0;
if( bStoreDefTabs )
{
const SvxTabStopItem& rDefTab = (const SvxTabStopItem &)
pPool->GetDefaultItem( pPool->GetWhich( SID_ATTR_TABSTOP, sal_False ) );
nDefDist = sal_uInt16( rDefTab.GetStart()->GetTabPos() );
- const long nPos = nTabs > 0 ? (*this)[nTabs-1].GetTabPos() : 0;
+ const sal_Int32 nPos = nTabs > 0 ? (*this)[nTabs-1].GetTabPos() : 0;
nCount = (sal_uInt16)(nPos / nDefDist);
nNew = (nCount + 1) * nDefDist;
if( nNew <= nPos + 50 )
nNew += nDefDist;
- long lA3Width = SvxPaperInfo::GetPaperSize(PAPER_A3).Width();
+ sal_Int32 lA3Width = SvxPaperInfo::GetPaperSize(PAPER_A3).Width();
nCount = (sal_uInt16)(nNew < lA3Width ? ( lA3Width - nNew ) / nDefDist + 1 : 0);
}
@@ -1227,7 +1227,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ )
for ( short i = 0; i < nTabs; i++ )
{
const SvxTabStop& rTab = (*this)[ i ];
- rStrm << (long) rTab.GetTabPos()
+ rStrm << rTab.GetTabPos()
<< (sal_Int8) rTab.GetAdjustment()
<< (unsigned char) rTab.GetDecimal()
<< (unsigned char) rTab.GetFill();
@@ -1237,7 +1237,7 @@ SvStream& SvxTabStopItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ )
for( ; nCount; --nCount )
{
SvxTabStop aSwTabStop(nNew, SVX_TAB_ADJUST_DEFAULT);
- rStrm << (long) aSwTabStop.GetTabPos()
+ rStrm << aSwTabStop.GetTabPos()
<< (sal_Int8) aSwTabStop.GetAdjustment()
<< (unsigned char) aSwTabStop.GetDecimal()
<< (unsigned char) aSwTabStop.GetFill();