diff options
Diffstat (limited to 'sw/source/filter')
54 files changed, 475 insertions, 475 deletions
diff --git a/sw/source/filter/ascii/parasc.cxx b/sw/source/filter/ascii/parasc.cxx index a82104dbf594..b58f268547ef 100644 --- a/sw/source/filter/ascii/parasc.cxx +++ b/sw/source/filter/ascii/parasc.cxx @@ -54,7 +54,7 @@ class SwASCIIParser std::unique_ptr<char[]> pArr; const SwAsciiOptions& rOpt; std::unique_ptr<SfxItemSet> pItemSet; - long nFileSize; + tools::Long nFileSize; SvtScriptType nScript; bool bNewDoc; @@ -243,7 +243,7 @@ ErrCode SwASCIIParser::CallParser() ErrCode SwASCIIParser::ReadChars() { sal_Unicode *pStt = nullptr, *pEnd = nullptr, *pLastStt = nullptr; - long nReadCnt = 0, nLineLen = 0; + tools::Long nReadCnt = 0, nLineLen = 0; sal_Unicode cLastCR = 0; bool bSwapUnicode = false; @@ -269,10 +269,10 @@ ErrCode SwASCIIParser::ReadChars() { aEmpty.SetCharSet(eCharSet); aEmpty.SetParaFlags(eLineEnd); - rInput.SeekRel(-(long(nLen))); + rInput.SeekRel(-(tools::Long(nLen))); } else - rInput.SeekRel(-(long(nOrig))); + rInput.SeekRel(-(tools::Long(nOrig))); pUseMe=&aEmpty; } diff --git a/sw/source/filter/ascii/wrtasc.cxx b/sw/source/filter/ascii/wrtasc.cxx index fa99ce7c6d95..d9933628a773 100644 --- a/sw/source/filter/ascii/wrtasc.cxx +++ b/sw/source/filter/ascii/wrtasc.cxx @@ -99,7 +99,7 @@ ErrCode SwASCWriter::WriteStream() case LINEEND_CRLF: m_sLineEnd = "\015\012"; break; } - long nMaxNode = m_pDoc->GetNodes().Count(); + tools::Long nMaxNode = m_pDoc->GetNodes().Count(); if( m_bShowProgress ) ::StartProgress( STR_STATSTR_W4WWRITE, 0, nMaxNode, m_pDoc->GetDocShell() ); diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 4093ae3999be..b799dee2da06 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -347,7 +347,7 @@ void SwFltControlStack::KillUnlockedAttrs(const SwPosition& rPos) // be applied to the document and removed from the stack. // Returns if there were any selected attributes on the stack SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos, - sal_uInt16 nAttrId, bool bTstEnd, long nHand, + sal_uInt16 nAttrId, bool bTstEnd, tools::Long nHand, bool consumedByField) { SwFltStackEntry *pRet = nullptr; @@ -995,7 +995,7 @@ SwFltRedline* SwFltRedline::Clone( SfxItemPool* ) const // methods of SwFltBookmark follow SwFltBookmark::SwFltBookmark( const OUString& rNa, const OUString& rVa, - long nHand, const bool bIsTOCBookmark ) + tools::Long nHand, const bool bIsTOCBookmark ) : SfxPoolItem( RES_FLTR_BOOKMARK ) , mnHandle( nHand ) , maName( rNa ) @@ -1048,12 +1048,12 @@ SwFltRDFMark* SwFltRDFMark::Clone(SfxItemPool*) const return new SwFltRDFMark(*this); } -void SwFltRDFMark::SetHandle(long nHandle) +void SwFltRDFMark::SetHandle(tools::Long nHandle) { m_nHandle = nHandle; } -long SwFltRDFMark::GetHandle() const +tools::Long SwFltRDFMark::GetHandle() const { return m_nHandle; } diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 8cb32cc97e4e..7b1a5cc19be3 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -366,7 +366,7 @@ void SwHTMLWriter::OutCSS1_Property( const char *pProp, Strm().WriteOString( sOut.makeStringAndClear() ); } -static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal, +static void AddUnitPropertyValue(OStringBuffer &rOut, tools::Long nVal, FieldUnit eUnit) { if( nVal < 0 ) @@ -377,9 +377,9 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal, } // the recalculated unit results from (x * nMul)/(nDiv*nFac*10) - long nMul = 1000; - long nDiv = 1; - long nFac = 100; + tools::Long nMul = 1000; + tools::Long nDiv = 1; + tools::Long nFac = 100; const char *pUnit; switch( eUnit ) { @@ -441,7 +441,7 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal, break; } - long nLongVal = 0; + tools::Long nLongVal = 0; bool bOutLongVal = true; if( nVal > LONG_MAX / nMul ) { @@ -454,7 +454,7 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal, if( nBigVal <= LONG_MAX ) { // a long is sufficient - nLongVal = static_cast<long>(nBigVal); + nLongVal = static_cast<tools::Long>(nBigVal); } else { @@ -496,14 +496,14 @@ static void AddUnitPropertyValue(OStringBuffer &rOut, long nVal, rOut.append(pUnit); } -void SwHTMLWriter::OutCSS1_UnitProperty( const char *pProp, long nVal ) +void SwHTMLWriter::OutCSS1_UnitProperty( const char *pProp, tools::Long nVal ) { OStringBuffer sOut; AddUnitPropertyValue(sOut, nVal, m_eCSS1Unit); OutCSS1_PropertyAscii(pProp, sOut.makeStringAndClear()); } -void SwHTMLWriter::OutCSS1_PixelProperty( const char *pProp, long nVal, +void SwHTMLWriter::OutCSS1_PixelProperty( const char *pProp, tools::Long nVal, bool bVert ) { OString sOut(OString::number(ToPixel(nVal,bVert)) + sCSS1_UNIT_px); @@ -1684,7 +1684,7 @@ static Writer& OutCSS1_SwPageDesc( Writer& rWrt, const SwPageDesc& rPageDesc, aRefSz = pRefPageDesc->GetMaster().GetFrameSize().GetSize(); if( bRefLandscape != rPageDesc.GetLandscape() ) { - long nTmp = aRefSz.Height(); + tools::Long nTmp = aRefSz.Height(); aRefSz.setHeight( aRefSz.Width() ); aRefSz.setWidth( nTmp ); } @@ -1871,9 +1871,9 @@ Writer& OutCSS1_NumberBulletListStyleOpt( Writer& rWrt, const SwNumRule& rNumRul const SwNumFormat& rNumFormat = rNumRule.Get( nLevel ); - long nLSpace = rNumFormat.GetAbsLSpace(); - long nFirstLineOffset = rNumFormat.GetFirstLineOffset(); - long nDfltFirstLineOffset = HTML_NUMBER_BULLET_INDENT; + tools::Long nLSpace = rNumFormat.GetAbsLSpace(); + tools::Long nFirstLineOffset = rNumFormat.GetFirstLineOffset(); + tools::Long nDfltFirstLineOffset = HTML_NUMBER_BULLET_INDENT; if( nLevel > 0 ) { const SwNumFormat& rPrevNumFormat = rNumRule.Get( nLevel-1 ); @@ -1942,7 +1942,7 @@ void SwHTMLWriter::OutCSS1_FrameFormatOptions( const SwFrameFormat& rFrameFormat // case the Orient-Attribute contains the correct position. // top - long nXPos=0, nYPos=0; + tools::Long nXPos=0, nYPos=0; bool bOutXPos = false, bOutYPos = false; if( RES_DRAWFRMFMT == rFrameFormat.Which() ) { @@ -2724,7 +2724,7 @@ static Writer& OutCSS1_SvxLineSpacing( Writer& rWrt, const SfxPoolItem& rHt ) } if( nHeight ) - rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_line_height, static_cast<long>(nHeight) ); + rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_line_height, static_cast<tools::Long>(nHeight) ); else if( nPercentHeight && !(nPercentHeight < 115 && rHTMLWrt.m_bParaDotLeaders )) // avoid HTML scrollbars and missing descenders { @@ -2896,14 +2896,14 @@ static Writer& OutCSS1_SvxLRSpace( Writer& rWrt, const SfxPoolItem& rHt ) // match that of the current template // A left margin can exist because of a list nearby - long nLeftMargin = rLRItem.GetTextLeft() - rHTMLWrt.m_nLeftMargin; + tools::Long nLeftMargin = rLRItem.GetTextLeft() - rHTMLWrt.m_nLeftMargin; if( rHTMLWrt.m_nDfltLeftMargin != nLeftMargin ) { rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_margin_left, nLeftMargin ); // max-width = max-width - margin-left for TOC paragraphs with dot leaders if( rHTMLWrt.m_bParaDotLeaders ) - rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_max_width, long(DOT_LEADERS_MAX_WIDTH/2.54*72*20) - nLeftMargin ); + rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_max_width, tools::Long(DOT_LEADERS_MAX_WIDTH/2.54*72*20) - nLeftMargin ); } @@ -2913,7 +2913,7 @@ static Writer& OutCSS1_SvxLRSpace( Writer& rWrt, const SfxPoolItem& rHt ) } // The LineIndent of the first line might contain the room for numbering - long nFirstLineIndent = static_cast<long>(rLRItem.GetTextFirstLineOffset()) - + tools::Long nFirstLineIndent = static_cast<tools::Long>(rLRItem.GetTextFirstLineOffset()) - rHTMLWrt.m_nFirstLineIndent; if( rHTMLWrt.m_nDfltFirstLineIndent != nFirstLineIndent ) { @@ -2933,13 +2933,13 @@ static Writer& OutCSS1_SvxULSpace( Writer& rWrt, const SfxPoolItem& rHt ) if( rHTMLWrt.m_nDfltTopMargin != rULItem.GetUpper() ) { rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_margin_top, - static_cast<long>(rULItem.GetUpper()) ); + static_cast<tools::Long>(rULItem.GetUpper()) ); } if( rHTMLWrt.m_nDfltBottomMargin != rULItem.GetLower() ) { rHTMLWrt.OutCSS1_UnitProperty( sCSS1_P_margin_bottom, - static_cast<long>(rULItem.GetLower()) ); + static_cast<tools::Long>(rULItem.GetLower()) ); } return rWrt; @@ -3402,10 +3402,10 @@ Writer& OutCSS1_SvxBox( Writer& rWrt, const SfxPoolItem& rHt ) OutCSS1_SvxBorderLine( rHTMLWrt, sCSS1_P_border_right, pRight ); } - long nTopDist = pTop ? rBoxItem.GetDistance( SvxBoxItemLine::TOP ) : 0; - long nBottomDist = pBottom ? rBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ) : 0; - long nLeftDist = pLeft ? rBoxItem.GetDistance( SvxBoxItemLine::LEFT ) : 0; - long nRightDist = pRight ? rBoxItem.GetDistance( SvxBoxItemLine::RIGHT ) : 0; + tools::Long nTopDist = pTop ? rBoxItem.GetDistance( SvxBoxItemLine::TOP ) : 0; + tools::Long nBottomDist = pBottom ? rBoxItem.GetDistance( SvxBoxItemLine::BOTTOM ) : 0; + tools::Long nLeftDist = pLeft ? rBoxItem.GetDistance( SvxBoxItemLine::LEFT ) : 0; + tools::Long nRightDist = pRight ? rBoxItem.GetDistance( SvxBoxItemLine::RIGHT ) : 0; if( nTopDist == nBottomDist && nLeftDist == nRightDist ) { diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 9a96233407b4..4c5f335597a0 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -2057,7 +2057,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) const SvxLRSpaceItem& rLR = rPgFormat.GetLRSpace(); const SwFormatCol& rCol = rPgFormat.GetCol(); - long nPageWidth = rSz.GetWidth() - rLR.GetLeft() - rLR.GetRight(); + tools::Long nPageWidth = rSz.GetWidth() - rLR.GetLeft() - rLR.GetRight(); if( 1 < rCol.GetNumCols() ) nPageWidth /= rCol.GetNumCols(); diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx index a3c2f4989c6a..1f09a40cf09b 100644 --- a/sw/source/filter/html/htmldrawreader.cxx +++ b/sw/source/filter/html/htmldrawreader.cxx @@ -248,7 +248,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) OUString aId, aStyle, aClass; - long nWidth=0, nHeight=0; + tools::Long nWidth=0, nHeight=0; bool bPercentWidth = false, bDirection = false, bBGColor = false; Size aSpace( 0, 0 ); sal_Int16 eVertOri = text::VertOrientation::TOP; @@ -493,7 +493,7 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable ) } else { - long nBrowseWidth = GetCurrentBrowseWidth(); + tools::Long nBrowseWidth = GetCurrentBrowseWidth(); aTwipSz.setWidth( !nWidth ? nBrowseWidth : (nWidth*nBrowseWidth) / 100 ); } diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index b7eb5308030e..46b29ebf2e51 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1397,7 +1397,7 @@ void SwHTMLParser::InsertInput() bool bDisabled = false, bValue = false; bool bSetGrfWidth = false, bSetGrfHeight = false; bool bHidden = false; - long nWidth=0, nHeight=0; + tools::Long nWidth=0, nHeight=0; sal_Int16 eVertOri = text::VertOrientation::TOP; sal_Int16 eHoriOri = text::HoriOrientation::NONE; SvKeyValueIterator *pHeaderAttrs = m_pFormImpl->GetHeaderAttrs(); diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index f60a7dda459f..41d1e07f7df8 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -323,8 +323,8 @@ void SwHTMLParser::InsertImage() sal_Int16 eVertOri = text::VertOrientation::TOP; sal_Int16 eHoriOri = text::HoriOrientation::NONE; bool bWidthProvided=false, bHeightProvided=false; - long nWidth=0, nHeight=0; - long nVSpace=0, nHSpace=0; + tools::Long nWidth=0, nHeight=0; + tools::Long nVSpace=0, nHSpace=0; sal_uInt16 nBorder = (m_xAttrTab->pINetFormat ? 1 : 0); bool bIsMap = false; @@ -538,11 +538,11 @@ IMAGE_SETEVENT: Reader::ResetFrameFormatAttrs( aFrameSet ); // set the border - long nHBorderWidth = 0, nVBorderWidth = 0; + tools::Long nHBorderWidth = 0, nVBorderWidth = 0; if( nBorder ) { - nHBorderWidth = static_cast<long>(nBorder); - nVBorderWidth = static_cast<long>(nBorder); + nHBorderWidth = static_cast<tools::Long>(nBorder); + nVBorderWidth = static_cast<tools::Long>(nBorder); SvxCSS1Parser::PixelToTwip( nVBorderWidth, nHBorderWidth ); ::editeng::SvxBorderLine aHBorderLine( nullptr, nHBorderWidth ); diff --git a/sw/source/filter/html/htmlnumreader.cxx b/sw/source/filter/html/htmlnumreader.cxx index e3dab319f9a6..feaee46f4cb3 100644 --- a/sw/source/filter/html/htmlnumreader.cxx +++ b/sw/source/filter/html/htmlnumreader.cxx @@ -263,7 +263,7 @@ void SwHTMLParser::NewNumberBulletList( HtmlTokenId nToken ) if( aPropInfo.m_bLeftMargin ) { // Default indent has already been added - long nAbsLSpace = + tools::Long nAbsLSpace = aNumFormat.GetAbsLSpace() - HTML_NUMBER_BULLET_MARGINLEFT; if( aPropInfo.m_nLeftMargin < 0 && nAbsLSpace < -aPropInfo.m_nLeftMargin ) diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 645ecbd1b358..65e0419f4ed9 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -396,23 +396,23 @@ bool SwHTMLParser::InsertEmbed() if( USHRT_MAX==aSize.Width() ) { bPercentWidth = (rOption.GetString().indexOf('%') != -1); - aSize.setWidth( static_cast<long>(rOption.GetNumber()) ); + aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) ); } break; case HtmlOptionId::HEIGHT: if( USHRT_MAX==aSize.Height() ) { bPercentHeight = (rOption.GetString().indexOf('%') != -1); - aSize.setHeight( static_cast<long>(rOption.GetNumber()) ); + aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) ); } break; case HtmlOptionId::HSPACE: if( USHRT_MAX==aSpace.Width() ) - aSpace.setWidth( static_cast<long>(rOption.GetNumber()) ); + aSpace.setWidth( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::VSPACE: if( USHRT_MAX==aSpace.Height() ) - aSpace.setHeight( static_cast<long>(rOption.GetNumber()) ); + aSpace.setHeight( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::DATA: if (m_bXHTML && aURL.isEmpty()) @@ -742,11 +742,11 @@ void SwHTMLParser::NewObject() break; case HtmlOptionId::WIDTH: bPercentWidth = (rOption.GetString().indexOf('%') != -1); - aSize.setWidth( static_cast<long>(rOption.GetNumber()) ); + aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::HEIGHT: bPercentHeight = (rOption.GetString().indexOf('%') != -1); - aSize.setHeight( static_cast<long>(rOption.GetNumber()) ); + aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::ALIGN: eVertOri = rOption.GetEnum( aHTMLImgVAlignTable, eVertOri ); @@ -757,10 +757,10 @@ void SwHTMLParser::NewObject() case HtmlOptionId::NAME: break; case HtmlOptionId::HSPACE: - aSpace.setWidth( static_cast<long>(rOption.GetNumber()) ); + aSpace.setWidth( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::VSPACE: - aSpace.setHeight( static_cast<long>(rOption.GetNumber()) ); + aSpace.setHeight( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::BORDER: break; @@ -902,17 +902,17 @@ void SwHTMLParser::InsertApplet() break; case HtmlOptionId::WIDTH: bPercentWidth = (rOption.GetString().indexOf('%') != -1); - aSize.setWidth( static_cast<long>(rOption.GetNumber()) ); + aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::HEIGHT: bPercentHeight = (rOption.GetString().indexOf('%') != -1); - aSize.setHeight( static_cast<long>(rOption.GetNumber()) ); + aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::HSPACE: - aSpace.setWidth( static_cast<long>(rOption.GetNumber()) ); + aSpace.setWidth( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::VSPACE: - aSpace.setHeight( static_cast<long>(rOption.GetNumber()) ); + aSpace.setHeight( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::MAYSCRIPT: bMayScript = true; @@ -1051,17 +1051,17 @@ void SwHTMLParser::InsertFloatingFrame() break; case HtmlOptionId::WIDTH: bPercentWidth = (rOption.GetString().indexOf('%') != -1); - aSize.setWidth( static_cast<long>(rOption.GetNumber()) ); + aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::HEIGHT: bPercentHeight = (rOption.GetString().indexOf('%') != -1); - aSize.setHeight( static_cast<long>(rOption.GetNumber()) ); + aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::HSPACE: - aSpace.setWidth( static_cast<long>(rOption.GetNumber()) ); + aSpace.setWidth( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::VSPACE: - aSpace.setHeight( static_cast<long>(rOption.GetNumber()) ); + aSpace.setHeight( static_cast<tools::Long>(rOption.GetNumber()) ); break; default: break; } diff --git a/sw/source/filter/html/htmlsect.cxx b/sw/source/filter/html/htmlsect.cxx index 024464355ac0..c9208357ceee 100644 --- a/sw/source/filter/html/htmlsect.cxx +++ b/sw/source/filter/html/htmlsect.cxx @@ -553,7 +553,7 @@ void SwHTMLParser::NewMultiCol( sal_uInt16 columnsFromCss ) { OUString aId; OUString aStyle, aClass, aLang, aDir; - long nWidth = 100; + tools::Long nWidth = 100; sal_uInt16 nCols = columnsFromCss, nGutter = 10; bool bPercentWidth = true; diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 6207967f3677..5c3131e878fe 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -936,10 +936,10 @@ void HTMLTable::InitCtor(const HTMLTableOptions& rOptions) const Color& rBorderColor = rOptions.aBorderColor; - long nBorderOpt = static_cast<long>(rOptions.nBorder); - long nPWidth = nBorderOpt==USHRT_MAX ? NETSCAPE_DFLT_BORDER + tools::Long nBorderOpt = static_cast<tools::Long>(rOptions.nBorder); + tools::Long nPWidth = nBorderOpt==USHRT_MAX ? NETSCAPE_DFLT_BORDER : nBorderOpt; - long nPHeight = nBorderOpt==USHRT_MAX ? 0 : nBorderOpt; + tools::Long nPHeight = nBorderOpt==USHRT_MAX ? 0 : nBorderOpt; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); // nBorder tells the width of the border as it's used in the width calculation of NetScape @@ -1341,7 +1341,7 @@ void HTMLTable::FixFrameFormat( SwTableBox *pBox, bool bSet = (m_nCellPadding > 0); SvxBoxItem aBoxItem( RES_BOX ); - long nInnerFrameWidth = nFrameWidth; + tools::Long nInnerFrameWidth = nFrameWidth; if( bTopLine ) { @@ -1604,7 +1604,7 @@ SwTableLine *HTMLTable::MakeTableLine( SwTableBox *pUpper, // The HTML tables represent a box. So we need to split behind that box nSplitCol = nCol + 1; - long nBoxRowSpan = rCell2.GetRowSpan(); + tools::Long nBoxRowSpan = rCell2.GetRowSpan(); if (!rCell2.GetContents() || rCell2.IsCovered()) { if (rCell2.IsCovered()) @@ -2462,7 +2462,7 @@ void HTMLTable::MakeTable( SwTableBox *pBox, sal_uInt16 nAbsAvail, sal_uInt16 nWidth2, nDummy; m_xLayoutInfo->GetAvail( nCol, nColSpan, nWidth2, nDummy ); - nWidth2 = static_cast< sal_uInt16 >((static_cast<long>(m_nWidth) * nPercentWidth) / 100); + nWidth2 = static_cast< sal_uInt16 >((static_cast<tools::Long>(m_nWidth) * nPercentWidth) / 100); SwHTMLParser::ResizeDrawObject( pObj, nWidth2 ); } diff --git a/sw/source/filter/html/htmltabw.cxx b/sw/source/filter/html/htmltabw.cxx index f7d5951ae585..4c83319747b7 100644 --- a/sw/source/filter/html/htmltabw.cxx +++ b/sw/source/filter/html/htmltabw.cxx @@ -79,7 +79,7 @@ class SwHTMLWrtTable : public SwWriteTable bool bTop, bool bBottom, bool bLeft, bool bRight ); public: - SwHTMLWrtTable( const SwTableLines& rLines, long nWidth, sal_uInt32 nBWidth, + SwHTMLWrtTable( const SwTableLines& rLines, tools::Long nWidth, sal_uInt32 nBWidth, bool bRel, sal_uInt16 nLeftSub, sal_uInt16 nRightSub, sal_uInt16 nNumOfRowsToRepeat ); explicit SwHTMLWrtTable( const SwHTMLTableLayout *pLayoutInfo ); @@ -92,7 +92,7 @@ public: } -SwHTMLWrtTable::SwHTMLWrtTable( const SwTableLines& rLines, long nWidth, +SwHTMLWrtTable::SwHTMLWrtTable( const SwTableLines& rLines, tools::Long nWidth, sal_uInt32 nBWidth, bool bRel, sal_uInt16 nLSub, sal_uInt16 nRSub, sal_uInt16 nNumOfRowsToRepeat ) @@ -318,7 +318,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, append("=\"").append(static_cast<sal_Int32>(nColSpan)).append("\""); } - long nWidth = 0; + tools::Long nWidth = 0; bool bOutWidth = true; sal_uInt32 nPercentWidth = SAL_MAX_UINT32; @@ -347,7 +347,7 @@ void SwHTMLWrtTable::OutTableCell( SwHTMLWriter& rWrt, // ReqIF implies strict XHTML: no width for <td>. bOutWidth = false; - long nHeight = pCell->GetHeight() > 0 + tools::Long nHeight = pCell->GetHeight() > 0 ? GetAbsHeight( pCell->GetHeight(), nRow, nRowSpan ) : 0; Size aPixelSz( nWidth, nHeight ); @@ -876,7 +876,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, sal_Int16 eFlyHoriOri = text::HoriOrientation::NONE; css::text::WrapTextMode eSurround = css::text::WrapTextMode_NONE; sal_uInt8 nFlyPercentWidth = 0; - long nFlyWidth = 0; + tools::Long nFlyWidth = 0; sal_uInt16 nFlyHSpace = 0; sal_uInt16 nFlyVSpace = 0; if( pFlyFrameFormat ) @@ -909,7 +909,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, SwFrameFormat *pFormat = rTable.GetFrameFormat(); const SwFormatFrameSize& rFrameSize = pFormat->GetFrameSize(); - long nWidth = rFrameSize.GetSize().Width(); + tools::Long nWidth = rFrameSize.GetSize().Width(); sal_uInt8 nPercentWidth = rFrameSize.GetWidthPercent(); sal_uInt16 nBaseWidth = static_cast<sal_uInt16>(nWidth); @@ -954,7 +954,7 @@ Writer& OutHTML_SwTableNode( Writer& rWrt, SwTableNode & rNode, { // Without a right margin also an absolute width is maintained. // We still try to define the actual width via the layout. - long nRealWidth = pFormat->FindLayoutRect(true).Width(); + tools::Long nRealWidth = pFormat->FindLayoutRect(true).Width(); if( nRealWidth ) nWidth = nRealWidth; } diff --git a/sw/source/filter/html/svxcss1.cxx b/sw/source/filter/html/svxcss1.cxx index c2286f949b04..9ff8244ca50b 100644 --- a/sw/source/filter/html/svxcss1.cxx +++ b/sw/source/filter/html/svxcss1.cxx @@ -870,7 +870,7 @@ bool SvxCSS1Parser::GetEnum( const CSS1PropertyEnum *pPropTable, return (pPropTable->pName != nullptr); } -void SvxCSS1Parser::PixelToTwip( long &rWidth, long &rHeight ) +void SvxCSS1Parser::PixelToTwip( tools::Long &rWidth, tools::Long &rHeight ) { if( Application::GetDefaultDevice() ) { @@ -1000,8 +1000,8 @@ static void ParseCSS1_font_size( const CSS1Expression *pExpr, double fHeight = pExpr->GetNumber(); if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0) { - long nPHeight = static_cast<long>(fHeight); - long nPWidth = 0; + tools::Long nPHeight = static_cast<tools::Long>(fHeight); + tools::Long nPWidth = 0; SvxCSS1Parser::PixelToTwip(nPWidth, nPHeight); nHeight = static_cast<sal_uLong>(nPHeight); } @@ -1601,8 +1601,8 @@ static void ParseCSS1_line_height( const CSS1Expression *pExpr, double fHeight = pExpr->GetNumber(); if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0) { - long nPHeight = static_cast<long>(fHeight); - long nPWidth = 0; + tools::Long nPHeight = static_cast<tools::Long>(fHeight); + tools::Long nPWidth = 0; SvxCSS1Parser::PixelToTwip(nPWidth, nPHeight); nHeight = static_cast<sal_uInt16>(nPHeight); } @@ -1784,8 +1784,8 @@ static void ParseCSS1_letter_spacing( const CSS1Expression *pExpr, double fHeight = pExpr->GetNumber(); if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0) { - long nPWidth = static_cast<long>(fHeight); - long nPHeight = 0; + tools::Long nPWidth = static_cast<tools::Long>(fHeight); + tools::Long nPHeight = 0; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); rItemSet.Put( SvxKerningItem( static_cast<short>(nPWidth), aItemIds.nKerning ) ); } @@ -1959,8 +1959,8 @@ static void ParseCSS1_text_indent( const CSS1Expression *pExpr, double fWidth = pExpr->GetNumber(); if (fWidth < SAL_MAX_INT32/2.0 && fWidth > SAL_MIN_INT32/2.0) { - long nPWidth = static_cast<long>(fWidth); - long nPHeight = 0; + tools::Long nPWidth = static_cast<tools::Long>(fWidth); + tools::Long nPHeight = 0; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); nIndent = static_cast<short>(nPWidth); bSet = true; @@ -2001,7 +2001,7 @@ static void ParseCSS1_margin_left( const CSS1Expression *pExpr, { OSL_ENSURE( pExpr, "no expression" ); - long nLeft = 0; + tools::Long nLeft = 0; bool bSet = false; switch( pExpr->GetType() ) { @@ -2016,8 +2016,8 @@ static void ParseCSS1_margin_left( const CSS1Expression *pExpr, double fLeft = pExpr->GetNumber(); if (fLeft < SAL_MAX_INT32/2.0 && fLeft > SAL_MIN_INT32/2.0) { - nLeft = static_cast<long>(fLeft); - long nPHeight = 0; + nLeft = static_cast<tools::Long>(fLeft); + tools::Long nPHeight = 0; SvxCSS1Parser::PixelToTwip( nLeft, nPHeight ); bSet = true; } @@ -2064,7 +2064,7 @@ static void ParseCSS1_margin_right( const CSS1Expression *pExpr, { OSL_ENSURE( pExpr, "no expression" ); - long nRight = 0; + tools::Long nRight = 0; bool bSet = false; switch( pExpr->GetType() ) { @@ -2079,8 +2079,8 @@ static void ParseCSS1_margin_right( const CSS1Expression *pExpr, double fRight = pExpr->GetNumber(); if (fRight < SAL_MAX_INT32/2.0 && fRight > SAL_MIN_INT32/2.0) { - nRight = static_cast<long>(fRight); - long nPHeight = 0; + nRight = static_cast<tools::Long>(fRight); + tools::Long nPHeight = 0; SvxCSS1Parser::PixelToTwip( nRight, nPHeight ); bSet = true; } @@ -2129,7 +2129,7 @@ static void ParseCSS1_margin_top( const CSS1Expression *pExpr, { case CSS1_LENGTH: { - long nTmp = pExpr->GetSLength(); + tools::Long nTmp = pExpr->GetSLength(); if( nTmp < 0 ) nTmp = 0; nUpper = static_cast<sal_uInt16>(nTmp); @@ -2141,8 +2141,8 @@ static void ParseCSS1_margin_top( const CSS1Expression *pExpr, double fHeight = pExpr->GetNumber(); if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0) { - long nPWidth = 0; - long nPHeight = static_cast<long>(fHeight); + tools::Long nPWidth = 0; + tools::Long nPHeight = static_cast<tools::Long>(fHeight); if( nPHeight < 0 ) nPHeight = 0; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); @@ -2191,7 +2191,7 @@ static void ParseCSS1_margin_bottom( const CSS1Expression *pExpr, { case CSS1_LENGTH: { - long nTmp = pExpr->GetSLength(); + tools::Long nTmp = pExpr->GetSLength(); if( nTmp < 0 ) nTmp = 0; nLower = static_cast<sal_uInt16>(nTmp); @@ -2203,8 +2203,8 @@ static void ParseCSS1_margin_bottom( const CSS1Expression *pExpr, double fHeight = pExpr->GetNumber(); if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0) { - long nPWidth = 0; - long nPHeight = static_cast<long>(fHeight); + tools::Long nPWidth = 0; + tools::Long nPHeight = static_cast<tools::Long>(fHeight); if( nPHeight < 0 ) nPHeight = 0; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); @@ -2247,13 +2247,13 @@ static void ParseCSS1_margin( const CSS1Expression *pExpr, { OSL_ENSURE( pExpr, "no expression" ); - long nMargins[4] = { 0, 0, 0, 0 }; + tools::Long nMargins[4] = { 0, 0, 0, 0 }; bool bSetMargins[4] = { false, false, false, false }; for( int i=0; pExpr && i<4 && !pExpr->GetOp(); ++i ) { bool bSetThis = false; - long nMargin = 0; + tools::Long nMargin = 0; switch( pExpr->GetType() ) { @@ -2268,8 +2268,8 @@ static void ParseCSS1_margin( const CSS1Expression *pExpr, double fMargin = pExpr->GetNumber(); if (fMargin < SAL_MAX_INT32/2.0 && fMargin > SAL_MIN_INT32/2.0) { - nMargin = static_cast<long>(fMargin); - long nPWidth = 0; + nMargin = static_cast<tools::Long>(fMargin); + tools::Long nPWidth = 0; SvxCSS1Parser::PixelToTwip( nPWidth, nMargin ); bSetThis = true; } @@ -2401,7 +2401,7 @@ static bool ParseCSS1_padding_xxx( const CSS1Expression *pExpr, { case CSS1_LENGTH: { - long nTmp = pExpr->GetSLength(); + tools::Long nTmp = pExpr->GetSLength(); if( nTmp < 0 ) nTmp = 0; else if( nTmp > SvxCSS1PropertyInfo::UNSET_BORDER_DISTANCE-1 ) @@ -2415,8 +2415,8 @@ static bool ParseCSS1_padding_xxx( const CSS1Expression *pExpr, double fWidth = pExpr->GetNumber(); if (fWidth < SAL_MAX_INT32/2.0 && fWidth > SAL_MIN_INT32/2.0) { - long nPWidth = static_cast<long>(fWidth); - long nPHeight = 0; + tools::Long nPWidth = static_cast<tools::Long>(fWidth); + tools::Long nPHeight = 0; if( nPWidth < 0 ) nPWidth = 0; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); @@ -2561,8 +2561,8 @@ static void ParseCSS1_border_xxx( const CSS1Expression *pExpr, bool bHori = nWhichLine == SvxBoxItemLine::TOP || nWhichLine == SvxBoxItemLine::BOTTOM; - long nPWidth = bHori ? 0 : fWidth; - long nPHeight = bHori ? fWidth : 0; + tools::Long nPWidth = bHori ? 0 : fWidth; + tools::Long nPHeight = bHori ? fWidth : 0; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); nWidth = static_cast<sal_uInt16>(bHori ? nPHeight : nPWidth); } @@ -2633,13 +2633,13 @@ static void ParseCSS1_border_xxx_width( const CSS1Expression *pExpr, double fLength = pExpr->GetNumber(); if (fLength < SAL_MAX_INT32/2.0 && fLength > SAL_MIN_INT32/2.0) { - long nWidthL = static_cast<long>(fLength); + tools::Long nWidthL = static_cast<tools::Long>(fLength); bool bHori = nWhichLine == SvxBoxItemLine::TOP || nWhichLine == SvxBoxItemLine::BOTTOM; - long nPWidth = bHori ? 0 : nWidthL; - long nPHeight = bHori ? nWidthL : 0; + tools::Long nPWidth = bHori ? 0 : nWidthL; + tools::Long nPHeight = bHori ? nWidthL : 0; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); nWidth = static_cast<sal_uInt16>(bHori ? nPHeight : nPWidth); } @@ -2826,7 +2826,7 @@ static void ParseCSS1_position( const CSS1Expression *pExpr, } static void ParseCSS1_length( const CSS1Expression *pExpr, - long& rLength, + tools::Long& rLength, SvxCSS1LengthType& rLengthType, bool bHori ) { @@ -2851,9 +2851,9 @@ static void ParseCSS1_length( const CSS1Expression *pExpr, double fLength = pExpr->GetNumber(); if (fLength < SAL_MAX_INT32/2.0 && fLength > SAL_MIN_INT32/2.0) { - long nWidthL = static_cast<long>(fLength); - long nPWidth = bHori ? 0 : nWidthL; - long nPHeight = bHori ? nWidthL : 0; + tools::Long nWidthL = static_cast<tools::Long>(fLength); + tools::Long nPWidth = bHori ? 0 : nWidthL; + tools::Long nPHeight = bHori ? nWidthL : 0; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); rLength = (bHori ? nPHeight : nPWidth); rLengthType = SVX_CSS1_LTYPE_TWIP; @@ -2862,7 +2862,7 @@ static void ParseCSS1_length( const CSS1Expression *pExpr, break; case CSS1_PERCENTAGE: - rLength = static_cast<long>(pExpr->GetNumber()); + rLength = static_cast<tools::Long>(pExpr->GetNumber()); if( rLength > 100 ) rLength = 100; rLengthType = SVX_CSS1_LTYPE_PERCENTAGE; @@ -2939,8 +2939,8 @@ static void ParseCSS1_size( const CSS1Expression *pExpr, double fHeight = pExpr->GetNumber(); if (fHeight < SAL_MAX_INT32/2.0 && fHeight > SAL_MIN_INT32/2.0) { - long nPHeight = static_cast<long>(fHeight); - long nPWidth = n==0 ? nPHeight : 0; + tools::Long nPHeight = static_cast<tools::Long>(fHeight); + tools::Long nPWidth = n==0 ? nPHeight : 0; SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); rPropInfo.m_nHeight = nPHeight; if( n==0 ) diff --git a/sw/source/filter/html/svxcss1.hxx b/sw/source/filter/html/svxcss1.hxx index 8bc1f47b380a..e7888ff39813 100644 --- a/sw/source/filter/html/svxcss1.hxx +++ b/sw/source/filter/html/svxcss1.hxx @@ -130,9 +130,9 @@ public: sal_uInt16 m_nColumnCount; - long m_nLeft, m_nTop; - long m_nWidth, m_nHeight; - long m_nLeftMargin, m_nRightMargin; + tools::Long m_nLeft, m_nTop; + tools::Long m_nWidth, m_nHeight; + tools::Long m_nLeftMargin, m_nRightMargin; SvxCSS1LengthType m_eLeftType, m_eTopType; SvxCSS1LengthType m_eWidthType, m_eHeightType; @@ -257,7 +257,7 @@ public: static bool GetEnum( const CSS1PropertyEnum *pPropTable, const OUString& rValue, sal_uInt16 &rEnum ); - static void PixelToTwip( long &nWidth, long &nHeight ); + static void PixelToTwip( tools::Long &nWidth, tools::Long &nHeight ); // determine the font height of a certain font size (0-6) virtual sal_uInt32 GetFontHeight( sal_uInt16 nSize ) const; diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index d5cd46f5e3db..c7810ee60ad6 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -4843,7 +4843,7 @@ void SwHTMLParser::InsertSpacer() sal_Int16 eVertOri = text::VertOrientation::TOP; sal_Int16 eHoriOri = text::HoriOrientation::NONE; Size aSize( 0, 0); - long nSize = 0; + tools::Long nSize = 0; bool bPercentWidth = false; bool bPercentHeight = false; sal_uInt16 nType = HTML_SPTYPE_HORI; @@ -4868,12 +4868,12 @@ void SwHTMLParser::InsertSpacer() case HtmlOptionId::WIDTH: // First only save as pixel value! bPercentWidth = (rOption.GetString().indexOf('%') != -1); - aSize.setWidth( static_cast<long>(rOption.GetNumber()) ); + aSize.setWidth( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::HEIGHT: // First only save as pixel value! bPercentHeight = (rOption.GetString().indexOf('%') != -1); - aSize.setHeight( static_cast<long>(rOption.GetNumber()) ); + aSize.setHeight( static_cast<tools::Long>(rOption.GetNumber()) ); break; case HtmlOptionId::SIZE: // First only save as pixel value! @@ -5011,7 +5011,7 @@ sal_uInt16 SwHTMLParser::ToTwips( sal_uInt16 nPixel ) { if( nPixel && Application::GetDefaultDevice() ) { - long nTwips = Application::GetDefaultDevice()->PixelToLogic( + tools::Long nTwips = Application::GetDefaultDevice()->PixelToLogic( Size( nPixel, nPixel ), MapMode( MapUnit::MapTwip ) ).Width(); return static_cast<sal_uInt16>(std::min(nTwips, SwTwips(SAL_MAX_UINT16))); } @@ -5291,8 +5291,8 @@ void SwHTMLParser::InsertHorzRule() SvxBorderLine aBorderLine( &aColor ); if( nSize ) { - long nPWidth = 0; - long nPHeight = static_cast<long>(nSize); + tools::Long nPWidth = 0; + tools::Long nPHeight = static_cast<tools::Long>(nSize); SvxCSS1Parser::PixelToTwip( nPWidth, nPHeight ); if ( !bNoShade ) { @@ -5324,17 +5324,17 @@ void SwHTMLParser::InsertHorzRule() if (!m_xTable) { // fake length and alignment of line above paragraph indents - long nBrowseWidth = GetCurrentBrowseWidth(); + tools::Long nBrowseWidth = GetCurrentBrowseWidth(); nWidth = bPercentWidth ? static_cast<sal_uInt16>((nWidth*nBrowseWidth) / 100) : ToTwips( static_cast<sal_uInt16>(nBrowseWidth) ); if( nWidth < MINLAY ) nWidth = MINLAY; - const SwFormatColl *pColl = (static_cast<long>(nWidth) < nBrowseWidth) ? GetCurrFormatColl() : nullptr; + const SwFormatColl *pColl = (static_cast<tools::Long>(nWidth) < nBrowseWidth) ? GetCurrFormatColl() : nullptr; if (pColl) { SvxLRSpaceItem aLRItem( pColl->GetLRSpace() ); - long nDist = nBrowseWidth - nWidth; + tools::Long nDist = nBrowseWidth - nWidth; switch( eAdjust ) { diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index 8227668f8dde..ab282ba652ff 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -458,8 +458,8 @@ public: inline void OutCSS1_Property( const char *pProp, const OUString& rVal ); void OutCSS1_Property( const char *pProp, const char *pVal, const OUString *pSVal ); - void OutCSS1_UnitProperty( const char *pProp, long nVal ); - void OutCSS1_PixelProperty( const char *pProp, long nVal, bool bVert ); + void OutCSS1_UnitProperty( const char *pProp, tools::Long nVal ); + void OutCSS1_PixelProperty( const char *pProp, tools::Long nVal, bool bVert ); void OutCSS1_SfxItemSet( const SfxItemSet& rItemSet, bool bDeep=true ); // events of BODY tag from SFX configuration diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index 338de25fcddd..2dbf2d6fae1e 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -165,7 +165,7 @@ public: void NewAttr(const SwPosition& rPos, const SfxPoolItem & rAttr ); - virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnd=true, long nHand = LONG_MAX, bool consumedByField=false); + virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnd=true, tools::Long nHand = LONG_MAX, bool consumedByField=false); void StealAttr(const SwNodeIndex& rNode); void MarkAllAttrsOld(); @@ -234,7 +234,7 @@ class SW_DLLPUBLIC SwFltBookmark : public SfxPoolItem { private: - long mnHandle; + tools::Long mnHandle; OUString maName; OUString maVal; bool mbIsTOCBookmark; @@ -242,14 +242,14 @@ private: public: SwFltBookmark( const OUString& rNa, const OUString& rVa, - long nHand, + tools::Long nHand, const bool bIsTOCBookmark = false ); // "purely virtual methods" of SfxPoolItem virtual bool operator==(const SfxPoolItem&) const override; virtual SwFltBookmark* Clone(SfxItemPool* = nullptr) const override; - long GetHandle() const { return mnHandle; } + tools::Long GetHandle() const { return mnHandle; } const OUString& GetName() const { return maName; } const OUString& GetValSys() const { return maVal; } bool IsTOCBookmark() const @@ -261,7 +261,7 @@ public: /// Stores RDF statements on a paragraph (key-value pairs where the subject is the paragraph). class SW_DLLPUBLIC SwFltRDFMark : public SfxPoolItem { - long m_nHandle; + tools::Long m_nHandle; std::vector< std::pair<OUString, OUString> > m_aAttributes; public: @@ -270,8 +270,8 @@ public: virtual bool operator==(const SfxPoolItem&) const override; virtual SwFltRDFMark* Clone(SfxItemPool* = nullptr) const override; - void SetHandle(long nHandle); - long GetHandle() const; + void SetHandle(tools::Long nHandle); + tools::Long GetHandle() const; void SetAttributes(const std::vector< std::pair<OUString, OUString> >& rAttributes); const std::vector< std::pair<OUString, OUString> >& GetAttributes() const; }; @@ -313,7 +313,7 @@ class ImportProgress private: SwDocShell *m_pDocShell; public: - ImportProgress(SwDocShell *pDocShell, long nStartVal, long nEndVal) + ImportProgress(SwDocShell *pDocShell, tools::Long nStartVal, tools::Long nEndVal) : m_pDocShell(pDocShell) { ::StartProgress(STR_STATSTR_W4WREAD, nStartVal, nEndVal, m_pDocShell); diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx index 27710a11b842..33cfe6782fba 100644 --- a/sw/source/filter/inc/wrtswtbl.hxx +++ b/sw/source/filter/inc/wrtswtbl.hxx @@ -48,7 +48,7 @@ class SW_DLLPUBLIC SwWriteTableCell const SwTableBox *pBox; // SwTableBox of the cell const SvxBrushItem *pBackground; // inherited background of a row - long nHeight; // fix/minimum height of a row + tools::Long nHeight; // fix/minimum height of a row sal_uInt32 nWidthOpt; // width from option; @@ -63,7 +63,7 @@ class SW_DLLPUBLIC SwWriteTableCell public: SwWriteTableCell(const SwTableBox *pB, sal_uInt16 nR, sal_uInt16 nC, sal_uInt16 nRSpan, - sal_uInt16 nCSpan, long nHght, const SvxBrushItem *pBGround) + sal_uInt16 nCSpan, tools::Long nHght, const SvxBrushItem *pBGround) : pBox( pB ), pBackground( pBGround ), nHeight( nHght ), nWidthOpt( 0 ), nRow( nR ), nCol( nC ), nRowSpan( nRSpan ), nColSpan( nCSpan ), bPercentWidthOpt( false ) @@ -77,7 +77,7 @@ public: sal_uInt16 GetRowSpan() const { return nRowSpan; } sal_uInt16 GetColSpan() const { return nColSpan; } - long GetHeight() const { return nHeight; } + tools::Long GetHeight() const { return nHeight; } sal_Int16 GetVertOri() const; const SvxBrushItem *GetBackground() const { return pBackground; } @@ -98,7 +98,7 @@ class SwWriteTableRow final SwWriteTableCells m_Cells; ///< all cells of the rows const SvxBrushItem *pBackground; // background - long nPos; // end position (twips) of the row + tools::Long nPos; // end position (twips) of the row bool mbUseLayoutHeights; SwWriteTableRow & operator= (const SwWriteTableRow &) = delete; @@ -114,12 +114,12 @@ public: bool bTopBorder : 1; // which borders are there? bool bBottomBorder : 1; - SwWriteTableRow( long nPos, bool bUseLayoutHeights ); + SwWriteTableRow( tools::Long nPos, bool bUseLayoutHeights ); SwWriteTableCell *AddCell( const SwTableBox *pBox, sal_uInt16 nRow, sal_uInt16 nCol, sal_uInt16 nRowSpan, sal_uInt16 nColSpan, - long nHeight, + tools::Long nHeight, const SvxBrushItem *pBackground ); void SetBackground( const SvxBrushItem *pBGround ) @@ -247,15 +247,15 @@ protected: virtual bool ShouldExpandSub( const SwTableBox *pBox, bool bExpandedBefore, sal_uInt16 nDepth ) const; - void CollectTableRowsCols( long nStartRPos, sal_uInt32 nStartCPos, - long nParentLineHeight, + void CollectTableRowsCols( tools::Long nStartRPos, sal_uInt32 nStartCPos, + tools::Long nParentLineHeight, sal_uInt32 nParentLineWidth, const SwTableLines& rLines, sal_uInt16 nDepth ); - void FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, + void FillTableRowsCols( tools::Long nStartRPos, sal_uInt16 nStartRow, sal_uInt32 nStartCPos, sal_uInt16 nStartCol, - long nParentLineHeight, + tools::Long nParentLineHeight, sal_uInt32 nParentLineWidth, const SwTableLines& rLines, const SvxBrushItem* pLineBrush, @@ -280,12 +280,12 @@ public: sal_uInt16 GetRelWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const; sal_uInt16 GetPercentWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const; - long GetAbsHeight(long nRawWidth, size_t nRow, sal_uInt16 nRowSpan) const; + tools::Long GetAbsHeight(tools::Long nRawWidth, size_t nRow, sal_uInt16 nRowSpan) const; double GetAbsWidthRatio() const { return m_nTabWidth == m_nBaseWidth ? 1.0 : double(m_nTabWidth) / m_nBaseWidth; } protected: - long GetLineHeight( const SwTableLine *pLine ); - static long GetLineHeight( const SwTableBox *pBox ); + tools::Long GetLineHeight( const SwTableLine *pLine ); + static tools::Long GetLineHeight( const SwTableBox *pBox ); static const SvxBrushItem *GetLineBrush( const SwTableBox *pBox, SwWriteTableRow *pRow ); @@ -293,7 +293,7 @@ protected: sal_uInt16 GetRightSpace(size_t nCol, sal_uInt16 nColSpan) const; public: - SwWriteTable(const SwTable* pTable, const SwTableLines& rLines, long nWidth, sal_uInt32 nBWidth, + SwWriteTable(const SwTable* pTable, const SwTableLines& rLines, tools::Long nWidth, sal_uInt32 nBWidth, bool bRel, sal_uInt16 nMaxDepth = USHRT_MAX, sal_uInt16 nLeftSub=0, sal_uInt16 nRightSub=0, sal_uInt32 nNumOfRowsToRepeat=0); SwWriteTable(const SwTable* pTable, const SwHTMLTableLayout *pLayoutInfo); diff --git a/sw/source/filter/writer/writer.cxx b/sw/source/filter/writer/writer.cxx index 8319f5181024..2311111fe39a 100644 --- a/sw/source/filter/writer/writer.cxx +++ b/sw/source/filter/writer/writer.cxx @@ -223,7 +223,7 @@ void Writer::SetStream(SvStream *const pStream) m_pImpl->m_pStream = pStream; } -SvStream& Writer::OutLong( SvStream& rStrm, long nVal ) +SvStream& Writer::OutLong( SvStream& rStrm, tools::Long nVal ) { const bool bNeg = nVal < 0; if (bNeg) diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx index 5135ee64ef58..3c9c031c16fb 100644 --- a/sw/source/filter/writer/wrtswtbl.cxx +++ b/sw/source/filter/writer/wrtswtbl.cxx @@ -54,7 +54,7 @@ sal_Int16 SwWriteTableCell::GetVertOri() const return eCellVertOri; } -SwWriteTableRow::SwWriteTableRow( long nPosition, bool bUseLayoutHeights ) +SwWriteTableRow::SwWriteTableRow( tools::Long nPosition, bool bUseLayoutHeights ) : pBackground(nullptr), nPos(nPosition), mbUseLayoutHeights(bUseLayoutHeights), nTopBorder(USHRT_MAX), nBottomBorder(USHRT_MAX), bTopBorder(true), bBottomBorder(true) @@ -64,7 +64,7 @@ SwWriteTableRow::SwWriteTableRow( long nPosition, bool bUseLayoutHeights ) SwWriteTableCell *SwWriteTableRow::AddCell( const SwTableBox *pBox, sal_uInt16 nRow, sal_uInt16 nCol, sal_uInt16 nRowSpan, sal_uInt16 nColSpan, - long nHeight, + tools::Long nHeight, const SvxBrushItem *pBackgroundBrush ) { SwWriteTableCell *pCell = @@ -90,14 +90,14 @@ sal_uInt32 SwWriteTable::GetBoxWidth( const SwTableBox *pBox ) return sal::static_int_cast<sal_uInt32>(aFrameSize.GetSize().Width()); } -long SwWriteTable::GetLineHeight( const SwTableLine *pLine ) +tools::Long SwWriteTable::GetLineHeight( const SwTableLine *pLine ) { #ifdef DBG_UTIL bool bOldGetLineHeightCalled = m_bGetLineHeightCalled; m_bGetLineHeightCalled = true; #endif - long nHeight = 0; + tools::Long nHeight = 0; if( m_bUseLayoutHeights ) { // At first we try to get the height of the layout. @@ -127,7 +127,7 @@ long SwWriteTable::GetLineHeight( const SwTableLine *pLine ) } else { - long nTmp = 0; + tools::Long nTmp = 0; const SwTableLines &rLines = pBox->GetTabLines(); for( size_t nLine=0; nLine<rLines.size(); nLine++ ) { @@ -141,7 +141,7 @@ long SwWriteTable::GetLineHeight( const SwTableLine *pLine ) return nHeight; } -long SwWriteTable::GetLineHeight( const SwTableBox *pBox ) +tools::Long SwWriteTable::GetLineHeight( const SwTableBox *pBox ) { const SwTableLine *pLine = pBox->GetUpper(); @@ -152,7 +152,7 @@ long SwWriteTable::GetLineHeight( const SwTableBox *pBox ) const SfxPoolItem* pItem; const SfxItemSet& rItemSet = pLineFrameFormat->GetAttrSet(); - long nHeight = 0; + tools::Long nHeight = 0; if( SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem )) nHeight = static_cast<const SwFormatFrameSize*>(pItem)->GetHeight(); @@ -341,23 +341,23 @@ sal_uInt16 SwWriteTable::GetAbsWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) con sal_uInt16 SwWriteTable::GetRelWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const { - long nWidth = GetRawWidth( nCol, nColSpan ); + tools::Long nWidth = GetRawWidth( nCol, nColSpan ); - return static_cast<sal_uInt16>(static_cast<long>(Fraction( nWidth*256 + GetBaseWidth()/2, + return static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction( nWidth*256 + GetBaseWidth()/2, GetBaseWidth() ))); } sal_uInt16 SwWriteTable::GetPercentWidth( sal_uInt16 nCol, sal_uInt16 nColSpan ) const { - long nWidth = GetRawWidth( nCol, nColSpan ); + tools::Long nWidth = GetRawWidth( nCol, nColSpan ); // Looks funny, but is nothing more than // [(100 * nWidth) + .5] without rounding errors - return static_cast<sal_uInt16>(static_cast<long>(Fraction( nWidth*100 + GetBaseWidth()/2, + return static_cast<sal_uInt16>(static_cast<tools::Long>(Fraction( nWidth*100 + GetBaseWidth()/2, GetBaseWidth() ))); } -long SwWriteTable::GetAbsHeight(long nRawHeight, size_t const nRow, +tools::Long SwWriteTable::GetAbsHeight(tools::Long nRawHeight, size_t const nRow, sal_uInt16 nRowSpan ) const { nRawHeight -= (2*m_nCellPadding + m_nCellSpacing); @@ -396,9 +396,9 @@ bool SwWriteTable::ShouldExpandSub(const SwTableBox *pBox, bool /*bExpandedBefor // FillTableRowsCols which is called immediately afterwards // is -extremely- unpleasant and potentially problematic. -void SwWriteTable::CollectTableRowsCols( long nStartRPos, +void SwWriteTable::CollectTableRowsCols( tools::Long nStartRPos, sal_uInt32 nStartCPos, - long nParentLineHeight, + tools::Long nParentLineHeight, sal_uInt32 nParentLineWidth, const SwTableLines& rLines, sal_uInt16 nDepth ) @@ -410,16 +410,16 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, sal_uInt32 nEndCPos = 0; #endif - long nRPos = nStartRPos; + tools::Long nRPos = nStartRPos; for( SwTableLines::size_type nLine = 0; nLine < nLines; ++nLine ) { /*const*/ SwTableLine *pLine = rLines[nLine]; - long nOldRPos = nRPos; + tools::Long nOldRPos = nRPos; if( nLine < nLines-1 || nParentLineHeight==0 ) { - long nLineHeight = GetLineHeight( pLine ); + tools::Long nLineHeight = GetLineHeight( pLine ); nRPos += nLineHeight; if( nParentLineHeight && nStartRPos + nParentLineHeight <= nRPos ) { @@ -439,7 +439,7 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, else { #if OSL_DEBUG_LEVEL > 0 - long nCheckPos = nRPos + GetLineHeight( pLine ); + tools::Long nCheckPos = nRPos + GetLineHeight( pLine ); #endif nRPos = nStartRPos + nParentLineHeight; #if OSL_DEBUG_LEVEL > 0 @@ -520,9 +520,9 @@ void SwWriteTable::CollectTableRowsCols( long nStartRPos, } } -void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, +void SwWriteTable::FillTableRowsCols( tools::Long nStartRPos, sal_uInt16 nStartRow, sal_uInt32 nStartCPos, sal_uInt16 nStartCol, - long nParentLineHeight, + tools::Long nParentLineHeight, sal_uInt32 nParentLineWidth, const SwTableLines& rLines, const SvxBrushItem* pParentBrush, @@ -533,7 +533,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, bool bSubExpanded = false; // Specifying the border - long nRPos = nStartRPos; + tools::Long nRPos = nStartRPos; sal_uInt16 nRow = nStartRow; for( SwTableLines::size_type nLine = 0; nLine < nLines; ++nLine ) @@ -541,10 +541,10 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, const SwTableLine *pLine = rLines[nLine]; // Determine the position of the last covered row - long nOldRPos = nRPos; + tools::Long nOldRPos = nRPos; if( nLine < nLines-1 || nParentLineHeight==0 ) { - long nLineHeight = GetLineHeight( pLine ); + tools::Long nLineHeight = GetLineHeight( pLine ); nRPos += nLineHeight; if( nParentLineHeight && nStartRPos + nParentLineHeight <= nRPos ) { @@ -589,7 +589,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, const SfxPoolItem* pItem; const SfxItemSet& rItemSet = pLineFrameFormat->GetAttrSet(); - long nHeight = 0; + tools::Long nHeight = 0; if( SfxItemState::SET == rItemSet.GetItemState( RES_FRM_SIZE, true, &pItem )) nHeight = static_cast<const SwFormatFrameSize*>(pItem)->GetHeight(); @@ -657,7 +657,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, sal_uInt16 nRowSpan = nRow - nOldRow + 1; // The new table model may have true row span attributes - const long nAttrRowSpan = pBox->getRowSpan(); + const tools::Long nAttrRowSpan = pBox->getRowSpan(); if ( 1 < nAttrRowSpan ) nRowSpan = static_cast<sal_uInt16>(nAttrRowSpan); else if ( nAttrRowSpan < 1 ) @@ -728,7 +728,7 @@ void SwWriteTable::FillTableRowsCols( long nStartRPos, sal_uInt16 nStartRow, } } -SwWriteTable::SwWriteTable(const SwTable* pTable, const SwTableLines& rLines, long nWidth, +SwWriteTable::SwWriteTable(const SwTable* pTable, const SwTableLines& rLines, tools::Long nWidth, sal_uInt32 nBWidth, bool bRel, sal_uInt16 nMaxDepth, sal_uInt16 nLSub, sal_uInt16 nRSub, sal_uInt32 nNumOfRowsToRepeat) : m_pTable(pTable), m_nBorderColor(sal_uInt32(-1)), m_nCellSpacing(0), m_nCellPadding(0), m_nBorder(0), m_nInnerBorder(0), m_nBaseWidth(nBWidth), m_nHeadEndRow(USHRT_MAX), @@ -838,7 +838,7 @@ SwWriteTable::SwWriteTable(const SwTable* pTable, const SwHTMLTableLayout *pLayo OSL_ENSURE( pBox, "Table in Table can not be exported over layout" ); - long nHeight = bHeightExported ? 0 : GetLineHeight( pBox ); + tools::Long nHeight = bHeightExported ? 0 : GetLineHeight( pBox ); const SvxBrushItem *pBrushItem = GetLineBrush( pBox, pRow ); SwWriteTableCell *pCell = diff --git a/sw/source/filter/ww8/WW8TableInfo.cxx b/sw/source/filter/ww8/WW8TableInfo.cxx index 7eb51d6f287c..98217348baf9 100644 --- a/sw/source/filter/ww8/WW8TableInfo.cxx +++ b/sw/source/filter/ww8/WW8TableInfo.cxx @@ -201,7 +201,7 @@ GridColsPtr WW8TableNodeInfoInner::getGridColsOfRow(AttributeOutputBase & rBase, const SwFormatFrameSize &rSize = pFormat->GetFrameSize(); unsigned long nTableSz = static_cast<unsigned long>(rSize.GetWidth()); - long nPageSize = 0; + tools::Long nPageSize = 0; bool bRelBoxSize = false; rBase.GetTablePageSize( this, nPageSize, bRelBoxSize ); @@ -1033,7 +1033,7 @@ WW8TableCellGrid::~WW8TableCellGrid() { } -WW8TableCellGridRow::Pointer_t WW8TableCellGrid::getRow(long nTop, bool bCreate) +WW8TableCellGridRow::Pointer_t WW8TableCellGrid::getRow(tools::Long nTop, bool bCreate) { WW8TableCellGridRow::Pointer_t pResult; @@ -1064,12 +1064,12 @@ WW8TableCellGrid::RowTops_t::const_iterator WW8TableCellGrid::getRowTopsEnd() co return m_aRowTops.end(); } -CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsBegin(long nTop) +CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsBegin(tools::Long nTop) { return getRow(nTop)->begin(); } -CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsEnd(long nTop) +CellInfoMultiSet::const_iterator WW8TableCellGrid::getCellsEnd(tools::Long nTop) { return getRow(nTop)->end(); } @@ -1103,7 +1103,7 @@ void WW8TableCellGrid::addShadowCells() bool bBeginningOfCell = true; bool bVertMerge = false; SwRect aRect = aCellIt->getRect(); - long nRowSpan = 1; + tools::Long nRowSpan = 1; while (aCellIt != aCellEndIt) { WW8TableNodeInfo * pNodeInfo = aCellIt->getTableNodeInfo(); @@ -1181,7 +1181,7 @@ WW8TableNodeInfo * WW8TableCellGrid::connectCells(RowEndInners_t &rLastRowEnds) sal_uInt32 nDepthInCell = 0; while (aCellIt != aCellEndIt) { - long nCellX = aCellIt->left(); + tools::Long nCellX = aCellIt->left(); WW8TableNodeInfo * pNodeInfo = aCellIt->getTableNodeInfo(); if (pNodeInfo) { diff --git a/sw/source/filter/ww8/WW8TableInfo.hxx b/sw/source/filter/ww8/WW8TableInfo.hxx index 1f344d4f019e..ca2cfb2c9252 100644 --- a/sw/source/filter/ww8/WW8TableInfo.hxx +++ b/sw/source/filter/ww8/WW8TableInfo.hxx @@ -130,12 +130,12 @@ public: bool operator < (const CellInfo & aCellInfo) const; - long top() const { return m_aRect.Top(); } - long bottom() const { return m_aRect.Bottom(); } - long left() const { return m_aRect.Left(); } - long right() const { return m_aRect.Right(); } - long width() const { return m_aRect.Width(); } - long height() const { return m_aRect.Height(); } + tools::Long top() const { return m_aRect.Top(); } + tools::Long bottom() const { return m_aRect.Bottom(); } + tools::Long left() const { return m_aRect.Left(); } + tools::Long right() const { return m_aRect.Right(); } + tools::Long width() const { return m_aRect.Width(); } + tools::Long height() const { return m_aRect.Height(); } const SwRect& getRect() const { return m_aRect; } WW8TableNodeInfo * getTableNodeInfo() const { return m_pNodeInfo; } @@ -261,11 +261,11 @@ class WW8TableCellGrid RowTops_t m_aRowTops; Rows_t m_aRows; - WW8TableCellGridRow::Pointer_t getRow(long nTop, bool bCreate = true); + WW8TableCellGridRow::Pointer_t getRow(tools::Long nTop, bool bCreate = true); RowTops_t::const_iterator getRowTopsBegin() const; RowTops_t::const_iterator getRowTopsEnd() const; - CellInfoMultiSet::const_iterator getCellsBegin(long nTop); - CellInfoMultiSet::const_iterator getCellsEnd(long nTop); + CellInfoMultiSet::const_iterator getCellsBegin(tools::Long nTop); + CellInfoMultiSet::const_iterator getCellsEnd(tools::Long nTop); public: typedef std::shared_ptr<WW8TableCellGrid> Pointer_t; diff --git a/sw/source/filter/ww8/attributeoutputbase.hxx b/sw/source/filter/ww8/attributeoutputbase.hxx index 89865c7de7f5..327f1fa9d26d 100644 --- a/sw/source/filter/ww8/attributeoutputbase.hxx +++ b/sw/source/filter/ww8/attributeoutputbase.hxx @@ -666,7 +666,7 @@ public: void GetTablePageSize ( ww8::WW8TableNodeInfoInner const * pTableTextNodeInfoInner, - long& rPageSize, bool& rRelBoxSize ); + tools::Long& rPageSize, bool& rRelBoxSize ); virtual void MaybeOutputBrushItem(SfxItemSet const&) { } diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 59656cce9d3e..76c40c207e36 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -3623,7 +3623,7 @@ void DocxAttributeOutput::InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t if (m_xTableWrt && pTable == m_xTableWrt->GetTable()) return; - long nPageSize = 0; + tools::Long nPageSize = 0; bool bRelBoxSize = false; // Create the SwWriteTable instance to use col spans (and maybe other infos) @@ -3868,7 +3868,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t // prepend the properties before the run m_pSerializer->mark(Tag_TableDefinition, comphelper::containerToSequence(aOrder)); - long nPageSize = 0; + tools::Long nPageSize = 0; const char* widthType = "dxa"; // If actual width of table is relative it should export is as "pct".` @@ -4039,7 +4039,7 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t // from lcl_DecrementHoriOrientPosition() in writerfilter if (const editeng::SvxBorderLine* pLeftBorder = rBox.GetLeft()) { - long nWidth = pLeftBorder->GetWidth(); + tools::Long nWidth = pLeftBorder->GetWidth(); nValue += (nWidth / 2); } @@ -5673,7 +5673,7 @@ void DocxAttributeOutput::WriteOLEShape(const SwFlyFrameFormat& rFrameFormat, co { //Get the left border color and width const Color aLineColor = rBox.GetLeft()->GetColor(); - const long aLineWidth = rBox.GetLeft()->GetWidth(); + const tools::Long aLineWidth = rBox.GetLeft()->GetWidth(); //Convert the left OLE border style to OOXML //FIXME improve if it's necessary @@ -8443,7 +8443,7 @@ void DocxAttributeOutput::ParaWidows( const SvxWidowsItem& rWidows ) } static void impl_WriteTabElement( FSHelperPtr const & pSerializer, - const SvxTabStop& rTab, long tabsOffset ) + const SvxTabStop& rTab, tools::Long tabsOffset ) { FastAttributeList *pTabElementAttrList = FastSerializerHelper::createAttrList(); @@ -8518,7 +8518,7 @@ void DocxAttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStop ) // Get offset for tabs // In DOCX, w:pos specifies the position of the current custom tab stop with respect to the current page margins. // But in ODT, zero position could be page margins or paragraph indent according to used settings. - long tabsOffset = 0; + tools::Long tabsOffset = 0; if (m_rExport.m_rDoc.getIDocumentSettingAccess().get(DocumentSettingId::TABS_RELATIVE_TO_INDENT)) tabsOffset = m_rExport.GetItem(RES_LR_SPACE).GetTextLeft(); diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx index d18c1daafd30..a1656ea75fab 100644 --- a/sw/source/filter/ww8/docxsdrexport.cxx +++ b/sw/source/filter/ww8/docxsdrexport.cxx @@ -428,7 +428,7 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons awt::Point aPos(pFrameFormat->GetHoriOrient().GetPos(), pFrameFormat->GetVertOrient().GetPos()); const SdrObject* pObj = pFrameFormat->FindRealSdrObject(); - long nRotation = 0; + tools::Long nRotation = 0; if (pObj != nullptr) { // SdrObjects know their layer, consider that instead of the frame format. @@ -713,9 +713,9 @@ void DocxSdrExport::startDMLAnchorInline(const SwFrameFormat* pFrameFormat, cons * 2147483647( MAX_INTEGER_VALUE ). * Therefore changing the following accordingly so that LO sync's up with MSO. **/ - sal_uInt64 cx = TwipsToEMU(std::clamp(rSize.Width(), 0L, long(SAL_MAX_INT32))); + sal_uInt64 cx = TwipsToEMU(std::clamp(rSize.Width(), 0L, tools::Long(SAL_MAX_INT32))); OString aWidth(OString::number(std::min(cx, sal_uInt64(SAL_MAX_INT32)))); - sal_uInt64 cy = TwipsToEMU(std::clamp(rSize.Height(), 0L, long(SAL_MAX_INT32))); + sal_uInt64 cy = TwipsToEMU(std::clamp(rSize.Height(), 0L, tools::Long(SAL_MAX_INT32))); OString aHeight(OString::number(std::min(cy, sal_uInt64(SAL_MAX_INT32)))); m_pImpl->getSerializer()->singleElementNS(XML_wp, XML_extent, XML_cx, aWidth, XML_cy, aHeight); diff --git a/sw/source/filter/ww8/escher.hxx b/sw/source/filter/ww8/escher.hxx index 6bdb7d03b450..91f90685a18e 100644 --- a/sw/source/filter/ww8/escher.hxx +++ b/sw/source/filter/ww8/escher.hxx @@ -96,7 +96,7 @@ private: protected: WW8Export& rWrt; SvStream* pEscherStrm; - long mnEmuMul, mnEmuDiv; + tools::Long mnEmuMul, mnEmuDiv; virtual sal_Int32 WriteFlyFrameAttr(const SwFrameFormat& rFormat, MSO_SPT eShapeType, EscherPropertyContainer& rPropOpt); diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index c91acb378f6d..9e76b3d3fd48 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -963,7 +963,7 @@ void RtfAttributeOutput::InitTableHelper( if (m_pTableWrt && pTable == m_pTableWrt->GetTable()) return; - long nPageSize = 0; + tools::Long nPageSize = 0; bool bRelBoxSize = false; // Create the SwWriteTable instance to use col spans @@ -2930,7 +2930,7 @@ void RtfAttributeOutput::ParaWidows(const SvxWidowsItem& rWidows) void RtfAttributeOutput::ParaTabStop(const SvxTabStopItem& rTabStop) { - long nOffset = 0; + tools::Long nOffset = 0; // Tabs are absolute by default. if (m_rExport.m_rDoc.getIDocumentSettingAccess().get( DocumentSettingId::TABS_RELATIVE_TO_INDENT)) @@ -3955,8 +3955,8 @@ static OString ExportPICT(const SwFlyFrameFormat* pFlyFrameFormat, const Size& r aRet.append("}"); //"}" } - long nXCroppedSize = rOrig.Width() - (rCr.GetLeft() + rCr.GetRight()); - long nYCroppedSize = rOrig.Height() - (rCr.GetTop() + rCr.GetBottom()); + tools::Long nXCroppedSize = rOrig.Width() - (rCr.GetLeft() + rCr.GetRight()); + tools::Long nYCroppedSize = rOrig.Height() - (rCr.GetTop() + rCr.GetBottom()); /* Graphic with a zero height or width, typically copied from webpages, caused crashes. */ if (!nXCroppedSize) nXCroppedSize = 100; diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index bc07a5c4d0ac..d5041849da32 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -1074,7 +1074,7 @@ void RtfExport::resetStream() { m_pStream.reset(); } SvStream& RtfExport::OutULong(sal_uLong nVal) { return Writer::OutULong(Strm(), nVal); } -SvStream& RtfExport::OutLong(long nVal) { return Writer::OutLong(Strm(), nVal); } +SvStream& RtfExport::OutLong(tools::Long nVal) { return Writer::OutLong(Strm(), nVal); } void RtfExport::OutUnicode(const char* pToken, const OUString& rContent, bool bUpr) { diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index 3b4f3b4b79d5..f95e75c5dbfb 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -184,7 +184,7 @@ public: /// Return back to the real stream. void resetStream(); SvStream& OutULong(sal_uLong nVal); - SvStream& OutLong(long nVal); + SvStream& OutLong(tools::Long nVal); void OutUnicode(const char* pToken, const OUString& rContent, bool bUpr = false); void OutDateTime(const char* pStr, const css::util::DateTime& rDT); void OutPageDescription(const SwPageDesc& rPgDsc, bool bCheckForFirstPage); diff --git a/sw/source/filter/ww8/rtfsdrexport.cxx b/sw/source/filter/ww8/rtfsdrexport.cxx index 81978c9bb106..87a559ed60f9 100644 --- a/sw/source/filter/ww8/rtfsdrexport.cxx +++ b/sw/source/filter/ww8/rtfsdrexport.cxx @@ -658,8 +658,8 @@ sal_Int32 RtfSdrExport::StartShape() rItemSet.GetItem(SID_ATTR_CHAR_FONTHEIGHT)); if (pFontHeight) { - long nFontHeight = TransformMetric(pFontHeight->GetHeight(), FieldUnit::TWIP, - FieldUnit::POINT); + tools::Long nFontHeight = TransformMetric(pFontHeight->GetHeight(), + FieldUnit::TWIP, FieldUnit::POINT); lcl_AppendSP( m_rAttrOutput.RunText(), "gtextSize", msfilter::rtfutil::OutString(OUString::number(nFontHeight * RTF_MULTIPLIER), diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx index 7416b176bbef..97f09efba839 100644 --- a/sw/source/filter/ww8/writerhelper.cxx +++ b/sw/source/filter/ww8/writerhelper.cxx @@ -682,7 +682,7 @@ namespace sw const Size &rSize = pNd->GetTwipSize(); Fraction aMoveHack(ww::nWrap100Percent, rSize.Width()); aMoveHack *= Fraction(15, 1); - long nMove(aMoveHack); + tools::Long nMove(aMoveHack); Fraction aHackX(ww::nWrap100Percent + nMove, ww::nWrap100Percent); diff --git a/sw/source/filter/ww8/writerwordglue.cxx b/sw/source/filter/ww8/writerwordglue.cxx index 988890f66fd7..ce38776ac52d 100644 --- a/sw/source/filter/ww8/writerwordglue.cxx +++ b/sw/source/filter/ww8/writerwordglue.cxx @@ -65,7 +65,7 @@ namespace myImplHelpers Otherwise we have to get the real layout rendered height, which is totally nonoptimum, but the best we can do. */ - long nDist=0; + tools::Long nDist=0; const SwFormatFrameSize& rSz = rFormat.GetFrameSize(); const SwHeaderAndFooterEatSpacingItem &rSpacingCtrl = diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 426a0d094e13..97437d754923 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -553,7 +553,7 @@ sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft, return bRet; } -static bool RTLDrawingsHack(long &rLeft, +static bool RTLDrawingsHack(tools::Long &rLeft, sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft, SwTwips nPageRight, SwTwips nPageSize) { @@ -677,12 +677,12 @@ void PlcDrawObj::WritePlc( WW8Export& rWrt ) const aRect = pObj->GetLogicRect(); // rotating to vertical means swapping height and width as seen in SvxMSDffManager::ImportShape - const long nAngle = NormAngle36000( pObj->GetRotateAngle() ); + const tools::Long nAngle = NormAngle36000( pObj->GetRotateAngle() ); const bool bAllowSwap = pObj->GetObjIdentifier() != OBJ_LINE && pObj->GetObjIdentifier() != OBJ_GRUP; if ( bAllowSwap && (( nAngle > 4500 && nAngle <= 13500 ) || ( nAngle > 22500 && nAngle <= 31500 )) ) { - const long nWidth = aRect.getWidth(); - const long nHeight = aRect.getHeight(); + const tools::Long nWidth = aRect.getWidth(); + const tools::Long nHeight = aRect.getHeight(); aRect.setWidth( nHeight ); aRect.setHeight( nWidth ); bHasHeightWidthSwapped = true; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index f853af98aa83..b28c2bd4d2cf 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -227,9 +227,9 @@ void WW8_WrtBookmarks::Append( WW8_CP nStartCp, const OUString& rNm) if (aResult.second) { BKMK aBK(false,rNm); - BKMKCP* pBKCP = new BKMKCP(static_cast<long>(nStartCp),aBK); + BKMKCP* pBKCP = new BKMKCP(static_cast<tools::Long>(nStartCp),aBK); aSttCps.insert(std::pair<long,BKMKCP*>(nStartCp,pBKCP)); - aResult.first->second = static_cast<long>(nStartCp); + aResult.first->second = static_cast<tools::Long>(nStartCp); } else { @@ -240,7 +240,7 @@ void WW8_WrtBookmarks::Append( WW8_CP nStartCp, const OUString& rNm) { if (aItr->second->second.first) nStartCp--; - aItr->second->first = static_cast<long>(nStartCp); + aItr->second->first = static_cast<tools::Long>(nStartCp); break; } } @@ -251,7 +251,7 @@ void WW8_WrtBookmarks::Write( WW8Export& rWrt) { if (aSttCps.empty()) return; - long n; + tools::Long n; std::vector<OUString> aNames; SvMemoryStream aTempStrm1(65535,65535); SvMemoryStream aTempStrm2(65535,65535); @@ -307,7 +307,7 @@ void WW8_WrtBookmarks::MoveFieldMarks(WW8_CP nFrom, WW8_CP nTo) { if (aItr->second) { - if (aItr->second->first == static_cast<long>(nFrom)) + if (aItr->second->first == static_cast<tools::Long>(nFrom)) { aItr->second->second.first = true; aItr->second->first = nTo; @@ -985,7 +985,7 @@ void WW8_WrPlcPn::AppendFkpEntry(WW8_FC nEndFc,short nVarLen,const sal_uInt8* pS *p++ = *pSprms++; nVarLen -= 2; - long nDataPos = rWrt.pDataStrm->Tell(); + tools::Long nDataPos = rWrt.pDataStrm->Tell(); SwWW8Writer::WriteShort( *rWrt.pDataStrm, nVarLen ); rWrt.pDataStrm->WriteBytes(pSprms, nVarLen); @@ -2175,7 +2175,7 @@ void WW8AttributeOutput::TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTab const SwFrameFormat * pLineFormat = pTabLine->GetFrameFormat(); // output line height sprmTDyaRowHeight - long nHeight = 0; + tools::Long nHeight = 0; const SwFormatFrameSize& rLSz = pLineFormat->GetFrameSize(); if ( SwFrameSize::Variable != rLSz.GetHeightSizeType() && rLSz.GetHeight() ) { @@ -2430,9 +2430,9 @@ ww8::WidthsPtr AttributeOutputBase::GetColumnWidths( ww8::WW8TableNodeInfoInner: return pTableTextNodeInfoInner->getGridColsOfRow(*this, true); } -void AttributeOutputBase::GetTablePageSize( ww8::WW8TableNodeInfoInner const * pTableTextNodeInfoInner, long& rPageSize, bool& rRelBoxSize ) +void AttributeOutputBase::GetTablePageSize( ww8::WW8TableNodeInfoInner const * pTableTextNodeInfoInner, tools::Long& rPageSize, bool& rRelBoxSize ) { - long nPageSize = 0; + tools::Long nPageSize = 0; const SwNode *pTextNd = pTableTextNodeInfoInner->getNode( ); const SwTable *pTable = pTableTextNodeInfoInner->getTable( ); @@ -3779,7 +3779,7 @@ ErrCode SwWW8Writer::WriteStorageImpl() if( pViewShell != nullptr ) pViewShell->CalcLayout(); - long nMaxNode = m_pDoc->GetNodes().Count(); + tools::Long nMaxNode = m_pDoc->GetNodes().Count(); ::StartProgress( STR_STATSTR_W4WWRITE, 0, nMaxNode, m_pDoc->GetDocShell() ); // Respect table at the beginning of the document diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx index 73d31b68245b..aaa5dcead827 100644 --- a/sw/source/filter/ww8/wrtww8gr.cxx +++ b/sw/source/filter/ww8/wrtww8gr.cxx @@ -118,7 +118,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, tools::SvRef<SotStora don't need to store another preview */ GDIMetaFile aWMF; - long nX=0,nY=0; + tools::Long nX=0,nY=0; if (!bGraphicNeeded && SwWW8ImplReader::ImportOleWMF(xOleStg,aWMF,nX,nY)) { // bGraphicNeeded set to true is right / fixes #i51670#. @@ -411,7 +411,7 @@ void WW8Export::OutGrf(const ww8::Frame &rFrame) SwTwips nHeight = rFlyFormat.GetFrameSize().GetHeight(); nHeight/=20; //nHeight was in twips, want it in half points, but //then half of total height. - long nFontHeight = GetItem(RES_CHRATR_FONTSIZE).GetHeight(); + tools::Long nFontHeight = GetItem(RES_CHRATR_FONTSIZE).GetHeight(); nHeight-=nFontHeight/20; Set_UInt16( pArr, NS_sprm::CHpsPos::val ); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 068601af0637..9604d4237269 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3164,7 +3164,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField ) assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is()); sal_uInt16 nScript = g_pBreakIt->GetBreakIter()->getScriptType( pField->GetPar1(), 0); - long nHeight = static_cast<const SvxFontHeightItem&>((GetExport().GetItem( + tools::Long nHeight = static_cast<const SvxFontHeightItem&>((GetExport().GetItem( GetWhichOfScript(RES_CHRATR_FONTSIZE,nScript)))).GetHeight(); nHeight = (nHeight + 10) / 20; //Font Size in points; @@ -4917,8 +4917,8 @@ class SwWW8WrTabu public: SwWW8WrTabu(sal_uInt16 nDelMax, sal_uInt16 nAddMax); - void Add(const SvxTabStop &rTS, long nAdjustment); - void Del(const SvxTabStop &rTS, long nAdjustment); + void Add(const SvxTabStop &rTS, tools::Long nAdjustment); + void Del(const SvxTabStop &rTS, tools::Long nAdjustment); void PutAll(WW8Export& rWW8Wrt); }; @@ -4936,7 +4936,7 @@ SwWW8WrTabu::SwWW8WrTabu(sal_uInt16 nDelMax, sal_uInt16 nAddMax) /** * insert a tab in the WW structure */ -void SwWW8WrTabu::Add(const SvxTabStop & rTS, long nAdjustment) +void SwWW8WrTabu::Add(const SvxTabStop & rTS, tools::Long nAdjustment) { // insert tab position ShortToSVBT16(msword_cast<sal_Int16>(rTS.GetTabPos() + nAdjustment), @@ -4988,7 +4988,7 @@ void SwWW8WrTabu::Add(const SvxTabStop & rTS, long nAdjustment) /** * Insert a to be deleted tab in the WW structure */ -void SwWW8WrTabu::Del(const SvxTabStop &rTS, long nAdjustment) +void SwWW8WrTabu::Del(const SvxTabStop &rTS, tools::Long nAdjustment) { // insert tab position ShortToSVBT16(msword_cast<sal_Int16>(rTS.GetTabPos() + nAdjustment), @@ -5028,7 +5028,7 @@ void SwWW8WrTabu::PutAll(WW8Export& rWrt) static void ParaTabStopAdd( WW8Export& rWrt, const SvxTabStopItem& rTStops, - const long nLParaMgn ) + const tools::Long nLParaMgn ) { SwWW8WrTabu aTab( 0, rTStops.Count()); @@ -5042,8 +5042,8 @@ static void ParaTabStopAdd( WW8Export& rWrt, aTab.PutAll( rWrt ); } -static bool lcl_IsEqual(long nOneLeft, const SvxTabStop &rOne, - long nTwoLeft, const SvxTabStop &rTwo) +static bool lcl_IsEqual(tools::Long nOneLeft, const SvxTabStop &rOne, + tools::Long nTwoLeft, const SvxTabStop &rTwo) { return( nOneLeft == nTwoLeft && @@ -5055,9 +5055,9 @@ static bool lcl_IsEqual(long nOneLeft, const SvxTabStop &rOne, static void ParaTabStopDelAdd( WW8Export& rWrt, const SvxTabStopItem& rTStyle, - const long nLStypeMgn, + const tools::Long nLStypeMgn, const SvxTabStopItem& rTNew, - const long nLParaMgn ) + const tools::Long nLParaMgn ) { SwWW8WrTabu aTab(rTStyle.Count(), rTNew.Count()); @@ -5066,7 +5066,7 @@ static void ParaTabStopDelAdd( WW8Export& rWrt, do { const SvxTabStop* pTO; - long nOP; + tools::Long nOP; if( nO < rTStyle.Count() ) // old not yet at the end? { pTO = &rTStyle[ nO ]; @@ -5084,7 +5084,7 @@ static void ParaTabStopDelAdd( WW8Export& rWrt, } const SvxTabStop* pTN; - long nNP; + tools::Long nNP; if( nN < rTNew.Count() ) // new not yet at the end { pTN = &rTNew[ nN ]; @@ -5137,7 +5137,7 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops ) { const bool bTabsRelativeToIndex = m_rWW8Export.m_pCurPam->GetDoc().getIDocumentSettingAccess().get( DocumentSettingId::TABS_RELATIVE_TO_INDENT ); - long nCurrentLeft = 0; + tools::Long nCurrentLeft = 0; if ( bTabsRelativeToIndex ) { const SfxPoolItem* pLR = m_rWW8Export.HasItem( RES_LR_SPACE ); @@ -5161,7 +5161,7 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops ) } // #i120938# - consider left indentation of style and its parent style - long nParentLeft = 0; + tools::Long nParentLeft = 0; if ( bTabsRelativeToIndex ) { const SvxLRSpaceItem &rStyleLR = ItemGet<SvxLRSpaceItem>( pParentStyle->GetAttrSet(), RES_LR_SPACE ); @@ -5184,7 +5184,7 @@ void WW8AttributeOutput::ParaTabStop( const SvxTabStopItem& rTabStops ) } else { - long nStyleLeft = 0; + tools::Long nStyleLeft = 0; if ( bTabsRelativeToIndex ) { const SvxLRSpaceItem &rStyleLR = ItemGet<SvxLRSpaceItem>(*m_rWW8Export.m_pStyAttr, RES_LR_SPACE); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index 2bb012ea6782..2a98d6ad3570 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -462,7 +462,7 @@ SdrObject* SwWW8ImplReader::ReadPolyLine(WW8_DPHEAD const * pHd, SfxAllItemSet & return pObj; } -static ESelection GetESelection(EditEngine const &rDrawEditEngine, long nCpStart, long nCpEnd) +static ESelection GetESelection(EditEngine const &rDrawEditEngine, tools::Long nCpStart, tools::Long nCpEnd) { sal_Int32 nPCnt = rDrawEditEngine.GetParagraphCount(); sal_Int32 nSP = 0; @@ -561,15 +561,15 @@ class Chunk { private: OUString msURL; - long mnStartPos; // 0x13 - long mnEndPos; // 0x15 + tools::Long mnStartPos; // 0x13 + tools::Long mnEndPos; // 0x15 public: - explicit Chunk(long nStart, const OUString &rURL) + explicit Chunk(tools::Long nStart, const OUString &rURL) : msURL(rURL), mnStartPos(nStart), mnEndPos(0) {} - void SetEndPos(long nEnd) { mnEndPos = nEnd; } - long GetStartPos() const {return mnStartPos;} - long GetEndPos() const {return mnEndPos;} + void SetEndPos(tools::Long nEnd) { mnEndPos = nEnd; } + tools::Long GetStartPos() const {return mnStartPos;} + tools::Long GetEndPos() const {return mnEndPos;} const OUString &GetURL() const {return msURL;} void Adjust(sal_Int32 nAdjust) { @@ -836,8 +836,8 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp, // special case: entire chain should be determined - done! if( USHRT_MAX > nSequence ) { - long nMinStartCp = rStartCp; - long nMaxEndCp = rEndCp; + tools::Long nMinStartCp = rStartCp; + tools::Long nMaxEndCp = rEndCp; // quickly grab the TextBox-Break-Descriptor-PLCF pT = m_xPlcxMan->GetTxbxBkd(); if (!pT) // It can occur on occasion, Caolan @@ -882,7 +882,7 @@ bool SwWW8ImplReader::GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp, // TxbxText() grabs the text from the WW file and returns that along with // the StartCp and the corrected (by -2, or -1 for version 8) EndCp. -sal_Int32 SwWW8ImplReader::GetRangeAsDrawingString(OUString& rString, long nStartCp, long nEndCp, ManTypes eType) +sal_Int32 SwWW8ImplReader::GetRangeAsDrawingString(OUString& rString, tools::Long nStartCp, tools::Long nEndCp, ManTypes eType) { WW8_CP nOffset = 0; m_xWwFib->GetBaseCp(eType, &nOffset); //TODO: check return value @@ -1003,9 +1003,9 @@ std::unique_ptr<OutlinerParaObject> SwWW8ImplReader::ImportAsOutliner(OUString & // InsertTxbxText() adds the Text and the Attributes for TextBoxes and CaptionBoxes void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, - Size const * pObjSiz, sal_uInt16 nTxBxS, sal_uInt16 nSequence, long nPosCp, + Size const * pObjSiz, sal_uInt16 nTxBxS, sal_uInt16 nSequence, tools::Long nPosCp, SwFrameFormat const * pOldFlyFormat, bool bMakeSdrGrafObj, bool& rbEraseTextObj, - bool* pbTestTxbxContainsText, long* pnStartCp, long* pnEndCp, + bool* pbTestTxbxContainsText, tools::Long* pnStartCp, tools::Long* pnEndCp, bool* pbContainsGraphics, SvxMSDffImportRec const * pRecord) { SwFrameFormat* pFlyFormat = nullptr; @@ -1206,8 +1206,8 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj, *pbContainsGraphics = bContainsGraphics; } -bool SwWW8ImplReader::TxbxChainContainsRealText(sal_uInt16 nTxBxS, long& rStartCp, - long& rEndCp) +bool SwWW8ImplReader::TxbxChainContainsRealText(sal_uInt16 nTxBxS, tools::Long& rStartCp, + tools::Long& rEndCp) { bool bErase, bContainsText; InsertTxbxText( nullptr,nullptr,nTxBxS,USHRT_MAX,0,nullptr,false, bErase, &bContainsText, @@ -1239,7 +1239,7 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD const * pHd, SfxAllItemSet &r Size aSize( static_cast<sal_Int16>(SVBT16ToUInt16( pHd->dxa )) , static_cast<sal_Int16>(SVBT16ToUInt16( pHd->dya )) ); - long nStartCpFly,nEndCpFly; + tools::Long nStartCpFly,nEndCpFly; bool bContainsGraphics; InsertTxbxText(pObj, &aSize, 0, 0, 0, nullptr, false, bDummy,nullptr,&nStartCpFly,&nEndCpFly,&bContainsGraphics); @@ -1419,7 +1419,7 @@ SdrObject* SwWW8ImplReader::ReadGrafPrimitive(short& rLeft, SfxAllItemSet &rSet) return pRet; } -void SwWW8ImplReader::ReadGrafLayer1( WW8PLCFspecial* pPF, long nGrafAnchorCp ) +void SwWW8ImplReader::ReadGrafLayer1( WW8PLCFspecial* pPF, tools::Long nGrafAnchorCp ) { pPF->SeekPos( nGrafAnchorCp ); WW8_FC nStartFc; @@ -2050,7 +2050,7 @@ void SwWW8ImplReader::MapWrapIntoFlyFormat(SvxMSDffImportRec const * pRecord, */ Fraction aMoveHack(ww::nWrap100Percent, rSize.Width()); aMoveHack *= Fraction(15, 1); - long nMove(aMoveHack); + tools::Long nMove(aMoveHack); aPoly.Move(nMove, 0); Fraction aHackX(ww::nWrap100Percent, ww::nWrap100Percent + nMove); @@ -2352,7 +2352,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, // convert 'left to page' to 'from left -<width> to page text area' eHoriOri = text::HoriOrientation::NONE; eHoriRel = text::RelOrientation::PAGE_PRINT_AREA; - const long nWidth = pFSPA->nXaRight - pFSPA->nXaLeft; + const tools::Long nWidth = pFSPA->nXaRight - pFSPA->nXaLeft; pFSPA->nXaLeft = -nWidth; pFSPA->nXaRight = 0; } @@ -2361,7 +2361,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, // convert 'right to page' to 'from left 0 to right page border' eHoriOri = text::HoriOrientation::NONE; eHoriRel = text::RelOrientation::PAGE_RIGHT; - const long nWidth = pFSPA->nXaRight - pFSPA->nXaLeft; + const tools::Long nWidth = pFSPA->nXaRight - pFSPA->nXaLeft; pFSPA->nXaLeft = 0; pFSPA->nXaRight = nWidth; } @@ -2418,7 +2418,7 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord, // Below line in word is a positive value, while in writer its // negative - long nYPos = pFSPA->nYaTop; + tools::Long nYPos = pFSPA->nYaTop; // #i22673# if ((eVertRel == text::RelOrientation::TEXT_LINE) && (eVertOri == text::VertOrientation::NONE)) nYPos = -nYPos; @@ -2501,7 +2501,7 @@ bool SwWW8ImplReader::IsObjectLayoutInTableCell( const sal_uInt32 nLayoutInTable return bIsObjectLayoutInTableCell; } -SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) +SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( tools::Long nGrafAnchorCp ) { if( m_nIniFlags & WW8FL_NO_GRAFLAYER ) return nullptr; @@ -2522,7 +2522,7 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) if( m_bVer67 ) { - long nOldPos = m_pStrm->Tell(); + tools::Long nOldPos = m_pStrm->Tell(); m_nDrawXOfs = m_nDrawYOfs = 0; ReadGrafLayer1( pPF, nGrafAnchorCp ); @@ -2863,7 +2863,7 @@ SwFrameFormat *SwWW8ImplReader::AddAutoAnchor(SwFrameFormat *pFormat) } SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SvxMSDffImportRec *pRecord, - long nGrafAnchorCp, SwFrameFormat* pRetFrameFormat) + tools::Long nGrafAnchorCp, SwFrameFormat* pRetFrameFormat) { SdrObject* pTrueObject = pRecord->pObj; @@ -2962,8 +2962,8 @@ SwFlyFrameFormat* SwWW8ImplReader::ConvertDrawTextToFly(SdrObject* &rpObject, WW8_FSPA const *pF, SfxItemSet &rFlySet) { SwFlyFrameFormat* pRetFrameFormat = nullptr; - long nStartCp; - long nEndCp; + tools::Long nStartCp; + tools::Long nEndCp; // Check if this textbox chain contains text as conversion of an empty // chain would not make sense. diff --git a/sw/source/filter/ww8/ww8graf2.cxx b/sw/source/filter/ww8/ww8graf2.cxx index a540648b85f4..3cb16f6422b8 100644 --- a/sw/source/filter/ww8/ww8graf2.cxx +++ b/sw/source/filter/ww8/ww8graf2.cxx @@ -267,7 +267,7 @@ bool SwWW8ImplReader::ReadGrafFile(OUString& rFileName, std::unique_ptr<Graphic> // the first 512 Bytes which are not relevant in a MAC-PICT (they are not // interpreted) bOk = false; - long nData = rPic.lcb - ( pSt->Tell() - nPosFc ); + tools::Long nData = rPic.lcb - ( pSt->Tell() - nPosFc ); if (nData > 0) { rpGraphic.reset(new Graphic()); @@ -281,7 +281,7 @@ bool SwWW8ImplReader::ReadGrafFile(OUString& rFileName, std::unique_ptr<Graphic> struct WW8PicDesc { sal_Int16 nCL, nCR, nCT, nCB; - long nWidth, nHeight; + tools::Long nWidth, nHeight; explicit WW8PicDesc( const WW8_PIC& rPic ); }; @@ -293,12 +293,12 @@ WW8PicDesc::WW8PicDesc( const WW8_PIC& rPic ) nCB(rPic.dyaCropBottom) { //See #i21190# before fiddling with this method - long nOriWidth = rPic.dxaGoal; //Size in 1/100 mm before crop - long nOriHeight = rPic.dyaGoal; + tools::Long nOriWidth = rPic.dxaGoal; //Size in 1/100 mm before crop + tools::Long nOriHeight = rPic.dyaGoal; - long nCurrentWidth = nOriWidth - (nCL + nCR); // Size after crop - long nCurrentHeight = nOriHeight - (nCT + nCB); + tools::Long nCurrentWidth = nOriWidth - (nCL + nCR); // Size after crop + tools::Long nCurrentHeight = nOriHeight - (nCT + nCB); if (!nCurrentWidth) nCurrentWidth = 1; if (!nCurrentHeight) diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 450e2f62916f..c535dd054588 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -751,7 +751,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, { if (nTextRotationAngle == 9000) { - long nWidth = rTextRect.GetWidth(); + tools::Long nWidth = rTextRect.GetWidth(); rTextRect.SetRight( rTextRect.Left() + rTextRect.GetHeight() ); rTextRect.SetBottom( rTextRect.Top() + nWidth ); @@ -767,7 +767,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, } else if (nTextRotationAngle == 27000) { - long nWidth = rTextRect.GetWidth(); + tools::Long nWidth = rTextRect.GetWidth(); rTextRect.SetRight( rTextRect.Left() + rTextRect.GetHeight() ); rTextRect.SetBottom( rTextRect.Top() + nWidth ); @@ -924,7 +924,7 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt, { if ( nTextRotationAngle ) { - long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ? + tools::Long nMinWH = rTextRect.GetWidth() < rTextRect.GetHeight() ? rTextRect.GetWidth() : rTextRect.GetHeight(); nMinWH /= 2; Point aPivot(rTextRect.TopLeft()); @@ -1192,7 +1192,7 @@ void SwWW8FltControlStack::NewAttr(const SwPosition& rPos, } SwFltStackEntry* SwWW8FltControlStack::SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, - bool bTstEnd, long nHand, bool ) + bool bTstEnd, tools::Long nHand, bool ) { SwFltStackEntry *pRet = nullptr; // Doing a textbox, and using the control stack only as a temporary @@ -1216,13 +1216,13 @@ SwFltStackEntry* SwWW8FltControlStack::SetAttr(const SwPosition& rPos, sal_uInt1 return pRet; } -long GetListFirstLineIndent(const SwNumFormat &rFormat) +tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat) { OSL_ENSURE( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION, "<GetListFirstLineIndent> - misusage: position-and-space-mode does not equal LABEL_WIDTH_AND_POSITION" ); SvxAdjust eAdj = rFormat.GetNumAdjust(); - long nReverseListIndented; + tools::Long nReverseListIndented; if (eAdj == SvxAdjust::Right) nReverseListIndented = -rFormat.GetCharTextDistance(); else if (eAdj == SvxAdjust::Center) @@ -1232,19 +1232,19 @@ long GetListFirstLineIndent(const SwNumFormat &rFormat) return nReverseListIndented; } -static long lcl_GetTrueMargin(const SvxLRSpaceItem &rLR, const SwNumFormat &rFormat, - long &rFirstLinePos) +static tools::Long lcl_GetTrueMargin(const SvxLRSpaceItem &rLR, const SwNumFormat &rFormat, + tools::Long &rFirstLinePos) { OSL_ENSURE( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION, "<lcl_GetTrueMargin> - misusage: position-and-space-mode does not equal LABEL_WIDTH_AND_POSITION" ); - const long nBodyIndent = rLR.GetTextLeft(); - const long nFirstLineDiff = rLR.GetTextFirstLineOffset(); + const tools::Long nBodyIndent = rLR.GetTextLeft(); + const tools::Long nFirstLineDiff = rLR.GetTextFirstLineOffset(); rFirstLinePos = nBodyIndent + nFirstLineDiff; const auto nPseudoListBodyIndent = rFormat.GetAbsLSpace(); - const long nReverseListIndented = GetListFirstLineIndent(rFormat); - long nExtraListIndent = nPseudoListBodyIndent + nReverseListIndented; + const tools::Long nReverseListIndented = GetListFirstLineIndent(rFormat); + tools::Long nExtraListIndent = nPseudoListBodyIndent + nReverseListIndented; return std::max<long>(nExtraListIndent, 0); } @@ -1258,8 +1258,8 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR, { if ( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { - long nWantedFirstLinePos; - long nExtraListIndent = lcl_GetTrueMargin(rLR, rFormat, nWantedFirstLinePos); + tools::Long nWantedFirstLinePos; + tools::Long nExtraListIndent = lcl_GetTrueMargin(rLR, rFormat, nWantedFirstLinePos); rLR.SetTextLeft(nWantedFirstLinePos - nExtraListIndent); rLR.SetTextFirstLineOffset(0); } @@ -1852,7 +1852,7 @@ void SwWW8ImplReader::ImportDop() DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA, true); // Import Default Tabs - long nDefTabSiz = m_xWDop->dxaTab; + tools::Long nDefTabSiz = m_xWDop->dxaTab; if( nDefTabSiz < 56 ) nDefTabSiz = 709; @@ -2126,7 +2126,7 @@ void SwWW8ImplReader::Read_HdFtFootnoteText( const SwNodeIndex* pSttIdx, /** * Use authornames, if not available fall back to initials. */ -long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) +tools::Long SwWW8ImplReader::Read_And(WW8PLCFManResult* pRes) { WW8PLCFx_SubDoc* pSD = m_xPlcxMan->GetAtn(); if (!pSD) @@ -3498,10 +3498,10 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const OUString& rAddString) /** * Return value: true for para end */ -bool SwWW8ImplReader::ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd, - long nCpOfs) +bool SwWW8ImplReader::ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, tools::Long nTextEnd, + tools::Long nCpOfs) { - long nEnd = ( nNextAttr < nTextEnd ) ? nNextAttr : nTextEnd; + tools::Long nEnd = ( nNextAttr < nTextEnd ) ? nNextAttr : nTextEnd; if (m_bSymbol || m_bIgnoreText) { @@ -3586,7 +3586,7 @@ bool SwWW8ImplReader::HandlePageBreakChar() return bParaEndAdded; } -bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) +bool SwWW8ImplReader::ReadChar(tools::Long nPosCp, tools::Long nCpOfs) { bool bNewParaEnd = false; // Reset Unicode flag and correct FilePos if needed. @@ -3708,7 +3708,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs) bool bReadObj = IsInlineEscherHack(); if( bReadObj ) { - long nCurPos = m_pStrm->Tell(); + tools::Long nCurPos = m_pStrm->Tell(); sal_uInt16 nWordCode(0); if( m_bIsUnicode ) @@ -3853,9 +3853,9 @@ void SwWW8ImplReader::ProcessCurrentCollChange(WW8PLCFManResult& rRes, } } -long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStartLine, int nDepthGuard) +tools::Long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, tools::Long nTextEnd, bool& rbStartLine, int nDepthGuard) { - long nSkipChars = 0; + tools::Long nSkipChars = 0; WW8PLCFManResult aRes; OSL_ENSURE(m_pPaM->GetNode().GetTextNode(), "Missing txtnode"); @@ -3884,7 +3884,7 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStar } // position of last CP that's to be ignored - long nSkipPos = -1; + tools::Long nSkipPos = -1; if( 0 < aRes.nSprmId ) // Ignore empty Attrs { @@ -3930,7 +3930,7 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStar m_bIgnoreText = true; sal_uInt16 nOldColl = m_nCurrentColl; bool bDoPlcxManPlusPLus = true; - long nNext; + tools::Long nNext; do { if( bDoPlcxManPlusPLus ) @@ -3999,7 +3999,7 @@ void SwWW8ImplReader::ClearParaEndPosition() m_aEndParaPos.clear(); } -void SwWW8ImplReader::ReadAttrs(WW8_CP& rTextPos, WW8_CP& rNext, long nTextEnd, bool& rbStartLine) +void SwWW8ImplReader::ReadAttrs(WW8_CP& rTextPos, WW8_CP& rNext, tools::Long nTextEnd, bool& rbStartLine) { // Do we have attributes? if( rTextPos >= rNext ) @@ -4067,7 +4067,7 @@ bool SwWW8ImplReader::ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType) m_bPgSecBreak = false; m_xPlcxMan = std::make_shared<WW8PLCFMan>(m_xSBase.get(), nType, nStartCp); - long nCpOfs = m_xPlcxMan->GetCpOfs(); // Offset for Header/Footer, Footnote + tools::Long nCpOfs = m_xPlcxMan->GetCpOfs(); // Offset for Header/Footer, Footnote WW8_CP nNext = m_xPlcxMan->Where(); m_pPreviousNode = nullptr; @@ -4912,7 +4912,7 @@ void WW8Customizations::Import( SwDocShell* pShell ) try { Tcg aTCG; - long nCur = mpTableStream->Tell(); + tools::Long nCur = mpTableStream->Tell(); if (!checkSeek(*mpTableStream, mWw8Fib.m_fcCmds)) // point at tgc record { SAL_WARN("sw.ww8", "** Seek to Customization data failed!!!! "); @@ -6092,10 +6092,10 @@ const OUString* SwWW8ImplReader::GetAnnotationAuthor(sal_uInt16 nIdx) m_pAtnNames.reset(new std::vector<OUString>); SvStream& rStrm = *m_pTableStream; - long nOldPos = rStrm.Tell(); + tools::Long nOldPos = rStrm.Tell(); rStrm.Seek( m_xWwFib->m_fcGrpStAtnOwners ); - long nRead = 0, nCount = m_xWwFib->m_lcbGrpStAtnOwners; + tools::Long nRead = 0, nCount = m_xWwFib->m_lcbGrpStAtnOwners; while (nRead < nCount && rStrm.good()) { if( m_bVer67 ) @@ -6545,7 +6545,7 @@ bool SwMSDffManager::GetOLEStorageName(sal_uInt32 nOLEId, OUString& rStorageName // We should then find the EmbeddedField and the corresponding Sprms // in that Area. // We only need the Sprm for the Picture Id. - long nOldPos = rReader.m_pStrm->Tell(); + tools::Long nOldPos = rReader.m_pStrm->Tell(); { // #i32596# - consider return value of method // <rReader.GetTxbxTextSttEndCp(..)>. If it returns false, method diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index cad9f5e9b03d..37ff8b1275ae 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -228,7 +228,7 @@ public: SwFormat* m_pFormat; std::shared_ptr<WW8FlyPara> m_xWWFly; SwNumRule* m_pOutlineNumrule; - long m_nFilePos; + tools::Long m_nFilePos; sal_uInt16 m_nBase; sal_uInt16 m_nFollow; sal_uInt16 m_nLFOIndex; @@ -389,7 +389,7 @@ public: void NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr); - virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnd=true, long nHand=LONG_MAX, bool consumedByField=false) override; + virtual SwFltStackEntry* SetAttr(const SwPosition& rPos, sal_uInt16 nAttrId, bool bTstEnd=true, tools::Long nHand=LONG_MAX, bool consumedByField=false) override; void SetToggleAttr(sal_uInt8 nId, bool bOn) { @@ -889,7 +889,7 @@ public: void PrependedInlineNode(const SwPosition &rPos, const SwNode &rNode); sal_uInt16 CurrentSectionColCount() const; bool WillHavePageDescHere(const SwNodeIndex& rIdx) const; - void CreateSep(const long nTextPos); + void CreateSep(const tools::Long nTextPos); void InsertSegments(); void JoinNode(const SwPosition &rPos, const SwNode &rNode); sal_uInt32 GetPageLeft() const; @@ -1420,9 +1420,9 @@ private: void emulateMSWordAddTextToParagraph(const OUString& rAddString); void simpleAddTextToParagraph(const OUString& rAddString); bool HandlePageBreakChar(); - bool ReadChar(long nPosCp, long nCpOfs); + bool ReadChar(tools::Long nPosCp, tools::Long nCpOfs); bool ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCpOfs); - bool ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd, long nCpOfs); + bool ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, tools::Long nTextEnd, tools::Long nCpOfs); static bool LangUsesHindiNumbers(LanguageType nLang); static sal_Unicode TranslateToHindiNumbers(sal_Unicode); @@ -1430,8 +1430,8 @@ private: void ProcessCurrentCollChange(WW8PLCFManResult& rRes, bool* pStartAttr, bool bCallProcessSpecial); - long ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStartLine, int nDepthGuard = 0); - void ReadAttrs(WW8_CP& rTextPos, WW8_CP& rNext, long nTextEnd, bool& rbStartLine); + tools::Long ReadTextAttr(WW8_CP& rTextPos, tools::Long nTextEnd, bool& rbStartLine, int nDepthGuard = 0); + void ReadAttrs(WW8_CP& rTextPos, WW8_CP& rNext, tools::Long nTextEnd, bool& rbStartLine); void CloseAttrEnds(); bool ReadText(WW8_CP nStartCp, WW8_CP nTextLen, ManTypes nType); @@ -1593,28 +1593,28 @@ private: bool GetTxbxTextSttEndCp(WW8_CP& rStartCp, WW8_CP& rEndCp, sal_uInt16 nTxBxS, sal_uInt16 nSequence); - sal_Int32 GetRangeAsDrawingString(OUString& rString, long StartCp, long nEndCp, ManTypes eType); + sal_Int32 GetRangeAsDrawingString(OUString& rString, tools::Long StartCp, tools::Long nEndCp, ManTypes eType); std::unique_ptr<OutlinerParaObject> ImportAsOutliner(OUString &rString, WW8_CP nStartCp, WW8_CP nEndCp, ManTypes eType); void InsertTxbxText(SdrTextObj* pTextObj, Size const * pObjSiz, - sal_uInt16 nTxBxS, sal_uInt16 nSequence, long nPosCp, SwFrameFormat const * pFlyFormat, + sal_uInt16 nTxBxS, sal_uInt16 nSequence, tools::Long nPosCp, SwFrameFormat const * pFlyFormat, bool bMakeSdrGrafObj, bool& rbEraseTextObj, - bool* pbTestTxbxContainsText = nullptr, long* pnStartCp = nullptr, - long* pnEndCp = nullptr, bool* pbContainsGraphics = nullptr, + bool* pbTestTxbxContainsText = nullptr, tools::Long* pnStartCp = nullptr, + tools::Long* pnEndCp = nullptr, bool* pbContainsGraphics = nullptr, SvxMSDffImportRec const * pRecord = nullptr); bool TxbxChainContainsRealText( sal_uInt16 nTxBxS, - long& rStartCp, - long& rEndCp ); + tools::Long& rStartCp, + tools::Long& rEndCp ); SdrObject *ReadTextBox(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet); SdrObject *ReadCaptionBox(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet); SdrObject *ReadGroup(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet); SdrObject *ReadGrafPrimitive(short& rLeft, SfxAllItemSet &rSet); - void ReadGrafLayer1( WW8PLCFspecial* pPF, long nGrafAnchorCp ); + void ReadGrafLayer1( WW8PLCFspecial* pPF, tools::Long nGrafAnchorCp ); SdrObject* CreateContactObject(SwFrameFormat* pFlyFormat); RndStdIds ProcessEscherAlign(SvxMSDffImportRec* pRecord, WW8_FSPA *pFSPA, SfxItemSet &rFlySet); bool MiserableRTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth, sal_Int16 eHoriOri, sal_Int16 eHoriRel); - SwFrameFormat* Read_GrafLayer( long nGrafAnchorCp ); + SwFrameFormat* Read_GrafLayer( tools::Long nGrafAnchorCp ); SwFlyFrameFormat* ImportReplaceableDrawables( SdrObject* &rpObject, SdrObject* &rpOurNewObject, SvxMSDffImportRec* pRecord, WW8_FSPA *pF, SfxItemSet &rFlySet ); @@ -1622,7 +1622,7 @@ private: SdrObject* &rpOurNewObject, SvxMSDffImportRec const * pRecord, RndStdIds eAnchor, WW8_FSPA const *pF, SfxItemSet &rFlySet ); SwFrameFormat* MungeTextIntoDrawBox(SvxMSDffImportRec *pRecord, - long nGrafAnchorCp, SwFrameFormat *pRetFrameFormat); + tools::Long nGrafAnchorCp, SwFrameFormat *pRetFrameFormat); void GrafikCtor(); void GrafikDtor(); @@ -1634,7 +1634,7 @@ private: OUString ConvertFFileName(const OUString& rRaw); WW8_CP Read_F_Tag(WW8FieldDesc* pF); void InsertTagField( const sal_uInt16 nId, const OUString& rTagText ); - long ImportExtSprm(WW8PLCFManResult* pRes); + tools::Long ImportExtSprm(WW8PLCFManResult* pRes); void EndExtSprm(sal_uInt16 nSprmId); void ReadDocInfo(); @@ -1708,14 +1708,14 @@ public: // really private, but can only be done public //Clear the para end position recorded in reader intermittently for the least impact on loading performance void ClearParaEndPosition(); - long Read_Footnote(WW8PLCFManResult* pRes); + tools::Long Read_Footnote(WW8PLCFManResult* pRes); sal_uInt16 End_Footnote(); - long Read_Field(WW8PLCFManResult* pRes); + tools::Long Read_Field(WW8PLCFManResult* pRes); sal_uInt16 End_Field(); - long Read_Book(WW8PLCFManResult*); - long Read_And(WW8PLCFManResult* pRes); - long Read_AtnBook(WW8PLCFManResult*); - long Read_FactoidBook(WW8PLCFManResult*); + tools::Long Read_Book(WW8PLCFManResult*); + tools::Long Read_And(WW8PLCFManResult* pRes); + tools::Long Read_AtnBook(WW8PLCFManResult*); + tools::Long Read_FactoidBook(WW8PLCFManResult*); // attributes @@ -1832,7 +1832,7 @@ public: // really private, but can only be done public void Read_TextVerticalAdjustment(sal_uInt16, const sal_uInt8* pData, short nLen); void Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, short nLen); - long MapBookmarkVariables(const WW8FieldDesc* pF, OUString &rOrigName, + tools::Long MapBookmarkVariables(const WW8FieldDesc* pF, OUString &rOrigName, const OUString &rData); OUString GetMappedBookmark(const OUString &rOrigName); @@ -1899,8 +1899,8 @@ public: // really private, but can only be done public static bool GetPictGrafFromStream(Graphic& rGraphic, SvStream& rSrc); static void PicRead( SvStream *pDataStream, WW8_PIC *pPic, bool bVer67); - static bool ImportOleWMF(const tools::SvRef<SotStorage>& xSrc1, GDIMetaFile& rWMF, long& rX, - long& rY); + static bool ImportOleWMF(const tools::SvRef<SotStorage>& xSrc1, GDIMetaFile& rWMF, tools::Long& rX, + tools::Long& rY); static Color GetCol(sal_uInt8 nIco); SwWW8ImplReader( sal_uInt8 nVersionPara, SotStorage* pStorage, SvStream* pSt, @@ -1928,7 +1928,7 @@ void SyncIndentWithList( SvxLRSpaceItem &rLR, const SwNumFormat &rFormat, const bool bFirstLineOfStSet, const bool bLeftIndentSet ); -long GetListFirstLineIndent(const SwNumFormat &rFormat); +tools::Long GetListFirstLineIndent(const SwNumFormat &rFormat); OUString BookmarkToWriter(const OUString &rBookmark); bool RTLGraphicsHack(SwTwips &rLeft, SwTwips nWidth, sal_Int16 eHoriOri, sal_Int16 eHoriRel, SwTwips nPageLeft, diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index d689ab36acb6..71ef80c27b52 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -284,7 +284,7 @@ sal_uInt16 SwWW8ImplReader::End_Footnote() return 0; } -long SwWW8ImplReader::Read_Footnote(WW8PLCFManResult* pRes) +tools::Long SwWW8ImplReader::Read_Footnote(WW8PLCFManResult* pRes) { /* Ignoring Footnote outside of the normal Text. People will put footnotes @@ -2406,7 +2406,7 @@ void WW8TabDesc::CreateSwTable() // Because SW cannot handle multi-page floating frames, // _any unnecessary_ floating tables have been converted to inline. - long nLeft = 0; + tools::Long nLeft = 0; if ( m_pIo->m_xSFlyPara && !m_pIo->m_xSFlyPara->pFlyFormat ) { // Get the table orientation from the fly @@ -2783,7 +2783,7 @@ void WW8TabDesc::FinishSwTable() auto& rRow = groupIt->row(n); for (size_t i = 0; i<rRow.size(); ++i) { - const long nRowSpanSet = (n == 0) && (i == 0) ? + const tools::Long nRowSpanSet = (n == 0) && (i == 0) ? nRowSpan : (-1 * (nRowSpan - n)); SwTableBox* pCurrentBox = rRow[i]; @@ -3923,7 +3923,7 @@ void WW8RStyle::Import1Style( sal_uInt16 nNr ) bool bOldNoImp = PrepareStyle(rSI, static_cast<ww::sti>(xStd->sti), nNr, xStd->istdNext); // if something is interpreted wrong, this should make it work again - long nPos = mpStStrm->Tell(); + tools::Long nPos = mpStStrm->Tell(); //Variable parts of the STD start at even byte offsets, but "inside //the STD", which I take to meaning even in relation to the starting diff --git a/sw/source/filter/ww8/ww8par2.hxx b/sw/source/filter/ww8/ww8par2.hxx index bd3de34179b4..ac35b4813b8f 100644 --- a/sw/source/filter/ww8/ww8par2.hxx +++ b/sw/source/filter/ww8/ww8par2.hxx @@ -65,7 +65,7 @@ struct WW8SwFlyPara sal_uInt8 nXBind, nYBind; // bound relative to what // part 2: changes found during reading - long nNewNetWidth; + tools::Long nNewNetWidth; std::unique_ptr<SwPosition> xMainTextPos; // to return to main text after apo sal_uInt16 nLineSpace; // line space in tw for graf apos bool bAutoWidth; @@ -80,7 +80,7 @@ struct WW8SwFlyPara const sal_Int32 nIniFlyDx, const sal_Int32 nIniFlyDy ); - void BoxUpWidth( long nWidth ); + void BoxUpWidth( tools::Long nWidth ); std::unique_ptr<SwWW8FltAnchorStack> xOldAnchorStck; }; @@ -141,7 +141,7 @@ public: WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW, const WW8SwFlyPara* pFS, bool bGraf); WW8FlySet(SwWW8ImplReader& rReader, const SwPaM* pPaM, const WW8_PIC& rPic, - long nWidth, long nHeight); + tools::Long nWidth, tools::Long nHeight); }; // Gets filled in WW8TabDesc::MergeCells(). diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 6ce373838e23..175f7b948613 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -1125,7 +1125,7 @@ WW8ListManager::WW8ListManager(SvStream& rSt_, SwWW8ImplReader& rReader_) // create Arrays bool bLVLOk = true; - long nOriginalPos = rSt.Tell(); + tools::Long nOriginalPos = rSt.Tell(); // 1. read PLCF LST and create list templates in Writer @@ -1654,7 +1654,7 @@ void UseListIndent(SwWW8StyInf &rStyle, const SwNumFormat &rFormat) if ( rFormat.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { const auto nAbsLSpace = rFormat.GetAbsLSpace(); - const long nListFirstLineIndent = GetListFirstLineIndent(rFormat); + const tools::Long nListFirstLineIndent = GetListFirstLineIndent(rFormat); SvxLRSpaceItem aLR(ItemGet<SvxLRSpaceItem>(*rStyle.m_pFormat, RES_LR_SPACE)); aLR.SetTextLeft(nAbsLSpace); aLR.SetTextFirstLineOffset(writer_cast<short>(nListFirstLineIndent)); diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 6517edb55463..1c5bc2a09b6c 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -64,7 +64,7 @@ struct OLE_MFP using namespace ::com::sun::star; -static bool SwWw8ReadScaling(long& rX, long& rY, tools::SvRef<SotStorage> const & rSrc1) +static bool SwWw8ReadScaling(tools::Long& rX, tools::Long& rY, tools::SvRef<SotStorage> const & rSrc1) { // Getting the scaling factor: // Information in the PIC-stream (by trying out) @@ -302,7 +302,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, } bool SwWW8ImplReader::ImportOleWMF(const tools::SvRef<SotStorage>& xSrc1, GDIMetaFile& rWMF, - long& rX, long& rY) + tools::Long& rX, tools::Long& rY) { bool bOk = false; OLE_MFP aMfp; @@ -335,7 +335,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, ::SetProgressState( m_nProgress, m_rDoc.GetDocShell() ); // Update - long nX=0, nY=0; // nX, nY is graphic size + tools::Long nX=0, nY=0; // nX, nY is graphic size bool bOleOk = true; // results in the name "_4711" diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx index 94fd99994dea..c37ee40fb6de 100644 --- a/sw/source/filter/ww8/ww8par5.cxx +++ b/sw/source/filter/ww8/ww8par5.cxx @@ -113,7 +113,7 @@ namespace } } -long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) +tools::Long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) { // should also work via pRes.nCo2OrIdx WW8PLCFx_Book* pB = m_xPlcxMan->GetBook(); @@ -150,11 +150,11 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) if( SwFltGetFlag( m_nFieldFlags, SwFltControlStack::BOOK_TO_VAR_REF ) ) { // set variable for translation bookmark - long nLen = pB->GetLen(); + tools::Long nLen = pB->GetLen(); if( nLen > MAX_FIELDLEN ) nLen = MAX_FIELDLEN; - long nOldPos = m_pStrm->Tell(); + tools::Long nOldPos = m_pStrm->Tell(); m_xSBase->WW8ReadString( *m_pStrm, aVal, pB->GetStartPos(), nLen, m_eStructCharSet ); m_pStrm->Seek( nOldPos ); @@ -229,7 +229,7 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*) return 0; } -long SwWW8ImplReader::Read_AtnBook(WW8PLCFManResult*) +tools::Long SwWW8ImplReader::Read_AtnBook(WW8PLCFManResult*) { if (WW8PLCFx_AtnBook* pAtnBook = m_xPlcxMan->GetAtnBook()) { @@ -241,7 +241,7 @@ long SwWW8ImplReader::Read_AtnBook(WW8PLCFManResult*) return 0; } -long SwWW8ImplReader::Read_FactoidBook(WW8PLCFManResult*) +tools::Long SwWW8ImplReader::Read_FactoidBook(WW8PLCFManResult*) { if (WW8PLCFx_FactoidBook* pFactoidBook = m_xPlcxMan->GetFactoidBook()) { @@ -753,7 +753,7 @@ void WW8FieldEntry::SetBookmarkCode(const OUString& bookmarkCode) // Read_Field reads a field or returns 0 if the field cannot be read, // so that the calling function reads the field in text format. // Returnvalue: Total length of field -long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) +tools::Long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) { typedef eF_ResT (SwWW8ImplReader::*FNReadField)( WW8FieldDesc*, OUString& ); enum Limits {eMax = 96}; @@ -950,7 +950,7 @@ long SwWW8ImplReader::Read_Field(WW8PLCFManResult* pRes) if (aF.bResNest && !AcceptableNestedField(aF.nId)) return aF.nLen; // Result nested -> unusable - long nOldPos = m_pStrm->Tell(); + tools::Long nOldPos = m_pStrm->Tell(); OUString aStr; aF.nLCode = m_xSBase->WW8ReadString( *m_pStrm, aStr, m_xPlcxMan->GetCpOfs()+ aF.nSCode, aF.nLCode, m_eTextCharSet ); @@ -1129,7 +1129,7 @@ void SwWW8ImplReader::InsertTagField( const sal_uInt16 nId, const OUString& rTag WW8_CP SwWW8ImplReader::Read_F_Tag( WW8FieldDesc* pF ) { - long nOldPos = m_pStrm->Tell(); + tools::Long nOldPos = m_pStrm->Tell(); WW8_CP nStart = pF->nSCode - 1; // starting with 0x19 WW8_CP nL = pF->nLen; // Total length with result and nest @@ -1189,7 +1189,7 @@ eF_ResT SwWW8ImplReader::Read_F_Input( WW8FieldDesc* pF, OUString& rStr ) // GetFieldResult allocates a string and reads the resulted field OUString SwWW8ImplReader::GetFieldResult( WW8FieldDesc const * pF ) { - long nOldPos = m_pStrm->Tell(); + tools::Long nOldPos = m_pStrm->Tell(); WW8_CP nStart = pF->nSRes; // result start WW8_CP nL = pF->nLRes; // result length @@ -1277,11 +1277,11 @@ the set/ask field, and end them directly afterwards. MapBookmarkVariables returns an identifier of the bookmark attribute to close after inserting the appropriate set/ask field. */ -long SwWW8ImplReader::MapBookmarkVariables(const WW8FieldDesc* pF, +tools::Long SwWW8ImplReader::MapBookmarkVariables(const WW8FieldDesc* pF, OUString &rOrigName, const OUString &rData) { OSL_ENSURE(m_xPlcxMan, "No pPlcxMan"); - long nNo; + tools::Long nNo; /* If there was no bookmark associated with this set field, then we create a pseudo one and insert it in the document. @@ -1396,7 +1396,7 @@ eF_ResT SwWW8ImplReader::Read_F_InputVar( WW8FieldDesc* pF, OUString& rStr ) aQ += aDef; } - const long nNo = MapBookmarkVariables(pF, sOrigName, aResult); + const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, aResult); SwSetExpFieldType* pFT = static_cast<SwSetExpFieldType*>(m_rDoc.getIDocumentFieldsAccess().InsertFieldType( SwSetExpFieldType(&m_rDoc, sOrigName, nsSwGetSetExpType::GSE_STRING))); @@ -2012,7 +2012,7 @@ eF_ResT SwWW8ImplReader::Read_F_Set( WW8FieldDesc* pF, OUString& rStr ) } } - const long nNo = MapBookmarkVariables(pF, sOrigName, sVal); + const tools::Long nNo = MapBookmarkVariables(pF, sOrigName, sVal); SwFieldType* pFT = m_rDoc.getIDocumentFieldsAccess().InsertFieldType( SwSetExpFieldType( &m_rDoc, sOrigName, nsSwGetSetExpType::GSE_STRING ) ); @@ -3669,7 +3669,7 @@ void SwWW8ImplReader::Read_FieldVanish( sal_uInt16, const sal_uInt8*, short nLen return; m_bIgnoreText = true; - long nOldPos = m_pStrm->Tell(); + tools::Long nOldPos = m_pStrm->Tell(); WW8_CP nStartCp = m_xPlcxMan->Where() + m_xPlcxMan->GetCpOfs(); diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index b72ca39c84fe..849d68ca1dbb 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -523,7 +523,7 @@ void wwSectionManager::SetPage(SwPageDesc &rInPageDesc, SwFrameFormat &rFormat, namespace { // Returns corrected (ODF) margin size -long SetBorderDistance(bool bFromEdge, SvxBoxItem& aBox, SvxBoxItemLine eLine, long nMSMargin) +tools::Long SetBorderDistance(bool bFromEdge, SvxBoxItem& aBox, SvxBoxItemLine eLine, tools::Long nMSMargin) { const editeng::SvxBorderLine* pLine = aBox.GetLine(eLine); if (!pLine) @@ -740,10 +740,10 @@ SwSectionFormat *wwSectionManager::InsertSection( SwFrameFormat& rFormat = pPage->GetMaster(); const SvxLRSpaceItem& rLR = rFormat.GetLRSpace(); - long nPageLeft = rLR.GetLeft(); - long nPageRight = rLR.GetRight(); - long nSectionLeft = rSection.GetPageLeft() - nPageLeft; - long nSectionRight = rSection.GetPageRight() - nPageRight; + tools::Long nPageLeft = rLR.GetLeft(); + tools::Long nPageRight = rLR.GetRight(); + tools::Long nSectionLeft = rSection.GetPageLeft() - nPageLeft; + tools::Long nSectionRight = rSection.GetPageRight() - nPageRight; if ((nSectionLeft != 0) || (nSectionRight != 0)) { SvxLRSpaceItem aLR(nSectionLeft, nSectionRight, 0, 0, RES_LR_SPACE); @@ -836,7 +836,7 @@ void wwSectionManager::SetNumberingType(const wwSection &rNewSection, // fills it/them with attributes and KF texts. // This has become necessary because the translation of the various // page attributes is interconnected too much. -void wwSectionManager::CreateSep(const long nTextPos) +void wwSectionManager::CreateSep(const tools::Long nTextPos) { /* #i1909# section/page breaks should not occur in tables or subpage @@ -2112,7 +2112,7 @@ bTogglePos(false) // by modifying the Fly width (fixed in SW) afterwards. // This can increase or decrease the Fly width, because the default value // is set without knowledge of the contents. -void WW8SwFlyPara::BoxUpWidth( long nInWidth ) +void WW8SwFlyPara::BoxUpWidth( tools::Long nInWidth ) { if( bAutoWidth && nInWidth > nNewNetWidth ) nNewNetWidth = nInWidth; @@ -2177,7 +2177,7 @@ WW8FlySet::WW8FlySet(SwWW8ImplReader& rReader, const WW8FlyPara* pFW, // WW8FlySet-ctor for character bound graphics WW8FlySet::WW8FlySet( SwWW8ImplReader& rReader, const SwPaM* pPaM, - const WW8_PIC& rPic, long nWidth, long nHeight ) + const WW8_PIC& rPic, tools::Long nWidth, tools::Long nHeight ) : SfxItemSet(rReader.m_rDoc.GetAttrPool(),svl::Items<RES_FRMATR_BEGIN,RES_FRMATR_END-1>{}) { Init(rReader, pPaM); @@ -2675,7 +2675,7 @@ void SwWW8ImplReader::StopApo() // frame´s size. if (m_xSFlyPara->nNewNetWidth > MINFLY && m_xSFlyPara->pFlyFormat) // BoxUpWidth ? { - long nW = m_xSFlyPara->nNewNetWidth; + tools::Long nW = m_xSFlyPara->nNewNetWidth; nW += m_xSFlyPara->nWidth - m_xSFlyPara->nNetWidth; // border for it m_xSFlyPara->pFlyFormat->SetFormatAttr( SwFormatFrameSize(m_xSFlyPara->eHeightFix, nW, m_xSFlyPara->nHeight)); @@ -4347,7 +4347,7 @@ void SwWW8ImplReader::Read_LineSpace( sal_uInt16, const sal_uInt8* pData, short if( 1 == nMulti ) // MultilineSpace ( proportional ) { - long n = nSpace * 10 / 24; // WW: 240 = 100%, SW: 100 = 100% + tools::Long n = nSpace * 10 / 24; // WW: 240 = 100%, SW: 100 = 100% // here n is in [0..13653] aLSpc.SetPropLineSpace( static_cast<sal_uInt16>(n) ); @@ -5253,7 +5253,7 @@ bool SwWW8ImplReader::ParseTabPos(WW8_TablePos *pTabPos, WW8PLCFx_Cp_FKP* pPap) // page attribute won't be used as attribute anymore // ( except OLST ) -long SwWW8ImplReader::ImportExtSprm(WW8PLCFManResult* pRes) +tools::Long SwWW8ImplReader::ImportExtSprm(WW8PLCFManResult* pRes) { // array for reading of the extended ( self-defined ) SPRMs typedef long (SwWW8ImplReader::*FNReadRecordExt)(WW8PLCFManResult*); diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index e8a9a6450330..cba66a28dbf5 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -1173,7 +1173,7 @@ WW8_CP WW8PLCFx_PCD::Where() return pPcdI ? pPcdI->Where() : WW8_CP_MAX; } -long WW8PLCFx_PCD::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) +tools::Long WW8PLCFx_PCD::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) { void* pData; rLen = 0; @@ -2086,7 +2086,7 @@ OUString read_uInt16_BeltAndBracesString(SvStream& rStrm) } sal_Int32 WW8ScannerBase::WW8ReadString( SvStream& rStrm, OUString& rStr, - WW8_CP nCurrentStartCp, long nTotalLen, rtl_TextEncoding eEnc ) const + WW8_CP nCurrentStartCp, tools::Long nTotalLen, rtl_TextEncoding eEnc ) const { // Read in plain text, which can extend over several pieces rStr.clear(); @@ -2096,7 +2096,7 @@ sal_Int32 WW8ScannerBase::WW8ReadString( SvStream& rStrm, OUString& rStr, WW8_CP nBehindTextCp = nCurrentStartCp + nTotalLen; WW8_CP nNextPieceCp = nBehindTextCp; // Initialization, important for Ver6 - long nTotalRead = 0; + tools::Long nTotalRead = 0; do { bool bIsUnicode(false), bPosOk(false); @@ -2174,7 +2174,7 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos, // that begins before nPos and ends after nPos. // Suitable for normal attributes. However, the beginning of the attribute is not corrected onto // the position nPos. -bool WW8PLCFspecial::SeekPos(long nP) +bool WW8PLCFspecial::SeekPos(tools::Long nP) { if( nP < pPLCF_PosArray[0] ) { @@ -2186,8 +2186,8 @@ bool WW8PLCFspecial::SeekPos(long nP) if ((nIdx < 1) || (nP < pPLCF_PosArray[nIdx - 1])) nIdx = 1; - long nI = nIdx; - long nEnd = nIMax; + tools::Long nI = nIdx; + tools::Long nEnd = nIMax; for(int n = (1==nIdx ? 1 : 2); n; --n ) { @@ -2209,7 +2209,7 @@ bool WW8PLCFspecial::SeekPos(long nP) // WW8PLCFspecial::SeekPosExact() like SeekPos(), but it is ensured that no attribute is cut, // i.e. the next given attribute begins at or after nPos. // Is used for fields and bookmarks. -bool WW8PLCFspecial::SeekPosExact(long nP) +bool WW8PLCFspecial::SeekPosExact(tools::Long nP) { if( nP < pPLCF_PosArray[0] ) { @@ -2220,8 +2220,8 @@ bool WW8PLCFspecial::SeekPosExact(long nP) if( nP <=pPLCF_PosArray[nIdx] ) nIdx = 0; - long nI = nIdx ? nIdx-1 : 0; - long nEnd = nIMax; + tools::Long nI = nIdx ? nIdx-1 : 0; + tools::Long nEnd = nIMax; for(int n = (0==nIdx ? 1 : 2); n; --n ) { @@ -2245,7 +2245,7 @@ bool WW8PLCFspecial::Get(WW8_CP& rPos, void*& rpValue) const return GetData( nIdx, rPos, rpValue ); } -bool WW8PLCFspecial::GetData(long nInIdx, WW8_CP& rPos, void*& rpValue) const +bool WW8PLCFspecial::GetData(tools::Long nInIdx, WW8_CP& rPos, void*& rpValue) const { if ( nInIdx >= nIMax ) { @@ -2549,16 +2549,16 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos, } // If nStartPos < 0, the first element of PLCFs will be taken -WW8PLCFpcd_Iter::WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, long nStartPos ) +WW8PLCFpcd_Iter::WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, tools::Long nStartPos ) :rPLCF( rPLCFpcd ), nIdx( 0 ) { if( nStartPos >= 0 ) SeekPos( nStartPos ); } -bool WW8PLCFpcd_Iter::SeekPos(long nPos) +bool WW8PLCFpcd_Iter::SeekPos(tools::Long nPos) { - long nP = nPos; + tools::Long nP = nPos; if( nP < rPLCF.pPLCF_PosArray[0] ) { @@ -2569,8 +2569,8 @@ bool WW8PLCFpcd_Iter::SeekPos(long nPos) if ((nIdx < 1) || (nP < rPLCF.pPLCF_PosArray[nIdx - 1])) nIdx = 1; - long nI = nIdx; - long nEnd = rPLCF.nIMax; + tools::Long nI = nIdx; + tools::Long nEnd = rPLCF.nIMax; for(int n = (1==nIdx ? 1 : 2); n; --n ) { @@ -2646,7 +2646,7 @@ void WW8PLCFx_Fc_FKP::WW8Fkp::FillEntry(WW8PLCFx_Fc_FKP::WW8Fkp::Entry &rEntry, } WW8PLCFx_Fc_FKP::WW8Fkp::WW8Fkp(const WW8Fib& rFib, SvStream* pSt, - SvStream* pDataSt, long _nFilePos, long nItemSiz, ePLCFT ePl, + SvStream* pDataSt, tools::Long _nFilePos, tools::Long nItemSiz, ePLCFT ePl, WW8_FC nStartFc) : nItemSize(nItemSiz), nFilePos(_nFilePos), mnIdx(0), ePLCF(ePl) , mnMustRemainCached(0), maSprmParser(rFib) @@ -3018,7 +3018,7 @@ void WW8PLCFx::GetSprms( WW8PLCFxDesc* p ) p->bRealLineEnd = false; } -long WW8PLCFx::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) +tools::Long WW8PLCFx::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) { OSL_ENSURE( false, "Called wrong GetNoSprms" ); rStart = rEnd = WW8_CP_MAX; @@ -3041,9 +3041,9 @@ namespace { class SamePos { private: - long mnPo; + tools::Long mnPo; public: - explicit SamePos(long nPo) : mnPo(nPo) {} + explicit SamePos(tools::Long nPo) : mnPo(nPo) {} bool operator()(const std::unique_ptr<WW8PLCFx_Fc_FKP::WW8Fkp>& pFkp) {return mnPo == pFkp->GetFilePos();} }; @@ -3094,10 +3094,10 @@ bool WW8PLCFx_Fc_FKP::NewFkp() return false; // PLCF completely processed } pPLCF->advance(); - long nPo = SVBT16ToUInt16( static_cast<sal_uInt8 *>(pPage) ); + tools::Long nPo = SVBT16ToUInt16( static_cast<sal_uInt8 *>(pPage) ); nPo <<= 9; // shift as LONG - long nCurrentFkpFilePos = pFkp ? pFkp->GetFilePos() : -1; + tools::Long nCurrentFkpFilePos = pFkp ? pFkp->GetFilePos() : -1; if (nCurrentFkpFilePos == nPo) pFkp->Reset(GetStartFc()); else @@ -3136,7 +3136,7 @@ WW8PLCFx_Fc_FKP::WW8PLCFx_Fc_FKP(SvStream* pSt, SvStream* pTableSt, , pFkp(nullptr), ePLCF(ePl) { SetStartFc(nStartFcL); - long nLenStruct = (8 > rFib.m_nVersion) ? 2 : 4; + tools::Long nLenStruct = (8 > rFib.m_nVersion) ? 2 : 4; if (ePl == CHP) { pPLCF.reset(new WW8PLCF(*pTableSt, rFib.m_fcPlcfbteChpx, rFib.m_lcbPlcfbteChpx, @@ -3196,7 +3196,7 @@ bool WW8PLCFx_Fc_FKP::SeekPos(WW8_FC nFcPos) void* pPage; if( pFkp && pPLCF->Get( nPLCFStart, nPLCFEnd, pPage ) ) { - long nPo = SVBT16ToUInt16( static_cast<sal_uInt8 *>(pPage) ); + tools::Long nPo = SVBT16ToUInt16( static_cast<sal_uInt8 *>(pPage) ); nPo <<= 9; // shift as LONG if (nPo != pFkp->GetFilePos()) pFkp = nullptr; @@ -3800,7 +3800,7 @@ SprmResult WW8PLCFx_SEPX::HasSprm(sal_uInt16 nId) const } SprmResult WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, const sal_uInt8* pOtherSprms, - long nOtherSprmSiz ) const + tools::Long nOtherSprmSiz ) const { SprmResult aRet; if (pPLCF) @@ -3876,8 +3876,8 @@ SprmResult WW8PLCFx_SEPX::HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const } WW8PLCFx_SubDoc::WW8PLCFx_SubDoc(SvStream* pSt, const WW8Fib& rFib, - WW8_CP nStartCp, long nFcRef, long nLenRef, long nFcText, long nLenText, - long nStruct) + WW8_CP nStartCp, tools::Long nFcRef, tools::Long nLenRef, tools::Long nFcText, tools::Long nLenText, + tools::Long nStruct) : WW8PLCFx(rFib, true) { if( nLenRef && nLenText ) @@ -4061,7 +4061,7 @@ bool WW8PLCFx_FLD::EndPosIsFieldEnd(WW8_CP& nCP) if (pPLCF) { - long n = pPLCF->GetIdx(); + tools::Long n = pPLCF->GetIdx(); pPLCF->advance(); @@ -4092,7 +4092,7 @@ void WW8PLCFx_FLD::GetSprms(WW8PLCFxDesc* p) return; } - long n = pPLCF->GetIdx(); + tools::Long n = pPLCF->GetIdx(); sal_Int32 nP; void *pData; @@ -4126,13 +4126,13 @@ void WW8PLCFx_FLD::advance() pPLCF->advance(); } -bool WW8PLCFx_FLD::GetPara(long nIdx, WW8FieldDesc& rF) +bool WW8PLCFx_FLD::GetPara(tools::Long nIdx, WW8FieldDesc& rF) { SAL_WARN_IF(!pPLCF, "sw.ww8", "Call without PLCFspecial field"); if( !pPLCF ) return false; - long n = pPLCF->GetIdx(); + tools::Long n = pPLCF->GetIdx(); pPLCF->SetIdx(nIdx); bool bOk = WW8GetFieldPara(*pPLCF, rF); @@ -4346,7 +4346,7 @@ WW8_CP WW8PLCFx_Book::Where() return pBook[nIsEnd]->Where(); } -long WW8PLCFx_Book::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) +tools::Long WW8PLCFx_Book::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) { void* pData; rEnd = WW8_CP_MAX; @@ -4391,7 +4391,7 @@ void WW8PLCFx_Book::advance() else { const void * p = pBook[0]->GetData(pBook[0]->GetIdx()); - long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p)); + tools::Long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p)); if (nPairFor == pBook[1]->GetIdx()) nIsEnd = 0; else @@ -4399,7 +4399,7 @@ void WW8PLCFx_Book::advance() } } -long WW8PLCFx_Book::GetLen() const +tools::Long WW8PLCFx_Book::GetLen() const { if( nIsEnd ) { @@ -4414,7 +4414,7 @@ long WW8PLCFx_Book::GetLen() const return 0; } const sal_uInt16 nEndIdx = SVBT16ToUInt16( *static_cast<SVBT16*>(p) ); - long nNum = pBook[1]->GetPos( nEndIdx ); + tools::Long nNum = pBook[1]->GetPos( nEndIdx ); nNum -= nStartPos; return nNum; } @@ -4431,11 +4431,11 @@ eBookStatus WW8PLCFx_Book::GetStatus() const { if (aStatus.empty()) return BOOK_NORMAL; - long nEndIdx = GetHandle(); + tools::Long nEndIdx = GetHandle(); return ( nEndIdx < nIMax ) ? aStatus[nEndIdx] : BOOK_NORMAL; } -long WW8PLCFx_Book::GetHandle() const +tools::Long WW8PLCFx_Book::GetHandle() const { if( !pBook[0] || !pBook[1] ) return LONG_MAX; @@ -4451,7 +4451,7 @@ long WW8PLCFx_Book::GetHandle() const } } -OUString WW8PLCFx_Book::GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex) +OUString WW8PLCFx_Book::GetBookmark(tools::Long nStart,tools::Long nEnd, sal_uInt16 &nIndex) { bool bFound = false; sal_uInt16 i = 0; @@ -4599,7 +4599,7 @@ WW8_CP WW8PLCFx_AtnBook::Where() return m_pBook[static_cast<int>(m_bIsEnd)]->Where(); } -long WW8PLCFx_AtnBook::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) +tools::Long WW8PLCFx_AtnBook::GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) { void* pData; rEnd = WW8_CP_MAX; @@ -4631,7 +4631,7 @@ void WW8PLCFx_AtnBook::advance() else { const void * p = m_pBook[0]->GetData(m_pBook[0]->GetIdx()); - long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p)); + tools::Long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p)); if (nPairFor == m_pBook[1]->GetIdx()) m_bIsEnd = false; else @@ -4639,7 +4639,7 @@ void WW8PLCFx_AtnBook::advance() } } -long WW8PLCFx_AtnBook::getHandle() const +tools::Long WW8PLCFx_AtnBook::getHandle() const { if (!m_pBook[0] || !m_pBook[1]) return LONG_MAX; @@ -4728,7 +4728,7 @@ WW8_CP WW8PLCFx_FactoidBook::Where() return m_pBook[static_cast<int>(m_bIsEnd)]->Where(); } -long WW8PLCFx_FactoidBook::GetNoSprms(WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen) +tools::Long WW8PLCFx_FactoidBook::GetNoSprms(WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen) { void* pData; rEnd = WW8_CP_MAX; @@ -4760,7 +4760,7 @@ void WW8PLCFx_FactoidBook::advance() else { const void * p = m_pBook[0]->GetData(m_pBook[0]->GetIdx()); - long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p)); + tools::Long nPairFor = (p == nullptr) ? 0 : SVBT16ToUInt16(*static_cast<SVBT16 const *>(p)); if (nPairFor == m_pBook[1]->GetIdx()) m_bIsEnd = false; else @@ -4768,7 +4768,7 @@ void WW8PLCFx_FactoidBook::advance() } } -long WW8PLCFx_FactoidBook::getHandle() const +tools::Long WW8PLCFx_FactoidBook::getHandle() const { if (!m_pBook[0] || !m_pBook[1]) return LONG_MAX; @@ -4915,7 +4915,7 @@ sal_uInt16 WW8PLCFMan::GetId(const WW8PLCFxDesc* p) const return nId; } -WW8PLCFMan::WW8PLCFMan(const WW8ScannerBase* pBase, ManTypes nType, long nStartCp, +WW8PLCFMan::WW8PLCFMan(const WW8ScannerBase* pBase, ManTypes nType, tools::Long nStartCp, bool bDoingDrawTextBox) : maSprmParser(*pBase->m_pWw8Fib), m_nLineEnd(WW8_CP_MAX), @@ -5147,7 +5147,7 @@ WW8_CP WW8PLCFMan::Where() const return l; } -void WW8PLCFMan::SeekPos( long nNewCp ) +void WW8PLCFMan::SeekPos( tools::Long nNewCp ) { m_pChp->pPLCFx->SeekPos( nNewCp + m_nCpO ); // create new attr m_pPap->pPLCFx->SeekPos( nNewCp + m_nCpO ); @@ -5186,7 +5186,7 @@ void WW8PLCFMan::RestoreAllPLCFx( const WW8PLCFxSaveAll& rSave ) namespace { - bool IsSizeLegal(long nSprmLen, sal_Int32 nSprmsLen) + bool IsSizeLegal(tools::Long nSprmLen, sal_Int32 nSprmsLen) { if (nSprmLen > nSprmsLen) { @@ -6211,7 +6211,7 @@ WW8Fib::WW8Fib(SvStream& rSt, sal_uInt8 nWantedVersion, sal_uInt32 nOffset): identify the values for PLCF and PLF LFO and PLCF for the textbox break descriptors */ - long nOldPos = rSt.Tell(); + tools::Long nOldPos = rSt.Tell(); rSt.Seek( 0x02da ); rSt.ReadInt32( m_fcSttbFnm ); diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index d6672ad94cc5..b9beb92652e0 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -203,9 +203,9 @@ struct WW8PLCFxSave1 { sal_uInt32 nPLCFxPos; sal_uInt32 nPLCFxPos2; ///< for PLCF_Cp_Fkp: PieceIter-Pos - long nPLCFxMemOfs; + tools::Long nPLCFxMemOfs; WW8_CP nStartCp; ///< for cp based iterator like PAP and CHP - long nCpOfs; + tools::Long nCpOfs; WW8_FC nStartFC; WW8_CP nAttrStart; WW8_CP nAttrEnd; @@ -221,8 +221,8 @@ class WW8PLCFspecial // iterator for PLCFs private: std::unique_ptr<sal_Int32[]> pPLCF_PosArray; ///< pointer to Pos-array and to the whole structure sal_uInt8* pPLCF_Contents; ///< pointer to content-array-part of Pos-array - long nIMax; ///< number of elements - long nIdx; ///< marker where we currently are + tools::Long nIMax; ///< number of elements + tools::Long nIdx; ///< marker where we currently are sal_uInt32 nStru; WW8PLCFspecial(const WW8PLCFspecial&) = delete; @@ -231,23 +231,23 @@ private: public: WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos, sal_uInt32 nPLCF, sal_uInt32 nStruct); - long GetIdx() const { return nIdx; } - void SetIdx( long nI ) { nIdx = nI; } - long GetIMax() const { return nIMax; } - bool SeekPos(long nPos); // walks over FC- or CP-value + tools::Long GetIdx() const { return nIdx; } + void SetIdx( tools::Long nI ) { nIdx = nI; } + tools::Long GetIMax() const { return nIMax; } + bool SeekPos(tools::Long nPos); // walks over FC- or CP-value // resp. next biggest value - bool SeekPosExact(long nPos); + bool SeekPosExact(tools::Long nPos); sal_Int32 Where() const { return ( nIdx >= nIMax ) ? SAL_MAX_INT32 : pPLCF_PosArray[nIdx]; } bool Get(WW8_CP& rStart, void*& rpValue) const; - bool GetData(long nIdx, WW8_CP& rPos, void*& rpValue) const; + bool GetData(tools::Long nIdx, WW8_CP& rPos, void*& rpValue) const; - const void* GetData( long nInIdx ) const + const void* GetData( tools::Long nInIdx ) const { return ( nInIdx >= nIMax ) ? nullptr : static_cast<const void*>(&pPLCF_Contents[nInIdx * nStru]); } - sal_Int32 GetPos( long nInIdx ) const + sal_Int32 GetPos( tools::Long nInIdx ) const { return ( nInIdx >= nIMax ) ? SAL_MAX_INT32 : pPLCF_PosArray[nInIdx]; } void advance() @@ -360,17 +360,17 @@ class WW8PLCFpcd_Iter { private: WW8PLCFpcd& rPLCF; - long nIdx; + tools::Long nIdx; WW8PLCFpcd_Iter(const WW8PLCFpcd_Iter&) = delete; WW8PLCFpcd_Iter& operator=(const WW8PLCFpcd_Iter&) = delete; public: - WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, long nStartPos = -1 ); - long GetIdx() const { return nIdx; } - void SetIdx( long nI ) { nIdx = nI; } - long GetIMax() const { return rPLCF.nIMax; } - bool SeekPos(long nPos); + WW8PLCFpcd_Iter( WW8PLCFpcd& rPLCFpcd, tools::Long nStartPos = -1 ); + tools::Long GetIdx() const { return nIdx; } + void SetIdx( tools::Long nI ) { nIdx = nI; } + tools::Long GetIMax() const { return rPLCF.nIMax; } + bool SeekPos(tools::Long nPos); sal_Int32 Where() const; bool Get(WW8_CP& rStart, WW8_CP& rEnd, void*& rpValue) const; void advance() @@ -417,7 +417,7 @@ public: virtual bool SeekPos(WW8_CP nCpPos) = 0; virtual WW8_FC Where() = 0; virtual void GetSprms( WW8PLCFxDesc* p ); - virtual long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen ); + virtual tools::Long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen ); virtual void advance() = 0; virtual sal_uInt16 GetIstd() const { return 0xffff; } virtual void Save( WW8PLCFxSave1& rSave ) const; @@ -474,7 +474,7 @@ public: virtual void SetIdx(sal_uInt32 nI) override; virtual bool SeekPos(WW8_CP nCpPos) override; virtual WW8_CP Where() override; - virtual long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen ) override; + virtual tools::Long GetNoSprms( WW8_CP& rStart, WW8_CP&, sal_Int32& rLen ) override; virtual void advance() override; WW8_CP CurrentPieceStartFc2Cp( WW8_FC nStartPos ); WW8_FC CurrentPieceStartCp2Fc( WW8_CP nCp ); @@ -484,7 +484,7 @@ public: void SetClipStart(WW8_CP nIn) { nClipStart = nIn; } WW8_CP GetClipStart() const { return nClipStart; } - static sal_Int32 TransformPieceAddress(long nfc, bool& bIsUnicodeAddress) + static sal_Int32 TransformPieceAddress(tools::Long nfc, bool& bIsUnicodeAddress) { bIsUnicodeAddress = 0 == (0x40000000 & nfc); return bIsUnicodeAddress ? nfc : (nfc & 0x3fffFFFF) / 2; @@ -522,10 +522,10 @@ public: sal_uInt8 maRawData[512]; std::vector<Entry> maEntries; - long nItemSize; // either 1 Byte or a complete BX + tools::Long nItemSize; // either 1 Byte or a complete BX // Offset in Stream where last read of 512 bytes took place - long nFilePos; + tools::Long nFilePos; sal_uInt8 mnIdx; // Pos marker ePLCFT ePLCF; sal_uInt8 mnIMax; // number of entries @@ -538,10 +538,10 @@ public: public: WW8Fkp (const WW8Fib& rFib, SvStream* pFKPStrm, - SvStream* pDataStrm, long _nFilePos, long nItemSiz, ePLCFT ePl, + SvStream* pDataStrm, tools::Long _nFilePos, tools::Long nItemSiz, ePLCFT ePl, WW8_FC nStartFc); void Reset(WW8_FC nPos); - long GetFilePos() const { return nFilePos; } + tools::Long GetFilePos() const { return nFilePos; } sal_uInt8 GetIdx() const { return mnIdx; } void SetIdx(sal_uInt8 nI); bool SeekPos(WW8_FC nFc); @@ -685,7 +685,7 @@ public: SprmResult HasSprm( sal_uInt16 nId ) const; SprmResult HasSprm( sal_uInt16 nId, sal_uInt8 n2nd ) const; SprmResult HasSprm( sal_uInt16 nId, const sal_uInt8* pOtherSprms, - long nOtherSprmSiz ) const; + tools::Long nOtherSprmSiz ) const; bool Find4Sprms(sal_uInt16 nId1, sal_uInt16 nId2, sal_uInt16 nId3, sal_uInt16 nId4, SprmResult& r1, SprmResult& r2, SprmResult& r3, SprmResult& r4) const; }; @@ -702,7 +702,7 @@ private: public: WW8PLCFx_SubDoc(SvStream* pSt, const WW8Fib& rFib, WW8_CP nStartCp, - long nFcRef, long nLenRef, long nFcText, long nLenText, long nStruc); + tools::Long nFcRef, tools::Long nLenRef, tools::Long nFcText, tools::Long nLenText, tools::Long nStruc); virtual ~WW8PLCFx_SubDoc() override; virtual sal_uInt32 GetIdx() const override; virtual void SetIdx(sal_uInt32 nIdx) override; @@ -717,7 +717,7 @@ public: virtual void GetSprms(WW8PLCFxDesc* p) override; virtual void advance() override; - long Count() const { return pRef ? pRef->GetIMax() : 0; } + tools::Long Count() const { return pRef ? pRef->GetIMax() : 0; } }; /// Iterator for fields @@ -740,7 +740,7 @@ public: virtual void advance() override; bool StartPosIsFieldStart(); bool EndPosIsFieldEnd(WW8_CP&); - bool GetPara(long nIdx, WW8FieldDesc& rF); + bool GetPara(tools::Long nIdx, WW8FieldDesc& rF); }; enum eBookStatus { BOOK_NORMAL = 0, BOOK_IGNORE = 0x1, BOOK_FIELD = 0x2 }; @@ -752,7 +752,7 @@ private: std::unique_ptr<WW8PLCFspecial> pBook[2]; // Start and End Position std::vector<OUString> aBookNames; // Name std::vector<eBookStatus> aStatus; - long nIMax; // Number of Booknotes + tools::Long nIMax; // Number of Booknotes sal_uInt16 nIsEnd; sal_Int32 nBookmarkId; // counter incremented by GetUniqueBookmarkName. @@ -762,24 +762,24 @@ private: public: WW8PLCFx_Book(SvStream* pTableSt,const WW8Fib& rFib); virtual ~WW8PLCFx_Book() override; - long GetIMax() const { return nIMax; } + tools::Long GetIMax() const { return nIMax; } virtual sal_uInt32 GetIdx() const override; virtual void SetIdx(sal_uInt32 nI) override; virtual sal_uInt32 GetIdx2() const override; virtual void SetIdx2(sal_uInt32 nIdx) override; virtual bool SeekPos(WW8_CP nCpPos) override; virtual WW8_CP Where() override; - virtual long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) override; + virtual tools::Long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) override; virtual void advance() override; const OUString* GetName() const; WW8_CP GetStartPos() const { return nIsEnd ? WW8_CP_MAX : pBook[0]->Where(); } - long GetLen() const; + tools::Long GetLen() const; bool GetIsEnd() const { return nIsEnd != 0; } - long GetHandle() const; + tools::Long GetHandle() const; void SetStatus( sal_uInt16 nIndex, eBookStatus eStat ); void MapName(OUString& rName); - OUString GetBookmark(long nStart,long nEnd, sal_uInt16 &nIndex); + OUString GetBookmark(tools::Long nStart,tools::Long nEnd, sal_uInt16 &nIndex); eBookStatus GetStatus() const; OUString GetUniqueBookmarkName(const OUString &rSuggestedName); }; @@ -806,11 +806,11 @@ public: virtual void SetIdx2(sal_uInt32 nIdx) override; virtual bool SeekPos(WW8_CP nCpPos) override; virtual WW8_CP Where() override; - virtual long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) override; + virtual tools::Long GetNoSprms( WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen ) override; virtual void advance() override; /// Handle is the unique ID of an annotation mark. - long getHandle() const; + tools::Long getHandle() const; bool getIsEnd() const; }; @@ -836,11 +836,11 @@ public: virtual void SetIdx2(sal_uInt32 nIdx) override; virtual bool SeekPos(WW8_CP nCpPos) override; virtual WW8_CP Where() override; - virtual long GetNoSprms(WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen) override; + virtual tools::Long GetNoSprms(WW8_CP& rStart, WW8_CP& rEnd, sal_Int32& rLen) override; virtual void advance() override; /// Handle is the unique ID of a factoid mark. - long getHandle() const; + tools::Long getHandle() const; bool getIsEnd() const; }; @@ -850,8 +850,8 @@ public: struct WW8PLCFManResult { WW8_CP nCpPos; // attribute starting position - long nMemLen; // length for previous - long nCp2OrIdx; // footnote-textpos or index in PLCF + tools::Long nMemLen; // length for previous + tools::Long nCp2OrIdx; // footnote-textpos or index in PLCF WW8_CP nCurrentCp; // only used by caller const sal_uInt8* pMemPos;// Mem-Pos for Sprms sal_uInt16 nSprmId; // Sprm-Id ( 0 = invalid Id -> skip! ) @@ -880,7 +880,7 @@ struct WW8PLCFxDesc WW8PLCFx* pPLCFx; std::stack<sal_uInt16>* pIdStack; // memory for Attr-Id for Attr-end(s) const sal_uInt8* pMemPos;// where are the Sprm(s) - long nOrigSprmsLen; + tools::Long nOrigSprmsLen; WW8_CP nStartPos; WW8_CP nEndPos; @@ -899,7 +899,7 @@ struct WW8PLCFxDesc WW8_CP nCp2OrIdx; // where are the NoSprm(s) sal_Int32 nSprmsLen; // how many bytes for further Sprms / length of footnote - long nCpOfs; // for Offset Header .. Footnote + tools::Long nCpOfs; // for Offset Header .. Footnote bool bFirstSprm; // for recognizing the first Sprm of a group bool bRealLineEnd; // false for Pap-Piece-end sal_Int16 nRelativeJustify; @@ -969,7 +969,7 @@ private: bool IsSprmLegalForCategory(sal_uInt16 nSprmId, short nIdx) const; public: - WW8PLCFMan(const WW8ScannerBase* pBase, ManTypes nType, long nStartCp, + WW8PLCFMan(const WW8ScannerBase* pBase, ManTypes nType, tools::Long nStartCp, bool bDoingDrawTextBox = false); ~WW8PLCFMan(); @@ -988,7 +988,7 @@ public: WW8PLCFx_Book* GetBook() const { return static_cast<WW8PLCFx_Book*>(m_pBkm->pPLCFx); } WW8PLCFx_AtnBook* GetAtnBook() const { return static_cast<WW8PLCFx_AtnBook*>(m_pAtnBkm->pPLCFx); } WW8PLCFx_FactoidBook* GetFactoidBook() const { return static_cast<WW8PLCFx_FactoidBook*>(m_pFactoidBkm->pPLCFx); } - long GetCpOfs() const { return m_pChp->nCpOfs; } // for Header/Footer... + tools::Long GetCpOfs() const { return m_pChp->nCpOfs; } // for Header/Footer... /* asks, if *current paragraph* has an Sprm of this type */ SprmResult HasParaSprm(sal_uInt16 nId) const; @@ -1005,7 +1005,7 @@ public: { return static_cast<WW8PLCFx_SEPX*>(m_pSep->pPLCFx); } WW8PLCFxDesc* GetPap() const { return m_pPap; } void TransferOpenSprms(std::stack<sal_uInt16> &rStack); - void SeekPos( long nNewCp ); + void SeekPos( tools::Long nNewCp ); void SaveAllPLCFx( WW8PLCFxSaveAll& rSave ) const; void RestoreAllPLCFx( const WW8PLCFxSaveAll& rSave ); WW8PLCFspecial* GetFdoa() const { return m_pFdoa; } @@ -1031,7 +1031,7 @@ friend WW8PLCFx_PCDAttrs::WW8PLCFx_PCDAttrs(const WW8Fib& rFib, friend WW8PLCFx_Cp_FKP::WW8PLCFx_Cp_FKP( SvStream*, SvStream*, SvStream*, const WW8ScannerBase&, ePLCFT ); -friend WW8PLCFMan::WW8PLCFMan(const WW8ScannerBase*, ManTypes, long, bool); +friend WW8PLCFMan::WW8PLCFMan(const WW8ScannerBase*, ManTypes, tools::Long, bool); friend class SwWW8FltControlStack; private: @@ -1091,7 +1091,7 @@ public: WW8_CP* pNextPieceCp = nullptr, bool* pTestFlag = nullptr) const; sal_Int32 WW8ReadString(SvStream& rStrm, OUString& rStr, WW8_CP nCurrentStartCp, - long nTotalLen, rtl_TextEncoding eEnc ) const; + tools::Long nTotalLen, rtl_TextEncoding eEnc ) const; }; diff --git a/sw/source/filter/ww8/ww8toolbar.cxx b/sw/source/filter/ww8/ww8toolbar.cxx index f41121945dd2..fea93ae66850 100644 --- a/sw/source/filter/ww8/ww8toolbar.cxx +++ b/sw/source/filter/ww8/ww8toolbar.cxx @@ -118,7 +118,7 @@ bool SwCTBWrapper::Read( SvStream& rS ) Tcg255SubStruct::Read( rS ); rS.ReadUInt16( reserved2 ).ReadUChar( reserved3 ).ReadUInt16( reserved4 ).ReadUInt16( reserved5 ); rS.ReadInt16( cbTBD ).ReadUInt16( cCust ).ReadInt32( cbDTBC ); - long nExpectedPos = rS.Tell() + cbDTBC; + tools::Long nExpectedPos = rS.Tell() + cbDTBC; if ( cbDTBC ) { // cbDTBC is the size in bytes of the SwTBC array @@ -138,12 +138,12 @@ bool SwCTBWrapper::Read( SvStream& rS ) bytesToRead = cbDTBC - ( rS.Tell() - nStart ); } while ( bytesToRead > 0 ); } - if ( static_cast< long >( rS.Tell() ) != nExpectedPos ) + if ( static_cast< tools::Long >( rS.Tell() ) != nExpectedPos ) { // Strange error condition, shouldn't happen ( but does in at least // one test document ) In the case where it happens the SwTBC & // TBCHeader records seem blank??? ( and incorrect ) - SAL_WARN_IF( static_cast< long >(rS.Tell()) != nExpectedPos, "sw.ww8","### Error: Expected pos not equal to actual pos after reading rtbdc"); + SAL_WARN_IF( static_cast< tools::Long >(rS.Tell()) != nExpectedPos, "sw.ww8","### Error: Expected pos not equal to actual pos after reading rtbdc"); SAL_INFO("sw.ww8","\tPos now is 0x" << std::hex << rS.Tell() << " should be 0x" << std::hex << nExpectedPos ); // seek to correct position after rtbdc rS.Seek( nExpectedPos ); diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index dc819e7ffb21..d458936a0116 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -603,7 +603,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( const sal_uInt16 nDistance = pTop->GetDistance(); const sal_uInt16 nInWidth = pTop->GetInWidth(); const sal_uInt16 nOutWidth = pTop->GetOutWidth(); - const long nWidth = pTop->GetWidth(); + const tools::Long nWidth = pTop->GetWidth(); bEqual = nDistance == pLeft->GetDistance() && nInWidth == pLeft->GetInWidth() && diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 1ce3ec93a63e..752125c3c2ab 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1251,25 +1251,25 @@ void SwXMLImport::SetViewSettings(const Sequence < PropertyValue > & aViewProps) if ( rValue.Name == "ViewAreaTop" ) { rValue.Value >>= nTmp; - aRect.setY( static_cast< long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) ); + aRect.setY( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) ); } else if ( rValue.Name == "ViewAreaLeft" ) { rValue.Value >>= nTmp; - aRect.setX( static_cast< long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) ); + aRect.setX( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) ); } else if ( rValue.Name == "ViewAreaWidth" ) { rValue.Value >>= nTmp; Size aSize( aRect.GetSize() ); - aSize.setWidth( static_cast< long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) ); + aSize.setWidth( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) ); aRect.SetSize( aSize ); } else if ( rValue.Name == "ViewAreaHeight" ) { rValue.Value >>= nTmp; Size aSize( aRect.GetSize() ); - aSize.setHeight( static_cast< long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) ); + aSize.setHeight( static_cast< tools::Long >(bTwip ? sanitiseMm100ToTwip(nTmp) : nTmp) ); aRect.SetSize( aSize ); } else if ( rValue.Name == "ShowRedlineChanges" ) diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 68dbde33016d..50528f430448 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -916,7 +916,7 @@ void SwXMLExport::ExportTableLine( const SwTableLine& rLine, const SwTableBox *pBox = rBoxes[nBox]; // NEW TABLES - const long nRowSpan = pBox->getRowSpan(); + const tools::Long nRowSpan = pBox->getRowSpan(); if( nRowSpan < 1 ) { SvXMLElementExport aElem2( *this, rTableInfo.GetPrefix(), diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 87e0eb9c712f..b580749c2911 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -2252,7 +2252,7 @@ SwTableLine *SwXMLTableContext::MakeTableLine( SwTableBox *pUpper, ( pCell->GetStartNode() || pCell->GetSubTable() ) ) { // insert new empty cell for covered cells: - long nBoxRowSpan = 1; + tools::Long nBoxRowSpan = 1; if ( !m_bHasSubTables ) { nBoxRowSpan = pCell->GetRowSpan(); |