use tools::Long in basegfx..chart2

Change-Id: Ide4014348d51f0b5f59e1e91b8d41c7748853254
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104608
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel
2020-10-21 15:34:16 +02:00
committed by Noel Grandin
parent 4bea7a1705
commit 387a88fa25
44 changed files with 135 additions and 127 deletions
+8 -8
View File
@@ -26,7 +26,7 @@ const double ZOOM_FACTOR = 1.12246205;
* @param nCurrent current value
* @param nMultiple multiple against which the current value is rounded
*/
static long roundMultiple(long nCurrent, int nMultiple)
static tools::Long roundMultiple(tools::Long nCurrent, int nMultiple)
{
// round zoom to a multiple of nMultiple
return (( nCurrent + nMultiple / 2 ) - ( nCurrent + nMultiple / 2 ) % nMultiple);
@@ -39,10 +39,10 @@ static long roundMultiple(long nCurrent, int nMultiple)
*
* @param nCurrent current zoom factor
*/
static long roundZoom(double nCurrent)
static tools::Long roundZoom(double nCurrent)
{
// convert nCurrent properly to int
long nNew = nCurrent + 0.5;
tools::Long nNew = nCurrent + 0.5;
// round to more common numbers above 50
if (nNew > 1000) {
@@ -66,7 +66,7 @@ static long roundZoom(double nCurrent)
* @param nPrevious previous zoom factor
* @param nStep step which shouldn't be skipped
*/
static long enforceStep(long nCurrent, long nPrevious, int nStep)
static tools::Long enforceStep(tools::Long nCurrent, tools::Long nPrevious, int nStep)
{
if ((( nCurrent > nStep ) && ( nPrevious < nStep ))
|| (( nCurrent < nStep ) && ( nPrevious > nStep )))
@@ -80,9 +80,9 @@ static long enforceStep(long nCurrent, long nPrevious, int nStep)
*
* @param nCurrent current zoom factor
*/
long zoomIn(long nCurrent)
tools::Long zoomIn(tools::Long nCurrent)
{
long nNew = roundZoom( nCurrent * ZOOM_FACTOR );
tools::Long nNew = roundZoom( nCurrent * ZOOM_FACTOR );
// make sure some values are not skipped
nNew = enforceStep(nNew, nCurrent, 200);
nNew = enforceStep(nNew, nCurrent, 100);
@@ -97,9 +97,9 @@ long zoomIn(long nCurrent)
*
* @param nCurrent current zoom factor
*/
long zoomOut(long nCurrent)
tools::Long zoomOut(tools::Long nCurrent)
{
long nNew = roundZoom( nCurrent / ZOOM_FACTOR );
tools::Long nNew = roundZoom( nCurrent / ZOOM_FACTOR );
// make sure some values are not skipped
nNew = enforceStep(nNew, nCurrent, 200);
nNew = enforceStep(nNew, nCurrent, 100);
+8 -7
View File
@@ -24,6 +24,7 @@
#include <rtl/math.hxx>
#include <parser.hxx>
#include <expr.hxx>
#include <tools/long.hxx>
#include <basic/sberrors.hxx>
@@ -294,8 +295,8 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* pParser)
{
double nl = pLeft->nVal;
double nr = pRight->nVal;
long ll = 0, lr = 0;
long llMod = 0, lrMod = 0;
tools::Long ll = 0, lr = 0;
tools::Long llMod = 0, lrMod = 0;
if( ( eTok >= AND && eTok <= IMP )
|| eTok == IDIV || eTok == MOD )
{
@@ -321,9 +322,9 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* pParser)
bErr = true;
nr = SbxMINLNG;
}
ll = static_cast<long>(nl); lr = static_cast<long>(nr);
llMod = static_cast<long>(nl);
lrMod = static_cast<long>(nr);
ll = static_cast<tools::Long>(nl); lr = static_cast<tools::Long>(nr);
llMod = static_cast<tools::Long>(nl);
lrMod = static_cast<tools::Long>(nr);
if( bErr )
{
pParser->Error( ERRCODE_BASIC_MATH_OVERFLOW );
@@ -411,7 +412,7 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* pParser)
&& nVal >= SbxMINLNG && nVal <= SbxMAXLNG )
{
// Decimal place away
long n = static_cast<long>(nVal);
tools::Long n = static_cast<tools::Long>(nVal);
nVal = n;
eType = ( n >= SbxMININT && n <= SbxMAXINT )
? SbxINTEGER : SbxLONG;
@@ -450,7 +451,7 @@ void SbiExprNode::FoldConstantsUnaryNode(SbiParser* pParser)
pParser->Error( ERRCODE_BASIC_MATH_OVERFLOW );
bError = true;
}
nVal = static_cast<double>(~static_cast<long>(nVal));
nVal = static_cast<double>(~static_cast<tools::Long>(nVal));
eType = SbxLONG;
} break;
default: break;
+2 -1
View File
@@ -26,6 +26,7 @@
#include <stdio.h>
#include <rtl/character.hxx>
#include <basic/sberrors.hxx>
#include <tools/long.hxx>
// All symbol names are laid down int the symbol-pool's stringpool, so that
// all symbols are handled in the same case. On saving the code-image, the
@@ -69,7 +70,7 @@ short SbiStringPool::Add( double n, SbxDataType t )
// tdf#131296 - store numeric value including its type character
// See GetSuffixType in basic/source/comp/scanner.cxx for type characters
case SbxINTEGER: snprintf( buf, sizeof(buf), "%d%%", static_cast<short>(n) ); break;
case SbxLONG: snprintf( buf, sizeof(buf), "%ld&", static_cast<long>(n) ); break;
case SbxLONG: snprintf( buf, sizeof(buf), "%ld&", static_cast<tools::Long>(n) ); break;
case SbxSINGLE: snprintf( buf, sizeof(buf), "%.6g!", static_cast<float>(n) ); break;
case SbxDOUBLE: snprintf( buf, sizeof(buf), "%.16g", n ); break; // default processing in SbiRuntime::StepLOADNC - no type character
case SbxCURRENCY: snprintf(buf, sizeof(buf), "%.16g@", n); break;
+1 -1
View File
@@ -53,7 +53,7 @@ ErrCode SbiDdeControl::GetLastErr( const DdeConnection* pConv )
{
return ERRCODE_NONE;
}
long nErr = pConv->GetError();
tools::Long nErr = pConv->GetError();
if( !nErr )
{
return ERRCODE_NONE;
+4 -4
View File
@@ -35,7 +35,7 @@ class SvRTLInputBox : public weld::GenericDialogController
std::unique_ptr<weld::Label> m_xPromptText;
OUString m_aText;
void PositionDialog( long nXTwips, long nYTwips );
void PositionDialog( tools::Long nXTwips, tools::Long nYTwips );
void InitButtons();
void SetPrompt(const OUString& rPrompt);
DECL_LINK( OkHdl, weld::Button&, void );
@@ -43,7 +43,7 @@ class SvRTLInputBox : public weld::GenericDialogController
public:
SvRTLInputBox(weld::Window* pParent, const OUString& rPrompt, const OUString& rTitle,
const OUString& rDefault, long nXTwips, long nYTwips );
const OUString& rDefault, tools::Long nXTwips, tools::Long nYTwips );
OUString const & GetText() const { return m_aText; }
};
@@ -51,7 +51,7 @@ public:
SvRTLInputBox::SvRTLInputBox(weld::Window* pParent, const OUString& rPrompt,
const OUString& rTitle, const OUString& rDefault,
long nXTwips, long nYTwips)
tools::Long nXTwips, tools::Long nYTwips)
: GenericDialogController(pParent, "svt/ui/inputbox.ui", "InputBox")
, m_xEdit(m_xBuilder->weld_entry("entry"))
, m_xOk(m_xBuilder->weld_button("ok"))
@@ -72,7 +72,7 @@ void SvRTLInputBox::InitButtons()
m_xCancel->connect_clicked(LINK(this,SvRTLInputBox,CancelHdl));
}
void SvRTLInputBox::PositionDialog(long nXTwips, long nYTwips)
void SvRTLInputBox::PositionDialog(tools::Long nXTwips, tools::Long nYTwips)
{
if( nXTwips != -1 && nYTwips != -1 )
{
+10 -10
View File
@@ -124,7 +124,7 @@ static void FilterWhiteSpace( OUString& rStr )
rStr = aRet.makeStringAndClear();
}
static long GetDayDiff( const Date& rDate );
static tools::Long GetDayDiff( const Date& rDate );
static const CharClass& GetCharClass()
{
@@ -782,7 +782,7 @@ void SbRtl_FileLen(StarBASIC *, SbxArray & rPar, bool)
(void)aItem.getFileStatus( aFileStatus );
nLen = static_cast<sal_Int32>(aFileStatus.getFileSize());
}
rPar.Get32(0)->PutLong( static_cast<long>(nLen) );
rPar.Get32(0)->PutLong( static_cast<tools::Long>(nLen) );
}
}
@@ -2218,7 +2218,7 @@ double Now_Impl()
{
DateTime aDateTime( DateTime::SYSTEM );
double aSerial = static_cast<double>(GetDayDiff( aDateTime ));
long nSeconds = aDateTime.GetHour();
tools::Long nSeconds = aDateTime.GetHour();
nSeconds *= 3600;
nSeconds += aDateTime.GetMin() * 60;
nSeconds += aDateTime.GetSec();
@@ -2254,7 +2254,7 @@ void SbRtl_Time(StarBASIC *, SbxArray & rPar, bool bWrite)
else
{
// Time: system dependent
long nSeconds=aTime.GetHour();
tools::Long nSeconds=aTime.GetHour();
nSeconds *= 3600;
nSeconds += aTime.GetMin() * 60;
nSeconds += aTime.GetSec();
@@ -2287,7 +2287,7 @@ void SbRtl_Time(StarBASIC *, SbxArray & rPar, bool bWrite)
void SbRtl_Timer(StarBASIC *, SbxArray & rPar, bool)
{
tools::Time aTime( tools::Time::SYSTEM );
long nSeconds = aTime.GetHour();
tools::Long nSeconds = aTime.GetHour();
nSeconds *= 3600;
nSeconds += aTime.GetMin() * 60;
nSeconds += aTime.GetSec();
@@ -3067,7 +3067,7 @@ void SbRtl_FileDateTime(StarBASIC *, SbxArray & rPar, bool)
else
{
double fSerial = static_cast<double>(GetDayDiff( aDate ));
long nSeconds = aTime.GetHour();
tools::Long nSeconds = aTime.GetHour();
nSeconds *= 3600;
nSeconds += aTime.GetMin() * 60;
nSeconds += aTime.GetSec();
@@ -4657,10 +4657,10 @@ void SbRtl_Partition(StarBASIC *, SbxArray & rPar, bool)
#endif
static long GetDayDiff( const Date& rDate )
static tools::Long GetDayDiff( const Date& rDate )
{
Date aRefDate( 1,1,1900 );
long nDiffDays;
tools::Long nDiffDays;
if ( aRefDate > rDate )
{
nDiffDays = aRefDate - rDate;
@@ -4677,7 +4677,7 @@ static long GetDayDiff( const Date& rDate )
sal_Int16 implGetDateYear( double aDate )
{
Date aRefDate( 1,1,1900 );
long nDays = static_cast<long>(aDate);
tools::Long nDays = static_cast<tools::Long>(aDate);
nDays -= 2; // standardize: 1.1.1900 => 0.0
aRefDate.AddDays( nDays );
sal_Int16 nRet = aRefDate.GetYear();
@@ -4788,7 +4788,7 @@ bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay,
}
}
long nDiffDays = GetDayDiff( aCurDate );
tools::Long nDiffDays = GetDayDiff( aCurDate );
rdRet = static_cast<double>(nDiffDays);
return true;
}
+4 -4
View File
@@ -559,13 +559,13 @@ void Wait_Impl( bool bDurationBased, SbxArray& rPar )
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
return;
}
long nWait = 0;
tools::Long nWait = 0;
if ( bDurationBased )
{
double dWait = rPar.Get32(1)->GetDouble();
double dNow = Now_Impl();
double dSecs = ( dWait - dNow ) * 24.0 * 3600.0;
nWait = static_cast<long>( dSecs * 1000 ); // wait in thousands of sec
nWait = static_cast<tools::Long>( dSecs * 1000 ); // wait in thousands of sec
}
else
{
@@ -1124,7 +1124,7 @@ static void PutGet( SbxArray& rPar, bool bPut )
SbxVariable* pVar2 = rPar.Get32(2);
SbxDataType eType2 = pVar2->GetType();
bool bHasRecordNo = (eType2 != SbxEMPTY && eType2 != SbxERROR);
long nRecordNo = pVar2->GetLong();
tools::Long nRecordNo = pVar2->GetLong();
if ( nFileNo < 1 || ( bHasRecordNo && nRecordNo < 1 ) )
{
StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT );
@@ -1217,7 +1217,7 @@ void SbRtl_Environ(StarBASIC *, SbxArray & rPar, bool)
rPar.Get32(0)->PutString( aResult );
}
static double GetDialogZoomFactor( bool bX, long nValue )
static double GetDialogZoomFactor( bool bX, tools::Long nValue )
{
OutputDevice* pDevice = Application::GetDefaultDevice();
double nResult = 0;
+2 -2
View File
@@ -190,8 +190,8 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e
{
try
{
long nSource = SotStorage::GetVersion( mxStorage );
long nTarget = SotStorage::GetVersion( xStorage );
tools::Long nSource = SotStorage::GetVersion( mxStorage );
tools::Long nTarget = SotStorage::GetVersion( xStorage );
if ( nSource == SOFFICE_FILEFORMAT_CURRENT &&
nTarget != SOFFICE_FILEFORMAT_CURRENT )
+1 -1
View File
@@ -78,7 +78,7 @@ namespace cairocanvas
if( !::basegfx::fTools::equalZero( fDividend) )
fStretch /= fDividend;
const long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
const tools::Long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
maFont->SetAverageFontWidth( nNewWidth );
+2 -2
View File
@@ -360,8 +360,8 @@ namespace cairocanvas
if( !pSurface )
{
long nWidth;
long nHeight;
tools::Long nWidth;
tools::Long nHeight;
vcl::bitmap::CanvasCairoExtractBitmapData(aBmpEx, aBitmap, data, bHasAlpha, nWidth, nHeight);
SurfaceSharedPtr pImageSurface = rSurfaceProvider->getOutputDevice()->CreateSurface(
+1 -1
View File
@@ -324,7 +324,7 @@ namespace cairocanvas
};
}
void TextLayout::setupTextOffsets( long* outputOffsets,
void TextLayout::setupTextOffsets( tools::Long* outputOffsets,
const uno::Sequence< double >& inputOffsets,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState ) const
+1 -1
View File
@@ -86,7 +86,7 @@ namespace cairocanvas
const css::rendering::ViewState& viewState,
const css::rendering::RenderState& renderState ) const;
void setupTextOffsets( long* outputOffsets,
void setupTextOffsets( tools::Long* outputOffsets,
const css::uno::Sequence< double >& inputOffsets,
const css::rendering::ViewState& viewState,
const css::rendering::RenderState& renderState ) const;
+1 -1
View File
@@ -78,7 +78,7 @@ namespace vclcanvas
if( !::basegfx::fTools::equalZero( fDividend) )
fStretch /= fDividend;
const long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
const ::tools::Long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
maFont->SetAverageFontWidth( nNewWidth );
+1 -1
View File
@@ -325,7 +325,7 @@ namespace vclcanvas
// paint sprite prio
vcl::Font aVCLFont;
aVCLFont.SetFontHeight( std::min(long(20),aOutputSize.Height()) );
aVCLFont.SetFontHeight( std::min(::tools::Long(20),aOutputSize.Height()) );
aVCLFont.SetColor( COL_RED );
rTargetSurface.SetTextAlign(ALIGN_TOP);
+1 -1
View File
@@ -388,7 +388,7 @@ namespace vclcanvas
};
}
void TextLayout::setupTextOffsets( long* outputOffsets,
void TextLayout::setupTextOffsets( ::tools::Long* outputOffsets,
const uno::Sequence< double >& inputOffsets,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState ) const
+1 -1
View File
@@ -85,7 +85,7 @@ namespace vclcanvas
const css::rendering::RenderState& renderState ) const;
private:
void setupTextOffsets( long* outputOffsets,
void setupTextOffsets( ::tools::Long* outputOffsets,
const css::uno::Sequence< double >& inputOffsets,
const css::rendering::ViewState& viewState,
const css::rendering::RenderState& renderState ) const;
+1 -1
View File
@@ -131,7 +131,7 @@ class DemoRenderer
void drawGrid()
{
long d, dIncr = maSize.Width() / 3;
tools::Long d, dIncr = maSize.Width() / 3;
for ( d = 0; d <= maSize.Width(); d += dIncr )
mxCanvas->drawLine( geometry::RealPoint2D( d, 0 ),
geometry::RealPoint2D( d, maSize.Height() ),
+3 -3
View File
@@ -968,17 +968,17 @@ void Chart2ImportTest::testTdf105517()
Reference<beans::XPropertySet> xPropSet1(xDSContainer->getDataSeries()[0], uno::UNO_QUERY);
CPPUNIT_ASSERT(xPropSet1.is());
long lineColor;
tools::Long lineColor;
xPropSet1->getPropertyValue("Color") >>= lineColor;
// incorrect line color was 0x4a7ebb due to not handling themeOverride
CPPUNIT_ASSERT_EQUAL(long(0xeaa700), lineColor);
CPPUNIT_ASSERT_EQUAL(tools::Long(0xeaa700), lineColor);
Reference<beans::XPropertySet> xPropSet2(xDSContainer->getDataSeries()[1], uno::UNO_QUERY);
CPPUNIT_ASSERT(xPropSet2.is());
xPropSet2->getPropertyValue("Color") >>= lineColor;
// incorrect line color was 0x98b855
CPPUNIT_ASSERT_EQUAL(long(0x1e69a8), lineColor);
CPPUNIT_ASSERT_EQUAL(tools::Long(0x1e69a8), lineColor);
}
void Chart2ImportTest::testTdf106217()
@@ -20,6 +20,7 @@
#include "WrappedGapwidthProperty.hxx"
#include "Chart2ModelContact.hxx"
#include <DiagramHelper.hxx>
#include <tools/long.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -82,7 +83,7 @@ void WrappedBarPositionProperty_Base::setPropertyValue( const Any& rOuterValue,
Sequence< sal_Int32 > aBarPositionSequence;
xProp->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence;
long nOldLength = aBarPositionSequence.getLength();
tools::Long nOldLength = aBarPositionSequence.getLength();
if( nOldLength <= m_nAxisIndex )
{
aBarPositionSequence.realloc( m_nAxisIndex+1 );
@@ -70,7 +70,7 @@ const BrowserMode BrowserStdFlags = BrowserMode::COLUMNSELECTION |
BrowserMode::AUTO_HSCROLL | BrowserMode::AUTO_VSCROLL |
BrowserMode::HIDESELECT;
sal_Int32 lcl_getRowInData( long nRow )
sal_Int32 lcl_getRowInData( tools::Long nRow )
{
return static_cast< sal_Int32 >( nRow );
}
@@ -607,7 +607,7 @@ void DataBrowser::RenewTable()
if (!m_apDataBrowserModel)
return;
long nOldRow = GetCurRow();
tools::Long nOldRow = GetCurRow();
sal_uInt16 nOldColId = GetCurColumnId();
bool bLastUpdateMode = GetUpdateMode();
@@ -684,7 +684,7 @@ OUString DataBrowser::GetColString( sal_Int32 nColumnId ) const
return OUString();
}
OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
OUString DataBrowser::GetCellText( tools::Long nRow, sal_uInt16 nColumnId ) const
{
OUString aResult;
@@ -744,7 +744,7 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
return aResult;
}
double DataBrowser::GetCellNumber( long nRow, sal_uInt16 nColumnId ) const
double DataBrowser::GetCellNumber( tools::Long nRow, sal_uInt16 nColumnId ) const
{
double fResult;
::rtl::math::setNan( & fResult );
@@ -1063,7 +1063,7 @@ void DataBrowser::PaintCell(
rDev.SetClipRegion();
}
bool DataBrowser::SeekRow( long nRow )
bool DataBrowser::SeekRow( tools::Long nRow )
{
if( ! EditBrowseBox::SeekRow( nRow ))
return false;
@@ -1078,14 +1078,14 @@ bool DataBrowser::SeekRow( long nRow )
bool DataBrowser::IsTabAllowed( bool bForward ) const
{
long nRow = GetCurRow();
long nCol = GetCurColumnId();
tools::Long nRow = GetCurRow();
tools::Long nCol = GetCurColumnId();
// column 0 is header-column
long nBadCol = bForward
tools::Long nBadCol = bForward
? GetColumnCount() - 1
: 1;
long nBadRow = bForward
tools::Long nBadRow = bForward
? GetRowCount() - 1
: 0;
@@ -1099,7 +1099,7 @@ bool DataBrowser::IsTabAllowed( bool bForward ) const
nCol != nBadCol );
}
::svt::CellController* DataBrowser::GetController( long /*nRow*/, sal_uInt16 nCol )
::svt::CellController* DataBrowser::GetController( tools::Long /*nRow*/, sal_uInt16 nCol )
{
if( m_bIsReadOnly )
return nullptr;
@@ -1116,7 +1116,7 @@ bool DataBrowser::IsTabAllowed( bool bForward ) const
}
void DataBrowser::InitController(
::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol )
::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol )
{
if( rController == m_rTextEditController )
{
@@ -55,10 +55,10 @@ class DataBrowser : public ::svt::EditBrowseBox
protected:
// EditBrowseBox overridables
virtual void PaintCell( OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColumnId ) const override;
virtual bool SeekRow( long nRow ) override;
virtual bool SeekRow( tools::Long nRow ) override;
virtual bool IsTabAllowed( bool bForward ) const override;
virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ) override;
virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ) override;
virtual ::svt::CellController* GetController( tools::Long nRow, sal_uInt16 nCol ) override;
virtual void InitController( ::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol ) override;
virtual bool SaveModified() override;
virtual void CursorMoved() override;
// called whenever the control of the current cell has been modified
@@ -82,12 +82,12 @@ public:
@return
the text out of the cell
*/
virtual OUString GetCellText(long nRow, sal_uInt16 nColId) const override;
virtual OUString GetCellText(tools::Long nRow, sal_uInt16 nColId) const override;
/** returns the number in the given cell. If a cell is empty or contains a
string, the result will be Nan
*/
double GetCellNumber( long nRow, sal_uInt16 nColumnId ) const;
double GetCellNumber( tools::Long nRow, sal_uInt16 nColumnId ) const;
bool isDateTimeString( const OUString& aInputString, double& fOutDateTimeValue );
@@ -154,7 +154,7 @@ private:
std::shared_ptr< NumberFormatterWrapper > m_spNumberFormatterWrapper;
/// the row that is currently painted
long m_nSeekRow;
tools::Long m_nSeekRow;
bool m_bIsReadOnly;
bool m_bDataValid;
@@ -236,7 +236,7 @@ void DataLabelResources::EnableControls()
// Enable or disable separator, placement and direction based on the check
// box states. Note that the check boxes are tri-state.
{
long nNumberOfCheckedLabelParts = 0;
tools::Long nNumberOfCheckedLabelParts = 0;
if (m_xCBNumber->get_state() != TRISTATE_FALSE)
++nNumberOfCheckedLabelParts;
if (m_xCBPercent->get_state() != TRISTATE_FALSE && m_xCBPercent->get_sensitive())
@@ -101,8 +101,8 @@ bool AxisPositionsTabPage::FillItemSet(SfxItemSet* rOutAttrs)
rOutAttrs->Put( SfxInt32Item( SCHATTR_AXIS_LABEL_POSITION, nLabelPos ));
// tick marks
long nTicks=0;
long nMinorTicks=0;
tools::Long nTicks=0;
tools::Long nMinorTicks=0;
if(m_xCB_MinorInner->get_active())
nMinorTicks|=CHAXIS_MARK_INNER;
@@ -211,7 +211,7 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
PlaceLabelsSelectHdl( *m_xLB_PlaceLabels );
// Tick marks
long nTicks = 0, nMinorTicks = 0;
tools::Long nTicks = 0, nMinorTicks = 0;
if (rInAttrs->GetItemState(SCHATTR_AXIS_TICKS,true, &pPoolItem)== SfxItemState::SET)
nTicks = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
if (rInAttrs->GetItemState(SCHATTR_AXIS_HELPTICKS,true, &pPoolItem)== SfxItemState::SET)
@@ -49,7 +49,7 @@ bool SchLayoutTabPage::FillItemSet(SfxItemSet* rOutAttrs)
int nShape = m_pGeometryResources ? m_pGeometryResources->get_selected_index() : -1;
if (nShape != -1)
{
long nSegs=32;
tools::Long nSegs=32;
if (nShape==CHART_SHAPE3D_PYRAMID)
nSegs=4;
@@ -66,7 +66,7 @@ void SchLayoutTabPage::Reset(const SfxItemSet* rInAttrs)
if (rInAttrs->GetItemState(SCHATTR_STYLE_SHAPE,true, &pPoolItem) == SfxItemState::SET)
{
long nVal = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
tools::Long nVal = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
if(m_pGeometryResources)
{
m_pGeometryResources->select(static_cast<sal_uInt16>(nVal));
@@ -74,7 +74,7 @@ void PolarOptionsTabPage::Reset(const SfxItemSet* rInAttrs)
if (rInAttrs->GetItemState(SCHATTR_STARTING_ANGLE, true, &pPoolItem) == SfxItemState::SET)
{
long nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
tools::Long nTmp = static_cast<tools::Long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
m_xAngleDial->SetRotation( nTmp*100 );
}
else
@@ -119,7 +119,7 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
m_xRbtAxis2->set_active(false);
if (rInAttrs->GetItemState(SCHATTR_AXIS,true, &pPoolItem) == SfxItemState::SET)
{
long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
tools::Long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
if(nVal==CHART_AXIS_SECONDARY_Y)
{
m_xRbtAxis2->set_active(true);
@@ -127,16 +127,16 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
}
}
long nTmp;
tools::Long nTmp;
if (rInAttrs->GetItemState(SCHATTR_BAR_GAPWIDTH, true, &pPoolItem) == SfxItemState::SET)
{
nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
nTmp = static_cast<tools::Long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
m_xMTGap->set_value(nTmp, FieldUnit::PERCENT);
}
if (rInAttrs->GetItemState(SCHATTR_BAR_OVERLAP, true, &pPoolItem) == SfxItemState::SET)
{
nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
nTmp = static_cast<tools::Long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
m_xMTOverlap->set_value(nTmp, FieldUnit::PERCENT);
}
@@ -185,7 +185,7 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
m_xRB_ContinueLine->set_sensitive(true);
}
long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
tools::Long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
if(nVal==css::chart::MissingValueTreatment::LEAVE_GAP)
m_xRB_DontPaint->set_active(true);
else if(nVal==css::chart::MissingValueTreatment::USE_ZERO)
@@ -305,7 +305,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
break;
case SCHATTR_AXIS_TIME_RESOLUTION:
{
long nTimeResolution=0;
tools::Long nTimeResolution=0;
if( rTimeIncrement.TimeResolution >>= nTimeResolution )
rOutItemSet.Put( SfxInt32Item( nWhichId, nTimeResolution ) );
else if( m_pExplicitScale )
@@ -47,10 +47,10 @@ using namespace ::com::sun::star::chart2;
static void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectangle& rPosAndSize, const awt::Size& rOriginalSize )
{
long nPosX(0);
long nPosY(0);
long nSizX(0);
long nSizY(0);
tools::Long nPosX(0);
tools::Long nPosY(0);
tools::Long nSizX(0);
tools::Long nSizY(0);
RectPoint eRP = RectPoint::LT;
@@ -1549,8 +1549,8 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
awt::Point aPos( xShape->getPosition() );
awt::Size aSize( xShape->getSize() );
awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) );
aPos.X = static_cast< long >( static_cast< double >( aPos.X ) + fShiftAmountX );
aPos.Y = static_cast< long >( static_cast< double >( aPos.Y ) + fShiftAmountY );
aPos.X = static_cast< tools::Long >( static_cast< double >( aPos.X ) + fShiftAmountX );
aPos.Y = static_cast< tools::Long >( static_cast< double >( aPos.Y ) + fShiftAmountY );
if( aPos.X + aSize.Width > aPageSize.Width )
aPos.X = aPageSize.Width - aSize.Width;
if( aPos.X < 0 )
@@ -98,7 +98,7 @@ void DragMethod_PieSegment::MoveSdrDrag(const Point& rPnt)
m_fAdditionalOffset = 1.0 - m_fInitialOffset;
B2DVector aNewPosVector = m_aStartVector + (m_aDragDirection * m_fAdditionalOffset);
Point aNewPos( static_cast<long>(aNewPosVector.getX()), static_cast<long>(aNewPosVector.getY()) );
Point aNewPos( static_cast<tools::Long>(aNewPosVector.getX()), static_cast<tools::Long>(aNewPosVector.getY()) );
if( aNewPos != DragStat().GetNow() )
{
Hide();
@@ -81,8 +81,8 @@ static ::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel&
if ( pLineEndList.is() )
{
OUString aName(SvxResId(pResId));
long nCount = pLineEndList->Count();
for ( long nIndex = 0; nIndex < nCount; ++nIndex )
tools::Long nCount = pLineEndList->Count();
for ( tools::Long nIndex = 0; nIndex < nCount; ++nIndex )
{
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex);
if ( pEntry->GetName() == aName )
@@ -191,10 +191,10 @@ void DrawCommandDispatch::setLineEnds( SfxItemSet& rAttr )
SfxItemSet aSet( pDrawViewWrapper->GetModel()->GetItemPool() );
pDrawViewWrapper->GetAttributes( aSet );
long nWidth = 300; // (1/100th mm)
tools::Long nWidth = 300; // (1/100th mm)
if ( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
{
long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
tools::Long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
if ( nValue > 0 )
{
nWidth = nValue * 3;
+4 -4
View File
@@ -283,10 +283,10 @@ void ChartModel::impl_adjustAdditionalShapesPositionAndSize( const awt::Size& aV
double fWidth = static_cast< double >( aVisualAreaSize.Width ) / m_aVisualAreaSize.Width;
double fHeight = static_cast< double >( aVisualAreaSize.Height ) / m_aVisualAreaSize.Height;
aPos.X = static_cast< long >( aPos.X * fWidth );
aPos.Y = static_cast< long >( aPos.Y * fHeight );
aSize.Width = static_cast< long >( aSize.Width * fWidth );
aSize.Height = static_cast< long >( aSize.Height * fHeight );
aPos.X = static_cast< tools::Long >( aPos.X * fWidth );
aPos.Y = static_cast< tools::Long >( aPos.Y * fHeight );
aSize.Width = static_cast< tools::Long >( aSize.Width * fWidth );
aSize.Height = static_cast< tools::Long >( aSize.Height * fHeight );
xShape->setPosition( aPos );
xShape->setSize( aSize );
+1 -1
View File
@@ -66,7 +66,7 @@ bool DateHelper::IsLessThanOneYearAway( const Date& rD1, const Date& rD2 )
return rD2 > aDMin && rD2 < aDMax;
}
double DateHelper::RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution )
double DateHelper::RasterizeDateValue( double fValue, const Date& rNullDate, tools::Long TimeResolution )
{
if (std::isnan(fValue))
return fValue;
@@ -185,19 +185,19 @@ void MergedMinimumAndMaximumSupplier::clearMinimumAndMaximumSupplierList()
m_aMinimumAndMaximumSupplierList.clear();
}
long MergedMinimumAndMaximumSupplier::calculateTimeResolutionOnXAxis()
tools::Long MergedMinimumAndMaximumSupplier::calculateTimeResolutionOnXAxis()
{
long nRet = css::chart::TimeUnit::YEAR;
tools::Long nRet = css::chart::TimeUnit::YEAR;
for (auto const& elem : m_aMinimumAndMaximumSupplierList)
{
long nCurrent = elem->calculateTimeResolutionOnXAxis();
tools::Long nCurrent = elem->calculateTimeResolutionOnXAxis();
if(nRet>nCurrent)
nRet=nCurrent;
}
return nRet;
}
void MergedMinimumAndMaximumSupplier::setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate )
void MergedMinimumAndMaximumSupplier::setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate )
{
for (auto const& elem : m_aMinimumAndMaximumSupplierList)
elem->setTimeResolutionOnXAxis( nTimeResolution, rNullDate );
+8 -7
View File
@@ -26,6 +26,7 @@
#include <com/sun/star/chart2/AxisType.hpp>
#include <rtl/math.hxx>
#include <tools/long.hxx>
#include <limits>
namespace chart
@@ -612,11 +613,11 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
nMaxMainIncrementCount--;
//choose major time interval:
long nDayCount = aMaxDate - aMinDate;
long nMainIncrementCount = 1;
tools::Long nDayCount = aMaxDate - aMinDate;
tools::Long nMainIncrementCount = 1;
if( !bAutoMajor )
{
long nIntervalDayCount = rExplicitIncrement.MajorTimeInterval.Number;
tools::Long nIntervalDayCount = rExplicitIncrement.MajorTimeInterval.Number;
if( rExplicitIncrement.MajorTimeInterval.TimeUnit < rExplicitScale.TimeResolution )
rExplicitIncrement.MajorTimeInterval.TimeUnit = rExplicitScale.TimeResolution;
switch( rExplicitIncrement.MajorTimeInterval.TimeUnit )
@@ -636,8 +637,8 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
}
if( bAutoMajor )
{
long nNumer = 1;
long nIntervalDays = nDayCount / nMaxMainIncrementCount;
tools::Long nNumer = 1;
tools::Long nIntervalDays = nDayCount / nMaxMainIncrementCount;
double nDaysPerInterval = 1.0;
if( nIntervalDays>365 || rExplicitScale.TimeResolution==YEAR )
{
@@ -672,7 +673,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
}
}
rExplicitIncrement.MajorTimeInterval.Number = nNumer;
nMainIncrementCount = static_cast<long>(nDayCount/(nNumer*nDaysPerInterval));
nMainIncrementCount = static_cast<tools::Long>(nDayCount/(nNumer*nDaysPerInterval));
}
//choose minor time interval:
@@ -680,7 +681,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
{
if( rExplicitIncrement.MinorTimeInterval.TimeUnit > rExplicitIncrement.MajorTimeInterval.TimeUnit )
rExplicitIncrement.MinorTimeInterval.TimeUnit = rExplicitIncrement.MajorTimeInterval.TimeUnit;
long nIntervalDayCount = rExplicitIncrement.MinorTimeInterval.Number;
tools::Long nIntervalDayCount = rExplicitIncrement.MinorTimeInterval.Number;
switch( rExplicitIncrement.MinorTimeInterval.TimeUnit )
{
case DAY:
@@ -1620,16 +1620,16 @@ void VSeriesPlotter::setMappedProperties(
PropertyMapper::setMappedProperties(xTargetProp,xSource,rMap,pOverwriteMap);
}
void VSeriesPlotter::setTimeResolutionOnXAxis( long TimeResolution, const Date& rNullDate )
void VSeriesPlotter::setTimeResolutionOnXAxis( tools::Long TimeResolution, const Date& rNullDate )
{
m_nTimeResolution = TimeResolution;
m_aNullDate = rNullDate;
}
// MinimumAndMaximumSupplier
long VSeriesPlotter::calculateTimeResolutionOnXAxis()
tools::Long VSeriesPlotter::calculateTimeResolutionOnXAxis()
{
long nRet = css::chart::TimeUnit::YEAR;
tools::Long nRet = css::chart::TimeUnit::YEAR;
if (!m_pExplicitCategoriesProvider)
return nRet;
+2 -1
View File
@@ -19,6 +19,7 @@
#pragma once
#include <tools/date.hxx>
#include <tools/long.hxx>
namespace chart
{
@@ -34,7 +35,7 @@ public:
static bool IsLessThanOneMonthAway( const Date& rD1, const Date& rD2 );
static bool IsLessThanOneYearAway( const Date& rD1, const Date& rD2 );
static double RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution );
static double RasterizeDateValue( double fValue, const Date& rNullDate, tools::Long TimeResolution );
};
} //namespace chart
@@ -21,6 +21,7 @@
#include <sal/types.h>
#include <tools/date.hxx>
#include <tools/long.hxx>
#include <set>
namespace chart
@@ -47,8 +48,8 @@ public:
virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) = 0;
//return a constant out of css::chart::TimeUnit that allows to display the smallest distance between occurring dates
virtual long calculateTimeResolutionOnXAxis() = 0;
virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) = 0;
virtual tools::Long calculateTimeResolutionOnXAxis() = 0;
virtual void setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate ) = 0;
protected:
~MinimumAndMaximumSupplier() {}
@@ -78,8 +79,8 @@ public:
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) override;
virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) override;
virtual long calculateTimeResolutionOnXAxis() override;
virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) override;
virtual tools::Long calculateTimeResolutionOnXAxis() override;
virtual void setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate ) override;
private:
typedef std::set< MinimumAndMaximumSupplier* > MinimumAndMaximumSupplierSet;
@@ -22,6 +22,7 @@
#include <basegfx/range/b2drectangle.hxx>
#include <rtl/math.hxx>
#include <tools/long.hxx>
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
#include <basegfx/matrix/b3dhommatrix.hxx>
@@ -106,7 +107,7 @@ public:
inline bool maySkipPointsInRegressionCalculation() const;
void setTimeResolution( long nTimeResolution, const Date& rNullDate );
void setTimeResolution( tools::Long nTimeResolution, const Date& rNullDate );
virtual void setScaledCategoryWidth( double fScaledCategoryWidth );
void AllowShiftXAxisPos( bool bAllowShift );
void AllowShiftZAxisPos( bool bAllowShift );
@@ -127,7 +128,7 @@ protected: //member
bool m_bMaySkipPointsInRegressionCalculation;
bool m_bDateAxis;
long m_nTimeResolution;
tools::Long m_nTimeResolution;
Date m_aNullDate;
double m_fScaledCategoryWidth;
+3 -3
View File
@@ -171,8 +171,8 @@ public:
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) override;
virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) override;
virtual long calculateTimeResolutionOnXAxis() override;
virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) override;
virtual tools::Long calculateTimeResolutionOnXAxis() override;
virtual void setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate ) override;
void getMinimumAndMaximumX( double& rfMinimum, double& rfMaximum ) const;
void getMinimumAndMaximumYInContinuousXRange( double& rfMinY, double& rfMaxY, double fMinX, double fMaxX, sal_Int32 nAxisIndex ) const;
@@ -412,7 +412,7 @@ protected:
std::vector< std::vector< VDataSeriesGroup > > m_aZSlots;
bool m_bCategoryXAxis;//true->xvalues are indices (this would not be necessary if series for category chart wouldn't have x-values)
long m_nTimeResolution;
tools::Long m_nTimeResolution;
Date m_aNullDate;
std::unique_ptr< NumberFormatterWrapper > m_apNumberFormatterWrapper;
+1 -1
View File
@@ -2279,7 +2279,7 @@ void lcl_createButtons(const uno::Reference<drawing::XShapes>& xPageShapes,
awt::Size aSize(4000, 700); // size of the button
long x = 0;
tools::Long x = 0;
if (xPivotTableDataProvider->getPageFields().hasElements())
{
@@ -652,7 +652,7 @@ double PlottingPositionHelper::getBaseValueY() const
return m_aScales[1].Origin;
}
void PlottingPositionHelper::setTimeResolution( long nTimeResolution, const Date& rNullDate )
void PlottingPositionHelper::setTimeResolution( tools::Long nTimeResolution, const Date& rNullDate )
{
m_nTimeResolution = nTimeResolution;
m_aNullDate = rNullDate;
+2 -2
View File
@@ -826,7 +826,7 @@ bool lcl_shouldSymbolsBePlacedOnTheLeftSide( const Reference< beans::XPropertySe
std::vector<std::shared_ptr<VButton>> lcl_createButtons(
uno::Reference<drawing::XShapes> const & xLegendContainer,
uno::Reference<lang::XMultiServiceFactory> const & xShapeFactory,
ChartModel& rModel, bool bPlaceButtonsVertically, long & nUsedHeight)
ChartModel& rModel, bool bPlaceButtonsVertically, tools::Long & nUsedHeight)
{
std::vector<std::shared_ptr<VButton>> aButtons;
@@ -1014,7 +1014,7 @@ void VLegend::createShapes(
if ( !aViewEntries.empty() || bIsPivotChart )
{
// create buttons
long nUsedButtonHeight = 0;
tools::Long nUsedButtonHeight = 0;
bool bPlaceButtonsVertically = (eLegendPosition != LegendPosition_PAGE_START &&
eLegendPosition != LegendPosition_PAGE_END &&
eExpansion != css::chart::ChartLegendExpansion_WIDE);
+3 -2
View File
@@ -10,14 +10,15 @@
#pragma once
#include <basegfx/basegfxdllapi.h>
#include <tools/long.hxx>
namespace basegfx::zoomtools
{
/** This namespace provides functions for optimized geometric zooming
*/
BASEGFX_DLLPUBLIC long zoomOut(long nCurrent);
BASEGFX_DLLPUBLIC long zoomIn(long nCurrent);
BASEGFX_DLLPUBLIC tools::Long zoomOut(tools::Long nCurrent);
BASEGFX_DLLPUBLIC tools::Long zoomIn(tools::Long nCurrent);
}