Fraction: Revert "fdo#81356: convert Fraction to boost::rational<long> - wip"
This reverts commit 47a2d7642d249d70b5da0c330a73f3a0032e4bba. Conflicts: cui/source/tabpages/transfrm.cxx svx/source/svdraw/svdedtv1.cxx svx/source/svdraw/svdibrow.cxx sw/source/filter/ww1/w1filter.cxx tools/source/generic/rational.cxx Change-Id: I4849916f5f277a4afef0e279b0135c76b36b9d15
This commit is contained in:
parent
e92c0d6f9b
commit
31af61ea09
@ -234,7 +234,7 @@ DlgEditor::DlgEditor (
|
|||||||
pDlgEdView->SetWorkArea( Rectangle( Point( 0, 0 ), pDlgEdPage->GetSize() ) );
|
pDlgEdView->SetWorkArea( Rectangle( Point( 0, 0 ), pDlgEdPage->GetSize() ) );
|
||||||
|
|
||||||
pDlgEdView->SetGridCoarse( aGridSize );
|
pDlgEdView->SetGridCoarse( aGridSize );
|
||||||
pDlgEdView->SetSnapGridWidth(boost::rational<long>(aGridSize.Width(),1), boost::rational<long>(aGridSize.Height(),1));
|
pDlgEdView->SetSnapGridWidth(Fraction(aGridSize.Width(), 1), Fraction(aGridSize.Height(), 1));
|
||||||
pDlgEdView->SetGridSnap( bGridSnap );
|
pDlgEdView->SetGridSnap( bGridSnap );
|
||||||
pDlgEdView->SetGridVisible( bGridVisible );
|
pDlgEdView->SetGridVisible( bGridVisible );
|
||||||
pDlgEdView->SetDragStripes(false);
|
pDlgEdView->SetDragStripes(false);
|
||||||
@ -508,7 +508,7 @@ IMPL_LINK_NOARG(DlgEditor, PaintTimeout)
|
|||||||
Size aSize = rWindow.PixelToLogic( Size( 400, 300 ) );
|
Size aSize = rWindow.PixelToLogic( Size( 400, 300 ) );
|
||||||
|
|
||||||
// align with grid
|
// align with grid
|
||||||
Size aGridSize_(boost::rational_cast<long>(pDlgEdView->GetSnapGridWidthX()), boost::rational_cast<long>(pDlgEdView->GetSnapGridWidthY()));
|
Size aGridSize_(long(pDlgEdView->GetSnapGridWidthX()), long(pDlgEdView->GetSnapGridWidthY()));
|
||||||
aSize.Width() -= aSize.Width() % aGridSize_.Width();
|
aSize.Width() -= aSize.Width() % aGridSize_.Width();
|
||||||
aSize.Height() -= aSize.Height() % aGridSize_.Height();
|
aSize.Height() -= aSize.Height() % aGridSize_.Height();
|
||||||
|
|
||||||
|
@ -940,7 +940,7 @@ void DlgEdObj::NbcMove( const Size& rSize )
|
|||||||
GetDlgEdForm()->GetDlgEditor().SetDialogModelChanged(true);
|
GetDlgEdForm()->GetDlgEditor().SetDialogModelChanged(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DlgEdObj::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
|
void DlgEdObj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
|
||||||
{
|
{
|
||||||
SdrUnoObj::NbcResize( rRef, xFract, yFract );
|
SdrUnoObj::NbcResize( rRef, xFract, yFract );
|
||||||
|
|
||||||
@ -1590,7 +1590,7 @@ void DlgEdForm::NbcMove( const Size& rSize )
|
|||||||
GetDlgEditor().SetDialogModelChanged(true);
|
GetDlgEditor().SetDialogModelChanged(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DlgEdForm::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
|
void DlgEdForm::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
|
||||||
{
|
{
|
||||||
SdrUnoObj::NbcResize( rRef, xFract, yFract );
|
SdrUnoObj::NbcResize( rRef, xFract, yFract );
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ protected:
|
|||||||
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac);
|
const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac);
|
||||||
|
|
||||||
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
||||||
|
|
||||||
using SfxListener::StartListening;
|
using SfxListener::StartListening;
|
||||||
@ -153,7 +153,7 @@ private:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -1343,8 +1343,8 @@ static double GetDialogZoomFactor( bool bX, long nValue )
|
|||||||
if( pDevice )
|
if( pDevice )
|
||||||
{
|
{
|
||||||
Size aRefSize( nValue, nValue );
|
Size aRefSize( nValue, nValue );
|
||||||
boost::rational<long> aFracX( 1, 26 );
|
Fraction aFracX( 1, 26 );
|
||||||
boost::rational<long> aFracY( 1, 24 );
|
Fraction aFracY( 1, 24 );
|
||||||
MapMode aMap( MAP_APPFONT, Point(), aFracX, aFracY );
|
MapMode aMap( MAP_APPFONT, Point(), aFracX, aFracY );
|
||||||
Size aScaledSize = pDevice->LogicToPixel( aRefSize, aMap );
|
Size aScaledSize = pDevice->LogicToPixel( aRefSize, aMap );
|
||||||
aRefSize = pDevice->LogicToPixel( aRefSize, MapMode(MAP_TWIP) );
|
aRefSize = pDevice->LogicToPixel( aRefSize, MapMode(MAP_TWIP) );
|
||||||
|
@ -244,8 +244,8 @@ void SAL_CALL ChartController::setPosSize(
|
|||||||
MapMode aNewMapMode(
|
MapMode aNewMapMode(
|
||||||
MAP_100TH_MM,
|
MAP_100TH_MM,
|
||||||
Point(0,0),
|
Point(0,0),
|
||||||
boost::rational<long>(nScaleXNumerator, nScaleXDenominator),
|
Fraction(nScaleXNumerator, nScaleXDenominator),
|
||||||
boost::rational<long>(nScaleYNumerator, nScaleYDenominator) );
|
Fraction(nScaleYNumerator, nScaleYDenominator) );
|
||||||
m_pChartWindow->SetMapMode(aNewMapMode);
|
m_pChartWindow->SetMapMode(aNewMapMode);
|
||||||
m_pChartWindow->setPosSizePixel( X, Y, Width, Height, Flags );
|
m_pChartWindow->setPosSizePixel( X, Y, Width, Height, Flags );
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ DrawModelWrapper::DrawModelWrapper( const uno::Reference<uno::XComponentContext>
|
|||||||
m_pChartItemPool = ChartItemPool::CreateChartItemPool();
|
m_pChartItemPool = ChartItemPool::CreateChartItemPool();
|
||||||
|
|
||||||
SetScaleUnit(MAP_100TH_MM);
|
SetScaleUnit(MAP_100TH_MM);
|
||||||
SetScaleFraction(boost::rational<long>(1, 1));
|
SetScaleFraction(Fraction(1, 1));
|
||||||
SetDefaultFontHeight(423); // 12pt
|
SetDefaultFontHeight(423); // 12pt
|
||||||
|
|
||||||
SfxItemPool* pMasterPool = &GetItemPool();
|
SfxItemPool* pMasterPool = &GetItemPool();
|
||||||
|
@ -168,7 +168,7 @@
|
|||||||
#include <svtools/miscopt.hxx>
|
#include <svtools/miscopt.hxx>
|
||||||
#include <tools/debug.hxx>
|
#include <tools/debug.hxx>
|
||||||
#include <tools/diagnose_ex.h>
|
#include <tools/diagnose_ex.h>
|
||||||
#include <tools/rational.hxx>
|
#include <tools/fract.hxx>
|
||||||
#include <tools/wldcrd.hxx>
|
#include <tools/wldcrd.hxx>
|
||||||
#include <unotools/confignode.hxx>
|
#include <unotools/confignode.hxx>
|
||||||
#include <unotools/datetime.hxx>
|
#include <unotools/datetime.hxx>
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include <boost/spirit/include/classic_core.hpp>
|
#include <boost/spirit/include/classic_core.hpp>
|
||||||
#include "RowFunctionParser.hxx"
|
#include "RowFunctionParser.hxx"
|
||||||
#include <rtl/ustring.hxx>
|
#include <rtl/ustring.hxx>
|
||||||
#include <tools/rational.hxx>
|
#include <tools/fract.hxx>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -812,8 +812,8 @@ void SvxCropExample::SetFrameSize( const Size& rSz )
|
|||||||
if(!aFrameSize.Height())
|
if(!aFrameSize.Height())
|
||||||
aFrameSize.Height() = 1;
|
aFrameSize.Height() = 1;
|
||||||
Size aWinSize( GetOutputSizePixel() );
|
Size aWinSize( GetOutputSizePixel() );
|
||||||
boost::rational<long> aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 );
|
Fraction aXScale( aWinSize.Width() * 4, aFrameSize.Width() * 5 );
|
||||||
boost::rational<long> aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 );
|
Fraction aYScale( aWinSize.Height() * 4, aFrameSize.Height() * 5 );
|
||||||
|
|
||||||
if( aYScale < aXScale )
|
if( aYScale < aXScale )
|
||||||
aXScale = aYScale;
|
aXScale = aYScale;
|
||||||
|
@ -90,9 +90,9 @@ static void lcl_ConvertRect(basegfx::B2DRange& rRange, const sal_uInt16 nDigits,
|
|||||||
rRange = basegfx::B2DRange(aTopLeft, aBottomRight);
|
rRange = basegfx::B2DRange(aTopLeft, aBottomRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lcl_ScaleRect(basegfx::B2DRange& rRange, const boost::rational<long> aUIScale)
|
static void lcl_ScaleRect(basegfx::B2DRange& rRange, const Fraction aUIScale)
|
||||||
{
|
{
|
||||||
const double fFactor(1.0 / boost::rational_cast<double>(aUIScale));
|
const double fFactor(1.0 / double(aUIScale));
|
||||||
rRange = basegfx::B2DRange(rRange.getMinimum() * fFactor, rRange.getMaximum() * fFactor);
|
rRange = basegfx::B2DRange(rRange.getMinimum() * fFactor, rRange.getMaximum() * fFactor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,7 +254,7 @@ void SvxAngleTabPage::Construct()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// take scale into account
|
// take scale into account
|
||||||
const boost::rational<long> aUIScale = pView->GetModel()->GetUIScale();
|
const Fraction aUIScale(pView->GetModel()->GetUIScale());
|
||||||
lcl_ScaleRect(maRange, aUIScale);
|
lcl_ScaleRect(maRange, aUIScale);
|
||||||
|
|
||||||
// take UI units into account
|
// take UI units into account
|
||||||
@ -274,7 +274,7 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet)
|
|||||||
|
|
||||||
if(m_pCtlAngle->IsValueModified() || m_pMtrPosX->IsValueModified() || m_pMtrPosY->IsValueModified())
|
if(m_pCtlAngle->IsValueModified() || m_pMtrPosX->IsValueModified() || m_pMtrPosY->IsValueModified())
|
||||||
{
|
{
|
||||||
const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale()));
|
const double fUIScale(double(pView->GetModel()->GetUIScale()));
|
||||||
const double fTmpX((GetCoreValue(*m_pMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale);
|
const double fTmpX((GetCoreValue(*m_pMtrPosX, ePoolUnit) + maAnchor.getX()) * fUIScale);
|
||||||
const double fTmpY((GetCoreValue(*m_pMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale);
|
const double fTmpY((GetCoreValue(*m_pMtrPosY, ePoolUnit) + maAnchor.getY()) * fUIScale);
|
||||||
|
|
||||||
@ -292,7 +292,7 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet)
|
|||||||
|
|
||||||
void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
|
void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
|
||||||
{
|
{
|
||||||
const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale()));
|
const double fUIScale(double(pView->GetModel()->GetUIScale()));
|
||||||
|
|
||||||
const SfxPoolItem* pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ROT_X );
|
const SfxPoolItem* pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ROT_X );
|
||||||
if(pItem)
|
if(pItem)
|
||||||
@ -475,9 +475,9 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs)
|
|||||||
|
|
||||||
if( m_pMtrRadius->IsValueChangedFromSaved() )
|
if( m_pMtrRadius->IsValueChangedFromSaved() )
|
||||||
{
|
{
|
||||||
boost::rational<long> aUIScale = pView->GetModel()->GetUIScale();
|
Fraction aUIScale = pView->GetModel()->GetUIScale();
|
||||||
long nTmp = GetCoreValue( *m_pMtrRadius, ePoolUnit );
|
long nTmp = GetCoreValue( *m_pMtrRadius, ePoolUnit );
|
||||||
nTmp = boost::rational_cast<long>(nTmp * aUIScale);
|
nTmp = Fraction( nTmp ) * aUIScale;
|
||||||
|
|
||||||
rAttrs->Put( makeSdrEckenradiusItem( nTmp ) );
|
rAttrs->Put( makeSdrEckenradiusItem( nTmp ) );
|
||||||
bModified = true;
|
bModified = true;
|
||||||
@ -527,8 +527,8 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
|
|||||||
|
|
||||||
if( pItem )
|
if( pItem )
|
||||||
{
|
{
|
||||||
const double fUIScale(boost::rational_cast<double>(this->pView->GetModel()->GetUIScale()));
|
const double fUIScale(double(pView->GetModel()->GetUIScale()));
|
||||||
const double fTmp((double)static_cast<const SdrMetricItem*>(pItem)->GetValue() / fUIScale);
|
const double fTmp((double)((const SdrMetricItem*)pItem)->GetValue() / fUIScale);
|
||||||
SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit);
|
SetMetricValue(*m_pMtrRadius, basegfx::fround(fTmp), ePoolUnit);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -758,7 +758,7 @@ void SvxPositionSizeTabPage::Construct()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// take scale into account
|
// take scale into account
|
||||||
const boost::rational<long> aUIScale = mpView->GetModel()->GetUIScale();
|
const Fraction aUIScale(mpView->GetModel()->GetUIScale());
|
||||||
lcl_ScaleRect( maWorkRange, aUIScale );
|
lcl_ScaleRect( maWorkRange, aUIScale );
|
||||||
lcl_ScaleRect( maRange, aUIScale );
|
lcl_ScaleRect( maRange, aUIScale );
|
||||||
|
|
||||||
@ -790,7 +790,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
|
|||||||
{
|
{
|
||||||
if ( m_pMtrPosX->IsValueModified() || m_pMtrPosY->IsValueModified() )
|
if ( m_pMtrPosX->IsValueModified() || m_pMtrPosY->IsValueModified() )
|
||||||
{
|
{
|
||||||
const double fUIScale(boost::rational_cast<double>(this->mpView->GetModel()->GetUIScale()));
|
const double fUIScale(double(mpView->GetModel()->GetUIScale()));
|
||||||
double fX((GetCoreValue( *m_pMtrPosX, mePoolUnit ) + maAnchor.getX()) * fUIScale);
|
double fX((GetCoreValue( *m_pMtrPosX, mePoolUnit ) + maAnchor.getX()) * fUIScale);
|
||||||
double fY((GetCoreValue( *m_pMtrPosY, mePoolUnit ) + maAnchor.getY()) * fUIScale);
|
double fY((GetCoreValue( *m_pMtrPosY, mePoolUnit ) + maAnchor.getY()) * fUIScale);
|
||||||
|
|
||||||
@ -828,19 +828,19 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
|
|||||||
|
|
||||||
if ( m_pMtrWidth->IsValueModified() || m_pMtrHeight->IsValueModified() )
|
if ( m_pMtrWidth->IsValueModified() || m_pMtrHeight->IsValueModified() )
|
||||||
{
|
{
|
||||||
boost::rational<long> aUIScale = mpView->GetModel()->GetUIScale();
|
Fraction aUIScale = mpView->GetModel()->GetUIScale();
|
||||||
|
|
||||||
// get Width
|
// get Width
|
||||||
double nWidth = static_cast<double>(m_pMtrWidth->GetValue( meDlgUnit ));
|
double nWidth = static_cast<double>(m_pMtrWidth->GetValue( meDlgUnit ));
|
||||||
nWidth = MetricField::ConvertDoubleValue( nWidth, m_pMtrWidth->GetBaseValue(), m_pMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
|
nWidth = MetricField::ConvertDoubleValue( nWidth, m_pMtrWidth->GetBaseValue(), m_pMtrWidth->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
|
||||||
long lWidth = long(nWidth * boost::rational_cast<double>(aUIScale));
|
long lWidth = long(nWidth * (double)aUIScale);
|
||||||
lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit );
|
lWidth = OutputDevice::LogicToLogic( lWidth, MAP_100TH_MM, (MapUnit)mePoolUnit );
|
||||||
lWidth = static_cast<long>(m_pMtrWidth->Denormalize( lWidth ));
|
lWidth = static_cast<long>(m_pMtrWidth->Denormalize( lWidth ));
|
||||||
|
|
||||||
// get Height
|
// get Height
|
||||||
double nHeight = static_cast<double>(m_pMtrHeight->GetValue( meDlgUnit ));
|
double nHeight = static_cast<double>(m_pMtrHeight->GetValue( meDlgUnit ));
|
||||||
nHeight = MetricField::ConvertDoubleValue( nHeight, m_pMtrHeight->GetBaseValue(), m_pMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
|
nHeight = MetricField::ConvertDoubleValue( nHeight, m_pMtrHeight->GetBaseValue(), m_pMtrHeight->GetDecimalDigits(), meDlgUnit, FUNIT_100TH_MM );
|
||||||
long lHeight = long(nHeight * boost::rational_cast<double>(aUIScale));
|
long lHeight = long(nHeight * (double)aUIScale);
|
||||||
lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit );
|
lHeight = OutputDevice::LogicToLogic( lHeight, MAP_100TH_MM, (MapUnit)mePoolUnit );
|
||||||
lHeight = static_cast<long>(m_pMtrHeight->Denormalize( lHeight ));
|
lHeight = static_cast<long>(m_pMtrHeight->Denormalize( lHeight ));
|
||||||
|
|
||||||
@ -899,7 +899,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* rOutAttrs )
|
|||||||
void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
|
void SvxPositionSizeTabPage::Reset( const SfxItemSet* )
|
||||||
{
|
{
|
||||||
const SfxPoolItem* pItem;
|
const SfxPoolItem* pItem;
|
||||||
const double fUIScale(boost::rational_cast<double>(this->mpView->GetModel()->GetUIScale()));
|
const double fUIScale(double(mpView->GetModel()->GetUIScale()));
|
||||||
|
|
||||||
if ( !mbPageDisabled )
|
if ( !mbPageDisabled )
|
||||||
{
|
{
|
||||||
|
@ -47,7 +47,7 @@ namespace dbaui
|
|||||||
TTableConnectionData m_vTableConnectionData;
|
TTableConnectionData m_vTableConnectionData;
|
||||||
TTableWindowData m_vTableData;
|
TTableWindowData m_vTableData;
|
||||||
|
|
||||||
boost::rational<long> m_aZoom;
|
Fraction m_aZoom;
|
||||||
::dbtools::SQLExceptionInfo m_aExceptionInfo;
|
::dbtools::SQLExceptionInfo m_aExceptionInfo;
|
||||||
|
|
||||||
OAddTableDlg* m_pAddTableDialog;
|
OAddTableDlg* m_pAddTableDialog;
|
||||||
|
@ -558,7 +558,7 @@ void doc_paintTile (LibreOfficeKitDocument* pThis,
|
|||||||
VirtualDevice aDevice(0, (sal_uInt16)32);
|
VirtualDevice aDevice(0, (sal_uInt16)32);
|
||||||
boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() );
|
boost::shared_array< sal_uInt8 > aBuffer( pBuffer, NoDelete< sal_uInt8 >() );
|
||||||
aDevice.SetOutputSizePixelScaleOffsetAndBuffer(
|
aDevice.SetOutputSizePixelScaleOffsetAndBuffer(
|
||||||
Size(nCanvasWidth, nCanvasHeight), rational_FromDouble(1.0), Point(),
|
Size(nCanvasWidth, nCanvasHeight), Fraction(1.0), Point(),
|
||||||
aBuffer, true );
|
aBuffer, true );
|
||||||
|
|
||||||
pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
|
pDoc->paintTile(aDevice, nCanvasWidth, nCanvasHeight,
|
||||||
|
@ -573,7 +573,7 @@ namespace
|
|||||||
basegfx::B2DHomMatrix getTransformFromMapMode(const MapMode& rMapMode)
|
basegfx::B2DHomMatrix getTransformFromMapMode(const MapMode& rMapMode)
|
||||||
{
|
{
|
||||||
basegfx::B2DHomMatrix aMapping;
|
basegfx::B2DHomMatrix aMapping;
|
||||||
const boost::rational<long> aNoScale(1, 1);
|
const Fraction aNoScale(1, 1);
|
||||||
const Point& rOrigin(rMapMode.GetOrigin());
|
const Point& rOrigin(rMapMode.GetOrigin());
|
||||||
|
|
||||||
if(0 != rOrigin.X() || 0 != rOrigin.Y())
|
if(0 != rOrigin.X() || 0 != rOrigin.Y())
|
||||||
@ -584,8 +584,8 @@ namespace
|
|||||||
if(rMapMode.GetScaleX() != aNoScale || rMapMode.GetScaleY() != aNoScale)
|
if(rMapMode.GetScaleX() != aNoScale || rMapMode.GetScaleY() != aNoScale)
|
||||||
{
|
{
|
||||||
aMapping.scale(
|
aMapping.scale(
|
||||||
boost::rational_cast<double>(rMapMode.GetScaleX()),
|
double(rMapMode.GetScaleX()),
|
||||||
boost::rational_cast<double>(rMapMode.GetScaleY()));
|
double(rMapMode.GetScaleY()));
|
||||||
}
|
}
|
||||||
|
|
||||||
return aMapping;
|
return aMapping;
|
||||||
|
@ -494,14 +494,14 @@ bool ImpEditEngine::ImpCheckRefMapMode()
|
|||||||
if ( aStatus.DoFormat100() )
|
if ( aStatus.DoFormat100() )
|
||||||
{
|
{
|
||||||
MapMode aMapMode( GetRefDevice()->GetMapMode() );
|
MapMode aMapMode( GetRefDevice()->GetMapMode() );
|
||||||
if ( aMapMode.GetScaleX().numerator() != aMapMode.GetScaleX().denominator() )
|
if ( aMapMode.GetScaleX().GetNumerator() != aMapMode.GetScaleX().GetDenominator() )
|
||||||
bChange = true;
|
bChange = true;
|
||||||
else if ( aMapMode.GetScaleY().numerator() != aMapMode.GetScaleY().denominator() )
|
else if ( aMapMode.GetScaleY().GetNumerator() != aMapMode.GetScaleY().GetDenominator() )
|
||||||
bChange = true;
|
bChange = true;
|
||||||
|
|
||||||
if ( bChange )
|
if ( bChange )
|
||||||
{
|
{
|
||||||
boost::rational<long> Scale1( 1, 1 );
|
Fraction Scale1( 1, 1 );
|
||||||
aMapMode.SetScaleX( Scale1 );
|
aMapMode.SetScaleX( Scale1 );
|
||||||
aMapMode.SetScaleY( Scale1 );
|
aMapMode.SetScaleY( Scale1 );
|
||||||
GetRefDevice()->Push();
|
GetRefDevice()->Push();
|
||||||
|
@ -2168,50 +2168,50 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
|
|||||||
if ( pA->GetMapMode().GetMapUnit() == MAP_RELATIVE )
|
if ( pA->GetMapMode().GetMapUnit() == MAP_RELATIVE )
|
||||||
{
|
{
|
||||||
MapMode aMM = pA->GetMapMode();
|
MapMode aMM = pA->GetMapMode();
|
||||||
boost::rational<long> aScaleX = aMM.GetScaleX();
|
Fraction aScaleX = aMM.GetScaleX();
|
||||||
boost::rational<long> aScaleY = aMM.GetScaleY();
|
Fraction aScaleY = aMM.GetScaleY();
|
||||||
|
|
||||||
Point aOrigin = aPictureMapMode.GetOrigin();
|
Point aOrigin = aPictureMapMode.GetOrigin();
|
||||||
BigInt aX( aOrigin.X() );
|
BigInt aX( aOrigin.X() );
|
||||||
aX *= BigInt( aScaleX.denominator() );
|
aX *= BigInt( aScaleX.GetDenominator() );
|
||||||
|
|
||||||
if( aOrigin.X() >= 0 )
|
if( aOrigin.X() >= 0 )
|
||||||
{
|
{
|
||||||
if( aScaleX.numerator() >= 0 )
|
if( aScaleX.GetNumerator() >= 0 )
|
||||||
aX += BigInt( aScaleX.numerator()/2 );
|
aX += BigInt( aScaleX.GetNumerator()/2 );
|
||||||
else
|
else
|
||||||
aX -= BigInt( (aScaleX.numerator()+1)/2 );
|
aX -= BigInt( (aScaleX.GetNumerator()+1)/2 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( aScaleX.numerator() >= 0 )
|
if( aScaleX.GetNumerator() >= 0 )
|
||||||
aX -= BigInt( (aScaleX.numerator()-1)/2 );
|
aX -= BigInt( (aScaleX.GetNumerator()-1)/2 );
|
||||||
else
|
else
|
||||||
aX += BigInt( aScaleX.numerator()/2 );
|
aX += BigInt( aScaleX.GetNumerator()/2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
aX /= BigInt( aScaleX.numerator() );
|
aX /= BigInt( aScaleX.GetNumerator() );
|
||||||
aOrigin.X() = (long) aX + aMM.GetOrigin().X();
|
aOrigin.X() = (long) aX + aMM.GetOrigin().X();
|
||||||
|
|
||||||
BigInt aY( aOrigin.Y() );
|
BigInt aY( aOrigin.Y() );
|
||||||
aY *= BigInt( aScaleY.denominator() );
|
aY *= BigInt( aScaleY.GetDenominator() );
|
||||||
|
|
||||||
if( aOrigin.Y() >= 0 )
|
if( aOrigin.Y() >= 0 )
|
||||||
{
|
{
|
||||||
if( aScaleY.numerator() >= 0 )
|
if( aScaleY.GetNumerator() >= 0 )
|
||||||
aY += BigInt( aScaleY.numerator()/2 );
|
aY += BigInt( aScaleY.GetNumerator()/2 );
|
||||||
else
|
else
|
||||||
aY -= BigInt( (aScaleY.numerator()+1)/2 );
|
aY -= BigInt( (aScaleY.GetNumerator()+1)/2 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( aScaleY.numerator() >= 0 )
|
if( aScaleY.GetNumerator() >= 0 )
|
||||||
aY -= BigInt( (aScaleY.numerator()-1)/2 );
|
aY -= BigInt( (aScaleY.GetNumerator()-1)/2 );
|
||||||
else
|
else
|
||||||
aY += BigInt( aScaleY.numerator()/2 );
|
aY += BigInt( aScaleY.GetNumerator()/2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
aY /= BigInt( aScaleY.numerator() );
|
aY /= BigInt( aScaleY.GetNumerator() );
|
||||||
aOrigin.Y() = (long)aY + aMM.GetOrigin().Y();
|
aOrigin.Y() = (long)aY + aMM.GetOrigin().Y();
|
||||||
aPictureMapMode.SetOrigin( aOrigin );
|
aPictureMapMode.SetOrigin( aOrigin );
|
||||||
|
|
||||||
|
@ -1962,48 +1962,48 @@ void PictWriter::WriteOpcodes( const GDIMetaFile & rMTF )
|
|||||||
if( pA->GetMapMode().GetMapUnit() == MAP_RELATIVE )
|
if( pA->GetMapMode().GetMapUnit() == MAP_RELATIVE )
|
||||||
{
|
{
|
||||||
MapMode aMM = pA->GetMapMode();
|
MapMode aMM = pA->GetMapMode();
|
||||||
boost::rational<long> aScaleX = aMM.GetScaleX();
|
Fraction aScaleX = aMM.GetScaleX();
|
||||||
boost::rational<long> aScaleY = aMM.GetScaleY();
|
Fraction aScaleY = aMM.GetScaleY();
|
||||||
|
|
||||||
Point aOrigin = aSrcMapMode.GetOrigin();
|
Point aOrigin = aSrcMapMode.GetOrigin();
|
||||||
BigInt aX( aOrigin.X() );
|
BigInt aX( aOrigin.X() );
|
||||||
aX *= BigInt( aScaleX.denominator() );
|
aX *= BigInt( aScaleX.GetDenominator() );
|
||||||
if( aOrigin.X() >= 0 )
|
if( aOrigin.X() >= 0 )
|
||||||
{
|
{
|
||||||
if( aScaleX.numerator() >= 0 )
|
if( aScaleX.GetNumerator() >= 0 )
|
||||||
aX += BigInt( aScaleX.numerator()/2 );
|
aX += BigInt( aScaleX.GetNumerator()/2 );
|
||||||
else
|
else
|
||||||
aX -= BigInt( (aScaleX.numerator()+1)/2 );
|
aX -= BigInt( (aScaleX.GetNumerator()+1)/2 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( aScaleX.numerator() >= 0 )
|
if( aScaleX.GetNumerator() >= 0 )
|
||||||
aX -= BigInt( (aScaleX.numerator()-1)/2 );
|
aX -= BigInt( (aScaleX.GetNumerator()-1)/2 );
|
||||||
else
|
else
|
||||||
aX += BigInt( aScaleX.numerator()/2 );
|
aX += BigInt( aScaleX.GetNumerator()/2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
aX /= BigInt( aScaleX.numerator() );
|
aX /= BigInt( aScaleX.GetNumerator() );
|
||||||
aOrigin.X() = (long)aX + aMM.GetOrigin().X();
|
aOrigin.X() = (long)aX + aMM.GetOrigin().X();
|
||||||
BigInt aY( aOrigin.Y() );
|
BigInt aY( aOrigin.Y() );
|
||||||
aY *= BigInt( aScaleY.denominator() );
|
aY *= BigInt( aScaleY.GetDenominator() );
|
||||||
|
|
||||||
if( aOrigin.Y() >= 0 )
|
if( aOrigin.Y() >= 0 )
|
||||||
{
|
{
|
||||||
if( aScaleY.numerator() >= 0 )
|
if( aScaleY.GetNumerator() >= 0 )
|
||||||
aY += BigInt( aScaleY.numerator()/2 );
|
aY += BigInt( aScaleY.GetNumerator()/2 );
|
||||||
else
|
else
|
||||||
aY -= BigInt( (aScaleY.numerator()+1)/2 );
|
aY -= BigInt( (aScaleY.GetNumerator()+1)/2 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if( aScaleY.numerator() >= 0 )
|
if( aScaleY.GetNumerator() >= 0 )
|
||||||
aY -= BigInt( (aScaleY.numerator()-1)/2 );
|
aY -= BigInt( (aScaleY.GetNumerator()-1)/2 );
|
||||||
else
|
else
|
||||||
aY += BigInt( aScaleY.numerator()/2 );
|
aY += BigInt( aScaleY.GetNumerator()/2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
aY /= BigInt( aScaleY.numerator() );
|
aY /= BigInt( aScaleY.GetNumerator() );
|
||||||
aOrigin.Y() = (long)aY + aMM.GetOrigin().Y();
|
aOrigin.Y() = (long)aY + aMM.GetOrigin().Y();
|
||||||
aSrcMapMode.SetOrigin( aOrigin );
|
aSrcMapMode.SetOrigin( aOrigin );
|
||||||
|
|
||||||
@ -2183,7 +2183,7 @@ bool PictWriter::WritePict(const GDIMetaFile & rMTF, SvStream & rTargetStream, F
|
|||||||
{
|
{
|
||||||
PictWriterAttrStackMember* pAt;
|
PictWriterAttrStackMember* pAt;
|
||||||
MapMode aMap72( MAP_INCH );
|
MapMode aMap72( MAP_INCH );
|
||||||
boost::rational<long> aDPIFrac( 1, 72 );
|
Fraction aDPIFrac( 1, 72 );
|
||||||
|
|
||||||
bStatus=true;
|
bStatus=true;
|
||||||
nLastPercent=0;
|
nLastPercent=0;
|
||||||
|
@ -2376,8 +2376,8 @@ void PSWriter::ImplGetMapMode( const MapMode& rMapMode )
|
|||||||
{
|
{
|
||||||
ImplWriteLine( "tm setmatrix" );
|
ImplWriteLine( "tm setmatrix" );
|
||||||
double fMul = ImplGetScaling( rMapMode );
|
double fMul = ImplGetScaling( rMapMode );
|
||||||
double fScaleX = boost::rational_cast<double>(rMapMode.GetScaleX()) * fMul;
|
double fScaleX = (double)rMapMode.GetScaleX() * fMul;
|
||||||
double fScaleY = boost::rational_cast<double>(rMapMode.GetScaleY()) * fMul;
|
double fScaleY = (double)rMapMode.GetScaleY() * fMul;
|
||||||
ImplTranslate( rMapMode.GetOrigin().X() * fScaleX, rMapMode.GetOrigin().Y() * fScaleY );
|
ImplTranslate( rMapMode.GetOrigin().X() * fScaleX, rMapMode.GetOrigin().Y() * fScaleY );
|
||||||
ImplScale( fScaleX, fScaleY );
|
ImplScale( fScaleX, fScaleY );
|
||||||
}
|
}
|
||||||
|
@ -2127,9 +2127,9 @@ void OS2METReader::ReadDsc(sal_uInt16 nDscID, sal_uInt16 /*nDscLen*/)
|
|||||||
ReadCoord(b32);
|
ReadCoord(b32);
|
||||||
|
|
||||||
if (nUnitType==0x00 && xr>0 && yr>0)
|
if (nUnitType==0x00 && xr>0 && yr>0)
|
||||||
aGlobMapMode=MapMode(MAP_INCH,Point(0,0),boost::rational<long>(10,xr),boost::rational<long>(10,yr));
|
aGlobMapMode=MapMode(MAP_INCH,Point(0,0),Fraction(10,xr),Fraction(10,yr));
|
||||||
else if (nUnitType==0x01 && xr>0 && yr>0)
|
else if (nUnitType==0x01 && xr>0 && yr>0)
|
||||||
aGlobMapMode=MapMode(MAP_CM,Point(0,0),boost::rational<long>(10,xr),boost::rational<long>(10,yr));
|
aGlobMapMode=MapMode(MAP_CM,Point(0,0),Fraction(10,xr),Fraction(10,yr));
|
||||||
else
|
else
|
||||||
aGlobMapMode=MapMode();
|
aGlobMapMode=MapMode();
|
||||||
|
|
||||||
|
@ -166,8 +166,8 @@ private:
|
|||||||
Size aActOvalSize;
|
Size aActOvalSize;
|
||||||
vcl::Font aActFont;
|
vcl::Font aActFont;
|
||||||
|
|
||||||
boost::rational<long> aHRes;
|
Fraction aHRes;
|
||||||
boost::rational<long> aVRes;
|
Fraction aVRes;
|
||||||
|
|
||||||
bool Callback(sal_uInt16 nPercent);
|
bool Callback(sal_uInt16 nPercent);
|
||||||
|
|
||||||
@ -1841,7 +1841,7 @@ void PictReader::ReadPict( SvStream & rStreamPict, GDIMetaFile & rGDIMetaFile )
|
|||||||
aActFont.SetSize(Size(0,12));
|
aActFont.SetSize(Size(0,12));
|
||||||
aActFont.SetAlign(ALIGN_BASELINE);
|
aActFont.SetAlign(ALIGN_BASELINE);
|
||||||
|
|
||||||
aHRes = aVRes = boost::rational<long>( 1, 1 );
|
aHRes = aVRes = Fraction( 1, 1 );
|
||||||
|
|
||||||
pVirDev = new VirtualDevice();
|
pVirDev = new VirtualDevice();
|
||||||
pVirDev->EnableOutput(false);
|
pVirDev->EnableOutput(false);
|
||||||
|
@ -148,8 +148,8 @@ bool PSDReader::ReadPSD(Graphic & rGraphic )
|
|||||||
if ( mnXResFixed && mnYResFixed )
|
if ( mnXResFixed && mnYResFixed )
|
||||||
{
|
{
|
||||||
Point aEmptyPoint;
|
Point aEmptyPoint;
|
||||||
boost::rational<long> aFractX( 1, mnXResFixed >> 16 );
|
Fraction aFractX( 1, mnXResFixed >> 16 );
|
||||||
boost::rational<long> aFractY( 1, mnYResFixed >> 16 );
|
Fraction aFractY( 1, mnYResFixed >> 16 );
|
||||||
MapMode aMapMode( MAP_INCH, aEmptyPoint, aFractX, aFractY );
|
MapMode aMapMode( MAP_INCH, aEmptyPoint, aFractX, aFractY );
|
||||||
Size aPrefSize = OutputDevice::LogicToLogic( aBitmapSize, aMapMode, MAP_100TH_MM );
|
Size aPrefSize = OutputDevice::LogicToLogic( aBitmapSize, aMapMode, MAP_100TH_MM );
|
||||||
rGraphic.SetPrefSize( aPrefSize );
|
rGraphic.SetPrefSize( aPrefSize );
|
||||||
|
@ -1127,7 +1127,7 @@ void TIFFReader::MakePalCol( void )
|
|||||||
nRX=(sal_uLong)(fXResolution*2.54+0.5);
|
nRX=(sal_uLong)(fXResolution*2.54+0.5);
|
||||||
nRY=(sal_uLong)(fYResolution*2.54+0.5);
|
nRY=(sal_uLong)(fYResolution*2.54+0.5);
|
||||||
}
|
}
|
||||||
MapMode aMapMode(MAP_INCH,Point(0,0),boost::rational<long>(1,nRX),boost::rational<long>(1,nRY));
|
MapMode aMapMode(MAP_INCH,Point(0,0),Fraction(1,nRX),Fraction(1,nRY));
|
||||||
aBitmap.SetPrefMapMode(aMapMode);
|
aBitmap.SetPrefMapMode(aMapMode);
|
||||||
aBitmap.SetPrefSize(Size(nImageWidth,nImageLength));
|
aBitmap.SetPrefSize(Size(nImageWidth,nImageLength));
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,7 @@ ImplEESdrWriter::ImplEESdrWriter( EscherEx& rEx )
|
|||||||
: mpEscherEx(&rEx)
|
: mpEscherEx(&rEx)
|
||||||
, maMapModeSrc(MAP_100TH_MM)
|
, maMapModeSrc(MAP_100TH_MM)
|
||||||
// PowerPoint: 576 dpi, WinWord: 1440 dpi, Excel: 1440 dpi
|
// PowerPoint: 576 dpi, WinWord: 1440 dpi, Excel: 1440 dpi
|
||||||
, maMapModeDest( MAP_INCH, Point(), boost::rational<long>( 1, EES_MAP_FRACTION ), boost::rational<long>( 1, EES_MAP_FRACTION ) )
|
, maMapModeDest( MAP_INCH, Point(), Fraction( 1, EES_MAP_FRACTION ), Fraction( 1, EES_MAP_FRACTION ) )
|
||||||
, mpPicStrm(NULL)
|
, mpPicStrm(NULL)
|
||||||
, mpHostAppData(NULL)
|
, mpHostAppData(NULL)
|
||||||
, mnPagesWritten(0)
|
, mnPagesWritten(0)
|
||||||
|
@ -170,9 +170,9 @@ void Impl_OlePres::Write( SvStream & rStm )
|
|||||||
{
|
{
|
||||||
// Always to 1/100 mm, until Mtf-Solution found
|
// Always to 1/100 mm, until Mtf-Solution found
|
||||||
// Assumption (no scaling, no origin translation)
|
// Assumption (no scaling, no origin translation)
|
||||||
DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleX() == boost::rational<long>( 1, 1 ),
|
DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleX() == Fraction( 1, 1 ),
|
||||||
"X-Skalierung im Mtf" );
|
"X-Skalierung im Mtf" );
|
||||||
DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleY() == boost::rational<long>( 1, 1 ),
|
DBG_ASSERT( pMtf->GetPrefMapMode().GetScaleY() == Fraction( 1, 1 ),
|
||||||
"Y-Skalierung im Mtf" );
|
"Y-Skalierung im Mtf" );
|
||||||
DBG_ASSERT( pMtf->GetPrefMapMode().GetOrigin() == Point(),
|
DBG_ASSERT( pMtf->GetPrefMapMode().GetOrigin() == Point(),
|
||||||
"Origin-Verschiebung im Mtf" );
|
"Origin-Verschiebung im Mtf" );
|
||||||
@ -183,8 +183,8 @@ void Impl_OlePres::Write( SvStream & rStm )
|
|||||||
Size aS( aPrefS );
|
Size aS( aPrefS );
|
||||||
aS = OutputDevice::LogicToLogic( aS, nMU, MAP_100TH_MM );
|
aS = OutputDevice::LogicToLogic( aS, nMU, MAP_100TH_MM );
|
||||||
|
|
||||||
pMtf->Scale( boost::rational<long>( aS.Width(), aPrefS.Width() ),
|
pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ),
|
||||||
boost::rational<long>( aS.Height(), aPrefS.Height() ) );
|
Fraction( aS.Height(), aPrefS.Height() ) );
|
||||||
pMtf->SetPrefMapMode( MAP_100TH_MM );
|
pMtf->SetPrefMapMode( MAP_100TH_MM );
|
||||||
pMtf->SetPrefSize( aS );
|
pMtf->SetPrefSize( aS );
|
||||||
}
|
}
|
||||||
@ -3118,11 +3118,11 @@ void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
|
|||||||
sal_uInt32 SvxMSDffManager::ScalePt( sal_uInt32 nVal ) const
|
sal_uInt32 SvxMSDffManager::ScalePt( sal_uInt32 nVal ) const
|
||||||
{
|
{
|
||||||
MapUnit eMap = pSdrModel->GetScaleUnit();
|
MapUnit eMap = pSdrModel->GetScaleUnit();
|
||||||
boost::rational<long> aFact( GetMapFactor( MAP_POINT, eMap ).X() );
|
Fraction aFact( GetMapFactor( MAP_POINT, eMap ).X() );
|
||||||
long aMul = aFact.numerator();
|
long aMul = aFact.GetNumerator();
|
||||||
long aDiv = aFact.denominator() * 65536;
|
long aDiv = aFact.GetDenominator() * 65536;
|
||||||
aFact = boost::rational<long>( aMul, aDiv ); // try again to shorten it
|
aFact = Fraction( aMul, aDiv ); // try again to shorten it
|
||||||
return BigMulDiv( nVal, aFact.numerator(), aFact.denominator() );
|
return BigMulDiv( nVal, aFact.GetNumerator(), aFact.GetDenominator() );
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Int32 SvxMSDffManager::ScalePoint( sal_Int32 nVal ) const
|
sal_Int32 SvxMSDffManager::ScalePoint( sal_Int32 nVal ) const
|
||||||
@ -3138,31 +3138,31 @@ void SvxMSDffManager::SetModel(SdrModel* pModel, long nApplicationScale)
|
|||||||
// PPT works in units of 576DPI
|
// PPT works in units of 576DPI
|
||||||
// WW on the other side uses twips, i.e. 1440DPI.
|
// WW on the other side uses twips, i.e. 1440DPI.
|
||||||
MapUnit eMap = pSdrModel->GetScaleUnit();
|
MapUnit eMap = pSdrModel->GetScaleUnit();
|
||||||
boost::rational<long> aFact = GetMapFactor(MAP_INCH, eMap).X();
|
Fraction aFact( GetMapFactor(MAP_INCH, eMap).X() );
|
||||||
long nMul=aFact.numerator();
|
long nMul=aFact.GetNumerator();
|
||||||
long nDiv=aFact.denominator()*nApplicationScale;
|
long nDiv=aFact.GetDenominator()*nApplicationScale;
|
||||||
aFact=boost::rational<long>(nMul,nDiv); // try again to shorten it
|
aFact=Fraction(nMul,nDiv); // try again to shorten it
|
||||||
// For 100TH_MM -> 2540/576=635/144
|
// For 100TH_MM -> 2540/576=635/144
|
||||||
// For Twip -> 1440/576=5/2
|
// For Twip -> 1440/576=5/2
|
||||||
nMapMul = aFact.numerator();
|
nMapMul = aFact.GetNumerator();
|
||||||
nMapDiv = aFact.denominator();
|
nMapDiv = aFact.GetDenominator();
|
||||||
bNeedMap = nMapMul!=nMapDiv;
|
bNeedMap = nMapMul!=nMapDiv;
|
||||||
|
|
||||||
// MS-DFF-Properties are mostly given in EMU (English Metric Units)
|
// MS-DFF-Properties are mostly given in EMU (English Metric Units)
|
||||||
// 1mm=36000emu, 1twip=635emu
|
// 1mm=36000emu, 1twip=635emu
|
||||||
aFact=GetMapFactor(MAP_100TH_MM,eMap).X();
|
aFact=GetMapFactor(MAP_100TH_MM,eMap).X();
|
||||||
nMul=aFact.numerator();
|
nMul=aFact.GetNumerator();
|
||||||
nDiv=aFact.denominator()*360;
|
nDiv=aFact.GetDenominator()*360;
|
||||||
aFact=boost::rational<long>(nMul,nDiv); // try again to shorten it
|
aFact=Fraction(nMul,nDiv); // try again to shorten it
|
||||||
// For 100TH_MM -> 1/360
|
// For 100TH_MM -> 1/360
|
||||||
// For Twip -> 14,40/(25,4*360)=144/91440=1/635
|
// For Twip -> 14,40/(25,4*360)=144/91440=1/635
|
||||||
nEmuMul=aFact.numerator();
|
nEmuMul=aFact.GetNumerator();
|
||||||
nEmuDiv=aFact.denominator();
|
nEmuDiv=aFact.GetDenominator();
|
||||||
|
|
||||||
// And something for typographic Points
|
// And something for typographic Points
|
||||||
aFact=GetMapFactor(MAP_POINT,eMap).X();
|
aFact=GetMapFactor(MAP_POINT,eMap).X();
|
||||||
nPntMul=aFact.numerator();
|
nPntMul=aFact.GetNumerator();
|
||||||
nPntDiv=aFact.denominator();
|
nPntDiv=aFact.GetDenominator();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2474,9 +2474,9 @@ Size SdrPowerPointImport::GetPageSize() const
|
|||||||
long nInchMul = 1, nInchDiv = 1;
|
long nInchMul = 1, nInchDiv = 1;
|
||||||
if ( bInch )
|
if ( bInch )
|
||||||
{ // temporarily convert size (for rounding it) from inch to metric units
|
{ // temporarily convert size (for rounding it) from inch to metric units
|
||||||
boost::rational<long> aFact = GetMapFactor(eMap,MAP_100TH_MM).X();
|
Fraction aFact(GetMapFactor(eMap,MAP_100TH_MM).X());
|
||||||
nInchMul = aFact.numerator();
|
nInchMul = aFact.GetNumerator();
|
||||||
nInchDiv = aFact.denominator();
|
nInchDiv = aFact.GetDenominator();
|
||||||
aRet.Width() = BigMulDiv( aRet.Width(), nInchMul, nInchDiv );
|
aRet.Width() = BigMulDiv( aRet.Width(), nInchMul, nInchDiv );
|
||||||
aRet.Height() = BigMulDiv( aRet.Height(), nInchMul, nInchDiv );
|
aRet.Height() = BigMulDiv( aRet.Height(), nInchMul, nInchDiv );
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include "pdf.hrc"
|
#include "pdf.hrc"
|
||||||
#include "tools/urlobj.hxx"
|
#include "tools/urlobj.hxx"
|
||||||
|
#include "tools/fract.hxx"
|
||||||
#include "tools/poly.hxx"
|
#include "tools/poly.hxx"
|
||||||
#include "vcl/mapmod.hxx"
|
#include "vcl/mapmod.hxx"
|
||||||
#include "vcl/virdev.hxx"
|
#include "vcl/virdev.hxx"
|
||||||
|
@ -3583,14 +3583,14 @@ void SVGActionWriter::WriteMetaFile( const Point& rPos100thmm,
|
|||||||
{
|
{
|
||||||
MapMode aMapMode( rMtf.GetPrefMapMode() );
|
MapMode aMapMode( rMtf.GetPrefMapMode() );
|
||||||
Size aPrefSize( rMtf.GetPrefSize() );
|
Size aPrefSize( rMtf.GetPrefSize() );
|
||||||
boost::rational<long> aFractionX = aMapMode.GetScaleX();
|
Fraction aFractionX( aMapMode.GetScaleX() );
|
||||||
boost::rational<long> aFractionY = aMapMode.GetScaleY();
|
Fraction aFractionY( aMapMode.GetScaleY() );
|
||||||
|
|
||||||
mpVDev->Push();
|
mpVDev->Push();
|
||||||
|
|
||||||
Size aSize( OutputDevice::LogicToLogic( rSize100thmm, MAP_100TH_MM, aMapMode ) );
|
Size aSize( OutputDevice::LogicToLogic( rSize100thmm, MAP_100TH_MM, aMapMode ) );
|
||||||
aMapMode.SetScaleX( aFractionX *= boost::rational<long>( aSize.Width(), aPrefSize.Width() ) );
|
aMapMode.SetScaleX( aFractionX *= Fraction( aSize.Width(), aPrefSize.Width() ) );
|
||||||
aMapMode.SetScaleY( aFractionY *= boost::rational<long>( aSize.Height(), aPrefSize.Height() ) );
|
aMapMode.SetScaleY( aFractionY *= Fraction( aSize.Height(), aPrefSize.Height() ) );
|
||||||
|
|
||||||
Point aOffset( OutputDevice::LogicToLogic( rPos100thmm, MAP_100TH_MM, aMapMode ) );
|
Point aOffset( OutputDevice::LogicToLogic( rPos100thmm, MAP_100TH_MM, aMapMode ) );
|
||||||
aMapMode.SetOrigin( aOffset += aMapMode.GetOrigin() );
|
aMapMode.SetOrigin( aOffset += aMapMode.GetOrigin() );
|
||||||
|
@ -515,7 +515,7 @@ namespace frm
|
|||||||
|
|
||||||
void RichTextControlImpl::notifyZoomChanged()
|
void RichTextControlImpl::notifyZoomChanged()
|
||||||
{
|
{
|
||||||
const boost::rational<long>& rZoom = m_pAntiImpl->GetZoom();
|
const Fraction& rZoom = m_pAntiImpl->GetZoom();
|
||||||
|
|
||||||
MapMode aMapMode( m_pAntiImpl->GetMapMode() );
|
MapMode aMapMode( m_pAntiImpl->GetMapMode() );
|
||||||
aMapMode.SetScaleX( rZoom );
|
aMapMode.SetScaleX( rZoom );
|
||||||
|
@ -84,7 +84,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
sal_Int32 mnXmlNamespace;
|
sal_Int32 mnXmlNamespace;
|
||||||
sal_Int32 mnSeriesCount;
|
sal_Int32 mnSeriesCount;
|
||||||
boost::rational<long> maFraction;
|
Fraction maFraction;
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxChartModel;
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > mxChartModel;
|
||||||
com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
|
com::sun::star::uno::Reference< com::sun::star::chart::XDiagram > mxDiagram;
|
||||||
com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > mxNewDiagram;
|
com::sun::star::uno::Reference< com::sun::star::chart2::XDiagram > mxNewDiagram;
|
||||||
|
@ -66,7 +66,7 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
sal_Int32 mnXmlNamespace;
|
sal_Int32 mnXmlNamespace;
|
||||||
boost::rational<long> maFraction;
|
Fraction maFraction;
|
||||||
MapMode maMapModeSrc, maMapModeDest;
|
MapMode maMapModeSrc, maMapModeDest;
|
||||||
|
|
||||||
::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& ) const;
|
::com::sun::star::awt::Size MapSize( const ::com::sun::star::awt::Size& ) const;
|
||||||
|
@ -34,7 +34,7 @@ class SfxInPlaceClient_Impl;
|
|||||||
class SfxViewShell;
|
class SfxViewShell;
|
||||||
class SfxObjectShell;
|
class SfxObjectShell;
|
||||||
namespace vcl { class Window; }
|
namespace vcl { class Window; }
|
||||||
namespace boost { template<typename T> class rational; }
|
class Fraction;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -74,10 +74,10 @@ public:
|
|||||||
bool SetObjArea( const Rectangle & );
|
bool SetObjArea( const Rectangle & );
|
||||||
Rectangle GetObjArea() const;
|
Rectangle GetObjArea() const;
|
||||||
Rectangle GetScaledObjArea() const;
|
Rectangle GetScaledObjArea() const;
|
||||||
void SetSizeScale( const boost::rational<long> & rScaleWidth, const boost::rational<long> & rScaleHeight );
|
void SetSizeScale( const Fraction & rScaleWidth, const Fraction & rScaleHeight );
|
||||||
bool SetObjAreaAndScale( const Rectangle&, const boost::rational<long>&, const boost::rational<long>& );
|
bool SetObjAreaAndScale( const Rectangle&, const Fraction&, const Fraction& );
|
||||||
const boost::rational<long>& GetScaleWidth() const;
|
const Fraction& GetScaleWidth() const;
|
||||||
const boost::rational<long>& GetScaleHeight() const;
|
const Fraction& GetScaleHeight() const;
|
||||||
void Invalidate();
|
void Invalidate();
|
||||||
static SfxInPlaceClient* GetClient( SfxObjectShell* pDoc, const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObject );
|
static SfxInPlaceClient* GetClient( SfxObjectShell* pDoc, const com::sun::star::uno::Reference < com::sun::star::embed::XEmbeddedObject >& xObject );
|
||||||
sal_Int64 GetAspect() const;
|
sal_Int64 GetAspect() const;
|
||||||
|
@ -638,8 +638,8 @@ public:
|
|||||||
|
|
||||||
SAL_DLLPRIVATE void DoDraw_Impl( OutputDevice* pDev,
|
SAL_DLLPRIVATE void DoDraw_Impl( OutputDevice* pDev,
|
||||||
const Point & rViewPos,
|
const Point & rViewPos,
|
||||||
const boost::rational<long>& rScaleX,
|
const Fraction & rScaleX,
|
||||||
const boost::rational<long>& rScaleY,
|
const Fraction & rScaleY,
|
||||||
const JobSetup & rSetup,
|
const JobSetup & rSetup,
|
||||||
sal_uInt16 nAspect );
|
sal_uInt16 nAspect );
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ class SfxProgress;
|
|||||||
class SvData;
|
class SvData;
|
||||||
class SfxViewShell;
|
class SfxViewShell;
|
||||||
class SystemWindow;
|
class SystemWindow;
|
||||||
namespace boost { template<typename T> class rational; }
|
class Fraction;
|
||||||
class Point;
|
class Point;
|
||||||
class Size;
|
class Size;
|
||||||
class SfxChildWindow;
|
class SfxChildWindow;
|
||||||
@ -118,7 +118,7 @@ public:
|
|||||||
SfxBindings& GetBindings() { return *pBindings; }
|
SfxBindings& GetBindings() { return *pBindings; }
|
||||||
const SfxBindings& GetBindings() const { return *pBindings; }
|
const SfxBindings& GetBindings() const { return *pBindings; }
|
||||||
vcl::Window& GetWindow() const;
|
vcl::Window& GetWindow() const;
|
||||||
virtual void SetZoomFactor( const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY );
|
virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
|
||||||
|
|
||||||
SfxProgress* GetProgress() const;
|
SfxProgress* GetProgress() const;
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
class SfxBaseController;
|
class SfxBaseController;
|
||||||
class Size;
|
class Size;
|
||||||
namespace boost { template<typename T> class rational; }
|
class Fraction;
|
||||||
namespace vcl { class Window; }
|
namespace vcl { class Window; }
|
||||||
class KeyEvent;
|
class KeyEvent;
|
||||||
class WorkWindow;
|
class WorkWindow;
|
||||||
@ -146,7 +146,7 @@ protected:
|
|||||||
|
|
||||||
virtual void InnerResizePixel( const Point &rOfs, const Size &rSize );
|
virtual void InnerResizePixel( const Point &rOfs, const Size &rSize );
|
||||||
virtual void OuterResizePixel( const Point &rOfs, const Size &rSize );
|
virtual void OuterResizePixel( const Point &rOfs, const Size &rSize );
|
||||||
virtual void SetZoomFactor( const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY );
|
virtual void SetZoomFactor( const Fraction &rZoomX, const Fraction &rZoomY );
|
||||||
|
|
||||||
virtual void Move();
|
virtual void Move();
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
class Point;
|
class Point;
|
||||||
class Rectangle;
|
class Rectangle;
|
||||||
class Size;
|
class Size;
|
||||||
namespace boost { template<typename T> class rational; }
|
class Fraction;
|
||||||
class IMapObject;
|
class IMapObject;
|
||||||
|
|
||||||
typedef ::std::vector< IMapObject* > IMapObjectList_impl;
|
typedef ::std::vector< IMapObject* > IMapObjectList_impl;
|
||||||
@ -117,7 +117,7 @@ public:
|
|||||||
void SetName( const OUString& rName ) { aName = rName; }
|
void SetName( const OUString& rName ) { aName = rName; }
|
||||||
|
|
||||||
// skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
|
// skaliert alle Objekte der ImageMap entpr. dem uebergebenen Faktor
|
||||||
void Scale( const boost::rational<long>& rFractX, const boost::rational<long>& rFracY );
|
void Scale( const Fraction& rFractX, const Fraction& rFracY );
|
||||||
|
|
||||||
// Im-/Export
|
// Im-/Export
|
||||||
void Write ( SvStream& rOStm, const OUString& rBaseURL ) const;
|
void Write ( SvStream& rOStm, const OUString& rBaseURL ) const;
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <tools/gen.hxx>
|
#include <tools/gen.hxx>
|
||||||
#include <svtools/imapobj.hxx>
|
#include <svtools/imapobj.hxx>
|
||||||
|
|
||||||
namespace boost { template<typename T> class rational; }
|
class Fraction;
|
||||||
|
|
||||||
class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
|
class SVT_DLLPUBLIC IMapCircleObject : public IMapObject
|
||||||
{
|
{
|
||||||
@ -60,7 +60,7 @@ public:
|
|||||||
// liefert das BoundRect des Kreis-Objektes in 1/100mm
|
// liefert das BoundRect des Kreis-Objektes in 1/100mm
|
||||||
virtual Rectangle GetBoundRect() const SAL_OVERRIDE;
|
virtual Rectangle GetBoundRect() const SAL_OVERRIDE;
|
||||||
|
|
||||||
void Scale( const boost::rational<long>& rFractX, const boost::rational<long>& rFracY );
|
void Scale( const Fraction& rFractX, const Fraction& rFracY );
|
||||||
|
|
||||||
using IMapObject::IsEqual;
|
using IMapObject::IsEqual;
|
||||||
bool IsEqual( const IMapCircleObject& rEqObj );
|
bool IsEqual( const IMapCircleObject& rEqObj );
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
#include <svtools/imapobj.hxx>
|
#include <svtools/imapobj.hxx>
|
||||||
#include <tools/poly.hxx>
|
#include <tools/poly.hxx>
|
||||||
|
|
||||||
namespace boost { template<typename T> class rational; }
|
class Fraction;
|
||||||
|
|
||||||
class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject
|
class SVT_DLLPUBLIC IMapPolygonObject : public IMapObject
|
||||||
{
|
{
|
||||||
@ -66,7 +66,7 @@ public:
|
|||||||
const Rectangle& GetExtraEllipse() const { return aEllipse; }
|
const Rectangle& GetExtraEllipse() const { return aEllipse; }
|
||||||
void SetExtraEllipse( const Rectangle& rEllipse );
|
void SetExtraEllipse( const Rectangle& rEllipse );
|
||||||
|
|
||||||
void Scale( const boost::rational<long>& rFractX, const boost::rational<long>& rFracY );
|
void Scale( const Fraction& rFractX, const Fraction& rFracY );
|
||||||
|
|
||||||
using IMapObject::IsEqual;
|
using IMapObject::IsEqual;
|
||||||
bool IsEqual( const IMapPolygonObject& rEqObj );
|
bool IsEqual( const IMapPolygonObject& rEqObj );
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include <svtools/imapobj.hxx>
|
#include <svtools/imapobj.hxx>
|
||||||
#include <tools/gen.hxx>
|
#include <tools/gen.hxx>
|
||||||
|
|
||||||
namespace boost { template<typename T> class rational; }
|
class Fraction;
|
||||||
|
|
||||||
class SVT_DLLPUBLIC IMapRectangleObject : public IMapObject
|
class SVT_DLLPUBLIC IMapRectangleObject : public IMapObject
|
||||||
{
|
{
|
||||||
@ -58,7 +58,7 @@ public:
|
|||||||
// liefert das BoundRect des Rechteck-Objektes in 1/100mm
|
// liefert das BoundRect des Rechteck-Objektes in 1/100mm
|
||||||
virtual Rectangle GetBoundRect() const SAL_OVERRIDE { return aRect; }
|
virtual Rectangle GetBoundRect() const SAL_OVERRIDE { return aRect; }
|
||||||
|
|
||||||
void Scale( const boost::rational<long>& rFractX, const boost::rational<long>& rFracY );
|
void Scale( const Fraction& rFractX, const Fraction& rFracY );
|
||||||
|
|
||||||
using IMapObject::IsEqual;
|
using IMapObject::IsEqual;
|
||||||
bool IsEqual( const IMapRectangleObject& rEqObj );
|
bool IsEqual( const IMapRectangleObject& rEqObj );
|
||||||
|
@ -644,7 +644,7 @@ private:
|
|||||||
RulerType meDragType;
|
RulerType meDragType;
|
||||||
MapUnit meSourceUnit;
|
MapUnit meSourceUnit;
|
||||||
FieldUnit meUnit;
|
FieldUnit meUnit;
|
||||||
boost::rational<long> maZoom;
|
Fraction maZoom;
|
||||||
bool mbCalc;
|
bool mbCalc;
|
||||||
bool mbFormat;
|
bool mbFormat;
|
||||||
bool mbDrag;
|
bool mbDrag;
|
||||||
@ -745,8 +745,8 @@ public:
|
|||||||
|
|
||||||
void SetUnit( FieldUnit eNewUnit );
|
void SetUnit( FieldUnit eNewUnit );
|
||||||
FieldUnit GetUnit() const { return meUnit; }
|
FieldUnit GetUnit() const { return meUnit; }
|
||||||
void SetZoom( const boost::rational<long>& rNewZoom );
|
void SetZoom( const Fraction& rNewZoom );
|
||||||
boost::rational<long> GetZoom() const { return maZoom; }
|
Fraction GetZoom() const { return maZoom; }
|
||||||
|
|
||||||
void SetSourceUnit( MapUnit eNewUnit ) { meSourceUnit = eNewUnit; }
|
void SetSourceUnit( MapUnit eNewUnit ) { meSourceUnit = eNewUnit; }
|
||||||
MapUnit GetSourceUnit() const { return meSourceUnit; }
|
MapUnit GetSourceUnit() const { return meSourceUnit; }
|
||||||
|
@ -153,7 +153,7 @@ public:
|
|||||||
virtual void SetPage(SdrPage* pNewPage) SAL_OVERRIDE;
|
virtual void SetPage(SdrPage* pNewPage) SAL_OVERRIDE;
|
||||||
virtual void SetModel(SdrModel* pNewModel) SAL_OVERRIDE;
|
virtual void SetModel(SdrModel* pNewModel) SAL_OVERRIDE;
|
||||||
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual SdrObjList* GetSubList() const SAL_OVERRIDE;
|
virtual SdrObjList* GetSubList() const SAL_OVERRIDE;
|
||||||
|
|
||||||
// Insert 3D object into the group; transfer to other owner!
|
// Insert 3D object into the group; transfer to other owner!
|
||||||
|
@ -191,8 +191,8 @@ public:
|
|||||||
|
|
||||||
virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& rXFact,
|
virtual void NbcResize(const Point& rRef, const Fraction& rXFact,
|
||||||
const boost::rational<long>& rYFact) SAL_OVERRIDE;
|
const Fraction& rYFact) SAL_OVERRIDE;
|
||||||
virtual void RecalcSnapRect() SAL_OVERRIDE;
|
virtual void RecalcSnapRect() SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual E3dScene* GetScene() const SAL_OVERRIDE;
|
virtual E3dScene* GetScene() const SAL_OVERRIDE;
|
||||||
|
@ -94,7 +94,7 @@ namespace sdr
|
|||||||
virtual void ForceDefaultAttributes();
|
virtual void ForceDefaultAttributes();
|
||||||
|
|
||||||
// Scale the included ItemSet.
|
// Scale the included ItemSet.
|
||||||
virtual void Scale(const boost::rational<long>& rScale) SAL_OVERRIDE;
|
virtual void Scale(const Fraction& rScale) SAL_OVERRIDE;
|
||||||
};
|
};
|
||||||
} // end of namespace properties
|
} // end of namespace properties
|
||||||
} // end of namespace sdr
|
} // end of namespace sdr
|
||||||
|
@ -30,7 +30,7 @@ class SdrObject;
|
|||||||
class SfxItemSet;
|
class SfxItemSet;
|
||||||
class SfxPoolItem;
|
class SfxPoolItem;
|
||||||
class SfxStyleSheet;
|
class SfxStyleSheet;
|
||||||
namespace boost { template<typename T> class rational; }
|
class Fraction;
|
||||||
class SfxItemPool;
|
class SfxItemPool;
|
||||||
class SdrModel;
|
class SdrModel;
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ namespace sdr
|
|||||||
|
|
||||||
// Scale the local ItemSet as far as it contains metric items. This needs to be
|
// Scale the local ItemSet as far as it contains metric items. This needs to be
|
||||||
// overloaded to do it for hierarchical objects like e.g. groups.
|
// overloaded to do it for hierarchical objects like e.g. groups.
|
||||||
virtual void Scale(const boost::rational<long>& rScale);
|
virtual void Scale(const Fraction& rScale);
|
||||||
|
|
||||||
// Move local items to a new ItemPool. This needs to be
|
// Move local items to a new ItemPool. This needs to be
|
||||||
// overloaded to do it for hierarchical objects like e.g. groups.
|
// overloaded to do it for hierarchical objects like e.g. groups.
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <tools/gen.hxx>
|
#include <tools/gen.hxx>
|
||||||
#include <tools/rational.hxx>
|
#include <tools/fract.hxx>
|
||||||
#include <svx/svxdllapi.h>
|
#include <svx/svxdllapi.h>
|
||||||
|
|
||||||
// Status information for specialized object dragging. In order for the model
|
// Status information for specialized object dragging. In order for the model
|
||||||
@ -146,8 +146,8 @@ public:
|
|||||||
bool CheckMinMoved(const Point& rPnt);
|
bool CheckMinMoved(const Point& rPnt);
|
||||||
long GetDX() const { return GetNow().X()-GetPrev().X(); }
|
long GetDX() const { return GetNow().X()-GetPrev().X(); }
|
||||||
long GetDY() const { return GetNow().Y()-GetPrev().Y(); }
|
long GetDY() const { return GetNow().Y()-GetPrev().Y(); }
|
||||||
boost::rational<long> GetXFact() const;
|
Fraction GetXFact() const;
|
||||||
boost::rational<long> GetYFact() const;
|
Fraction GetYFact() const;
|
||||||
|
|
||||||
SdrDragMethod* GetDragMethod() const { return pDragMethod; }
|
SdrDragMethod* GetDragMethod() const { return pDragMethod; }
|
||||||
void SetDragMethod(SdrDragMethod* pMth) { pDragMethod=pMth; }
|
void SetDragMethod(SdrDragMethod* pMth) { pDragMethod=pMth; }
|
||||||
|
@ -258,8 +258,8 @@ public:
|
|||||||
class SVX_DLLPUBLIC SdrDragResize : public SdrDragMethod
|
class SVX_DLLPUBLIC SdrDragResize : public SdrDragMethod
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
boost::rational<long> aXFact;
|
Fraction aXFact;
|
||||||
boost::rational<long> aYFact;
|
Fraction aYFact;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TYPEINFO_OVERRIDE();
|
TYPEINFO_OVERRIDE();
|
||||||
|
@ -212,8 +212,8 @@ public:
|
|||||||
// waagerechte Linie hat z.B. immer eine Hoehe von 0.
|
// waagerechte Linie hat z.B. immer eine Hoehe von 0.
|
||||||
void SetMarkedObjRect(const Rectangle& rRect, bool bCopy=false);
|
void SetMarkedObjRect(const Rectangle& rRect, bool bCopy=false);
|
||||||
void MoveMarkedObj(const Size& rSiz, bool bCopy=false);
|
void MoveMarkedObj(const Size& rSiz, bool bCopy=false);
|
||||||
void ResizeMarkedObj(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bCopy=false);
|
void ResizeMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
|
||||||
void ResizeMultMarkedObj(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, const bool bCopy, const bool bWdh, const bool bHgt);
|
void ResizeMultMarkedObj(const Point& rRef, const Fraction& xFact, const Fraction& yFact, const bool bCopy, const bool bWdh, const bool bHgt);
|
||||||
long GetMarkedObjRotate() const;
|
long GetMarkedObjRotate() const;
|
||||||
void RotateMarkedObj(const Point& rRef, long nWink, bool bCopy=false);
|
void RotateMarkedObj(const Point& rRef, long nWink, bool bCopy=false);
|
||||||
void MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy=false);
|
void MirrorMarkedObj(const Point& rRef1, const Point& rRef2, bool bCopy=false);
|
||||||
@ -228,7 +228,7 @@ public:
|
|||||||
void CopyMarkedObj();
|
void CopyMarkedObj();
|
||||||
void SetAllMarkedRect(const Rectangle& rRect, bool bCopy=false) { SetMarkedObjRect(rRect,bCopy); }
|
void SetAllMarkedRect(const Rectangle& rRect, bool bCopy=false) { SetMarkedObjRect(rRect,bCopy); }
|
||||||
void MoveAllMarked(const Size& rSiz, bool bCopy=false) { MoveMarkedObj (rSiz,bCopy); }
|
void MoveAllMarked(const Size& rSiz, bool bCopy=false) { MoveMarkedObj (rSiz,bCopy); }
|
||||||
void ResizeAllMarked(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bCopy=false) { ResizeMarkedObj (rRef,xFact,yFact,bCopy); }
|
void ResizeAllMarked(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false) { ResizeMarkedObj (rRef,xFact,yFact,bCopy); }
|
||||||
long GetAllMarkedRotate() const { return GetMarkedObjRotate(); }
|
long GetAllMarkedRotate() const { return GetMarkedObjRotate(); }
|
||||||
void RotateAllMarked(const Point& rRef, long nWink, bool bCopy=false) { RotateMarkedObj(rRef,nWink,bCopy); }
|
void RotateAllMarked(const Point& rRef, long nWink, bool bCopy=false) { RotateMarkedObj(rRef,nWink,bCopy); }
|
||||||
void MirrorAllMarked(const Point& rRef1, const Point& rRef2, bool bCopy=false) { MirrorMarkedObj(rRef1,rRef2,bCopy); }
|
void MirrorAllMarked(const Point& rRef1, const Point& rRef2, bool bCopy=false) { MirrorMarkedObj(rRef1,rRef2,bCopy); }
|
||||||
|
@ -62,7 +62,7 @@ friend class SdrAttrObj;
|
|||||||
Color aFontColor;
|
Color aFontColor;
|
||||||
sal_uIntPtr nFontHeight;
|
sal_uIntPtr nFontHeight;
|
||||||
MapUnit eMapUnit;
|
MapUnit eMapUnit;
|
||||||
boost::rational<long> aMapFraction;
|
Fraction aMapFraction;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static SdrEngineDefaults& GetDefaults();
|
static SdrEngineDefaults& GetDefaults();
|
||||||
@ -92,8 +92,8 @@ public:
|
|||||||
static void SetMapUnit(MapUnit eMap) { GetDefaults().eMapUnit=eMap; }
|
static void SetMapUnit(MapUnit eMap) { GetDefaults().eMapUnit=eMap; }
|
||||||
static MapUnit GetMapUnit() { return GetDefaults().eMapUnit; }
|
static MapUnit GetMapUnit() { return GetDefaults().eMapUnit; }
|
||||||
// Default MapFraction ist 1/1.
|
// Default MapFraction ist 1/1.
|
||||||
static void SetMapFraction(const boost::rational<long>& rMap) { GetDefaults().aMapFraction=rMap; }
|
static void SetMapFraction(const Fraction& rMap) { GetDefaults().aMapFraction=rMap; }
|
||||||
static boost::rational<long> GetMapFraction() { return GetDefaults().aMapFraction; }
|
static Fraction GetMapFraction() { return GetDefaults().aMapFraction; }
|
||||||
|
|
||||||
// Einen Outliner mit den engineglobalen
|
// Einen Outliner mit den engineglobalen
|
||||||
// Defaulteinstellungen auf dem Heap erzeugen.
|
// Defaulteinstellungen auf dem Heap erzeugen.
|
||||||
|
@ -78,7 +78,7 @@ public:
|
|||||||
void DeleteMarkedGluePoints();
|
void DeleteMarkedGluePoints();
|
||||||
|
|
||||||
void MoveMarkedGluePoints (const Size& rSiz, bool bCopy=false);
|
void MoveMarkedGluePoints (const Size& rSiz, bool bCopy=false);
|
||||||
void ResizeMarkedGluePoints(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bCopy=false);
|
void ResizeMarkedGluePoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bCopy=false);
|
||||||
void RotateMarkedGluePoints(const Point& rRef, long nWink, bool bCopy=false);
|
void RotateMarkedGluePoints(const Point& rRef, long nWink, bool bCopy=false);
|
||||||
void MirrorMarkedGluePoints(const Point& rRef1, const Point& rRef2, bool bCopy=false);
|
void MirrorMarkedGluePoints(const Point& rRef1, const Point& rRef2, bool bCopy=false);
|
||||||
void MirrorMarkedGluePointsHorizontal(bool bCopy=false);
|
void MirrorMarkedGluePointsHorizontal(bool bCopy=false);
|
||||||
|
@ -155,12 +155,12 @@ protected:
|
|||||||
Link aIOProgressLink;
|
Link aIOProgressLink;
|
||||||
OUString aTablePath;
|
OUString aTablePath;
|
||||||
Size aMaxObjSize; // e.g. for auto-growing text
|
Size aMaxObjSize; // e.g. for auto-growing text
|
||||||
boost::rational<long> aObjUnit; // description of the coordinate units for ClipBoard, Drag&Drop, ...
|
Fraction aObjUnit; // description of the coordinate units for ClipBoard, Drag&Drop, ...
|
||||||
MapUnit eObjUnit; // see above
|
MapUnit eObjUnit; // see above
|
||||||
FieldUnit eUIUnit; // unit, scale (e.g. 1/1000) for the UI (status bar) is set by ImpSetUIUnit()
|
FieldUnit eUIUnit; // unit, scale (e.g. 1/1000) for the UI (status bar) is set by ImpSetUIUnit()
|
||||||
boost::rational<long> aUIScale; // see above
|
Fraction aUIScale; // see above
|
||||||
OUString aUIUnitStr; // see above
|
OUString aUIUnitStr; // see above
|
||||||
boost::rational<long> aUIUnitFact; // see above
|
Fraction aUIUnitFact; // see above
|
||||||
int nUIUnitKomma; // see above
|
int nUIUnitKomma; // see above
|
||||||
|
|
||||||
SdrLayerAdmin* pLayerAdmin;
|
SdrLayerAdmin* pLayerAdmin;
|
||||||
@ -376,10 +376,10 @@ public:
|
|||||||
// with the correct sizes.
|
// with the correct sizes.
|
||||||
MapUnit GetScaleUnit() const { return eObjUnit; }
|
MapUnit GetScaleUnit() const { return eObjUnit; }
|
||||||
void SetScaleUnit(MapUnit eMap);
|
void SetScaleUnit(MapUnit eMap);
|
||||||
const boost::rational<long>& GetScaleFraction() const { return aObjUnit; }
|
const Fraction& GetScaleFraction() const { return aObjUnit; }
|
||||||
void SetScaleFraction(const boost::rational<long>& rFrac);
|
void SetScaleFraction(const Fraction& rFrac);
|
||||||
// Setting both simultaneously performs a little better
|
// Setting both simultaneously performs a little better
|
||||||
void SetScaleUnit(MapUnit eMap, const boost::rational<long>& rFrac);
|
void SetScaleUnit(MapUnit eMap, const Fraction& rFrac);
|
||||||
|
|
||||||
// maximal size e.g. for auto growing texts
|
// maximal size e.g. for auto growing texts
|
||||||
const Size& GetMaxObjSize() const { return aMaxObjSize; }
|
const Size& GetMaxObjSize() const { return aMaxObjSize; }
|
||||||
@ -389,12 +389,12 @@ public:
|
|||||||
void SetUIUnit(FieldUnit eUnit);
|
void SetUIUnit(FieldUnit eUnit);
|
||||||
FieldUnit GetUIUnit() const { return eUIUnit; }
|
FieldUnit GetUIUnit() const { return eUIUnit; }
|
||||||
// The scale of the drawing. Default 1/1.
|
// The scale of the drawing. Default 1/1.
|
||||||
void SetUIScale(const boost::rational<long>& rScale);
|
void SetUIScale(const Fraction& rScale);
|
||||||
const boost::rational<long>& GetUIScale() const { return aUIScale; }
|
const Fraction& GetUIScale() const { return aUIScale; }
|
||||||
// Setting both simultaneously performs a little better
|
// Setting both simultaneously performs a little better
|
||||||
void SetUIUnit(FieldUnit eUnit, const boost::rational<long>& rScale);
|
void SetUIUnit(FieldUnit eUnit, const Fraction& rScale);
|
||||||
|
|
||||||
const boost::rational<long>& GetUIUnitFact() const { return aUIUnitFact; }
|
const Fraction& GetUIUnitFact() const { return aUIUnitFact; }
|
||||||
const OUString& GetUIUnitStr() const { return aUIUnitStr; }
|
const OUString& GetUIUnitStr() const { return aUIUnitStr; }
|
||||||
int GetUIUnitKomma() const { return nUIUnitKomma; }
|
int GetUIUnitKomma() const { return nUIUnitKomma; }
|
||||||
bool IsUIOnlyKomma() const { return bUIOnlyKomma; }
|
bool IsUIOnlyKomma() const { return bUIOnlyKomma; }
|
||||||
@ -402,7 +402,7 @@ public:
|
|||||||
static void TakeUnitStr(FieldUnit eUnit, OUString& rStr);
|
static void TakeUnitStr(FieldUnit eUnit, OUString& rStr);
|
||||||
void TakeMetricStr(long nVal, OUString& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const;
|
void TakeMetricStr(long nVal, OUString& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const;
|
||||||
void TakeWinkStr(long nWink, OUString& rStr, bool bNoDegChar = false) const;
|
void TakeWinkStr(long nWink, OUString& rStr, bool bNoDegChar = false) const;
|
||||||
void TakePercentStr(const boost::rational<long>& rVal, OUString& rStr, bool bNoPercentChar = false) const;
|
void TakePercentStr(const Fraction& rVal, OUString& rStr, bool bNoPercentChar = false) const;
|
||||||
|
|
||||||
// RecalcPageNums is ordinarily only called by the Page.
|
// RecalcPageNums is ordinarily only called by the Page.
|
||||||
bool IsPagNumsDirty() const { return bPagNumsDirty; };
|
bool IsPagNumsDirty() const { return bPagNumsDirty; };
|
||||||
|
@ -188,13 +188,13 @@ public:
|
|||||||
virtual const Rectangle& GetLogicRect() const SAL_OVERRIDE;
|
virtual const Rectangle& GetLogicRect() const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void Move(const Size& rSiz) SAL_OVERRIDE;
|
virtual void Move(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
|
virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
|
||||||
virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
virtual void SetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void SetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
virtual void SetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void SetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
|
@ -672,13 +672,13 @@ public:
|
|||||||
// Objekte sollten i.d.R. nur die Nbc-Methoden ueberladen.
|
// Objekte sollten i.d.R. nur die Nbc-Methoden ueberladen.
|
||||||
// Nbc bedeutet: 'NoBroadcast'.
|
// Nbc bedeutet: 'NoBroadcast'.
|
||||||
virtual void NbcMove (const Size& rSiz);
|
virtual void NbcMove (const Size& rSiz);
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact);
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
|
||||||
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
|
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs);
|
||||||
virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
|
virtual void NbcMirror(const Point& rRef1, const Point& rRef2);
|
||||||
virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear);
|
virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear);
|
||||||
|
|
||||||
virtual void Move (const Size& rSiz);
|
virtual void Move (const Size& rSiz);
|
||||||
virtual void Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative = true);
|
virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true);
|
||||||
virtual void Rotate(const Point& rRef, long nWink, double sn, double cs);
|
virtual void Rotate(const Point& rRef, long nWink, double sn, double cs);
|
||||||
virtual void Mirror(const Point& rRef1, const Point& rRef2);
|
virtual void Mirror(const Point& rRef1, const Point& rRef2);
|
||||||
virtual void Shear (const Point& rRef, long nWink, double tn, bool bVShear);
|
virtual void Shear (const Point& rRef, long nWink, double tn, bool bVShear);
|
||||||
|
@ -116,7 +116,7 @@ public:
|
|||||||
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcSetRelativePos(const Point& rPnt) SAL_OVERRIDE;
|
virtual void NbcSetRelativePos(const Point& rPnt) SAL_OVERRIDE;
|
||||||
virtual Point GetRelativePos() const SAL_OVERRIDE;
|
virtual Point GetRelativePos() const SAL_OVERRIDE;
|
||||||
|
@ -112,7 +112,7 @@ public:
|
|||||||
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const SAL_OVERRIDE;
|
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const SAL_OVERRIDE;
|
||||||
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
||||||
virtual void NbcMove(const Size& aSiz) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& aSiz) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const SAL_OVERRIDE;
|
virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const SAL_OVERRIDE;
|
||||||
|
@ -264,7 +264,7 @@ public:
|
|||||||
|
|
||||||
virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
virtual void NbcMove(const Size& aSize) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& aSize) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRefPnt, const boost::rational<long>& aXFact, const boost::rational<long>& aYFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact) SAL_OVERRIDE;
|
||||||
|
|
||||||
// #i54102# added rotate, mirrorn and shear support
|
// #i54102# added rotate, mirrorn and shear support
|
||||||
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
|
@ -162,7 +162,7 @@ public:
|
|||||||
virtual sal_uInt32 GetHdlCount() const SAL_OVERRIDE;
|
virtual sal_uInt32 GetHdlCount() const SAL_OVERRIDE;
|
||||||
virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const SAL_OVERRIDE;
|
virtual SdrHdl* GetHdl(sal_uInt32 nHdlNum) const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void NbcShear (const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
|
@ -85,7 +85,7 @@ public:
|
|||||||
virtual long GetShearAngle(bool bVertical = false) const SAL_OVERRIDE;
|
virtual long GetShearAngle(bool bVertical = false) const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void Move(const Size& rSiz) SAL_OVERRIDE;
|
virtual void Move(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
|
virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
|
||||||
virtual void Rotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void Rotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
virtual void Mirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void Mirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
@ -95,7 +95,7 @@ public:
|
|||||||
virtual void SetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void SetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
|
@ -117,7 +117,7 @@ public:
|
|||||||
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
|
@ -136,7 +136,7 @@ public:
|
|||||||
SdrOle2Obj& operator=(const SdrOle2Obj& rObj);
|
SdrOle2Obj& operator=(const SdrOle2Obj& rObj);
|
||||||
|
|
||||||
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSize) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void NbcSetSnapRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
virtual void SetGeoData(const SdrObjGeoData& rGeo) SAL_OVERRIDE;
|
virtual void SetGeoData(const SdrObjGeoData& rGeo) SAL_OVERRIDE;
|
||||||
@ -167,7 +167,7 @@ public:
|
|||||||
const OUString& aMediaType );
|
const OUString& aMediaType );
|
||||||
|
|
||||||
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetParentXModel() const;
|
::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > GetParentXModel() const;
|
||||||
bool CalculateNewScaling( boost::rational<long>& aScaleWidth, boost::rational<long>& aScaleHeight, Size& aObjAreaSize );
|
bool CalculateNewScaling( Fraction& aScaleWidth, Fraction& aScaleHeight, Size& aObjAreaSize );
|
||||||
bool AddOwnLightClient();
|
bool AddOwnLightClient();
|
||||||
|
|
||||||
// handy to get the empty replacement graphic without accessing all the old stuff
|
// handy to get the empty replacement graphic without accessing all the old stuff
|
||||||
|
@ -114,7 +114,7 @@ public:
|
|||||||
basegfx::B2DPolyPolygon getDragPolyPolygon(const SdrDragStat& rDrag) const;
|
basegfx::B2DPolyPolygon getDragPolyPolygon(const SdrDragStat& rDrag) const;
|
||||||
|
|
||||||
virtual void NbcMove(const Size& aSize) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& aSize) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRefPnt, const boost::rational<long>& aXFact, const boost::rational<long>& aYFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRefPnt, const Fraction& aXFact, const Fraction& aYFact) SAL_OVERRIDE;
|
||||||
virtual void NbcRotate(const Point& rRefPnt, long nAngle, double fSin, double fCos) SAL_OVERRIDE;
|
virtual void NbcRotate(const Point& rRefPnt, long nAngle, double fSin, double fCos) SAL_OVERRIDE;
|
||||||
virtual void NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2) SAL_OVERRIDE;
|
virtual void NbcMirror(const Point& rRefPnt1, const Point& rRefPnt2) SAL_OVERRIDE;
|
||||||
virtual void NbcShear(const Point& rRefPnt, long nAngle, double fTan, bool bVShear) SAL_OVERRIDE;
|
virtual void NbcShear(const Point& rRefPnt, long nAngle, double fTan, bool bVShear) SAL_OVERRIDE;
|
||||||
|
@ -105,7 +105,7 @@ public:
|
|||||||
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
|
@ -241,7 +241,7 @@ public:
|
|||||||
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual bool BegTextEdit(SdrOutliner& rOutl) SAL_OVERRIDE;
|
virtual bool BegTextEdit(SdrOutliner& rOutl) SAL_OVERRIDE;
|
||||||
virtual void EndTextEdit(SdrOutliner& rOutl) SAL_OVERRIDE;
|
virtual void EndTextEdit(SdrOutliner& rOutl) SAL_OVERRIDE;
|
||||||
|
@ -264,7 +264,7 @@ private:
|
|||||||
Rectangle& rTextRect,
|
Rectangle& rTextRect,
|
||||||
Rectangle& rAnchorRect,
|
Rectangle& rAnchorRect,
|
||||||
Rectangle& rPaintRect,
|
Rectangle& rPaintRect,
|
||||||
boost::rational<long>& aFitXKorreg ) const;
|
Fraction& aFitXKorreg ) const;
|
||||||
void ImpAutoFitText( SdrOutliner& rOutliner ) const;
|
void ImpAutoFitText( SdrOutliner& rOutliner ) const;
|
||||||
static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting );
|
static void ImpAutoFitText( SdrOutliner& rOutliner, const Size& rShapeSize, bool bIsVerticalWriting );
|
||||||
SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
|
SVX_DLLPRIVATE SdrObject* ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const;
|
||||||
@ -284,7 +284,7 @@ protected:
|
|||||||
SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier, bool bNoSetAttr = false) const;
|
SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier, bool bNoSetAttr = false) const;
|
||||||
SdrObject* ImpConvertAddText(SdrObject* pObj, bool bBezier) const;
|
SdrObject* ImpConvertAddText(SdrObject* pObj, bool bBezier) const;
|
||||||
void ImpSetTextStyleSheetListeners();
|
void ImpSetTextStyleSheetListeners();
|
||||||
void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, boost::rational<long>& rFitXKorreg) const;
|
void ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextSize, const Size& rShapeSize, Fraction& rFitXKorreg) const;
|
||||||
void ImpJustifyRect(Rectangle& rRect) const;
|
void ImpJustifyRect(Rectangle& rRect) const;
|
||||||
void ImpCheckShear();
|
void ImpCheckShear();
|
||||||
Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
|
Rectangle ImpDragCalcRect(const SdrDragStat& rDrag) const;
|
||||||
@ -468,7 +468,7 @@ public:
|
|||||||
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
virtual Pointer GetCreatePointer() const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
|
@ -80,7 +80,7 @@ public:
|
|||||||
|
|
||||||
virtual SdrUnoObj* Clone() const SAL_OVERRIDE;
|
virtual SdrUnoObj* Clone() const SAL_OVERRIDE;
|
||||||
SdrUnoObj& operator= (const SdrUnoObj& rObj);
|
SdrUnoObj& operator= (const SdrUnoObj& rObj);
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcSetLayer(SdrLayerID nLayer) SAL_OVERRIDE;
|
virtual void NbcSetLayer(SdrLayerID nLayer) SAL_OVERRIDE;
|
||||||
|
|
||||||
// SpecialDrag support
|
// SpecialDrag support
|
||||||
|
@ -101,13 +101,13 @@ public:
|
|||||||
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const SAL_OVERRIDE;
|
virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
virtual void NbcMove(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void NbcRotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void NbcMirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void NbcShear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
|
|
||||||
virtual void Move(const Size& rSiz) SAL_OVERRIDE;
|
virtual void Move(const Size& rSiz) SAL_OVERRIDE;
|
||||||
virtual void Resize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
|
virtual void Resize(const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bUnsetRelative = true) SAL_OVERRIDE;
|
||||||
virtual void Rotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
virtual void Rotate(const Point& rRef, long nWink, double sn, double cs) SAL_OVERRIDE;
|
||||||
virtual void Mirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
virtual void Mirror(const Point& rRef1, const Point& rRef2) SAL_OVERRIDE;
|
||||||
virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
virtual void Shear(const Point& rRef, long nWink, double tn, bool bVShear) SAL_OVERRIDE;
|
||||||
|
@ -64,7 +64,7 @@ public:
|
|||||||
bool IsDeleteMarkedPointsPossible() const SAL_OVERRIDE;
|
bool IsDeleteMarkedPointsPossible() const SAL_OVERRIDE;
|
||||||
|
|
||||||
void MoveMarkedPoints(const Size& rSiz);
|
void MoveMarkedPoints(const Size& rSiz);
|
||||||
void ResizeMarkedPoints(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact);
|
void ResizeMarkedPoints(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
|
||||||
void RotateMarkedPoints(const Point& rRef, long nWink);
|
void RotateMarkedPoints(const Point& rRef, long nWink);
|
||||||
|
|
||||||
// Hierbei entstehen eventuell beliebig viele neue Objekte:
|
// Hierbei entstehen eventuell beliebig viele neue Objekte:
|
||||||
|
@ -51,10 +51,10 @@ protected:
|
|||||||
class ImplHelpLineOverlay* mpHelpLineOverlay;
|
class ImplHelpLineOverlay* mpHelpLineOverlay;
|
||||||
|
|
||||||
Size aMagnSiz;
|
Size aMagnSiz;
|
||||||
boost::rational<long> aSnapWdtX;
|
Fraction aSnapWdtX;
|
||||||
boost::rational<long> aSnapWdtY;
|
Fraction aSnapWdtY;
|
||||||
|
|
||||||
sal_uInt16 nMagnSizPix;
|
sal_uInt16 nMagnSizPix;
|
||||||
long nSnapAngle;
|
long nSnapAngle;
|
||||||
long nEliminatePolyPointLimitAngle;
|
long nEliminatePolyPointLimitAngle;
|
||||||
|
|
||||||
@ -98,9 +98,9 @@ public:
|
|||||||
virtual void BrkAction() SAL_OVERRIDE; // f.abg.Klassen Actions z,B, Draggen abbrechen.
|
virtual void BrkAction() SAL_OVERRIDE; // f.abg.Klassen Actions z,B, Draggen abbrechen.
|
||||||
virtual void TakeActionRect(Rectangle& rRect) const SAL_OVERRIDE;
|
virtual void TakeActionRect(Rectangle& rRect) const SAL_OVERRIDE;
|
||||||
|
|
||||||
void SetSnapGridWidth(const boost::rational<long>& rX, const boost::rational<long>& rY) { aSnapWdtX=rX; aSnapWdtY=rY; }
|
void SetSnapGridWidth(const Fraction& rX, const Fraction& rY) { aSnapWdtX=rX; aSnapWdtY=rY; }
|
||||||
const boost::rational<long>& GetSnapGridWidthX() const { return aSnapWdtX; }
|
const Fraction& GetSnapGridWidthX() const { return aSnapWdtX; }
|
||||||
const boost::rational<long>& GetSnapGridWidthY() const { return aSnapWdtY; }
|
const Fraction& GetSnapGridWidthY() const { return aSnapWdtY; }
|
||||||
|
|
||||||
void SetSnapMagnetic(const Size& rSiz) { if (rSiz!=aMagnSiz) { aMagnSiz=rSiz; } }
|
void SetSnapMagnetic(const Size& rSiz) { if (rSiz!=aMagnSiz) { aMagnSiz=rSiz; } }
|
||||||
const Size& GetSnapMagnetic() const { return aMagnSiz; }
|
const Size& GetSnapMagnetic() const { return aMagnSiz; }
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include <rtl/ustring.hxx>
|
#include <rtl/ustring.hxx>
|
||||||
#include <svx/svxdllapi.h>
|
#include <svx/svxdllapi.h>
|
||||||
#include <tools/rational.hxx>
|
#include <tools/fract.hxx>
|
||||||
#include <tools/gen.hxx>
|
#include <tools/gen.hxx>
|
||||||
#include <tools/poly.hxx>
|
#include <tools/poly.hxx>
|
||||||
#include <vcl/field.hxx>
|
#include <vcl/field.hxx>
|
||||||
@ -55,10 +55,10 @@ inline void MovePoly(Polygon& rPoly, const Size& S) { rPoly.Move(S.Width(),
|
|||||||
inline void MovePoly(tools::PolyPolygon& rPoly, const Size& S) { rPoly.Move(S.Width(),S.Height()); }
|
inline void MovePoly(tools::PolyPolygon& rPoly, const Size& S) { rPoly.Move(S.Width(),S.Height()); }
|
||||||
void MoveXPoly(XPolygon& rPoly, const Size& S);
|
void MoveXPoly(XPolygon& rPoly, const Size& S);
|
||||||
|
|
||||||
SVX_DLLPUBLIC void ResizeRect(Rectangle& rRect, const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact, bool bNoJustify = false);
|
SVX_DLLPUBLIC void ResizeRect(Rectangle& rRect, const Point& rRef, const Fraction& xFact, const Fraction& yFact, bool bNoJustify = false);
|
||||||
inline void ResizePoint(Point& rPnt, const Point& rRef, boost::rational<long> xFact, boost::rational<long> yFact);
|
inline void ResizePoint(Point& rPnt, const Point& rRef, Fraction xFact, Fraction yFact);
|
||||||
void ResizePoly(Polygon& rPoly, const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact);
|
void ResizePoly(Polygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact);
|
||||||
void ResizeXPoly(XPolygon& rPoly, const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact);
|
void ResizeXPoly(XPolygon& rPoly, const Point& rRef, const Fraction& xFact, const Fraction& yFact);
|
||||||
|
|
||||||
inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs);
|
inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs);
|
||||||
SVX_DLLPUBLIC void RotatePoly(Polygon& rPoly, const Point& rRef, double sn, double cs);
|
SVX_DLLPUBLIC void RotatePoly(Polygon& rPoly, const Point& rRef, double sn, double cs);
|
||||||
@ -102,10 +102,12 @@ void CrookStretchPoly(XPolyPolygon& rPoly, const Point& rCenter, const Point& rR
|
|||||||
/* Inline */
|
/* Inline */
|
||||||
/**************************************************************************************************/
|
/**************************************************************************************************/
|
||||||
|
|
||||||
inline void ResizePoint(Point& rPnt, const Point& rRef, boost::rational<long> xFact, boost::rational<long> yFact)
|
inline void ResizePoint(Point& rPnt, const Point& rRef, Fraction xFact, Fraction yFact)
|
||||||
{
|
{
|
||||||
rPnt.X()=rRef.X()+ Round(((double)(rPnt.X()-rRef.X())*xFact.numerator())/xFact.denominator());
|
if (xFact.GetDenominator()==0) xFact=Fraction(xFact.GetNumerator(),1); // DivZero abfangen
|
||||||
rPnt.Y()=rRef.Y()+ Round(((double)(rPnt.Y()-rRef.Y())*yFact.numerator())/yFact.denominator());
|
if (yFact.GetDenominator()==0) yFact=Fraction(yFact.GetNumerator(),1); // DivZero abfangen
|
||||||
|
rPnt.X()=rRef.X()+ Round(((double)(rPnt.X()-rRef.X())*xFact.GetNumerator())/xFact.GetDenominator());
|
||||||
|
rPnt.Y()=rRef.Y()+ Round(((double)(rPnt.Y()-rRef.Y())*yFact.GetNumerator())/yFact.GetDenominator());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs)
|
inline void RotatePoint(Point& rPnt, const Point& rRef, double sn, double cs)
|
||||||
@ -219,25 +221,25 @@ SVX_DLLPUBLIC void OrthoDistance4(const Point& rPt0, Point& rPt, bool bBigOrtho)
|
|||||||
// Rechnung und Zwischenergebnis sind BigInt.
|
// Rechnung und Zwischenergebnis sind BigInt.
|
||||||
SVX_DLLPUBLIC long BigMulDiv(long nVal, long nMul, long nDiv);
|
SVX_DLLPUBLIC long BigMulDiv(long nVal, long nMul, long nDiv);
|
||||||
|
|
||||||
// Fehlerbehaftetes Kuerzen einer boost::rational<long>.
|
// Fehlerbehaftetes Kuerzen einer Fraction.
|
||||||
// nDigits gibt an, wieviele signifikante Stellen in
|
// nDigits gibt an, wieviele signifikante Stellen in
|
||||||
// Zaehler/Nenner mindestens erhalten bleiben sollen.
|
// Zaehler/Nenner mindestens erhalten bleiben sollen.
|
||||||
void Kuerzen(boost::rational<long>& rF, unsigned nDigits);
|
void Kuerzen(Fraction& rF, unsigned nDigits);
|
||||||
|
|
||||||
|
|
||||||
class FrPair {
|
class FrPair {
|
||||||
boost::rational<long> aX;
|
Fraction aX;
|
||||||
boost::rational<long> aY;
|
Fraction aY;
|
||||||
public:
|
public:
|
||||||
FrPair() : aX(0,1),aY(0,1) {}
|
FrPair() : aX(0,1),aY(0,1) {}
|
||||||
FrPair(const boost::rational<long>& rBoth) : aX(rBoth),aY(rBoth) {}
|
FrPair(const Fraction& rBoth) : aX(rBoth),aY(rBoth) {}
|
||||||
FrPair(const boost::rational<long>& rX, const boost::rational<long>& rY) : aX(rX),aY(rY) {}
|
FrPair(const Fraction& rX, const Fraction& rY) : aX(rX),aY(rY) {}
|
||||||
FrPair(long nMul, long nDiv) : aX(nMul,nDiv),aY(nMul,nDiv) {}
|
FrPair(long nMul, long nDiv) : aX(nMul,nDiv),aY(nMul,nDiv) {}
|
||||||
FrPair(long xMul, long xDiv, long yMul, long yDiv): aX(xMul,xDiv),aY(yMul,yDiv) {}
|
FrPair(long xMul, long xDiv, long yMul, long yDiv): aX(xMul,xDiv),aY(yMul,yDiv) {}
|
||||||
const boost::rational<long>& X() const { return aX; }
|
const Fraction& X() const { return aX; }
|
||||||
const boost::rational<long>& Y() const { return aY; }
|
const Fraction& Y() const { return aY; }
|
||||||
boost::rational<long>& X() { return aX; }
|
Fraction& X() { return aX; }
|
||||||
boost::rational<long>& Y() { return aY; }
|
Fraction& Y() { return aY; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fuer die Umrechnung von Masseinheiten
|
// Fuer die Umrechnung von Masseinheiten
|
||||||
@ -263,7 +265,7 @@ inline bool IsInch(FieldUnit eU) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class SVX_DLLPUBLIC SdrFormatter {
|
class SVX_DLLPUBLIC SdrFormatter {
|
||||||
boost::rational<long> aScale;
|
Fraction aScale;
|
||||||
long nMul_;
|
long nMul_;
|
||||||
long nDiv_;
|
long nDiv_;
|
||||||
short nKomma_;
|
short nKomma_;
|
||||||
|
@ -20,26 +20,26 @@
|
|||||||
#define INCLUDED_SVX_SXFIITM_HXX
|
#define INCLUDED_SVX_SXFIITM_HXX
|
||||||
|
|
||||||
#include <svl/poolitem.hxx>
|
#include <svl/poolitem.hxx>
|
||||||
#include <tools/rational.hxx>
|
#include <tools/fract.hxx>
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/* FractionItem */
|
/* FractionItem */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
class SdrFractionItem: public SfxPoolItem {
|
class SdrFractionItem: public SfxPoolItem {
|
||||||
boost::rational<long> nValue;
|
Fraction nValue;
|
||||||
public:
|
public:
|
||||||
TYPEINFO_VISIBILITY( SVX_DLLPUBLIC );
|
TYPEINFO_VISIBILITY( SVX_DLLPUBLIC );
|
||||||
SdrFractionItem(sal_uInt16 nId=0): SfxPoolItem(nId) {}
|
SdrFractionItem(sal_uInt16 nId=0): SfxPoolItem(nId) {}
|
||||||
SdrFractionItem(sal_uInt16 nId, const boost::rational<long>& rVal): SfxPoolItem(nId), nValue(rVal) {}
|
SdrFractionItem(sal_uInt16 nId, const Fraction& rVal): SfxPoolItem(nId), nValue(rVal) {}
|
||||||
SdrFractionItem(sal_uInt16 nId, SvStream& rIn);
|
SdrFractionItem(sal_uInt16 nId, SvStream& rIn);
|
||||||
virtual bool operator==(const SfxPoolItem&) const SAL_OVERRIDE;
|
virtual bool operator==(const SfxPoolItem&) const SAL_OVERRIDE;
|
||||||
virtual bool GetPresentation(SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, OUString &rText, const IntlWrapper * = 0) const SAL_OVERRIDE;
|
virtual bool GetPresentation(SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, OUString &rText, const IntlWrapper * = 0) const SAL_OVERRIDE;
|
||||||
virtual SfxPoolItem* Create(SvStream&, sal_uInt16 nVer) const SAL_OVERRIDE;
|
virtual SfxPoolItem* Create(SvStream&, sal_uInt16 nVer) const SAL_OVERRIDE;
|
||||||
virtual SvStream& Store(SvStream&, sal_uInt16 nItemVers) const SAL_OVERRIDE;
|
virtual SvStream& Store(SvStream&, sal_uInt16 nItemVers) const SAL_OVERRIDE;
|
||||||
virtual SfxPoolItem* Clone(SfxItemPool *pPool=NULL) const SAL_OVERRIDE;
|
virtual SfxPoolItem* Clone(SfxItemPool *pPool=NULL) const SAL_OVERRIDE;
|
||||||
const boost::rational<long>& GetValue() const { return nValue; }
|
const Fraction& GetValue() const { return nValue; }
|
||||||
void SetValue(const boost::rational<long>& rVal) { nValue = rVal; }
|
void SetValue(const Fraction& rVal) { nValue = rVal; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@
|
|||||||
class SdrScaleItem: public SdrFractionItem {
|
class SdrScaleItem: public SdrFractionItem {
|
||||||
public:
|
public:
|
||||||
TYPEINFO_OVERRIDE();
|
TYPEINFO_OVERRIDE();
|
||||||
SdrScaleItem(sal_uInt16 nId=0): SdrFractionItem(nId, boost::rational<long>(1,1) ) {}
|
SdrScaleItem(sal_uInt16 nId=0): SdrFractionItem(nId,Fraction(1,1)) {}
|
||||||
SdrScaleItem(sal_uInt16 nId, const boost::rational<long>& rVal): SdrFractionItem(nId,rVal) {}
|
SdrScaleItem(sal_uInt16 nId, const Fraction& rVal): SdrFractionItem(nId,rVal) {}
|
||||||
SdrScaleItem(sal_uInt16 nId, SvStream& rIn): SdrFractionItem(nId,rIn) {}
|
SdrScaleItem(sal_uInt16 nId, SvStream& rIn): SdrFractionItem(nId,rIn) {}
|
||||||
virtual bool GetPresentation(SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, OUString &rText, const IntlWrapper * = 0) const SAL_OVERRIDE;
|
virtual bool GetPresentation(SfxItemPresentation ePresentation, SfxMapUnit eCoreMetric, SfxMapUnit ePresentationMetric, OUString &rText, const IntlWrapper * = 0) const SAL_OVERRIDE;
|
||||||
virtual SfxPoolItem* Create(SvStream&, sal_uInt16 nVer) const SAL_OVERRIDE;
|
virtual SfxPoolItem* Create(SvStream&, sal_uInt16 nVer) const SAL_OVERRIDE;
|
||||||
|
@ -28,6 +28,8 @@ class SvStream;
|
|||||||
|
|
||||||
#define MAX_DIGITS 8
|
#define MAX_DIGITS 8
|
||||||
|
|
||||||
|
class Fraction;
|
||||||
|
|
||||||
class TOOLS_DLLPUBLIC SAL_WARN_UNUSED BigInt
|
class TOOLS_DLLPUBLIC SAL_WARN_UNUSED BigInt
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
@ -145,6 +147,8 @@ public:
|
|||||||
TOOLS_DLLPUBLIC friend bool operator> ( const BigInt& rVal1, const BigInt& rVal2 );
|
TOOLS_DLLPUBLIC friend bool operator> ( const BigInt& rVal1, const BigInt& rVal2 );
|
||||||
friend inline bool operator<=( const BigInt& rVal1, const BigInt& rVal2 );
|
friend inline bool operator<=( const BigInt& rVal1, const BigInt& rVal2 );
|
||||||
friend inline bool operator>=( const BigInt& rVal1, const BigInt& rVal2 );
|
friend inline bool operator>=( const BigInt& rVal1, const BigInt& rVal2 );
|
||||||
|
|
||||||
|
friend class Fraction;
|
||||||
};
|
};
|
||||||
|
|
||||||
inline BigInt::operator short() const
|
inline BigInt::operator short() const
|
||||||
|
142
include/tools/fract.hxx
Normal file
142
include/tools/fract.hxx
Normal file
@ -0,0 +1,142 @@
|
|||||||
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||||
|
/*
|
||||||
|
* This file is part of the LibreOffice project.
|
||||||
|
*
|
||||||
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||||
|
*
|
||||||
|
* This file incorporates work covered by the following license notice:
|
||||||
|
*
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
|
* contributor license agreements. See the NOTICE file distributed
|
||||||
|
* with this work for additional information regarding copyright
|
||||||
|
* ownership. The ASF licenses this file to you under the Apache
|
||||||
|
* License, Version 2.0 (the "License"); you may not use this file
|
||||||
|
* except in compliance with the License. You may obtain a copy of
|
||||||
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||||
|
*/
|
||||||
|
#ifndef INCLUDED_TOOLS_FRACT_HXX
|
||||||
|
#define INCLUDED_TOOLS_FRACT_HXX
|
||||||
|
|
||||||
|
#include <tools/toolsdllapi.h>
|
||||||
|
|
||||||
|
class SvStream;
|
||||||
|
|
||||||
|
class TOOLS_DLLPUBLIC SAL_WARN_UNUSED Fraction
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
long nNumerator;
|
||||||
|
long nDenominator;
|
||||||
|
|
||||||
|
public:
|
||||||
|
Fraction() { nNumerator = 0; nDenominator = 1; }
|
||||||
|
Fraction( const Fraction & rFrac );
|
||||||
|
Fraction( long nNum, long nDen=1 );
|
||||||
|
Fraction( double dVal );
|
||||||
|
|
||||||
|
bool IsValid() const;
|
||||||
|
|
||||||
|
long GetNumerator() const { return nNumerator; }
|
||||||
|
long GetDenominator() const { return nDenominator; }
|
||||||
|
|
||||||
|
operator long() const;
|
||||||
|
operator double() const;
|
||||||
|
|
||||||
|
Fraction& operator=( const Fraction& rfrFrac );
|
||||||
|
|
||||||
|
Fraction& operator+=( const Fraction& rfrFrac );
|
||||||
|
Fraction& operator-=( const Fraction& rfrFrac );
|
||||||
|
Fraction& operator*=( const Fraction& rfrFrac );
|
||||||
|
Fraction& operator/=( const Fraction& rfrFrac );
|
||||||
|
|
||||||
|
void ReduceInaccurate( unsigned nSignificantBits );
|
||||||
|
|
||||||
|
friend inline Fraction operator+( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
friend inline Fraction operator-( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
friend inline Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
friend inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
|
||||||
|
TOOLS_DLLPUBLIC friend bool operator==( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
friend inline bool operator!=( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
TOOLS_DLLPUBLIC friend bool operator< ( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
TOOLS_DLLPUBLIC friend bool operator> ( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
friend inline bool operator<=( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
friend inline bool operator>=( const Fraction& rVal1, const Fraction& rVal2 );
|
||||||
|
|
||||||
|
TOOLS_DLLPUBLIC friend SvStream& ReadFraction( SvStream& rIStream, Fraction& rFract );
|
||||||
|
TOOLS_DLLPUBLIC friend SvStream& WriteFraction( SvStream& rOStream, const Fraction& rFract );
|
||||||
|
};
|
||||||
|
|
||||||
|
inline Fraction::Fraction( const Fraction& rFrac )
|
||||||
|
{
|
||||||
|
nNumerator = rFrac.nNumerator;
|
||||||
|
nDenominator = rFrac.nDenominator;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Fraction& Fraction::operator=( const Fraction& rFrac )
|
||||||
|
{
|
||||||
|
nNumerator = rFrac.nNumerator;
|
||||||
|
nDenominator = rFrac.nDenominator;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool Fraction::IsValid() const
|
||||||
|
{
|
||||||
|
return (nDenominator > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Fraction::operator long() const
|
||||||
|
{
|
||||||
|
if ( nDenominator > 0 )
|
||||||
|
return (nNumerator / nDenominator);
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Fraction operator+( const Fraction& rVal1, const Fraction& rVal2 )
|
||||||
|
{
|
||||||
|
Fraction aErg( rVal1 );
|
||||||
|
aErg += rVal2;
|
||||||
|
return aErg;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Fraction operator-( const Fraction& rVal1, const Fraction& rVal2 )
|
||||||
|
{
|
||||||
|
Fraction aErg( rVal1 );
|
||||||
|
aErg -= rVal2;
|
||||||
|
return aErg;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Fraction operator*( const Fraction& rVal1, const Fraction& rVal2 )
|
||||||
|
{
|
||||||
|
Fraction aErg( rVal1 );
|
||||||
|
aErg *= rVal2;
|
||||||
|
return aErg;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline Fraction operator/( const Fraction& rVal1, const Fraction& rVal2 )
|
||||||
|
{
|
||||||
|
Fraction aErg( rVal1 );
|
||||||
|
aErg /= rVal2;
|
||||||
|
return aErg;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator !=( const Fraction& rVal1, const Fraction& rVal2 )
|
||||||
|
{
|
||||||
|
return !(rVal1 == rVal2);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator <=( const Fraction& rVal1, const Fraction& rVal2 )
|
||||||
|
{
|
||||||
|
return !(rVal1 > rVal2);
|
||||||
|
}
|
||||||
|
|
||||||
|
inline bool operator >=( const Fraction& rVal1, const Fraction& rVal2 )
|
||||||
|
{
|
||||||
|
return !(rVal1 < rVal2);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
@ -1,25 +0,0 @@
|
|||||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
||||||
/*
|
|
||||||
* This file is part of the LibreOffice project.
|
|
||||||
*
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
#ifndef INCLUDED_TOOLS_RATIONAL_HXX
|
|
||||||
#define INCLUDED_TOOLS_RATIONAL_HXX
|
|
||||||
|
|
||||||
#include <boost/rational.hpp>
|
|
||||||
#include <tools/toolsdllapi.h>
|
|
||||||
|
|
||||||
class SvStream;
|
|
||||||
|
|
||||||
TOOLS_DLLPUBLIC boost::rational<long> rational_FromDouble(double dVal);
|
|
||||||
TOOLS_DLLPUBLIC void rational_ReduceInaccurate(boost::rational<long>& rRational, unsigned nSignificantBits);
|
|
||||||
TOOLS_DLLPUBLIC SvStream& ReadFraction(SvStream& rIStream, boost::rational<long>& rRational);
|
|
||||||
TOOLS_DLLPUBLIC SvStream& WriteFraction(SvStream& rOStream, const boost::rational<long>& rRational);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
|
@ -136,7 +136,7 @@ public:
|
|||||||
// additional Move method getting specifics how to handle MapMode( MAP_PIXEL )
|
// additional Move method getting specifics how to handle MapMode( MAP_PIXEL )
|
||||||
void Move( long nX, long nY, long nDPIX, long nDPIY );
|
void Move( long nX, long nY, long nDPIX, long nDPIY );
|
||||||
void Scale( double fScaleX, double fScaleY );
|
void Scale( double fScaleX, double fScaleY );
|
||||||
void Scale( const boost::rational<long>& rScaleX, const boost::rational<long>& rScaleY );
|
void Scale( const Fraction& rScaleX, const Fraction& rScaleY );
|
||||||
void Rotate( long nAngle10 );
|
void Rotate( long nAngle10 );
|
||||||
void Clip( const Rectangle& );
|
void Clip( const Rectangle& );
|
||||||
/* get the bound rect of the contained actions
|
/* get the bound rect of the contained actions
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#define INCLUDED_VCL_MAPMOD_HXX
|
#define INCLUDED_VCL_MAPMOD_HXX
|
||||||
|
|
||||||
#include <tools/gen.hxx>
|
#include <tools/gen.hxx>
|
||||||
#include <tools/rational.hxx>
|
#include <tools/fract.hxx>
|
||||||
#include <tools/solar.h>
|
#include <tools/solar.h>
|
||||||
#include <vcl/dllapi.h>
|
#include <vcl/dllapi.h>
|
||||||
#include <tools/resid.hxx>
|
#include <tools/resid.hxx>
|
||||||
@ -44,8 +44,8 @@ private:
|
|||||||
sal_uLong mnRefCount;
|
sal_uLong mnRefCount;
|
||||||
MapUnit meUnit;
|
MapUnit meUnit;
|
||||||
Point maOrigin;
|
Point maOrigin;
|
||||||
boost::rational<long> maScaleX;
|
Fraction maScaleX;
|
||||||
boost::rational<long> maScaleY;
|
Fraction maScaleY;
|
||||||
bool mbSimple;
|
bool mbSimple;
|
||||||
|
|
||||||
friend SvStream& ReadImplMapMode( SvStream& rIStm, ImplMapMode& rMapMode );
|
friend SvStream& ReadImplMapMode( SvStream& rIStm, ImplMapMode& rMapMode );
|
||||||
@ -75,7 +75,7 @@ public:
|
|||||||
MapMode( const MapMode& rMapMode );
|
MapMode( const MapMode& rMapMode );
|
||||||
MapMode( MapUnit eUnit );
|
MapMode( MapUnit eUnit );
|
||||||
MapMode( MapUnit eUnit, const Point& rLogicOrg,
|
MapMode( MapUnit eUnit, const Point& rLogicOrg,
|
||||||
const boost::rational<long>& rScaleX, const boost::rational<long>& rScaleY );
|
const Fraction& rScaleX, const Fraction& rScaleY );
|
||||||
~MapMode();
|
~MapMode();
|
||||||
|
|
||||||
void SetMapUnit( MapUnit eUnit );
|
void SetMapUnit( MapUnit eUnit );
|
||||||
@ -86,11 +86,11 @@ public:
|
|||||||
const Point& GetOrigin() const
|
const Point& GetOrigin() const
|
||||||
{ return mpImplMapMode->maOrigin; }
|
{ return mpImplMapMode->maOrigin; }
|
||||||
|
|
||||||
void SetScaleX( const boost::rational<long>& rScaleX );
|
void SetScaleX( const Fraction& rScaleX );
|
||||||
const boost::rational<long>& GetScaleX() const
|
const Fraction& GetScaleX() const
|
||||||
{ return mpImplMapMode->maScaleX; }
|
{ return mpImplMapMode->maScaleX; }
|
||||||
void SetScaleY( const boost::rational<long>& rScaleY );
|
void SetScaleY( const Fraction& rScaleY );
|
||||||
const boost::rational<long>& GetScaleY() const
|
const Fraction& GetScaleY() const
|
||||||
{ return mpImplMapMode->maScaleY; }
|
{ return mpImplMapMode->maScaleY; }
|
||||||
|
|
||||||
MapMode& operator=( const MapMode& rMapMode );
|
MapMode& operator=( const MapMode& rMapMode );
|
||||||
|
@ -124,7 +124,7 @@ public:
|
|||||||
|
|
||||||
bool SetOutputSizePixel( const Size& rNewSize, bool bErase = true );
|
bool SetOutputSizePixel( const Size& rNewSize, bool bErase = true );
|
||||||
bool SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize,
|
bool SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize,
|
||||||
const boost::rational<long>& rScale,
|
const Fraction& rScale,
|
||||||
const Point& rNewOffset,
|
const Point& rNewOffset,
|
||||||
const basebmp::RawMemorySharedArray &pBuffer,
|
const basebmp::RawMemorySharedArray &pBuffer,
|
||||||
const bool bTopDown = false );
|
const bool bTopDown = false );
|
||||||
|
@ -1011,8 +1011,8 @@ public:
|
|||||||
void SetCursor( vcl::Cursor* pCursor );
|
void SetCursor( vcl::Cursor* pCursor );
|
||||||
vcl::Cursor* GetCursor() const;
|
vcl::Cursor* GetCursor() const;
|
||||||
|
|
||||||
void SetZoom( const boost::rational<long>& rZoom );
|
void SetZoom( const Fraction& rZoom );
|
||||||
const boost::rational<long>& GetZoom() const;
|
const Fraction& GetZoom() const;
|
||||||
bool IsZoom() const;
|
bool IsZoom() const;
|
||||||
long CalcZoom( long n ) const;
|
long CalcZoom( long n ) const;
|
||||||
|
|
||||||
|
@ -148,7 +148,7 @@ protected:
|
|||||||
OCustomShape(const OUString& _sComponentName);
|
OCustomShape(const OUString& _sComponentName);
|
||||||
|
|
||||||
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
||||||
|
|
||||||
@ -196,7 +196,7 @@ protected:
|
|||||||
|
|
||||||
|
|
||||||
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
||||||
|
|
||||||
@ -244,7 +244,7 @@ protected:
|
|||||||
virtual ~OUnoObject();
|
virtual ~OUnoObject();
|
||||||
|
|
||||||
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
virtual void NbcMove( const Size& rSize ) SAL_OVERRIDE;
|
||||||
virtual void NbcResize(const Point& rRef, const boost::rational<long>& xFact, const boost::rational<long>& yFact) SAL_OVERRIDE;
|
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) SAL_OVERRIDE;
|
||||||
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
virtual void NbcSetLogicRect(const Rectangle& rRect) SAL_OVERRIDE;
|
||||||
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) SAL_OVERRIDE;
|
||||||
|
|
||||||
|
@ -538,7 +538,7 @@ void OCustomShape::NbcMove( const Size& rSize )
|
|||||||
SdrObjCustomShape::NbcMove( rSize );
|
SdrObjCustomShape::NbcMove( rSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
void OCustomShape::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
|
void OCustomShape::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
|
||||||
{
|
{
|
||||||
SdrObjCustomShape::NbcResize( rRef, xFract, yFract );
|
SdrObjCustomShape::NbcResize( rRef, xFract, yFract );
|
||||||
|
|
||||||
@ -749,7 +749,7 @@ void OUnoObject::NbcMove( const Size& rSize )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void OUnoObject::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
|
void OUnoObject::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
|
||||||
{
|
{
|
||||||
SdrUnoObj::NbcResize( rRef, xFract, yFract );
|
SdrUnoObj::NbcResize( rRef, xFract, yFract );
|
||||||
|
|
||||||
@ -1050,7 +1050,7 @@ void OOle2Obj::NbcMove( const Size& rSize )
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void OOle2Obj::NbcResize(const Point& rRef, const boost::rational<long>& xFract, const boost::rational<long>& yFract)
|
void OOle2Obj::NbcResize(const Point& rRef, const Fraction& xFract, const Fraction& yFract)
|
||||||
{
|
{
|
||||||
SdrOle2Obj::NbcResize( rRef, xFract, yFract );
|
SdrOle2Obj::NbcResize( rRef, xFract, yFract );
|
||||||
|
|
||||||
|
@ -257,7 +257,7 @@ namespace rptui
|
|||||||
|
|
||||||
/** zoom the ruler and view windows
|
/** zoom the ruler and view windows
|
||||||
*/
|
*/
|
||||||
void zoom(const boost::rational<long>& _aZoom);
|
void zoom(const Fraction& _aZoom);
|
||||||
|
|
||||||
/** fills the vector with all selected control models
|
/** fills the vector with all selected control models
|
||||||
/param _rSelection The vector will be filled and will not be cleared before.
|
/param _rSelection The vector will be filled and will not be cleared before.
|
||||||
|
@ -211,7 +211,7 @@ namespace rptui
|
|||||||
|
|
||||||
/** zoom the ruler and view windows
|
/** zoom the ruler and view windows
|
||||||
*/
|
*/
|
||||||
void zoom(const boost::rational<long>& _aZoom);
|
void zoom(const Fraction& _aZoom);
|
||||||
|
|
||||||
/** fills the vector with all selected control models
|
/** fills the vector with all selected control models
|
||||||
/param _rSelection The vector will be filled and will not be cleared before.
|
/param _rSelection The vector will be filled and will not be cleared before.
|
||||||
|
@ -202,7 +202,7 @@ namespace rptui
|
|||||||
|
|
||||||
/** zoom the ruler and view windows
|
/** zoom the ruler and view windows
|
||||||
*/
|
*/
|
||||||
void zoom(const boost::rational<long>& _aZoom);
|
void zoom(const Fraction& _aZoom);
|
||||||
|
|
||||||
/** fills the vector with all selected control models
|
/** fills the vector with all selected control models
|
||||||
/param _rSelection The vector will be filled and will not be cleared before.
|
/param _rSelection The vector will be filled and will not be cleared before.
|
||||||
|
@ -120,7 +120,7 @@ namespace rptui
|
|||||||
|
|
||||||
/** zoom the ruler and view windows
|
/** zoom the ruler and view windows
|
||||||
*/
|
*/
|
||||||
void zoom(const boost::rational<long>& _aZoom);
|
void zoom(const Fraction& _aZoom);
|
||||||
|
|
||||||
void scrollChildren(long _nThumbPosX);
|
void scrollChildren(long _nThumbPosX);
|
||||||
};
|
};
|
||||||
|
@ -71,7 +71,7 @@ namespace rptui
|
|||||||
|
|
||||||
/** zoom the ruler and view windows
|
/** zoom the ruler and view windows
|
||||||
*/
|
*/
|
||||||
void zoom(const boost::rational<long>& _aZoom);
|
void zoom(const Fraction& _aZoom);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_STARTMARKER_HXX
|
#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_STARTMARKER_HXX
|
||||||
|
@ -176,7 +176,7 @@ namespace rptui
|
|||||||
@param _aZoom the zoom scale
|
@param _aZoom the zoom scale
|
||||||
@param _rWindow where to set the map mode
|
@param _rWindow where to set the map mode
|
||||||
*/
|
*/
|
||||||
void setZoomFactor(const boost::rational<long>& _aZoom, ::vcl::Window& _rWindow);
|
void setZoomFactor(const Fraction& _aZoom, ::vcl::Window& _rWindow);
|
||||||
}
|
}
|
||||||
#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_UITOOLS_HXX
|
#endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_UITOOLS_HXX
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ namespace rptui
|
|||||||
|
|
||||||
/** zoom the ruler and view windows
|
/** zoom the ruler and view windows
|
||||||
*/
|
*/
|
||||||
void zoom(const boost::rational<long>& _aZoom);
|
void zoom(const Fraction& _aZoom);
|
||||||
|
|
||||||
void scrollChildren(const Point& _aThumbPos);
|
void scrollChildren(const Point& _aThumbPos);
|
||||||
|
|
||||||
|
@ -991,7 +991,7 @@ void correctOverlapping(SdrObject* _pControl,OReportSection& _aReportSection,boo
|
|||||||
rSectionView.InsertObjectAtView(_pControl,*rSectionView.GetSdrPageView(),SDRINSERT_ADDMARK);
|
rSectionView.InsertObjectAtView(_pControl,*rSectionView.GetSdrPageView(),SDRINSERT_ADDMARK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setZoomFactor(const boost::rational<long>& _aZoom, vcl::Window& _rWindow)
|
void setZoomFactor(const Fraction& _aZoom, vcl::Window& _rWindow)
|
||||||
{
|
{
|
||||||
MapMode aMapMode( _rWindow.GetMapMode() );
|
MapMode aMapMode( _rWindow.GetMapMode() );
|
||||||
aMapMode.SetScaleX(_aZoom);
|
aMapMode.SetScaleX(_aZoom);
|
||||||
|
@ -684,7 +684,7 @@ sal_uInt32 ODesignView::getMarkedObjectCount() const
|
|||||||
return m_aScrollWindow.getMarkedObjectCount();
|
return m_aScrollWindow.getMarkedObjectCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ODesignView::zoom(const boost::rational<long>& _aZoom)
|
void ODesignView::zoom(const Fraction& _aZoom)
|
||||||
{
|
{
|
||||||
m_aScrollWindow.zoom(_aZoom);
|
m_aScrollWindow.zoom(_aZoom);
|
||||||
}
|
}
|
||||||
|
@ -45,9 +45,9 @@ OEndMarker::~OEndMarker()
|
|||||||
|
|
||||||
void OEndMarker::Paint( const Rectangle& /*rRect*/ )
|
void OEndMarker::Paint( const Rectangle& /*rRect*/ )
|
||||||
{
|
{
|
||||||
boost::rational<long> aCornerSpace(long(CORNER_SPACE));
|
Fraction aCornerSpace(long(CORNER_SPACE));
|
||||||
aCornerSpace *= GetMapMode().GetScaleX();
|
aCornerSpace *= GetMapMode().GetScaleX();
|
||||||
const long nCornerSpace = boost::rational_cast<long>(aCornerSpace);
|
const long nCornerSpace = aCornerSpace;
|
||||||
|
|
||||||
Size aSize = GetSizePixel();
|
Size aSize = GetSizePixel();
|
||||||
aSize.Width() += nCornerSpace;
|
aSize.Width() += nCornerSpace;
|
||||||
|
@ -4171,7 +4171,7 @@ void OReportController::impl_fillState_nothrow(const OUString& _sProperty,dbaui:
|
|||||||
|
|
||||||
void OReportController::impl_zoom_nothrow()
|
void OReportController::impl_zoom_nothrow()
|
||||||
{
|
{
|
||||||
boost::rational<long> aZoom(m_nZoomValue,100);
|
Fraction aZoom(m_nZoomValue,100);
|
||||||
setZoomFactor( aZoom,*getDesignView() );
|
setZoomFactor( aZoom,*getDesignView() );
|
||||||
getDesignView()->zoom(aZoom);
|
getDesignView()->zoom(aZoom);
|
||||||
InvalidateFeature(SID_ATTR_ZOOM,Reference< XStatusListener >(), true);
|
InvalidateFeature(SID_ATTR_ZOOM,Reference< XStatusListener >(), true);
|
||||||
|
@ -202,8 +202,8 @@ void OReportSection::fill()
|
|||||||
m_pView->SetGridFine(aGridSizeFine);
|
m_pView->SetGridFine(aGridSizeFine);
|
||||||
|
|
||||||
// #i93595# set snap grid width to snap to all existing subdivisions
|
// #i93595# set snap grid width to snap to all existing subdivisions
|
||||||
const boost::rational<long> aX(aGridSizeFine.A());
|
const Fraction aX(aGridSizeFine.A());
|
||||||
const boost::rational<long> aY(aGridSizeFine.B());
|
const Fraction aY(aGridSizeFine.B());
|
||||||
m_pView->SetSnapGridWidth(aX, aY);
|
m_pView->SetSnapGridWidth(aX, aY);
|
||||||
|
|
||||||
m_pView->SetGridSnap( pDesignView->isGridSnap() );
|
m_pView->SetGridSnap( pDesignView->isGridSnap() );
|
||||||
|
@ -141,11 +141,11 @@ void OReportWindow::showRuler(bool _bShow)
|
|||||||
|
|
||||||
sal_Int32 OReportWindow::getMaxMarkerWidth(bool _bWithEnd) const
|
sal_Int32 OReportWindow::getMaxMarkerWidth(bool _bWithEnd) const
|
||||||
{
|
{
|
||||||
boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
||||||
aStartWidth *= m_aViewsWindow.GetMapMode().GetScaleX();
|
aStartWidth *= m_aViewsWindow.GetMapMode().GetScaleX();
|
||||||
if ( _bWithEnd )
|
if ( _bWithEnd )
|
||||||
aStartWidth += boost::rational<long>(long(REPORT_ENDMARKER_WIDTH));
|
aStartWidth += Fraction(long(REPORT_ENDMARKER_WIDTH));
|
||||||
return sal_Int32(boost::rational_cast<long>(aStartWidth));
|
return sal_Int32((long)aStartWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
sal_Int32 OReportWindow::GetTotalWidth() const
|
sal_Int32 OReportWindow::GetTotalWidth() const
|
||||||
@ -153,14 +153,14 @@ sal_Int32 OReportWindow::GetTotalWidth() const
|
|||||||
sal_Int32 nWidth = 0;
|
sal_Int32 nWidth = 0;
|
||||||
if ( !m_aViewsWindow.empty() )
|
if ( !m_aViewsWindow.empty() )
|
||||||
{
|
{
|
||||||
boost::rational<long> aStartWidth(long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH ));
|
Fraction aStartWidth(long(REPORT_ENDMARKER_WIDTH + REPORT_STARTMARKER_WIDTH ));
|
||||||
const boost::rational<long> aZoom(m_pView->getController().getZoomValue(),100);
|
const Fraction aZoom(m_pView->getController().getZoomValue(),100);
|
||||||
aStartWidth *= aZoom;
|
aStartWidth *= aZoom;
|
||||||
const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width;
|
const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width;
|
||||||
boost::rational<long> aPaperWidth(nPaperWidth,1);
|
Fraction aPaperWidth(nPaperWidth,1);
|
||||||
aPaperWidth *= aZoom;
|
aPaperWidth *= aZoom;
|
||||||
const Size aPageSize = LogicToPixel(Size(boost::rational_cast<long>(aPaperWidth),0));
|
const Size aPageSize = LogicToPixel(Size(aPaperWidth,0));
|
||||||
nWidth = aPageSize.Width() + boost::rational_cast<long>(aStartWidth);
|
nWidth = aPageSize.Width() + long(aStartWidth);
|
||||||
}
|
}
|
||||||
return nWidth;
|
return nWidth;
|
||||||
}
|
}
|
||||||
@ -171,10 +171,10 @@ void OReportWindow::Resize()
|
|||||||
if ( !m_aViewsWindow.empty() )
|
if ( !m_aViewsWindow.empty() )
|
||||||
{
|
{
|
||||||
const Size aTotalOutputSize = GetOutputSizePixel();
|
const Size aTotalOutputSize = GetOutputSizePixel();
|
||||||
boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100);
|
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100);
|
||||||
|
|
||||||
const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 0 ), MAP_APPFONT );
|
const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 0 ), MAP_APPFONT );
|
||||||
Point aStartPoint(boost::rational_cast<long>(aStartWidth) + aOffset.X(),0);
|
Point aStartPoint((long)aStartWidth + aOffset.X(),0);
|
||||||
uno::Reference<report::XReportDefinition> xReportDefinition = getReportView()->getController().getReportDefinition();
|
uno::Reference<report::XReportDefinition> xReportDefinition = getReportView()->getController().getReportDefinition();
|
||||||
const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
|
const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
|
||||||
sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
|
sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
|
||||||
@ -372,7 +372,7 @@ sal_uInt32 OReportWindow::getMarkedObjectCount() const
|
|||||||
return m_aViewsWindow.getMarkedObjectCount();
|
return m_aViewsWindow.getMarkedObjectCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OReportWindow::zoom(const boost::rational<long>& _aZoom)
|
void OReportWindow::zoom(const Fraction& _aZoom)
|
||||||
{
|
{
|
||||||
m_aHRuler.SetZoom(_aZoom);
|
m_aHRuler.SetZoom(_aZoom);
|
||||||
m_aHRuler.Invalidate();
|
m_aHRuler.Invalidate();
|
||||||
@ -414,14 +414,14 @@ sal_uInt16 OReportWindow::getZoomFactor(SvxZoomType _eType) const
|
|||||||
break;
|
break;
|
||||||
case SVX_ZOOM_WHOLEPAGE:
|
case SVX_ZOOM_WHOLEPAGE:
|
||||||
{
|
{
|
||||||
nZoom = (sal_uInt16) boost::rational_cast<long>( boost::rational<long>(aSize.Width() * 100, impl_getRealPixelWidth()) );
|
nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth());
|
||||||
MapMode aMap( MAP_100TH_MM );
|
MapMode aMap( MAP_100TH_MM );
|
||||||
const Size aHeight = m_aViewsWindow.LogicToPixel(m_aViewsWindow.PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler.GetSizePixel().Height())),aMap);
|
const Size aHeight = m_aViewsWindow.LogicToPixel(m_aViewsWindow.PixelToLogic(Size(0,GetTotalHeight() + m_aHRuler.GetSizePixel().Height())),aMap);
|
||||||
nZoom = ::std::min(nZoom, (sal_uInt16) boost::rational_cast<long>( boost::rational<long>(aSize.Height() * 100, aHeight.Height()) ));
|
nZoom = ::std::min(nZoom,(sal_uInt16)(long)Fraction(aSize.Height()*100,aHeight.Height()));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SVX_ZOOM_PAGEWIDTH:
|
case SVX_ZOOM_PAGEWIDTH:
|
||||||
nZoom = (sal_uInt16)boost::rational_cast<long>( boost::rational<long>(aSize.Width() * 100, this->impl_getRealPixelWidth()) );
|
nZoom = (sal_uInt16)(long)Fraction(aSize.Width()*100,impl_getRealPixelWidth());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -101,8 +101,8 @@ void OScrollWindowHelper::setTotalSize(sal_Int32 _nWidth ,sal_Int32 _nHeight)
|
|||||||
m_aTotalPixelSize.Height() = _nHeight;
|
m_aTotalPixelSize.Height() = _nHeight;
|
||||||
|
|
||||||
// now set the ranges without start marker
|
// now set the ranges without start marker
|
||||||
boost::rational<long> aStartWidth(REPORT_STARTMARKER_WIDTH * m_pParent->getController().getZoomValue(),100);
|
Fraction aStartWidth(REPORT_STARTMARKER_WIDTH * m_pParent->getController().getZoomValue(),100);
|
||||||
long nWidth = long(_nWidth - boost::rational_cast<double>(aStartWidth));
|
long nWidth = long(_nWidth - (double)aStartWidth);
|
||||||
m_aHScroll.SetRangeMax( nWidth );
|
m_aHScroll.SetRangeMax( nWidth );
|
||||||
m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() );
|
m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() );
|
||||||
|
|
||||||
@ -163,9 +163,9 @@ Size OScrollWindowHelper::ResizeScrollBars()
|
|||||||
const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MAP_APPFONT );
|
const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MAP_APPFONT );
|
||||||
// resize scrollbars and set their ranges
|
// resize scrollbars and set their ranges
|
||||||
{
|
{
|
||||||
boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100);
|
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100);
|
||||||
const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - boost::rational_cast<long>(aStartWidth);
|
const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - (long)aStartWidth;
|
||||||
lcl_setScrollBar(nNewWidth,Point( boost::rational_cast<long>(aStartWidth) + aOffset.X(), aOutPixSz.Height() ),Size( nNewWidth, nScrSize ),m_aHScroll);
|
lcl_setScrollBar(nNewWidth,Point( (long)aStartWidth + aOffset.X(), aOutPixSz.Height() ),Size( nNewWidth, nScrSize ),m_aHScroll);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow.getRulerHeight();
|
const sal_Int32 nNewHeight = aOutPixSz.Height() - m_aReportWindow.getRulerHeight();
|
||||||
@ -383,7 +383,7 @@ sal_uInt32 OScrollWindowHelper::getMarkedObjectCount() const
|
|||||||
return m_aReportWindow.getMarkedObjectCount();
|
return m_aReportWindow.getMarkedObjectCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OScrollWindowHelper::zoom(const boost::rational<long>& _aZoom)
|
void OScrollWindowHelper::zoom(const Fraction& _aZoom)
|
||||||
{
|
{
|
||||||
m_aReportWindow.zoom(_aZoom);
|
m_aReportWindow.zoom(_aZoom);
|
||||||
Resize();
|
Resize();
|
||||||
|
@ -220,7 +220,7 @@ void OSectionWindow::Resize()
|
|||||||
Window::Resize();
|
Window::Resize();
|
||||||
|
|
||||||
Size aOutputSize = GetOutputSizePixel();
|
Size aOutputSize = GetOutputSizePixel();
|
||||||
boost::rational<long> aEndWidth(long(REPORT_ENDMARKER_WIDTH));
|
Fraction aEndWidth(long(REPORT_ENDMARKER_WIDTH));
|
||||||
aEndWidth *= GetMapMode().GetScaleX();
|
aEndWidth *= GetMapMode().GetScaleX();
|
||||||
|
|
||||||
const Point aThumbPos = m_pParent->getView()->getThumbPos();
|
const Point aThumbPos = m_pParent->getView()->getThumbPos();
|
||||||
@ -236,33 +236,33 @@ void OSectionWindow::Resize()
|
|||||||
{
|
{
|
||||||
const bool bShowEndMarker = m_pParent->getView()->GetTotalWidth() <= (aThumbPos.X() + aOutputSize.Width() );
|
const bool bShowEndMarker = m_pParent->getView()->GetTotalWidth() <= (aThumbPos.X() + aOutputSize.Width() );
|
||||||
|
|
||||||
boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
||||||
aStartWidth *= GetMapMode().GetScaleX();
|
aStartWidth *= GetMapMode().GetScaleX();
|
||||||
|
|
||||||
// set start marker
|
// set start marker
|
||||||
m_aStartMarker.SetPosSizePixel(Point(0,0),Size(boost::rational_cast<long>(aStartWidth),aOutputSize.Height()));
|
m_aStartMarker.SetPosSizePixel(Point(0,0),Size(aStartWidth,aOutputSize.Height()));
|
||||||
|
|
||||||
// set report section
|
// set report section
|
||||||
const uno::Reference< report::XSection> xSection = m_aReportSection.getSection();
|
const uno::Reference< report::XSection> xSection = m_aReportSection.getSection();
|
||||||
Size aSectionSize = LogicToPixel( Size( 0,xSection->getHeight() ) );
|
Size aSectionSize = LogicToPixel( Size( 0,xSection->getHeight() ) );
|
||||||
Point aReportPos(boost::rational_cast<long>(aStartWidth),0);
|
Point aReportPos(aStartWidth,0);
|
||||||
aSectionSize.Width() = aOutputSize.Width() - boost::rational_cast<long>(aStartWidth);
|
aSectionSize.Width() = aOutputSize.Width() - (long)aStartWidth;
|
||||||
if ( bShowEndMarker )
|
if ( bShowEndMarker )
|
||||||
aSectionSize.Width() -= boost::rational_cast<long>(aEndWidth);
|
aSectionSize.Width() -= (long)aEndWidth;
|
||||||
|
|
||||||
m_aReportSection.SetPosSizePixel(aReportPos,aSectionSize);
|
m_aReportSection.SetPosSizePixel(aReportPos,aSectionSize);
|
||||||
|
|
||||||
// set splitter
|
// set splitter
|
||||||
aReportPos.Y() += aSectionSize.Height();
|
aReportPos.Y() += aSectionSize.Height();
|
||||||
m_aSplitter.SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter.GetSizePixel().Height()));
|
m_aSplitter.SetPosSizePixel(aReportPos,Size(aSectionSize.Width(),m_aSplitter.GetSizePixel().Height()));
|
||||||
aSectionSize.Height() = (long)(1000 * boost::rational_cast<double>(this->GetMapMode().GetScaleY()));
|
aSectionSize.Height() = (long)(1000 * (double)GetMapMode().GetScaleY());
|
||||||
m_aSplitter.SetDragRectPixel( Rectangle(Point(boost::rational_cast<long>(aStartWidth),0),aSectionSize));
|
m_aSplitter.SetDragRectPixel( Rectangle(Point(aStartWidth,0),aSectionSize));
|
||||||
|
|
||||||
// set end marker
|
// set end marker
|
||||||
aReportPos.X() += aSectionSize.Width();
|
aReportPos.X() += aSectionSize.Width();
|
||||||
aReportPos.Y() = 0;
|
aReportPos.Y() = 0;
|
||||||
m_aEndMarker.Show(bShowEndMarker);
|
m_aEndMarker.Show(bShowEndMarker);
|
||||||
m_aEndMarker.SetPosSizePixel(aReportPos,Size(boost::rational_cast<long>(aEndWidth),aOutputSize.Height()));
|
m_aEndMarker.SetPosSizePixel(aReportPos,Size(aEndWidth,aOutputSize.Height()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ IMPL_LINK( OSectionWindow, Collapsed, OColorListener *, _pMarker )
|
|||||||
return 0L;
|
return 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OSectionWindow::zoom(const boost::rational<long>& _aZoom)
|
void OSectionWindow::zoom(const Fraction& _aZoom)
|
||||||
{
|
{
|
||||||
setZoomFactor(_aZoom,*this);
|
setZoomFactor(_aZoom,*this);
|
||||||
m_aStartMarker.zoom(_aZoom);
|
m_aStartMarker.zoom(_aZoom);
|
||||||
|
@ -89,9 +89,9 @@ OStartMarker::~OStartMarker()
|
|||||||
|
|
||||||
sal_Int32 OStartMarker::getMinHeight() const
|
sal_Int32 OStartMarker::getMinHeight() const
|
||||||
{
|
{
|
||||||
boost::rational<long> aExtraWidth(long(2*REPORT_EXTRA_SPACE));
|
Fraction aExtraWidth(long(2*REPORT_EXTRA_SPACE));
|
||||||
aExtraWidth *= GetMapMode().GetScaleX();
|
aExtraWidth *= GetMapMode().GetScaleX();
|
||||||
return LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() + boost::rational_cast<long>(aExtraWidth);
|
return LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() + (long)aExtraWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
void OStartMarker::Paint( const Rectangle& rRect )
|
void OStartMarker::Paint( const Rectangle& rRect )
|
||||||
@ -99,7 +99,7 @@ void OStartMarker::Paint( const Rectangle& rRect )
|
|||||||
(void)rRect;
|
(void)rRect;
|
||||||
Size aSize = GetOutputSizePixel();
|
Size aSize = GetOutputSizePixel();
|
||||||
long nSize = aSize.Width();
|
long nSize = aSize.Width();
|
||||||
const long nCornerWidth = long(CORNER_SPACE * boost::rational_cast<double>(GetMapMode().GetScaleX()));
|
const long nCornerWidth = long(CORNER_SPACE * (double)GetMapMode().GetScaleX());
|
||||||
|
|
||||||
if ( isCollapsed() )
|
if ( isCollapsed() )
|
||||||
{
|
{
|
||||||
@ -134,7 +134,7 @@ void OStartMarker::Paint( const Rectangle& rRect )
|
|||||||
}
|
}
|
||||||
if ( m_bMarked )
|
if ( m_bMarked )
|
||||||
{
|
{
|
||||||
const long nCornerHeight = long(CORNER_SPACE * boost::rational_cast<double>(GetMapMode().GetScaleY()));
|
const long nCornerHeight = long(CORNER_SPACE * (double)GetMapMode().GetScaleY());
|
||||||
Rectangle aRect( Point(nCornerWidth,nCornerHeight),
|
Rectangle aRect( Point(nCornerWidth,nCornerHeight),
|
||||||
Size(aSize.Width() - nCornerWidth - nCornerWidth,aSize.Height() - nCornerHeight - nCornerHeight));
|
Size(aSize.Width() - nCornerWidth - nCornerWidth,aSize.Height() - nCornerHeight - nCornerHeight));
|
||||||
ColorChanger aColors( this, COL_WHITE, COL_WHITE );
|
ColorChanger aColors( this, COL_WHITE, COL_WHITE );
|
||||||
@ -218,17 +218,17 @@ void OStartMarker::Resize()
|
|||||||
|
|
||||||
Size aImageSize = m_aImage.GetImage().GetSizePixel();
|
Size aImageSize = m_aImage.GetImage().GetSizePixel();
|
||||||
const MapMode& rMapMode = GetMapMode();
|
const MapMode& rMapMode = GetMapMode();
|
||||||
aImageSize.Width() = long(aImageSize.Width() * boost::rational_cast<double>(rMapMode.GetScaleX()));
|
aImageSize.Width() = long(aImageSize.Width() * (double)rMapMode.GetScaleX());
|
||||||
aImageSize.Height() = long(aImageSize.Height() * boost::rational_cast<double>(rMapMode.GetScaleY()));
|
aImageSize.Height() = long(aImageSize.Height() * (double)rMapMode.GetScaleY());
|
||||||
|
|
||||||
boost::rational<long> aExtraWidth(long(REPORT_EXTRA_SPACE));
|
Fraction aExtraWidth(long(REPORT_EXTRA_SPACE));
|
||||||
aExtraWidth *= rMapMode.GetScaleX();
|
aExtraWidth *= rMapMode.GetScaleX();
|
||||||
|
|
||||||
Point aPos(aImageSize.Width() + boost::rational_cast<long>((aExtraWidth + aExtraWidth)), boost::rational_cast<long>(aExtraWidth));
|
Point aPos(aImageSize.Width() + (long)(aExtraWidth + aExtraWidth), aExtraWidth);
|
||||||
const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText.GetTextHeight())).Height());
|
const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 2*aPos.Y(),LogicToPixel(Size(0,m_aText.GetTextHeight())).Height());
|
||||||
m_aText.SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight));
|
m_aText.SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight));
|
||||||
|
|
||||||
aPos.X() = boost::rational_cast<long>(aExtraWidth);
|
aPos.X() = aExtraWidth;
|
||||||
aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ;
|
aPos.Y() += static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() - aImageSize.Height()) * 0.5) ;
|
||||||
m_aImage.SetPosSizePixel(aPos,aImageSize);
|
m_aImage.SetPosSizePixel(aPos,aImageSize);
|
||||||
}
|
}
|
||||||
@ -281,7 +281,7 @@ void OStartMarker::setCollapsed(bool _bCollapsed)
|
|||||||
changeImage();
|
changeImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OStartMarker::zoom(const boost::rational<long>& _aZoom)
|
void OStartMarker::zoom(const Fraction& _aZoom)
|
||||||
{
|
{
|
||||||
setZoomFactor(_aZoom,*this);
|
setZoomFactor(_aZoom,*this);
|
||||||
m_aVRuler.SetZoom(_aZoom);
|
m_aVRuler.SetZoom(_aZoom);
|
||||||
|
@ -206,7 +206,7 @@ void OViewsWindow::impl_resizeSectionWindow(OSectionWindow& _rSectionWindow,Poin
|
|||||||
aSectionSize.Height() = nMinHeight;
|
aSectionSize.Height() = nMinHeight;
|
||||||
}
|
}
|
||||||
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
|
const StyleSettings& rSettings = GetSettings().GetStyleSettings();
|
||||||
aSectionSize.Height() += (long)(rSettings.GetSplitSize() * boost::rational_cast<double>(_rSectionWindow.GetMapMode().GetScaleY()));
|
aSectionSize.Height() += (long)(rSettings.GetSplitSize() * (double)_rSectionWindow.GetMapMode().GetScaleY());
|
||||||
|
|
||||||
if ( _bSet )
|
if ( _bSet )
|
||||||
_rSectionWindow.SetPosSizePixel(_rStartPoint,aSectionSize);
|
_rSectionWindow.SetPosSizePixel(_rStartPoint,aSectionSize);
|
||||||
@ -263,13 +263,13 @@ void OViewsWindow::Paint( const Rectangle& rRect )
|
|||||||
Window::Paint( rRect );
|
Window::Paint( rRect );
|
||||||
|
|
||||||
Size aOut = GetOutputSizePixel();
|
Size aOut = GetOutputSizePixel();
|
||||||
boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
||||||
aStartWidth *= GetMapMode().GetScaleX();
|
aStartWidth *= GetMapMode().GetScaleX();
|
||||||
|
|
||||||
aOut.Width() -= boost::rational_cast<long>(aStartWidth);
|
aOut.Width() -= (long)aStartWidth;
|
||||||
aOut = PixelToLogic(aOut);
|
aOut = PixelToLogic(aOut);
|
||||||
|
|
||||||
Rectangle aRect(PixelToLogic(Point(boost::rational_cast<long>(aStartWidth),0)),aOut);
|
Rectangle aRect(PixelToLogic(Point(aStartWidth,0)),aOut);
|
||||||
Wallpaper aWall( m_aColorConfig.GetColorValue(::svtools::APPBACKGROUND).nColor );
|
Wallpaper aWall( m_aColorConfig.GetColorValue(::svtools::APPBACKGROUND).nColor );
|
||||||
DrawWallpaper(aRect,aWall);
|
DrawWallpaper(aRect,aWall);
|
||||||
}
|
}
|
||||||
@ -1685,11 +1685,11 @@ void OViewsWindow::collapseSections(const uno::Sequence< beans::PropertyValue>&
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OViewsWindow::zoom(const boost::rational<long>& _aZoom)
|
void OViewsWindow::zoom(const Fraction& _aZoom)
|
||||||
{
|
{
|
||||||
const MapMode& aMapMode = GetMapMode();
|
const MapMode& aMapMode = GetMapMode();
|
||||||
|
|
||||||
boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
||||||
if ( _aZoom < aMapMode.GetScaleX() )
|
if ( _aZoom < aMapMode.GetScaleX() )
|
||||||
aStartWidth *= aMapMode.GetScaleX();
|
aStartWidth *= aMapMode.GetScaleX();
|
||||||
else
|
else
|
||||||
@ -1707,7 +1707,7 @@ void OViewsWindow::zoom(const boost::rational<long>& _aZoom)
|
|||||||
Resize();
|
Resize();
|
||||||
|
|
||||||
Size aOut = GetOutputSizePixel();
|
Size aOut = GetOutputSizePixel();
|
||||||
aOut.Width() = boost::rational_cast<long>(aStartWidth);
|
aOut.Width() = aStartWidth;
|
||||||
aOut = PixelToLogic(aOut);
|
aOut = PixelToLogic(aOut);
|
||||||
|
|
||||||
Rectangle aRect(PixelToLogic(Point(0,0)),aOut);
|
Rectangle aRect(PixelToLogic(Point(0,0)),aOut);
|
||||||
|
@ -78,10 +78,10 @@ void DlgEdFunc::ForceScroll( const Point& rPos )
|
|||||||
OScrollWindowHelper* pScrollWindow = pReportWindow->getScrollWindow();
|
OScrollWindowHelper* pScrollWindow = pReportWindow->getScrollWindow();
|
||||||
|
|
||||||
Size aOut = pReportWindow->GetOutputSizePixel();
|
Size aOut = pReportWindow->GetOutputSizePixel();
|
||||||
boost::rational<long> aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
|
||||||
aStartWidth *= m_pParent->GetMapMode().GetScaleX();
|
aStartWidth *= m_pParent->GetMapMode().GetScaleX();
|
||||||
|
|
||||||
aOut.Width() -= boost::rational_cast<long>(aStartWidth);
|
aOut.Width() -= (long)aStartWidth;
|
||||||
aOut.Height() = m_pParent->GetOutputSizePixel().Height();
|
aOut.Height() = m_pParent->GetOutputSizePixel().Height();
|
||||||
|
|
||||||
Point aPos = pScrollWindow->getThumbPos();
|
Point aPos = pScrollWindow->getThumbPos();
|
||||||
@ -90,7 +90,7 @@ void DlgEdFunc::ForceScroll( const Point& rPos )
|
|||||||
Rectangle aOutRect( aPos, aOut );
|
Rectangle aOutRect( aPos, aOut );
|
||||||
aOutRect = m_pParent->PixelToLogic( aOutRect );
|
aOutRect = m_pParent->PixelToLogic( aOutRect );
|
||||||
Rectangle aWorkArea(Point(), pScrollWindow->getTotalSize());
|
Rectangle aWorkArea(Point(), pScrollWindow->getTotalSize());
|
||||||
aWorkArea.Right() -= boost::rational_cast<long>(aStartWidth);
|
aWorkArea.Right() -= (long)aStartWidth;
|
||||||
aWorkArea = pScrollWindow->PixelToLogic( aWorkArea );
|
aWorkArea = pScrollWindow->PixelToLogic( aWorkArea );
|
||||||
if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) )
|
if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) )
|
||||||
{
|
{
|
||||||
|
@ -69,7 +69,7 @@ class RefMovedHint;
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace boost { template<typename T> class rational; }
|
class Fraction;
|
||||||
class OutputDevice;
|
class OutputDevice;
|
||||||
class SfxItemPoolCache;
|
class SfxItemPoolCache;
|
||||||
class SvtListener;
|
class SvtListener;
|
||||||
@ -455,12 +455,12 @@ public:
|
|||||||
|
|
||||||
long GetNeededSize(
|
long GetNeededSize(
|
||||||
SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY,
|
SCROW nRow, OutputDevice* pDev, double nPPTX, double nPPTY,
|
||||||
const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY,
|
const Fraction& rZoomX, const Fraction& rZoomY,
|
||||||
bool bWidth, const ScNeededSizeOptions& rOptions, const ScPatternAttr** pPatternChange ) const;
|
bool bWidth, const ScNeededSizeOptions& rOptions, const ScPatternAttr** pPatternChange ) const;
|
||||||
|
|
||||||
sal_uInt16 GetOptimalColWidth(
|
sal_uInt16 GetOptimalColWidth(
|
||||||
OutputDevice* pDev, double nPPTX, double nPPTY,
|
OutputDevice* pDev, double nPPTX, double nPPTY,
|
||||||
const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY,
|
const Fraction& rZoomX, const Fraction& rZoomY,
|
||||||
bool bFormula, sal_uInt16 nOldWidth, const ScMarkData* pMarkData, const ScColWidthParam* pParam) const;
|
bool bFormula, sal_uInt16 nOldWidth, const ScMarkData* pMarkData, const ScColWidthParam* pParam) const;
|
||||||
|
|
||||||
void GetOptimalHeight(
|
void GetOptimalHeight(
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
#include "compressedarray.hxx"
|
#include "compressedarray.hxx"
|
||||||
#include "calcmacros.hxx"
|
#include "calcmacros.hxx"
|
||||||
#include "calcconfig.hxx"
|
#include "calcconfig.hxx"
|
||||||
#include <tools/rational.hxx>
|
#include <tools/fract.hxx>
|
||||||
#include <tools/gen.hxx>
|
#include <tools/gen.hxx>
|
||||||
#include <svl/zforlist.hxx>
|
#include <svl/zforlist.hxx>
|
||||||
|
|
||||||
@ -1451,7 +1451,7 @@ public:
|
|||||||
void StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, bool bRemoved,
|
void StyleSheetChanged( const SfxStyleSheetBase* pStyleSheet, bool bRemoved,
|
||||||
OutputDevice* pDev,
|
OutputDevice* pDev,
|
||||||
double nPPTX, double nPPTY,
|
double nPPTX, double nPPTY,
|
||||||
const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY );
|
const Fraction& rZoomX, const Fraction& rZoomY );
|
||||||
|
|
||||||
bool IsStyleSheetUsed( const ScStyleSheet& rStyle, bool bGatherAllStyles ) const;
|
bool IsStyleSheetUsed( const ScStyleSheet& rStyle, bool bGatherAllStyles ) const;
|
||||||
|
|
||||||
@ -1519,7 +1519,7 @@ public:
|
|||||||
|
|
||||||
sal_uInt16 GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* pDev,
|
sal_uInt16 GetOptimalColWidth( SCCOL nCol, SCTAB nTab, OutputDevice* pDev,
|
||||||
double nPPTX, double nPPTY,
|
double nPPTX, double nPPTY,
|
||||||
const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY,
|
const Fraction& rZoomX, const Fraction& rZoomY,
|
||||||
bool bFormula,
|
bool bFormula,
|
||||||
const ScMarkData* pMarkData = NULL,
|
const ScMarkData* pMarkData = NULL,
|
||||||
const ScColWidthParam* pParam = NULL );
|
const ScColWidthParam* pParam = NULL );
|
||||||
@ -1532,7 +1532,7 @@ public:
|
|||||||
long GetNeededSize( SCCOL nCol, SCROW nRow, SCTAB nTab,
|
long GetNeededSize( SCCOL nCol, SCROW nRow, SCTAB nTab,
|
||||||
OutputDevice* pDev,
|
OutputDevice* pDev,
|
||||||
double nPPTX, double nPPTY,
|
double nPPTX, double nPPTY,
|
||||||
const boost::rational<long>& rZoomX, const boost::rational<long>& rZoomY,
|
const Fraction& rZoomX, const Fraction& rZoomY,
|
||||||
bool bWidth, bool bTotalSize = false );
|
bool bWidth, bool bTotalSize = false );
|
||||||
|
|
||||||
SC_DLLPUBLIC void ShowCol(SCCOL nCol, SCTAB nTab, bool bShow);
|
SC_DLLPUBLIC void ShowCol(SCCOL nCol, SCTAB nTab, bool bShow);
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
#include <tools/date.hxx>
|
#include <tools/date.hxx>
|
||||||
#include <tools/time.hxx>
|
#include <tools/time.hxx>
|
||||||
#include <tools/gen.hxx>
|
#include <tools/gen.hxx>
|
||||||
#include <tools/rational.hxx>
|
#include <tools/fract.hxx>
|
||||||
|
|
||||||
class OutputDevice;
|
class OutputDevice;
|
||||||
class ScDocument;
|
class ScDocument;
|
||||||
@ -44,8 +44,8 @@ class ScEditUtil
|
|||||||
OutputDevice* pDev; // MapMode has to be set
|
OutputDevice* pDev; // MapMode has to be set
|
||||||
double nPPTX;
|
double nPPTX;
|
||||||
double nPPTY;
|
double nPPTY;
|
||||||
boost::rational<long> aZoomX;
|
Fraction aZoomX;
|
||||||
boost::rational<long> aZoomY;
|
Fraction aZoomY;
|
||||||
|
|
||||||
static const char pCalcDelimiters[];
|
static const char pCalcDelimiters[];
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ public:
|
|||||||
ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ,
|
ScEditUtil( ScDocument* pDocument, SCCOL nX, SCROW nY, SCTAB nZ,
|
||||||
const Point& rScrPosPixel,
|
const Point& rScrPosPixel,
|
||||||
OutputDevice* pDevice, double nScaleX, double nScaleY,
|
OutputDevice* pDevice, double nScaleX, double nScaleY,
|
||||||
const boost::rational<long>& rX, const boost::rational<long>& rY ) :
|
const Fraction& rX, const Fraction& rY ) :
|
||||||
pDoc(pDocument),nCol(nX),nRow(nY),nTab(nZ),
|
pDoc(pDocument),nCol(nX),nRow(nY),nTab(nZ),
|
||||||
aScrPos(rScrPosPixel),pDev(pDevice),
|
aScrPos(rScrPosPixel),pDev(pDevice),
|
||||||
nPPTX(nScaleX),nPPTY(nScaleY),aZoomX(rX),aZoomY(rY) {}
|
nPPTX(nScaleX),nPPTY(nScaleY),aZoomX(rX),aZoomY(rY) {}
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
namespace vcl { class Font; }
|
namespace vcl { class Font; }
|
||||||
class OutputDevice;
|
class OutputDevice;
|
||||||
namespace boost { template<class T> class rational; }
|
class Fraction;
|
||||||
class ScStyleSheet;
|
class ScStyleSheet;
|
||||||
class SvNumberFormatter;
|
class SvNumberFormatter;
|
||||||
class ScDocument;
|
class ScDocument;
|
||||||
@ -83,14 +83,14 @@ public:
|
|||||||
static void GetFont( vcl::Font& rFont, const SfxItemSet& rItemSet,
|
static void GetFont( vcl::Font& rFont, const SfxItemSet& rItemSet,
|
||||||
ScAutoFontColorMode eAutoMode,
|
ScAutoFontColorMode eAutoMode,
|
||||||
OutputDevice* pOutDev = NULL,
|
OutputDevice* pOutDev = NULL,
|
||||||
const boost::rational<long>* pScale = NULL,
|
const Fraction* pScale = NULL,
|
||||||
const SfxItemSet* pCondSet = NULL,
|
const SfxItemSet* pCondSet = NULL,
|
||||||
sal_uInt8 nScript = 0, const Color* pBackConfigColor = NULL,
|
sal_uInt8 nScript = 0, const Color* pBackConfigColor = NULL,
|
||||||
const Color* pTextConfigColor = NULL );
|
const Color* pTextConfigColor = NULL );
|
||||||
/** Fills a font object from the own item set. */
|
/** Fills a font object from the own item set. */
|
||||||
void GetFont( vcl::Font& rFont, ScAutoFontColorMode eAutoMode,
|
void GetFont( vcl::Font& rFont, ScAutoFontColorMode eAutoMode,
|
||||||
OutputDevice* pOutDev = NULL,
|
OutputDevice* pOutDev = NULL,
|
||||||
const boost::rational<long>* pScale = NULL,
|
const Fraction* pScale = NULL,
|
||||||
const SfxItemSet* pCondSet = NULL,
|
const SfxItemSet* pCondSet = NULL,
|
||||||
sal_uInt8 nScript = 0, const Color* pBackConfigColor = NULL,
|
sal_uInt8 nScript = 0, const Color* pBackConfigColor = NULL,
|
||||||
const Color* pTextConfigColor = NULL ) const;
|
const Color* pTextConfigColor = NULL ) const;
|
||||||
|
@ -876,7 +876,7 @@
|
|||||||
#include <tools/datetime.hxx>
|
#include <tools/datetime.hxx>
|
||||||
#include <tools/debug.hxx>
|
#include <tools/debug.hxx>
|
||||||
#include <tools/diagnose_ex.h>
|
#include <tools/diagnose_ex.h>
|
||||||
#include <tools/rational.hxx>
|
#include <tools/fract.hxx>
|
||||||
#include <tools/gen.hxx>
|
#include <tools/gen.hxx>
|
||||||
#include <tools/globname.hxx>
|
#include <tools/globname.hxx>
|
||||||
#include <tools/mempool.hxx>
|
#include <tools/mempool.hxx>
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user