Kaydet (Commit) 0a26e27d authored tarafından Matteo Casalin's avatar Matteo Casalin

sal_uInt16: use more proper types, avoid unneeded casts, constify

Change-Id: Ic30441307eaa391868ffbb85a67d1c0327258084
üst ba0498a6
......@@ -1076,14 +1076,14 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// This is the default. If the paragraph could not be mapped to
// any of the standard pdf tags, we write a user defined tag
// <stylename> with role = P
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Paragraph);
nPDFType = vcl::PDFWriter::Paragraph;
aPDFType = sStyleName;
// Quotations: BlockQuote
if (sStyleName.equalsAscii(aQuotations))
{
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::BlockQuote);
nPDFType = vcl::PDFWriter::BlockQuote;
aPDFType = OUString(aBlockQuoteString);
}
......@@ -1091,7 +1091,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
else if (sStyleName.equalsAscii(aCaption))
{
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Caption);
nPDFType = vcl::PDFWriter::Caption;
aPDFType = OUString(aCaptionString);
}
......@@ -1099,7 +1099,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
else if (sParentStyleName.equalsAscii(aCaption))
{
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Caption);
nPDFType = vcl::PDFWriter::Caption;
aPDFType = sStyleName + aCaptionString;
}
......@@ -1107,7 +1107,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
else if (sStyleName.equalsAscii(aHeading))
{
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Heading);
nPDFType = vcl::PDFWriter::Heading;
aPDFType = OUString(aHString);
}
......@@ -1116,7 +1116,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
if ( pTxtNd->IsOutline() )
{
int nRealLevel = pTxtNd->GetAttrOutlineLevel()-1;
nRealLevel = nRealLevel > 5 ? 5 : nRealLevel;
nRealLevel = nRealLevel > 5 ? 5 : nRealLevel;
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::H1 + nRealLevel);
switch(nRealLevel)
......@@ -1375,7 +1375,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
else
{
const LanguageType nCurrentLanguage = rInf.GetFont()->GetLanguage();
const sal_uInt16 nFont = rInf.GetFont()->GetActual();
const sal_uInt8 nFont = rInf.GetFont()->GetActual();
const LanguageType nDefaultLang = SwEnhancedPDFExportHelper::GetDefaultLanguage();
if ( UNDERLINE_NONE != rInf.GetFont()->GetUnderline() ||
......@@ -1699,8 +1699,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
const bool bHeaderFooter = pDoc->IsInHeaderFooter( aPos.nNode );
// Create links for all selected rectangles:
const sal_uInt16 nNumOfRects = aTmp.size();
for ( sal_uInt16 i = 0; i < nNumOfRects; ++i )
const size_t nNumOfRects = aTmp.size();
for ( size_t i = 0; i < nNumOfRects; ++i )
{
// Link Rectangle
const SwRect& rLinkRect( aTmp[ i ] );
......@@ -1739,8 +1739,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// HYPERLINKS (Graphics, Frames, OLEs )
const SwFrmFmts* pTbl = pDoc->GetSpzFrmFmts();
const sal_uInt16 nSpzFrmFmtsCount = pTbl->size();
for( sal_uInt16 n = 0; n < nSpzFrmFmtsCount; ++n )
const size_t nSpzFrmFmtsCount = pTbl->size();
for( size_t n = 0; n < nSpzFrmFmtsCount; ++n )
{
const SwFrmFmt* pFrmFmt = (*pTbl)[n];
const SfxPoolItem* pItem;
......@@ -1868,8 +1868,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
const bool bHeaderFooter = pDoc->IsInHeaderFooter( aPos.nNode );
// Create links for all selected rectangles:
const sal_uInt16 nNumOfRects = aTmp.size();
for ( sal_uInt16 i = 0; i < nNumOfRects; ++i )
const size_t nNumOfRects = aTmp.size();
for ( size_t i = 0; i < nNumOfRects; ++i )
{
// Link rectangle
const SwRect& rLinkRect( aTmp[ i ] );
......@@ -1908,8 +1908,8 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// FOOTNOTES
const sal_uInt16 nFtnCount = pDoc->GetFtnIdxs().size();
for ( sal_uInt16 nIdx = 0; nIdx < nFtnCount; ++nIdx )
const size_t nFtnCount = pDoc->GetFtnIdxs().size();
for ( size_t nIdx = 0; nIdx < nFtnCount; ++nIdx )
{
// Set cursor to text node that contains the footnote:
const SwTxtFtn* pTxtFtn = pDoc->GetFtnIdxs()[ nIdx ];
......
......@@ -68,8 +68,7 @@
* NUM_DEFAULT_VALUES.
* Also adjust NUM_ATTRIBUTE_STACKS in atrhndl.hxx.
*/
const sal_uInt8 StackPos[ static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) -
static_cast<sal_uInt16>(RES_CHRATR_BEGIN) + 1 ] =
const sal_uInt8 StackPos[ RES_TXTATR_WITHEND_END - RES_CHRATR_BEGIN + 1 ] =
{
0, // // 0
1, // RES_CHRATR_CASEMAP = RES_CHRATR_BEGIN // 1
......@@ -508,7 +507,7 @@ void SwAttrHandler::PopAndChg( const SwTxtAttr& rAttr, SwFont& rFnt )
if ( bRet )
{
// we remove rAttr from the appropriate stack
sal_uInt16 nStackPos = StackPos[ i ];
const sal_uInt16 nStackPos = StackPos[ i ];
aAttrStack[ nStackPos ].Remove( rAttr );
// reset font according to attribute on top of stack
// or default value
......@@ -590,7 +589,7 @@ void SwAttrHandler::ActivateTop( SwFont& rFnt, const sal_uInt16 nAttr )
{
// ruby stack has no more attributes
// check, if an rotation attribute has to be applied
sal_uInt16 nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
const sal_uInt16 nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
bool bTwoLineAct = false;
const SwTxtAttr* pTwoLineAttr = aAttrStack[ nTwoLineStack ].Top();
......@@ -607,7 +606,7 @@ void SwAttrHandler::ActivateTop( SwFont& rFnt, const sal_uInt16 nAttr )
return;
// eventually, an rotate attribute has to be activated
sal_uInt16 nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
const sal_uInt16 nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
const SwTxtAttr* pRotateAttr = aAttrStack[ nRotateStack ].Top();
if ( pRotateAttr )
......@@ -809,7 +808,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, bool bPush )
if ( bRuby )
break;
sal_uInt16 nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
const sal_uInt16 nTwoLineStack = StackPos[ RES_CHRATR_TWO_LINES ];
bool bTwoLineAct = false;
const SwTxtAttr* pTwoLineAttr = aAttrStack[ nTwoLineStack ].Top();
......@@ -847,7 +846,7 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, bool bPush )
if ( bRuby )
break;
sal_uInt16 nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
const sal_uInt16 nRotateStack = StackPos[ RES_CHRATR_ROTATE ];
const SwTxtAttr* pRotateAttr = aAttrStack[ nRotateStack ].Top();
if ( pRotateAttr )
......
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