diff options
Diffstat (limited to 'sw/source/ui/envelp/envfmt.cxx')
-rw-r--r-- | sw/source/ui/envelp/envfmt.cxx | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx index d0d608a8bb..381ec6cd1e 100644 --- a/sw/source/ui/envelp/envfmt.cxx +++ b/sw/source/ui/envelp/envfmt.cxx @@ -112,7 +112,7 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) : SetExchangeSupport(); // Metrics - FieldUnit aMetric = ::GetDfltMetric(FALSE); + FieldUnit aMetric = ::GetDfltMetric(sal_False); SetMetric(aAddrLeftField, aMetric); SetMetric(aAddrTopField, aMetric); SetMetric(aSendLeftField, aMetric); @@ -157,29 +157,29 @@ SwEnvFmtPage::SwEnvFmtPage(Window* pParent, const SfxItemSet& rSet) : aSizeFormatBox .SetSelectHdl(LINK(this, SwEnvFmtPage, FormatHdl)); // aSizeFormatBox - for (USHORT i = PAPER_A3; i <= PAPER_KAI32BIG; i++) + for (sal_uInt16 i = PAPER_A3; i <= PAPER_KAI32BIG; i++) { if (i != PAPER_USER) { String aPaperName = SvxPaperInfo::GetName((Paper) i), aEntryName; - USHORT nPos = 0; - BOOL bFound = FALSE; + sal_uInt16 nPos = 0; + sal_Bool bFound = sal_False; while (nPos < aSizeFormatBox.GetEntryCount() && !bFound) { aEntryName = aSizeFormatBox.GetEntry(i); if (aEntryName < aPaperName) nPos++; else - bFound = TRUE; + bFound = sal_True; } aSizeFormatBox.InsertEntry(aPaperName, nPos); - aIDs.Insert((USHORT) i, nPos); + aIDs.Insert((sal_uInt16) i, nPos); } } aSizeFormatBox.InsertEntry(SvxPaperInfo::GetName(PAPER_USER)); - aIDs.Insert((USHORT) PAPER_USER, aIDs.Count()); + aIDs.Insert((sal_uInt16) PAPER_USER, aIDs.Count()); } @@ -201,13 +201,13 @@ IMPL_LINK_INLINE_START( SwEnvFmtPage, ModifyHdl, Edit *, pEdit ) if (pEdit == &aSizeWidthField || pEdit == &aSizeHeightField) { Paper ePaper = SvxPaperInfo::GetSvxPaper( - Size(lHeight, lWidth), MAP_TWIP, TRUE); - for (USHORT i = 0; i < aIDs.Count(); i++) - if (aIDs[i] == (USHORT)ePaper) + Size(lHeight, lWidth), MAP_TWIP, sal_True); + for (sal_uInt16 i = 0; i < aIDs.Count(); i++) + if (aIDs[i] == (sal_uInt16)ePaper) aSizeFormatBox.SelectEntryPos(i); // remember user size - if (aIDs[aSizeFormatBox.GetSelectEntryPos()] == (USHORT)PAPER_USER) + if (aIDs[aSizeFormatBox.GetSelectEntryPos()] == (sal_uInt16)PAPER_USER) { lUserW = lWidth ; lUserH = lHeight; @@ -231,9 +231,9 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) OSL_ENSURE(pSh, "Shell missing"); // determine collection-ptr - BOOL bSender = pButton != &aAddrEditButton; + sal_Bool bSender = pButton != &aAddrEditButton; - SwTxtFmtColl* pColl = pSh->GetTxtCollFromPool( static_cast< USHORT >( + SwTxtFmtColl* pColl = pSh->GetTxtCollFromPool( static_cast< sal_uInt16 >( bSender ? RES_POOLCOLL_SENDADRESS : RES_POOLCOLL_JAKETADRESS)); OSL_ENSURE(pColl, "Text collection missing"); @@ -251,7 +251,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) const SfxPoolItem *pTmpBrush; if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_CHRATR_BACKGROUND, - TRUE, &pTmpBrush ) ) + sal_True, &pTmpBrush ) ) { SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) ); aTmpBrush.SetWhich( RES_BACKGROUND ); @@ -269,7 +269,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) { SfxItemSet aOutputSet( *pDlg->GetOutputItemSet() ); if( SFX_ITEM_SET == aOutputSet.GetItemState( RES_BACKGROUND, - FALSE, &pTmpBrush ) ) + sal_False, &pTmpBrush ) ) { SvxBrushItem aTmpBrush( *((SvxBrushItem*)pTmpBrush) ); aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND ); @@ -294,7 +294,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) const SvxTabStopItem& rDefTabs = (const SvxTabStopItem&) pSh->GetView().GetCurShell()->GetPool().GetDefaultItem(RES_PARATR_TABSTOP); - USHORT nDefDist = ::GetTabDist( rDefTabs ); + sal_uInt16 nDefDist = ::GetTabDist( rDefTabs ); SfxUInt16Item aDefDistItem( SID_ATTR_TABSTOP_DEFAULTS, nDefDist ); aTmpSet.Put( aDefDistItem ); @@ -318,10 +318,10 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) // maybe relocate defaults const SfxPoolItem* pItem = 0; SfxItemSet* pOutputSet = (SfxItemSet*)pDlg->GetOutputItemSet(); - USHORT nNewDist; + sal_uInt16 nNewDist; if( SFX_ITEM_SET == pOutputSet->GetItemState( SID_ATTR_TABSTOP_DEFAULTS, - FALSE, &pItem ) && + sal_False, &pItem ) && nDefDist != (nNewDist = ((SfxUInt16Item*)pItem)->GetValue()) ) { SvxTabStopItem aDefTabs( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); @@ -345,16 +345,16 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton ) Description: A temporary Itemset that gets discarded at abort ------------------------------------------------------------------------*/ -SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, BOOL bSender) +SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, sal_Bool bSender) { SfxItemSet *&pAddrSet = bSender ? GetParent()->pSenderSet : GetParent()->pAddresseeSet; if (!pAddrSet) { // determine range (merge both Itemsets' ranges) - const USHORT *pRanges = pColl->GetAttrSet().GetRanges(); + const sal_uInt16 *pRanges = pColl->GetAttrSet().GetRanges(); - static USHORT const aRanges[] = + static sal_uInt16 const aRanges[] = { RES_PARATR_BEGIN, RES_PARATR_ADJUST, RES_PARATR_TABSTOP, RES_PARATR_END-1, @@ -368,12 +368,12 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, BOOL bSender) }; // BruteForce merge because MergeRange in SvTools is buggy: - USHORT i = 0; + sal_uInt16 i = 0; SvLongsSort aMergedRanges( 0, 10 ); while (pRanges[i]) { - for (USHORT nPos = pRanges[i]; nPos <= pRanges[i+1]; nPos++) + for (sal_uInt16 nPos = pRanges[i]; nPos <= pRanges[i+1]; nPos++) aMergedRanges.Insert(nPos); i += 2; } @@ -382,13 +382,13 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, BOOL bSender) while (aRanges[i]) { - for (USHORT nPos = aRanges[i]; nPos <= aRanges[i+1]; nPos++) + for (sal_uInt16 nPos = aRanges[i]; nPos <= aRanges[i+1]; nPos++) aMergedRanges.Insert(nPos); i += 2; } // compact ranges - std::vector<USHORT> aCompactedRanges; + std::vector<sal_uInt16> aCompactedRanges; aCompactedRanges.push_back(aMergedRanges[0]); @@ -408,7 +408,7 @@ SfxItemSet *SwEnvFmtPage::GetCollItemSet(SwTxtFmtColl* pColl, BOOL bSender) } // create new ranges - USHORT *pNewRanges = new USHORT[aCompactedRanges.size() + 1]; + sal_uInt16 *pNewRanges = new sal_uInt16[aCompactedRanges.size() + 1]; for (i = 0; i < aCompactedRanges.size(); ++i) pNewRanges[i] = aCompactedRanges[i]; @@ -433,8 +433,8 @@ IMPL_LINK( SwEnvFmtPage, FormatHdl, ListBox *, EMPTYARG ) long lAddrFromLeft; long lAddrFromTop; - USHORT nPaper = aIDs[aSizeFormatBox.GetSelectEntryPos()]; - if (nPaper != (USHORT)PAPER_USER) + sal_uInt16 nPaper = aIDs[aSizeFormatBox.GetSelectEntryPos()]; + if (nPaper != (sal_uInt16)PAPER_USER) { Size aSz = SvxPaperInfo::GetPaperSize((Paper)nPaper); lWidth = Max(aSz.Width(), aSz.Height()); @@ -529,8 +529,8 @@ void SwEnvFmtPage::FillItem(SwEnvItem& rItem) rItem.lSendFromLeft = static_cast< sal_Int32 >(GetFldVal(aSendLeftField)); rItem.lSendFromTop = static_cast< sal_Int32 >(GetFldVal(aSendTopField )); - USHORT nPaper = aIDs[aSizeFormatBox.GetSelectEntryPos()]; - if (nPaper == (USHORT)PAPER_USER) + sal_uInt16 nPaper = aIDs[aSizeFormatBox.GetSelectEntryPos()]; + if (nPaper == (sal_uInt16)PAPER_USER) { long lWVal = static_cast< long >(GetFldVal(aSizeWidthField )); long lHVal = static_cast< long >(GetFldVal(aSizeHeightField)); @@ -546,11 +546,11 @@ void SwEnvFmtPage::FillItem(SwEnvItem& rItem) } } -BOOL SwEnvFmtPage::FillItemSet(SfxItemSet& rSet) +sal_Bool SwEnvFmtPage::FillItemSet(SfxItemSet& rSet) { FillItem(GetParent()->aEnvItem); rSet.Put(GetParent()->aEnvItem); - return TRUE; + return sal_True; } void SwEnvFmtPage::Reset(const SfxItemSet& rSet) @@ -559,9 +559,9 @@ void SwEnvFmtPage::Reset(const SfxItemSet& rSet) Paper ePaper = SvxPaperInfo::GetSvxPaper( Size( Min(rItem.lWidth, rItem.lHeight), - Max(rItem.lWidth, rItem.lHeight)), MAP_TWIP, TRUE); - for (USHORT i = 0; i < (USHORT) aIDs.Count(); i++) - if (aIDs[i] == (USHORT)ePaper) + Max(rItem.lWidth, rItem.lHeight)), MAP_TWIP, sal_True); + for (sal_uInt16 i = 0; i < (sal_uInt16) aIDs.Count(); i++) + if (aIDs[i] == (sal_uInt16)ePaper) aSizeFormatBox.SelectEntryPos(i); // Metric fields |