summaryrefslogtreecommitdiff
path: root/sw/source/ui/chrdlg/drpcps.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/chrdlg/drpcps.cxx')
-rw-r--r--sw/source/ui/chrdlg/drpcps.cxx124
1 files changed, 62 insertions, 62 deletions
diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx
index f31e5d7dc7a7..e4b95c599071 100644
--- a/sw/source/ui/chrdlg/drpcps.cxx
+++ b/sw/source/ui/chrdlg/drpcps.cxx
@@ -89,7 +89,7 @@ using namespace ::com::sun::star::lang;
// Globals ******************************************************************
-static USHORT __FAR_DATA aPageRg[] = {
+static sal_uInt16 __FAR_DATA aPageRg[] = {
RES_PARATR_DROP, RES_PARATR_DROP,
0
};
@@ -104,14 +104,14 @@ class SwDropCapsPict : public Control
String maScriptText;
Color maBackColor;
Color maTextLineColor;
- BYTE mnLines;
+ sal_uInt8 mnLines;
long mnTotLineH;
long mnLineH;
long mnTextH;
- USHORT mnDistance;
+ sal_uInt16 mnDistance;
sal_Int32 mnLeading;
Printer* mpPrinter;
- BOOL mbDelPrinter;
+ sal_Bool mbDelPrinter;
SvULongs maTextWidth;
SvXub_StrLens maScriptChg;
SvUShorts maScriptType;
@@ -126,19 +126,19 @@ class SwDropCapsPict : public Control
Size CalcTextSize( void );
inline void InitPrinter( void );
void _InitPrinter( void );
- void GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, USHORT _nWhich );
+ void GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, sal_uInt16 _nWhich );
public:
SwDropCapsPict(Window *pParent, const ResId &rResId) :
- Control(pParent, rResId), mpPrinter( NULL ), mbDelPrinter( FALSE ) {}
+ Control(pParent, rResId), mpPrinter( NULL ), mbDelPrinter( sal_False ) {}
~SwDropCapsPict();
void UpdatePaintSettings( void ); // also invalidates control!
inline void SetText( const String& rT );
- inline void SetLines( BYTE nL );
- inline void SetDistance( USHORT nD );
- inline void SetValues( const String& rText, BYTE nLines, USHORT nDistance );
+ inline void SetLines( sal_uInt8 nL );
+ inline void SetDistance( sal_uInt16 nD );
+ inline void SetValues( const String& rText, sal_uInt8 nLines, sal_uInt16 nDistance );
void DrawPrev( const Point& rPt );
};
@@ -149,19 +149,19 @@ inline void SwDropCapsPict::SetText( const String& rT )
UpdatePaintSettings();
}
-inline void SwDropCapsPict::SetLines( BYTE nL )
+inline void SwDropCapsPict::SetLines( sal_uInt8 nL )
{
mnLines = nL;
UpdatePaintSettings();
}
-inline void SwDropCapsPict::SetDistance( USHORT nD )
+inline void SwDropCapsPict::SetDistance( sal_uInt16 nD )
{
mnDistance = nD;
UpdatePaintSettings();
}
-inline void SwDropCapsPict::SetValues( const String& rText, BYTE nLines, USHORT nDistance )
+inline void SwDropCapsPict::SetValues( const String& rText, sal_uInt8 nLines, sal_uInt16 nDistance )
{
maText = rText;
mnLines = nLines;
@@ -181,10 +181,10 @@ Default-String aus Zeichenanzahl erzeugen (A, AB, ABC, ...)
****************************************************************************/
-String GetDefaultString(USHORT nChars)
+String GetDefaultString(sal_uInt16 nChars)
{
String aStr;
- for (USHORT i = 0; i < nChars; i++)
+ for (sal_uInt16 i = 0; i < nChars; i++)
aStr += String((char) (i + 65));
return aStr;
}
@@ -218,7 +218,7 @@ Pict: Update Font
#define LINES 10
#define BORDER 2
-void SwDropCapsPict::GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, USHORT _nWhich )
+void SwDropCapsPict::GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, sal_uInt16 _nWhich )
{
SfxItemSet aSet( _rPage.rSh.GetAttrPool(), _nWhich, _nWhich);
_rPage.rSh.GetCurAttr(aSet);
@@ -261,7 +261,7 @@ void SwDropCapsPict::UpdatePaintSettings( void )
// CTL
GetFontSettings( *pPage, maCTLFont, RES_CHRATR_CTL_FONT );
- pPage->rSh.Pop(FALSE);
+ pPage->rSh.Pop(sal_False);
pPage->rSh.EndCrsrMove();
}
else
@@ -285,9 +285,9 @@ void SwDropCapsPict::UpdatePaintSettings( void )
maCJKFont.SetSize(Size(0, mnTextH));
maCTLFont.SetSize(Size(0, mnTextH));
- aFont.SetTransparent(TRUE);
- maCJKFont.SetTransparent(TRUE);
- maCTLFont.SetTransparent(TRUE);
+ aFont.SetTransparent(sal_True);
+ maCJKFont.SetTransparent(sal_True);
+ maCTLFont.SetTransparent(sal_True);
aFont.SetColor( SwViewOption::GetFontColor() );
maCJKFont.SetColor( SwViewOption::GetFontColor() );
@@ -337,12 +337,12 @@ void SwDropCapsPict::Paint(const Rectangle &/*rRect*/)
ASSERT(mnLineH > 0, "So klein lassen wir uns nicht machen");
long nY0 = (aOutputSizePixel.Height() - (LINES * mnTotLineH)) / 2;
SetFillColor( maTextLineColor );
- for (USHORT i = 0; i < LINES; ++i)
+ for (sal_uInt16 i = 0; i < LINES; ++i)
DrawRect(Rectangle(Point(BORDER, nY0 + i * mnTotLineH), Size(aOutputSizePixel.Width() - 2 * BORDER, mnLineH)));
// Texthintergrund mit Abstand (240 twips ~ 1 Zeilenhoehe)
- ULONG lDistance = mnDistance;
- USHORT nDistW = (USHORT) (ULONG) (((lDistance * 100) / 240) * mnTotLineH) / 100;
+ sal_uLong lDistance = mnDistance;
+ sal_uInt16 nDistW = (sal_uInt16) (sal_uLong) (((lDistance * 100) / 240) * mnTotLineH) / 100;
SetFillColor( maBackColor );
if(((SwDropCapsPage*)GetParent())->aDropCapsBox.IsChecked())
{
@@ -363,7 +363,7 @@ void SwDropCapsPict::DrawPrev( const Point& rPt )
InitPrinter();
Font aOldFont = mpPrinter->GetFont();
- USHORT nScript;
+ sal_uInt16 nScript;
size_t nIdx = 0;
xub_StrLen nStart = 0;
xub_StrLen nEnd;
@@ -396,7 +396,7 @@ void SwDropCapsPict::DrawPrev( const Point& rPt )
else
break;
}
- while( TRUE );
+ while( sal_True );
mpPrinter->SetFont( aOldFont );
}
@@ -422,8 +422,8 @@ void SwDropCapsPict::CheckScript( void )
}
if( xBreak.is() )
{
- USHORT nScript = xBreak->getScriptType( maText, 0 );
- USHORT nChg = 0;
+ sal_uInt16 nScript = xBreak->getScriptType( maText, 0 );
+ sal_uInt16 nChg = 0;
if( I18N_SCRIPTTYPE::WEAK == nScript )
{
nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript );
@@ -438,13 +438,13 @@ void SwDropCapsPict::CheckScript( void )
nChg = (xub_StrLen)xBreak->endOfScript( maText, nChg, nScript );
maScriptChg.push_back( nChg );
maScriptType.Insert( nScript, nCnt );
- maTextWidth.Insert( ULONG(0), nCnt++ );
+ maTextWidth.Insert( sal_uLong(0), nCnt++ );
if( nChg < maText.Len() )
nScript = xBreak->getScriptType( maText, nChg );
else
break;
- } while( TRUE );
+ } while( sal_True );
}
}
@@ -452,7 +452,7 @@ Size SwDropCapsPict::CalcTextSize( void )
{
InitPrinter();
- USHORT nScript;
+ sal_uInt16 nScript;
size_t nIdx = 0;
xub_StrLen nStart = 0;
xub_StrLen nEnd;
@@ -478,7 +478,7 @@ Size SwDropCapsPict::CalcTextSize( void )
{
SvxFont& rFnt = ( nScript == I18N_SCRIPTTYPE::ASIAN )? maCJKFont :
( ( nScript == I18N_SCRIPTTYPE::COMPLEX )? maCTLFont : maFont );
- ULONG nWidth = rFnt.GetTxtSize( mpPrinter, maText, nStart, nEnd-nStart ).Width();
+ sal_uLong nWidth = rFnt.GetTxtSize( mpPrinter, maText, nStart, nEnd-nStart ).Width();
if( nIdx < maTextWidth.Count() )
maTextWidth[ nIdx++ ] = nWidth;
@@ -504,7 +504,7 @@ Size SwDropCapsPict::CalcTextSize( void )
else
break;
}
- while( TRUE );
+ while( sal_True );
nHeight -= nAscent;
nCJKHeight -= nCJKAscent;
nCTLHeight -= nCTLAscent;
@@ -532,7 +532,7 @@ void SwDropCapsPict::_InitPrinter()
if ( !mpPrinter )
{
mpPrinter = new Printer;
- mbDelPrinter = TRUE;
+ mbDelPrinter = sal_True;
}
}
@@ -547,7 +547,7 @@ SwDropCapsDlg::SwDropCapsDlg(Window *pParent, const SfxItemSet &rSet ) :
{
SwDropCapsPage* pNewPage = (SwDropCapsPage*) SwDropCapsPage::Create(this, rSet);
- pNewPage->SetFormat(FALSE);
+ pNewPage->SetFormat(sal_False);
SetTabPage(pNewPage);
}
@@ -587,15 +587,15 @@ SwDropCapsPage::SwDropCapsPage(Window *pParent, const SfxItemSet &rSet) :
pPict (new SwDropCapsPict(this, SW_RES(CNT_PICT))),
- bModified(FALSE),
- bFormat(TRUE),
+ bModified(sal_False),
+ bFormat(sal_True),
rSh(::GetActiveView()->GetWrtShell())
{
FreeResource();
SetExchangeSupport();
- USHORT nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current());
- bHtmlMode = nHtmlMode & HTMLMODE_ON ? TRUE : FALSE;
+ sal_uInt16 nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current());
+ bHtmlMode = nHtmlMode & HTMLMODE_ON ? sal_True : sal_False;
//Im Vorlagendialog kann der Text nicht beeinflusst werden
aTextText.Enable( !bFormat );
@@ -652,7 +652,7 @@ Page: FillItemSet-Overload
****************************************************************************/
-BOOL SwDropCapsPage::FillItemSet(SfxItemSet &rSet)
+sal_Bool SwDropCapsPage::FillItemSet(SfxItemSet &rSet)
{
if(bModified)
FillSet(rSet);
@@ -682,7 +682,7 @@ void SwDropCapsPage::Reset(const SfxItemSet &rSet)
aDistanceField.SetValue(0);
}
- ::FillCharStyleListBox(aTemplateBox, rSh.GetView().GetDocShell(), TRUE);
+ ::FillCharStyleListBox(aTemplateBox, rSh.GetView().GetDocShell(), sal_True);
aTemplateBox.InsertEntry(SW_RESSTR(SW_STR_NONE), 0);
// Vorlage defaulten
@@ -692,7 +692,7 @@ void SwDropCapsPage::Reset(const SfxItemSet &rSet)
// Controls enablen
aDropCapsBox.Check(aFmtDrop.GetLines() > 1);
- const USHORT nVal = USHORT(aDropCapsField.GetValue());
+ const sal_uInt16 nVal = sal_uInt16(aDropCapsField.GetValue());
if (bFormat)
aTextEdit.SetText(GetDefaultString(nVal));
else
@@ -704,11 +704,11 @@ void SwDropCapsPage::Reset(const SfxItemSet &rSet)
// Preview
pPict->SetValues( aTextEdit.GetText(),
- BYTE( aLinesField.GetValue() ),
- USHORT( aDistanceField.Denormalize( aDistanceField.GetValue( FUNIT_TWIP ) ) ) );
+ sal_uInt8( aLinesField.GetValue() ),
+ sal_uInt16( aDistanceField.Denormalize( aDistanceField.GetValue( FUNIT_TWIP ) ) ) );
ClickHdl(&aDropCapsBox);
- bModified = FALSE;
+ bModified = sal_False;
}
/****************************************************************************
@@ -718,7 +718,7 @@ Page: Click-Handler der CheckBox
IMPL_LINK( SwDropCapsPage, ClickHdl, Button *, EMPTYARG )
{
- BOOL bChecked = aDropCapsBox.IsChecked();
+ sal_Bool bChecked = aDropCapsBox.IsChecked();
aWholeWordCB .Enable( bChecked && !bHtmlMode );
@@ -741,7 +741,7 @@ IMPL_LINK( SwDropCapsPage, ClickHdl, Button *, EMPTYARG )
else
pPict->SetText(aEmptyStr);
- bModified = TRUE;
+ bModified = sal_True;
return 0;
}
@@ -757,7 +757,7 @@ IMPL_LINK( SwDropCapsPage, WholeWordHdl, CheckBox *, EMPTYARG )
ModifyHdl(&aDropCapsField);
- bModified = TRUE;
+ bModified = sal_True;
return 0;
}
@@ -774,11 +774,11 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
// Ggf. Text setzen
if (pEdit == &aDropCapsField)
{
- USHORT nVal;
- BOOL bSetText = FALSE;
+ sal_uInt16 nVal;
+ sal_Bool bSetText = sal_False;
if (!aWholeWordCB.IsChecked())
- nVal = (USHORT)aDropCapsField.GetValue();
+ nVal = (sal_uInt16)aDropCapsField.GetValue();
else
nVal = 0;
@@ -786,7 +786,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
sPreview = GetDefaultString(nVal);
else
{
- bSetText = TRUE;
+ bSetText = sal_True;
sPreview = rSh.GetDropTxt(nVal);
}
@@ -795,7 +795,7 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
if (sEdit.Len() && sPreview.CompareTo(sEdit, sEdit.Len()) != COMPARE_EQUAL)
{
sPreview = sEdit.Copy(0, sPreview.Len());
- bSetText = FALSE;
+ bSetText = sal_False;
}
if (bSetText)
@@ -803,8 +803,8 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
}
else if (pEdit == &aTextEdit) // Ggf. Anzahl setzen
{
- USHORT nTmp = aTextEdit.GetText().Len();
- aDropCapsField.SetValue(Max((USHORT)1, nTmp));
+ sal_uInt16 nTmp = aTextEdit.GetText().Len();
+ aDropCapsField.SetValue(Max((sal_uInt16)1, nTmp));
sPreview = aTextEdit.GetText().Copy(0, nTmp);
}
@@ -813,11 +813,11 @@ IMPL_LINK( SwDropCapsPage, ModifyHdl, Edit *, pEdit )
if (pEdit == &aDropCapsField || pEdit == &aTextEdit)
pPict->SetText (sPreview);
else if (pEdit == &aLinesField)
- pPict->SetLines((BYTE)aLinesField.GetValue());
+ pPict->SetLines((sal_uInt8)aLinesField.GetValue());
else
- pPict->SetDistance((USHORT)aDistanceField.Denormalize(aDistanceField.GetValue(FUNIT_TWIP)));
+ pPict->SetDistance((sal_uInt16)aDistanceField.Denormalize(aDistanceField.GetValue(FUNIT_TWIP)));
- bModified = TRUE;
+ bModified = sal_True;
return 0;
}
@@ -830,13 +830,13 @@ Page: Select-Handler der Template-Box.
IMPL_LINK_INLINE_START( SwDropCapsPage, SelectHdl, ListBox *, EMPTYARG )
{
pPict->UpdatePaintSettings();
- bModified = TRUE;
+ bModified = sal_True;
return 0;
}
IMPL_LINK_INLINE_END( SwDropCapsPage, SelectHdl, ListBox *, EMPTYARG )
-USHORT* SwDropCapsPage::GetRanges()
+sal_uInt16* SwDropCapsPage::GetRanges()
{
return aPageRg;
}
@@ -848,13 +848,13 @@ void SwDropCapsPage::FillSet( SfxItemSet &rSet )
{
SwFmtDrop aFmt;
- BOOL bOn = aDropCapsBox.IsChecked();
+ sal_Bool bOn = aDropCapsBox.IsChecked();
if(bOn)
{
// Anzahl, Zeilen, Abstand
- aFmt.GetChars() = (BYTE) aDropCapsField.GetValue();
- aFmt.GetLines() = (BYTE) aLinesField.GetValue();
- aFmt.GetDistance() = (USHORT) aDistanceField.Denormalize(aDistanceField.GetValue(FUNIT_TWIP));
+ aFmt.GetChars() = (sal_uInt8) aDropCapsField.GetValue();
+ aFmt.GetLines() = (sal_uInt8) aLinesField.GetValue();
+ aFmt.GetDistance() = (sal_uInt16) aDistanceField.Denormalize(aDistanceField.GetValue(FUNIT_TWIP));
aFmt.GetWholeWord() = aWholeWordCB.IsChecked();
// Vorlage