diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-19 15:18:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-20 08:04:53 +0200 |
commit | 1e822e401ea8fe950c7fb62172ac61d8396c98e9 (patch) | |
tree | 3a29227adfe1c5ec9209d7e7deb2035633104986 /sw/source/uibase | |
parent | b225980d2d65694278c9ed89512fbe21b08febd6 (diff) |
use tools::Long in sw
Change-Id: I44be72b3a9b14823ec37a3c799cffb4fb4d6e1de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104527
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase')
80 files changed, 537 insertions, 535 deletions
diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index 784720d8f353..a5ba5cb27c9c 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -330,7 +330,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) if ( aPaperSize.Width() > aPaperSize.Height() ) Swap( aPaperSize ); - long lLeft = rItem.m_nShiftRight, + tools::Long lLeft = rItem.m_nShiftRight, lUpper = rItem.m_nShiftDown; sal_uInt16 nPageW = static_cast<sal_uInt16>(std::max(rItem.m_nWidth, rItem.m_nHeight)), @@ -339,13 +339,13 @@ void SwModule::InsertEnv( SfxRequest& rReq ) switch (rItem.m_eAlign) { case ENV_HOR_LEFT: break; - case ENV_HOR_CNTR: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW)) / 2; + case ENV_HOR_CNTR: lLeft += std::max(0L, tools::Long(aPaperSize.Width() - nPageW)) / 2; break; - case ENV_HOR_RGHT: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW)); + case ENV_HOR_RGHT: lLeft += std::max(0L, tools::Long(aPaperSize.Width() - nPageW)); break; - case ENV_VER_LEFT: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH)); + case ENV_VER_LEFT: lUpper += std::max(0L, tools::Long(aPaperSize.Width() - nPageH)); break; - case ENV_VER_CNTR: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH)) / 2; + case ENV_VER_CNTR: lUpper += std::max(0L, tools::Long(aPaperSize.Width() - nPageH)) / 2; break; case ENV_VER_RGHT: break; } diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index 77534197e1e6..fda48d4e007f 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -239,7 +239,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) aDesc.SetUseOn(UseOnPage::All); // Site numbering // Set page size - long lPgWidth, lPgHeight; + tools::Long lPgWidth, lPgHeight; lPgWidth = std::max<sal_Int32>(rItem.m_lPWidth, MINLAY); lPgHeight = std::max<sal_Int32>(rItem.m_lPHeight, MINLAY); rFormat.SetFormatAttr( SwFormatFrameSize( SwFrameSize::Fixed, lPgWidth, lPgHeight )); diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index d918df4b3a37..64564cb39c9b 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -895,7 +895,7 @@ void SwDocShell::SetVisArea( const tools::Rectangle &rRect ) { Size aSz( m_pView->GetDocSz() ); aSz.AdjustWidth(DOCUMENTBORDER ); aSz.AdjustHeight(DOCUMENTBORDER ); - long nMoveX = 0, nMoveY = 0; + tools::Long nMoveX = 0, nMoveY = 0; if ( aRect.Right() > aSz.Width() ) nMoveX = aSz.Width() - aRect.Right(); if ( aRect.Bottom() > aSz.Height() ) diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 479eed290aad..a2342c9f3d0e 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -609,7 +609,7 @@ void SwDocShell::Execute(SfxRequest& rReq) nFlags = aNewFileDlg.GetTemplateFlags(); rReq.AppendItem( SfxStringItem( SID_TEMPLATE_NAME, aFileName ) ); - rReq.AppendItem( SfxInt32Item( SID_TEMPLATE_LOAD, static_cast<long>(nFlags) ) ); + rReq.AppendItem( SfxInt32Item( SID_TEMPLATE_LOAD, static_cast<tools::Long>(nFlags) ) ); } if( !aFileName.isEmpty() ) diff --git a/sw/source/uibase/app/mainwn.cxx b/sw/source/uibase/app/mainwn.cxx index df4d9a908d63..dbb6da6e405e 100644 --- a/sw/source/uibase/app/mainwn.cxx +++ b/sw/source/uibase/app/mainwn.cxx @@ -29,7 +29,7 @@ namespace { struct SwProgress { - long nStartValue, + tools::Long nStartValue, nStartCount; SwDocShell *pDocShell; std::unique_ptr<SfxProgress> pProgress; @@ -49,7 +49,7 @@ static SwProgress *lcl_SwFindProgress( SwDocShell const *pDocShell ) return nullptr; } -void StartProgress( const char* pMessResId, long nStartValue, long nEndValue, +void StartProgress( const char* pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell ) { if( SW_MOD()->IsEmbeddedLoadSave() ) @@ -79,7 +79,7 @@ void StartProgress( const char* pMessResId, long nStartValue, long nEndValue, pProgress->nStartValue = nStartValue; } -void SetProgressState( long nPosition, SwDocShell const *pDocShell ) +void SetProgressState( tools::Long nPosition, SwDocShell const *pDocShell ) { if( pProgressContainer && !SW_MOD()->IsEmbeddedLoadSave() ) { diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index e4f398a42ac4..2026942e90ad 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -335,7 +335,7 @@ static void lcl_InitNumberFormatter(SwDSParam& rParam, uno::Reference<sdbc::XDat } } -static bool lcl_MoveAbsolute(SwDSParam* pParam, long nAbsPos) +static bool lcl_MoveAbsolute(SwDSParam* pParam, tools::Long nAbsPos) { bool bRet = false; try @@ -600,8 +600,8 @@ void SwDBManager::ImportDBEntry(SwWrtShell* pSh) OUStringBuffer sStr; uno::Sequence<OUString> aColNames = xCols->getElementNames(); const OUString* pColNames = aColNames.getConstArray(); - long nLength = aColNames.getLength(); - for(long i = 0; i < nLength; i++) + tools::Long nLength = aColNames.getLength(); + for(tools::Long i = 0; i < nLength; i++) { uno::Any aCol = xCols->getByName(pColNames[i]); uno::Reference< beans::XPropertySet > xColumnProp; @@ -1259,7 +1259,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, static_cast<CreateMonitor*>(xProgressDlg.get())->SetTotalCount(nMaxDocs); } - long nStartRow, nEndRow; + tools::Long nStartRow, nEndRow; bool bFreezedLayouts = false; // to collect temporary email files std::vector< OUString> aFilesToRemove; diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx index 45cc86b4f9b7..e53df293fda3 100644 --- a/sw/source/uibase/dialog/regionsw.cxx +++ b/sw/source/uibase/dialog/regionsw.cxx @@ -54,7 +54,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) SwRect aRect; rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); - long nWidth = aRect.Width(); + tools::Long nWidth = aRect.Width(); aSet.Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth)); // height=width for more consistent preview (analog to edit region) @@ -90,7 +90,7 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq) SwFormatCol aCol; SwRect aRect; rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); - long nWidth = aRect.Width(); + tools::Long nWidth = aRect.Width(); sal_uInt16 nCol = static_cast<const SfxUInt16Item *>(pItem)->GetValue(); if(nCol) @@ -164,7 +164,7 @@ void SwWrtShell::StartInsertRegionDialog(const SwSectionData& rSectionData) SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE>{}); SwRect aRect; CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); - long nWidth = aRect.Width(); + tools::Long nWidth = aRect.Width(); aSet.Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth)); // height=width for more consistent preview (analog to edit region) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); diff --git a/sw/source/uibase/docvw/AnchorOverlayObject.cxx b/sw/source/uibase/docvw/AnchorOverlayObject.cxx index 74ed52b93441..69c8ce3ad758 100644 --- a/sw/source/uibase/docvw/AnchorOverlayObject.cxx +++ b/sw/source/uibase/docvw/AnchorOverlayObject.cxx @@ -25,6 +25,7 @@ #include <svx/sdrpaintwindow.hxx> #include <svx/svdview.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> +#include <tools/long.hxx> #include <sw_primitivetypes2d.hxx> #include <drawinglayer/primitive2d/primitivetools2d.hxx> @@ -178,7 +179,7 @@ ImplPrimitive2DIDBlock(AnchorPrimitive, PRIMITIVE2D_ID_SWSIDEBARANCHORPRIMITIVE) /*static*/ std::unique_ptr<AnchorOverlayObject> AnchorOverlayObject::CreateAnchorOverlayObject( SwView const & rDocView, const SwRect& aAnchorRect, - long aPageBorder, + tools::Long aPageBorder, const Point& aLineStart, const Point& aLineEnd, const Color& aColorAnchor ) diff --git a/sw/source/uibase/docvw/AnchorOverlayObject.hxx b/sw/source/uibase/docvw/AnchorOverlayObject.hxx index 180d017577a8..6618f9575bd2 100644 --- a/sw/source/uibase/docvw/AnchorOverlayObject.hxx +++ b/sw/source/uibase/docvw/AnchorOverlayObject.hxx @@ -21,7 +21,7 @@ #define INCLUDED_SW_SOURCE_UIBASE_DOCVW_ANCHOROVERLAYOBJECT_HXX #include <svx/sdr/overlay/overlayobject.hxx> - +#include <tools/long.hxx> #include <basegfx/polygon/b2dpolygon.hxx> class SwView; @@ -42,7 +42,7 @@ class AnchorOverlayObject final : public sdr::overlay::OverlayObjectWithBasePosi public: static std::unique_ptr<AnchorOverlayObject> CreateAnchorOverlayObject( SwView const & rDocView, const SwRect& aAnchorRect, - long aPageBorder, + tools::Long aPageBorder, const Point& aLineStart, const Point& aLineEnd, const Color& aColorAnchor ); diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx index 663141839d00..a38cba50aa04 100644 --- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx +++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx @@ -194,14 +194,14 @@ void AnnotationMenuButton::Paint(vcl::RenderContext& rRenderContext, const tools tools::Rectangle aSymbolRect(aRect); // 25% distance to the left and right button border - const long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth() * 250) + 500) / 1000; + const tools::Long nBorderDistanceLeftAndRight = ((aSymbolRect.GetWidth() * 250) + 500) / 1000; aSymbolRect.AdjustLeft(nBorderDistanceLeftAndRight ); aSymbolRect.AdjustRight( -nBorderDistanceLeftAndRight ); // 40% distance to the top button border - const long nBorderDistanceTop = ((aSymbolRect.GetHeight() * 400) + 500) / 1000; + const tools::Long nBorderDistanceTop = ((aSymbolRect.GetHeight() * 400) + 500) / 1000; aSymbolRect.AdjustTop(nBorderDistanceTop ); // 15% distance to the bottom button border - const long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) + 500) / 1000; + const tools::Long nBorderDistanceBottom = ((aSymbolRect.GetHeight() * 150) + 500) / 1000; aSymbolRect.AdjustBottom( -nBorderDistanceBottom ); DecorationView aDecoView(&rRenderContext); aDecoView.DrawSymbol(aSymbolRect, SymbolType::SPIN_DOWN, (bHighContrast ? COL_WHITE : COL_BLACK)); diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index e252f0fed78c..4f4677971c01 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -408,8 +408,8 @@ void SwAnnotationWin::MouseButtonUp(const MouseEvent& rMouseEvent) } } -void SwAnnotationWin::SetPosSizePixelRect(long nX, long nY, long nWidth, long nHeight, - const SwRect& aAnchorRect, const long aPageBorder) +void SwAnnotationWin::SetPosSizePixelRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, + const SwRect& aAnchorRect, const tools::Long aPageBorder) { mPosSize = tools::Rectangle(Point(nX,nY),Size(nWidth,nHeight)); if (!mAnchorRect.IsEmpty() && mAnchorRect != aAnchorRect) @@ -428,7 +428,7 @@ void SwAnnotationWin::SetVirtualPosSize( const Point& aPoint, const Size& aSize) mPosSize = tools::Rectangle(aPoint,aSize); } -void SwAnnotationWin::TranslateTopPosition(const long aAmount) +void SwAnnotationWin::TranslateTopPosition(const tools::Long aAmount) { mPosSize.Move(0,aAmount); } @@ -634,21 +634,21 @@ void SwAnnotationWin::Rescale() if ( mpMetadataAuthor ) { vcl::Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetLabelFont() ); - sal_Int32 nHeight = long(aFont.GetFontHeight() * rFraction); + sal_Int32 nHeight = tools::Long(aFont.GetFontHeight() * rFraction); aFont.SetFontHeight( nHeight ); mpMetadataAuthor->SetControlFont( aFont ); } if ( mpMetadataDate ) { vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetLabelFont() ); - sal_Int32 nHeight = long(aFont.GetFontHeight() * rFraction); + sal_Int32 nHeight = tools::Long(aFont.GetFontHeight() * rFraction); aFont.SetFontHeight( nHeight ); mpMetadataDate->SetControlFont( aFont ); } if ( mpMetadataResolved ) { vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetLabelFont() ); - sal_Int32 nHeight = long(aFont.GetFontHeight() * rFraction); + sal_Int32 nHeight = tools::Long(aFont.GetFontHeight() * rFraction); aFont.SetFontHeight( nHeight ); mpMetadataResolved->SetControlFont( aFont ); } @@ -890,8 +890,8 @@ void SwAnnotationWin::SetPosAndSize() void SwAnnotationWin::DoResize() { - long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); - long aHeight = GetSizePixel().Height(); + tools::Long aTextHeight = LogicToPixel( mpOutliner->CalcTextSize()).Height(); + tools::Long aHeight = GetSizePixel().Height(); unsigned long aWidth = GetSizePixel().Width(); aHeight -= GetMetaHeight(); @@ -959,10 +959,10 @@ void SwAnnotationWin::DoResize() const Fraction& fy( GetMapMode().GetScaleY() ); const Point aPos( mpMetadataAuthor->GetPosPixel()); - mpMenuButton->setPosSizePixel( long(aPos.X()+GetSizePixel().Width()-(METABUTTON_WIDTH+10)*fx), - long(aPos.Y()+5*fy), - long(METABUTTON_WIDTH*fx), - long(METABUTTON_HEIGHT*fy) ); + mpMenuButton->setPosSizePixel( tools::Long(aPos.X()+GetSizePixel().Width()-(METABUTTON_WIDTH+10)*fx), + tools::Long(aPos.Y()+5*fy), + tools::Long(METABUTTON_WIDTH*fx), + tools::Long(METABUTTON_HEIGHT*fy) ); } void SwAnnotationWin::SetSizePixel( const Size& rNewSize ) @@ -982,17 +982,17 @@ void SwAnnotationWin::SetScrollbar() mpVScrollbar->SetThumbPos(mpOutlinerView->GetVisArea().Top()); } -void SwAnnotationWin::ResizeIfNecessary(long aOldHeight, long aNewHeight) +void SwAnnotationWin::ResizeIfNecessary(tools::Long aOldHeight, tools::Long aNewHeight) { if (aOldHeight != aNewHeight) { //check for lower border or next note - long aBorder = mrMgr.GetNextBorder(); + tools::Long aBorder = mrMgr.GetNextBorder(); if (aBorder != -1) { if (aNewHeight > GetMinimumSizeWithoutMeta()) { - long aNewLowerValue = GetPosPixel().Y() + aNewHeight + GetMetaHeight(); + tools::Long aNewLowerValue = GetPosPixel().Y() + aNewHeight + GetMetaHeight(); if (aNewLowerValue < aBorder) SetSizePixel(Size(GetSizePixel().Width(),aNewHeight+GetMetaHeight())); else @@ -1329,7 +1329,7 @@ SwEditWin& SwAnnotationWin::EditWin() return mrView.GetEditWin(); } -long SwAnnotationWin::GetPostItTextHeight() +tools::Long SwAnnotationWin::GetPostItTextHeight() { return mpOutliner ? LogicToPixel(mpOutliner->CalcTextSize()).Height() : 0; } @@ -1396,7 +1396,7 @@ void SwAnnotationWin::UnsetActiveSidebarWin() IMPL_LINK(SwAnnotationWin, ScrollHdl, ScrollBar*, pScroll, void) { - long nDiff = GetOutlinerView()->GetEditView().GetVisArea().Top() - pScroll->GetThumbPos(); + tools::Long nDiff = GetOutlinerView()->GetEditView().GetVisArea().Top() - pScroll->GetThumbPos(); GetOutlinerView()->Scroll( 0, nDiff ); } @@ -1426,14 +1426,14 @@ sal_Int32 SwAnnotationWin::GetScrollbarWidth() const sal_Int32 SwAnnotationWin::GetMetaButtonAreaWidth() const { const Fraction& f( GetMapMode().GetScaleX() ); - return long(METABUTTON_AREA_WIDTH * f); + return tools::Long(METABUTTON_AREA_WIDTH * f); } sal_Int32 SwAnnotationWin::GetMetaHeight() const { const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY()); const int fields = GetNumFields(); - return long(fields*POSTIT_META_FIELD_HEIGHT*f); + return tools::Long(fields*POSTIT_META_FIELD_HEIGHT*f); } sal_Int32 SwAnnotationWin::GetNumFields() const @@ -1449,7 +1449,7 @@ sal_Int32 SwAnnotationWin::GetMinimumSizeWithMeta() const sal_Int32 SwAnnotationWin::GetMinimumSizeWithoutMeta() const { const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY()); - return long(POSTIT_MINIMUMSIZE_WITHOUT_META * f); + return tools::Long(POSTIT_MINIMUMSIZE_WITHOUT_META * f); } void SwAnnotationWin::SetSpellChecking() diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx index 45dfb48da60b..f9a63c449a08 100644 --- a/sw/source/uibase/docvw/HeaderFooterWin.cxx +++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx @@ -213,7 +213,7 @@ void SwHeaderFooterWin::dispose() SwFrameMenuButtonBase::dispose(); } -void SwHeaderFooterWin::SetOffset(Point aOffset, long nXLineStart, long nXLineEnd) +void SwHeaderFooterWin::SetOffset(Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd) { // Compute the text to show const SwPageDesc* pDesc = GetPageFrame()->GetPageDesc(); @@ -243,7 +243,7 @@ void SwHeaderFooterWin::SetOffset(Point aOffset, long nXLineStart, long nXLineEn Size aBoxSize (aTextPxRect.GetWidth() + BUTTON_WIDTH + TEXT_PADDING * 2, aFontMetric.GetLineHeight() + TEXT_PADDING * 2 ); - long nYFooterOff = 0; + tools::Long nYFooterOff = 0; if (!m_bIsHeader) nYFooterOff = aBoxSize.Height(); diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx index 9360ea3b7ea1..8172713fc47e 100644 --- a/sw/source/uibase/docvw/PageBreakWin.cxx +++ b/sw/source/uibase/docvw/PageBreakWin.cxx @@ -348,7 +348,7 @@ void SwPageBreakWin::UpdatePosition(const std::optional<Point>& xEvtPt) ::tools::Rectangle aBoundRect = GetEditWin()->LogicToPixel( pPageFrame->GetBoundRect(GetEditWin()).SVRect() ); ::tools::Rectangle aFrameRect = GetEditWin()->LogicToPixel( pPageFrame->getFrameArea().SVRect() ); - long nYLineOffset = ( aBoundRect.Top() + aFrameRect.Top() ) / 2; + tools::Long nYLineOffset = ( aBoundRect.Top() + aFrameRect.Top() ) / 2; if ( pPrevPage ) { ::tools::Rectangle aPrevFrameRect = GetEditWin()->LogicToPixel( pPrevPage->getFrameArea().SVRect() ); @@ -356,8 +356,8 @@ void SwPageBreakWin::UpdatePosition(const std::optional<Point>& xEvtPt) } // Get the page + sidebar coords - long nPgLeft = aFrameRect.Left(); - long nPgRight = aFrameRect.Right(); + tools::Long nPgLeft = aFrameRect.Left(); + tools::Long nPgRight = aFrameRect.Right(); unsigned long nSidebarWidth = 0; const SwPostItMgr* pPostItMngr = GetEditWin()->GetView().GetWrtShell().GetPostItMgr(); @@ -374,9 +374,9 @@ void SwPageBreakWin::UpdatePosition(const std::optional<Point>& xEvtPt) // Place the button on the left or right? ::tools::Rectangle aVisArea = GetEditWin()->LogicToPixel( GetEditWin()->GetView().GetVisArea() ); - long nLineLeft = std::max( nPgLeft, aVisArea.Left() ); - long nLineRight = std::min( nPgRight, aVisArea.Right() ); - long nBtnLeft = nLineLeft; + tools::Long nLineLeft = std::max( nPgLeft, aVisArea.Left() ); + tools::Long nLineRight = std::min( nPgRight, aVisArea.Right() ); + tools::Long nBtnLeft = nLineLeft; if ( m_xMousePt ) { diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 607d94c3e33f..4041609b56d6 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -618,7 +618,7 @@ bool SwPostItMgr::CalcRects() if (!bChange && mpWrtShell->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE)) { - long nLayoutHeight = SwPostItHelper::getLayoutHeight( mpWrtShell->GetLayout() ); + tools::Long nLayoutHeight = SwPostItHelper::getLayoutHeight( mpWrtShell->GetLayout() ); if( nLayoutHeight > mbLayoutHeight ) { if (mPages[0]->bScrollbar || HasScrollbars()) @@ -653,13 +653,13 @@ bool SwPostItMgr::HasScrollbars() const void SwPostItMgr::PreparePageContainer() { // we do not just delete the SwPostItPageItem, so offset/scrollbar is not lost - long lPageSize = mpWrtShell->GetNumPages(); - long lContainerSize = mPages.size(); + tools::Long lPageSize = mpWrtShell->GetNumPages(); + tools::Long lContainerSize = mPages.size(); if (lContainerSize < lPageSize) { mPages.reserve(lPageSize); - for (long i=0; i<lPageSize - lContainerSize;i++) + for (tools::Long i=0; i<lPageSize - lContainerSize;i++) mPages.emplace_back( new SwPostItPageItem()); } else if (lContainerSize > lPageSize) @@ -700,8 +700,8 @@ void SwPostItMgr::LayoutPostIts() { std::vector<SwAnnotationWin*> aVisiblePostItList; unsigned long lNeededHeight = 0; - long mlPageBorder = 0; - long mlPageEnd = 0; + tools::Long mlPageBorder = 0; + tools::Long mlPageEnd = 0; for (auto const& pItem : pPage->mvSidebarItems) { @@ -730,8 +730,8 @@ void SwPostItMgr::LayoutPostIts() if (pItem->mbShow) { - long Y = mpEditWin->LogicToPixel( Point(0,pItem->maLayoutInfo.mPosition.Bottom())).Y(); - long aPostItHeight = 0; + tools::Long Y = mpEditWin->LogicToPixel( Point(0,pItem->maLayoutInfo.mPosition.Bottom())).Y(); + tools::Long aPostItHeight = 0; if (!pPostIt) { pPostIt = pItem->GetSidebarWindow( mpView->GetEditWin(), @@ -796,13 +796,13 @@ void SwPostItMgr::LayoutPostIts() else if (sal_Int32 nScrollSize = GetScrollSize()) { //when we changed our zoom level, the offset value can be too big, so lets check for the largest possible zoom value - long aAvailableHeight = mpEditWin->LogicToPixel(Size(0,pPage->mPageRect.Height())).Height() - 2 * GetSidebarScrollerHeight(); - long lOffset = -1 * nScrollSize * (aVisiblePostItList.size() - aAvailableHeight / nScrollSize); + tools::Long aAvailableHeight = mpEditWin->LogicToPixel(Size(0,pPage->mPageRect.Height())).Height() - 2 * GetSidebarScrollerHeight(); + tools::Long lOffset = -1 * nScrollSize * (aVisiblePostItList.size() - aAvailableHeight / nScrollSize); if (pPage->lOffset < lOffset) pPage->lOffset = lOffset; } bUpdate = (bOldScrollbar != pPage->bScrollbar) || bUpdate; - const long aSidebarheight = pPage->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0; + const tools::Long aSidebarheight = pPage->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0; /* TODO - enlarge all notes till GetNextBorder(), as we resized to average value before @@ -946,8 +946,8 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const OSL_ENSURE ((*aItem)->mpPostIt,"BorderOverPageBorder: NULL postIt, should never happen"); if ((*aItem)->mpPostIt) { - const long aSidebarheight = mPages[aPage-1]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0; - const long aEndValue = mpEditWin->PixelToLogic(Point(0,(*aItem)->mpPostIt->GetPosPixel().Y()+(*aItem)->mpPostIt->GetSizePixel().Height())).Y(); + const tools::Long aSidebarheight = mPages[aPage-1]->bScrollbar ? mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height() : 0; + const tools::Long aEndValue = mpEditWin->PixelToLogic(Point(0,(*aItem)->mpPostIt->GetPosPixel().Y()+(*aItem)->mpPostIt->GetSizePixel().Height())).Y(); return aEndValue <= mPages[aPage-1]->mPageRect.Bottom()-aSidebarheight; } else @@ -995,7 +995,7 @@ void SwPostItMgr::PaintTile(OutputDevice& rRenderContext) } } -void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage) +void SwPostItMgr::Scroll(const tools::Long lScroll,const unsigned long aPage) { OSL_ENSURE((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value"); // do not scroll more than necessary up or down @@ -1004,7 +1004,7 @@ void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage) const bool bOldUp = ArrowEnabled(KEY_PAGEUP,aPage); const bool bOldDown = ArrowEnabled(KEY_PAGEDOWN,aPage); - const long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height(); + const tools::Long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height(); for (auto const& item : mPages[aPage-1]->mvSidebarItems) { SwAnnotationWin* pPostIt = item->mpPostIt; @@ -1053,25 +1053,25 @@ void SwPostItMgr::AutoScroll(const SwAnnotationWin* pPostIt,const unsigned long if (!mPages[aPage-1]->bScrollbar) return; - const long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height(); + const tools::Long aSidebarheight = mpEditWin->PixelToLogic(Size(0,GetSidebarScrollerHeight())).Height(); const bool bBottom = mpEditWin->PixelToLogic(Point(0,pPostIt->GetPosPixel().Y()+pPostIt->GetSizePixel().Height())).Y() <= (mPages[aPage-1]->mPageRect.Bottom()-aSidebarheight); const bool bTop = mpEditWin->PixelToLogic(Point(0,pPostIt->GetPosPixel().Y())).Y() >= (mPages[aPage-1]->mPageRect.Top()+aSidebarheight); if ( !(bBottom && bTop)) { - const long aDiff = bBottom ? mpEditWin->LogicToPixel(Point(0,mPages[aPage-1]->mPageRect.Top() + aSidebarheight)).Y() - pPostIt->GetPosPixel().Y() : + const tools::Long aDiff = bBottom ? mpEditWin->LogicToPixel(Point(0,mPages[aPage-1]->mPageRect.Top() + aSidebarheight)).Y() - pPostIt->GetPosPixel().Y() : mpEditWin->LogicToPixel(Point(0,mPages[aPage-1]->mPageRect.Bottom() - aSidebarheight)).Y() - (pPostIt->GetPosPixel().Y()+pPostIt->GetSizePixel().Height()); // this just adds the missing value to get the next a* GetScrollSize() after aDiff // e.g aDiff= 61 POSTIT_SCROLL=50 --> lScroll = 100 const auto nScrollSize = GetScrollSize(); assert(nScrollSize); - const long lScroll = bBottom ? (aDiff + ( nScrollSize - (aDiff % nScrollSize))) : (aDiff - (nScrollSize + (aDiff % nScrollSize))); + const tools::Long lScroll = bBottom ? (aDiff + ( nScrollSize - (aDiff % nScrollSize))) : (aDiff - (nScrollSize + (aDiff % nScrollSize))); Scroll(lScroll, aPage); } } void SwPostItMgr::MakeVisible(const SwAnnotationWin* pPostIt ) { - long aPage = -1; + tools::Long aPage = -1; // we don't know the page yet, lets find it ourselves std::vector<SwPostItPageItem*>::size_type n=0; for (auto const& page : mPages) @@ -1124,7 +1124,7 @@ Color SwPostItMgr::GetArrowColor(sal_uInt16 aDirection,unsigned long aPage) cons } } -bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList, const tools::Rectangle& rBorder, long lNeededHeight) +bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList, const tools::Rectangle& rBorder, tools::Long lNeededHeight) { /*** General layout idea:***/ // - if we have space left, we always move the current one up, @@ -1134,18 +1134,18 @@ bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList //rBorder is the page rect const tools::Rectangle aBorder = mpEditWin->LogicToPixel(rBorder); - long lTopBorder = aBorder.Top() + 5; - long lBottomBorder = aBorder.Bottom() - 5; - const long lVisibleHeight = lBottomBorder - lTopBorder; //aBorder.GetHeight() ; + tools::Long lTopBorder = aBorder.Top() + 5; + tools::Long lBottomBorder = aBorder.Bottom() - 5; + const tools::Long lVisibleHeight = lBottomBorder - lTopBorder; //aBorder.GetHeight() ; const size_t nPostItListSize = aVisiblePostItList.size(); - long lTranslatePos = 0; + tools::Long lTranslatePos = 0; bool bScrollbars = false; // do all necessary resizings if (nPostItListSize > 0 && lVisibleHeight < lNeededHeight) { // ok, now we have to really resize and adding scrollbars - const long lAverageHeight = (lVisibleHeight - nPostItListSize*GetSpaceBetween()) / nPostItListSize; + const tools::Long lAverageHeight = (lVisibleHeight - nPostItListSize*GetSpaceBetween()) / nPostItListSize; if (lAverageHeight<GetMinimumSizeWithMeta()) { bScrollbars = true; @@ -1174,7 +1174,7 @@ bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList { loop++; bDone = true; - long lSpaceUsed = lTopBorder + GetSpaceBetween(); + tools::Long lSpaceUsed = lTopBorder + GetSpaceBetween(); for(auto i = aVisiblePostItList.begin(); i != aVisiblePostItList.end() ; ++i) { auto aNextPostIt = i; @@ -1202,7 +1202,7 @@ bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList } else { - long lMoveUp = (*i)->VirtualPos().Y() - lTopBorder; + tools::Long lMoveUp = (*i)->VirtualPos().Y() - lTopBorder; (*i)->TranslateTopPosition(-1* lMoveUp); if ((*aNextPostIt)->IsFollow()) (*aNextPostIt)->TranslateTopPosition( (lTranslatePos+ANCHORLINE_WIDTH) - lMoveUp); @@ -1224,7 +1224,7 @@ bool SwPostItMgr::LayoutByPage(std::vector<SwAnnotationWin*> &aVisiblePostItList // the first one could overlap the topborder instead of a second note if (i==aVisiblePostItList.begin()) { - long lMoveDown = lTopBorder - (*i)->VirtualPos().Y(); + tools::Long lMoveDown = lTopBorder - (*i)->VirtualPos().Y(); if (lMoveDown>0) { bDone = false; @@ -1824,7 +1824,7 @@ SwAnnotationWin* SwPostItMgr::GetNextPostIt( sal_uInt16 aDirection, return nullptr; } -long SwPostItMgr::GetNextBorder() +tools::Long SwPostItMgr::GetNextBorder() { for (auto const& pPage : mPages) { @@ -2025,7 +2025,7 @@ bool SwPostItMgr::ScrollbarHit(const unsigned long aPage,const Point &aPoint) if (aRectBottom.IsInside(aPoint)) { - if (aPoint.X() < long((aPointBottom.X() + GetSidebarWidth()/3))) + if (aPoint.X() < tools::Long((aPointBottom.X() + GetSidebarWidth()/3))) Scroll( GetScrollSize(),aPage); else Scroll( -1*GetScrollSize(), aPage); @@ -2033,7 +2033,7 @@ bool SwPostItMgr::ScrollbarHit(const unsigned long aPage,const Point &aPoint) } else if (aRectTop.IsInside(aPoint)) { - if (aPoint.X() < long((aPointTop.X() + GetSidebarWidth()/3*2))) + if (aPoint.X() < tools::Long((aPointTop.X() + GetSidebarWidth()/3*2))) Scroll(GetScrollSize(), aPage); else Scroll(-1*GetScrollSize(), aPage); @@ -2062,17 +2062,17 @@ void SwPostItMgr::CorrectPositions() // yeah, I know, if this is a left page it could be wrong, but finding the page and the note is probably not even faster than just doing it // check, if anchor overlay object exists. - const long aAnchorX = pFirstPostIt->Anchor() - ? mpEditWin->LogicToPixel( Point(static_cast<long>(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X() + const tools::Long aAnchorX = pFirstPostIt->Anchor() + ? mpEditWin->LogicToPixel( Point(static_cast<tools::Long>(pFirstPostIt->Anchor()->GetSixthPosition().getX()),0)).X() : 0; - const long aAnchorY = pFirstPostIt->Anchor() - ? mpEditWin->LogicToPixel( Point(0,static_cast<long>(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1 + const tools::Long aAnchorY = pFirstPostIt->Anchor() + ? mpEditWin->LogicToPixel( Point(0,static_cast<tools::Long>(pFirstPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1 : 0; if (Point(aAnchorX,aAnchorY) == pFirstPostIt->GetPosPixel()) return; - long aAnchorPosX = 0; - long aAnchorPosY = 0; + tools::Long aAnchorPosX = 0; + tools::Long aAnchorPosY = 0; for (const std::unique_ptr<SwPostItPageItem>& pPage : mPages) { for (auto const& item : pPage->mvSidebarItems) @@ -2081,9 +2081,9 @@ void SwPostItMgr::CorrectPositions() if ( item->mbShow && item->mpPostIt && item->mpPostIt->Anchor() ) { aAnchorPosX = pPage->eSidebarPosition == sw::sidebarwindows::SidebarPosition::LEFT - ? mpEditWin->LogicToPixel( Point(static_cast<long>(item->mpPostIt->Anchor()->GetSeventhPosition().getX()),0)).X() - : mpEditWin->LogicToPixel( Point(static_cast<long>(item->mpPostIt->Anchor()->GetSixthPosition().getX()),0)).X(); - aAnchorPosY = mpEditWin->LogicToPixel( Point(0,static_cast<long>(item->mpPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1; + ? mpEditWin->LogicToPixel( Point(static_cast<tools::Long>(item->mpPostIt->Anchor()->GetSeventhPosition().getX()),0)).X() + : mpEditWin->LogicToPixel( Point(static_cast<tools::Long>(item->mpPostIt->Anchor()->GetSixthPosition().getX()),0)).X(); + aAnchorPosY = mpEditWin->LogicToPixel( Point(0,static_cast<tools::Long>(item->mpPostIt->Anchor()->GetSixthPosition().getY()))).Y() + 1; item->mpPostIt->SetPosPixel(Point(aAnchorPosX,aAnchorPosY)); } } @@ -2120,7 +2120,7 @@ unsigned long SwPostItMgr::GetSidebarWidth(bool bPx) const if (bEnableMapMode) // The output device is the window. mpWrtShell->GetOut()->EnableMapMode(); - long nRet = mpWrtShell->GetOut()->PixelToLogic(Size(aWidth, 0)).Width(); + tools::Long nRet = mpWrtShell->GetOut()->PixelToLogic(Size(aWidth, 0)).Width(); if (bEnableMapMode) mpWrtShell->GetOut()->EnableMapMode(false); return nRet; diff --git a/sw/source/uibase/docvw/SidebarTxtControl.cxx b/sw/source/uibase/docvw/SidebarTxtControl.cxx index b1f4f8879f23..c33e07e999e1 100644 --- a/sw/source/uibase/docvw/SidebarTxtControl.cxx +++ b/sw/source/uibase/docvw/SidebarTxtControl.cxx @@ -253,7 +253,7 @@ void SidebarTextControl::KeyInput( const KeyEvent& rKeyEvt ) if (comphelper::LibreOfficeKit::isActive()) SetMapMode(oldMapMode); - long aOldHeight = mrSidebarWin.GetPostItTextHeight(); + tools::Long aOldHeight = mrSidebarWin.GetPostItTextHeight(); bool bDone = false; /// HACK: need to switch off processing of Undo/Redo in Outliner diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 08bc94f91ca1..f28599ccf030 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -170,8 +170,8 @@ static SdrHdlKind g_eSdrMoveHdl = SdrHdlKind::User; QuickHelpData* SwEditWin::m_pQuickHlpData = nullptr; -long SwEditWin::m_nDDStartPosY = 0; -long SwEditWin::m_nDDStartPosX = 0; +tools::Long SwEditWin::m_nDDStartPosY = 0; +tools::Long SwEditWin::m_nDDStartPosX = 0; static SfxShell* lcl_GetTextShellFromDispatcher( SwView const & rView ); @@ -681,11 +681,11 @@ void SwEditWin::JustifyAreaTimer() { const tools::Rectangle &rVisArea = GetView().GetVisArea(); #ifdef UNX - const long coMinLen = 100; + const tools::Long coMinLen = 100; #else const long coMinLen = 50; #endif - long const nTimeout = 800, + tools::Long const nTimeout = 800, nDiff = std::max( std::max( m_aMovePos.Y() - rVisArea.Bottom(), rVisArea.Top() - m_aMovePos.Y() ), std::max( m_aMovePos.X() - rVisArea.Right(), rVisArea.Left() - m_aMovePos.X())); @@ -760,7 +760,7 @@ bool SwEditWin::IsInputSequenceCheckingRequired( const OUString &rText, const Sw SwBreakIt *pBreakIter = SwBreakIt::Get(); uno::Reference < i18n::XBreakIterator > xBI = pBreakIter->GetBreakIter(); assert(xBI.is()); - long nCTLScriptPos = -1; + tools::Long nCTLScriptPos = -1; if (xBI->getScriptType( rText, 0 ) == i18n::ScriptType::COMPLEX) nCTLScriptPos = 0; @@ -1076,10 +1076,10 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb ) pToCharContentPos, bFollowTextFlow, false, &aRefPoint ); } - long nLeft = std::min( aTmp.Left() - aBoundRect.Left(), aSnap.Width() ); - long nRight = std::min( aBoundRect.Right() - aTmp.Right(), aSnap.Width() ); - long nUp = std::min( aTmp.Top() - aBoundRect.Top(), aSnap.Height() ); - long nDown = std::min( aBoundRect.Bottom() - aTmp.Bottom(), aSnap.Height() ); + tools::Long nLeft = std::min( aTmp.Left() - aBoundRect.Left(), aSnap.Width() ); + tools::Long nRight = std::min( aBoundRect.Right() - aTmp.Right(), aSnap.Width() ); + tools::Long nUp = std::min( aTmp.Top() - aBoundRect.Top(), aSnap.Height() ); + tools::Long nDown = std::min( aBoundRect.Bottom() - aTmp.Bottom(), aSnap.Height() ); switch ( nDir ) { @@ -1116,7 +1116,7 @@ void SwEditWin::ChangeFly( sal_uInt8 nDir, bool bWeb ) bool bSet = false; if ((RndStdIds::FLY_AS_CHAR == eAnchorId) && ( nDir % 2 )) { - long aDiff = aTmp.Top() - aRefPoint.Y(); + tools::Long aDiff = aTmp.Top() - aRefPoint.Y(); if( aDiff > 0 ) aDiff = 0; else if ( aDiff < -aTmp.Height() ) @@ -1205,8 +1205,8 @@ void SwEditWin::ChangeDrawing( sal_uInt8 nDir ) SwWrtShell &rSh = m_rView.GetWrtShell(); rSh.StartUndo(); - long nX = 0; - long nY = 0; + tools::Long nX = 0; + tools::Long nY = 0; const bool bOnePixel( MOVE_LEFT_SMALL == nDir || MOVE_UP_SMALL == nDir || @@ -5790,7 +5790,7 @@ void SwEditWin::SelectMenuPosition(SwWrtShell& rSh, const Point& rMousePos ) { aEEPos -= rOutputArea.TopRight(); //invert the horizontal direction and exchange X and Y - long nTemp = -aEEPos.X(); + tools::Long nTemp = -aEEPos.X(); aEEPos.setX( aEEPos.Y() ); aEEPos.setY( nTemp ); } diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 064ddee8de01..5ee7e763fcb9 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -86,8 +86,8 @@ static OUString lcl_GetRedlineHelp( const SwRangeRedline& rRedl, bool bBalloon ) OUString SwEditWin::ClipLongToolTip(const OUString& rText) { OUString sDisplayText(rText); - long nTextWidth = GetTextWidth(sDisplayText); - long nMaxWidth = GetDesktopRectPixel().GetWidth() * 2 / 3; + tools::Long nTextWidth = GetTextWidth(sDisplayText); + tools::Long nMaxWidth = GetDesktopRectPixel().GetWidth() * 2 / 3; nMaxWidth = PixelToLogic(Size(nMaxWidth, 0)).Width(); if (nTextWidth > nMaxWidth) sDisplayText = GetEllipsisString(sDisplayText, nMaxWidth, DrawTextFlags::CenterEllipsis); diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index d103de0b74f4..33f7a33435d1 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -323,10 +323,10 @@ void SwSrcEditWindow::Resize() if ( !m_pTextView ) return; - long nVisY = m_pTextView->GetStartDocPos().Y(); + tools::Long nVisY = m_pTextView->GetStartDocPos().Y(); m_pTextView->ShowCursor(); Size aOutSz( GetOutputSizePixel() ); - long nMaxVisAreaStart = m_pTextView->GetTextEngine()->GetTextHeight() - aOutSz.Height(); + tools::Long nMaxVisAreaStart = m_pTextView->GetTextEngine()->GetTextHeight() - aOutSz.Height(); if ( nMaxVisAreaStart < 0 ) nMaxVisAreaStart = 0; if ( m_pTextView->GetStartDocPos().Y() > nMaxVisAreaStart ) @@ -336,7 +336,7 @@ void SwSrcEditWindow::Resize() m_pTextView->SetStartDocPos( aStartDocPos ); m_pTextView->ShowCursor(); } - long nScrollStd = GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long nScrollStd = GetSettings().GetStyleSettings().GetScrollBarSize(); Size aScrollSz(aOutSz.Width() - nScrollStd, nScrollStd ); Point aScrollPos(0, aOutSz.Height() - nScrollStd); @@ -570,14 +570,14 @@ IMPL_LINK(SwSrcEditWindow, ScrollHdl, ScrollBar*, pScroll, void) { if(pScroll == m_pVScrollbar) { - long nDiff = m_pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos(); + tools::Long nDiff = m_pTextView->GetStartDocPos().Y() - pScroll->GetThumbPos(); GetTextView()->Scroll( 0, nDiff ); m_pTextView->ShowCursor( false ); pScroll->SetThumbPos( m_pTextView->GetStartDocPos().Y() ); } else { - long nDiff = m_pTextView->GetStartDocPos().X() - pScroll->GetThumbPos(); + tools::Long nDiff = m_pTextView->GetStartDocPos().X() - pScroll->GetThumbPos(); GetTextView()->Scroll( nDiff, 0 ); m_pTextView->ShowCursor( false ); pScroll->SetThumbPos( m_pTextView->GetStartDocPos().X() ); @@ -633,7 +633,7 @@ IMPL_LINK( SwSrcEditWindow, SyntaxTimerHdl, Timer*, pIdle, void ) pIdle->Start(); // SyntaxTimerHdl is called when text changed // => good opportunity to determine text width! - long nPrevTextWidth = m_nCurTextWidth; + tools::Long nPrevTextWidth = m_nCurTextWidth; m_nCurTextWidth = m_pTextEngine->CalcTextWidth() + 25; // small tolerance if ( m_nCurTextWidth != nPrevTextWidth ) SetScrollBarRanges(); diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx index 583f5baad33b..479311332f75 100644 --- a/sw/source/uibase/frmdlg/colex.cxx +++ b/sw/source/uibase/frmdlg/colex.cxx @@ -196,8 +196,8 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr if (!nColumnCount) return; - long nL = GetLeft(); - long nR = GetRight(); + tools::Long nL = GetLeft(); + tools::Long nR = GetRight(); if (GetUsage() == SvxPageUsage::Mirror && !bSecond) { @@ -269,7 +269,7 @@ void SwColExample::DrawPage(vcl::RenderContext& rRenderContext, const Point& rOr if (pColMgr->GetLineHeightPercent() != 100) { - long nLength = !m_bVertical ? aDown.Y() - aUp.Y() : aDown.X() - aUp.X(); + tools::Long nLength = !m_bVertical ? aDown.Y() - aUp.Y() : aDown.X() - aUp.X(); nLength -= nLength * pColMgr->GetLineHeightPercent() / 100; switch (pColMgr->GetAdjust()) { @@ -369,7 +369,7 @@ void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools: rRenderContext.SetFillColor(aGrayColor); //column separator? - long nLength = aLogSize.Height() - 2 * aTL.Y(); + tools::Long nLength = aLogSize.Height() - 2 * aTL.Y(); Point aUp(aTL); Point aDown(aTL.X(), nLength); bool bLines = false; @@ -402,7 +402,7 @@ void SwColumnOnlyExample::Paint(vcl::RenderContext& rRenderContext, const tools: rRenderContext.DrawRect(aRect); rRenderContext.SetFillColor(rFieldColor); tools::Rectangle aFrameRect(aTL, m_aFrameSize); - long nSum = aTL.X(); + tools::Long nSum = aTL.X(); for (sal_uInt16 i = 0; i < nColCount; i++) { const SwColumn* pCol = &rCols[i]; @@ -430,22 +430,22 @@ void SwColumnOnlyExample::SetColumns(const SwFormatCol& rCol) { m_aCols = rCol; sal_uInt16 nWishSum = m_aCols.GetWishWidth(); - long nFrameWidth = m_aFrameSize.Width(); + tools::Long nFrameWidth = m_aFrameSize.Width(); SwColumns& rCols = m_aCols.GetColumns(); sal_uInt16 nColCount = rCols.size(); for(sal_uInt16 i = 0; i < nColCount; i++) { SwColumn* pCol = &rCols[i]; - long nWish = pCol->GetWishWidth(); + tools::Long nWish = pCol->GetWishWidth(); nWish *= nFrameWidth; nWish /= nWishSum; pCol->SetWishWidth(static_cast<sal_uInt16>(nWish)); - long nLeft = pCol->GetLeft(); + tools::Long nLeft = pCol->GetLeft(); nLeft *= nFrameWidth; nLeft /= nWishSum; pCol->SetLeft(static_cast<sal_uInt16>(nLeft)); - long nRight = pCol->GetRight(); + tools::Long nRight = pCol->GetRight(); nRight *= nFrameWidth; nRight /= nWishSum; pCol->SetRight(static_cast<sal_uInt16>(nRight)); @@ -511,8 +511,8 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point aLineColor.Invert(); } rRenderContext.SetLineColor(aLineColor); - long nL = GetLeft(); - long nR = GetRight(); + tools::Long nL = GetLeft(); + tools::Long nR = GetRight(); if (GetUsage() == SvxPageUsage::Mirror && !bSecond) { diff --git a/sw/source/uibase/frmdlg/frmmgr.cxx b/sw/source/uibase/frmdlg/frmmgr.cxx index 146ab05384c8..35abd6baa560 100644 --- a/sw/source/uibase/frmdlg/frmmgr.cxx +++ b/sw/source/uibase/frmdlg/frmmgr.cxx @@ -279,7 +279,7 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, if ( m_bIsInVertical || m_bIsInVerticalL2R ) { Point aPos(aBoundRect.Pos()); - long nTmp = aPos.X(); + tools::Long nTmp = aPos.X(); aPos.setX( aPos.Y() ); aPos.setY( nTmp ); Size aSize(aBoundRect.SSize()); @@ -477,7 +477,7 @@ void SwFlyFrameAttrMgr::ValidateMetrics( SvxSwFrameValidation& rVal, if ( m_bIsInVertical || m_bIsInVerticalL2R ) { //restore width/height exchange - long nTmp = rVal.nWidth; + tools::Long nTmp = rVal.nWidth; rVal.nWidth = rVal.nHeight; rVal.nHeight = nTmp; } @@ -523,7 +523,7 @@ void SwFlyFrameAttrMgr::DelAttr( sal_uInt16 nId ) m_aSet.ClearItem( nId ); } -void SwFlyFrameAttrMgr::SetLRSpace( long nLeft, long nRight ) +void SwFlyFrameAttrMgr::SetLRSpace( tools::Long nLeft, tools::Long nRight ) { OSL_ENSURE( LONG_MAX != nLeft && LONG_MAX != nRight, "Which border to set?" ); @@ -535,7 +535,7 @@ void SwFlyFrameAttrMgr::SetLRSpace( long nLeft, long nRight ) m_aSet.Put( aTmp ); } -void SwFlyFrameAttrMgr::SetULSpace( long nTop, long nBottom ) +void SwFlyFrameAttrMgr::SetULSpace( tools::Long nTop, tools::Long nBottom ) { OSL_ENSURE(LONG_MAX != nTop && LONG_MAX != nBottom, "Which border to set?" ); @@ -600,7 +600,7 @@ void SwFlyFrameAttrMgr::SetRotation(sal_uInt16 nOld, sal_uInt16 nNew, const Size void SwFlyFrameAttrMgr::SetSize( const Size& rSize ) { SwFormatFrameSize aSize( GetFrameSize() ); - aSize.SetSize(Size(std::max(rSize.Width(), long(MINFLY)), std::max(rSize.Height(), long(MINFLY)))); + aSize.SetSize(Size(std::max(rSize.Width(), tools::Long(MINFLY)), std::max(rSize.Height(), tools::Long(MINFLY)))); m_aSet.Put( aSize ); } diff --git a/sw/source/uibase/inc/HeaderFooterWin.hxx b/sw/source/uibase/inc/HeaderFooterWin.hxx index dc1cee8cc0ae..b874e870e702 100644 --- a/sw/source/uibase/inc/HeaderFooterWin.hxx +++ b/sw/source/uibase/inc/HeaderFooterWin.hxx @@ -48,7 +48,7 @@ public: virtual ~SwHeaderFooterWin( ) override; virtual void dispose() override; - void SetOffset( Point aOffset, long nXLineStart, long nXLineEnd ); + void SetOffset( Point aOffset, tools::Long nXLineStart, tools::Long nXLineEnd ); virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; diff --git a/sw/source/uibase/inc/autoformatpreview.hxx b/sw/source/uibase/inc/autoformatpreview.hxx index a5f41e4d9248..8617e35e02f8 100644 --- a/sw/source/uibase/inc/autoformatpreview.hxx +++ b/sw/source/uibase/inc/autoformatpreview.hxx @@ -46,10 +46,10 @@ private: bool mbFitWidth; bool mbRTL; Size maPreviousSize; - long mnLabelColumnWidth; - long mnDataColumnWidth1; - long mnDataColumnWidth2; - long mnRowHeight; + tools::Long mnLabelColumnWidth; + tools::Long mnDataColumnWidth1; + tools::Long mnDataColumnWidth2; + tools::Long mnRowHeight; const OUString maStringJan; const OUString maStringFeb; const OUString maStringMar; diff --git a/sw/source/uibase/inc/column.hxx b/sw/source/uibase/inc/column.hxx index 1b799c1c2c90..fd3e391e639d 100644 --- a/sw/source/uibase/inc/column.hxx +++ b/sw/source/uibase/inc/column.hxx @@ -43,9 +43,9 @@ class SwColumnDlg : public SfxDialogController std::unique_ptr<SfxItemSet> m_pSelectionSet; SfxItemSet* m_pFrameSet; - long m_nOldSelection; - long m_nSelectionWidth; - long m_nPageWidth; + tools::Long m_nOldSelection; + tools::Long m_nSelectionWidth; + tools::Long m_nPageWidth; bool m_bPageChanged : 1; bool m_bSectionChanged : 1; @@ -88,8 +88,8 @@ class SwColumnPage : public SfxTabPage sal_uInt16 m_nFirstVis; sal_uInt16 m_nCols; - long m_nColWidth[nMaxCols]; - long m_nColDist[nMaxCols]; + tools::Long m_nColWidth[nMaxCols]; + tools::Long m_nColDist[nMaxCols]; SwPercentField* m_pModifiedField; std::map<weld::MetricSpinButton*, SwPercentField*> m_aPercentFieldsMap; @@ -178,7 +178,7 @@ public: virtual void Reset(const SfxItemSet *rSet) override; void SetFrameMode(bool bMod); - void SetPageWidth(long nPageWidth); + void SetPageWidth(tools::Long nPageWidth); void SetFormatUsed(bool bFormatUsed) { diff --git a/sw/source/uibase/inc/content.hxx b/sw/source/uibase/inc/content.hxx index 414db7068dcb..05a02a095b90 100644 --- a/sw/source/uibase/inc/content.hxx +++ b/sw/source/uibase/inc/content.hxx @@ -44,7 +44,7 @@ class SwOutlineContent : public SwContent SwOutlineNodes::size_type nArrPos, sal_uInt8 nLevel, bool bMove, - long nYPos) : + tools::Long nYPos) : SwContent(pCnt, rName, nYPos), nOutlinePos(nArrPos), nOutlineLevel(nLevel), bIsMoveable(bMove) {} @@ -62,7 +62,7 @@ class SwRegionContent : public SwContent SwRegionContent( const SwContentType* pCnt, const OUString& rName, sal_uInt8 nLevel, - long nYPos) : + tools::Long nYPos) : SwContent(pCnt, rName, nYPos), nRegionLevel(nLevel){} sal_uInt8 GetRegionLevel() const {return nRegionLevel;} @@ -78,7 +78,7 @@ public: const OUString& rName, const OUString& rURL, const SwTextINetFormat* pAttr, - long nYPos ) + tools::Long nYPos ) : SwContent( pCnt, rName, nYPos ), sURL( rURL ), pINetAttr( pAttr ) {} @@ -94,7 +94,7 @@ public: SwPostItContent( const SwContentType* pCnt, const OUString& rName, const SwFormatField* pFormatField, - long nYPos ) + tools::Long nYPos ) : SwContent(pCnt, rName, nYPos) , pField(pFormatField) {} @@ -107,7 +107,7 @@ class SwGraphicContent : public SwContent { OUString sLink; public: - SwGraphicContent(const SwContentType* pCnt, const OUString& rName, const OUString& rLink, long nYPos) + SwGraphicContent(const SwContentType* pCnt, const OUString& rName, const OUString& rLink, tools::Long nYPos) : SwContent( pCnt, rName, nYPos ), sLink( rLink ) {} virtual ~SwGraphicContent() override; @@ -119,7 +119,7 @@ class SwTOXBaseContent : public SwContent { const SwTOXBase* pBase; public: - SwTOXBaseContent(const SwContentType* pCnt, const OUString& rName, long nYPos, const SwTOXBase& rBase) + SwTOXBaseContent(const SwContentType* pCnt, const OUString& rName, tools::Long nYPos, const SwTOXBase& rBase) : SwContent( pCnt, rName, nYPos ), pBase(&rBase) {} virtual ~SwTOXBaseContent() override; diff --git a/sw/source/uibase/inc/drpcps.hxx b/sw/source/uibase/inc/drpcps.hxx index 2ff081427d31..39479738cde8 100644 --- a/sw/source/uibase/inc/drpcps.hxx +++ b/sw/source/uibase/inc/drpcps.hxx @@ -44,9 +44,9 @@ class SwDropCapsPict : public weld::CustomWidgetController Color maBackColor; Color maTextLineColor; sal_uInt8 mnLines; - long mnTotLineH; - long mnLineH; - long mnTextH; + tools::Long mnTotLineH; + tools::Long mnLineH; + tools::Long mnTextH; sal_uInt16 mnDistance; VclPtr<Printer> mpPrinter; bool mbDelPrinter; diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index 9406b75803fd..ec8994cf791e 100644 --- a/sw/source/uibase/inc/edtwin.hxx +++ b/sw/source/uibase/inc/edtwin.hxx @@ -60,8 +60,8 @@ class SW_DLLPUBLIC SwEditWin final : public vcl::Window, { static QuickHelpData* m_pQuickHlpData; - static long m_nDDStartPosX; - static long m_nDDStartPosY; + static tools::Long m_nDDStartPosX; + static tools::Long m_nDDStartPosY; Color m_aWaterCanTextColor; // text color; for the watering can Color m_aWaterCanTextBackColor; // text background; for the watering can @@ -245,8 +245,8 @@ public: virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override; - static long GetDDStartPosX() { return m_nDDStartPosX; } - static long GetDDStartPosY() { return m_nDDStartPosY; } + static tools::Long GetDDStartPosX() { return m_nDDStartPosX; } + static tools::Long GetDDStartPosY() { return m_nDDStartPosY; } static void InitStaticData(); static void FinitStaticData(); diff --git a/sw/source/uibase/inc/frmmgr.hxx b/sw/source/uibase/inc/frmmgr.hxx index 8cd1ee303a06..fc038f96d77d 100644 --- a/sw/source/uibase/inc/frmmgr.hxx +++ b/sw/source/uibase/inc/frmmgr.hxx @@ -96,10 +96,10 @@ public: void SetRotation(sal_uInt16 nOld, sal_uInt16 nNew, const Size& rUnrotatedSize); // space to content - void SetLRSpace( long nLeft, - long nRight ); - void SetULSpace( long nTop, - long nBottom ); + void SetLRSpace( tools::Long nLeft, + tools::Long nRight ); + void SetULSpace( tools::Long nTop, + tools::Long nBottom ); void SetCol( const SwFormatCol &rCol); @@ -131,8 +131,8 @@ public: inline const SvxBoxItem &GetBox() const; inline const SwFormatFrameSize &GetFrameSize() const; - long CalcWidthBorder() { return CalcLeftSpace()+CalcRightSpace(); } - long CalcHeightBorder() { return CalcTopSpace()+CalcBottomSpace(); } + tools::Long CalcWidthBorder() { return CalcLeftSpace()+CalcRightSpace(); } + tools::Long CalcHeightBorder() { return CalcTopSpace()+CalcBottomSpace(); } }; inline const Size& SwFlyFrameAttrMgr::GetSize() const diff --git a/sw/source/uibase/inc/frmpage.hxx b/sw/source/uibase/inc/frmpage.hxx index 6aba31a44348..077e088b0bc2 100644 --- a/sw/source/uibase/inc/frmpage.hxx +++ b/sw/source/uibase/inc/frmpage.hxx @@ -133,7 +133,7 @@ class SwFramePage: public SfxTabPage DECL_LINK(RelHdl, weld::ComboBox&, void); void InitPos(RndStdIds eId, sal_Int16 nH, sal_Int16 nHRel, sal_Int16 nV, sal_Int16 nVRel, - long nX, long nY); + tools::Long nX, tools::Long nY); DECL_LINK(RealSizeHdl, weld::Button&, void); DECL_LINK(RelSizeClickHdl, weld::ToggleButton&, void); diff --git a/sw/source/uibase/inc/labrec.hxx b/sw/source/uibase/inc/labrec.hxx index 1810ff476dba..3a32734e4a5e 100644 --- a/sw/source/uibase/inc/labrec.hxx +++ b/sw/source/uibase/inc/labrec.hxx @@ -37,14 +37,14 @@ public: OUString m_aMake; OUString m_aType; - long m_nHDist; - long m_nVDist; - long m_nWidth; - long m_nHeight; - long m_nLeft; - long m_nUpper; - long m_nPWidth; - long m_nPHeight; + tools::Long m_nHDist; + tools::Long m_nVDist; + tools::Long m_nWidth; + tools::Long m_nHeight; + tools::Long m_nLeft; + tools::Long m_nUpper; + tools::Long m_nPWidth; + tools::Long m_nPHeight; sal_Int32 m_nCols; sal_Int32 m_nRows; bool m_bCont; diff --git a/sw/source/uibase/inc/mmconfigitem.hxx b/sw/source/uibase/inc/mmconfigitem.hxx index bae35cfdcb14..62e30dd67ba7 100644 --- a/sw/source/uibase/inc/mmconfigitem.hxx +++ b/sw/source/uibase/inc/mmconfigitem.hxx @@ -22,6 +22,7 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Reference.hxx> #include <com/sun/star/view/XSelectionChangeListener.hpp> +#include <tools/long.hxx> #include <memory> #include <set> #include <vector> @@ -46,7 +47,7 @@ namespace sw::mark { class IMark; } struct SwDocMergeInfo { sw::mark::IMark* startPageInTarget; - long nDBRow; + tools::Long nDBRow; }; class SW_DLLPUBLIC SwMailMergeConfigItem diff --git a/sw/source/uibase/inc/navicont.hxx b/sw/source/uibase/inc/navicont.hxx index b6842ad91b6a..b5e02ce75f77 100644 --- a/sw/source/uibase/inc/navicont.hxx +++ b/sw/source/uibase/inc/navicont.hxx @@ -35,7 +35,7 @@ class NaviContentBookmark { OUString aUrl; // URL including jump mark OUString aDescr; // description - long nDocSh; // address of DocShell + tools::Long nDocSh; // address of DocShell RegionMode nDefDrag; // description contains defaultDragType public: diff --git a/sw/source/uibase/inc/numprevw.hxx b/sw/source/uibase/inc/numprevw.hxx index a5510a6d454f..af86246d6a46 100644 --- a/sw/source/uibase/inc/numprevw.hxx +++ b/sw/source/uibase/inc/numprevw.hxx @@ -29,7 +29,7 @@ class NumberingPreview : public weld::CustomWidgetController { const SwNumRule* pActNum; vcl::Font aStdFont; - long nPageWidth; + tools::Long nPageWidth; const OUString* pOutlineNames; bool bPosition; sal_uInt16 nActLevel; @@ -53,7 +53,7 @@ public: Invalidate(); } - void SetPageWidth(long nPgWidth) + void SetPageWidth(tools::Long nPgWidth) {nPageWidth = nPgWidth;} void SetOutlineNames(const OUString* pNames) {pOutlineNames = pNames;} diff --git a/sw/source/uibase/inc/pgfnote.hxx b/sw/source/uibase/inc/pgfnote.hxx index c174aee48b01..36f2bdfb4ea0 100644 --- a/sw/source/uibase/inc/pgfnote.hxx +++ b/sw/source/uibase/inc/pgfnote.hxx @@ -40,7 +40,7 @@ public: private: - long lMaxHeight; + tools::Long lMaxHeight; std::unique_ptr<weld::RadioButton> m_xMaxHeightPageBtn; std::unique_ptr<weld::RadioButton> m_xMaxHeightBtn; diff --git a/sw/source/uibase/inc/pview.hxx b/sw/source/uibase/inc/pview.hxx index 38f743f9c71c..6a2c898069f0 100644 --- a/sw/source/uibase/inc/pview.hxx +++ b/sw/source/uibase/inc/pview.hxx @@ -141,7 +141,7 @@ public: return maPaintedPreviewDocRect; } - void Scroll(long nXMove, long nYMove, ScrollFlags nFlags = ScrollFlags::NONE) override; + void Scroll(tools::Long nXMove, tools::Long nYMove, ScrollFlags nFlags = ScrollFlags::NONE) override; /** Method to enable/disable book preview @param _bBookPreview diff --git a/sw/source/uibase/inc/shdwcrsr.hxx b/sw/source/uibase/inc/shdwcrsr.hxx index 2bd51c69ced3..9c516f47405e 100644 --- a/sw/source/uibase/inc/shdwcrsr.hxx +++ b/sw/source/uibase/inc/shdwcrsr.hxx @@ -30,18 +30,18 @@ class SwShadowCursor VclPtr<vcl::Window> pWin; Color aCol; Point aOldPt; - long nOldHeight; + tools::Long nOldHeight; sal_uInt16 nOldMode; - void DrawTri( const Point& rPt, long nHeight, bool bLeft ); - void DrawCursor( const Point& rPt, long nHeight, sal_uInt16 nMode ); + void DrawTri( const Point& rPt, tools::Long nHeight, bool bLeft ); + void DrawCursor( const Point& rPt, tools::Long nHeight, sal_uInt16 nMode ); public: SwShadowCursor( vcl::Window& rWin, const Color& rCol ) : pWin( &rWin ), aCol( rCol ), nOldHeight(0), nOldMode( USHRT_MAX ) {} ~SwShadowCursor(); - void SetPos( const Point& rPt, long nHeight, sal_uInt16 nMode ); + void SetPos( const Point& rPt, tools::Long nHeight, sal_uInt16 nMode ); void Paint(); diff --git a/sw/source/uibase/inc/srcedtw.hxx b/sw/source/uibase/inc/srcedtw.hxx index e48226f351b6..2cdefb908f41 100644 --- a/sw/source/uibase/inc/srcedtw.hxx +++ b/sw/source/uibase/inc/srcedtw.hxx @@ -75,7 +75,7 @@ private: css::uno::Reference< css::beans::XMultiPropertySet > m_xNotifier; - long m_nCurTextWidth; + tools::Long m_nCurTextWidth; sal_uInt16 m_nStartLine; rtl_TextEncoding m_eSourceEncoding; bool m_bReadonly; diff --git a/sw/source/uibase/inc/swcont.hxx b/sw/source/uibase/inc/swcont.hxx index 76efc6d88df2..3d9aa56e53c9 100644 --- a/sw/source/uibase/inc/swcont.hxx +++ b/sw/source/uibase/inc/swcont.hxx @@ -71,13 +71,13 @@ class SwContent : public SwTypeNumber { const SwContentType* pParent; OUString sContentName; - long nYPosition; + tools::Long nYPosition; // some subclasses appear to use this for a tools/gen.hxx-style // geometric Y position, while e.g. SwOutlineContent wants to store // the index in its subtree bool bInvisible; public: - SwContent(const SwContentType* pCnt, const OUString& rName, long nYPos ); + SwContent(const SwContentType* pCnt, const OUString& rName, tools::Long nYPos ); virtual bool IsProtect() const; const SwContentType* GetParent() const {return pParent;} diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx index 5274a5f99558..117da38f3f03 100644 --- a/sw/source/uibase/inc/swuicnttab.hxx +++ b/sw/source/uibase/inc/swuicnttab.hxx @@ -263,7 +263,7 @@ class SwTokenWindow SwTOXWidget* InsertItem(const OUString& rText, const SwFormToken& aToken); void AdjustPositions(); void AdjustScrolling(); - void MoveControls(long nOffset); + void MoveControls(tools::Long nOffset); public: SwTokenWindow(std::unique_ptr<weld::Container> xParent); diff --git a/sw/source/uibase/inc/wrtsh.hxx b/sw/source/uibase/inc/wrtsh.hxx index 1b70623ccb33..e0d8c517cda6 100644 --- a/sw/source/uibase/inc/wrtsh.hxx +++ b/sw/source/uibase/inc/wrtsh.hxx @@ -114,16 +114,16 @@ public: using SwEditShell::Insert; - long CallSetCursor(const Point* pPt, bool bProp) { return (this->*m_fnSetCursor)(pPt, bProp); } + tools::Long CallSetCursor(const Point* pPt, bool bProp) { return (this->*m_fnSetCursor)(pPt, bProp); } void Drag (const Point* pPt, bool bProp) { (this->*m_fnDrag)(pPt, bProp); } void EndDrag (const Point* pPt, bool bProp) { (this->*m_fnEndDrag)(pPt, bProp); } - long KillSelection(const Point* pPt, bool bProp) { return (this->*m_fnKillSel)(pPt, bProp); } + tools::Long KillSelection(const Point* pPt, bool bProp) { return (this->*m_fnKillSel)(pPt, bProp); } bool IsSplitVerticalByDefault() const; void SetSplitVerticalByDefault(bool value); // reset all selections - long ResetSelect( const Point *, bool ); + tools::Long ResetSelect( const Point *, bool ); // resets the cursorstack after movement with PageUp/-Down if a stack is built up inline void ResetCursorStack(); @@ -338,7 +338,7 @@ typedef bool (SwWrtShell::*FNSimpleMove)(); sal_uInt16 nSlotId = 0); // SlotId for dialog bool InsertOleObject( const svt::EmbeddedObjectRef& xObj, SwFlyFrameFormat **pFlyFrameFormat = nullptr ); - void LaunchOLEObj( long nVerb = 0 ); // start server + void LaunchOLEObj( tools::Long nVerb = 0 ); // start server virtual void MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset ) override; virtual void CalcAndSetScale( svt::EmbeddedObjectRef& xObj, const SwRect *pFlyPrtRect = nullptr, @@ -585,9 +585,9 @@ private: SAL_DLLPRIVATE void ResetCursorStack_(); using SwCursorShell::SetCursor; - SAL_DLLPRIVATE long SetCursor(const Point *, bool bProp=false ); + SAL_DLLPRIVATE tools::Long SetCursor(const Point *, bool bProp=false ); - SAL_DLLPRIVATE long SetCursorKillSel(const Point *, bool bProp ); + SAL_DLLPRIVATE tools::Long SetCursorKillSel(const Point *, bool bProp ); SAL_DLLPRIVATE void BeginDrag(const Point *, bool bProp ); SAL_DLLPRIVATE void DefaultDrag(const Point *, bool bProp ); @@ -603,7 +603,7 @@ private: SAL_DLLPRIVATE void SttLeaveSelect(); SAL_DLLPRIVATE void AddLeaveSelect(); - SAL_DLLPRIVATE long Ignore(const Point *, bool bProp ); + SAL_DLLPRIVATE tools::Long Ignore(const Point *, bool bProp ); SAL_DLLPRIVATE void LeaveExtSel() { m_bSelWrd = m_bSelLn = false;} diff --git a/sw/source/uibase/lingu/hhcwrp.cxx b/sw/source/uibase/lingu/hhcwrp.cxx index 2d23fa468056..23974dfa109a 100644 --- a/sw/source/uibase/lingu/hhcwrp.cxx +++ b/sw/source/uibase/lingu/hhcwrp.cxx @@ -238,7 +238,7 @@ void SwHHCWrapper::ChangeText( const OUString &rNewText, // offset to calculate the position in the text taking into // account that text may have been replaced with new text of // different length. Negative values allowed! - long nCorrectionOffset = 0; + tools::Long nCorrectionOffset = 0; OSL_ENSURE(nIndices == 0 || nIndices == nConvTextLen, "mismatch between string length and sequence length!" ); diff --git a/sw/source/uibase/misc/swruler.cxx b/sw/source/uibase/misc/swruler.cxx index fb117e8e3b95..841578834e96 100644 --- a/sw/source/uibase/misc/swruler.cxx +++ b/sw/source/uibase/misc/swruler.cxx @@ -41,8 +41,8 @@ namespace * \param Color arrow color * \param bCollapsed if the arrow should display the collapsed state */ -void ImplDrawArrow(vcl::RenderContext& rRenderContext, long nX, long nY, long nSize, - const Color& rColor, bool bCollapsed) +void ImplDrawArrow(vcl::RenderContext& rRenderContext, tools::Long nX, tools::Long nY, + tools::Long nSize, const Color& rColor, bool bCollapsed) { tools::Polygon aTrianglePolygon(4); @@ -152,8 +152,8 @@ void SwCommentRuler::DrawCommentControl(vcl::RenderContext& rRenderContext) // calculate label and arrow positions const OUString aLabel = SwResId(STR_COMMENTS_LABEL); - const long nTriangleSize = maVirDev->GetTextHeight() / 2 + 1; - const long nTrianglePad = maVirDev->GetTextHeight() / 4; + const tools::Long nTriangleSize = maVirDev->GetTextHeight() / 2 + 1; + const tools::Long nTrianglePad = maVirDev->GetTextHeight() / 4; Point aLabelPos(0, (aControlRect.GetHeight() - maVirDev->GetTextHeight()) / 2); Point aArrowPos(0, (aControlRect.GetHeight() - nTriangleSize) / 2); @@ -165,7 +165,7 @@ void SwCommentRuler::DrawCommentControl(vcl::RenderContext& rRenderContext) } else // RTL => | Comments < | { - const long nLabelWidth = maVirDev->GetTextWidth(aLabel); + const tools::Long nLabelWidth = maVirDev->GetTextWidth(aLabel); if (!bIsCollapsed) { aArrowPos.setX(aControlRect.GetWidth() - 1 - nTrianglePad - CONTROL_BORDER_WIDTH @@ -322,17 +322,17 @@ tools::Rectangle SwCommentRuler::GetCommentControlRegion() const unsigned long nSidebarWidth = pPostItMgr->GetSidebarWidth(true); //FIXME When the page width is larger then screen, the ruler is misplaced by one pixel - long nLeft = GetPageOffset(); + tools::Long nLeft = GetPageOffset(); if (GetTextRTL()) nLeft += GetBorderOffset() - nSidebarWidth; else nLeft += GetWinOffset() + mpSwWin->LogicToPixel(Size(GetPageWidth(), 0)).Width(); // Ruler::ImplDraw uses RULER_OFF (value: 3px) as offset, and Ruler::ImplFormat adds one extra pixel - long nTop = 4; + tools::Long nTop = 4; // Somehow pPostItMgr->GetSidebarBorderWidth() returns border width already doubled - long nRight = nLeft + nSidebarWidth + pPostItMgr->GetSidebarBorderWidth(true); - long nBottom = nTop + GetRulerVirHeight() - 3; + tools::Long nRight = nLeft + nSidebarWidth + pPostItMgr->GetSidebarBorderWidth(true); + tools::Long nBottom = nTop + GetRulerVirHeight() - 3; tools::Rectangle aRect(nLeft, nTop, nRight, nBottom); return aRect; diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index b84681e353f9..c5dfa9dc1366 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -110,7 +110,7 @@ SwInputWindow::SwInputWindow(vcl::Window* pParent, SfxDispatcher const * pDispat Size aSizeTbx = CalcWindowSizePixel(); Size aEditSize = mxEdit->GetSizePixel(); tools::Rectangle aItemRect( GetItemRect(FN_FORMULA_CALC) ); - long nMaxHeight = std::max(aEditSize.Height(), aItemRect.GetHeight()); + tools::Long nMaxHeight = std::max(aEditSize.Height(), aItemRect.GetHeight()); if( nMaxHeight+2 > aSizeTbx.Height() ) aSizeTbx.setHeight( nMaxHeight+2 ); Size aSize = GetSizePixel(); @@ -174,11 +174,11 @@ void SwInputWindow::Resize() { ToolBox::Resize(); - long nWidth = GetSizePixel().Width(); - long nLeft = mxEdit->GetPosPixel().X(); + tools::Long nWidth = GetSizePixel().Width(); + tools::Long nLeft = mxEdit->GetPosPixel().X(); Size aEditSize = mxEdit->GetSizePixel(); - aEditSize.setWidth( std::max( static_cast<long>(nWidth - nLeft - 5), long(0) ) ); + aEditSize.setWidth( std::max( static_cast<tools::Long>(nWidth - nLeft - 5), tools::Long(0) ) ); mxEdit->SetSizePixel( aEditSize ); } diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx index f45a9a8233ea..f4f7fc9488d1 100644 --- a/sw/source/uibase/shells/annotsh.cxx +++ b/sw/source/uibase/shells/annotsh.cxx @@ -868,7 +868,7 @@ void SwAnnotationShell::ExecClpbrd(SfxRequest const &rReq) OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView(); - long aOldHeight = pPostItMgr->GetActiveSidebarWin()->GetPostItTextHeight(); + tools::Long aOldHeight = pPostItMgr->GetActiveSidebarWin()->GetPostItTextHeight(); sal_uInt16 nSlot = rReq.GetSlot(); switch (nSlot) { @@ -1496,7 +1496,7 @@ void SwAnnotationShell::ExecUndo(SfxRequest &rReq) SwWrtShell &rSh = rView.GetWrtShell(); SwUndoId nUndoId(SwUndoId::EMPTY); - long aOldHeight = rView.GetPostItMgr()->HasActiveSidebarWin() + tools::Long aOldHeight = rView.GetPostItMgr()->HasActiveSidebarWin() ? rView.GetPostItMgr()->GetActiveSidebarWin()->GetPostItTextHeight() : 0; diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index fea15d78428a..65f95858a480 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -912,7 +912,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, if(bIsInVertical) { Point aPos(aBoundRect.Pos()); - long nTmp = aPos.X(); + tools::Long nTmp = aPos.X(); aPos.setX( aPos.Y() ); aPos.setY( nTmp ); Size aSize(aBoundRect.SSize()); @@ -1054,7 +1054,7 @@ IMPL_LINK(SwDrawBaseShell, ValidatePosition, SvxSwFrameValidation&, rValidation, if(bIsInVertical) { //restore width/height exchange - long nTmp = rValidation.nWidth; + tools::Long nTmp = rValidation.nWidth; rValidation.nWidth = rValidation.nHeight; rValidation.nHeight = nTmp; } diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 23fd983166e3..594a018828da 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -871,12 +871,12 @@ void SwTableShell::Execute(SfxRequest &rReq) ::GetTableSel( rSh, aBoxes ); if ( !aBoxes.empty() ) { - long maxX = 0; - long maxY = 0; - long minX = std::numeric_limits<long>::max(); - long minY = std::numeric_limits<long>::max(); - long nbBoxes = aBoxes.size(); - for ( long i = 0; i < nbBoxes; i++ ) + tools::Long maxX = 0; + tools::Long maxY = 0; + tools::Long minX = std::numeric_limits<long>::max(); + tools::Long minY = std::numeric_limits<long>::max(); + tools::Long nbBoxes = aBoxes.size(); + for ( tools::Long i = 0; i < nbBoxes; i++ ) { Point aCoord ( aBoxes[i]->GetCoordinates() ); if ( aCoord.X() < minX ) minX = aCoord.X(); @@ -965,7 +965,7 @@ void SwTableShell::Execute(SfxRequest &rReq) } case FN_TABLE_SPLIT_CELLS: { - long nCount=0; + tools::Long nCount=0; bool bHorizontal=true; bool bProportional = false; const SfxInt32Item* pSplit = rReq.GetArg<SfxInt32Item>(FN_TABLE_SPLIT_CELLS); @@ -982,7 +982,7 @@ void SwTableShell::Execute(SfxRequest &rReq) else { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - const long nMaxVert = rSh.GetAnyCurRect( CurRectType::Frame ).Width() / MINLAY; + const tools::Long nMaxVert = rSh.GetAnyCurRect( CurRectType::Frame ).Width() / MINLAY; ScopedVclPtr<SvxAbstractSplitTableDialog> pDlg(pFact->CreateSvxSplitTableDialog(GetView().GetFrameWeld(), rSh.IsTableVertical(), nMaxVert)); if(rSh.IsSplitVerticalByDefault()) pDlg->SetSplitVerticalByDefault(); @@ -1117,7 +1117,7 @@ void SwTableShell::Execute(SfxRequest &rReq) const SfxUInt32Item* pItem2 = rReq.GetArg<SfxUInt32Item>(SID_ATTR_TABLE_ROW_HEIGHT); if (pItem2) { - long nNewHeight = pItem2->GetValue(); + tools::Long nNewHeight = pItem2->GetValue(); std::unique_ptr<SwFormatFrameSize> pHeight = rSh.GetRowHeight(); if ( pHeight ) { @@ -1134,7 +1134,7 @@ void SwTableShell::Execute(SfxRequest &rReq) const SfxUInt32Item* pItem2 = rReq.GetArg<SfxUInt32Item>(SID_ATTR_TABLE_COLUMN_WIDTH); if (pItem2) { - long nNewWidth = pItem2->GetValue(); + tools::Long nNewWidth = pItem2->GetValue(); SwTableFUNC aFunc( &rSh ); aFunc.InitTabCols(); aFunc.SetColWidth(aFunc.GetCurColNum(), nNewWidth); @@ -1422,7 +1422,7 @@ void SwTableShell::GetState(SfxItemSet &rSet) std::unique_ptr<SwFormatFrameSize> pHeight = rSh.GetRowHeight(); if (pHeight) { - long nHeight = pHeight->GetHeight(); + tools::Long nHeight = pHeight->GetHeight(); aRowHeight.SetValue(nHeight); rSet.Put(aRowHeight); diff --git a/sw/source/uibase/shells/textidx.cxx b/sw/source/uibase/shells/textidx.cxx index 8247dbdbfbb9..b577547347e6 100644 --- a/sw/source/uibase/shells/textidx.cxx +++ b/sw/source/uibase/shells/textidx.cxx @@ -105,7 +105,7 @@ void SwTextShell::ExecIdx(SfxRequest const &rReq) SwRect aRect; rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); - long nWidth = aRect.Width(); + tools::Long nWidth = aRect.Width(); aSet.Put(SwFormatFrameSize(SwFrameSize::Variable, nWidth)); // Height = width for a more consistent preview (analogous to edit range) aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth))); diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 14844e1134c1..17550dc717f3 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -365,12 +365,12 @@ void SwTextShell::Execute(SfxRequest &rReq) { case SID_UNICODE_NOTATION_TOGGLE: { - long nMaxUnits = 256; + tools::Long nMaxUnits = 256; sal_Int32 nSelLength = rWrtSh.GetSelText().getLength(); if( rWrtSh.IsSelection() && !rWrtSh.IsMultiSelection() && (nSelLength < nMaxUnits) ) nMaxUnits = nSelLength; - long index = 0; + tools::Long index = 0; ToggleUnicodeCodepoint aToggle; while( nMaxUnits-- && aToggle.AllowMoreInput(rWrtSh.GetChar(true, index-1)) ) --index; @@ -1029,7 +1029,7 @@ void SwTextShell::Execute(SfxRequest &rReq) // Left border as offset //#i24363# tab stops relative to indent - const long nOff = rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::TABS_RELATIVE_TO_INDENT) ? + const tools::Long nOff = rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::TABS_RELATIVE_TO_INDENT) ? aCoreSet.Get( RES_LR_SPACE ).GetTextLeft() : 0; SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff ); aCoreSet.Put( aOff ); diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx b/sw/source/uibase/sidebar/PageFormatPanel.cxx index 7a13c6553fde..45019db48e9d 100644 --- a/sw/source/uibase/sidebar/PageFormatPanel.cxx +++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx @@ -347,14 +347,14 @@ FieldUnit PageFormatPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolIte return eUnit; } -void PageFormatPanel::ExecuteMarginLRChange( const long nPageLeftMargin, const long nPageRightMargin ) +void PageFormatPanel::ExecuteMarginLRChange( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin ) { mpPageLRMarginItem->SetLeft( nPageLeftMargin ); mpPageLRMarginItem->SetRight( nPageRightMargin ); mpBindings->GetDispatcher()->ExecuteList( SID_ATTR_PAGE_LRSPACE, SfxCallMode::RECORD, { mpPageLRMarginItem.get() }); } -void PageFormatPanel::ExecuteMarginULChange(const long nPageTopMargin, const long nPageBottomMargin) +void PageFormatPanel::ExecuteMarginULChange(const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin) { mpPageULMarginItem->SetUpper( nPageTopMargin ); mpPageULMarginItem->SetLower( nPageBottomMargin ); diff --git a/sw/source/uibase/sidebar/PageFormatPanel.hxx b/sw/source/uibase/sidebar/PageFormatPanel.hxx index 4ea09bb503a1..7c2a505618c8 100644 --- a/sw/source/uibase/sidebar/PageFormatPanel.hxx +++ b/sw/source/uibase/sidebar/PageFormatPanel.hxx @@ -89,17 +89,17 @@ private: FieldUnit meFUnit; MapUnit meUnit; - long mnPageLeftMargin; - long mnPageRightMargin; - long mnPageTopMargin; - long mnPageBottomMargin; + tools::Long mnPageLeftMargin; + tools::Long mnPageRightMargin; + tools::Long mnPageTopMargin; + tools::Long mnPageBottomMargin; OUString aCustomEntry; void Initialize(); void SetMarginFieldUnit(); void UpdateMarginBox(); - void ExecuteMarginLRChange( const long nPageLeftMargin, const long nPageRightMargin ); - void ExecuteMarginULChange( const long nPageTopMargin, const long nPageBottomMargin); + void ExecuteMarginLRChange( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin ); + void ExecuteMarginULChange( const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin); DECL_LINK(PaperFormatModifyHdl, weld::ComboBox&, void); DECL_LINK(PaperSizeModifyHdl, weld::MetricSpinButton&, void); DECL_LINK(PaperModifyMarginHdl, weld::ComboBox&, void ); diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx index 2ef8b200aae4..d3f2a0d91642 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.cxx +++ b/sw/source/uibase/sidebar/PageMarginControl.cxx @@ -238,16 +238,16 @@ PageMarginControl::~PageMarginControl() void PageMarginControl::SetMetricFieldMaxValues( const Size& rPageSize ) { - const long nML = m_xLeftMarginEdit->denormalize( m_xLeftMarginEdit->get_value( FieldUnit::TWIP ) ); - const long nMR = m_xRightMarginEdit->denormalize( m_xRightMarginEdit->get_value( FieldUnit::TWIP ) ); - const long nMT = m_xTopMarginEdit->denormalize( m_xTopMarginEdit->get_value( FieldUnit::TWIP ) ); - const long nMB = m_xBottomMarginEdit->denormalize( m_xBottomMarginEdit->get_value( FieldUnit::TWIP ) ); + const tools::Long nML = m_xLeftMarginEdit->denormalize( m_xLeftMarginEdit->get_value( FieldUnit::TWIP ) ); + const tools::Long nMR = m_xRightMarginEdit->denormalize( m_xRightMarginEdit->get_value( FieldUnit::TWIP ) ); + const tools::Long nMT = m_xTopMarginEdit->denormalize( m_xTopMarginEdit->get_value( FieldUnit::TWIP ) ); + const tools::Long nMB = m_xBottomMarginEdit->denormalize( m_xBottomMarginEdit->get_value( FieldUnit::TWIP ) ); - const long nPH = OutputDevice::LogicToLogic( rPageSize.Height(), m_eUnit, MapUnit::MapTwip ); - const long nPW = OutputDevice::LogicToLogic( rPageSize.Width(), m_eUnit, MapUnit::MapTwip ); + const tools::Long nPH = OutputDevice::LogicToLogic( rPageSize.Height(), m_eUnit, MapUnit::MapTwip ); + const tools::Long nPW = OutputDevice::LogicToLogic( rPageSize.Width(), m_eUnit, MapUnit::MapTwip ); // Left - long nMax = nPW - nMR - MINBODY; + tools::Long nMax = nPW - nMR - MINBODY; m_xLeftMarginEdit->set_max( m_xLeftMarginEdit->normalize( nMax ), FieldUnit::TWIP ); // Right @@ -420,8 +420,8 @@ IMPL_LINK( PageMarginControl, SelectMarginHdl, weld::Button&, rControl, void ) } void PageMarginControl::ExecuteMarginLRChange( - const long nPageLeftMargin, - const long nPageRightMargin ) + const tools::Long nPageLeftMargin, + const tools::Long nPageRightMargin ) { if ( SfxViewFrame::Current() ) { @@ -435,8 +435,8 @@ void PageMarginControl::ExecuteMarginLRChange( } void PageMarginControl::ExecuteMarginULChange( - const long nPageTopMargin, - const long nPageBottomMargin ) + const tools::Long nPageTopMargin, + const tools::Long nPageBottomMargin ) { if ( SfxViewFrame::Current() ) { diff --git a/sw/source/uibase/sidebar/PageMarginControl.hxx b/sw/source/uibase/sidebar/PageMarginControl.hxx index a702d7c8e808..88e2d0e11e97 100644 --- a/sw/source/uibase/sidebar/PageMarginControl.hxx +++ b/sw/source/uibase/sidebar/PageMarginControl.hxx @@ -28,7 +28,7 @@ #define SWPAGE_WIDE_VALUE3 1800 // #i19922# - tdf#126051 see cui/source/tabpages/page.cxx and svx/source/dialog/hdft.cxx -const long MINBODY = 56; // 1mm in twips rounded +const tools::Long MINBODY = 56; // 1mm in twips rounded class PageMarginPopup; @@ -63,10 +63,10 @@ private: rtl::Reference<PageMarginPopup> m_xControl; - long m_nPageLeftMargin; - long m_nPageRightMargin; - long m_nPageTopMargin; - long m_nPageBottomMargin; + tools::Long m_nPageLeftMargin; + tools::Long m_nPageRightMargin; + tools::Long m_nPageTopMargin; + tools::Long m_nPageBottomMargin; bool m_bMirrored; const MapUnit m_eUnit; @@ -74,10 +74,10 @@ private: Size m_aPageSize; bool m_bUserCustomValuesAvailable; - long m_nUserCustomPageLeftMargin; - long m_nUserCustomPageRightMargin; - long m_nUserCustomPageTopMargin; - long m_nUserCustomPageBottomMargin; + tools::Long m_nUserCustomPageLeftMargin; + tools::Long m_nUserCustomPageRightMargin; + tools::Long m_nUserCustomPageTopMargin; + tools::Long m_nUserCustomPageBottomMargin; bool m_bUserCustomMirrored; bool m_bCustomValuesUsed; @@ -87,11 +87,11 @@ private: DECL_LINK( ModifyULMarginHdl, weld::MetricSpinButton&, void ); static void ExecuteMarginLRChange( - const long nPageLeftMargin, - const long nPageRightMargin ); + const tools::Long nPageLeftMargin, + const tools::Long nPageRightMargin ); static void ExecuteMarginULChange( - const long nPageTopMargin, - const long nPageBottomMargin ); + const tools::Long nPageTopMargin, + const tools::Long nPageBottomMargin ); static void ExecutePageLayoutChange( const bool bMirrored ); void SetMetricFieldMaxValues(const Size& rPageSize); diff --git a/sw/source/uibase/sidebar/PageMarginUtils.hxx b/sw/source/uibase/sidebar/PageMarginUtils.hxx index 1361361a18a1..cdef6eb7e687 100644 --- a/sw/source/uibase/sidebar/PageMarginUtils.hxx +++ b/sw/source/uibase/sidebar/PageMarginUtils.hxx @@ -28,8 +28,8 @@ namespace sw::sidebar{ -bool IsNone( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored) +bool IsNone( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin, + const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored) { return( std::abs(nPageLeftMargin - SWPAGE_NO_MARGIN) <= SWPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SWPAGE_NO_MARGIN ) <= SWPAGE_UNIT_THRESHOLD && @@ -38,8 +38,8 @@ bool IsNone( const long nPageLeftMargin, const long nPageRightMargin, !bMirrored ); } -void SetNone( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored) +void SetNone( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin, + tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored) { nPageLeftMargin = SWPAGE_NO_MARGIN; nPageRightMargin = SWPAGE_NO_MARGIN; @@ -48,8 +48,8 @@ void SetNone( long& nPageLeftMargin, long& nPageRightMargin, bMirrored = false; } -bool IsNarrow( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored) +bool IsNarrow( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin, + const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored) { return( std::abs(nPageLeftMargin - SWPAGE_NARROW_VALUE) <= SWPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SWPAGE_NARROW_VALUE) <= SWPAGE_UNIT_THRESHOLD && @@ -58,8 +58,8 @@ bool IsNarrow( const long nPageLeftMargin, const long nPageRightMargin, !bMirrored ); } -void SetNarrow( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored) +void SetNarrow( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin, + tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored) { nPageLeftMargin = SWPAGE_NARROW_VALUE; nPageRightMargin = SWPAGE_NARROW_VALUE; @@ -68,8 +68,8 @@ void SetNarrow( long& nPageLeftMargin, long& nPageRightMargin, bMirrored = false; } -bool IsModerate( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored) +bool IsModerate( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin, + const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored) { return( std::abs(nPageLeftMargin - SWPAGE_MODERATE_LR) <= SWPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SWPAGE_MODERATE_LR) <= SWPAGE_UNIT_THRESHOLD && @@ -78,8 +78,8 @@ bool IsModerate( const long nPageLeftMargin, const long nPageRightMargin, !bMirrored ); } -void SetModerate( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored) +void SetModerate( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin, + tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored) { nPageLeftMargin = SWPAGE_MODERATE_LR; nPageRightMargin = SWPAGE_MODERATE_LR; @@ -88,8 +88,8 @@ void SetModerate( long& nPageLeftMargin, long& nPageRightMargin, bMirrored = false; } -bool IsNormal075( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored) +bool IsNormal075( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin, + const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored) { return( std::abs(nPageLeftMargin - SWPAGE_NORMAL_VALUE) <= SWPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SWPAGE_NORMAL_VALUE) <= SWPAGE_UNIT_THRESHOLD && @@ -98,8 +98,8 @@ bool IsNormal075( const long nPageLeftMargin, const long nPageRightMargin, !bMirrored ); } -void SetNormal075( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored) +void SetNormal075( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin, + tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored) { nPageLeftMargin = SWPAGE_NORMAL_VALUE; nPageRightMargin = SWPAGE_NORMAL_VALUE; @@ -108,8 +108,8 @@ void SetNormal075( long& nPageLeftMargin, long& nPageRightMargin, bMirrored = false; } -bool IsNormal100( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored) +bool IsNormal100( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin, + const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored) { return( std::abs(nPageLeftMargin - SWPAGE_WIDE_VALUE1) <= SWPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SWPAGE_WIDE_VALUE1) <= SWPAGE_UNIT_THRESHOLD && @@ -118,8 +118,8 @@ bool IsNormal100( const long nPageLeftMargin, const long nPageRightMargin, !bMirrored ); } -void SetNormal100( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored) +void SetNormal100( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin, + tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored) { nPageLeftMargin = SWPAGE_WIDE_VALUE1; nPageRightMargin = SWPAGE_WIDE_VALUE1; @@ -128,8 +128,8 @@ void SetNormal100( long& nPageLeftMargin, long& nPageRightMargin, bMirrored = false; } -bool IsNormal125( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored) +bool IsNormal125( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin, + const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored) { return( std::abs(nPageLeftMargin - SWPAGE_WIDE_VALUE3) <= SWPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SWPAGE_WIDE_VALUE3) <= SWPAGE_UNIT_THRESHOLD && @@ -138,8 +138,8 @@ bool IsNormal125( const long nPageLeftMargin, const long nPageRightMargin, !bMirrored ); } -void SetNormal125( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored) +void SetNormal125( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin, + tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored) { nPageLeftMargin = SWPAGE_WIDE_VALUE3; nPageRightMargin = SWPAGE_WIDE_VALUE3; @@ -148,8 +148,8 @@ void SetNormal125( long& nPageLeftMargin, long& nPageRightMargin, bMirrored = false; } -bool IsWide( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored) +bool IsWide( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin, + const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored) { return( std::abs(nPageLeftMargin - SWPAGE_WIDE_VALUE2) <= SWPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SWPAGE_WIDE_VALUE2) <= SWPAGE_UNIT_THRESHOLD && @@ -158,8 +158,8 @@ bool IsWide( const long nPageLeftMargin, const long nPageRightMargin, !bMirrored ); } -void SetWide( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored) +void SetWide( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin, + tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored) { nPageLeftMargin = SWPAGE_WIDE_VALUE2; nPageRightMargin = SWPAGE_WIDE_VALUE2; @@ -168,8 +168,8 @@ void SetWide( long& nPageLeftMargin, long& nPageRightMargin, bMirrored = false; } -bool IsMirrored( const long nPageLeftMargin, const long nPageRightMargin, - const long nPageTopMargin, const long nPageBottomMargin, bool bMirrored) +bool IsMirrored( const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin, + const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin, bool bMirrored) { return( std::abs(nPageLeftMargin - SWPAGE_WIDE_VALUE3) <= SWPAGE_UNIT_THRESHOLD && std::abs(nPageRightMargin - SWPAGE_WIDE_VALUE1) <= SWPAGE_UNIT_THRESHOLD && @@ -178,8 +178,8 @@ bool IsMirrored( const long nPageLeftMargin, const long nPageRightMargin, bMirrored ); } -void SetMirrored( long& nPageLeftMargin, long& nPageRightMargin, - long& nPageTopMargin, long& nPageBottomMargin, bool& bMirrored) +void SetMirrored( tools::Long& nPageLeftMargin, tools::Long& nPageRightMargin, + tools::Long& nPageTopMargin, tools::Long& nPageBottomMargin, bool& bMirrored) { nPageLeftMargin = SWPAGE_WIDE_VALUE3; nPageRightMargin = SWPAGE_WIDE_VALUE1; diff --git a/sw/source/uibase/sidebar/PageOrientationControl.cxx b/sw/source/uibase/sidebar/PageOrientationControl.cxx index d44dd3a5b2ca..b6f8aa78fff0 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.cxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.cxx @@ -73,8 +73,8 @@ PageOrientationControl::~PageOrientationControl() } void PageOrientationControl::ExecuteMarginLRChange( - const long nPageLeftMargin, - const long nPageRightMargin ) + const tools::Long nPageLeftMargin, + const tools::Long nPageRightMargin ) { mpPageLRMarginItem->SetLeft( nPageLeftMargin ); mpPageLRMarginItem->SetRight( nPageRightMargin ); @@ -83,8 +83,8 @@ void PageOrientationControl::ExecuteMarginLRChange( } void PageOrientationControl::ExecuteMarginULChange( - const long nPageTopMargin, - const long nPageBottomMargin ) + const tools::Long nPageTopMargin, + const tools::Long nPageBottomMargin ) { mpPageULMarginItem->SetUpper( nPageTopMargin ); mpPageULMarginItem->SetLower( nPageBottomMargin ); @@ -123,8 +123,8 @@ void PageOrientationControl::ExecuteOrientationChange( const bool bLandscape ) mpPageItem->SetLandscape( bLandscape ); // swap the width and height of the page size - const long nRotatedWidth = mpPageSizeItem->GetSize().Height(); - const long nRotatedHeight = mpPageSizeItem->GetSize().Width(); + const tools::Long nRotatedWidth = mpPageSizeItem->GetSize().Height(); + const tools::Long nRotatedHeight = mpPageSizeItem->GetSize().Width(); mpPageSizeItem->SetSize(Size(nRotatedWidth, nRotatedHeight)); // apply changed attributes @@ -138,11 +138,11 @@ void PageOrientationControl::ExecuteOrientationChange( const bool bLandscape ) // check, if margin values still fit to the changed page size. // if not, adjust margin values { - const long nML = mpPageLRMarginItem->GetLeft(); - const long nMR = mpPageLRMarginItem->GetRight(); - const long nTmpPW = nML + nMR + MINBODY; + const tools::Long nML = mpPageLRMarginItem->GetLeft(); + const tools::Long nMR = mpPageLRMarginItem->GetRight(); + const tools::Long nTmpPW = nML + nMR + MINBODY; - const long nPW = mpPageSizeItem->GetSize().Width(); + const tools::Long nPW = mpPageSizeItem->GetSize().Width(); if ( nTmpPW > nPW ) { @@ -156,11 +156,11 @@ void PageOrientationControl::ExecuteOrientationChange( const bool bLandscape ) } } - const long nMT = mpPageULMarginItem->GetUpper(); - const long nMB = mpPageULMarginItem->GetLower(); - const long nTmpPH = nMT + nMB + MINBODY; + const tools::Long nMT = mpPageULMarginItem->GetUpper(); + const tools::Long nMB = mpPageULMarginItem->GetLower(); + const tools::Long nTmpPH = nMT + nMB + MINBODY; - const long nPH = mpPageSizeItem->GetSize().Height(); + const tools::Long nPH = mpPageSizeItem->GetSize().Height(); if ( nTmpPH > nPH ) { diff --git a/sw/source/uibase/sidebar/PageOrientationControl.hxx b/sw/source/uibase/sidebar/PageOrientationControl.hxx index 7cb825406fbc..5f71ca925894 100644 --- a/sw/source/uibase/sidebar/PageOrientationControl.hxx +++ b/sw/source/uibase/sidebar/PageOrientationControl.hxx @@ -46,8 +46,8 @@ private: std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem; std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem; - void ExecuteMarginULChange(const long nPageTopMargin, const long nPageBottomMargin); - void ExecuteMarginLRChange(const long nPageLeftMargin, const long nPageRightMargin); + void ExecuteMarginULChange(const tools::Long nPageTopMargin, const tools::Long nPageBottomMargin); + void ExecuteMarginLRChange(const tools::Long nPageLeftMargin, const tools::Long nPageRightMargin); void ExecuteOrientationChange(const bool bLandscape); DECL_LINK(ImplOrientationHdl, weld::Button&, void); diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx index 4d82afe29349..f24bf135c706 100644 --- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx +++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx @@ -75,7 +75,7 @@ BitmapEx GenerateStylePreview(SfxObjectShell& rSource, OUString const & aName) pVirtualDev->SetLineColor(COL_LIGHTGRAY); pVirtualDev->SetFillColor(); - long y = 0; + tools::Long y = 0; { pVirtualDev->SetFillColor(COL_LIGHTGRAY); tools::Rectangle aNameRect(0, y, nPreviewWidth, nNameHeight); diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx b/sw/source/uibase/sidebar/TableEditPanel.cxx index 2a91ec6b3bfb..de053ddaa837 100644 --- a/sw/source/uibase/sidebar/TableEditPanel.cxx +++ b/sw/source/uibase/sidebar/TableEditPanel.cxx @@ -54,7 +54,7 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(pState); if (pItem) { - long nNewHeight = pItem->GetValue(); + tools::Long nNewHeight = pItem->GetValue(); nNewHeight = m_xRowHeightEdit->normalize(nNewHeight); m_xRowHeightEdit->set_value(nNewHeight, FieldUnit::TWIP); } @@ -74,7 +74,7 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState const SfxUInt32Item* pItem = static_cast<const SfxUInt32Item*>(pState); if (pItem) { - long nNewWidth = pItem->GetValue(); + tools::Long nNewWidth = pItem->GetValue(); nNewWidth = m_xColumnWidthEdit->normalize(nNewWidth); m_xColumnWidthEdit->set_value(nNewWidth, FieldUnit::TWIP); } diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx index 290ca4106fb3..f4c4951f6546 100644 --- a/sw/source/uibase/sidebar/ThemePanel.cxx +++ b/sw/source/uibase/sidebar/ThemePanel.cxx @@ -43,7 +43,7 @@ public: class ColorVariable { public: - long mnIndex; + tools::Long mnIndex; sal_Int16 mnTintShade; ColorVariable() @@ -51,7 +51,7 @@ public: , mnTintShade() {} - ColorVariable(long nIndex, sal_Int16 nTintShade) + ColorVariable(tools::Long nIndex, sal_Int16 nTintShade) : mnIndex(nIndex) , mnTintShade(nTintShade) {} @@ -367,15 +367,15 @@ BitmapEx GenerateColorPreview(const svx::ColorSet& rColorSet) { ScopedVclPtrInstance<VirtualDevice> pVirtualDev(*Application::GetDefaultDevice()); float fScaleFactor = pVirtualDev->GetDPIScaleFactor(); - long BORDER = 2 * fScaleFactor; - long SIZE = 12 * fScaleFactor; + tools::Long BORDER = 2 * fScaleFactor; + tools::Long SIZE = 12 * fScaleFactor; Size aSize(BORDER * 7 + SIZE * 6, BORDER * 3 + SIZE * 2); pVirtualDev->SetOutputSizePixel(aSize); - long x = BORDER; - long y1 = BORDER; - long y2 = y1 + SIZE + BORDER; + tools::Long x = BORDER; + tools::Long y1 = BORDER; + tools::Long y2 = y1 + SIZE + BORDER; pVirtualDev->SetLineColor(COL_LIGHTGRAY); diff --git a/sw/source/uibase/table/swtablerep.cxx b/sw/source/uibase/table/swtablerep.cxx index a7518c14ebb5..4eac6343b58d 100644 --- a/sw/source/uibase/table/swtablerep.cxx +++ b/sw/source/uibase/table/swtablerep.cxx @@ -60,7 +60,7 @@ SwTableRep::~SwTableRep() bool SwTableRep::FillTabCols( SwTabCols& rTabCols ) const { - long nOldLeft = rTabCols.GetLeft(), + tools::Long nOldLeft = rTabCols.GetLeft(), nOldRight = rTabCols.GetRight(); bool bSingleLine = false; diff --git a/sw/source/uibase/uitest/uiobject.cxx b/sw/source/uibase/uitest/uiobject.cxx index 4ac900ec635c..867083edb6e2 100644 --- a/sw/source/uibase/uitest/uiobject.cxx +++ b/sw/source/uibase/uitest/uiobject.cxx @@ -212,8 +212,8 @@ void CommentUIObject::execute(const OUString& rAction, if (rParameters.find("FROM") != rParameters.end() && rParameters.find("TO") != rParameters.end()) { - long nMin = rParameters.find("FROM")->second.toInt32(); - long nMax = rParameters.find("TO")->second.toInt32(); + tools::Long nMin = rParameters.find("FROM")->second.toInt32(); + tools::Long nMax = rParameters.find("TO")->second.toInt32(); ESelection aNewSelection( 0 , nMin, mxCommentUIObject->GetOutliner()->GetParagraphCount()-1, nMax ); mxCommentUIObject->GetOutlinerView()->SetSelection( aNewSelection ); } diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 362b08bfc54d..038428d9290e 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1286,7 +1286,7 @@ bool SwPagePreview::ChgPage( int eMvMode, bool bUpdateScrollbar ) void SwPagePreview::CalcAndSetBorderPixel( SvBorder &rToFill ) { const StyleSettings &rSet = m_pViewWin->GetSettings().GetStyleSettings(); - const long nTmp = rSet.GetScrollBarSize(); + const tools::Long nTmp = rSet.GetScrollBarSize(); if ( m_pVScrollbar->IsVisible( true ) ) rToFill.Right() = nTmp; if ( m_pHScrollbar->IsVisible( true ) ) @@ -1393,7 +1393,7 @@ IMPL_LINK( SwPagePreview, ScrollHdl, ScrollBar *, p, void ) { // Scroll how many pages?? OUString sStateStr(m_sPageStr); - long nThmbPos = pScrollbar->GetThumbPos(); + tools::Long nThmbPos = pScrollbar->GetThumbPos(); if( 1 == m_pViewWin->GetCol() || !nThmbPos ) ++nThmbPos; sStateStr += OUString::number( nThmbPos ); @@ -1481,13 +1481,13 @@ IMPL_LINK( SwPagePreview, EndScrollHdl, ScrollBar *, p, void ) } else { - long nThmbPos = pScrollbar->GetThumbPos(); + tools::Long nThmbPos = pScrollbar->GetThumbPos(); m_pViewWin->Scroll(0, nThmbPos - m_pViewWin->GetPaintedPreviewDocRect().Top()); } } else { - long nThmbPos = pScrollbar->GetThumbPos(); + tools::Long nThmbPos = pScrollbar->GetThumbPos(); m_pViewWin->Scroll(nThmbPos - m_pViewWin->GetPaintedPreviewDocRect().Left(), 0); } // additional invalidate page status. @@ -1576,7 +1576,7 @@ void SwPagePreview::ScrollViewSzChg() const Size& rPreviewSize = GetViewShell()->PagePreviewLayout()->GetPreviewDocSize(); m_pVScrollbar->SetRangeMax(rPreviewSize.Height()) ; - long nVisHeight = rDocRect.GetHeight(); + tools::Long nVisHeight = rDocRect.GetHeight(); m_pVScrollbar->SetVisibleSize( nVisHeight ); m_pVScrollbar->SetThumbPos( rDocRect.Top() ); m_pVScrollbar->SetLineSize( nVisHeight / 10 ); @@ -1601,8 +1601,8 @@ void SwPagePreview::ScrollViewSzChg() { bShowHScrollbar = true; - long nVisWidth = rDocRect.GetWidth(); - long nThumb = rDocRect.Left(); + tools::Long nVisWidth = rDocRect.GetWidth(); + tools::Long nThumb = rDocRect.Left(); aRange = Range(0, rPreviewSize.Width()); m_pHScrollbar->SetRange( aRange ); @@ -1762,7 +1762,7 @@ void SwPagePreviewWin::AdjustPreviewToNewZoom( const sal_uInt16 _nZoomFactor, * when less than the desired number of rows fits into * the view */ -void SwPagePreviewWin::Scroll(long nXMove, long nYMove, ScrollFlags /*nFlags*/) +void SwPagePreviewWin::Scroll(tools::Long nXMove, tools::Long nYMove, ScrollFlags /*nFlags*/) { maPaintedPreviewDocRect.Move(nXMove, nYMove); mpPgPreviewLayout->Prepare( 0, maPaintedPreviewDocRect.TopLeft(), diff --git a/sw/source/uibase/uiview/scroll.cxx b/sw/source/uibase/uiview/scroll.cxx index e44154b34222..1bd4bd1e9338 100644 --- a/sw/source/uibase/uiview/scroll.cxx +++ b/sw/source/uibase/uiview/scroll.cxx @@ -52,7 +52,7 @@ void SwScrollbar::DocSzChgd( const Size &rSize ) void SwScrollbar::ViewPortChgd( const tools::Rectangle &rRect ) { - long nThumb, nVisible; + tools::Long nThumb, nVisible; if( bHori ) { nThumb = rRect.Left(); @@ -103,8 +103,8 @@ void SwScrollbar::SetAuto(bool bSet) void SwScrollbar::AutoShow() { - long nVis = GetVisibleSize(); - long nLen = GetRange().Len(); + tools::Long nVis = GetVisibleSize(); + tools::Long nLen = GetRange().Len(); if( nVis >= nLen - 1) { if(ScrollBar::IsVisible()) diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 62f306a9dcf7..6709689e556b 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -123,19 +123,19 @@ static void lcl_PrintHeader( vcl::RenderContext &rOutDev, sal_Int32 nPages, sal_ aFont.SetAlignment( ALIGN_BOTTOM ); rOutDev.SetFont( aFont ); - long nFontHeight = rOutDev.GetTextHeight(); + tools::Long nFontHeight = rOutDev.GetTextHeight(); // 1.Border => Line, 2+3 Border = Space. - long nYTop = TMARGPRN-3*nBorder-nFontHeight; + tools::Long nYTop = TMARGPRN-3*nBorder-nFontHeight; - long nXLeft = nLeftMargin-nBorder; - long nXRight = aSz.Width()-RMARGPRN+nBorder; + tools::Long nXLeft = nLeftMargin-nBorder; + tools::Long nXRight = aSz.Width()-RMARGPRN+nBorder; rOutDev.DrawRect( tools::Rectangle( Point( nXLeft, nYTop ), Size( nXRight-nXLeft, aSz.Height() - nYTop - BMARGPRN + nBorder ) ) ); - long nY = TMARGPRN-2*nBorder; + tools::Long nY = TMARGPRN-2*nBorder; Point aPos( nLeftMargin, nY ); rOutDev.DrawText( aPos, rTitle ); if ( nPages != 1 ) @@ -684,16 +684,16 @@ sal_Int32 SwSrcView::PrintSource( OUString aTitle( GetViewFrame()->GetWindow().GetText() ); - const long nLineHeight = pOutDev->GetTextHeight(); // slightly more - const long nParaSpace = 10; + const tools::Long nLineHeight = pOutDev->GetTextHeight(); // slightly more + const tools::Long nParaSpace = 10; Size aPaperSz = pOutDev->GetOutputSize(); aPaperSz.AdjustWidth( -(LMARGPRN + RMARGPRN) ); aPaperSz.AdjustHeight( -(TMARGPRN + BMARGPRN) ); // nLinepPage is not true, if lines have to be wrapped... - const long nLinespPage = nLineHeight ? aPaperSz.Height() / nLineHeight : 1; - const long nCharWidth = pOutDev->GetTextWidth("X"); + const tools::Long nLinespPage = nLineHeight ? aPaperSz.Height() / nLineHeight : 1; + const tools::Long nCharWidth = pOutDev->GetTextWidth("X"); const sal_Int32 nCharspLine = nCharWidth ? static_cast<sal_Int32>(aPaperSz.Width() / nCharWidth) : 1; const sal_uInt32 nParas = pTextEngine->GetParagraphCount(); diff --git a/sw/source/uibase/uiview/swcli.cxx b/sw/source/uibase/uiview/swcli.cxx index 05f5f6ccc95a..02dc88cade38 100644 --- a/sw/source/uibase/uiview/swcli.cxx +++ b/sw/source/uibase/uiview/swcli.cxx @@ -67,8 +67,8 @@ void SwOleClient::RequestNewObjectArea( tools::Rectangle& aLogRect ) MapMode aObjectMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( GetObject()->getMapUnit( GetAspect() ) ) ); MapMode aClientMap( GetEditWin()->GetMapMode().GetMapUnit() ); - Size aNewObjSize( long( aLogRect.GetWidth() / GetScaleWidth() ), - long( aLogRect.GetHeight() / GetScaleHeight() ) ); + Size aNewObjSize( tools::Long( aLogRect.GetWidth() / GetScaleWidth() ), + tools::Long( aLogRect.GetHeight() / GetScaleHeight() ) ); // convert to logical coordinates of the embedded object Size aNewSize = GetEditWin()->LogicToLogic( aNewObjSize, &aClientMap, &aObjectMap ); @@ -141,8 +141,8 @@ void SwOleClient::ViewChanged() const MapMode aObjMap( VCLUnoHelper::UnoEmbed2VCLMapUnit( GetObject()->getMapUnit( GetAspect() ) ) ); aVisSize = OutputDevice::LogicToLogic( aVisSize, aObjMap, aMyMap ); - aVisSize.setWidth( long(aVisSize.Width() * GetScaleWidth()) ); - aVisSize.setHeight( long(aVisSize.Height() * GetScaleHeight()) ); + aVisSize.setWidth( tools::Long(aVisSize.Width() * GetScaleWidth()) ); + aVisSize.setHeight( tools::Long(aVisSize.Height() * GetScaleHeight()) ); SwRect aRect( Point( LONG_MIN, LONG_MIN ), aVisSize ); rSh.LockView( true ); // Prevent scrolling in the EndAction diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index a61a96af71d6..0a9fde5beb18 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -1174,19 +1174,19 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse ) // No it is *not* a good idea to call GetToken within Point constr. immediately, // because which parameter is evaluated first? - long nX = rUserData.getToken( 0, ';', nPos ).toInt32(), + tools::Long nX = rUserData.getToken( 0, ';', nPos ).toInt32(), nY = rUserData.getToken( 0, ';', nPos ).toInt32(); Point aCursorPos( nX, nY ); sal_uInt16 nZoomFactor = static_cast< sal_uInt16 >( rUserData.getToken(0, ';', nPos ).toInt32() ); - long nLeft = rUserData.getToken(0, ';', nPos ).toInt32(), + tools::Long nLeft = rUserData.getToken(0, ';', nPos ).toInt32(), nTop = rUserData.getToken(0, ';', nPos ).toInt32(), nRight = rUserData.getToken(0, ';', nPos ).toInt32(), nBottom= rUserData.getToken(0, ';', nPos ).toInt32(); - const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2; + const tools::Long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2; if ( nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) ) return; @@ -1244,8 +1244,8 @@ void SwView::ReadUserData( const OUString &rUserData, bool bBrowse ) if( !m_sNewCursorPos.isEmpty() ) { sal_Int32 nIdx{ 0 }; - const long nXTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32(); - const long nYTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32(); + const tools::Long nXTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32(); + const tools::Long nYTmp = m_sNewCursorPos.getToken( 0, ';', nIdx ).toInt32(); Point aCursorPos2( nXTmp, nYTmp ); bSelectObj = m_pWrtShell->IsObjSelectable( aCursorPos2 ); @@ -1388,7 +1388,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > return; Point aCursorPos( nX, nY ); - const long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2; + const tools::Long nAdd = m_pWrtShell->GetViewOptions()->getBrowseMode() ? DOCUMENTBORDER : DOCUMENTBORDER*2; if (nBottom > (m_pWrtShell->GetDocSize().Height()+nAdd) ) return; @@ -1491,7 +1491,7 @@ void SwView::ReadUserDataSequence ( const uno::Sequence < beans::PropertyValue > else { //check if the values are possible - long nXMax = m_pHScrollbar->GetRangeMax() - m_pHScrollbar->GetVisibleSize(); + tools::Long nXMax = m_pHScrollbar->GetRangeMax() - m_pHScrollbar->GetVisibleSize(); if( aTopLeft.X() > nXMax ) aTopLeft.setX( nXMax < 0 ? 0 : nXMax ); } @@ -1567,7 +1567,7 @@ void SwView::ShowCursor( bool bOn ) m_pWrtShell->LockView( false ); } -ErrCode SwView::DoVerb( long nVerb ) +ErrCode SwView::DoVerb( tools::Long nVerb ) { if ( !GetViewFrame()->GetFrame().IsInPlace() ) { diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 6866c8b4788a..b0e133d92403 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -586,7 +586,7 @@ void SwView::Execute(SfxRequest &rReq) case SID_ZOOM_IN: case SID_ZOOM_OUT: { - long nFact = m_pWrtShell->GetViewOptions()->GetZoom(); + tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom(); if (SID_ZOOM_OUT == nSlot) nFact = basegfx::zoomtools::zoomIn(nFact); else @@ -894,7 +894,7 @@ void SwView::Execute(SfxRequest &rReq) } m_pViewImpl->InitRequest( rReq ); - long nFound = InsertDoc( nSlot, sFileName, sFilterName, nVersion ); + tools::Long nFound = InsertDoc( nSlot, sFileName, sFilterName, nVersion ); if ( bHasFileName ) { @@ -1562,13 +1562,13 @@ void SwView::StateStatusLine(SfxItemSet &rSet) const Size& rEditSize = GetEditWin().GetOutputSizePixel(); const Size aWindowSize( GetEditWin().PixelToLogic( rEditSize, aTmpMap ) ); - const long nOf = pVOpt->GetDocumentBorder() * 2; - long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width(); + const tools::Long nOf = pVOpt->GetDocumentBorder() * 2; + tools::Long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width(); nTmpWidth += nOf; aPageSize.AdjustHeight(nOf ); - long nFac = aWindowSize.Width() * 100 / nTmpWidth; + tools::Long nFac = aWindowSize.Width() * 100 / nTmpWidth; - long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height(); + tools::Long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height(); nFac = std::min( nFac, nVisPercent ); if (nFac >= MINZOOM) @@ -2205,7 +2205,7 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ) sFilter = static_cast<const SfxStringItem *>(pItem )->GetValue(); bool bHasFileName = !sFile.isEmpty(); - long nFound = InsertDoc( nSlot, sFile, sFilter ); + tools::Long nFound = InsertDoc( nSlot, sFile, sFilter ); if ( bHasFileName ) { @@ -2215,7 +2215,7 @@ void SwView::ExecuteInsertDoc( SfxRequest& rRequest, const SfxPoolItem* pItem ) } } -long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUString& rFilterName, sal_Int16 nVersion ) +tools::Long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUString& rFilterName, sal_Int16 nVersion ) { std::unique_ptr<SfxMedium> pMed; SwDocShell* pDocSh = GetDocShell(); @@ -2255,10 +2255,10 @@ long SwView::InsertDoc( sal_uInt16 nSlotId, const OUString& rFileName, const OUS return InsertMedium( nSlotId, std::move(pMed), nVersion ); } -long SwView::InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion ) +tools::Long SwView::InsertMedium( sal_uInt16 nSlotId, std::unique_ptr<SfxMedium> pMedium, sal_Int16 nVersion ) { bool bInsert = false, bCompare = false; - long nFound = 0; + tools::Long nFound = 0; SwDocShell* pDocSh = GetDocShell(); switch( nSlotId ) @@ -2571,7 +2571,7 @@ IMPL_LINK( SwView, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileDlg, void ) } const sal_uInt16 nSlot = m_pViewImpl->GetRequest()->GetSlot(); - long nFound = InsertMedium( nSlot, std::move(pMed), m_pViewImpl->GetParam() ); + tools::Long nFound = InsertMedium( nSlot, std::move(pMed), m_pViewImpl->GetParam() ); if ( SID_INSERTDOC == nSlot ) { diff --git a/sw/source/uibase/uiview/viewmdi.cxx b/sw/source/uibase/uiview/viewmdi.cxx index 398d8369370f..30aed9abf826 100644 --- a/sw/source/uibase/uiview/viewmdi.cxx +++ b/sw/source/uibase/uiview/viewmdi.cxx @@ -93,7 +93,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, { // start of SwActContext scope SwActContext aActContext(m_pWrtShell.get()); - long nFac = nFactor; + tools::Long nFac = nFactor; const bool bWeb = dynamic_cast< const SwWebView *>( this ) != nullptr; SwMasterUsrPref *pUsrPref = const_cast<SwMasterUsrPref*>(SW_MOD()->GetUsrPref(bWeb)); @@ -101,7 +101,7 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, const SwPageDesc &rDesc = m_pWrtShell->GetPageDesc( m_pWrtShell->GetCurPageDesc() ); const SvxLRSpaceItem &rLRSpace = rDesc.GetMaster().GetLRSpace(); const SwViewOption *pOpt = m_pWrtShell->GetViewOptions(); - long lLeftMargin = 0; + tools::Long lLeftMargin = 0; if( eZoomType != SvxZoomType::PERCENT ) { @@ -135,26 +135,26 @@ void SwView::SetZoom_( const Size &rEditSize, SvxZoomType eZoomType, } else if(SvxZoomType::WHOLEPAGE == eZoomType || SvxZoomType::PAGEWIDTH == eZoomType ) { - const long nOf = DOCUMENTBORDER * 2; - long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width(); + const tools::Long nOf = DOCUMENTBORDER * 2; + tools::Long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width(); nTmpWidth += nOf; aPageSize.AdjustHeight(nOf ); nFac = aWindowSize.Width() * 100 / nTmpWidth; if ( SvxZoomType::WHOLEPAGE == eZoomType ) { - long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height(); + tools::Long nVisPercent = aWindowSize.Height() * 100 / aPageSize.Height(); nFac = std::min( nFac, nVisPercent ); } } else { - const long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width(); + const tools::Long nTmpWidth = bAutomaticViewLayout ? aPageSize.Width() : aRootSize.Width(); nFac = aWindowSize.Width() * 100 / nTmpWidth; } } - nFac = std::max( long( MINZOOM ), nFac ); + nFac = std::max( tools::Long( MINZOOM ), nFac ); const sal_uInt16 nZoomFac = static_cast<sal_uInt16>(nFac); SwViewOption aOpt( *pOpt ); diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index 66df1f44c950..679e08fc8025 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -60,10 +60,10 @@ bool SwView::IsDocumentBorder() SvxZoomType::PAGEWIDTH_NOBORDER == m_pWrtShell->GetViewOptions()->GetZoomType(); } -static long GetLeftMargin( SwView const &rView ) +static tools::Long GetLeftMargin( SwView const &rView ) { SvxZoomType eType = rView.GetWrtShell().GetViewOptions()->GetZoomType(); - long lRet = rView.GetWrtShell().GetAnyCurRect(CurRectType::PagePrt).Left(); + tools::Long lRet = rView.GetWrtShell().GetAnyCurRect(CurRectType::PagePrt).Left(); return eType == SvxZoomType::PERCENT ? lRet + DOCUMENTBORDER : eType == SvxZoomType::PAGEWIDTH || eType == SvxZoomType::PAGEWIDTH_NOBORDER ? 0 : lRet + DOCUMENTBORDER + nLeftOfst; @@ -77,17 +77,17 @@ static void lcl_GetPos(SwView const * pView, SwWrtShell &rSh = pView->GetWrtShell(); const Size aDocSz( rSh.GetDocSize() ); - const long lBorder = bBorder ? DOCUMENTBORDER : DOCUMENTBORDER * 2; + const tools::Long lBorder = bBorder ? DOCUMENTBORDER : DOCUMENTBORDER * 2; const bool bHori = pScrollbar->IsHoriScroll(); - const long lPos = pScrollbar->GetThumbPos() + (bBorder ? DOCUMENTBORDER : 0); + const tools::Long lPos = pScrollbar->GetThumbPos() + (bBorder ? DOCUMENTBORDER : 0); - long lDelta = lPos - (bHori ? rSh.VisArea().Pos().X() : rSh.VisArea().Pos().Y()); + tools::Long lDelta = lPos - (bHori ? rSh.VisArea().Pos().X() : rSh.VisArea().Pos().Y()); - const long lSize = (bHori ? aDocSz.Width() : aDocSz.Height()) + lBorder; + const tools::Long lSize = (bHori ? aDocSz.Width() : aDocSz.Height()) + lBorder; // Should right or below are too much space, // then they must be subtracted out of the VisArea! - long nTmp = pView->GetVisArea().Right()+lDelta; + tools::Long nTmp = pView->GetVisArea().Right()+lDelta; if ( bHori && nTmp > lSize ) lDelta -= nTmp - lSize; nTmp = pView->GetVisArea().Bottom()+lDelta; @@ -124,20 +124,20 @@ void SwView::InvalidateRulerPos() // Limits the scrolling so far that only a quarter of the // screen can be scrolled up before the end of the document. -long SwView::SetHScrollMax( long lMax ) +tools::Long SwView::SetHScrollMax( tools::Long lMax ) { - const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; - const long lSize = GetDocSz().Width() + lBorder - m_aVisArea.GetWidth(); + const tools::Long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; + const tools::Long lSize = GetDocSz().Width() + lBorder - m_aVisArea.GetWidth(); // At negative values the document is completely visible. // In this case, no scrolling. return std::max( std::min( lMax, lSize ), 0L ); } -long SwView::SetVScrollMax( long lMax ) +tools::Long SwView::SetVScrollMax( tools::Long lMax ) { - const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; - long lSize = GetDocSz().Height() + lBorder - m_aVisArea.GetHeight(); + const tools::Long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER * 2; + tools::Long lSize = GetDocSz().Height() + lBorder - m_aVisArea.GetHeight(); return std::max( std::min( lMax, lSize), 0L ); // see horizontal } @@ -291,7 +291,7 @@ void SwView::SetVisArea( const Point &rPt, bool bUpdateScrollbar ) // Let's see how far we get with half BrushSize. Point aPt = GetEditWin().LogicToPixel( rPt ); #if HAVE_FEATURE_DESKTOP - const long nTmp = GetWrtShell().IsFrameView() ? 4 : 8; + const tools::Long nTmp = GetWrtShell().IsFrameView() ? 4 : 8; aPt.AdjustX( -(aPt.X() % nTmp) ); aPt.AdjustY( -(aPt.Y() % nTmp) ); #endif @@ -300,8 +300,8 @@ void SwView::SetVisArea( const Point &rPt, bool bUpdateScrollbar ) if ( aPt == m_aVisArea.TopLeft() ) return; - const long lXDiff = m_aVisArea.Left() - aPt.X(); - const long lYDiff = m_aVisArea.Top() - aPt.Y(); + const tools::Long lXDiff = m_aVisArea.Left() - aPt.X(); + const tools::Long lYDiff = m_aVisArea.Top() - aPt.Y(); SetVisArea( tools::Rectangle( aPt, Point( m_aVisArea.Right() - lXDiff, m_aVisArea.Bottom() - lYDiff ) ), bUpdateScrollbar); @@ -339,9 +339,9 @@ void SwView::CalcPt( Point *pPt, const tools::Rectangle &rRect, const SwTwips lMin = IsDocumentBorder() ? DOCUMENTBORDER : 0; - long nYScroll = GetYScroll(); - long nDesHeight = rRect.GetHeight(); - long nCurHeight = m_aVisArea.GetHeight(); + tools::Long nYScroll = GetYScroll(); + tools::Long nDesHeight = rRect.GetHeight(); + tools::Long nCurHeight = m_aVisArea.GetHeight(); nYScroll = std::min(nYScroll, nCurHeight - nDesHeight); // If it is scarce, then scroll not too much. if(nDesHeight > nCurHeight) // the height is not sufficient, then nYScroll is no longer of interest { @@ -360,7 +360,7 @@ void SwView::CalcPt( Point *pPt, const tools::Rectangle &rRect, nRangeY : nYScroll ) ); pPt->setY( SetVScrollMax( pPt->Y() ) ); } - long nXScroll = GetXScroll(); + tools::Long nXScroll = GetXScroll(); if ( rRect.Right() > m_aVisArea.Right() ) // Shift right { pPt->setX( rRect.Right() - @@ -390,7 +390,7 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt return; tools::Rectangle aOldVisArea( m_aVisArea ); - long nDiffY = 0; + tools::Long nDiffY = 0; weld::Window* pCareDialog = SwViewShell::GetCareDialog(GetWrtShell()); if (pCareDialog) @@ -418,8 +418,8 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt return; // Is above or below the dialogue more space? - long nTopDiff = aDlgRect.Top() - m_aVisArea.Top(); - long nBottomDiff = m_aVisArea.Bottom() - aDlgRect.Bottom(); + tools::Long nTopDiff = aDlgRect.Top() - m_aVisArea.Top(); + tools::Long nBottomDiff = m_aVisArea.Bottom() - aDlgRect.Bottom(); if ( nTopDiff < nBottomDiff ) { if ( nBottomDiff > 0 ) // Is there room below at all? @@ -460,7 +460,7 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt if( m_bTopCursor ) { - const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; + const tools::Long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; aPt.setY( std::min( std::max( nBorder, rRect.Top() ), m_aDocSz.Height() + nBorder - m_aVisArea.GetHeight() ) ); @@ -477,7 +477,7 @@ void SwView::Scroll( const tools::Rectangle &rRect, sal_uInt16 nRangeX, sal_uInt if( m_bTopCursor ) { - const long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; + const tools::Long nBorder = IsDocumentBorder() ? DOCUMENTBORDER : 0; aPt.setY( std::min( std::max( nBorder, rRect.Top() ), m_aDocSz.Height() + nBorder - m_aVisArea.GetHeight() ) ); @@ -527,7 +527,7 @@ bool SwView::GetPageScrollUpOffset( SwTwips &rOff ) const if ( !m_aVisArea.Top() || !m_aVisArea.GetHeight() ) return false; - long nYScrl = GetYScroll() / 2; + tools::Long nYScrl = GetYScroll() / 2; rOff = -(m_aVisArea.GetHeight() - nYScrl); // Do not scroll before the beginning of the document. if( m_aVisArea.Top() - rOff < 0 ) @@ -550,7 +550,7 @@ bool SwView::GetPageScrollDownOffset( SwTwips &rOff ) const if ( !m_aVisArea.GetHeight() || (m_aVisArea.GetHeight() > m_aDocSz.Height()) ) return false; - long nYScrl = GetYScroll() / 2; + tools::Long nYScrl = GetYScroll() / 2; rOff = m_aVisArea.GetHeight() - nYScrl; // Do not scroll past the end of the document. if ( m_aVisArea.Top() + rOff > m_aDocSz.Height() ) @@ -775,23 +775,23 @@ void SwView::CalcVisArea( const Size &rOutPixel ) // The shifts to the right and/or below can now be incorrect // (e.g. change zoom level, change view size). - const long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER*2; + const tools::Long lBorder = IsDocumentBorder() ? DOCUMENTBORDER : DOCUMENTBORDER*2; if ( aRect.Left() ) { - const long lWidth = GetWrtShell().GetDocSize().Width() + lBorder; + const tools::Long lWidth = GetWrtShell().GetDocSize().Width() + lBorder; if ( aRect.Right() > lWidth ) { - long lDelta = aRect.Right() - lWidth; + tools::Long lDelta = aRect.Right() - lWidth; aRect.AdjustLeft( -lDelta ); aRect.AdjustRight( -lDelta ); } } if ( aRect.Top() ) { - const long lHeight = GetWrtShell().GetDocSize().Height() + lBorder; + const tools::Long lHeight = GetWrtShell().GetDocSize().Height() + lBorder; if ( aRect.Bottom() > lHeight ) { - long lDelta = aRect.Bottom() - lHeight; + tools::Long lDelta = aRect.Bottom() - lHeight; aRect.AdjustTop( -lDelta ); aRect.AdjustBottom( -lDelta ); } @@ -808,7 +808,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill ) bool bRightVRuler = m_pWrtShell->GetViewOptions()->IsVRulerRight(); if ( m_pVRuler->IsVisible() ) { - long nWidth = m_pVRuler->GetSizePixel().Width(); + tools::Long nWidth = m_pVRuler->GetSizePixel().Width(); if(bRightVRuler) rToFill.Right() = nWidth; else @@ -820,7 +820,7 @@ void SwView::CalcAndSetBorderPixel( SvBorder &rToFill ) rToFill.Top() = m_pHRuler->GetSizePixel().Height(); const StyleSettings &rSet = GetEditWin().GetSettings().GetStyleSettings(); - const long nTmp = rSet.GetScrollBarSize(); + const tools::Long nTmp = rSet.GetScrollBarSize(); if( m_pVScrollbar->IsVisible(true) ) { if(bRightVRuler) @@ -848,15 +848,15 @@ void ViewResizePixel( const vcl::RenderContext &rRef, // ViewResizePixel is also used by Preview!!! const bool bHRuler = pHRuler && pHRuler->IsVisible(); - const long nHLinSzHeight = bHRuler ? + const tools::Long nHLinSzHeight = bHRuler ? pHRuler->GetSizePixel().Height() : 0; const bool bVRuler = pVRuler && pVRuler->IsVisible(); - const long nVLinSzWidth = bVRuler ? + const tools::Long nVLinSzWidth = bVRuler ? pVRuler->GetSizePixel().Width() : 0; - const long nScrollBarSize = rRef.GetSettings().GetStyleSettings().GetScrollBarSize(); - const long nHBSzHeight = rHScrollbar.IsVisible(true) ? nScrollBarSize : 0; - const long nVBSzWidth = rVScrollbar.IsVisible(true) ? nScrollBarSize : 0; + const tools::Long nScrollBarSize = rRef.GetSettings().GetStyleSettings().GetScrollBarSize(); + const tools::Long nHBSzHeight = rHScrollbar.IsVisible(true) ? nScrollBarSize : 0; + const tools::Long nVBSzWidth = rVScrollbar.IsVisible(true) ? nScrollBarSize : 0; if(pVRuler) { @@ -988,9 +988,9 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize, bool ) if( m_pHRuler->IsVisible() || m_pVRuler->IsVisible() ) { const Fraction& rFrac = GetEditWin().GetMapMode().GetScaleX(); - long nZoom = 100; + tools::Long nZoom = 100; if (rFrac.IsValid()) - nZoom = long(rFrac * 100); + nZoom = tools::Long(rFrac * 100); const Fraction aFrac( nZoom, 100 ); m_pVRuler->SetZoom( aFrac ); @@ -1062,7 +1062,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) CurrShell aCurr( m_pWrtShell.get() ); bool bRepeat = false; - long nCnt = 0; + tools::Long nCnt = 0; bool bUnLockView = !m_pWrtShell->IsViewLocked(); m_pWrtShell->LockView( true ); @@ -1140,7 +1140,7 @@ void SwView::OuterResizePixel( const Point &rOfst, const Size &rSize ) void SwView::SetZoomFactor( const Fraction &rX, const Fraction &rY ) { const Fraction &rFrac = rX < rY ? rX : rY; - SetZoom( SvxZoomType::PERCENT, static_cast<short>(long(rFrac * Fraction( 100, 1 ))) ); + SetZoom( SvxZoomType::PERCENT, static_cast<short>(tools::Long(rFrac * Fraction( 100, 1 ))) ); // To minimize rounding errors we also adjust the odd values // of the base class if necessary. @@ -1162,7 +1162,7 @@ bool SwView::UpdateScrollbars() } Size aTmpSz( m_aDocSz ); - const long lOfst = bBorder ? 0 : DOCUMENTBORDER * 2; + const tools::Long lOfst = bBorder ? 0 : DOCUMENTBORDER * 2; aTmpSz.AdjustWidth(lOfst ); aTmpSz.AdjustHeight(lOfst ); { @@ -1197,11 +1197,11 @@ bool SwView::HandleWheelCommands( const CommandEvent& rCEvt ) const CommandWheelData* pWData = rCEvt.GetWheelData(); if (pWData && CommandWheelMode::ZOOM == pWData->GetMode()) { - long nFact = m_pWrtShell->GetViewOptions()->GetZoom(); + tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom(); if( 0L > pWData->GetDelta() ) - nFact = std::max( long(20), basegfx::zoomtools::zoomOut( nFact )); + nFact = std::max( tools::Long(20), basegfx::zoomtools::zoomOut( nFact )); else - nFact = std::min( long(600), basegfx::zoomtools::zoomIn( nFact )); + nFact = std::min( tools::Long(600), basegfx::zoomtools::zoomIn( nFact )); SetZoom( SvxZoomType::PERCENT, nFact ); bOk = true; diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 8c267d180350..5849365ea243 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -72,9 +72,9 @@ void SwView::GetState(SfxItemSet &rSet) case SID_ZOOM_IN: case SID_ZOOM_OUT: { - long nFact = m_pWrtShell->GetViewOptions()->GetZoom(); - if ((SID_ZOOM_OUT == nWhich && nFact >= long(600)) || - (SID_ZOOM_IN == nWhich && nFact <= long(20))) + tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom(); + if ((SID_ZOOM_OUT == nWhich && nFact >= tools::Long(600)) || + (SID_ZOOM_IN == nWhich && nFact <= tools::Long(20))) { rSet.DisableItem(nWhich); } @@ -430,8 +430,8 @@ void SwView::GetState(SfxItemSet &rSet) break; case SID_MAIL_SCROLLBODY_PAGEDOWN: { - const long nBottom = m_pWrtShell->GetDocSize().Height() + DOCUMENTBORDER; - const long nAct = GetVisArea().Bottom(); + const tools::Long nBottom = m_pWrtShell->GetDocSize().Height() + DOCUMENTBORDER; + const tools::Long nAct = GetVisArea().Bottom(); rSet.Put(SfxBoolItem(SID_MAIL_SCROLLBODY_PAGEDOWN, nAct < nBottom )); } break; diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index d62f7f806139..7924d5b04ca7 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -66,14 +66,14 @@ using namespace ::com::sun::star; // Pack columns static void lcl_FillSvxColumn(const SwFormatCol& rCol, - long nTotalWidth, + tools::Long nTotalWidth, SvxColumnItem& rColItem, - long nDistance) + tools::Long nDistance) { const SwColumns& rCols = rCol.GetColumns(); bool bOrtho = rCol.IsOrtho() && !rCols.empty(); - long nInnerWidth = 0; + tools::Long nInnerWidth = 0; if( bOrtho ) { nInnerWidth = nTotalWidth; @@ -87,16 +87,16 @@ static void lcl_FillSvxColumn(const SwFormatCol& rCol, nInnerWidth /= rCols.size(); } - long nWidth = 0; + tools::Long nWidth = 0; for ( size_t i = 0; i < rCols.size(); ++i ) { const SwColumn* pCol = &rCols[i]; - const long nStart = pCol->GetLeft() + nWidth + nDistance; + const tools::Long nStart = pCol->GetLeft() + nWidth + nDistance; if( bOrtho ) nWidth += nInnerWidth + pCol->GetLeft() + pCol->GetRight(); else nWidth += rCol.CalcColWidth(i, static_cast< sal_uInt16 >(nTotalWidth)); - const long nEnd = nWidth - pCol->GetRight() + nDistance; + const tools::Long nEnd = nWidth - pCol->GetRight() + nDistance; SvxColumnDescription aColDesc(nStart, nEnd, true); rColItem.Append(aColDesc); @@ -105,7 +105,7 @@ static void lcl_FillSvxColumn(const SwFormatCol& rCol, // Transfer ColumnItem in ColumnInfo static void lcl_ConvertToCols(const SvxColumnItem& rColItem, - long nTotalWidth, + tools::Long nTotalWidth, SwFormatCol& rCols) { OSL_ENSURE( rCols.GetNumCols() == rColItem.Count(), "Column count mismatch" ); @@ -123,13 +123,13 @@ static void lcl_ConvertToCols(const SvxColumnItem& rColItem, for( sal_uInt16 i=0; i < rColItem.Count()-1; ++i ) { OSL_ENSURE(rColItem[i+1].nStart >= rColItem[i].nEnd,"overlapping columns" ); - const long nStart = std::max(rColItem[i+1].nStart, rColItem[i].nEnd); + const tools::Long nStart = std::max(rColItem[i+1].nStart, rColItem[i].nEnd); const sal_uInt16 nRight = static_cast<sal_uInt16>((nStart - rColItem[i].nEnd) / 2); - const long nWidth = rColItem[i].nEnd - rColItem[i].nStart + nLeft + nRight; + const tools::Long nWidth = rColItem[i].nEnd - rColItem[i].nStart + nLeft + nRight; SwColumn* pCol = &rArr[i]; - pCol->SetWishWidth( sal_uInt16(long(rCols.GetWishWidth()) * nWidth / nTotalWidth )); + pCol->SetWishWidth( sal_uInt16(tools::Long(rCols.GetWishWidth()) * nWidth / nTotalWidth )); pCol->SetLeft( nLeft ); pCol->SetRight( nRight ); nSumAll += pCol->GetWishWidth(); @@ -170,7 +170,7 @@ void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace) if ( rDesc.GetUseOn() == UseOnPage::Mirror && (nPhyPage % 2) == 0 ) { - long nTmp = rLRSpace.GetRight(); + tools::Long nTmp = rLRSpace.GetRight(); rLRSpace.SetRight( rLRSpace.GetLeft() ); rLRSpace.SetLeft( nTmp ); } @@ -178,30 +178,30 @@ void SwView::SwapPageMargin(const SwPageDesc& rDesc, SvxLRSpaceItem& rLRSpace) // If the frame border is moved, the column separator // should stay in the same absolute position. -static void lcl_Scale(long& nVal, long nScale) +static void lcl_Scale(tools::Long& nVal, tools::Long nScale) { nVal *= nScale; nVal >>= 8; } static void ResizeFrameCols(SwFormatCol& rCol, - long nOldWidth, - long nNewWidth, - long nLeftDelta ) + tools::Long nOldWidth, + tools::Long nNewWidth, + tools::Long nLeftDelta ) { SwColumns& rArr = rCol.GetColumns(); - long nWishSum = static_cast<long>(rCol.GetWishWidth()); - long nWishDiff = (nWishSum * 100/nOldWidth * nNewWidth) / 100 - nWishSum; - long nNewWishWidth = nWishSum + nWishDiff; + tools::Long nWishSum = static_cast<tools::Long>(rCol.GetWishWidth()); + tools::Long nWishDiff = (nWishSum * 100/nOldWidth * nNewWidth) / 100 - nWishSum; + tools::Long nNewWishWidth = nWishSum + nWishDiff; if(nNewWishWidth > 0xffffl) { // If the desired width is getting too large, then all values // must be scaled appropriately. - long nScale = (0xffffl << 8)/ nNewWishWidth; + tools::Long nScale = (0xffffl << 8)/ nNewWishWidth; for(SwColumn & i : rArr) { SwColumn* pCol = &i; - long nVal = pCol->GetWishWidth(); + tools::Long nVal = pCol->GetWishWidth(); lcl_Scale(nVal, nScale); pCol->SetWishWidth(static_cast<sal_uInt16>(nVal)); nVal = pCol->GetLeft(); @@ -249,8 +249,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) const SwFormatFrameSize &rFrameSize = rDesc.GetMaster().GetFrameSize(); const SwRect& rPageRect = rSh.GetAnyCurRect(CurRectType::Page); - const long nPageWidth = bBrowse ? rPageRect.Width() : rFrameSize.GetWidth(); - const long nPageHeight = bBrowse ? rPageRect.Height() : rFrameSize.GetHeight(); + const tools::Long nPageWidth = bBrowse ? rPageRect.Width() : rFrameSize.GetWidth(); + const tools::Long nPageHeight = bBrowse ? rPageRect.Height() : rFrameSize.GetHeight(); bool bUnlockView = false; rSh.StartAllAction(); @@ -277,7 +277,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) rSh.IsFrameVertical(true, bRTL, bVertL2R) ) || ( !bFrameSelection && bVerticalWriting); } - long nDeltaX = bVerticalFrame ? + tools::Long nDeltaX = bVerticalFrame ? rRect.Right() - rPageRect.Right() + aLongLR.GetRight() : rPageRect.Left() + aLongLR.GetLeft() - rRect.Left(); @@ -301,13 +301,13 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) } SwFormatFrameSize aSize( pFormat->GetFrameSize() ); - long nOldWidth = aSize.GetWidth(); + tools::Long nOldWidth = aSize.GetWidth(); if(aSize.GetWidthPercent()) { SwRect aRect; rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); - long nPrtWidth = aRect.Width(); + tools::Long nPrtWidth = aRect.Width(); aSize.SetWidthPercent(sal_uInt8((nPageWidth - aLongLR.GetLeft() - aLongLR.GetRight()) * 100 /nPrtWidth)); } else @@ -339,7 +339,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) else if ( nFrameType & ( FrameTypeFlags::HEADER | FrameTypeFlags::FOOTER )) { // Subtract out page margins - long nOld = rDesc.GetMaster().GetLRSpace().GetLeft(); + tools::Long nOld = rDesc.GetMaster().GetLRSpace().GetLeft(); aLongLR.SetLeft( nOld > aLongLR.GetLeft() ? 0 : aLongLR.GetLeft() - nOld ); nOld = rDesc.GetMaster().GetLRSpace().GetRight(); @@ -366,8 +366,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) SwRect aSectRect = rSh.GetAnyCurRect(CurRectType::SectionPrt); const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section); aSectRect.Pos() += aTmpRect.Pos(); - long nLeftDiff = aLongLR.GetLeft() - static_cast<long>(aSectRect.Left() - rPageRect.Left() ); - long nRightDiff = aLongLR.GetRight() - static_cast<long>( rPageRect.Right() - aSectRect.Right()); + tools::Long nLeftDiff = aLongLR.GetLeft() - static_cast<tools::Long>(aSectRect.Left() - rPageRect.Left() ); + tools::Long nRightDiff = aLongLR.GetRight() - static_cast<tools::Long>( rPageRect.Right() - aSectRect.Right()); //change the LRSpaceItem of the section accordingly const SwSection* pCurrSect = rSh.GetCurrSection(); const SwSectionFormat* pSectFormat = pCurrSect->GetFormat(); @@ -380,7 +380,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if(bSect) { SwFormatCol aCols( pSectFormat->GetCol() ); - long nDiffWidth = nLeftDiff + nRightDiff; + tools::Long nDiffWidth = nLeftDiff + nRightDiff; ::ResizeFrameCols(aCols, aSectRect.Width(), aSectRect.Width() - nDiffWidth, nLeftDiff ); aSet.Put( aCols ); } @@ -427,8 +427,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) { SwFrameFormat* pFormat = rSh.GetFlyFrameFormat(); const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded); - const long nDeltaY = rPageRect.Top() + aLongULSpace.GetUpper() - rRect.Top(); - const long nHeight = nPageHeight - (aLongULSpace.GetUpper() + aLongULSpace.GetLower()); + const tools::Long nDeltaY = rPageRect.Top() + aLongULSpace.GetUpper() - rRect.Top(); + const tools::Long nHeight = nPageHeight - (aLongULSpace.GetUpper() + aLongULSpace.GetLower()); SfxItemSet aSet( GetPool(), svl::Items<RES_FRM_SIZE, RES_FRM_SIZE, RES_VERT_ORIENT, RES_HORI_ORIENT>{} ); @@ -456,7 +456,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) { SwRect aRect; rSh.CalcBoundRect(aRect, RndStdIds::FLY_AS_CHAR); - long nPrtHeight = aRect.Height(); + tools::Long nPrtHeight = aRect.Height(); aSize.SetHeightPercent(sal_uInt8(nHeight * 100 /nPrtHeight)); } else @@ -479,8 +479,8 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) SwRect aSectRect = rSh.GetAnyCurRect(CurRectType::SectionPrt); const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section); aSectRect.Pos() += aTmpRect.Pos(); - const long nLeftDiff = aLongULSpace.GetUpper() - static_cast<long>(aSectRect.Top() - rPageRect.Top()); - const long nRightDiff = aLongULSpace.GetLower() - static_cast<long>(nPageHeight - aSectRect.Bottom() + rPageRect.Top()); + const tools::Long nLeftDiff = aLongULSpace.GetUpper() - static_cast<tools::Long>(aSectRect.Top() - rPageRect.Top()); + const tools::Long nRightDiff = aLongULSpace.GetLower() - static_cast<tools::Long>(nPageHeight - aSectRect.Bottom() + rPageRect.Top()); //change the LRSpaceItem of the section accordingly const SwSection* pCurrSect = rSh.GetCurrSection(); const SwSectionFormat* pSectFormat = pCurrSect->GetFormat(); @@ -493,7 +493,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if(bSect) { SwFormatCol aCols( pSectFormat->GetCol() ); - long nDiffWidth = nLeftDiff + nRightDiff; + tools::Long nDiffWidth = nLeftDiff + nRightDiff; ::ResizeFrameCols(aCols, aSectRect.Height(), aSectRect.Height() - nDiffWidth, nLeftDiff ); aSet.Put( aCols ); } @@ -583,9 +583,9 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) const sal_uInt16 nGutterWidth = 0; const SvxLRSpaceItem aLR( rDesc.GetMaster().GetLRSpace() ); - const long nLeft = aLR.GetLeft(); - const long nRight = aLR.GetRight(); - const long nWidth = nPageWidth - nLeft - nRight; + const tools::Long nLeft = aLR.GetLeft(); + const tools::Long nRight = aLR.GetRight(); + const tools::Long nWidth = nPageWidth - nLeft - nRight; SwFormatCol aCols( rDesc.GetMaster().GetCol() ); aCols.Init( nCount, nGutterWidth, nWidth ); @@ -593,18 +593,18 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) aCols.SetGutterWidth( nGutterWidth, nWidth ); aCols.SetOrtho( false, nGutterWidth, nWidth ); - long nColumnLeft = 0; - long nColumnRight = 0; + tools::Long nColumnLeft = 0; + tools::Long nColumnRight = 0; if ( nPageColumnType == 4 ) { - nColumnRight = static_cast<long>(nWidth/3); + nColumnRight = static_cast<tools::Long>(nWidth/3); nColumnLeft = nWidth - nColumnRight; aCols.GetColumns()[0].SetWishWidth( nColumnLeft ); aCols.GetColumns()[1].SetWishWidth( nColumnRight ); } else if ( nPageColumnType == 5 ) { - nColumnLeft = static_cast<long>(nWidth/3); + nColumnLeft = static_cast<tools::Long>(nWidth/3); nColumnRight = nWidth - nColumnLeft; aCols.GetColumns()[0].SetWishWidth( nColumnLeft ); aCols.GetColumns()[1].SetWishWidth( nColumnRight ); @@ -911,7 +911,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) rSh.GetTabCols(aTabCols); // left table border - long nBorder = static_cast<long>(aColItem.GetLeft() - aTabCols.GetLeftMin()); + tools::Long nBorder = static_cast<tools::Long>(aColItem.GetLeft() - aTabCols.GetLeftMin()); aTabCols.SetLeft( nBorder ); nBorder = (bVerticalWriting ? nPageHeight : nPageWidth) - aTabCols.GetLeftMin() - aColItem.GetRight(); @@ -981,7 +981,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) pSectFormat->GetCol() : aSet.Get( RES_COL, false )); SwRect aCurRect = rSh.GetAnyCurRect(bSect ? CurRectType::SectionPrt : CurRectType::FlyEmbeddedPrt); - const long lWidth = bVerticalWriting ? aCurRect.Height() : aCurRect.Width(); + const tools::Long lWidth = bVerticalWriting ? aCurRect.Height() : aCurRect.Width(); ::lcl_ConvertToCols( aColItem, lWidth, aCols ); aSet.Put( aCols ); if(bSect) @@ -1039,7 +1039,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) } else { - long nBorder = nPageHeight - aTabCols.GetLeftMin() - aColItem.GetRight(); + tools::Long nBorder = nPageHeight - aTabCols.GetLeftMin() - aColItem.GetRight(); aTabCols.SetRight( nBorder ); } @@ -1049,7 +1049,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) for ( size_t i = nColItems; i; --i ) { const SvxColumnDescription& rCol = aColItem[i - 1]; - long nColumnPos = aTabCols.GetRight() - rCol.nEnd ; + tools::Long nColumnPos = aTabCols.GetRight() - rCol.nEnd ; aTabCols[i - 1] = nColumnPos; aTabCols.SetHidden( i - 1, !rCol.bVisible ); } @@ -1088,7 +1088,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) const SfxPoolItem *pBorderType; const SfxPoolItem *pIndex; const SfxPoolItem *pOffset; - constexpr long constDistanceOffset = 40; + constexpr tools::Long constDistanceOffset = 40; if (pReqArgs->GetItemState(SID_TABLE_BORDER_TYPE, true, &pBorderType) == SfxItemState::SET && pReqArgs->GetItemState(SID_TABLE_BORDER_INDEX, true, &pIndex) == SfxItemState::SET @@ -1106,22 +1106,22 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if (sType == "column-left") { auto & rEntry = aTabCols.GetEntry(0); - long nNewPosition = aTabCols.GetLeft() + long(nOffset); - long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset); + tools::Long nNewPosition = aTabCols.GetLeft() + tools::Long(nOffset); + tools::Long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset); aTabCols.SetLeft(nPosition); } else if (sType == "column-right") { auto & rEntry = aTabCols.GetEntry(aTabCols.Count() - 1); - long nNewPosition = aTabCols.GetRight() + long(nOffset); - long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset); + tools::Long nNewPosition = aTabCols.GetRight() + tools::Long(nOffset); + tools::Long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset); aTabCols.SetRight(nPosition); } else if (sType == "column-middle" && nIndex < aTabCols.Count()) { auto & rEntry = aTabCols.GetEntry(nIndex); - long nNewPosition = rEntry.nPos + long(nOffset); - long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset); + tools::Long nNewPosition = rEntry.nPos + tools::Long(nOffset); + tools::Long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset); rEntry.nPos = nPosition; } @@ -1135,22 +1135,22 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) if (sType == "row-left") { auto & rEntry = aTabRows.GetEntry(0); - long nNewPosition = aTabRows.GetLeft() + long(nOffset); - long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset); + tools::Long nNewPosition = aTabRows.GetLeft() + tools::Long(nOffset); + tools::Long nPosition = std::min(nNewPosition, rEntry.nPos - constDistanceOffset); aTabRows.SetLeft(nPosition); } else if (sType == "row-right") { auto & rEntry = aTabRows.GetEntry(aTabRows.Count() - 1); - long nNewPosition = aTabRows.GetRight() + long(nOffset); - long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset); + tools::Long nNewPosition = aTabRows.GetRight() + tools::Long(nOffset); + tools::Long nPosition = std::max(nNewPosition, rEntry.nPos + constDistanceOffset); aTabRows.SetRight(nPosition); } else if (sType == "row-middle" && nIndex < aTabRows.Count()) { auto & rEntry = aTabRows.GetEntry(nIndex); - long nNewPosition = rEntry.nPos + long(nOffset); - long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset); + tools::Long nNewPosition = rEntry.nPos + tools::Long(nOffset); + tools::Long nPosition = std::clamp(nNewPosition, rEntry.nMin, rEntry.nMax - constDistanceOffset); rEntry.nPos = nPosition; } @@ -1358,8 +1358,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) // PageOffset/limiter const SwRect& rPageRect = rSh.GetAnyCurRect( CurRectType::Page, pPt ); const SwRect& rPagePrtRect = rSh.GetAnyCurRect( CurRectType::PagePrt, pPt ); - const long nPageWidth = rPageRect.Width(); - const long nPageHeight = rPageRect.Height(); + const tools::Long nPageWidth = rPageRect.Width(); + const tools::Long nPageHeight = rPageRect.Height(); const SwPageDesc& rDesc = rSh.GetPageDesc( IsTabColFromDoc() || m_bTabRowFromDoc ? @@ -1503,8 +1503,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) { // Page margin top bottom SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() ); - SvxLongULSpaceItem aLongUL( static_cast<long>(aUL.GetUpper()), - static_cast<long>(aUL.GetLower()), + SvxLongULSpaceItem aLongUL( static_cast<tools::Long>(aUL.GetUpper()), + static_cast<tools::Long>(aUL.GetLower()), SID_ATTR_LONG_ULSPACE); if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY ) @@ -1541,8 +1541,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) { const SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() ); SvxLongULSpaceItem aLongUL( - static_cast<long>(aUL.GetUpper()), - static_cast<long>(aUL.GetLower()), + static_cast<tools::Long>(aUL.GetUpper()), + static_cast<tools::Long>(aUL.GetLower()), SID_ATTR_PAGE_ULSPACE ); rSet.Put( aLongUL ); @@ -1570,7 +1570,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) const SvxTabStopItem& rDefTabs = rSh.GetDefault(RES_PARATR_TABSTOP); OSL_ENSURE(m_pHRuler, "why is there no ruler?"); - const long nDefTabDist = ::GetTabDist(rDefTabs); + const tools::Long nDefTabDist = ::GetTabDist(rDefTabs); m_pHRuler->SetDefTabDist( nDefTabDist ); m_pVRuler->SetDefTabDist( nDefTabDist ); ::lcl_EraseDefTabs(aTabStops); @@ -1864,8 +1864,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) SvxColumnItem aColItem(nNum, nL, nR); - long nStart = 0; - long nEnd = 0; + tools::Long nStart = 0; + tools::Long nEnd = 0; //columns in right-to-left tables need to be mirrored bool bIsTableRTL = @@ -1980,9 +1980,9 @@ void SwView::StateTabWin(SfxItemSet& rSet) const SwRect &rSizeRect = rSh.GetAnyCurRect(CurRectType::FlyEmbeddedPrt, pPt); bool bUseVertical = bFrameHasVerticalColumns || (!bFrameSelection && bVerticalWriting); - const long lWidth = bUseVertical ? rSizeRect.Height() : rSizeRect.Width(); + const tools::Long lWidth = bUseVertical ? rSizeRect.Height() : rSizeRect.Width(); const SwRect &rRect = rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt); - long nDist2 = ((bUseVertical ? rRect.Height() : rRect.Width()) - lWidth) /2; + tools::Long nDist2 = ((bUseVertical ? rRect.Height() : rRect.Width()) - lWidth) /2; ::lcl_FillSvxColumn(rCol, lWidth, aColItem, nDist2); if(bUseVertical) @@ -2016,7 +2016,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) SvxColumnItem aColItem(nNum); const SwRect aPrtRect = rSh.GetAnyCurRect(CurRectType::PagePrt, pPt); const SvxBoxItem& rBox = rMaster.GetFormatAttr(RES_BOX); - long nDist = rBox.GetSmallestDistance(); + tools::Long nDist = rBox.GetSmallestDistance(); lcl_FillSvxColumn( aCol, @@ -2101,8 +2101,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) SvxColumnItem aColItem(0, nL, nR); - long nStart = 0; - long nEnd = 0; + tools::Long nStart = 0; + tools::Long nEnd = 0; for ( size_t i = 0; i < aTabCols.Count(); ++i ) { @@ -2355,7 +2355,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) } else { - long nLeft = rPagePrtRect.Left(); + tools::Long nLeft = rPagePrtRect.Left(); aRectangle.SetLeft( nStart + nLeft ); aRectangle.SetRight( nPageWidth - nEnd - nLeft ); } diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index e28496725c5e..c77f92073b20 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -1038,7 +1038,7 @@ static OUString lcl_CreateOutlineString( size_t nIndex, nLevel <= pTextNd->GetActualListLevel(); nLevel++ ) { - long nVal = aNumVector[nLevel]; + tools::Long nVal = aNumVector[nLevel]; nVal ++; nVal -= pOutlRule->Get(nLevel).GetStart(); sEntry.append(OUString::number( nVal )); @@ -3132,7 +3132,7 @@ void SwXTextDocument::removePasteEventListener( void SwXTextDocument::paintTile( VirtualDevice &rDevice, int nOutputWidth, int nOutputHeight, int nTilePosX, int nTilePosY, - long nTileWidth, long nTileHeight ) + tools::Long nTileWidth, tools::Long nTileHeight ) { SwViewShell* pViewShell = m_pDocShell->GetWrtShell(); pViewShell->PaintTile(rDevice, nOutputWidth, nOutputHeight, diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 97317e9ed67c..6a0aa7edde25 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -901,11 +901,11 @@ awt::Point SwXTextViewCursor::getPosition() const SwFrameFormat& rMaster = rSh.GetPageDesc( rSh.GetCurPageDesc() ).GetMaster(); const SvxULSpaceItem& rUL = rMaster.GetULSpace(); - const long nY = aCharRect.Top() - (rUL.GetUpper() + DOCUMENTBORDER); + const tools::Long nY = aCharRect.Top() - (rUL.GetUpper() + DOCUMENTBORDER); aRet.Y = convertTwipToMm100(nY); const SvxLRSpaceItem& rLR = rMaster.GetLRSpace(); - const long nX = aCharRect.Left() - (rLR.GetLeft() + DOCUMENTBORDER); + const tools::Long nX = aCharRect.Left() - (rLR.GetLeft() + DOCUMENTBORDER); aRet.X = convertTwipToMm100(nX); return aRet; diff --git a/sw/source/uibase/utlui/attrdesc.cxx b/sw/source/uibase/utlui/attrdesc.cxx index 98c092246a81..334417377106 100644 --- a/sw/source/uibase/utlui/attrdesc.cxx +++ b/sw/source/uibase/utlui/attrdesc.cxx @@ -484,7 +484,7 @@ bool SwFormatCol::GetPresentation rText = OUString::number(nCnt) + " " + SwResId( STR_COLUMNS ); if ( COLADJ_NONE != GetLineAdj() ) { - const long nWdth = static_cast<long>(GetLineWidth()); + const tools::Long nWdth = static_cast<tools::Long>(GetLineWidth()); rText += " " + SwResId( STR_LINE_WIDTH ) + " " + ::GetMetricText( nWdth, eCoreUnit, MapUnit::MapPoint, &rIntl ); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index bc801c5af2d0..fad3aa2a4a2c 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -172,7 +172,7 @@ namespace // Content, contains names and reference at the content type. -SwContent::SwContent(const SwContentType* pCnt, const OUString& rName, long nYPos) : +SwContent::SwContent(const SwContentType* pCnt, const OUString& rName, tools::Long nYPos) : SwTypeNumber(CTYPE_CNT), pParent(pCnt), sContentName(rName), @@ -807,7 +807,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) if (!pTemp->GetName().isEmpty()) { SwContact* pContact = static_cast<SwContact*>(pTemp->GetUserCall()); - long nYPos = 0; + tools::Long nYPos = 0; const Point aNullPt; if(pContact && pContact->GetFormat()) nYPos = pContact->GetFormat()->FindLayoutRect(false, &aNullPt).Top(); diff --git a/sw/source/uibase/utlui/numfmtlb.cxx b/sw/source/uibase/utlui/numfmtlb.cxx index 115f98fddc5e..88b2b27b344a 100644 --- a/sw/source/uibase/utlui/numfmtlb.cxx +++ b/sw/source/uibase/utlui/numfmtlb.cxx @@ -256,7 +256,7 @@ void SwNumFormatBase::SetFormatType(const SvNumFormatType nFormatType) const sal_uInt32 nSysLongDateFormat = pFormatter->GetFormatIndex( NF_DATE_SYSTEM_LONG, eCurLanguage ); - for( long nIndex = eOffsetStart; nIndex <= eOffsetEnd; ++nIndex ) + for( tools::Long nIndex = eOffsetStart; nIndex <= eOffsetEnd; ++nIndex ) { const sal_uInt32 nFormat = pFormatter->GetFormatIndex( static_cast<NfIndexTableOffset>(nIndex), eCurLanguage ); diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx index dbdf78b49ccb..dfe40700d726 100644 --- a/sw/source/uibase/utlui/shdwcrsr.cxx +++ b/sw/source/uibase/utlui/shdwcrsr.cxx @@ -29,7 +29,7 @@ SwShadowCursor::~SwShadowCursor() DrawCursor( aOldPt, nOldHeight, nOldMode ); } -void SwShadowCursor::SetPos( const Point& rPt, long nHeight, sal_uInt16 nMode ) +void SwShadowCursor::SetPos( const Point& rPt, tools::Long nHeight, sal_uInt16 nMode ) { Point aPt( pWin->LogicToPixel( rPt )); nHeight = pWin->LogicToPixel( Size( 0, nHeight )).Height(); @@ -45,17 +45,17 @@ void SwShadowCursor::SetPos( const Point& rPt, long nHeight, sal_uInt16 nMode ) } } -void SwShadowCursor::DrawTri( const Point& rPt, long nHeight, bool bLeft ) +void SwShadowCursor::DrawTri( const Point& rPt, tools::Long nHeight, bool bLeft ) { - long nLineDiff = nHeight / 2; - long nLineDiffHalf = nLineDiff / 2; + tools::Long nLineDiff = nHeight / 2; + tools::Long nLineDiffHalf = nLineDiff / 2; // Dot above Point aPt1( (bLeft ? rPt.X() - 3 : rPt.X() + 3), rPt.Y() + nLineDiffHalf ); // Dot below Point aPt2( aPt1.X(), aPt1.Y() + nHeight - nLineDiff - 1 ); - long nDiff = bLeft ? -1 : 1; + tools::Long nDiff = bLeft ? -1 : 1; while( aPt1.Y() <= aPt2.Y() ) { pWin->DrawLine( aPt1, aPt2 ); @@ -65,7 +65,7 @@ void SwShadowCursor::DrawTri( const Point& rPt, long nHeight, bool bLeft ) } } -void SwShadowCursor::DrawCursor( const Point& rPt, long nHeight, sal_uInt16 nMode ) +void SwShadowCursor::DrawCursor( const Point& rPt, tools::Long nHeight, sal_uInt16 nMode ) { nHeight = (((nHeight / 4)+1) * 4) + 1; @@ -97,11 +97,11 @@ void SwShadowCursor::Paint() tools::Rectangle SwShadowCursor::GetRect() const { - long nH = nOldHeight; + tools::Long nH = nOldHeight; Point aPt( aOldPt ); nH = (((nH / 4)+1) * 4) + 1; - long nWidth = nH / 4 + 3 + 1; + tools::Long nWidth = nH / 4 + 3 + 1; Size aSz( nWidth, nH ); diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx index fbb098e74605..de816541cb07 100644 --- a/sw/source/uibase/utlui/uiitems.cxx +++ b/sw/source/uibase/utlui/uiitems.cxx @@ -86,7 +86,7 @@ bool SwPageFootnoteInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const { Fraction aTmp( 100, 1 ); aTmp *= aFootnoteInfo.GetWidth(); - rVal <<= static_cast<sal_Int8>(static_cast<long>(aTmp)); + rVal <<= static_cast<sal_Int8>(static_cast<tools::Long>(aTmp)); } break; case MID_LINE_ADJUST : rVal <<= static_cast<sal_Int16>(aFootnoteInfo.GetAdj());break;//text::HorizontalAdjust diff --git a/sw/source/uibase/utlui/viewlayoutctrl.cxx b/sw/source/uibase/utlui/viewlayoutctrl.cxx index bdb18bbb376e..9f010e73861d 100644 --- a/sw/source/uibase/utlui/viewlayoutctrl.cxx +++ b/sw/source/uibase/utlui/viewlayoutctrl.cxx @@ -96,12 +96,12 @@ void SwViewLayoutControl::Paint( const UserDrawEvent& rUsrEvt ) const bool bAutomatic = 1 == mpImpl->mnState; const bool bBookMode = 2 == mpImpl->mnState; - const long nImageWidthSum = mpImpl->maImageSingleColumn.GetSizePixel().Width() + + const tools::Long nImageWidthSum = mpImpl->maImageSingleColumn.GetSizePixel().Width() + mpImpl->maImageAutomatic.GetSizePixel().Width() + mpImpl->maImageBookMode.GetSizePixel().Width(); - const long nXOffset = (aRect.GetWidth() - nImageWidthSum) / 2; - const long nYOffset = (aControlRect.GetHeight() - mpImpl->maImageSingleColumn.GetSizePixel().Height()) / 2; + const tools::Long nXOffset = (aRect.GetWidth() - nImageWidthSum) / 2; + const tools::Long nYOffset = (aControlRect.GetHeight() - mpImpl->maImageSingleColumn.GetSizePixel().Height()) / 2; aRect.AdjustLeft( nXOffset ); aRect.AdjustTop( nYOffset ); @@ -122,17 +122,17 @@ bool SwViewLayoutControl::MouseButtonDown( const MouseEvent & rEvt ) { const tools::Rectangle aRect = getControlRect(); const Point aPoint = rEvt.GetPosPixel(); - const long nXDiff = aPoint.X() - aRect.Left(); + const tools::Long nXDiff = aPoint.X() - aRect.Left(); sal_uInt16 nColumns = 1; bool bBookMode = false; - const long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width(); - const long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width(); - const long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width(); - const long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook; + const tools::Long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width(); + const tools::Long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width(); + const tools::Long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width(); + const tools::Long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook; - const long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2; + const tools::Long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2; if ( nXDiff < nXOffset + nImageWidthSingle ) { @@ -170,14 +170,14 @@ bool SwViewLayoutControl::MouseMove( const MouseEvent & rEvt ) { const tools::Rectangle aRect = getControlRect(); const Point aPoint = rEvt.GetPosPixel(); - const long nXDiff = aPoint.X() - aRect.Left(); + const tools::Long nXDiff = aPoint.X() - aRect.Left(); - const long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width(); - const long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width(); - const long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width(); - const long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook; + const tools::Long nImageWidthSingle = mpImpl->maImageSingleColumn.GetSizePixel().Width(); + const tools::Long nImageWidthAuto = mpImpl->maImageAutomatic.GetSizePixel().Width(); + const tools::Long nImageWidthBook = mpImpl->maImageBookMode.GetSizePixel().Width(); + const tools::Long nImageWidthSum = nImageWidthSingle + nImageWidthAuto + nImageWidthBook; - const long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2; + const tools::Long nXOffset = (aRect.GetWidth() - nImageWidthSum)/2; if ( nXDiff < nXOffset + nImageWidthSingle ) { diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx index 14070c71ef8e..491a2fcbdb2a 100644 --- a/sw/source/uibase/wrtsh/move.cxx +++ b/sw/source/uibase/wrtsh/move.cxx @@ -37,7 +37,7 @@ - EndSelect() */ -const long nReadOnlyScrollOfst = 10; +const tools::Long nReadOnlyScrollOfst = 10; namespace { diff --git a/sw/source/uibase/wrtsh/select.cxx b/sw/source/uibase/wrtsh/select.cxx index dc47cb73acdb..2c61e51c1deb 100644 --- a/sw/source/uibase/wrtsh/select.cxx +++ b/sw/source/uibase/wrtsh/select.cxx @@ -46,7 +46,7 @@ namespace com::sun::star::util { using namespace ::com::sun::star::util; -static long nStartDragX = 0, nStartDragY = 0; +static tools::Long nStartDragX = 0, nStartDragY = 0; static bool bStartDrag = false; void SwWrtShell::Invalidate() @@ -300,7 +300,7 @@ void SwWrtShell::PopMode() // eponymous methods in the CursorShell, the second removes // all selections at first. -long SwWrtShell::SetCursor(const Point *pPt, bool bTextOnly) +tools::Long SwWrtShell::SetCursor(const Point *pPt, bool bTextOnly) { // Remove a possibly present selection at the position // of the mouseclick @@ -312,7 +312,7 @@ long SwWrtShell::SetCursor(const Point *pPt, bool bTextOnly) return SwCursorShell::SetCursor(*pPt, bTextOnly); } -long SwWrtShell::SetCursorKillSel(const Point *pPt, bool bTextOnly ) +tools::Long SwWrtShell::SetCursorKillSel(const Point *pPt, bool bTextOnly ) { SwActContext aActContext(this); ResetSelect(pPt,false); @@ -329,7 +329,7 @@ void SwWrtShell::UnSelectFrame() // Remove of all selections -long SwWrtShell::ResetSelect(const Point *,bool) +tools::Long SwWrtShell::ResetSelect(const Point *,bool) { if(IsSelFrameMode()) { @@ -375,7 +375,7 @@ void SwWrtShell::SetSplitVerticalByDefault(bool value) // Do nothing -long SwWrtShell::Ignore(const Point *, bool ) { +tools::Long SwWrtShell::Ignore(const Point *, bool ) { return 1; } diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 69fad015bbde..5fb1b42f75d2 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -611,7 +611,7 @@ bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrame // The current selected OLE object will be loaded with the // verb into the server. -void SwWrtShell::LaunchOLEObj( long nVerb ) +void SwWrtShell::LaunchOLEObj( tools::Long nVerb ) { if ( GetCntType() != CNT_OLE || GetView().GetViewFrame()->GetFrame().IsInPlace() ) @@ -810,7 +810,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, aObjArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ).SSize(); // differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea - long nX, nY; + tools::Long nX, nY; SwSelPaintRects::Get1PixelInLogic( *this, &nX, &nY ); if( !( _aVisArea.Width() - nX <= aObjArea.Width() && _aVisArea.Width() + nX >= aObjArea.Width() && @@ -863,8 +863,8 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, } else { - aArea.Width ( long( aArea.Width() / pCli->GetScaleWidth() ) ); - aArea.Height( long( aArea.Height() / pCli->GetScaleHeight() ) ); + aArea.Width ( tools::Long( aArea.Width() / pCli->GetScaleWidth() ) ); + aArea.Height( tools::Long( aArea.Height() / pCli->GetScaleHeight() ) ); } pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight ); |