diff options
author | Armin Le Grand <alg@apache.org> | 2013-08-08 14:01:55 +0000 |
---|---|---|
committer | Armin Le Grand <alg@apache.org> | 2013-08-08 14:01:55 +0000 |
commit | bcb0630dd609dbf890558a719f77d3da44bcbcac (patch) | |
tree | 936245aa6e97d747cc78dcf8953ee0f2920125de | |
parent | d9804cd7c4f01ac54dc5947bfefea2bc0296b414 (diff) |
adaptions, changes, warnings reviewed
170 files changed, 1443 insertions, 1193 deletions
diff --git a/basegfx/source/point/b2dpoint.cxx b/basegfx/source/point/b2dpoint.cxx index 6285ddbd2f30..99fe2546d5fe 100644 --- a/basegfx/source/point/b2dpoint.cxx +++ b/basegfx/source/point/b2dpoint.cxx @@ -19,10 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_basegfx.hxx" + #include <basegfx/point/b2dpoint.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/numeric/ftools.hxx> diff --git a/basegfx/source/vector/b2dvector.cxx b/basegfx/source/vector/b2dvector.cxx index 8b613ddea8cf..7f8acaf11037 100644 --- a/basegfx/source/vector/b2dvector.cxx +++ b/basegfx/source/vector/b2dvector.cxx @@ -19,10 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_basegfx.hxx" + #include <basegfx/vector/b2dvector.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/numeric/ftools.hxx> diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index f7b6841dca44..4c3a7c54d219 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -334,7 +334,7 @@ void ScaleTabPage::EnableControls() { //transport value from one to other control if( bWasDateAxis ) - lcl_setValue( aFmtFldStepMain, m_aMt_MainDateStep.GetValue() ); + lcl_setValue( aFmtFldStepMain, static_cast< double >(m_aMt_MainDateStep.GetValue())); else m_aMt_MainDateStep.SetValue( static_cast<sal_Int32>(aFmtFldStepMain.GetValue()) ); } @@ -542,18 +542,18 @@ void ScaleTabPage::Reset(const SfxItemSet& rInAttrs) if (rInAttrs.GetItemState(SCHATTR_AXIS_TIME_RESOLUTION,sal_True, &pPoolItem) == SFX_ITEM_SET) { m_nTimeResolution = ((const SfxInt32Item*)pPoolItem)->GetValue(); - m_aLB_TimeResolution.SelectEntryPos( m_nTimeResolution ); + m_aLB_TimeResolution.SelectEntryPos(static_cast< sal_uInt16 >(m_nTimeResolution)); } if (rInAttrs.GetItemState(SCHATTR_AXIS_MAIN_TIME_UNIT,sal_True, &pPoolItem) == SFX_ITEM_SET) { m_nMainTimeUnit = ((const SfxInt32Item*)pPoolItem)->GetValue(); - m_aLB_MainTimeUnit.SelectEntryPos( m_nMainTimeUnit ); + m_aLB_MainTimeUnit.SelectEntryPos(static_cast< sal_uInt16 >(m_nMainTimeUnit)); } if (rInAttrs.GetItemState(SCHATTR_AXIS_HELP_TIME_UNIT,sal_True, &pPoolItem) == SFX_ITEM_SET) { m_nHelpTimeUnit = ((const SfxInt32Item*)pPoolItem)->GetValue(); - m_aLB_HelpTimeUnit.SelectEntryPos( m_nHelpTimeUnit ); + m_aLB_HelpTimeUnit.SelectEntryPos(static_cast< sal_uInt16 >(m_nHelpTimeUnit)); } EnableControls(); diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx index c66777bbf5ec..88562114947a 100644 --- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx +++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx @@ -286,11 +286,11 @@ void DrawViewWrapper::setMarkHandleProvider( MarkHandleProvider* pMarkHandleProv m_pMarkHandleProvider = pMarkHandleProvider; } -void DrawViewWrapper::CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* /* pRedirector */) +void DrawViewWrapper::CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* /* pRedirector */) const { svtools::ColorConfig aColorConfig; Color aFillColor = Color( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor ); - this->SetApplicationBackgroundColor(aFillColor); + const_cast< DrawViewWrapper* >(this)->SetApplicationBackgroundColor(aFillColor); this->E3dView::CompleteRedraw( pOut, rReg ); } diff --git a/chart2/source/controller/inc/DrawViewWrapper.hxx b/chart2/source/controller/inc/DrawViewWrapper.hxx index fec4891a011a..3d1666df677f 100644 --- a/chart2/source/controller/inc/DrawViewWrapper.hxx +++ b/chart2/source/controller/inc/DrawViewWrapper.hxx @@ -70,7 +70,7 @@ public: //---------------------- //pMarkHandleProvider can be NULL; ownership is not taken void setMarkHandleProvider( MarkHandleProvider* pMarkHandleProvider ); - void CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0); + void CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0) const; SdrObject* getTextEditObject() const; SdrOutliner* getOutliner() const; diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index 9c2dd0a3d16f..b0079ad947bd 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -432,8 +432,8 @@ void ChartController::impl_PasteShapes( SdrModel* pModel ) { Reference< drawing::XShape > xSelShape; m_pDrawViewWrapper->BegUndo( SVX_RESSTR( RID_SVX_3D_UNDO_EXCHANGE_PASTE ) ); - sal_uInt16 nCount = pModel->GetPageCount(); - for ( sal_uInt16 i = 0; i < nCount; ++i ) + sal_uInt32 nCount = pModel->GetPageCount(); + for ( sal_uInt32 i = 0; i < nCount; ++i ) { const SdrPage* pPage = pModel->GetPage( i ); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx index f3ec25a6163f..e5c67639ff0f 100644 --- a/chart2/source/controller/main/ChartTransferable.cxx +++ b/chart2/source/controller/main/ChartTransferable.cxx @@ -129,8 +129,8 @@ sal_Bool ChartTransferable::WriteObject( SotStorageStreamRef& rxOStm, void* pUse const SfxItemPool& rItemPool = pMarkedObjModel->GetItemPool(); const SvxFontHeightItem& rDefaultFontHeight = static_cast< const SvxFontHeightItem& >( rItemPool.GetDefaultItem( EE_CHAR_FONTHEIGHT ) ); - sal_uInt16 nCount = pMarkedObjModel->GetPageCount(); - for ( sal_uInt16 i = 0; i < nCount; ++i ) + sal_uInt32 nCount = pMarkedObjModel->GetPageCount(); + for ( sal_uInt32 i = 0; i < nCount; ++i ) { const SdrPage* pPage = pMarkedObjModel->GetPage( i ); SdrObjListIter aIter( *pPage, IM_DEEPNOGROUPS ); diff --git a/chart2/source/view/charttypes/PieChart.cxx b/chart2/source/view/charttypes/PieChart.cxx index 049343a1682c..c91a2a3b7c9a 100644 --- a/chart2/source/view/charttypes/PieChart.cxx +++ b/chart2/source/view/charttypes/PieChart.cxx @@ -374,7 +374,7 @@ void PieChart::createShapes() uno::Any aAny = xPropertySet->getPropertyValue( C2U("3DRelativeHeight") ); aAny >>= n3DRelativeHeight; } - catch(const uno::Exception& e) {} + catch(const uno::Exception& /*e*/) {} } //============================================================================= diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index d4a7888bf7ab..fbfe0251638a 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -711,7 +711,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter( if (n3DRelativeHeightOldValue != n3DRelativeHeight) xPropertySet->setPropertyValue( C2U("3DRelativeHeight"), uno::makeAny(n3DRelativeHeight) ); } - catch(const uno::Exception& e){} + catch(const uno::Exception& /*e*/){} } } @@ -1632,7 +1632,11 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( SeriesPlotterContainer& { //if( !bIsPieOrDonut ) // aConsumedOuterRect = ::basegfx::B2IRectangle( ShapeFactory::getRectangleOfShape(xBoundingShape) ); - aUsedOuterRect = awt::Rectangle( aConsumedOuterRect.getMinX(), aConsumedOuterRect.getMinY(), aConsumedOuterRect.getWidth(), aConsumedOuterRect.getHeight() ); + aUsedOuterRect = awt::Rectangle( + basegfx::fround(aConsumedOuterRect.getMinX()), + basegfx::fround(aConsumedOuterRect.getMinY()), + basegfx::fround(aConsumedOuterRect.getWidth()), + basegfx::fround(aConsumedOuterRect.getHeight())); } else aUsedOuterRect = awt::Rectangle( rAvailablePos.X, rAvailablePos.Y, rAvailableSize.Width, rAvailableSize.Height ); @@ -1652,7 +1656,11 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( SeriesPlotterContainer& else { ::basegfx::B2IRectangle aConsumedInnerRect = aVDiagram.getCurrentRectangle(); - m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle( aConsumedInnerRect.getMinX(), aConsumedInnerRect.getMinY(), aConsumedInnerRect.getWidth(), aConsumedInnerRect.getHeight() ); + m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle( + basegfx::fround(aConsumedInnerRect.getMinX()), + basegfx::fround(aConsumedInnerRect.getMinY()), + basegfx::fround(aConsumedInnerRect.getWidth()), + basegfx::fround(aConsumedInnerRect.getHeight())); } } else @@ -1662,7 +1670,11 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( SeriesPlotterContainer& else { ::basegfx::B2IRectangle aConsumedInnerRect = aVDiagram.getCurrentRectangle(); - m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle( aConsumedInnerRect.getMinX(), aConsumedInnerRect.getMinY(), aConsumedInnerRect.getWidth(), aConsumedInnerRect.getHeight() ); + m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle( + basegfx::fround(aConsumedInnerRect.getMinX()), + basegfx::fround(aConsumedInnerRect.getMinY()), + basegfx::fround(aConsumedInnerRect.getWidth()), + basegfx::fround(aConsumedInnerRect.getHeight())); } } diff --git a/chart2/source/view/main/VTitle.cxx b/chart2/source/view/main/VTitle.cxx index 4de17d179fbb..a352fc4d2d60 100644 --- a/chart2/source/view/main/VTitle.cxx +++ b/chart2/source/view/main/VTitle.cxx @@ -250,13 +250,13 @@ void VTitle::createShapes( } // #i109336# Improve auto positioning in chart - float fFontHeight = 0.0; + double fFontHeight = 0.0; if ( xShapeProp.is() && ( xShapeProp->getPropertyValue( C2U( "CharHeight" ) ) >>= fFontHeight ) ) { fFontHeight *= ( 2540. / 72. ); // pt -> 1/100 mm - float fXFraction = 0.18; + double fXFraction = 0.18; sal_Int32 nXDistance = static_cast< sal_Int32 >( ::rtl::math::round( fFontHeight * fXFraction ) ); - float fYFraction = 0.30; + double fYFraction = 0.30; sal_Int32 nYDistance = static_cast< sal_Int32 >( ::rtl::math::round( fFontHeight * fYFraction ) ); xShapeProp->setPropertyValue( C2U( "TextLeftDistance" ), uno::makeAny( nXDistance ) ); xShapeProp->setPropertyValue( C2U( "TextRightDistance" ), uno::makeAny( nXDistance ) ); diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx index 829d0be06240..48696b56f357 100644 --- a/sc/source/ui/drawfunc/fuconpol.cxx +++ b/sc/source/ui/drawfunc/fuconpol.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" @@ -28,12 +26,11 @@ #include "tabvwsh.hxx" #include "sc.hrc" #include "drawview.hxx" - -// #98185# Create default drawing objects via keyboard #include <svx/svdopath.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/point/b2dpoint.hxx> #include <svx/svdlegacy.hxx> +#include <svx/sdrobjecttools.hxx> // Pixelabstand zum Schliessen von Freihand-Zeichnungen #ifndef CLOSE_PIXDIST @@ -247,106 +244,143 @@ void FuConstPolygon::Deactivate() // #98185# Create default drawing objects via keyboard SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const basegfx::B2DRange& rRange) { - // case SID_DRAW_POLYGON: - // case SID_DRAW_POLYGON_NOFILL: - // case SID_DRAW_BEZIER_NOFILL: - // case SID_DRAW_FREELINE_NOFILL: - - SdrObject* pObj = SdrObjFactory::MakeNewObject( - pView->getSdrModelFromSdrView(), - pView->getSdrObjectCreationInfo()); + SdrPathObj* pRetval = dynamic_cast< SdrPathObj* >( + SdrObjFactory::MakeNewObject( + pView->getSdrModelFromSdrView(), + pView->getSdrObjectCreationInfo())); - if(pObj) + if(pRetval) { - SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj); + DefaultSdrPathObjType eType(DefaultSdrPathObjType_Line); + bool bClosed(false); - if(pSdrPathObj) + switch(nID) { - basegfx::B2DPolyPolygon aPoly; - - switch(nID) - { - case SID_DRAW_BEZIER_NOFILL: - { - basegfx::B2DPolygon aInnerPoly; - - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - - const basegfx::B2DPoint aCenterBottom(rRange.getCenterX(), rRange.getMaxY()); - aInnerPoly.appendBezierSegment( - aCenterBottom, - aCenterBottom, - rRange.getCenter()); - - const basegfx::B2DPoint aCenterTop(rRange.getCenterX(), rRange.getMinY()); - aInnerPoly.appendBezierSegment( - aCenterTop, - aCenterTop, - basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); - - aPoly.append(aInnerPoly); - break; - } - case SID_DRAW_FREELINE_NOFILL: - { - basegfx::B2DPolygon aInnerPoly; - - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - - aInnerPoly.appendBezierSegment( - rRange.getMinimum(), - basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY()), - rRange.getCenter()); - - aInnerPoly.appendBezierSegment( - basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()), - basegfx::B2DPoint(rRange.getMaxX(), rRange.getMaxY()), - basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); - - aPoly.append(aInnerPoly); - break; - } - case SID_DRAW_POLYGON: - case SID_DRAW_POLYGON_NOFILL: - { - basegfx::B2DPolygon aInnerPoly; - const double fWdt(rRange.getWidth()); - const double fHgt(rRange.getHeight()); - - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.3, rRange.getMinY() + fHgt * 0.7)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY() + fHgt * 0.15)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.65, rRange.getMinY())); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt, rRange.getMinY() + fHgt * 0.3)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.5)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.75)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxY(), rRange.getMaxX())); - - if(SID_DRAW_POLYGON_NOFILL == nID) - { - aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY())); - } - else - { - aInnerPoly.setClosed(true); - } - - aPoly.append(aInnerPoly); - break; - } - } - - pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(aPoly); - } - else - { - DBG_ERROR("Object is NO path object"); + case SID_DRAW_BEZIER_NOFILL: + eType = DefaultSdrPathObjType_Bezier; + break; + case SID_DRAW_FREELINE_NOFILL: + eType = DefaultSdrPathObjType_Freeline; + break; + case SID_DRAW_POLYGON: + eType = DefaultSdrPathObjType_Polygon; + bClosed = true; + break; + case SID_DRAW_POLYGON_NOFILL: + eType = DefaultSdrPathObjType_Polygon; + break; } - sdr::legacy::SetLogicRange(*pObj, rRange); + initializeDefaultSdrPathObjByObjectType(*pRetval, eType, rRange, bClosed); + } + else + { + OSL_ENSURE(false, "Could not create default path object (!)"); } - return pObj; + return pRetval; + + // TTTT +// // case SID_DRAW_POLYGON: +// // case SID_DRAW_POLYGON_NOFILL: +// // case SID_DRAW_BEZIER_NOFILL: +// // case SID_DRAW_FREELINE_NOFILL: +// +// SdrObject* pObj = SdrObjFactory::MakeNewObject( +// pView->getSdrModelFromSdrView(), +// pView->getSdrObjectCreationInfo()); +// +// if(pObj) +// { +// SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj); +// +// if(pSdrPathObj) +// { +// basegfx::B2DPolyPolygon aPoly; +// +// switch(nID) +// { +// case SID_DRAW_BEZIER_NOFILL: +// { +// basegfx::B2DPolygon aInnerPoly; +// +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); +// +// const basegfx::B2DPoint aCenterBottom(rRange.getCenterX(), rRange.getMaxY()); +// aInnerPoly.appendBezierSegment( +// aCenterBottom, +// aCenterBottom, +// rRange.getCenter()); +// +// const basegfx::B2DPoint aCenterTop(rRange.getCenterX(), rRange.getMinY()); +// aInnerPoly.appendBezierSegment( +// aCenterTop, +// aCenterTop, +// basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); +// +// aPoly.append(aInnerPoly); +// break; +// } +// case SID_DRAW_FREELINE_NOFILL: +// { +// basegfx::B2DPolygon aInnerPoly; +// +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); +// +// aInnerPoly.appendBezierSegment( +// rRange.getMinimum(), +// basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY()), +// rRange.getCenter()); +// +// aInnerPoly.appendBezierSegment( +// basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()), +// basegfx::B2DPoint(rRange.getMaxX(), rRange.getMaxY()), +// basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); +// +// aPoly.append(aInnerPoly); +// break; +// } +// case SID_DRAW_POLYGON: +// case SID_DRAW_POLYGON_NOFILL: +// { +// basegfx::B2DPolygon aInnerPoly; +// const double fWdt(rRange.getWidth()); +// const double fHgt(rRange.getHeight()); +// +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.3, rRange.getMinY() + fHgt * 0.7)); +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY() + fHgt * 0.15)); +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.65, rRange.getMinY())); +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt, rRange.getMinY() + fHgt * 0.3)); +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.5)); +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.75)); +// aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxY(), rRange.getMaxX())); +// +// if(SID_DRAW_POLYGON_NOFILL == nID) +// { +// aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY())); +// } +// else +// { +// aInnerPoly.setClosed(true); +// } +// +// aPoly.append(aInnerPoly); +// break; +// } +// } +// +// pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(aPoly); +// } +// else +// { +// DBG_ERROR("Object is NO path object"); +// } +// +// sdr::legacy::SetLogicRange(*pObj, rRange); +// } +// +// return pObj; } // eof diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx index 06a2533bdc13..eb71b9ccef76 100644 --- a/sc/source/ui/drawfunc/fuconrec.cxx +++ b/sc/source/ui/drawfunc/fuconrec.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sc.hxx" @@ -35,12 +33,9 @@ #include <basegfx/point/b2dpoint.hxx> #include <svx/svdlegacy.hxx> #include <svx/sdrobjectfactory.hxx> - +#include <svx/sdrobjecttools.hxx> #include "scresid.hxx" -//------------------------------------------------------------------------ - - /************************************************************************* |* |* Konstruktor @@ -246,11 +241,15 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const bas if(pSdrPathObj) { - const double fYMiddle((rRange.getMinY() + rRange.getMaxY()) * 0.5); - basegfx::B2DPolygon aPoly; - aPoly.append(basegfx::B2DPoint(rRange.getMinX(), fYMiddle)); - aPoly.append(basegfx::B2DPoint(rRange.getMaxX(), fYMiddle)); - pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aPoly)); + initializeDefaultSdrPathObjByObjectType(*pSdrPathObj, DefaultSdrPathObjType_Line, rRange, false); + //pSdrPathObj->initializeDefaultSdrPathObjBySlotID(nID, rRange); + + // TTTT + //const double fYMiddle((rRange.getMinY() + rRange.getMaxY()) * 0.5); + //basegfx::B2DPolygon aPoly; + //aPoly.append(basegfx::B2DPoint(rRange.getMinX(), fYMiddle)); + //aPoly.append(basegfx::B2DPoint(rRange.getMaxX(), fYMiddle)); + //pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(basegfx::B2DPolyPolygon(aPoly)); } else { diff --git a/sd/inc/Outliner.hxx b/sd/inc/Outliner.hxx index 967371b895cb..47669c867e83 100644 --- a/sd/inc/Outliner.hxx +++ b/sd/inc/Outliner.hxx @@ -224,7 +224,7 @@ private: bool mbMatchMayExist; /// The number of pages in the current view. - sal_uInt16 mnPageCount; + sal_uInt32 mnPageCount; /// Number of objects on the current page / in the current selection. sal_Int32 mnObjectCount; diff --git a/sd/inc/sdpage.hxx b/sd/inc/sdpage.hxx index 89a80b3505de..662bbd838610 100644 --- a/sd/inc/sdpage.hxx +++ b/sd/inc/sdpage.hxx @@ -96,8 +96,11 @@ namespace sd { int meDateTimeFormat; HeaderFooterSettings(); + HeaderFooterSettings(const HeaderFooterSettings& rSource); + ~HeaderFooterSettings(); bool operator==( const HeaderFooterSettings& rSettings ) const; + HeaderFooterSettings& operator=(const HeaderFooterSettings& rHeaderFooter); }; typedef std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::office::XAnnotation > > AnnotationVector; @@ -214,7 +217,7 @@ public: void InsertPresObj(SdrObject* pObj, PresObjKind eKind ); void SetAutoLayout(AutoLayout eLayout, bool bInit=false, bool bCreate=false); - AutoLayout GetAutoLayout() const { return meAutoLayout; } + AutoLayout GetAutoLayout() const; void CreateTitleAndLayout(bool bInit=false, bool bCreate=false); SdrObject* InsertAutoLayoutShape(SdrObject* pObj, PresObjKind eObjKind, bool bVertical, const basegfx::B2DRange& rRange, bool bInit ); @@ -226,7 +229,7 @@ public: void SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eObjKind, const String& rStr ); void SetPageKind(PageKind ePgType) { mePageKind = ePgType; } - PageKind GetPageKind() const { return mePageKind; } + PageKind GetPageKind() const; void SetSelected(bool bSel) { mbSelected = bSel; } bool IsSelected() const { return mbSelected; } @@ -234,10 +237,10 @@ public: void SetFadeEffect(::com::sun::star::presentation::FadeEffect eNewEffect); ::com::sun::star::presentation::FadeEffect GetFadeEffect() const; - void SetPresChange(PresChange eChange) { mePresChange = eChange; } + void SetPresChange(PresChange eChange); PresChange GetPresChange() const { return mePresChange; } - void SetTime(sal_uInt32 nNewTime) { mnTime = nNewTime; } + void SetTime(sal_uInt32 nNewTime); sal_uInt32 GetTime() const { return mnTime; } void SetSound(bool bNewSoundOn) { mbSoundOn = bNewSoundOn; } diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx index 7ed5c2d316a5..20d62eee5ffd 100644 --- a/sd/source/core/drawdoc3.cxx +++ b/sd/source/core/drawdoc3.cxx @@ -2120,11 +2120,11 @@ void SdDrawDocument::Merge(SdrModel& rSourceModel, bool bMergeMasterPages, bool bAllMasterPages, bool bUndo, bool bTreadSourceAsConst) { - sal_uInt16 nMasterPageCount = GetMasterPageCount(); + sal_uInt32 nMasterPageCount = GetMasterPageCount(); SdrModel::Merge( rSourceModel, nFirstPageNum, nLastPageNum, nDestPos, bMergeMasterPages, bAllMasterPages, bUndo, bTreadSourceAsConst ); // add style family for each new master page - for( sal_uInt16 nMaster = nMasterPageCount; nMaster < GetMasterPageCount(); nMaster++ ) + for( sal_uInt32 nMaster = nMasterPageCount; nMaster < GetMasterPageCount(); nMaster++ ) { SdPage* pPage = static_cast< SdPage* >( GetMasterPage( nMaster ) ); if( pPage && pPage->IsMasterPage() && (pPage->GetPageKind() == PK_STANDARD) ) diff --git a/sd/source/core/drawdoc4.cxx b/sd/source/core/drawdoc4.cxx index 85c0f869cd55..78f964b62b60 100644 --- a/sd/source/core/drawdoc4.cxx +++ b/sd/source/core/drawdoc4.cxx @@ -1111,9 +1111,9 @@ void SdDrawDocument::ImpOnlineSpellCallback(SpellCallbackInfo* pInfo, SdrObject* void SdDrawDocument::RestoreLayerNames() { SdrLayerAdmin& rLayerAdmin = GetModelLayerAdmin(); - sal_uInt16 nLayerCount = rLayerAdmin.GetLayerCount(); + sal_uInt32 nLayerCount = rLayerAdmin.GetLayerCount(); - for (sal_uInt16 nLayer = 0; nLayer < nLayerCount; nLayer++) + for (sal_uInt32 nLayer = 0; nLayer < nLayerCount; nLayer++) { SdrLayer* pLayer = rLayerAdmin.GetLayer(nLayer); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 1024c1a763c2..23e16c2cf416 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -3176,6 +3176,27 @@ bool SdPage::IsPrecious (void) const +void SdPage::SetTime(sal_uInt32 nNewTime) +{ + mnTime = nNewTime; +} + +void SdPage::SetPresChange(PresChange eChange) +{ + mePresChange = eChange; +} + +AutoLayout SdPage::GetAutoLayout() const +{ + return meAutoLayout; +} + +PageKind SdPage::GetPageKind() const +{ + return mePageKind; +} + + HeaderFooterSettings::HeaderFooterSettings() { @@ -3187,6 +3208,16 @@ HeaderFooterSettings::HeaderFooterSettings() meDateTimeFormat = SVXDATEFORMAT_A; } + +HeaderFooterSettings::HeaderFooterSettings(const HeaderFooterSettings& rSource) +{ + *this = rSource; +} + +HeaderFooterSettings::~HeaderFooterSettings() +{ +} + bool HeaderFooterSettings::operator==( const HeaderFooterSettings& rSettings ) const { return (mbHeaderVisible == rSettings.mbHeaderVisible) && @@ -3200,3 +3231,19 @@ bool HeaderFooterSettings::operator==( const HeaderFooterSettings& rSettings ) c (maDateTimeText == rSettings.maDateTimeText); } +HeaderFooterSettings& HeaderFooterSettings::operator=(const HeaderFooterSettings& rHeaderFooter) +{ + mbHeaderVisible = rHeaderFooter.mbHeaderVisible; + maHeaderText = rHeaderFooter.maHeaderText; + mbFooterVisible = rHeaderFooter.mbFooterVisible; + maFooterText = rHeaderFooter.maFooterText; + mbSlideNumberVisible = rHeaderFooter.mbSlideNumberVisible; + mbDateTimeVisible = rHeaderFooter.mbDateTimeVisible; + mbDateTimeIsFixed = rHeaderFooter.mbDateTimeIsFixed; + maDateTimeText = rHeaderFooter.maDateTimeText; + meDateTimeFormat = rHeaderFooter.meDateTimeFormat; + + return *this; +} + +// eof diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index a96bc5114d48..36d8615d98f6 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -3430,7 +3430,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u } nParaFlags >>= 16; - sal_uInt32 nDefaultTabSize = mfMap100thMmToMs * 2011.0; + sal_uInt32 nDefaultTabSize = basegfx::fround(mfMap100thMmToMs * 2011.0); sal_uInt32 nDefaultTabs = basegfx::fround(fabs(maObjectRange.getWidth())) / nDefaultTabSize; if ( nTabs ) nDefaultTabs -= (sal_Int32)( ( ( pTabStop[ nTabs - 1 ].Position / 4.40972 ) + nTextOfs ) / nDefaultTabSize ); diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index c161e18bbfd3..9a5100d4b50a 100644 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -222,13 +222,14 @@ sal_Bool SdGRFFilter::Import() SdPage* pPage = mrDocument.GetSdPage( 0, PK_STANDARD ); Point aPos; - const basegfx::B2DVector& rPageScale = pPage->GetPageScale(); - Size aPagSize(basegfx::fround(rPageScale.getX()), basegfx::fround(rPageScale.getY())); - Size aGrfSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), - aGraphic.GetPrefMapMode(), MAP_100TH_MM ) ); - - aPagSize.Width() -= pPage->GetLeftPageBorder() + pPage->GetRightPageBorder(); - aPagSize.Height() -= pPage->GetTopPageBorder() + pPage->GetBottomPageBorder(); + const Size aPagSize( + basegfx::fround(pPage->GetInnerPageScale().getX()), + basegfx::fround(pPage->GetInnerPageScale().getY())); + Size aGrfSize( + OutputDevice::LogicToLogic( + aGraphic.GetPrefSize(), + aGraphic.GetPrefMapMode(), + MAP_100TH_MM ) ); // scale to fit page if ( ( ( aGrfSize.Height() > aPagSize.Height() ) || ( aGrfSize.Width() > aPagSize.Width() ) ) && @@ -240,19 +241,19 @@ sal_Bool SdGRFFilter::Import() // Grafik an Pagesize anpassen (skaliert) if( fGrfWH < fWinWH ) { - aGrfSize.Width() = (long) ( aPagSize.Height() * fGrfWH ); + aGrfSize.Width() = basegfx::fround( aPagSize.Height() * fGrfWH ); aGrfSize.Height() = aPagSize.Height(); } else if( fGrfWH > 0.F ) { aGrfSize.Width() = aPagSize.Width(); - aGrfSize.Height()= (long) ( aPagSize.Width() / fGrfWH ); + aGrfSize.Height()= basegfx::fround( aPagSize.Width() / fGrfWH ); } } // Ausgaberechteck fuer Grafik setzen - aPos.X() = ( ( aPagSize.Width() - aGrfSize.Width() ) >> 1 ) + pPage->GetLeftPageBorder(); - aPos.Y() = ( ( aPagSize.Height() - aGrfSize.Height() ) >> 1 ) + pPage->GetTopPageBorder(); + aPos.X() = ( ( aPagSize.Width() - aGrfSize.Width() ) >> 1 ) + basegfx::fround(pPage->GetLeftPageBorder()); + aPos.Y() = ( ( aPagSize.Height() - aGrfSize.Height() ) >> 1 ) + basegfx::fround(pPage->GetTopPageBorder()); SdrGrafObj* pNewSdrGraf = new SdrGrafObj( pPage->getSdrModelFromSdrPage(), diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 6dd9ecd839b5..277fe191505e 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -845,7 +845,7 @@ void HtmlExport::SetDocColors( SdPage* pPage ) /////////////////////////////////////////////////////////////////////// -void HtmlExport::InitProgress( sal_uInt16 nProgrCount ) +void HtmlExport::InitProgress( sal_uInt32 nProgrCount ) { String aStr(SdResId(STR_CREATE_PAGES)); mpProgress = new SfxProgress( mpDocSh, aStr, nProgrCount ); @@ -1240,13 +1240,13 @@ String HtmlExport::CreateTextForPage( SdrOutliner* pOutliner, sal_Int16 nActDepth = -1; String aParaText; - for (sal_uLong nPara = 0; nPara < nCount; nPara++) + for (sal_uInt16 nPara = 0; nPara < nCount; nPara++) { pPara = pOutliner->GetParagraph(nPara); if(pPara == 0) continue; - const sal_Int16 nDepth = (sal_uInt16) pOutliner->GetDepth( (sal_uInt16) nPara ); + const sal_Int16 nDepth = (sal_uInt16) pOutliner->GetDepth( nPara ); aParaText = ParagraphToHTMLString(pOutliner,nPara,rBackgroundColor); if(aParaText.Len() == 0) @@ -1331,8 +1331,8 @@ String HtmlExport::CreateTextForNotesPage( SdrOutliner* pOutliner, pOutliner->Clear(); pOutliner->SetText( *pOPO ); - sal_uLong nCount = pOutliner->GetParagraphCount(); - for (sal_uLong nPara = 0; nPara < nCount; nPara++) + sal_uInt16 nCount = pOutliner->GetParagraphCount(); + for (sal_uInt16 nPara = 0; nPara < nCount; nPara++) { aStr.AppendAscii("<p style=\""); aStr.Append( getParagraphStyle( pOutliner, nPara ) ); @@ -1642,14 +1642,14 @@ bool HtmlExport::CreateHtmlForPresPages() Rectangle aRect(sdr::legacy::GetBoundRect(*pObject)); Point aLogPos(aRect.TopLeft()); bool bIsSquare = aRect.GetWidth() == aRect.GetHeight(); - - sal_uLong nPageWidth = pPage->GetPageScale().getX() - pPage->GetLeftPageBorder() - pPage->GetRightPageBorder(); + const sal_Int32 nLeftPageBorder(basegfx::fround(pPage->GetLeftPageBorder())); + const sal_Int32 nTopPageBorder(basegfx::fround(pPage->GetTopPageBorder())); // das BoundRect bezieht sich auf den physikalischen // Seitenursprung, nicht auf den Koordinatenursprung - aRect.Move(-pPage->GetLeftPageBorder(), -pPage->GetTopPageBorder()); + aRect.Move(-nLeftPageBorder, -nTopPageBorder); - double fLogicToPixel = ((double)mnWidthPixel) / nPageWidth; + const double fLogicToPixel((double)mnWidthPixel / pPage->GetInnerPageScale().getX()); aRect.Left() = (long)(aRect.Left() * fLogicToPixel); aRect.Top() = (long)(aRect.Top() * fLogicToPixel); aRect.Right() = (long)(aRect.Right() * fLogicToPixel); @@ -1705,8 +1705,7 @@ bool HtmlExport::CreateHtmlForPresPages() GetRectangle(false)); // Umrechnung in Pixelkoordinaten - aArea.Move(aLogPos.X() - pPage->GetLeftPageBorder(), - aLogPos.Y() - pPage->GetTopPageBorder()); + aArea.Move(aLogPos.X() - nLeftPageBorder, aLogPos.Y() - nTopPageBorder); aArea.Left() = (long)(aArea.Left() * fLogicToPixel); aArea.Top() = (long)(aArea.Top() * fLogicToPixel); aArea.Right() = (long)(aArea.Right() * fLogicToPixel); @@ -1720,8 +1719,7 @@ bool HtmlExport::CreateHtmlForPresPages() { Point aCenter(((IMapCircleObject*)pArea)-> GetCenter(false)); - aCenter += Point(aLogPos.X() - pPage->GetLeftPageBorder(), - aLogPos.Y() - pPage->GetTopPageBorder()); + aCenter += Point(aLogPos.X() - nLeftPageBorder, aLogPos.Y() - nTopPageBorder); aCenter.X() = (long)(aCenter.X() * fLogicToPixel); aCenter.Y() = (long)(aCenter.Y() * fLogicToPixel); @@ -1738,7 +1736,11 @@ bool HtmlExport::CreateHtmlForPresPages() { Polygon aArea(((IMapPolygonObject*)pArea)->GetPolygon(false)); const basegfx::B2DPolyPolygon aPolyPolygon(aArea.getB2DPolygon()); - aStr += CreateHTMLPolygonArea(aPolyPolygon, Size(aLogPos.X() - pPage->GetLeftPageBorder(), aLogPos.Y() - pPage->GetTopPageBorder()), fLogicToPixel, aURL); + aStr += CreateHTMLPolygonArea( + aPolyPolygon, + Size(aLogPos.X() - nLeftPageBorder, aLogPos.Y() - nTopPageBorder), + fLogicToPixel, + aURL); } break; @@ -1846,7 +1848,11 @@ bool HtmlExport::CreateHtmlForPresPages() { const basegfx::B2DPolyPolygon aPolyPolygon(static_cast< SdrPathObj* >(pObject)->getB2DPolyPolygonInObjectCoordinates()); - aStr += CreateHTMLPolygonArea(aPolyPolygon, Size(-pPage->GetLeftPageBorder(), -pPage->GetTopPageBorder()), fLogicToPixel, aHRef); + aStr += CreateHTMLPolygonArea( + aPolyPolygon, + Size(-nLeftPageBorder, - nTopPageBorder), + fLogicToPixel, + aHRef); } // was anderes: das BoundRect nehmen else diff --git a/sd/source/filter/html/htmlex.hxx b/sd/source/filter/html/htmlex.hxx index 4f70e07ce2e6..8bfb9e3149e2 100644 --- a/sd/source/filter/html/htmlex.hxx +++ b/sd/source/filter/html/htmlex.hxx @@ -208,7 +208,7 @@ class HtmlExport bool CopyFile( const String& rSourceFile, const String& rDestPath ); bool CopyScript( const String& rPath, const String& rSource, const String& rDest, bool bUnix = false ); - void InitProgress( sal_uInt16 nProgrCount ); + void InitProgress( sal_uInt32 nProgrCount ); void ResetProgress(); String WriteMetaCharset() const; diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index ae493eb10c03..369c5d94d714 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -571,7 +571,7 @@ sal_Bool ImplSdPPTImport::Import() for ( sal_uInt32 nMasterNum = 0; nMasterNum < nMasterAnz; nMasterNum++ ) { - SetPageNum( nMasterNum, PPT_MASTERPAGE ); + SetPageNum( static_cast< sal_uInt16 >(nMasterNum), PPT_MASTERPAGE ); SdPage* pPage = (SdPage*)MakeBlancPage( true ); if ( pPage ) { @@ -733,7 +733,7 @@ sal_Bool ImplSdPPTImport::Import() sal_uInt32 i; for ( i = 0; i < mpDoc->GetMasterPageCount() && ( (pMPage = (SdPage*)mpDoc->GetMasterPage( i )) != 0 ); i++ ) { - SetPageNum( i, PPT_MASTERPAGE ); + SetPageNum( static_cast< sal_uInt16 >(i), PPT_MASTERPAGE ); ///////////////////////////////////////////// // importing master page objects // ///////////////////////////////////////////// @@ -1047,14 +1047,14 @@ sal_Bool ImplSdPPTImport::Import() pSdrModel->InsertPage( pPage ); // #i37397#, trying to set the title master for the first page - sal_uInt16 nMaster, nMasterCount = pSdrModel->GetMasterPageCount(); + sal_uInt32 nMaster, nMasterCount = pSdrModel->GetMasterPageCount(); SdPage* pFoundMaster = NULL; for ( nMaster = 1; nMaster < nMasterCount; nMaster++ ) { SdPage* pMaster = static_cast<SdPage*>( pSdrModel->GetMasterPage( nMaster ) ); if ( pMaster->GetPageKind() == PK_STANDARD ) { - SetPageNum( nMaster, PPT_MASTERPAGE ); + SetPageNum( static_cast< sal_uInt16 >(nMaster), PPT_MASTERPAGE ); if ( !pFoundMaster ) pFoundMaster = pMaster; else if ( GetSlideLayoutAtom()->eLayout == PPT_LAYOUT_TITLEMASTERSLIDE ) @@ -1088,7 +1088,7 @@ sal_Bool ImplSdPPTImport::Import() //////////////////// // set AutoLayout // //////////////////// - SetPageNum( i, PPT_SLIDEPAGE ); + SetPageNum( static_cast< sal_uInt16 >(i), PPT_SLIDEPAGE ); SdPage* pPage = mpDoc->GetSdPage( i, PK_STANDARD ); AutoLayout eAutoLayout = AUTOLAYOUT_NONE; const PptSlideLayoutAtom* pSlideLayout = GetSlideLayoutAtom(); @@ -2396,10 +2396,10 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj break; } } -// [Bug 119962] Placeholder in ppt file created by MS 2007 is lost if load in Impress
- unsigned int nParaCount = pTextObj->Count();
- PPTParagraphObj *pFirstPara = nParaCount == 0 ? NULL : pTextObj->First();
- unsigned int nFirstParaTextcount = pFirstPara == NULL ? 0 : pFirstPara->GetTextSize();
+// [Bug 119962] Placeholder in ppt file created by MS 2007 is lost if load in Impress + unsigned int nParaCount = pTextObj->Count(); + PPTParagraphObj *pFirstPara = nParaCount == 0 ? NULL : pTextObj->First(); + unsigned int nFirstParaTextcount = pFirstPara == NULL ? 0 : pFirstPara->GetTextSize(); if ( i < 8 || (nParaCount == 1 && nFirstParaTextcount == 0 || nParaCount == 0)) { PresObjKind ePresObjKind = PRESOBJ_NONE; diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx index 373c92e6a06b..5a3fb1b5cfc7 100644 --- a/sd/source/filter/xml/sdtransform.cxx +++ b/sd/source/filter/xml/sdtransform.cxx @@ -107,8 +107,8 @@ void SdTransformOOo2xDocument::transform() void SdTransformOOo2xDocument::transformMasterPages() { - sal_uInt16 nMasterPageCount = mrDocument.GetMasterPageCount(); - for( sal_uInt16 nMasterPage = 0; nMasterPage < nMasterPageCount; nMasterPage++ ) + sal_uInt32 nMasterPageCount = mrDocument.GetMasterPageCount(); + for( sal_uInt32 nMasterPage = 0; nMasterPage < nMasterPageCount; nMasterPage++ ) { SdrObjList* pPage = mrDocument.GetMasterPage( nMasterPage ); if( pPage ) @@ -118,8 +118,8 @@ void SdTransformOOo2xDocument::transformMasterPages() void SdTransformOOo2xDocument::transformDrawPages() { - sal_uInt16 nPageCount = mrDocument.GetPageCount(); - for( sal_uInt16 nPage = 0; nPage < nPageCount; nPage++ ) + sal_uInt32 nPageCount = mrDocument.GetPageCount(); + for( sal_uInt32 nPage = 0; nPage < nPageCount; nPage++ ) { SdrObjList* pPage = mrDocument.GetPage( nPage ); if( pPage ) diff --git a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx index 351d8f20aec9..1a34101bb8a8 100644 --- a/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx +++ b/sd/source/ui/accessibility/AccessibleSlideSorterObject.cxx @@ -58,7 +58,7 @@ namespace accessibility { AccessibleSlideSorterObject::AccessibleSlideSorterObject( const Reference<XAccessible>& rxParent, ::sd::slidesorter::SlideSorter& rSlideSorter, - sal_uInt16 nPageNumber) + sal_uInt32 nPageNumber) : AccessibleSlideSorterObjectBase(::sd::MutexOwner::maMutex), mxParent(rxParent), mnPageNumber(nPageNumber), @@ -79,7 +79,7 @@ AccessibleSlideSorterObject::~AccessibleSlideSorterObject (void) -sal_uInt16 AccessibleSlideSorterObject::GetPageNumber (void) const +sal_uInt32 AccessibleSlideSorterObject::GetPageNumber (void) const { return mnPageNumber; } @@ -265,7 +265,7 @@ Reference<XAccessibleStateSet> SAL_CALL // Conditional states. if (mrSlideSorter.GetController().GetPageSelector().IsPageSelected(mnPageNumber)) pStateSet->AddState(AccessibleStateType::SELECTED); - if (mrSlideSorter.GetController().GetFocusManager().GetFocusedPageIndex() == mnPageNumber) + if (mrSlideSorter.GetController().GetFocusManager().GetFocusedPageIndex() == static_cast< sal_Int32 >(mnPageNumber)) if (mrSlideSorter.GetController().GetFocusManager().IsFocusShowing()) pStateSet->AddState(AccessibleStateType::FOCUSED); } diff --git a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx index 3848251a5d01..de479dc9b288 100644 --- a/sd/source/ui/animations/CustomAnimationCreateDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationCreateDialog.cxx @@ -557,11 +557,11 @@ CustomAnimationCreateDialog::CustomAnimationCreateDialog( Window* pParent, Custo // select current preset if available if( rsPresetId.getLength() != 0 ) { - for( sal_uInt16 i = ENTRANCE; i <= MOTIONPATH; i++ ) + for( sal_uInt32 i = ENTRANCE; i <= MOTIONPATH; i++ ) { if( mpTabPages[i]->select( rsPresetId ) ) { - mpTabControl->SetCurPageId( RID_TP_CUSTOMANIMATION_ENTRANCE + i ); + mpTabControl->SetCurPageId( static_cast< sal_uInt16 >(RID_TP_CUSTOMANIMATION_ENTRANCE + i )); break; } } diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index b46a51a45e2d..eadf9016e972 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -1213,7 +1213,7 @@ IMPL_LINK( SlideTransitionPane, ApplyToAllButtonClicked, void *, EMPTYARG ) ::sd::slidesorter::SharedPageSelection pPages ( new ::sd::slidesorter::SlideSorterViewShell::PageSelection()); - sal_uInt16 nPageCount = mpDrawDoc->GetSdPageCount( PK_STANDARD ); + sal_uInt32 nPageCount = mpDrawDoc->GetSdPageCount( PK_STANDARD ); pPages->reserve( nPageCount ); for( sal_uInt32 i=0; i<nPageCount; ++i ) { diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx index 77656c29b707..f5346d3de622 100644 --- a/sd/source/ui/animations/motionpathtag.cxx +++ b/sd/source/ui/animations/motionpathtag.cxx @@ -453,12 +453,13 @@ void MotionPathTag::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) // -------------------------------------------------------------------- -void MotionPathTag::MovePath( int nDX, int nDY ) +void MotionPathTag::MovePath( double fDX, double fDY ) { - if( mpPathObj ) + if(mpPathObj) { - sdr::legacy::MoveSdrObject(*mpPathObj, Size( nDX, nDY ) ); - mrView.SetMarkHandles(); + mpPathObj->setSdrObjectTransformation(basegfx::tools::createTranslateB2DHomMatrix(fDX, fDY) * mpPathObj->getSdrObjectTransformation()); + // sdr::legacy::MoveSdrObject(*mpPathObj, Size( nDX, nDY ) ); + mrView.SetMarkHandles(); // TTTT: Neded? } } @@ -717,33 +718,33 @@ bool MotionPathTag::OnMarkHandle( const KeyEvent& rKEvt ) bool MotionPathTag::OnMove( const KeyEvent& rKEvt ) { - long nX = 0; - long nY = 0; + double fX = 0.0; + double fY = 0.0; switch( rKEvt.GetKeyCode().GetCode() ) { - case KEY_UP: nY = -1; break; - case KEY_DOWN: nY = 1; break; - case KEY_LEFT: nX = -1; break; - case KEY_RIGHT: nX = 1; break; - default: break; + case KEY_UP: fY = -1.0; break; + case KEY_DOWN: fY = 1.0; break; + case KEY_LEFT: fX = -1.0; break; + case KEY_RIGHT: fX = 1.0; break; + default: break; } if(rKEvt.GetKeyCode().IsMod2()) { OutputDevice* pOut = mrView.GetViewShell()->GetActiveWindow(); Size aLogicSizeOnePixel = (pOut) ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100); - nX *= aLogicSizeOnePixel.Width(); - nY *= aLogicSizeOnePixel.Height(); + fX *= aLogicSizeOnePixel.Width(); + fY *= aLogicSizeOnePixel.Height(); } else { // old, fixed move distance - nX *= 100; - nY *= 100; + fX *= 100.0; + fY *= 100.0; } - if( nX || nY ) + if( !basegfx::fTools::equalZero(fX) || !basegfx::fTools::equalZero(fY) ) { // in point edit mode move the handle with the focus const SdrHdlList& rHdlList = mrView.GetHdlList(); @@ -751,9 +752,9 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt ) if(pHdl) { - // now move the Handle (nX, nY) + // now move the Handle (fX, fY) const basegfx::B2DPoint aStartPoint(pHdl->getPosition()); - const basegfx::B2DPoint aEndPoint(aStartPoint + basegfx::B2DPoint(nX, nY)); + const basegfx::B2DPoint aEndPoint(aStartPoint + basegfx::B2DPoint(fX, fY)); // start dragging rtl::Reference< MotionPathTag > xTag( this ); @@ -797,7 +798,7 @@ bool MotionPathTag::OnMove( const KeyEvent& rKEvt ) else { // move the path - MovePath( nX, nY ); + MovePath( fX, fY ); } } diff --git a/sd/source/ui/animations/motionpathtag.hxx b/sd/source/ui/animations/motionpathtag.hxx index df70f49b211d..10a853ba45d0 100644 --- a/sd/source/ui/animations/motionpathtag.hxx +++ b/sd/source/ui/animations/motionpathtag.hxx @@ -89,7 +89,7 @@ public: virtual bool IsOpenCloseMarkedObjectsPossible() const; virtual SdrObjClosedKind GetMarkedObjectsClosedState() const; - void MovePath( int nDX, int nDY ); + void MovePath( double fDX, double fDY ); bool OnDelete(); bool OnTabHandles( const KeyEvent& rKEvt ); bool OnMarkHandle( const KeyEvent& rKEvt ); diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 692e2f783069..b969427341a1 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -381,7 +381,7 @@ void AnnotationManagerImpl::InsertAnnotation() AnnotationVector aAnnotations( pPage->getAnnotations() ); if( !aAnnotations.empty() ) { - const int page_width = pPage->GetPageScale().getX(); + const int page_width = basegfx::fround(pPage->GetPageScale().getX()); const int width = 1000; const int height = 800; Rectangle aTagRect; @@ -1209,7 +1209,7 @@ SdPage* AnnotationManagerImpl::GetNextPage( SdPage* pPage, bool bForeward ) } else { - if( nPageNum == (mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) ? 0 : 1 ) + if( nPageNum == sal_uInt32(mpDoc->GetDocumentType() == DOCUMENT_TYPE_IMPRESS) ? 0 : 1 ) { // we reached beginning of master pages, start with end if pages return mpDoc->GetSdPage( mpDoc->GetSdPageCount(PK_STANDARD)-1, PK_STANDARD ); diff --git a/sd/source/ui/annotations/annotationtag.cxx b/sd/source/ui/annotations/annotationtag.cxx index fea4fc236833..dad652385de5 100644 --- a/sd/source/ui/annotations/annotationtag.cxx +++ b/sd/source/ui/annotations/annotationtag.cxx @@ -422,7 +422,7 @@ bool AnnotationTag::Command( const CommandEvent& rCEvt ) return false; } -void AnnotationTag::Move( int nDX, int nDY ) +void AnnotationTag::Move( double fDX, double fDY ) { if( mxAnnotation.is() ) { @@ -430,8 +430,8 @@ void AnnotationTag::Move( int nDX, int nDY ) mrManager.GetDoc()->BegUndo( String( SdResId( STR_ANNOTATION_UNDO_MOVE ) ) ); RealPoint2D aPosition( mxAnnotation->getPosition() ); - aPosition.X += (double)nDX / 100.0; - aPosition.Y += (double)nDY / 100.0; + aPosition.X += fDX / 100.0; + aPosition.Y += fDY / 100.0; mxAnnotation->setPosition( aPosition ); if( mrManager.GetDoc()->IsUndoEnabled() ) @@ -443,15 +443,15 @@ void AnnotationTag::Move( int nDX, int nDY ) bool AnnotationTag::OnMove( const KeyEvent& rKEvt ) { - long nX = 0; - long nY = 0; + double fX = 0.0; + double fY = 0.0; switch( rKEvt.GetKeyCode().GetCode() ) { - case KEY_UP: nY = -1; break; - case KEY_DOWN: nY = 1; break; - case KEY_LEFT: nX = -1; break; - case KEY_RIGHT: nX = 1; break; + case KEY_UP: fY = -1.0; break; + case KEY_DOWN: fY = 1.0; break; + case KEY_LEFT: fX = -1.0; break; + case KEY_RIGHT: fX = 1.0; break; default: break; } @@ -459,20 +459,20 @@ bool AnnotationTag::OnMove( const KeyEvent& rKEvt ) { OutputDevice* pOut = mrView.GetViewShell()->GetActiveWindow(); Size aLogicSizeOnePixel = (pOut) ? pOut->PixelToLogic(Size(1,1)) : Size(100, 100); - nX *= aLogicSizeOnePixel.Width(); - nY *= aLogicSizeOnePixel.Height(); + fX *= aLogicSizeOnePixel.Width(); + fY *= aLogicSizeOnePixel.Height(); } else { // old, fixed move distance - nX *= 100; - nY *= 100; + fX *= 100.0; + fY *= 100.0; } - if( nX || nY ) + if( !basegfx::fTools::equalZero(fX) || !basegfx::fTools::equalZero(fY) ) { // move the annotation - Move( nX, nY ); + Move( fX, fY ); } return true; diff --git a/sd/source/ui/annotations/annotationtag.hxx b/sd/source/ui/annotations/annotationtag.hxx index 2a3d7c885574..6aa4d98b1bf5 100644 --- a/sd/source/ui/annotations/annotationtag.hxx +++ b/sd/source/ui/annotations/annotationtag.hxx @@ -62,7 +62,7 @@ public: virtual void CheckPossibilities(); virtual bool MarkPoints(const basegfx::B2DRange* pRange, bool bUnmark); - void Move( int nDX, int nDY ); + void Move( double fDX, double fDY ); bool OnMove( const KeyEvent& rKEvt ); // --- diff --git a/sd/source/ui/app/tmplctrl.cxx b/sd/source/ui/app/tmplctrl.cxx index 455fc1f0670d..61876ba19c1b 100644 --- a/sd/source/ui/app/tmplctrl.cxx +++ b/sd/source/ui/app/tmplctrl.cxx @@ -135,7 +135,7 @@ void SdTemplateControl::Command( const CommandEvent& rCEvt ) { const sal_uInt32 nMasterCount = pDoc->GetMasterSdPageCount(PK_STANDARD); - sal_uInt32 nCount = 0; + sal_uInt16 nCount = 0; for( sal_uInt32 nPage = 0; nPage < nMasterCount; ++nPage ) { SdPage* pMaster = pDoc->GetMasterSdPage(nPage, PK_STANDARD); diff --git a/sd/source/ui/dlg/dlgassim.cxx b/sd/source/ui/dlg/dlgassim.cxx index b881977d9ee1..f8e6b02a20e0 100644 --- a/sd/source/ui/dlg/dlgassim.cxx +++ b/sd/source/ui/dlg/dlgassim.cxx @@ -112,8 +112,8 @@ void SdPageListControl::Fill( SdDrawDocument* pDoc ) { Outliner* pOutliner = pDoc->GetInternalOutliner(); - sal_uInt16 nPage = 0; - const sal_uInt16 nMaxPages = pDoc->GetPageCount(); + sal_uInt32 nPage = 0; + const sal_uInt32 nMaxPages = pDoc->GetPageCount(); while( nPage < nMaxPages ) { SdPage* pPage = (SdPage*) pDoc->GetPage( nPage ); @@ -153,7 +153,7 @@ void SdPageListControl::Fill( SdDrawDocument* pDoc ) for (sal_uLong nPara = 0; nPara < nCount; nPara++) { pPara = pOutliner->GetParagraph(nPara); - if(pPara && pOutliner->GetDepth( (sal_uInt16) nPara ) == 0 ) + if(pPara && pOutliner->GetDepth( nPara ) == 0 ) { String aParaText = pOutliner->GetText(pPara); if(aParaText.Len() != 0) diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index 015059cf20df..2341d3f4d7b0 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -244,10 +244,9 @@ void SdDocPreviewWin::updateViewSettings() pView->SetPageVisible( false ); pView->ShowSdrPage( *pPage ); - const Point aNewOrg( pPage->GetLeftPageBorder(), pPage->GetTopPageBorder() ); + const Point aNewOrg(basegfx::fround(pPage->GetLeftPageBorder()), basegfx::fround(pPage->GetTopPageBorder())); const Size aSize(basegfx::fround(pPage->GetPageScale().getX()), basegfx::fround(pPage->GetPageScale().getY())); - const Size aNewSize( aSize.Width() - pPage->GetLeftPageBorder() - pPage->GetRightPageBorder(), - aSize.Height() - pPage->GetTopPageBorder() - pPage->GetBottomPageBorder() ); + const Size aNewSize(basegfx::fround(pPage->GetInnerPageScale().getX()), basegfx::fround(pPage->GetInnerPageScale().getY())); const Rectangle aClipRect( aNewOrg, aNewSize ); MapMode aVMap( aMap ); @@ -256,11 +255,11 @@ void SdDocPreviewWin::updateViewSettings() aVDev.SetRelativeMapMode( aVMap ); aVDev.IntersectClipRegion( aClipRect ); - // Use new StandardCheckVisisbilityRedirector - StandardCheckVisisbilityRedirector aRedirector; - const Rectangle aRedrawRectangle = Rectangle( Point(), aNewSize ); - Region aRedrawRegion(aRedrawRectangle); - pView->SdrPaintView::CompleteRedraw(&aVDev,aRedrawRegion,&aRedirector); + // Use new StandardCheckVisisbilityRedirector + StandardCheckVisisbilityRedirector aRedirector; + const Rectangle aRedrawRectangle = Rectangle( Point(), aNewSize ); + Region aRedrawRegion(aRedrawRectangle); + pView->SdrPaintView::CompleteRedraw(&aVDev,aRedrawRegion,&aRedirector); aVDev.Pop(); diff --git a/sd/source/ui/dlg/present.cxx b/sd/source/ui/dlg/present.cxx index c31da4e59f85..6eb8527ae6e4 100644 --- a/sd/source/ui/dlg/present.cxx +++ b/sd/source/ui/dlg/present.cxx @@ -230,7 +230,7 @@ void SdStartPresentationDlg::InitMonitorSettings() // Store display index together with name. const sal_uInt32 nEntryIndex (maLBMonitor.GetEntryCount()-1); - maLBMonitor.SetEntryData(nEntryIndex, (void*)nDisplay); + maLBMonitor.SetEntryData(static_cast< sal_uInt16 >(nEntryIndex), (void*)nDisplay); // Remember the index of the default selection. if (nDefaultSelectedDisplay == nDisplay) @@ -245,7 +245,7 @@ void SdStartPresentationDlg::InitMonitorSettings() { maLBMonitor.InsertEntry( msAllMonitors ); const sal_uInt32 nEntryIndex (maLBMonitor.GetEntryCount()-1); - maLBMonitor.SetEntryData(nEntryIndex, (void*)-1); + maLBMonitor.SetEntryData(static_cast< sal_uInt16 >(nEntryIndex), (void*)-1); if (nDefaultSelectedDisplay == -1) nSelectedIndex = nEntryIndex; } diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index e578aa38277f..3233fac026bf 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -73,7 +73,7 @@ SdPresLayoutDlg::SdPresLayoutDlg( { FreeResource(); - mpLayoutNames = new List; + //mpLayoutNames = new List; maVS.SetDoubleClickHdl(LINK(this, SdPresLayoutDlg, ClickLayoutHdl)); maBtnLoad.SetClickHdl(LINK(this, SdPresLayoutDlg, ClickLoadHdl)); @@ -89,14 +89,14 @@ SdPresLayoutDlg::SdPresLayoutDlg( SdPresLayoutDlg::~SdPresLayoutDlg() { - String* pName = (String*)mpLayoutNames->First(); - while (pName) - { - delete pName; - pName = (String*)mpLayoutNames->Next(); - } - - delete mpLayoutNames; + //String* pName = (String*)mpLayoutNames->First(); + //while (pName) + //{ + // delete pName; + // pName = (String*)mpLayoutNames->Next(); + //} + // + //delete mpLayoutNames; } /************************************************************************* @@ -108,7 +108,7 @@ SdPresLayoutDlg::~SdPresLayoutDlg() void SdPresLayoutDlg::Reset() { const SfxPoolItem *pPoolItem = NULL; - long nName; + sal_uInt32 nName(0); // MasterPage austauschen if( mrOutAttrs.GetItemState( ATTR_PRESLAYOUT_MASTER_PAGE, false, &pPoolItem ) == SFX_ITEM_SET ) @@ -128,15 +128,16 @@ void SdPresLayoutDlg::Reset() FillValueSet(); - mnLayoutCount = mpLayoutNames->Count(); + mnLayoutCount = maLayoutNames.size(); for( nName = 0; nName < mnLayoutCount; nName++ ) { - if (*((String*)mpLayoutNames->GetObject(nName)) == maName) + if(maLayoutNames[nName] == maName) + //if (*((String*)mpLayoutNames->GetObject(nName)) == maName) break; } DBG_ASSERT(nName < mnLayoutCount, "Layout nicht gefunden"); - maVS.SelectItem((sal_uInt16)nName + 1); // Inizes des ValueSets beginnen bei 1 + maVS.SelectItem(static_cast< sal_uInt16 >(nName + 1)); // Inizes des ValueSets beginnen bei 1 } @@ -158,11 +159,13 @@ void SdPresLayoutDlg::GetAttr(SfxItemSet& rOutAttrs) { aLayoutName = maName; aLayoutName.Append( DOCUMENT_TOKEN ); - aLayoutName.Append( *(String*)mpLayoutNames->GetObject( nId - 1 ) ); + //aLayoutName.Append( *(String*)mpLayoutNames->GetObject( nId - 1 ) ); + aLayoutName.Append(maLayoutNames[nId - 1]); } else { - aLayoutName = *(String*)mpLayoutNames->GetObject( nId - 1 ); + //aLayoutName = *(String*)mpLayoutNames->GetObject( nId - 1 ); + aLayoutName = maLayoutNames[nId - 1]; if( aLayoutName == maStrNone ) aLayoutName.Erase(); // so wird "- keine -" codiert (s.u.) } @@ -190,19 +193,21 @@ void SdPresLayoutDlg::FillValueSet() SdDrawDocument* pDoc = mpDocSh->GetDoc(); - sal_uInt16 nCount = pDoc->GetMasterPageCount(); + sal_uInt32 nCount = pDoc->GetMasterPageCount(); - for (sal_uInt16 nLayout = 0; nLayout < nCount; nLayout++) + for (sal_uInt32 nLayout = 0; nLayout < nCount; nLayout++) { SdPage* pMaster = (SdPage*)pDoc->GetMasterPage(nLayout); if (pMaster->GetPageKind() == PK_STANDARD) { String aLayoutName(pMaster->GetLayoutName()); aLayoutName.Erase( aLayoutName.SearchAscii( SD_LT_SEPARATOR ) ); - mpLayoutNames->Insert(new String(aLayoutName), LIST_APPEND); + maLayoutNames.push_back(aLayoutName); + //mpLayoutNames->Insert(new String(aLayoutName), LIST_APPEND); Bitmap aBitmap(mpDocSh->GetPagePreviewBitmap(pMaster, 90)); - maVS.InsertItem((sal_uInt16)mpLayoutNames->Count(), aBitmap, aLayoutName); + //maVS.InsertItem(mpLayoutNames->Count(), aBitmap, aLayoutName); + maVS.InsertItem(maLayoutNames.size(), aBitmap, aLayoutName); } } @@ -273,24 +278,38 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) if( !bCancel ) { // Pruefen, ob Vorlage schon vorhanden + // TTTT: check if this works and if yes, cleanup mpLayoutNames + bool bExists = false; - String* pName = (String*)mpLayoutNames->First(); + //String* pName = (String*)mpLayoutNames->First(); String aCompareStr( maName ); if( maName.Len() == 0 ) aCompareStr = maStrNone; - while( pName && !bExists ) + for(sal_uInt32 a(0); !bExists && a < maLayoutNames.size(); a++) { - if( aCompareStr == *pName ) + if(aCompareStr == maLayoutNames[a]) { bExists = true; - // Vorlage selektieren - sal_uInt16 nId = (sal_uInt16) mpLayoutNames->GetCurPos() + 1; - maVS.SelectItem( nId ); + + // select template + // const sal_uInt16 nId(static_cast< sal_uInt16 >(a + 1); + maVS.SelectItem(static_cast< sal_uInt16 >(a + 1)); } - pName = (String*)mpLayoutNames->Next(); } + //while( pName && !bExists ) + //{ + // if( aCompareStr == *pName ) + // { + // bExists = true; + // // Vorlage selektieren + // sal_uInt16 nId = (sal_uInt16) mpLayoutNames->GetCurPos() + 1; + // maVS.SelectItem( nId ); + // } + // pName = (String*)mpLayoutNames->Next(); + //} + if( !bExists ) { // Dokument laden um Preview-Bitmap zu ermitteln (wenn Vorlage ausgewaehlt) @@ -310,19 +329,21 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) Bitmap aBitmap( pTemplDocSh->GetPagePreviewBitmap( pMaster, 90 ) ); maVS.InsertItem( (sal_uInt16) mpLayoutNames->Count(), aBitmap, maName); */ - sal_uInt16 nCount = pTemplDoc->GetMasterPageCount(); + sal_uInt32 nCount = pTemplDoc->GetMasterPageCount(); - for (sal_uInt16 nLayout = 0; nLayout < nCount; nLayout++) + for (sal_uInt32 nLayout = 0; nLayout < nCount; nLayout++) { SdPage* pMaster = (SdPage*) pTemplDoc->GetMasterPage(nLayout); if (pMaster->GetPageKind() == PK_STANDARD) { String aLayoutName(pMaster->GetLayoutName()); aLayoutName.Erase( aLayoutName.SearchAscii( SD_LT_SEPARATOR ) ); - mpLayoutNames->Insert(new String(aLayoutName), LIST_APPEND); + //mpLayoutNames->Insert(new String(aLayoutName), LIST_APPEND); + maLayoutNames.push_back(aLayoutName); Bitmap aBitmap(pTemplDocSh->GetPagePreviewBitmap(pMaster, 90)); - maVS.InsertItem((sal_uInt16)mpLayoutNames->Count(), aBitmap, aLayoutName); + //maVS.InsertItem(mpLayoutNames->Count(), aBitmap, aLayoutName); + maVS.InsertItem(maLayoutNames.size(), aBitmap, aLayoutName); } } } @@ -336,15 +357,18 @@ IMPL_LINK(SdPresLayoutDlg, ClickLoadHdl, void *, EMPTYARG) else { // leeres Layout - mpLayoutNames->Insert( new String( maStrNone ), LIST_APPEND ); - maVS.InsertItem( (sal_uInt16) mpLayoutNames->Count(), - Bitmap( SdResId( BMP_FOIL_NONE ) ), maStrNone ); + //mpLayoutNames->Insert( new String( maStrNone ), LIST_APPEND ); + maLayoutNames.push_back(maStrNone); + //maVS.InsertItem( (sal_uInt16) mpLayoutNames->Count(), + // Bitmap( SdResId( BMP_FOIL_NONE ) ), maStrNone ); + maVS.InsertItem(maLayoutNames.size(), Bitmap( SdResId( BMP_FOIL_NONE ) ), maStrNone ); } if (!bCancel) { // Vorlage selektieren - maVS.SelectItem( (sal_uInt16) mpLayoutNames->Count() ); + //maVS.SelectItem( (sal_uInt16) mpLayoutNames->Count() ); + maVS.SelectItem(static_cast< sal_uInt16 >(maLayoutNames.size())); } } } diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 51fa3f567f4a..c8cdf819bd22 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -416,7 +416,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, bool bAllPages, const St // first insert all pages including objects sal_uInt16 nPage = 0; - const sal_uInt16 nMaxPages = mpDoc->GetPageCount(); + const sal_uInt32 nMaxPages = mpDoc->GetPageCount(); while( nPage < nMaxPages ) { @@ -437,7 +437,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, bool bAllPages, const St if( mbShowAllPages ) { nPage = 0; - const sal_uInt16 nMaxMasterPages = mpDoc->GetMasterPageCount(); + const sal_uInt32 nMaxMasterPages = mpDoc->GetMasterPageCount(); while( nPage < nMaxMasterPages ) { @@ -645,7 +645,7 @@ bool SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc ) // Alle Pages incl. Objekte vergleichen sal_uInt16 nPage = 0; - const sal_uInt16 nMaxPages = mpDoc->GetPageCount(); + const sal_uInt32 nMaxPages = mpDoc->GetPageCount(); while( nPage < nMaxPages ) { @@ -760,7 +760,7 @@ void SdPageObjsTLB::RequestingChilds( SvLBoxEntry* pFileEntry ) // only insert all "normal" ? slides with objects sal_uInt16 nPage = 0; - const sal_uInt16 nMaxPages = mpBookmarkDoc->GetPageCount(); + const sal_uInt32 nMaxPages = mpBookmarkDoc->GetPageCount(); while( nPage < nMaxPages ) { diff --git a/sd/source/ui/docshell/docshel2.cxx b/sd/source/ui/docshell/docshel2.cxx index 0e49e7ed9e50..85214719ba02 100644 --- a/sd/source/ui/docshell/docshel2.cxx +++ b/sd/source/ui/docshell/docshel2.cxx @@ -238,6 +238,11 @@ FrameView* DrawDocShell::GetFrameView() return(pFrameView); } +sd::ViewShell* DrawDocShell::GetViewShell() +{ + return mpViewShell; +} + /************************************************************************* |* |* Groesse der ersten Seite zurueckgeben diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index d729b5eeeda4..022573ca85c4 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -879,7 +879,7 @@ bool DrawDocShell::GotoBookmark(const String& rBookmark) // by using the API because this takes care of all the // little things to be done. Especially writing the view // data to the frame view (see bug #107803#). - sal_uInt16 nSdPgNum = (nPageNumber - 1) / 2; + sal_uInt32 nSdPgNum = (nPageNumber - 1) / 2; Reference<drawing::XDrawView> xController (rBase.GetController(), UNO_QUERY); if (xController.is()) { diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx index 3bb93aa86058..a6539f7769ea 100644 --- a/sd/source/ui/framework/module/ModuleController.cxx +++ b/sd/source/ui/framework/module/ModuleController.cxx @@ -312,7 +312,7 @@ void SAL_CALL ModuleController::requestResource (const OUString& rsResourceURL) iFactory->second, aArguments); } - catch(Exception&e) + catch(Exception& /*e*/) { OSL_TRACE("caught exception while creating factory."); } diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx index 0a6ce326df59..ca6d051edd2c 100644 --- a/sd/source/ui/func/fuconbez.cxx +++ b/sd/source/ui/func/fuconbez.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sd.hxx" @@ -39,7 +37,6 @@ #include <svx/svdlegacy.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> - #include "app.hrc" #include "ViewShell.hxx" #include "ViewShellBase.hxx" @@ -49,6 +46,7 @@ #include "drawdoc.hxx" #include "res_bmp.hrc" #include "CustomAnimationEffect.hxx" +#include <svx/sdrobjecttools.hxx> using namespace ::com::sun::star::uno; @@ -391,144 +389,191 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c // case SID_DRAW_BEZIER_FILL: // BASIC // case SID_DRAW_BEZIER_NOFILL: // BASIC - SdrObject* pObj = SdrObjFactory::MakeNewObject( - mpView->getSdrModelFromSdrView(), - mpView->getSdrObjectCreationInfo()); + SdrPathObj* pObj = dynamic_cast< SdrPathObj* >( + SdrObjFactory::MakeNewObject( + mpView->getSdrModelFromSdrView(), + mpView->getSdrObjectCreationInfo())); if(pObj) { - SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj); + DefaultSdrPathObjType eType(DefaultSdrPathObjType_Line); + bool bClosed(false); - if(pSdrPathObj) + switch(nID) { - basegfx::B2DPolyPolygon aPoly; - - switch(nID) - { - case SID_DRAW_BEZIER_FILL: - { - const double fWdt(rRange.getWidth() * 0.5); - const double fHgt(rRange.getHeight() * 0.5); - const basegfx::B2DPolygon aInnerPoly(basegfx::tools::createPolygonFromEllipse(rRange.getCenter(), fWdt, fHgt)); - - aPoly.append(aInnerPoly); - break; - } - case SID_DRAW_BEZIER_NOFILL: - { - basegfx::B2DPolygon aInnerPoly; - - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - - const basegfx::B2DPoint aCenterBottom(rRange.getCenterX(), rRange.getMaxY()); - aInnerPoly.appendBezierSegment( - aCenterBottom, - aCenterBottom, - rRange.getCenter()); - - const basegfx::B2DPoint aCenterTop(rRange.getCenterX(), rRange.getMinY()); - aInnerPoly.appendBezierSegment( - aCenterTop, - aCenterTop, - basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); - - aPoly.append(aInnerPoly); - break; - } - case SID_DRAW_FREELINE: - case SID_DRAW_FREELINE_NOFILL: - { - basegfx::B2DPolygon aInnerPoly; - - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - - aInnerPoly.appendBezierSegment( - rRange.getMinimum(), - basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY()), - rRange.getCenter()); - - aInnerPoly.appendBezierSegment( - basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()), - rRange.getMaximum(), - basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); - - if(SID_DRAW_FREELINE == nID) - { - aInnerPoly.append(rRange.getMaximum()); - } - else - { - aInnerPoly.setClosed(true); - } - - aPoly.append(aInnerPoly); - break; - } - case SID_DRAW_XPOLYGON: - case SID_DRAW_XPOLYGON_NOFILL: - { - basegfx::B2DPolygon aInnerPoly; - - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - aInnerPoly.append(rRange.getMinimum()); - aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY())); - aInnerPoly.append(rRange.getCenter()); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxX(), rRange.getCenterY())); - aInnerPoly.append(rRange.getMaximum()); - - if(SID_DRAW_XPOLYGON_NOFILL == nID) - { - aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY())); - } - else - { - aInnerPoly.setClosed(true); - } - - aPoly.append(aInnerPoly); - break; - } - case SID_DRAW_POLYGON: - case SID_DRAW_POLYGON_NOFILL: - { - basegfx::B2DPolygon aInnerPoly; - const double fWdt(rRange.getWidth()); - const double fHgt(rRange.getHeight()); - - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.3, rRange.getMinY() + fHgt * 0.7)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY() + fHgt * 0.15)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.65, rRange.getMinY())); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt, rRange.getMinY() + fHgt * 0.3)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.5)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 075)); - aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxY(), rRange.getMaxX())); - - if(SID_DRAW_POLYGON_NOFILL == nID) - { - aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY())); - } - else - { - aInnerPoly.setClosed(true); - } - - aPoly.append(aInnerPoly); - break; - } - } - - pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(aPoly); - } - else - { - DBG_ERROR("Object is NO path object"); + case SID_DRAW_BEZIER_FILL: + eType = DefaultSdrPathObjType_BezierFill; + bClosed = true; + break; + case SID_DRAW_BEZIER_NOFILL: + eType = DefaultSdrPathObjType_Bezier; + break; + case SID_DRAW_FREELINE: + eType = DefaultSdrPathObjType_Freeline; + bClosed = true; + break; + case SID_DRAW_FREELINE_NOFILL: + eType = DefaultSdrPathObjType_Freeline; + break; + case SID_DRAW_XPOLYGON: + eType = DefaultSdrPathObjType_XPolygon; + bClosed = true; + break; + case SID_DRAW_XPOLYGON_NOFILL: + eType = DefaultSdrPathObjType_XPolygon; + break; + case SID_DRAW_POLYGON: + eType = DefaultSdrPathObjType_Polygon; + bClosed = true; + break; + case SID_DRAW_POLYGON_NOFILL: + eType = DefaultSdrPathObjType_Polygon; + break; } - sdr::legacy::SetLogicRange(*pObj, rRange); + initializeDefaultSdrPathObjByObjectType(*pObj, eType, rRange, bClosed); + } + else + { + DBG_ERROR("Object is NO path object"); } return pObj; + + // TTTT + //{ + // SdrPathObj* pSdrPathObj = dynamic_cast< SdrPathObj* >(pObj); + // + // if(pSdrPathObj) + // { + // basegfx::B2DPolyPolygon aPoly; + // + // switch(nID) + // { + // case SID_DRAW_BEZIER_FILL: + // { + // const double fWdt(rRange.getWidth() * 0.5); + // const double fHgt(rRange.getHeight() * 0.5); + // const basegfx::B2DPolygon aInnerPoly(basegfx::tools::createPolygonFromEllipse(rRange.getCenter(), fWdt, fHgt)); + // + // aPoly.append(aInnerPoly); + // break; + // } + // case SID_DRAW_BEZIER_NOFILL: + // { + // basegfx::B2DPolygon aInnerPoly; + // + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); + // + // const basegfx::B2DPoint aCenterBottom(rRange.getCenterX(), rRange.getMaxY()); + // aInnerPoly.appendBezierSegment( + // aCenterBottom, + // aCenterBottom, + // rRange.getCenter()); + // + // const basegfx::B2DPoint aCenterTop(rRange.getCenterX(), rRange.getMinY()); + // aInnerPoly.appendBezierSegment( + // aCenterTop, + // aCenterTop, + // basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); + // + // aPoly.append(aInnerPoly); + // break; + // } + // case SID_DRAW_FREELINE: + // case SID_DRAW_FREELINE_NOFILL: + // { + // basegfx::B2DPolygon aInnerPoly; + // + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); + // + // aInnerPoly.appendBezierSegment( + // rRange.getMinimum(), + // basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY()), + // rRange.getCenter()); + // + // aInnerPoly.appendBezierSegment( + // basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY()), + // rRange.getMaximum(), + // basegfx::B2DPoint(rRange.getMaxX(), rRange.getMinY())); + // + // if(SID_DRAW_FREELINE == nID) + // { + // aInnerPoly.append(rRange.getMaximum()); + // } + // else + // { + // aInnerPoly.setClosed(true); + // } + // + // aPoly.append(aInnerPoly); + // break; + // } + // case SID_DRAW_XPOLYGON: + // case SID_DRAW_XPOLYGON_NOFILL: + // { + // basegfx::B2DPolygon aInnerPoly; + // + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); + // aInnerPoly.append(rRange.getMinimum()); + // aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMinY())); + // aInnerPoly.append(rRange.getCenter()); + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxX(), rRange.getCenterY())); + // aInnerPoly.append(rRange.getMaximum()); + // + // if(SID_DRAW_XPOLYGON_NOFILL == nID) + // { + // aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY())); + // } + // else + // { + // aInnerPoly.setClosed(true); + // } + // + // aPoly.append(aInnerPoly); + // break; + // } + // case SID_DRAW_POLYGON: + // case SID_DRAW_POLYGON_NOFILL: + // { + // basegfx::B2DPolygon aInnerPoly; + // const double fWdt(rRange.getWidth()); + // const double fHgt(rRange.getHeight()); + // + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMaxY())); + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.3, rRange.getMinY() + fHgt * 0.7)); + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX(), rRange.getMinY() + fHgt * 0.15)); + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.65, rRange.getMinY())); + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt, rRange.getMinY() + fHgt * 0.3)); + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.5)); + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMinX() + fWdt * 0.8, rRange.getMinY() + fHgt * 0.75)); + // aInnerPoly.append(basegfx::B2DPoint(rRange.getMaxY(), rRange.getMaxX())); + // + // if(SID_DRAW_POLYGON_NOFILL == nID) + // { + // aInnerPoly.append(basegfx::B2DPoint(rRange.getCenterX(), rRange.getMaxY())); + // } + // else + // { + // aInnerPoly.setClosed(true); + // } + // + // aPoly.append(aInnerPoly); + // break; + // } + // } + // + // pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(aPoly); + // } + // else + // { + // DBG_ERROR("Object is NO path object"); + // } + // + // sdr::legacy::SetLogicRange(*pObj, rRange); + //} + // + //return pObj; } } // end of namespace sd diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx index fab780a51710..f848b11481ba 100644 --- a/sd/source/ui/func/fuconrec.cxx +++ b/sd/source/ui/func/fuconrec.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sd.hxx" @@ -54,7 +52,6 @@ #include <basegfx/polygon/b2dpolygontools.hxx> #include <basegfx/polygon/b2dpolygon.hxx> #include <svx/svdlegacy.hxx> - #include "sdresid.hxx" #include "View.hxx" #include "sdpage.hxx" @@ -63,6 +60,7 @@ #include "drawdoc.hxx" #include "res_bmp.hrc" #include "glob.hrc" +#include <svx/sdrobjecttools.hxx> namespace sd { @@ -851,12 +849,16 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const if(pSdrPathObj) { - const double fYMiddle((aRange.getMinY() + aRange.getMaxY()) * 0.5); - - ::basegfx::B2DPolygon aB2DPolygon; - aB2DPolygon.append(::basegfx::B2DPoint(aStart.getX(), fYMiddle)); - aB2DPolygon.append(::basegfx::B2DPoint(aEnd.getX(), fYMiddle)); - pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(::basegfx::B2DPolyPolygon(aB2DPolygon)); + initializeDefaultSdrPathObjByObjectType(*pSdrPathObj, DefaultSdrPathObjType_Line, rRange, false); + //pSdrPathObj->initializeDefaultSdrPathObjBySlotID(nID, aRange); + + // TTTT + //const double fYMiddle((aRange.getMinY() + aRange.getMaxY()) * 0.5); + // + //::basegfx::B2DPolygon aB2DPolygon; + //aB2DPolygon.append(::basegfx::B2DPoint(aStart.getX(), fYMiddle)); + //aB2DPolygon.append(::basegfx::B2DPoint(aEnd.getX(), fYMiddle)); + //pSdrPathObj->setB2DPolyPolygonInObjectCoordinates(::basegfx::B2DPolyPolygon(aB2DPolygon)); } else { diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index d4605d14d939..f44f2f88a308 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -211,7 +211,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) } nIdx--; - sal_uInt32 nNumItemId = SID_ATTR_NUMBERING_RULE; + sal_uInt16 nNumItemId = SID_ATTR_NUMBERING_RULE; const SfxPoolItem* pTmpItem = GetNumBulletItem( aNewAttr, nNumItemId ); SvxNumRule* pNumRule = NULL; if ( pTmpItem ) @@ -316,7 +316,7 @@ void FuOutlineBullet::SetCurrentBulletsNumbering(SfxRequest& rReq) rReq.Done(); } -const SfxPoolItem* FuOutlineBullet::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt32& nNumItemId) +const SfxPoolItem* FuOutlineBullet::GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& nNumItemId) { //SvxNumBulletItem* pRetItem = NULL; const SfxPoolItem* pTmpItem = NULL; diff --git a/sd/source/ui/func/fupoor.cxx b/sd/source/ui/func/fupoor.cxx index a1663e791472..bdaa01a75dd9 100644 --- a/sd/source/ui/func/fupoor.cxx +++ b/sd/source/ui/func/fupoor.cxx @@ -382,7 +382,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) if (!mpView->IsTextEdit() && !bSlideShow && !mpDocSh->IsUIActive()) { // Zoom vergroessern - mpViewShell->SetZoom(mpWindow->GetZoom() * 3 / 2); + mpViewShell->SetZoom(basegfx::fround(mpWindow->GetZoom() * (3.0 / 2.0))); DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell); @@ -401,7 +401,7 @@ bool FuPoor::KeyInput(const KeyEvent& rKEvt) if (!mpView->IsTextEdit() && !bSlideShow && !mpDocSh->IsUIActive()) { // Zoom verringern - mpViewShell->SetZoom(mpWindow->GetZoom() * 2 / 3); + mpViewShell->SetZoom(basegfx::fround(mpWindow->GetZoom() * (2.0 / 3.0))); DrawViewShell* pDrawViewShell = dynamic_cast< DrawViewShell* >(mpViewShell); diff --git a/sd/source/ui/inc/AccessibleSlideSorterObject.hxx b/sd/source/ui/inc/AccessibleSlideSorterObject.hxx index 362cd4c0fbf5..77dea982367d 100644 --- a/sd/source/ui/inc/AccessibleSlideSorterObject.hxx +++ b/sd/source/ui/inc/AccessibleSlideSorterObject.hxx @@ -72,7 +72,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent, ::sd::slidesorter::SlideSorter& rSlideSorter, - sal_uInt16 nPageNumber); + sal_uInt32 nPageNumber); ~AccessibleSlideSorterObject (void); /** Return the page that is made accessible by the called object. @@ -81,7 +81,7 @@ public: /** The page number as given to the constructor. */ - sal_uInt16 GetPageNumber (void) const; + sal_uInt32 GetPageNumber (void) const; void FireAccessibleEvent ( short nEventId, @@ -217,7 +217,7 @@ public: private: ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible> mxParent; - sal_uInt16 mnPageNumber; + sal_uInt32 mnPageNumber; ::sd::slidesorter::SlideSorter& mrSlideSorter; sal_uInt32 mnClientId; diff --git a/sd/source/ui/inc/ClientView.hxx b/sd/source/ui/inc/ClientView.hxx index e91cd66279a3..ead57f27bec8 100644 --- a/sd/source/ui/inc/ClientView.hxx +++ b/sd/source/ui/inc/ClientView.hxx @@ -29,6 +29,7 @@ namespace sd { class DrawViewShell; +class Window; /************************************************************************ |* @@ -46,13 +47,13 @@ public: DrawViewShell* pShell); virtual ~ClientView (void); - virtual void CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L); + virtual void CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) const; // Wenn die View kein Invalidate() an den Fenstern durchfuehren soll, muss // man diese beiden folgenden Methoden ueberladen und entsprechend anders // reagieren. - virtual void InvalidateOneWin(::Window& rWin); - virtual void InvalidateOneWin(::Window& rWin, const basegfx::B2DRange& rRange); + virtual void InvalidateOneWin(::Window& rWin) const; + virtual void InvalidateOneWin(::Window& rWin, const ::basegfx::B2DRange& rRange) const; }; } // end of namespace sd diff --git a/sd/source/ui/inc/DrawDocShell.hxx b/sd/source/ui/inc/DrawDocShell.hxx index 287ef9ebb229..3082d7f262bc 100644 --- a/sd/source/ui/inc/DrawDocShell.hxx +++ b/sd/source/ui/inc/DrawDocShell.hxx @@ -110,7 +110,7 @@ public: using SfxObjectShell::GetVisArea; using SfxShell::GetViewShell; - sd::ViewShell* GetViewShell() { return mpViewShell; } + sd::ViewShell* GetViewShell(); ::sd::FrameView* GetFrameView(); ::sd::FunctionReference GetDocShellFunction() const { return mxDocShellFunction; } void SetDocShellFunction( const ::sd::FunctionReference& xFunction ); diff --git a/sd/source/ui/inc/FrameView.hxx b/sd/source/ui/inc/FrameView.hxx index 45d6eb05be57..e2563b427b27 100644 --- a/sd/source/ui/inc/FrameView.hxx +++ b/sd/source/ui/inc/FrameView.hxx @@ -194,7 +194,7 @@ private: bool mbNoAttribs; // Gliederungsmodus Rectangle maVisArea; // Sichtbarer Bereich PageKind mePageKind; // Seitentyp (Standard, Notizen, Handzettel) - sal_uInt16 mnSelectedPage; // Selektierte Seite + sal_uInt32 mnSelectedPage; // Selektierte Seite PageKind mePageKindOnLoad; sal_uInt32 mnSelectedPageOnLoad; EditMode meStandardEditMode; // Editmode im Zeichenmodus (Page/MasterPage) diff --git a/sd/source/ui/inc/PresentationViewShell.hxx b/sd/source/ui/inc/PresentationViewShell.hxx index 3ef37abed620..c8c30421ecb6 100644 --- a/sd/source/ui/inc/PresentationViewShell.hxx +++ b/sd/source/ui/inc/PresentationViewShell.hxx @@ -60,7 +60,7 @@ protected: private: Rectangle maOldVisArea; - virtual void Activate (bool bIsMDIActivate); + virtual void Activate (sal_Bool bIsMDIActivate); virtual void Paint (const Rectangle& rRect, ::sd::Window* pWin); }; diff --git a/sd/source/ui/inc/SlideView.hxx b/sd/source/ui/inc/SlideView.hxx index e088d639abaf..0f83e8d0e404 100644 --- a/sd/source/ui/inc/SlideView.hxx +++ b/sd/source/ui/inc/SlideView.hxx @@ -74,8 +74,8 @@ public: sal_uInt16 ChangePagesPerRow( sal_uInt16 nNum ); sal_uInt16 GetPagesPerRow() const { return nPagesPerRow; } - virtual void InvalidateOneWin( ::Window& rWin ); - virtual void InvalidateOneWin( ::Window& rWin, const basegfx::B2DRange& rRange ); + virtual void InvalidateOneWin( ::Window& rWin ) const; + virtual void InvalidateOneWin( ::Window& rWin, const ::basegfx::B2DRange& rRange ) const; void SetAllowInvalidate( bool bFlag ); bool IsInvalidateAllowed() const; diff --git a/sd/source/ui/inc/SlideViewShell.hxx b/sd/source/ui/inc/SlideViewShell.hxx index 7b0d5ddac32e..bdfda8df19e1 100644 --- a/sd/source/ui/inc/SlideViewShell.hxx +++ b/sd/source/ui/inc/SlideViewShell.hxx @@ -144,7 +144,7 @@ public: /** On activation the preview is turned off. */ - virtual void Activate (bool IsMDIActivate); + virtual void Activate (sal_Bool IsMDIActivate); protected: virtual Size GetOptimalSizePixel() const; diff --git a/sd/source/ui/inc/View.hxx b/sd/source/ui/inc/View.hxx index d26b07d836ab..7a409edcfe68 100644 --- a/sd/source/ui/inc/View.hxx +++ b/sd/source/ui/inc/View.hxx @@ -76,7 +76,7 @@ public: ViewShell* pViewSh=NULL); virtual ~View (void); - void CompleteRedraw( OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L); + void CompleteRedraw( OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) const; virtual bool GetAttributes(SfxItemSet& rTargetSet, bool bOnlyHardAttr = false ) const; virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false); diff --git a/sd/source/ui/inc/ViewClipboard.hxx b/sd/source/ui/inc/ViewClipboard.hxx index eb78e43c7e64..8df85c7af339 100644 --- a/sd/source/ui/inc/ViewClipboard.hxx +++ b/sd/source/ui/inc/ViewClipboard.hxx @@ -66,7 +66,7 @@ protected: /** Return an index of a page after which the pages of the transferable are to be inserted into the target document. */ - virtual sal_uInt16 DetermineInsertPosition ( + virtual sal_uInt32 DetermineInsertPosition ( const SdTransferable& rTransferable); /** Insert the slides in the given transferable behind the last selected @@ -79,9 +79,9 @@ protected: @return Returns the number of inserted slides. */ - virtual sal_uInt16 InsertSlides ( + virtual sal_uInt32 InsertSlides ( const SdTransferable& rTransferable, - sal_uInt16 nInsertPosition); + sal_uInt32 nInsertPosition); }; } // end of namespace ::sd diff --git a/sd/source/ui/inc/ViewShell.hxx b/sd/source/ui/inc/ViewShell.hxx index 6b0e207f4414..0fb63d5c008a 100644 --- a/sd/source/ui/inc/ViewShell.hxx +++ b/sd/source/ui/inc/ViewShell.hxx @@ -267,11 +267,11 @@ public: void SetStartShowWithDialog( bool bIn = true ) { mbStartShowWithDialog = bIn; } bool IsStartShowWithDialog() const { return mbStartShowWithDialog; } - sal_uInt16 GetPrintedHandoutPageNum (void) const { return mnPrintedHandoutPageNum; } - void SetPrintedHandoutPageNum (sal_uInt16 nPageNumber) {mnPrintedHandoutPageNum=nPageNumber; } + sal_uInt32 GetPrintedHandoutPageNum (void) const { return mnPrintedHandoutPageNum; } + void SetPrintedHandoutPageNum (sal_uInt32 nPageNumber) {mnPrintedHandoutPageNum=nPageNumber; } - sal_uInt16 GetPrintedHandoutPageCount(void) const { return mnPrintedHandoutPageCount; } - void SetPrintedHandoutPageCount (sal_uInt16 nPageCount) {mnPrintedHandoutPageCount=nPageCount; } + sal_uInt32 GetPrintedHandoutPageCount(void) const { return mnPrintedHandoutPageCount; } + void SetPrintedHandoutPageCount (sal_uInt32 nPageCount) {mnPrintedHandoutPageCount=nPageCount; } virtual sal_uInt16 PrepareClose( bool bUI = true, bool bForBrowsing = false ); @@ -488,8 +488,8 @@ protected: bool mbCenterAllowed; // wird an Fenster weitergegeben bool mbStartShowWithDialog; // Praesentation wurde ueber Dialog gestartet - sal_uInt16 mnPrintedHandoutPageNum; // Page number of the handout page that is to be printed. - sal_uInt16 mnPrintedHandoutPageCount; // Page count of the handout pages that are to be printed. + sal_uInt32 mnPrintedHandoutPageNum; // Page number of the handout page that is to be printed. + sal_uInt32 mnPrintedHandoutPageCount; // Page count of the handout pages that are to be printed. /** Area covered by all windows, i.e. the area of the parent window without the controls at the borders like rulers, scroll bars, tab diff --git a/sd/source/ui/inc/drawview.hxx b/sd/source/ui/inc/drawview.hxx index 4ddc0e11281c..cf9ce7e6445b 100644 --- a/sd/source/ui/inc/drawview.hxx +++ b/sd/source/ui/inc/drawview.hxx @@ -52,7 +52,7 @@ public: virtual ~DrawView (void); virtual void handleSelectionChange(); - void CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L); + void CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) const; virtual bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll = false); @@ -66,7 +66,7 @@ public: virtual void MakeVisibleAtView(const basegfx::B2DRange& rRange, ::Window& rWin); virtual void HideSdrPage(); - void PresPaint(const Region& rRegion); + void PresPaint(const Region& rRegion) const; virtual void DeleteMarked(); // from SdrView diff --git a/sd/source/ui/inc/fuolbull.hxx b/sd/source/ui/inc/fuolbull.hxx index 60be4d9505a4..4120369e19e5 100644 --- a/sd/source/ui/inc/fuolbull.hxx +++ b/sd/source/ui/inc/fuolbull.hxx @@ -60,7 +60,7 @@ private: void SetCurrentBulletsNumbering(SfxRequest& rReq); - const SfxPoolItem* GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt32& nNumItemId); + const SfxPoolItem* GetNumBulletItem(SfxItemSet& aNewAttr, sal_uInt16& nNumItemId); }; diff --git a/sd/source/ui/inc/sdpreslt.hxx b/sd/source/ui/inc/sdpreslt.hxx index 4519a49a2153..08a7d5db797d 100644 --- a/sd/source/ui/inc/sdpreslt.hxx +++ b/sd/source/ui/inc/sdpreslt.hxx @@ -71,10 +71,11 @@ private: const SfxItemSet& mrOutAttrs; - List* mpLayoutNames; + std::vector< String > maLayoutNames; + // List* mpLayoutNames; String maName; // Layoutname oder Dateiname - long mnLayoutCount; // Anzahl, der im Dokument vorhandenen MasterPages + sal_uInt32 mnLayoutCount; // Anzahl, der im Dokument vorhandenen MasterPages const String maStrNone; void FillValueSet(); diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx index 4d4ff45f0c0c..676f56285da7 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx @@ -139,12 +139,12 @@ void CurrentMasterPagesSelector::LateInit (void) void CurrentMasterPagesSelector::Fill (ItemList& rItemList) { - sal_uInt16 nPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD); + sal_uInt32 nPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD); SdPage* pMasterPage; // Remember the names of the master pages that have been inserted to // avoid double insertion. ::std::set<String> aMasterPageNames; - for (sal_uInt16 nIndex=0; nIndex<nPageCount; nIndex++) + for (sal_uInt32 nIndex=0; nIndex<nPageCount; nIndex++) { pMasterPage = mrDocument.GetMasterSdPage (nIndex, PK_STANDARD); if (pMasterPage == NULL) @@ -192,10 +192,10 @@ void CurrentMasterPagesSelector::UpdateSelection (void) { // Iterate over all pages and for the selected ones put the name of // their master page into a set. - sal_uInt16 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD); + sal_uInt32 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD); SdPage* pPage; ::std::set<String> aNames; - sal_uInt16 nIndex; + sal_uInt32 nIndex; bool bLoop (true); for (nIndex=0; nIndex<nPageCount && bLoop; nIndex++) { @@ -226,10 +226,10 @@ void CurrentMasterPagesSelector::UpdateSelection (void) sal_uInt16 nItemCount (PreviewValueSet::GetItemCount()); for (nIndex=1; nIndex<=nItemCount && bLoop; nIndex++) { - String sName (PreviewValueSet::GetItemText (nIndex)); + String sName (PreviewValueSet::GetItemText (static_cast< sal_uInt16 >(nIndex))); if (aNames.find(sName) != aNames.end()) { - PreviewValueSet::SelectItem (nIndex); + PreviewValueSet::SelectItem (static_cast< sal_uInt16 >(nIndex)); } } } diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx index 45f1b2018a8b..9271b935faf3 100644 --- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx @@ -80,7 +80,8 @@ private: virtual void LateInit (void); DECL_LINK(EventMultiplexerListener,sd::tools::EventMultiplexerEvent*); - void Notify (SfxBroadcaster&, const SfxHint& rHint); + using MasterPagesSelector::Notify; + virtual void Notify (SfxBroadcaster&, const SfxHint& rHint); }; } } // end of namespace sd::sidebar diff --git a/sd/source/ui/sidebar/CustomAnimationPanel.cxx b/sd/source/ui/sidebar/CustomAnimationPanel.cxx index 5fd87d2a2a00..40dd531dbe71 100644 --- a/sd/source/ui/sidebar/CustomAnimationPanel.cxx +++ b/sd/source/ui/sidebar/CustomAnimationPanel.cxx @@ -69,7 +69,7 @@ CustomAnimationPanel::~CustomAnimationPanel (void) -css::ui::LayoutSize CustomAnimationPanel::GetHeightForWidth (const sal_Int32 nWidth) +css::ui::LayoutSize CustomAnimationPanel::GetHeightForWidth (const sal_Int32 /*nWidth*/) { const sal_Int32 nMinimumHeight(getCustomAnimationPanelMinimumHeight(mpWrappedControl.get())); return css::ui::LayoutSize(nMinimumHeight,-1, nMinimumHeight); diff --git a/sd/source/ui/sidebar/DocumentHelper.cxx b/sd/source/ui/sidebar/DocumentHelper.cxx index 1ae5a2154865..7ec225e92ad8 100644 --- a/sd/source/ui/sidebar/DocumentHelper.cxx +++ b/sd/source/ui/sidebar/DocumentHelper.cxx @@ -55,8 +55,7 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument ( break; // Check the presence of the source document. - SdDrawDocument* pSourceDocument = static_cast<SdDrawDocument*>( - pMasterPage->GetModel()); + SdDrawDocument* pSourceDocument = static_cast< SdDrawDocument* >(&pMasterPage->getSdrModelFromSdrPage()); if (pSourceDocument == NULL) break; @@ -72,13 +71,13 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument ( // present. This is not the case when we are called during the // creation of the slide master page because then the notes master // page is not there. - sal_uInt16 nSourceMasterPageCount = pSourceDocument->GetMasterPageCount(); + const sal_uInt32 nSourceMasterPageCount(pSourceDocument->GetMasterPageCount()); if (nSourceMasterPageCount%2 == 0) // There should be 1 handout page + n slide masters + n notes // masters = 2*n+1. An even value indicates that a new slide // master but not yet the notes master has been inserted. break; - sal_uInt16 nIndex = pMasterPage->GetPageNum(); + const sal_uInt32 nIndex(pMasterPage->GetPageNumber()); if (nSourceMasterPageCount <= nIndex+1) break; // Get the slide master page. @@ -95,7 +94,7 @@ SdPage* DocumentHelper::CopyMasterPageToLocalDocument ( // Check if a master page with the same name as that of the given // master page already exists. bool bPageExists (false); - sal_uInt16 nMasterPageCount(rTargetDocument.GetMasterSdPageCount(PK_STANDARD)); + const sal_uInt32 nMasterPageCount(rTargetDocument.GetMasterSdPageCount(PK_STANDARD)); for (sal_uInt16 nMaster=0; nMaster<nMasterPageCount; nMaster++) { SdPage* pCandidate = static_cast<SdPage*>( @@ -166,9 +165,7 @@ SdPage* DocumentHelper::GetSlideForMasterPage (SdPage* pMasterPage) { SdPage* pCandidate = NULL; - SdDrawDocument* pDocument = NULL; - if (pMasterPage != NULL) - pDocument = dynamic_cast<SdDrawDocument*>(pMasterPage->GetModel()); + SdDrawDocument* pDocument = pMasterPage ? dynamic_cast< SdDrawDocument* >(&pMasterPage->getSdrModelFromSdrPage()) : 0; // Iterate over all pages and check if it references the given master // page. @@ -176,7 +173,7 @@ SdPage* DocumentHelper::GetSlideForMasterPage (SdPage* pMasterPage) { // In most cases a new slide has just been inserted so start with // the last page. - sal_uInt16 nPageIndex (pDocument->GetSdPageCount(PK_STANDARD)-1); + sal_uInt32 nPageIndex(pDocument->GetSdPageCount(PK_STANDARD) - 1); bool bFound (false); while ( ! bFound) { @@ -222,11 +219,10 @@ SdPage* DocumentHelper::AddMasterPage ( try { // Duplicate the master page. - pClonedMasterPage = static_cast<SdPage*>(pMasterPage->Clone()); + pClonedMasterPage = static_cast< SdPage* >(pMasterPage->CloneSdrPage()); // Copy the necessary styles. - SdDrawDocument* pSourceDocument - = static_cast<SdDrawDocument*>(pMasterPage->GetModel()); + SdDrawDocument* pSourceDocument = static_cast< SdDrawDocument* >(&pMasterPage->getSdrModelFromSdrPage()); if (pSourceDocument != NULL) ProvideStyles (*pSourceDocument, rTargetDocument, pClonedMasterPage); @@ -237,7 +233,7 @@ SdPage* DocumentHelper::AddMasterPage ( // master page. rTargetDocument.InsertMasterPage (pClonedMasterPage); } - catch (uno::Exception& rException) + catch (uno::Exception& /*rException*/) { pClonedMasterPage = NULL; DBG_UNHANDLED_EXCEPTION(); @@ -324,7 +320,7 @@ void DocumentHelper::AssignMasterPageToPageList ( ::std::vector<SdPage*> aCleanedList; for (iPage=rpPageList->begin(); iPage!=rpPageList->end(); ++iPage) { - OSL_ASSERT(*iPage!=NULL && (*iPage)->GetModel() == &rTargetDocument); + OSL_ASSERT(*iPage!=NULL && &(*iPage)->getSdrModelFromSdrPage() == &rTargetDocument); if (*iPage != NULL && (*iPage)->GetLayoutName().CompareTo(sFullLayoutName)!=0) { @@ -365,21 +361,21 @@ void DocumentHelper::AssignMasterPageToPageList ( SdPage* DocumentHelper::AddMasterPage ( SdDrawDocument& rTargetDocument, SdPage* pMasterPage, - sal_uInt16 nInsertionIndex) + sal_uInt32 nInsertionIndex) { SdPage* pClonedMasterPage = NULL; if (pMasterPage!=NULL) { // Duplicate the master page. - pClonedMasterPage = static_cast<SdPage*>(pMasterPage->Clone()); + pClonedMasterPage = static_cast<SdPage*>(pMasterPage->CloneSdrPage()); // Copy the precious flag. pClonedMasterPage->SetPrecious(pMasterPage->IsPrecious()); // Copy the necessary styles. - SdDrawDocument* pSourceDocument - = static_cast<SdDrawDocument*>(pMasterPage->GetModel()); + SdDrawDocument* pSourceDocument = static_cast< SdDrawDocument* >(&pMasterPage->getSdrModelFromSdrPage()); + if (pSourceDocument != NULL) { ProvideStyles (*pSourceDocument, rTargetDocument, pClonedMasterPage); @@ -390,14 +386,17 @@ SdPage* DocumentHelper::AddMasterPage ( // Adapt the size of the new master page to that of the pages in // the document. - Size aNewSize (rTargetDocument.GetSdPage(0, pMasterPage->GetPageKind())->GetSize()); - Rectangle aBorders ( - pClonedMasterPage->GetLftBorder(), - pClonedMasterPage->GetUppBorder(), - pClonedMasterPage->GetRgtBorder(), - pClonedMasterPage->GetLwrBorder()); - pClonedMasterPage->ScaleObjects(aNewSize, aBorders, sal_True); - pClonedMasterPage->SetSize(aNewSize); + const SdPage* pSourcePage = rTargetDocument.GetSdPage(0, pMasterPage->GetPageKind()); + const basegfx::B2DVector aSourcePageSize(pSourcePage->GetPageScale()); + + pClonedMasterPage->ScaleObjects( + aSourcePageSize, + pClonedMasterPage->GetLeftPageBorder(), + pClonedMasterPage->GetTopPageBorder(), + pClonedMasterPage->GetRightPageBorder(), + pClonedMasterPage->GetBottomPageBorder(), + true); + pClonedMasterPage->SetPageScale(aSourcePageSize); pClonedMasterPage->CreateTitleAndLayout(sal_True); } } @@ -429,7 +428,9 @@ void DocumentHelper::AssignMasterPageToPage ( // Leave early when the parameters are invalid. if (pPage == NULL || pMasterPage == NULL) return; - SdDrawDocument* pDocument = dynamic_cast<SdDrawDocument*>(pPage->GetModel()); + + SdDrawDocument* pDocument = dynamic_cast< SdDrawDocument* >(&pPage->getSdrModelFromSdrPage()); + if (pDocument == NULL) return; @@ -445,7 +446,7 @@ void DocumentHelper::AssignMasterPageToPage ( pPage->getSdrPageProperties().PutItem(XFillStyleItem(XFILL_NONE)); pDocument->SetMasterPage ( - (pPage->GetPageNum()-1)/2, + (pPage->GetPageNumber()-1)/2, rsBaseLayoutName, pDocument, sal_False, @@ -455,8 +456,8 @@ void DocumentHelper::AssignMasterPageToPage ( { // Find first slide that uses the master page. SdPage* pSlide = NULL; - sal_uInt16 nPageCount = pDocument->GetSdPageCount(PK_STANDARD); - for (sal_uInt16 nPage=0; nPage<nPageCount&&pSlide==NULL; nPage++) + const sal_uInt32 nPageCount(pDocument->GetSdPageCount(PK_STANDARD)); + for (sal_uInt32 nPage=0; nPage<nPageCount&&pSlide==NULL; nPage++) { SdrPage* pCandidate = pDocument->GetSdPage(nPage,PK_STANDARD); if (pCandidate != NULL @@ -472,7 +473,7 @@ void DocumentHelper::AssignMasterPageToPage ( // 2. Assign the given master pages to the first slide that was // found above that uses the master page. pDocument->SetMasterPage ( - (pSlide->GetPageNum()-1)/2, + (pSlide->GetPageNumber()-1)/2, rsBaseLayoutName, pDocument, sal_False, @@ -505,11 +506,14 @@ SdPage* DocumentHelper::ProvideMasterPage ( OSL_ASSERT(pMasterPage != NULL); return NULL; } - SdDrawDocument* pSourceDocument = static_cast<SdDrawDocument*>(pMasterPage->GetModel()); + + SdDrawDocument* pSourceDocument = static_cast< SdDrawDocument* >(&pMasterPage->getSdrModelFromSdrPage()); + if (pSourceDocument == NULL) return NULL; - SdPage* pNotesMasterPage = static_cast<SdPage*>( - pSourceDocument->GetMasterPage(pMasterPage->GetPageNum()+1)); + + SdPage* pNotesMasterPage = static_cast<SdPage*>(pSourceDocument->GetMasterPage(pMasterPage->GetPageNumber()+1)); + if (pNotesMasterPage == NULL) { // The model is not in a valid state. Maybe a new master page @@ -522,7 +526,7 @@ SdPage* DocumentHelper::ProvideMasterPage ( // Search for a master page with the same name as the given one in // the target document. const XubString sMasterPageLayoutName (pMasterPage->GetLayoutName()); - for (sal_uInt16 nIndex=0,nCount=rTargetDocument.GetMasterPageCount(); nIndex<nCount; ++nIndex) + for (sal_uInt32 nIndex=0,nCount=rTargetDocument.GetMasterPageCount(); nIndex<nCount; ++nIndex) { SdPage* pCandidate = static_cast<SdPage*>(rTargetDocument.GetMasterPage(nIndex)); if (pCandidate!=NULL @@ -541,14 +545,14 @@ SdPage* DocumentHelper::ProvideMasterPage ( // Determine the position where the new master pages are inserted. // By default they are inserted at the end. When we assign to a // master page then insert after the last of the (selected) pages. - sal_uInt16 nInsertionIndex = rTargetDocument.GetMasterPageCount(); + sal_uInt32 nInsertionIndex(rTargetDocument.GetMasterPageCount()); if (rpPageList->front()->IsMasterPage()) { - nInsertionIndex = rpPageList->back()->GetPageNum(); + nInsertionIndex = rpPageList->back()->GetPageNumber(); } // Clone the master page. - if (pMasterPage->GetModel() != &rTargetDocument) + if (&pMasterPage->getSdrModelFromSdrPage() != &rTargetDocument) { pMasterPageInDocument = AddMasterPage (rTargetDocument, pMasterPage, nInsertionIndex); if( rTargetDocument.IsUndoEnabled() ) @@ -559,7 +563,7 @@ SdPage* DocumentHelper::ProvideMasterPage ( pMasterPageInDocument = pMasterPage; // Clone the notes master. - if (pNotesMasterPage->GetModel() != &rTargetDocument) + if (&pNotesMasterPage->getSdrModelFromSdrPage() != &rTargetDocument) { SdPage* pClonedNotesMasterPage = AddMasterPage (rTargetDocument, pNotesMasterPage, nInsertionIndex+1); diff --git a/sd/source/ui/sidebar/DocumentHelper.hxx b/sd/source/ui/sidebar/DocumentHelper.hxx index a5f7d8b35950..1d4a8072f28e 100644 --- a/sd/source/ui/sidebar/DocumentHelper.hxx +++ b/sd/source/ui/sidebar/DocumentHelper.hxx @@ -78,7 +78,7 @@ private: static SdPage* AddMasterPage ( SdDrawDocument& rTargetDocument, SdPage* pMasterPage, - sal_uInt16 nInsertionIndex); + sal_uInt32 nInsertionIndex); static SdPage* ProvideMasterPage ( SdDrawDocument& rTargetDocument, SdPage* pMasterPage, diff --git a/sd/source/ui/sidebar/MasterPageObserver.cxx b/sd/source/ui/sidebar/MasterPageObserver.cxx index 3aeb6d0bbd7c..db77748af94a 100644 --- a/sd/source/ui/sidebar/MasterPageObserver.cxx +++ b/sd/source/ui/sidebar/MasterPageObserver.cxx @@ -187,8 +187,8 @@ void MasterPageObserver::Implementation::RegisterDocument ( { // Gather the names of all the master pages in the given document. MasterPageContainer::data_type aMasterPageSet; - sal_uInt16 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD); - for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++) + sal_uInt32 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD); + for (sal_uInt32 nIndex=0; nIndex<nMasterPageCount; nIndex++) { SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PK_STANDARD); if (pMasterPage != NULL) @@ -325,9 +325,9 @@ void MasterPageObserver::Implementation::AnalyzeUsedMasterPages ( SdDrawDocument& rDocument) { // Create a set of names of the master pages used by the given document. - sal_uInt16 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD); + sal_uInt32 nMasterPageCount = rDocument.GetMasterSdPageCount(PK_STANDARD); ::std::set<String> aCurrentMasterPages; - for (sal_uInt16 nIndex=0; nIndex<nMasterPageCount; nIndex++) + for (sal_uInt32 nIndex=0; nIndex<nMasterPageCount; nIndex++) { SdPage* pMasterPage = rDocument.GetMasterSdPage (nIndex, PK_STANDARD); if (pMasterPage != NULL) diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx index 694ee21b404b..771f05c03b8e 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx @@ -421,7 +421,7 @@ void MasterPagesSelector::AssignMasterPageToAllSlides (SdPage* pMasterPage) if (pMasterPage == NULL) break; - sal_uInt16 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD); + sal_uInt32 nPageCount = mrDocument.GetSdPageCount(PK_STANDARD); if (nPageCount == 0) break; diff --git a/sd/source/ui/sidebar/MasterPagesSelector.hxx b/sd/source/ui/sidebar/MasterPagesSelector.hxx index f58ddefffae1..5a08a5a16392 100644 --- a/sd/source/ui/sidebar/MasterPagesSelector.hxx +++ b/sd/source/ui/sidebar/MasterPagesSelector.hxx @@ -84,10 +84,10 @@ public: page, is cloned and inserted into mrDocument. The necessary styles are copied as well. */ - static SdPage* AddMasterPage ( - SdDrawDocument* pTargetDocument, - SdPage* pMasterPage, - sal_uInt16 nInsertionIndex); + //static SdPage* AddMasterPage ( + // SdDrawDocument* pTargetDocument, + // SdPage* pMasterPage, + // sal_uInt32 nInsertionIndex); virtual Size GetPreferredSize (void); virtual sal_Int32 GetPreferredWidth (sal_Int32 nHeight); diff --git a/sd/source/ui/sidebar/PanelBase.cxx b/sd/source/ui/sidebar/PanelBase.cxx index ba2519c67712..ed6e8b00950d 100644 --- a/sd/source/ui/sidebar/PanelBase.cxx +++ b/sd/source/ui/sidebar/PanelBase.cxx @@ -66,7 +66,7 @@ void PanelBase::Dispose (void) -css::ui::LayoutSize PanelBase::GetHeightForWidth (const sal_Int32 nWidth) +css::ui::LayoutSize PanelBase::GetHeightForWidth (const sal_Int32 /*nWidth*/) { sal_Int32 nHeight (0); if (ProvideWrappedControl()) diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx index 7dba3eea3afa..9de457e71981 100644 --- a/sd/source/ui/sidebar/PanelFactory.cxx +++ b/sd/source/ui/sidebar/PanelFactory.cxx @@ -105,7 +105,7 @@ Sequence<rtl::OUString> SAL_CALL PanelFactory_getSupportedServiceNames (void) //----- PanelFactory -------------------------------------------------------- PanelFactory::PanelFactory( - const css::uno::Reference<css::uno::XComponentContext>& rxContext) + const css::uno::Reference<css::uno::XComponentContext>& /*rxContext*/) : PanelFactoryInterfaceBase(m_aMutex) { } diff --git a/sd/source/ui/sidebar/PreviewValueSet.cxx b/sd/source/ui/sidebar/PreviewValueSet.cxx index cce4a8fedb16..56ad0749d1d9 100644 --- a/sd/source/ui/sidebar/PreviewValueSet.cxx +++ b/sd/source/ui/sidebar/PreviewValueSet.cxx @@ -97,7 +97,7 @@ void PreviewValueSet::Resize (void) -void PreviewValueSet::Rearrange (bool bForceRequestResize) +void PreviewValueSet::Rearrange (bool /*bForceRequestResize*/) { sal_uInt16 nNewColumnCount (CalculateColumnCount ( GetOutputSizePixel().Width())); diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx index c107a5e43384..7529798e4725 100644 --- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx +++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx @@ -113,8 +113,8 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList) { // Create a set of names of the master pages used by the document. MasterPageObserver::MasterPageNameSet aCurrentNames; - sal_uInt16 nMasterPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD); - sal_uInt16 nIndex; + sal_uInt32 nMasterPageCount = mrDocument.GetMasterSdPageCount(PK_STANDARD); + sal_uInt32 nIndex; for (nIndex=0; nIndex<nMasterPageCount; nIndex++) { SdPage* pMasterPage = mrDocument.GetMasterSdPage (nIndex, PK_STANDARD); @@ -125,7 +125,7 @@ void RecentMasterPagesSelector::Fill (ItemList& rItemList) // Insert the recently used master pages that are currently not used. RecentlyUsedMasterPages& rInstance (RecentlyUsedMasterPages::Instance()); - int nPageCount = rInstance.GetMasterPageCount(); + const sal_uInt32 nPageCount = rInstance.GetMasterPageCount(); for (nIndex=0; nIndex<nPageCount; nIndex++) { // Add an entry when a) the page is already known to the diff --git a/sd/source/ui/sidebar/SlideTransitionPanel.cxx b/sd/source/ui/sidebar/SlideTransitionPanel.cxx index c23ebc135c7c..ee89dd24d2e5 100644 --- a/sd/source/ui/sidebar/SlideTransitionPanel.cxx +++ b/sd/source/ui/sidebar/SlideTransitionPanel.cxx @@ -67,7 +67,7 @@ SlideTransitionPanel::~SlideTransitionPanel (void) -css::ui::LayoutSize SlideTransitionPanel::GetHeightForWidth (const sal_Int32 nWidth) +css::ui::LayoutSize SlideTransitionPanel::GetHeightForWidth (const sal_Int32 /*nWidth*/) { const sal_Int32 nMinimumHeight(getSlideTransitionPanelMinimumHeight(mpWrappedControl.get())); return css::ui::LayoutSize(nMinimumHeight,-1, nMinimumHeight); diff --git a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx index eb08f0c514bf..3bffa8bb0c07 100644 --- a/sd/source/ui/slidesorter/controller/SlsClipboard.cxx +++ b/sd/source/ui/slidesorter/controller/SlsClipboard.cxx @@ -343,7 +343,7 @@ sal_Int32 Clipboard::PasteTransferable (sal_Int32 nInsertPosition) SdTransferable* pClipTransferable = SD_MOD()->pTransferClip; model::SlideSorterModel& rModel (mrSlideSorter.GetModel()); bool bMergeMasterPages = !pClipTransferable->HasSourceDoc (rModel.GetDocument()); - sal_uInt16 nInsertIndex (rModel.GetCoreIndex(nInsertPosition)); + sal_uInt32 nInsertIndex (rModel.GetCoreIndex(nInsertPosition)); sal_Int32 nInsertPageCount (0); if (pClipTransferable->HasPageBookmarks()) { @@ -567,7 +567,7 @@ void Clipboard::CreateSlideTransferable ( if (pTransferableDocument == NULL) break; bool bIsMasterPage(false); - const sal_uInt16 nPageIndex (pTransferableDocument->GetPageByName(sBookmark, bIsMasterPage)); + const sal_uInt32 nPageIndex (pTransferableDocument->GetPageByName(sBookmark, bIsMasterPage)); if (nPageIndex == SDRPAGE_NOTFOUND) break; @@ -912,7 +912,7 @@ void Clipboard::Abort (void) -sal_uInt16 Clipboard::DetermineInsertPosition (const SdTransferable& ) +sal_uInt32 Clipboard::DetermineInsertPosition (const SdTransferable& ) { // Tell the model to move the dragged pages behind the one with the // index nInsertionIndex which first has to be transformed into an index @@ -930,11 +930,11 @@ sal_uInt16 Clipboard::DetermineInsertPosition (const SdTransferable& ) -sal_uInt16 Clipboard::InsertSlides ( +sal_uInt32 Clipboard::InsertSlides ( const SdTransferable& rTransferable, - sal_uInt16 nInsertPosition) + sal_uInt32 nInsertPosition) { - sal_uInt16 nInsertedPageCount = ViewClipboard::InsertSlides ( + sal_uInt32 nInsertedPageCount = ViewClipboard::InsertSlides ( rTransferable, nInsertPosition); @@ -943,7 +943,7 @@ sal_uInt16 Clipboard::InsertSlides ( maPagesToSelect.clear(); SdDrawDocument* pDocument = mrSlideSorter.GetModel().GetDocument(); if (pDocument != NULL) - for (sal_Int32 i=0; i<=nInsertedPageCount; i+=2) + for (sal_uInt32 i=0; i<=nInsertedPageCount; i+=2) maPagesToSelect.push_back( dynamic_cast<SdPage*>(pDocument->GetPage(nInsertPosition+i))); diff --git a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx index 2235049e85ad..bafc9ee3b8fd 100644 --- a/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx +++ b/sd/source/ui/slidesorter/controller/SlsCurrentSlideManager.cxx @@ -210,7 +210,7 @@ void CurrentSlideManager::SetCurrentSlideAtViewShellBase (const SharedPageDescri { sal_uInt32 nPageNumber = (rpDescriptor->GetPage()->GetPageNumber()-1)/2; pDrawViewShell->SwitchPage(nPageNumber); - pDrawViewShell->GetPageTabControl()->SetCurPageId(nPageNumber+1); + pDrawViewShell->GetPageTabControl()->SetCurPageId(static_cast< sal_uInt16 >(nPageNumber + 1)); } } } @@ -229,8 +229,8 @@ void CurrentSlideManager::SetCurrentSlideAtTabControl (const SharedPageDescripto ::boost::dynamic_pointer_cast<DrawViewShell>(pBase->GetMainViewShell())); if (pDrawViewShell) { - sal_uInt32 nPageNumber = (rpDescriptor->GetPage()->GetPageNumber()-1)/2; - pDrawViewShell->GetPageTabControl()->SetCurPageId(sal_uInt16(nPageNumber+1)); + const sal_uInt32 nPageNumber = (rpDescriptor->GetPage()->GetPageNumber()-1)/2; + pDrawViewShell->GetPageTabControl()->SetCurPageId(static_cast< sal_uInt16 >(nPageNumber + 1)); } } } diff --git a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx index 32a261d806e5..54152488c5c0 100644 --- a/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx +++ b/sd/source/ui/slidesorter/controller/SlsSelectionFunction.cxx @@ -1536,15 +1536,15 @@ void NormalModeHandler::RangeSelect (const model::SharedPageDescriptor& rpDescri { // Select all pages between the anchor and the given one, including // the two. - const sal_uInt16 nAnchorIndex ((pAnchor->GetPage()->GetPageNumber()-1) / 2); - const sal_uInt16 nOtherIndex ((rpDescriptor->GetPage()->GetPageNumber()-1) / 2); + const sal_uInt32 nAnchorIndex ((pAnchor->GetPage()->GetPageNumber()-1) / 2); + const sal_uInt32 nOtherIndex ((rpDescriptor->GetPage()->GetPageNumber()-1) / 2); // Iterate over all pages in the range. Start with the anchor // page. This way the PageSelector will recognize it again as // anchor (the first selected page after a DeselectAllPages() // becomes the anchor.) - const sal_uInt16 nStep ((nAnchorIndex < nOtherIndex) ? +1 : -1); - sal_uInt16 nIndex (nAnchorIndex); + const sal_uInt32 nStep ((nAnchorIndex < nOtherIndex) ? +1 : -1); + sal_uInt32 nIndex (nAnchorIndex); while (true) { rSelector.SelectPage(nIndex); diff --git a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx index 86cfa8feb5fa..12ba234c0775 100644 --- a/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx +++ b/sd/source/ui/slidesorter/inc/controller/SlsClipboard.hxx @@ -106,12 +106,12 @@ public: void Abort (void); protected: - virtual sal_uInt16 DetermineInsertPosition ( + virtual sal_uInt32 DetermineInsertPosition ( const SdTransferable& rTransferable); - virtual sal_uInt16 InsertSlides ( + virtual sal_uInt32 InsertSlides ( const SdTransferable& rTransferable, - sal_uInt16 nInsertPosition); + sal_uInt32 nInsertPosition); private: SlideSorter& mrSlideSorter; diff --git a/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx b/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx index e09cce3664a8..50f1997d538d 100644 --- a/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx +++ b/sd/source/ui/slidesorter/inc/model/SlideSorterModel.hxx @@ -151,7 +151,7 @@ public: the n*2+1 magic. Only when a special model is set, like a custom slide show, then the returned value is different. */ - sal_uInt16 GetCoreIndex (const sal_Int32 nIndex) const; + sal_uInt32 GetCoreIndex (const sal_Int32 nIndex) const; /** Call this method after the document has changed its structure. This will get the model in sync with the SdDrawDocument. This method diff --git a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx index a4fdfeb43657..4fbbc439df12 100644 --- a/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx +++ b/sd/source/ui/slidesorter/inc/view/SlideSorterView.hxx @@ -137,7 +137,7 @@ public: virtual void CompleteRedraw ( OutputDevice* pDevice, const Region& rPaintArea, - sdr::contact::ViewObjectContactRedirector* pRedirector = NULL); + sdr::contact::ViewObjectContactRedirector* pRedirector = NULL) const; void Paint (OutputDevice& rDevice, const Rectangle& rRepaintArea); virtual void ConfigurationChanged ( diff --git a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx index a1e084a3c60f..512369b4dc51 100644 --- a/sd/source/ui/slidesorter/model/SlideSorterModel.cxx +++ b/sd/source/ui/slidesorter/model/SlideSorterModel.cxx @@ -294,7 +294,7 @@ sal_Int32 SlideSorterModel::GetIndex (const SdrPage* pPage) const ::osl::MutexGuard aGuard (maMutex); // First try to guess the right index. - sal_Int16 nNumber ((pPage->GetPageNumber()-1)/2); + sal_Int32 nNumber ((pPage->GetPageNumber()-1)/2); SharedPageDescriptor pDescriptor (GetPageDescriptor(nNumber, false)); if (pDescriptor.get() != NULL && pDescriptor->GetPage() == pPage) @@ -327,7 +327,7 @@ sal_Int32 SlideSorterModel::GetIndex (const SdrPage* pPage) const -sal_uInt16 SlideSorterModel::GetCoreIndex (const sal_Int32 nIndex) const +sal_uInt32 SlideSorterModel::GetCoreIndex (const sal_Int32 nIndex) const { SharedPageDescriptor pDescriptor (GetPageDescriptor(nIndex)); if (pDescriptor) diff --git a/sd/source/ui/slidesorter/view/SlideSorterView.cxx b/sd/source/ui/slidesorter/view/SlideSorterView.cxx index 5ebec196dcfc..d9b7d0ed7e20 100644 --- a/sd/source/ui/slidesorter/view/SlideSorterView.cxx +++ b/sd/source/ui/slidesorter/view/SlideSorterView.cxx @@ -719,7 +719,7 @@ static double gnLastFrameStart = 0; void SlideSorterView::CompleteRedraw ( OutputDevice* pDevice, const Region& rPaintArea, - sdr::contact::ViewObjectContactRedirector* pRedirector) + sdr::contact::ViewObjectContactRedirector* pRedirector) const { (void)pRedirector; #ifdef DEBUG_TIMING @@ -742,13 +742,13 @@ void SlideSorterView::CompleteRedraw ( { mrSlideSorter.GetContentWindow()->IncrementLockCount(); if (mpLayeredDevice->HandleMapModeChange()) - DeterminePageObjectVisibilities(); + const_cast< SlideSorterView* >(this)->DeterminePageObjectVisibilities(); mpLayeredDevice->Repaint(rPaintArea); mrSlideSorter.GetContentWindow()->DecrementLockCount(); } else { - maRedrawRegion.Union(rPaintArea); + const_cast< SlideSorterView* >(this)->maRedrawRegion.Union(rPaintArea); } #ifdef DEBUG_TIMING diff --git a/sd/source/ui/slidesorter/view/SlsButtonBar.cxx b/sd/source/ui/slidesorter/view/SlsButtonBar.cxx index ff088bf4675a..8f4a9ee61a52 100644 --- a/sd/source/ui/slidesorter/view/SlsButtonBar.cxx +++ b/sd/source/ui/slidesorter/view/SlsButtonBar.cxx @@ -71,6 +71,7 @@ public: /** Set the preview bounding box, the maximal area in which to display buttons. A call to this method triggers a call to Layout(). */ + virtual ~BackgroundTheme(); void SetPreviewBoundingBox (const Rectangle& rPreviewBoundingBox); Button::IconSize GetIconSize (void) const; @@ -104,6 +105,7 @@ namespace { RectangleBackgroundTheme( const ::boost::shared_ptr<Theme>& rpTheme, const ::std::vector<SharedButton>& rButtons); + virtual ~RectangleBackgroundTheme(); virtual BitmapEx CreateBackground ( const OutputDevice& rTemplateDevice, const bool bIsButtonDown) const; @@ -125,6 +127,7 @@ namespace { BitmapBackgroundTheme( const ::boost::shared_ptr<Theme>& rpTheme, const ::std::vector<SharedButton>& rButtons); + virtual ~BitmapBackgroundTheme(); virtual BitmapEx CreateBackground ( const OutputDevice& rTemplateDevice, const bool bIsButtonDown) const; @@ -804,6 +807,11 @@ ButtonBar::BackgroundTheme::BackgroundTheme ( +ButtonBar::BackgroundTheme::~BackgroundTheme() +{ +} + + void ButtonBar::BackgroundTheme::SetPreviewBoundingBox (const Rectangle& rPreviewBoundingBox) { @@ -876,6 +884,12 @@ RectangleBackgroundTheme::RectangleBackgroundTheme ( +RectangleBackgroundTheme::~RectangleBackgroundTheme() +{ +} + + + BitmapEx RectangleBackgroundTheme::CreateBackground ( const OutputDevice& rTemplateDevice, const bool bIsButtonDown) const @@ -993,6 +1007,12 @@ BitmapBackgroundTheme::BitmapBackgroundTheme ( +BitmapBackgroundTheme::~BitmapBackgroundTheme() +{ +} + + + BitmapEx BitmapBackgroundTheme::CreateBackground ( const OutputDevice& rTemplateDevice, const bool bIsButtonDown) const diff --git a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx index de560b64f77d..1f23cd68773e 100644 --- a/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx +++ b/sd/source/ui/slidesorter/view/SlsLayeredDevice.cxx @@ -50,6 +50,10 @@ public: { } + virtual ~LayerInvalidator() + { + } + virtual void Invalidate (const Rectangle& rInvalidationBox) { mpLayeredDevice->Invalidate(rInvalidationBox, mnLayer); diff --git a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx index 20022caf4a4d..f2f0790beaee 100644 --- a/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx +++ b/sd/source/ui/slidesorter/view/SlsPageObjectPainter.cxx @@ -542,7 +542,7 @@ Bitmap PageObjectPainter::CreateBackgroundBitmap( else { Color aColor (aTopColor); - aColor.Merge(aBottomColor, 255 * (nY2-nY) / (nY2-nY1)); + aColor.Merge(aBottomColor, static_cast< sal_uInt8 >(255 * (nY2-nY) / (nY2-nY1))); aBitmapDevice.SetLineColor(aColor); } aBitmapDevice.DrawLine( diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx index fd1a8debee0e..f425d2a78c37 100644 --- a/sd/source/ui/slidesorter/view/SlsTheme.cxx +++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx @@ -40,20 +40,20 @@ const static ColorData White = 0xffffff; -ColorData ChangeLuminance (const ColorData aColorData, const int nValue) +ColorData ChangeLuminance (const ColorData aColorData, const sal_uInt8 nValue) { Color aColor (aColorData); if (nValue > 0) aColor.IncreaseLuminance(nValue); else - aColor.DecreaseLuminance(-nValue); + aColor.DecreaseLuminance(nValue); return aColor.GetColor(); } ColorData HGBAdapt ( const ColorData aColorData, - const sal_Int32 nNewSaturation, - const sal_Int32 nNewBrightness) + const sal_Int16 nNewSaturation, + const sal_Int16 nNewBrightness) { sal_uInt16 nHue (0); sal_uInt16 nSaturation (0); @@ -376,13 +376,16 @@ void Theme::SetGradient ( rGradient.mnSaturationOverride = nSaturationOverride; rGradient.mnBrightnessOverride = nBrightnessOverride; const ColorData aColor (nSaturationOverride>=0 || nBrightnessOverride>=0 - ? HGBAdapt(aBaseColor, nSaturationOverride, nBrightnessOverride) + ? HGBAdapt( + aBaseColor, + static_cast< sal_uInt16 >(nSaturationOverride), + static_cast< sal_uInt16 >(nBrightnessOverride)) : aBaseColor); - rGradient.maFillColor1 = ChangeLuminance(aColor, nFillStartOffset); - rGradient.maFillColor2 = ChangeLuminance(aColor, nFillEndOffset); - rGradient.maBorderColor1 = ChangeLuminance(aColor, nBorderStartOffset); - rGradient.maBorderColor2 = ChangeLuminance(aColor, nBorderEndOffset); + rGradient.maFillColor1 = ChangeLuminance(aColor, static_cast< sal_uInt8 >(nFillStartOffset)); + rGradient.maFillColor2 = ChangeLuminance(aColor, static_cast< sal_uInt8 >(nFillEndOffset)); + rGradient.maBorderColor1 = ChangeLuminance(aColor, static_cast< sal_uInt8 >(nBorderStartOffset)); + rGradient.maBorderColor2 = ChangeLuminance(aColor, static_cast< sal_uInt8 >(nBorderEndOffset)); rGradient.mnFillOffset1 = nFillStartOffset; rGradient.mnFillOffset2 = nFillEndOffset; diff --git a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx index 0361b163eba5..d886057ae51d 100644 --- a/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx +++ b/sd/source/ui/slidesorter/view/SlsViewCacheContext.cxx @@ -129,7 +129,9 @@ const SdrPage* ViewCacheContext::GetPage (cache::CacheKey aKey) sal_Int32 ViewCacheContext::GetPriority (cache::CacheKey aKey) { - return - (static_cast<const SdrPage*>(aKey)->GetPageNumber()-1) / 2; + const sal_uInt32 nPageNumber((static_cast< const SdrPage* >(aKey)->GetPageNumber() - 1) / 2); + + return -static_cast< sal_Int32 >(nPageNumber); } @@ -137,7 +139,8 @@ sal_Int32 ViewCacheContext::GetPriority (cache::CacheKey aKey) model::SharedPageDescriptor ViewCacheContext::GetDescriptor (cache::CacheKey aKey) { - sal_uInt16 nPageIndex ((static_cast<const SdrPage*>(aKey)->GetPageNumber() - 1) / 2); + sal_uInt32 nPageIndex ((static_cast<const SdrPage*>(aKey)->GetPageNumber() - 1) / 2); + return mrModel.GetPageDescriptor(nPageIndex); } diff --git a/sd/source/ui/table/tableobjectbar.cxx b/sd/source/ui/table/tableobjectbar.cxx index e3d01753a355..35f9a1463817 100644 --- a/sd/source/ui/table/tableobjectbar.cxx +++ b/sd/source/ui/table/tableobjectbar.cxx @@ -149,9 +149,9 @@ void TableObjectBar::Execute( SfxRequest& rReq ) { SdrView* pView = mpView; SfxBindings* pBindings = &mpViewSh->GetViewFrame()->GetBindings(); - rtl::Reference< sdr::SelectionController > xController( mpView->getSelectionController() ); - sal_uLong nSlotId = rReq.GetSlot(); + sal_uInt16 nSlotId = rReq.GetSlot(); + if( xController.is() ) { switch( nSlotId ) @@ -160,7 +160,12 @@ void TableObjectBar::Execute( SfxRequest& rReq ) case SID_TABLE_INSERT_COL_DLG: { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ::std::auto_ptr<SvxAbstractInsRowColDlg> pDlg( pFact ? pFact->CreateSvxInsRowColDlg( mpView->GetViewShell()->GetParentWindow(), nSlotId == SID_TABLE_INSERT_COL_DLG, SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) : 0); + ::std::auto_ptr<SvxAbstractInsRowColDlg> pDlg( pFact + ? pFact->CreateSvxInsRowColDlg( + mpView->GetViewShell()->GetParentWindow(), + nSlotId == SID_TABLE_INSERT_COL_DLG, + SD_MOD()->GetSlotPool()->GetSlot(nSlotId)->GetCommand()) + : 0); if( pDlg.get() && (pDlg->Execute() == 1) ) { @@ -169,10 +174,10 @@ void TableObjectBar::Execute( SfxRequest& rReq ) else nSlotId = SID_TABLE_INSERT_COL; - rReq.AppendItem( SfxInt16Item( (sal_uInt16)nSlotId, (sal_uInt16)pDlg->getInsertCount() ) ); + rReq.AppendItem( SfxInt16Item( nSlotId, (sal_uInt16)pDlg->getInsertCount() ) ); rReq.AppendItem( SfxBoolItem( SID_TABLE_PARAM_INSERT_AFTER, !pDlg->isInsertBefore() ) ); - rReq.SetSlot( (sal_uInt16)nSlotId ); + rReq.SetSlot( nSlotId ); } } } diff --git a/sd/source/ui/unoidl/unolayer.cxx b/sd/source/ui/unoidl/unolayer.cxx index 8ece62f438dc..2eb39a41848a 100644 --- a/sd/source/ui/unoidl/unolayer.cxx +++ b/sd/source/ui/unoidl/unolayer.cxx @@ -543,8 +543,8 @@ uno::Reference< drawing::XLayer > SAL_CALL SdLayerManager::insertNewByIndex( sal if( mpModel->mpDoc ) { SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetModelLayerAdmin(); - sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount(); - sal_uInt16 nLayer = nLayerCnt - 2 + 1; + sal_uInt32 nLayerCnt = rLayerAdmin.GetLayerCount(); + sal_uInt32 nLayer = nLayerCnt - 2 + 1; String aLayerName; // Ueberpruefung auf schon vorhandene Namen @@ -697,7 +697,7 @@ uno::Sequence< OUString > SAL_CALL SdLayerManager::getElementNames() throw lang::DisposedException(); SdrLayerAdmin& rLayerAdmin = mpModel->mpDoc->GetModelLayerAdmin(); - const sal_uInt16 nLayerCount = rLayerAdmin.GetLayerCount(); + const sal_uInt32 nLayerCount = rLayerAdmin.GetLayerCount(); uno::Sequence< OUString > aSeq( nLayerCount ); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 1cc316d65deb..d8910241e5f5 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2517,7 +2517,7 @@ void SAL_CALL SdDrawPagesAccess::remove( const uno::Reference< drawing::XDrawPag SdDrawDocument& rDoc = *mpModel->mpDoc; - sal_uInt16 nPageCount = rDoc.GetSdPageCount( PK_STANDARD ); + const sal_uInt32 nPageCount(rDoc.GetSdPageCount( PK_STANDARD )); if( nPageCount > 1 ) { // pPage von xPage besorgen und dann die Id (nPos )ermitteln @@ -2990,10 +2990,9 @@ SdPage* SdDocLinkTargets::FindPage( const OUString& rName ) const throw() if( mpDoc == NULL ) return NULL; - const sal_uInt16 nMaxPages = mpDoc->GetPageCount(); - const sal_uInt16 nMaxMasterPages = mpDoc->GetMasterPageCount(); - - sal_uInt16 nPage; + const sal_uInt32 nMaxPages = mpDoc->GetPageCount(); + const sal_uInt32 nMaxMasterPages = mpDoc->GetMasterPageCount(); + sal_uInt32 nPage; SdPage* pPage; const String aName( rName ); diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx index c2ee9c9a026f..4139cc95ab40 100644 --- a/sd/source/ui/view/DocumentRenderer.cxx +++ b/sd/source/ui/view/DocumentRenderer.cxx @@ -879,9 +879,11 @@ namespace { const Size aPrintSize(rPrinter.GetOutputSize()); const sal_Int32 nPageWidth (aPageSize.Width() + mnGap - - pPageToPrint->GetLeftPageBorder() - pPageToPrint->GetRightPageBorder()); + - basegfx::fround(pPageToPrint->GetLeftPageBorder()) + - basegfx::fround(pPageToPrint->GetRightPageBorder())); const sal_Int32 nPageHeight (aPageSize.Height() + mnGap - - pPageToPrint->GetTopPageBorder() - pPageToPrint->GetBottomPageBorder()); + - basegfx::fround(pPageToPrint->GetTopPageBorder()) + - basegfx::fround(pPageToPrint->GetBottomPageBorder())); if (nPageWidth<=0 || nPageHeight<=0) return; @@ -925,8 +927,8 @@ namespace { { public: BookletPrinterPage ( - const sal_uInt16 nFirstPageIndex, - const sal_uInt16 nSecondPageIndex, + const sal_uInt32 nFirstPageIndex, + const sal_uInt32 nSecondPageIndex, const Point& rFirstOffset, const Point& rSecondOffset, const PageKind ePageKind, @@ -1725,14 +1727,14 @@ private: long nPageH = aOutRect.GetHeight(); - for (sal_uInt16 + for (sal_uInt32 nIndex=0, nCount=mrBase.GetDocument()->GetSdPageCount(PK_STANDARD); nIndex < nCount; ) { pOutliner->Clear(); - pOutliner->SetFirstPageNumber(nIndex+1); + pOutliner->SetFirstPageNumber(static_cast< sal_uInt16 >(nIndex+1)); Paragraph* pPara = NULL; sal_Int32 nH (0); @@ -1920,8 +1922,8 @@ private: ++nShapeCount; } - const sal_uInt16 nPageCount = mrBase.GetDocument()->GetSdPageCount(PK_STANDARD); - const sal_uInt16 nHandoutPageCount = nShapeCount ? (nPageCount + nShapeCount - 1) / nShapeCount : 0; + const sal_uInt32 nPageCount = mrBase.GetDocument()->GetSdPageCount(PK_STANDARD); + const sal_uInt32 nHandoutPageCount = nShapeCount ? (nPageCount + nShapeCount - 1) / nShapeCount : 0; pViewShell->SetPrintedHandoutPageCount( nHandoutPageCount ); mrBase.GetDocument()->setHandoutPageCount( nHandoutPageCount ); @@ -2008,7 +2010,7 @@ private: pViewShell->WriteFrameViewData(); Point aPtZero; - for (sal_uInt16 + for (sal_uInt32 nIndex=0, nCount=mrBase.GetDocument()->GetSdPageCount(PK_STANDARD); nIndex < nCount; @@ -2047,8 +2049,8 @@ private: rInfo.msPageString = ::rtl::OUString(); rInfo.msPageString += rInfo.msTimeDate; - long aPageWidth = aPageSize.Width() - pPage->GetLeftPageBorder() - pPage->GetRightPageBorder(); - long aPageHeight = aPageSize.Height() - pPage->GetTopPageBorder() - pPage->GetBottomPageBorder(); + const long aPageWidth(basegfx::fround(pPage->GetInnerPageScale().getX())); + const long aPageHeight(basegfx::fround(pPage->GetInnerPageScale().getY())); // Bugfix zu 44530: // Falls implizit umgestellt wurde (Landscape/Portrait) // wird dies beim Kacheln, bzw. aufteilen (Poster) beruecksichtigt @@ -2134,8 +2136,8 @@ private: } // create vector of pages to print - ::std::vector< sal_uInt16 > aPageVector; - for (sal_uInt16 + ::std::vector< sal_uInt32 > aPageVector; + for (sal_uInt32 nIndex=0, nCount=mrBase.GetDocument()->GetSdPageCount(ePageKind); nIndex < nCount; @@ -2147,14 +2149,14 @@ private: } // create pairs of pages to print on each page - typedef ::std::vector< ::std::pair< sal_uInt16, sal_uInt16 > > PairVector; + typedef ::std::vector< ::std::pair< sal_uInt32, sal_uInt32 > > PairVector; PairVector aPairVector; if ( ! aPageVector.empty()) { sal_uInt32 nFirstIndex = 0, nLastIndex = aPageVector.size() - 1; if( aPageVector.size() & 1 ) - aPairVector.push_back( ::std::make_pair( (sal_uInt16) 65535, aPageVector[ nFirstIndex++ ] ) ); + aPairVector.push_back( ::std::make_pair( (sal_uInt32) 0xffffffff, aPageVector[ nFirstIndex++ ] ) ); else aPairVector.push_back( ::std::make_pair( aPageVector[ nLastIndex-- ], aPageVector[ nFirstIndex++ ] ) ); @@ -2177,7 +2179,7 @@ private: if ((!bIsIndexOdd && mpOptions->IsPrintFrontPage()) || (bIsIndexOdd && mpOptions->IsPrintBackPage())) { - const ::std::pair<sal_uInt16, sal_uInt16> aPair (aPairVector[nIndex]); + const ::std::pair<sal_uInt32, sal_uInt32> aPair (aPairVector[nIndex]); Point aSecondOffset (aOffset); if (rInfo.meOrientation == ORIENTATION_LANDSCAPE) aSecondOffset.X() += aAdjustedPrintSize.Width() / 2; @@ -2296,9 +2298,13 @@ private: // keep the page content at its position if it fits, otherwise // move it to the printable area const long nPageWidth ( - rInfo.maPageSize.Width() - rPage.GetLeftPageBorder() - rPage.GetRightPageBorder()); + rInfo.maPageSize.Width() + - basegfx::fround(rPage.GetLeftPageBorder()) + - basegfx::fround(rPage.GetRightPageBorder())); const long nPageHeight ( - rInfo.maPageSize.Height() - rPage.GetTopPageBorder() - rPage.GetBottomPageBorder()); + rInfo.maPageSize.Height() + - basegfx::fround(rPage.GetTopPageBorder()) + - basegfx::fround(rPage.GetBottomPageBorder())); #if 0 Point aOrigin ( nPageWidth < rInfo.maPrintSize.Width() ? -aPageOffset.X() : 0, diff --git a/sd/source/ui/view/ViewClipboard.cxx b/sd/source/ui/view/ViewClipboard.cxx index baada9eee392..ef80c9b5c8e7 100644 --- a/sd/source/ui/view/ViewClipboard.cxx +++ b/sd/source/ui/view/ViewClipboard.cxx @@ -185,7 +185,7 @@ void ViewClipboard::AssignMasterPage ( -sal_uInt16 ViewClipboard::DetermineInsertPosition ( +sal_uInt32 ViewClipboard::DetermineInsertPosition ( const SdTransferable& ) { SdDrawDocument* pDoc = mrView.GetDoc(); @@ -208,13 +208,13 @@ sal_uInt16 ViewClipboard::DetermineInsertPosition ( -sal_uInt16 ViewClipboard::InsertSlides ( +sal_uInt32 ViewClipboard::InsertSlides ( const SdTransferable& rTransferable, - sal_uInt16 nInsertPosition) + sal_uInt32 nInsertPosition) { SdDrawDocument* pDoc = mrView.GetDoc(); - sal_uInt16 nInsertPgCnt = 0; + sal_uInt32 nInsertPgCnt = 0; bool bMergeMasterPages = !rTransferable.HasSourceDoc( pDoc ); // Prepare the insertion. @@ -226,7 +226,7 @@ sal_uInt16 ViewClipboard::InsertSlides ( // pages are inserted. pBookmarkList = &rTransferable.GetPageBookmarks(); pDataDocSh = rTransferable.GetPageDocShell(); - nInsertPgCnt = (sal_uInt16)pBookmarkList->Count(); + nInsertPgCnt = pBookmarkList->Count(); } else { diff --git a/sd/source/ui/view/ViewTabBar.cxx b/sd/source/ui/view/ViewTabBar.cxx index 02b323dde9e9..e8b888028450 100644 --- a/sd/source/ui/view/ViewTabBar.cxx +++ b/sd/source/ui/view/ViewTabBar.cxx @@ -624,11 +624,11 @@ void ViewTabBar::UpdateActiveButton (void) if (xView.is()) { Reference<XResourceId> xViewId (xView->getResourceId()); - for (sal_uInt16 nIndex=0; nIndex<maTabBarButtons.size(); ++nIndex) + for (sal_uInt32 nIndex=0; nIndex<maTabBarButtons.size(); ++nIndex) { if (maTabBarButtons[nIndex].ResourceId->compareTo(xViewId) == 0) { - mpTabControl->SetCurPageId(nIndex+1); + mpTabControl->SetCurPageId(static_cast< sal_uInt16 >(nIndex+1)); mpTabControl->::TabControl::ActivatePage(); break; } @@ -647,18 +647,21 @@ void ViewTabBar::UpdateTabBarButtons (void) for (iTab=maTabBarButtons.begin(),nIndex=1; iTab!=maTabBarButtons.end(); ++iTab,++nIndex) { // Create a new tab when there are not enough. + const sal_uInt16 nIndex16(static_cast< sal_uInt16 >(nIndex)); if (nPageCount < nIndex) - mpTabControl->InsertPage(nIndex, iTab->ButtonLabel); + mpTabControl->InsertPage(nIndex16, iTab->ButtonLabel); // Update the tab. - mpTabControl->SetPageText(nIndex, iTab->ButtonLabel); - mpTabControl->SetHelpText(nIndex, iTab->HelpText); - mpTabControl->SetTabPage(nIndex, mpTabPage.get()); + mpTabControl->SetPageText(nIndex16, iTab->ButtonLabel); + mpTabControl->SetHelpText(nIndex16, iTab->HelpText); + mpTabControl->SetTabPage(nIndex16, mpTabPage.get()); } // Delete tabs that are no longer used. for (; nIndex<=nPageCount; ++nIndex) - mpTabControl->RemovePage(nIndex); + { + mpTabControl->RemovePage(static_cast< sal_uInt16 >(nIndex)); + } mpTabPage->Hide(); } diff --git a/sd/source/ui/view/clview.cxx b/sd/source/ui/view/clview.cxx index 1db0867d4ba2..524ac374bbee 100644 --- a/sd/source/ui/view/clview.cxx +++ b/sd/source/ui/view/clview.cxx @@ -69,9 +69,10 @@ ClientView::~ClientView() |* \************************************************************************/ -void ClientView::InvalidateOneWin(::Window& rWin) +void ClientView::InvalidateOneWin(::Window& rWin) const { Region aRegion; + CompleteRedraw(&rWin, aRegion); } @@ -82,7 +83,7 @@ void ClientView::InvalidateOneWin(::Window& rWin) |* \************************************************************************/ -void ClientView::InvalidateOneWin(::Window& rWin, const basegfx::B2DRange& rRange) +void ClientView::InvalidateOneWin(::Window& rWin, const ::basegfx::B2DRange& rRange) const { if(!rRange.isEmpty()) { @@ -101,7 +102,7 @@ void ClientView::InvalidateOneWin(::Window& rWin, const basegfx::B2DRange& rRang |* \************************************************************************/ -void ClientView::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector ) +void ClientView::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector ) const { DrawView::CompleteRedraw(pOutDev, rReg, pRedirector); } diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx index a750ed1dcc79..ed812700f067 100644 --- a/sd/source/ui/view/drawview.cxx +++ b/sd/source/ui/view/drawview.cxx @@ -493,12 +493,12 @@ bool DrawView::SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAtt |* \************************************************************************/ -void DrawView::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector /*=0L*/) +void DrawView::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector /*=0L*/) const { if( mpVDev ) { delete mpVDev; - mpVDev = NULL; + const_cast< DrawView* >(this)->mpVDev = NULL; } bool bStandardPaint = true; @@ -531,7 +531,7 @@ void DrawView::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::co |* \************************************************************************/ -void DrawView::PresPaint(const Region& rRegion) +void DrawView::PresPaint(const Region& rRegion) const { if(mpViewSh) { diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 33a97d722de8..e66cfbac8384 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -146,7 +146,7 @@ void DrawViewShell::UIDeactivated( SfxInPlaceClient* pCli ) |* \************************************************************************/ -void DrawViewShell::Deactivate(sal_Bool bIsMDIActivate) +void DrawViewShell::Deactivate(sal_Bool /*bIsMDIActivate*/) { // Do not forward to ViewShell::Deactivate() to prevent a context change. } @@ -356,7 +356,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) { ViewShellManager::UpdateLock aLock (GetViewShellBase().GetViewShellManager()); - sal_uInt16 nActualPageNum = 0; + sal_uInt32 nActualPageNum = 0; GetViewShellBase().GetDrawController().FireChangeEditMode (eEMode == EM_MASTERPAGE); GetViewShellBase().GetDrawController().FireChangeLayerMode (bIsLayerModeActive); @@ -413,7 +413,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) { pPage = GetDoc()->GetSdPage(i, mePageKind); aPageName = pPage->GetName(); - maTabControl.InsertPage(i + 1, aPageName); + maTabControl.InsertPage(static_cast< sal_uInt16 >(i + 1), aPageName); if ( pPage->IsSelected() && nActualPageNum == 0 ) { @@ -421,7 +421,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) } } - maTabControl.SetCurPageId(nActualPageNum + 1); + maTabControl.SetCurPageId(static_cast< sal_uInt16 >(nActualPageNum + 1)); SwitchPage(nActualPageNum); } @@ -449,7 +449,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) String aLayoutName(pMaster->GetLayoutName()); aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR)); - maTabControl.InsertPage(i + 1, aLayoutName); + maTabControl.InsertPage(static_cast< sal_uInt16 >(i + 1), aLayoutName); if (&(mpActualPage->TRG_GetMasterPage()) == pMaster) { @@ -457,7 +457,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) } } - maTabControl.SetCurPageId(nActualMasterPageNum + 1); + maTabControl.SetCurPageId(static_cast< sal_uInt16 >(nActualMasterPageNum + 1)); SwitchPage(nActualMasterPageNum); } @@ -478,7 +478,9 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool bIsLayerModeActive) // Set the tab control only for draw pages. For master page // this has been done already above. if (meEditMode == EM_PAGE) - maTabControl.SetCurPageId (nActualPageNum + 1); + { + maTabControl.SetCurPageId(static_cast< sal_uInt16 >(nActualPageNum + 1)); + } } /*AF: The LayerDialogChildWindow is not used anymore (I hope). if (GetViewFrame()->KnowsChildWindow( @@ -731,7 +733,7 @@ void DrawViewShell::ResetActualPage() GetDoc()->SetSelected(pPage, i == nCurrentPage); } - maTabControl.SetCurPageId(nCurrentPage + 1); + maTabControl.SetCurPageId(static_cast< sal_uInt16 >(nCurrentPage + 1)); } else // EM_MASTERPAGE { @@ -751,7 +753,7 @@ void DrawViewShell::ResetActualPage() nActualMasterPageNum = i; } - maTabControl.SetCurPageId(nActualMasterPageNum + 1); + maTabControl.SetCurPageId(static_cast< sal_uInt16 >(nActualMasterPageNum + 1)); SwitchPage(nActualMasterPageNum); } @@ -1121,7 +1123,7 @@ bool DrawViewShell::SwitchPage(sal_uInt32 nSelectedPage) } } - maTabControl.SetCurPageId(nSelectedPage+1); + maTabControl.SetCurPageId(static_cast< sal_uInt16 >(nSelectedPage + 1)); String aPageName = mpActualPage->GetName(); if (maTabControl.GetPageText(nSelectedPage+1) != aPageName) @@ -1191,7 +1193,7 @@ bool DrawViewShell::SwitchPage(sal_uInt32 nSelectedPage) String aLayoutName(pMaster->GetLayoutName()); aLayoutName.Erase(aLayoutName.SearchAscii(SD_LT_SEPARATOR)); - maTabControl.SetCurPageId(nSelectedPage+1); + maTabControl.SetCurPageId(static_cast< sal_uInt16 >(nSelectedPage + 1)); if (maTabControl.GetPageText(nSelectedPage+1) != aLayoutName) { @@ -1355,7 +1357,7 @@ void DrawViewShell::ResetActualLayer() mpDrawView->SetActiveLayer( pLayerBar->GetPageText(aTheActiveLayer + 1) ); } - pLayerBar->SetCurPageId(aTheActiveLayer + 1); + pLayerBar->SetCurPageId(static_cast< sal_uInt16 >(aTheActiveLayer + 1)); GetViewFrame()->GetBindings().Invalidate( SID_MODIFYLAYER ); GetViewFrame()->GetBindings().Invalidate( SID_DELETE_LAYER ); } diff --git a/sd/source/ui/view/drviews5.cxx b/sd/source/ui/view/drviews5.cxx index 4af7cf8c8521..b1d362d29c04 100644 --- a/sd/source/ui/view/drviews5.cxx +++ b/sd/source/ui/view/drviews5.cxx @@ -704,7 +704,7 @@ void DrawViewShell::SetActiveTabLayerIndex (int nIndex) { // Tell the draw view and the tab control of the new active layer. mpDrawView->SetActiveLayer (pBar->GetPageText (pBar->GetPageId ((sal_uInt16)nIndex))); - pBar->SetCurPageId (pBar->GetPageId ((sal_uInt16)nIndex)); + pBar->SetCurPageId(static_cast< sal_uInt16 >(pBar->GetPageId(nIndex))); } } } diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index a0355a9e0dad..77dd335902c6 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1438,6 +1438,8 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) bFoundNoGraphicObj = true; break; } + default: + break; } } else diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx index 0e495e113cb7..e6b59202e670 100644 --- a/sd/source/ui/view/drviews8.cxx +++ b/sd/source/ui/view/drviews8.cxx @@ -494,7 +494,6 @@ void DrawViewShell::ScannerEvent( const ::com::sun::star::lang::EventObject& ) const ::vos::OGuard aGuard( Application::GetSolarMutex() ); SdrPage& rPage = mpDrawView->GetSdrPageView()->getSdrPageFromSdrPageView(); Size aBmpSize( aScanBmp.GetPrefSize() ); - Size aPageSize(basegfx::fround(rPage.GetPageScale().getX()), basegfx::fround(rPage.GetPageScale().getY())); const MapMode aMap100( MAP_100TH_MM ); if( !aBmpSize.Width() || !aBmpSize.Height() ) @@ -505,8 +504,9 @@ void DrawViewShell::ScannerEvent( const ::com::sun::star::lang::EventObject& ) else aBmpSize = OutputDevice::LogicToLogic( aBmpSize, aScanBmp.GetPrefMapMode(), aMap100 ); - aPageSize.Width() -= rPage.GetLeftPageBorder() + rPage.GetRightPageBorder(); - aPageSize.Height() -= rPage.GetTopPageBorder() + rPage.GetBottomPageBorder(); + const Size aPageSize( + basegfx::fround(rPage.GetInnerPageScale().getX()), + basegfx::fround(rPage.GetInnerPageScale().getY())); if( ( ( aBmpSize.Height() > aPageSize.Height() ) || ( aBmpSize.Width() > aPageSize.Width() ) ) && aBmpSize.Height() && aPageSize.Height() ) { @@ -526,7 +526,9 @@ void DrawViewShell::ScannerEvent( const ::com::sun::star::lang::EventObject& ) } Point aPnt ( ( aPageSize.Width() - aBmpSize.Width() ) >> 1, ( aPageSize.Height() - aBmpSize.Height() ) >> 1 ); - aPnt += Point( rPage.GetLeftPageBorder(), rPage.GetTopPageBorder() ); + aPnt += Point( + basegfx::fround(rPage.GetLeftPageBorder()), + basegfx::fround(rPage.GetTopPageBorder()) ); SdrGrafObj* pGrafObj = NULL; bool bInsertNewObject = true; SdrGrafObj* pTargetObj = dynamic_cast< SdrGrafObj* >(GetView()->getSelectedIfSingle()); diff --git a/sd/source/ui/view/drviewsa.cxx b/sd/source/ui/view/drviewsa.cxx index 5369da94ae79..9726f4006019 100644 --- a/sd/source/ui/view/drviewsa.cxx +++ b/sd/source/ui/view/drviewsa.cxx @@ -705,7 +705,7 @@ void DrawViewShell::GetStatusBarState(SfxItemSet& rSet) aPagePos.setX(aPagePos.getX() - (aPageScale.getX() * 0.5)); const basegfx::B2DRange aFullPageZoomRange( aPagePos, aPagePos + aPageScale ); - aZoomItem.AddSnappingPoint( pActiveWindow->GetZoomForRange( aFullPageZoomRange ) ); + aZoomItem.AddSnappingPoint( static_cast< sal_Int32 >(pActiveWindow->GetZoomForRange( aFullPageZoomRange ))); } aZoomItem.AddSnappingPoint(100); rSet.Put( aZoomItem ); diff --git a/sd/source/ui/view/drviewsb.cxx b/sd/source/ui/view/drviewsb.cxx index 22672e20b516..51c7e85831a3 100644 --- a/sd/source/ui/view/drviewsb.cxx +++ b/sd/source/ui/view/drviewsb.cxx @@ -98,8 +98,8 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq) } SdrLayerAdmin& rLayerAdmin = GetDoc()->GetModelLayerAdmin(); - sal_uInt16 nLayerCnt = rLayerAdmin.GetLayerCount(); - sal_uInt16 nLayer = nLayerCnt - 2 + 1; + sal_uInt32 nLayerCnt = rLayerAdmin.GetLayerCount(); + sal_uInt32 nLayer = nLayerCnt - 2 + 1; String aLayerName ( SdResId(STR_LAYER) ), aLayerTitle, aLayerDesc; aLayerName += String::CreateFromInt32( (sal_Int32)nLayer ); bool bIsVisible = false; @@ -190,7 +190,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq) String aPrevLayer = mpDrawView->GetActiveLayer(); String aName; SdrLayer* pLayer; - sal_uInt16 nPrevLayer = 0; + sal_uInt32 nPrevLayer = 0; nLayerCnt = rLayerAdmin.GetLayerCount(); for ( nLayer = 0; nLayer < nLayerCnt; nLayer++ ) @@ -201,7 +201,7 @@ void DrawViewShell::FuTemp02(SfxRequest& rReq) if ( aPrevLayer == aName ) { // nPrevLayer = nLayer; - nPrevLayer = Max(nLayer, (sal_uInt16) 4); + nPrevLayer = std::max(nLayer, sal_uInt32(4)); } } @@ -770,7 +770,7 @@ bool DrawViewShell::RenameSlide( sal_uInt32 nPageId, const String & rName ) if( bSuccess ) { // user edited page names may be changed by the page so update control - maTabControl.SetPageText( nPageId, rName ); + maTabControl.SetPageText( static_cast< sal_uInt16 >(nPageId), rName ); // set document to modified state GetDoc()->SetChanged( true ); diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 87f7281f820f..ac5e44fd1d3a 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -444,8 +444,8 @@ static OUString createHelpLinesString( const SdrHelpLineList& rHelpLines ) { ::rtl::OUStringBuffer aLines; - const sal_uInt16 nCount = rHelpLines.GetCount(); - for( sal_uInt16 nHlpLine = 0; nHlpLine < nCount; nHlpLine++ ) + const sal_uInt32 nCount = rHelpLines.GetCount(); + for( sal_uInt32 nHlpLine = 0; nHlpLine < nCount; nHlpLine++ ) { const SdrHelpLine& rHelpLine = rHelpLines[nHlpLine]; const basegfx::B2DPoint& rPos = rHelpLine.GetPos(); diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index bc8f8c0e0ba3..b3acc2823830 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1424,7 +1424,7 @@ void OutlineViewShell::GetStatusBarState(SfxItemSet& rSet) if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_STATUS_PAGE ) || SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_STATUS_LAYOUT ) ) */ - sal_uInt16 nPageCount = GetDoc()->GetSdPageCount( PK_STANDARD ); + sal_uInt32 nPageCount = GetDoc()->GetSdPageCount( PK_STANDARD ); String aPageStr, aLayoutStr; ::sd::Window* pWin = GetActiveWindow(); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 047b91bb7290..a81212f58a7d 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -586,7 +586,7 @@ SdPage* OutlineView::InsertSlideForParagraph( Paragraph* pPara ) { nExample = nTarget - 1; - sal_uInt16 nPageCount = mpDoc->GetSdPageCount( PK_STANDARD ); + sal_uInt32 nPageCount = mpDoc->GetSdPageCount( PK_STANDARD ); if( nExample >= nPageCount ) nExample = nPageCount - 1; } @@ -965,11 +965,13 @@ IMPL_LINK( OutlineView, StatusEventHdl, EditStatus *, EMPTYARG ) if (!aVis.IsEmpty()) // nicht beim Oeffnen { - const Size aTextSize(OUTLINE_PAPERWIDTH, mpOutliner->GetTextHeight() + pWin->GetLogicVector().getY()); + const basegfx::B2DVector aTextSize( + OUTLINE_PAPERWIDTH, + mpOutliner->GetTextHeight() + pWin->GetLogicVector().getY()); mpOutlineViewShell->InitWindows( basegfx::B2DPoint(0.0, 0.0), - basegfx::B2DVector(aTextSize.Width(), aTextSize.Height()), + aTextSize, basegfx::B2DPoint(aVis.Left(), aVis.Top())); mpOutlineViewShell->UpdateScrollBars(); } @@ -1842,7 +1844,7 @@ void OutlineView::TryToMergeUndoActions() pEditUndo = dynamic_cast< EditUndo* >(pListAction->aUndoActions[--nAction].pAction); } - sal_uInt16 nEditPos = nAction; // we need this later to remove the merged undo actions + size_t nEditPos = nAction; // we need this later to remove the merged undo actions // make sure it is the only EditUndo action in the top undo list while( pEditUndo && nAction ) @@ -1895,8 +1897,8 @@ void OutlineView::TryToMergeUndoActions() if( pSourceList && pDestinationList ) { - sal_uInt16 nCount = pSourceList->aUndoActions.size(); - sal_uInt16 nDestAction = pDestinationList->aUndoActions.size(); + size_t nCount = pSourceList->aUndoActions.size(); + size_t nDestAction = pDestinationList->aUndoActions.size(); while( nCount-- ) { SfxUndoAction* pTemp = pSourceList->aUndoActions[0].pAction; diff --git a/sd/source/ui/view/presvish.cxx b/sd/source/ui/view/presvish.cxx index 72c49813d4df..9f107b144b14 100644 --- a/sd/source/ui/view/presvish.cxx +++ b/sd/source/ui/view/presvish.cxx @@ -139,7 +139,7 @@ SvxRuler* PresentationViewShell::CreateVRuler(::sd::Window*) } -void PresentationViewShell::Activate( bool bIsMDIActivate ) +void PresentationViewShell::Activate( sal_Bool bIsMDIActivate ) { DrawViewShell::Activate( bIsMDIActivate ); diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index c8802b4a2f2c..f2fe021c292f 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -497,7 +497,7 @@ drawinglayer::primitive2d::Primitive2DSequence ViewRedirector::createRedirectedP |* \************************************************************************/ -void View::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector /*=0L*/) +void View::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector /*=0L*/) const { // ausfuehren ?? if (mnLockRedrawSmph == 0) @@ -536,7 +536,9 @@ void View::CompleteRedraw(OutputDevice* pOutDev, const Region& rReg, sdr::contac else { if (!mpLockedRedraws) - mpLockedRedraws = new List; + { + const_cast< View* >(this)->mpLockedRedraws = new List; + } SdViewRedrawRec* pRec = new SdViewRedrawRec; pRec->mpOut = pOutDev; diff --git a/sd/source/ui/view/tabcontr.cxx b/sd/source/ui/view/tabcontr.cxx index b6d8f46e5563..d54db2812066 100644 --- a/sd/source/ui/view/tabcontr.cxx +++ b/sd/source/ui/view/tabcontr.cxx @@ -293,13 +293,13 @@ sal_Int8 TabControl::ExecuteDrop( const ExecuteDropEvent& rEvt ) if (pDrViewSh->IsSwitchPageAllowed()) { // 1. Create a copy. - sal_uInt16 nPageNumOfCopy = pDoc->DuplicatePage (GetCurPageId() - 1); + sal_uInt32 nPageNumOfCopy = pDoc->DuplicatePage (GetCurPageId() - 1); // 2. Move page. For this first switch to the copy: // MovePages operates on the currently selected page(s). pDrViewSh->SwitchPage (nPageNumOfCopy); // Adapt target page id when necessary, i.e. page copy // has been inserted in front of the target page. - sal_uInt16 nPageNum = nPageId; + sal_uInt32 nPageNum = nPageId; if ((nPageNumOfCopy <= nPageNum) && (nPageNum != (sal_uInt16)-1)) nPageNum += 1; if (pDoc->MovePages(nPageNum)) @@ -309,7 +309,7 @@ sal_Int8 TabControl::ExecuteDrop( const ExecuteDropEvent& rEvt ) // be executed after the still pending ones. if (nPageNumOfCopy >= nPageNum || (nPageNum == (sal_uInt16)-1)) nPageNum += 1; - SetCurPageId (GetPageId(nPageNum)); + SetCurPageId(GetPageId(static_cast< sal_uInt16 >(nPageNum))); SfxDispatcher* pDispatcher = pDrViewSh->GetViewFrame()->GetDispatcher(); pDispatcher->Execute(SID_SWITCHPAGE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD); diff --git a/sd/source/ui/view/viewshel.cxx b/sd/source/ui/view/viewshel.cxx index 9b59e3a871e2..7010a93f66fb 100644 --- a/sd/source/ui/view/viewshel.cxx +++ b/sd/source/ui/view/viewshel.cxx @@ -725,15 +725,19 @@ bool ViewShell::HandleScrollCommand(const CommandEvent& rCEvt, ::sd::Window* pWi { if( !GetDocSh()->IsUIActive() ) { - const long nOldZoom = GetActiveWindow()->GetZoom(); - long nNewZoom; + const double fOldZoom(GetActiveWindow()->GetZoom()); + double fNewZoom; if( pData->GetDelta() < 0L ) - nNewZoom = Max( (long) pWin->GetMinZoom(), (long)(nOldZoom - DELTA_ZOOM) ); + { + fNewZoom = std::max( pWin->GetMinZoom(), fOldZoom - DELTA_ZOOM); + } else - nNewZoom = Min( (long) pWin->GetMaxZoom(), (long)(nOldZoom + DELTA_ZOOM) ); + { + fNewZoom = std::min( pWin->GetMaxZoom(), fOldZoom + DELTA_ZOOM); + } - SetZoom( nNewZoom ); + SetZoom( basegfx::fround(fNewZoom) ); Invalidate( SID_ATTR_ZOOM ); Invalidate( SID_ATTR_ZOOMSLIDER ); diff --git a/svx/Library_svxcore.mk b/svx/Library_svxcore.mk index 40ca6b989af0..94dc19bc26e7 100644 --- a/svx/Library_svxcore.mk +++ b/svx/Library_svxcore.mk @@ -302,6 +302,7 @@ $(eval $(call gb_Library_add_exception_objects,svxcore,\ svx/source/svdraw/sdrhittesthelper \ svx/source/svdraw/sdrmasterpagedescriptor \ svx/source/svdraw/sdrpagewindow \ + svx/source/svdraw/sdrobjecttools \ svx/source/svdraw/sdrpaintwindow \ svx/source/svdraw/selectioncontroller \ svx/source/svdraw/svdattr \ diff --git a/svx/Package_inc.mk b/svx/Package_inc.mk index 7a219888f698..98b9bec742f8 100644 --- a/svx/Package_inc.mk +++ b/svx/Package_inc.mk @@ -526,3 +526,4 @@ $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrselection.hxx,svx/sdrselect $(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrobjectfactory.hxx,svx/sdrobjectfactory.hxx)) $(eval $(call gb_Package_add_file,svx_inc,inc/svx/svdlegacy.hxx,svx/svdlegacy.hxx)) $(eval $(call gb_Package_add_file,svx_inc,inc/svx/globaldrawitempool.hxx,svx/globaldrawitempool.hxx)) +$(eval $(call gb_Package_add_file,svx_inc,inc/svx/sdrobjecttools.hxx,svx/sdrobjecttools.hxx)) diff --git a/svx/inc/svx/fmview.hxx b/svx/inc/svx/fmview.hxx index fc3f5394fc65..3f8c1c2bfe48 100644 --- a/svx/inc/svx/fmview.hxx +++ b/svx/inc/svx/fmview.hxx @@ -145,8 +145,8 @@ public: virtual void InsertControlContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& xCC); virtual void RemoveControlContainer(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& xCC); - virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut); - virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer); + virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut) const; + virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) const; SVX_DLLPRIVATE sal_Bool checkUnMarkAll(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xSource); diff --git a/svx/inc/svx/sdrpaintwindow.hxx b/svx/inc/svx/sdrpaintwindow.hxx index d28c7880ee6c..f6eadda6d6ad 100644 --- a/svx/inc/svx/sdrpaintwindow.hxx +++ b/svx/inc/svx/sdrpaintwindow.hxx @@ -71,7 +71,7 @@ private: OutputDevice& mrOutputDevice; // the SdrPaintView this window belongs to - SdrPaintView& mrPaintView; + const SdrPaintView& mrPaintView; // the new OverlayManager for the new OverlayObjects. Test add here, will // replace the IAOManager as soon as it works. @@ -91,11 +91,11 @@ private: void impCreateOverlayManager(); public: - SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut); + SdrPaintWindow(const SdrPaintView& rNewPaintView, OutputDevice& rOut); ~SdrPaintWindow(); // data read accesses - SdrPaintView& GetPaintView() const { return mrPaintView; } + const SdrPaintView& GetPaintView() const { return mrPaintView; } OutputDevice& GetOutputDevice() const { return mrOutputDevice; } // OVERLAYMANAGER diff --git a/svx/inc/svx/svdedtv.hxx b/svx/inc/svx/svdedtv.hxx index 6dd12ebb2d4a..772e1b6dc5ac 100644 --- a/svx/inc/svx/svdedtv.hxx +++ b/svx/inc/svx/svdedtv.hxx @@ -198,7 +198,7 @@ public: void AddUndoActions( std::vector< SdrUndoAction* >& ); // Layerverwaltung. Mit Undo. - SdrLayer* InsertNewLayer(const String& rName, sal_uInt16 nPos=0xFFFF); + SdrLayer* InsertNewLayer(const String& rName, sal_uInt32 nPos = 0xFFFFFFFF); // Loeschen eines Layer inkl. aller darauf befindlichen Objekte void DeleteLayer(const String& rName); diff --git a/svx/inc/svx/svdmodel.hxx b/svx/inc/svx/svdmodel.hxx index 3977bad86f95..ba257e72bc45 100644 --- a/svx/inc/svx/svdmodel.hxx +++ b/svx/inc/svx/svdmodel.hxx @@ -234,7 +234,7 @@ protected: XGradientListSharedPtr maGradientList; XBitmapListSharedPtr maBitmapList; - sal_uInt16 mnHandoutPageCount; + sal_uInt32 mnHandoutPageCount; /// bitfield bool mbDeletePool : 1; // zum Aufraeumen von pMyPool ab 303a @@ -257,8 +257,8 @@ public: virtual ~SdrModel(); void ClearModel(bool bCalledFromDestructor); - sal_uInt16 getHandoutPageCount() const { return mnHandoutPageCount; } - void setHandoutPageCount( sal_uInt16 nHandoutPageCount ) { mnHandoutPageCount = nHandoutPageCount; } + sal_uInt32 getHandoutPageCount() const { return mnHandoutPageCount; } + void setHandoutPageCount( sal_uInt32 nHandoutPageCount ) { mnHandoutPageCount = nHandoutPageCount; } const SvNumberFormatter& GetNumberFormatter() const; @@ -350,7 +350,7 @@ public: const Fraction& GetUIScale() const { return maUIScale; } static void TakeUnitStr(FieldUnit eUnit, String& rStr); - void TakeMetricStr(long nVal, String& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const; + void TakeMetricStr(double fVal, String& rStr, bool bNoUnitChars = false, sal_Int32 nNumDigits = -1) const; void TakeWinkStr(long nWink, String& rStr, bool bNoDegChar = false) const; void TakePercentStr(const Fraction& rVal, String& rStr, bool bNoPercentChar = false) const; diff --git a/svx/inc/svx/svdobj.hxx b/svx/inc/svx/svdobj.hxx index a8c854259a5e..a30a01269989 100644 --- a/svx/inc/svx/svdobj.hxx +++ b/svx/inc/svx/svdobj.hxx @@ -603,9 +603,6 @@ public: virtual bool BckCreate(SdrDragStat& rStat); virtual void BrkCreate(SdrDragStat& rStat); - // damit holt man sich den Pointer, der das Createn dieses Objekts symbolisiert - virtual Pointer GetCreatePointer(const SdrView& rSdrView) const; - // Polygon das waehrend des Erzeugens aufgezogen wird virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; diff --git a/svx/inc/svx/svdocapt.hxx b/svx/inc/svx/svdocapt.hxx index 0436b273e450..b692a158420b 100644 --- a/svx/inc/svx/svdocapt.hxx +++ b/svx/inc/svx/svdocapt.hxx @@ -121,7 +121,6 @@ public: virtual bool BckCreate(SdrDragStat& rStat); virtual void BrkCreate(SdrDragStat& rStat); virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; - virtual Pointer GetCreatePointer(const SdrView& rSdrView) const; virtual sal_uInt32 GetSnapPointCount() const; virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const; diff --git a/svx/inc/svx/svdocirc.hxx b/svx/inc/svx/svdocirc.hxx index 292dee633bcf..681a1eba80e1 100644 --- a/svx/inc/svx/svdocirc.hxx +++ b/svx/inc/svx/svdocirc.hxx @@ -104,7 +104,6 @@ public: virtual bool BckCreate(SdrDragStat& rStat); virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; - virtual Pointer GetCreatePointer(const SdrView& rSdrView) const; virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const; protected: diff --git a/svx/inc/svx/svdoedge.hxx b/svx/inc/svx/svdoedge.hxx index c70aedb75577..a78963b67d36 100644 --- a/svx/inc/svx/svdoedge.hxx +++ b/svx/inc/svx/svdoedge.hxx @@ -252,7 +252,6 @@ public: virtual void BrkCreate(SdrDragStat& rStat); virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; - virtual Pointer GetCreatePointer(const SdrView& rSdrView) const; virtual SdrObject* DoConvertToPolygonObject(bool bBezier, bool bAddText) const; virtual sal_uInt32 GetSnapPointCount() const; diff --git a/svx/inc/svx/svdomeas.hxx b/svx/inc/svx/svdomeas.hxx index 32346fb8c043..aec2d102c1c0 100644 --- a/svx/inc/svx/svdomeas.hxx +++ b/svx/inc/svx/svdomeas.hxx @@ -137,7 +137,6 @@ public: virtual bool BckCreate(SdrDragStat& rStat); virtual void BrkCreate(SdrDragStat& rStat); virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; - virtual Pointer GetCreatePointer(const SdrView& rSdrView) const; virtual sal_uInt32 GetSnapPointCount() const; virtual basegfx::B2DPoint GetSnapPoint(sal_uInt32 i) const; diff --git a/svx/inc/svx/svdopath.hxx b/svx/inc/svx/svdopath.hxx index 8662e54497f8..46c6e5987b19 100644 --- a/svx/inc/svx/svdopath.hxx +++ b/svx/inc/svx/svdopath.hxx @@ -138,7 +138,6 @@ public: virtual bool BckCreate(SdrDragStat& rStat); virtual void BrkCreate(SdrDragStat& rStat); virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; - virtual Pointer GetCreatePointer(const SdrView& rSdrView) const; // during drag or create, allow accessing the so-far created/modified polyPolygon basegfx::B2DPolyPolygon getObjectPolyPolygon(const SdrDragStat& rDrag) const; diff --git a/svx/inc/svx/svdorect.hxx b/svx/inc/svx/svdorect.hxx index 8c9df88475bd..e57be04bd45b 100644 --- a/svx/inc/svx/svdorect.hxx +++ b/svx/inc/svx/svdorect.hxx @@ -85,7 +85,6 @@ public: virtual String getSpecialDragComment(const SdrDragStat& rDrag) const; virtual basegfx::B2DPolyPolygon TakeCreatePoly(const SdrDragStat& rDrag) const; - virtual Pointer GetCreatePointer(const SdrView& rSdrView) const; virtual bool DoMacro(const SdrObjMacroHitRec& rRec); virtual XubString GetMacroPopupComment(const SdrObjMacroHitRec& rRec) const; diff --git a/svx/inc/svx/svdotable.hxx b/svx/inc/svx/svdotable.hxx index 4b62c46d562c..78c6d6edf5eb 100644 --- a/svx/inc/svx/svdotable.hxx +++ b/svx/inc/svx/svdotable.hxx @@ -248,7 +248,6 @@ public: virtual bool BckCreate(SdrDragStat& rStat); virtual void BrkCreate(SdrDragStat& rStat); - virtual Pointer GetCreatePointer(const SdrView& rSdrView) const; virtual bool BegTextEdit(SdrOutliner& rOutl); virtual void EndTextEdit(SdrOutliner& rOutl); diff --git a/svx/inc/svx/svdotext.hxx b/svx/inc/svx/svdotext.hxx index 0a6f19bcf9c5..581014567010 100644 --- a/svx/inc/svx/svdotext.hxx +++ b/svx/inc/svx/svdotext.hxx @@ -271,7 +271,7 @@ private: protected: bool ImpCanConvTextToCurve() const; - SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier, bool bNoSetAttr = sal_False) const; + SdrObject* ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bBezier, bool bNoSetAttr = sal_False) const; SdrObject* ImpConvertAddText(SdrObject* pObj, bool bBezier) const; void ImpSetTextStyleSheetListeners(); void ImpSetCharStretching(SdrOutliner& rOutliner, const basegfx::B2DRange& rTextRange, const basegfx::B2DRange& rAnchorRange) const; @@ -421,7 +421,6 @@ public: virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd); virtual bool BckCreate(SdrDragStat& rStat); virtual void BrkCreate(SdrDragStat& rStat); - virtual Pointer GetCreatePointer(const SdrView& rSdrView) const; virtual bool HasTextEdit() const; virtual bool BegTextEdit(SdrOutliner& rOutl); diff --git a/svx/inc/svx/svdpagv.hxx b/svx/inc/svx/svdpagv.hxx index 6c9ed3e72b39..fcc936ea70e9 100644 --- a/svx/inc/svx/svdpagv.hxx +++ b/svx/inc/svx/svdpagv.hxx @@ -91,7 +91,7 @@ protected: SdrPageWindow* RemovePageWindow(sal_uInt32 nPos); SdrPageWindow* RemovePageWindow(SdrPageWindow& rOld); - void ImpInvalidateHelpLineArea(sal_uInt16 nNum) const; + void ImpInvalidateHelpLineArea(sal_uInt32 nNum) const; void SetLayer(const String& rName, SetOfByte& rBS, bool bJa); bool IsLayer(const String& rName, const SetOfByte& rBS) const; diff --git a/svx/inc/svx/svdpntv.hxx b/svx/inc/svx/svdpntv.hxx index 1ebe89f24890..4c75f72fbf7d 100644 --- a/svx/inc/svx/svdpntv.hxx +++ b/svx/inc/svx/svdpntv.hxx @@ -326,7 +326,7 @@ public: //////////////////////////////////////////////////////////////////////////////////////////////////// // used internally for Draw/Impress/sch/chart2 - virtual void CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0); + virtual void CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0) const; // #i72889# used from CompleteRedraw() implementation internally, added to be able to do a complete redraw in single steps // @@ -336,16 +336,16 @@ public: // DoCompleteRedraw draws the DrawingLayer hierarchy then. // EndCompleteRedraw does the necessary refreshes, evtl. paints text edit and overlay and evtl destroys the // SdrPaintWindow again. This means: the SdrPaintWindow is no longer safe after this closing call. - virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut); - virtual void DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0); - virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer); + virtual SdrPaintWindow* BeginCompleteRedraw(OutputDevice* pOut) const; + virtual void DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0) const; + virtual void EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) const; //////////////////////////////////////////////////////////////////////////////////////////////////// // used for the other applications basctl/sc/sw which call DrawLayer at PageViews // #i74769# Interface change to use common BeginCompleteRedraw/EndCompleteRedraw // #i76114# bDisableIntersect disables intersecting rReg with the Window's paint region - SdrPaintWindow* BeginDrawLayers(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false); - void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer); + SdrPaintWindow* BeginDrawLayers(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect = false) const; + void EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) const; bool IsPageVisible() const { return mbPageVisible; } // Seite (weisse Flaeche) malen oder nicht bool IsPageBorderVisible() const { return mbPageBorderVisible; } // Seite (weisse Flaeche) malen oder nicht diff --git a/svx/inc/svx/svdsnpv.hxx b/svx/inc/svx/svdsnpv.hxx index 96fa3b8ad2c8..edab80017008 100644 --- a/svx/inc/svx/svdsnpv.hxx +++ b/svx/inc/svx/svdsnpv.hxx @@ -157,7 +157,7 @@ public: bool PickHelpLine(const basegfx::B2DPoint& rPnt, double fTol, sal_uInt32& rnHelpLineNum) const; // Verschieben einer vorhandenen Hilfslinie. nHelpLineNum von PickHelpLine verwenden. - bool BegDragHelpLine(sal_uInt16 nHelpLineNum); + bool BegDragHelpLine(sal_uInt32 nHelpLineNum); // Interaktives einfuegen einer neuen Hilfslinie bool BegDragHelpLine(const basegfx::B2DPoint& rPnt, SdrHelpLineKind eNewKind); Pointer GetDraggedHelpLinePointer() const; diff --git a/svx/inc/svx/svdundo.hxx b/svx/inc/svx/svdundo.hxx index 5a518252d583..8edab506a44b 100644 --- a/svx/inc/svx/svdundo.hxx +++ b/svx/inc/svx/svdundo.hxx @@ -419,12 +419,12 @@ class SdrUndoLayer : public SdrUndoAction protected: SdrLayer* mpLayer; SdrLayerAdmin& mrLayerAdmin; - sal_uInt16 mnLayerNum; + sal_uInt32 mnLayerNum; /// bitfield bool mbItsMine : 1; - SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); + SdrUndoLayer(sal_uInt32 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); public: virtual ~SdrUndoLayer(); }; @@ -434,7 +434,7 @@ public: class SdrUndoNewLayer : public SdrUndoLayer { public: - SdrUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) + SdrUndoNewLayer(sal_uInt32 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) : SdrUndoLayer(nLayerNum, rNewLayerAdmin, rNewModel) { } @@ -451,7 +451,7 @@ public: class SdrUndoDelLayer : public SdrUndoLayer { public: - SdrUndoDelLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) + SdrUndoDelLayer(sal_uInt32 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) : SdrUndoLayer(nLayerNum, rNewLayerAdmin, rNewModel) { mbItsMine = true; @@ -656,8 +656,8 @@ public: virtual SdrUndoAction* CreateUndoObjectStrAttr( SdrObject& rObject, SdrUndoObjStrAttr::ObjStrAttrType eObjStrAttrType, String sOldStr, String sNewStr ); // layer - virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); - virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); + virtual SdrUndoAction* CreateUndoNewLayer(sal_uInt32 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); + virtual SdrUndoAction* CreateUndoDeleteLayer(sal_uInt32 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel); // virtual SdrUndoAction* CreateUndoMoveLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel, sal_uInt16 nNeuPos1); // page diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx index 145ac2f741ff..3df38c94ed82 100644 --- a/svx/source/form/fmview.cxx +++ b/svx/source/form/fmview.cxx @@ -476,7 +476,7 @@ void FmFormView::RemoveControlContainer(const Reference< ::com::sun::star::awt:: } // ----------------------------------------------------------------------------- -SdrPaintWindow* FmFormView::BeginCompleteRedraw(OutputDevice* pOut) +SdrPaintWindow* FmFormView::BeginCompleteRedraw(OutputDevice* pOut) const { SdrPaintWindow* pPaintWindow = E3dView::BeginCompleteRedraw( pOut ); pImpl->suspendTabOrderUpdate(); @@ -484,7 +484,7 @@ SdrPaintWindow* FmFormView::BeginCompleteRedraw(OutputDevice* pOut) } // ----------------------------------------------------------------------------- -void FmFormView::EndCompleteRedraw( SdrPaintWindow& rPaintWindow, bool bPaintFormLayer ) +void FmFormView::EndCompleteRedraw( SdrPaintWindow& rPaintWindow, bool bPaintFormLayer ) const { E3dView::EndCompleteRedraw( rPaintWindow, bPaintFormLayer ); pImpl->resumeTabOrderUpdate(); diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx index 054b9f5f90a3..8c5db5e60b6a 100644 --- a/svx/source/svdraw/sdrpaintwindow.cxx +++ b/svx/source/svdraw/sdrpaintwindow.cxx @@ -185,7 +185,7 @@ void SdrPaintWindow::impCreateOverlayManager() } } -SdrPaintWindow::SdrPaintWindow(SdrPaintView& rNewPaintView, OutputDevice& rOut) +SdrPaintWindow::SdrPaintWindow(const SdrPaintView& rNewPaintView, OutputDevice& rOut) : mrOutputDevice(rOut), mrPaintView(rNewPaintView), mpOverlayManager(0), diff --git a/svx/source/svdraw/sdrselection.cxx b/svx/source/svdraw/sdrselection.cxx index cce02a4eb090..2035df406108 100644 --- a/svx/source/svdraw/sdrselection.cxx +++ b/svx/source/svdraw/sdrselection.cxx @@ -354,6 +354,8 @@ namespace sdr } break; } + default: + break; } } } diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx index 2f51dcb112f9..0e0e5f82c39d 100644 --- a/svx/source/svdraw/svdcrtv.cxx +++ b/svx/source/svdraw/svdcrtv.cxx @@ -371,23 +371,142 @@ void SdrCreateView::setSdrObjectCreationInfo(const SdrObjectCreationInfo& rNew) // copy values maSdrObjectCreationInfo = rNew; - // Always use I-Beam for text tool if(IsTextTool()) { + // Always use I-Beam for text tool setCreatePointer(POINTER_TEXT); } - else if(static_cast< sal_uInt16 >(OBJ_NONE) != maSdrObjectCreationInfo.getIdent()) + else if(SdrInventor == maSdrObjectCreationInfo.getInvent()) { - SdrObject* pObj = SdrObjFactory::MakeNewObject( - getSdrModelFromSdrView(), - getSdrObjectCreationInfo()); - - if(pObj) + // different pointers for Sdr-level ObjectTypes + switch(maSdrObjectCreationInfo.getIdent()) { - setCreatePointer(pObj->GetCreatePointer(*getAsSdrView())); - deleteSdrObjectSafeAndClearPointer(pObj); + case OBJ_RECT: + { + // The former implementation created a temporary default SdrRectObj only to call GetCreatePointer + // on it nad delete it again, this is not needed anymore. Default for creation of SdrTextObj + // is bIsTextFrame = false, thus the former check for IsTextFrame() is false, too, so not POINTER_DRAW_TEXT + setCreatePointer(POINTER_DRAW_RECT); + break; + } + + case OBJ_POLY: + { + if(maSdrObjectCreationInfo.getFreehandMode()) + { + setCreatePointer(POINTER_DRAW_FREEHAND); + } + else + { + switch(maSdrObjectCreationInfo.getSdrPathObjType()) + { + case PathType_Line: + { + setCreatePointer(POINTER_DRAW_LINE); + break; + } + case PathType_OpenPolygon: + case PathType_ClosedPolygon: + { + setCreatePointer(POINTER_DRAW_POLYGON); + break; + } + case PathType_OpenBezier: + case PathType_ClosedBezier: + { + setCreatePointer(POINTER_DRAW_BEZIER); + break; + } + } + } + break; + } + + case OBJ_EDGE: + { + setCreatePointer(POINTER_DRAW_CONNECT); + break; + } + + case OBJ_CIRC: + { + switch(maSdrObjectCreationInfo.getSdrCircleObjType()) + { + case CircleType_Circle: + { + setCreatePointer(POINTER_DRAW_ELLIPSE); + break; + } + case CircleType_Sector: + { + setCreatePointer(POINTER_DRAW_PIE); + break; + } + case CircleType_Arc: + { + setCreatePointer(POINTER_DRAW_ARC); + break; + } + case CircleType_Segment: + { + setCreatePointer(POINTER_DRAW_CIRCLECUT); + break; + } + } + break; + } + + case OBJ_CAPTION: + { + setCreatePointer(POINTER_DRAW_CAPTION); + break; + } + + case OBJ_TEXT: + case OBJ_TITLETEXT: + case OBJ_OUTLINETEXT: + // The former implementation created a temporary default SdrTextObj only to call GetCreatePointer + // on it nad delete it again, this is not needed anymore. Default for creation of SdrTextObj + // is bIsTextFrame = false, thus the former check for IsTextFrame() is false, too, so not POINTER_DRAW_TEXT + + case OBJ_NONE: + case OBJ_GRUP: + case OBJ_GRAF: + case OBJ_OLE2: + case OBJ_PAGE: + case OBJ_FRAME: + case OBJ_UNO: + case OBJ_CUSTOMSHAPE: + case OBJ_MEDIA: + case OBJ_MEASURE: + case OBJ_TABLE: + default: + { + // default for Sdr-Level objects + setCreatePointer(POINTER_CROSS); + break; + } } } + else + { + // default for non-Sdr-Level objects + setCreatePointer(POINTER_CROSS); + } + + // TTTT + //else if(static_cast< sal_uInt16 >(OBJ_NONE) != maSdrObjectCreationInfo.getIdent()) + //{ + // SdrObject* pObj = SdrObjFactory::MakeNewObject( + // getSdrModelFromSdrView(), + // getSdrObjectCreationInfo()); + // + // if(pObj) + // { + // setCreatePointer(pObj->GetCreatePointer(*getAsSdrView())); + // deleteSdrObjectSafeAndClearPointer(pObj); + // } + //} } bool SdrCreateView::ImpBegCreateObj( diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx index d520a955c8df..16d8b25c6f0e 100644 --- a/svx/source/svdraw/svddrgmt.cxx +++ b/svx/source/svdraw/svddrgmt.cxx @@ -2711,7 +2711,7 @@ void SdrDragCrook::TakeSdrDragComment(XubString& rStr) const if(nVal < 0) { - nVal += 36000.0; + nVal += 36000; } if(mbAtCenter) diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx index 280bf98161e0..7f725d46bed2 100644 --- a/svx/source/svdraw/svdedtv.cxx +++ b/svx/source/svdraw/svdedtv.cxx @@ -137,7 +137,7 @@ SdrEditView::~SdrEditView() { } -SdrLayer* SdrEditView::InsertNewLayer(const XubString& rName, sal_uInt16 nPos) +SdrLayer* SdrEditView::InsertNewLayer(const XubString& rName, sal_uInt32 nPos) { SdrLayerAdmin& rLA = getSdrModelFromSdrView().GetModelLayerAdmin(); const sal_uInt32 nMax(rLA.GetLayerCount()); diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 4875b7f0eb09..d8fb9d5ca9f3 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -1256,13 +1256,13 @@ void SdrModel::TakeUnitStr(FieldUnit eUnit, XubString& rStr) } } -void SdrModel::TakeMetricStr(long nVal, XubString& rStr, bool bNoUnitChars, sal_Int32 nNumDigits) const +void SdrModel::TakeMetricStr(double fVal, XubString& rStr, bool bNoUnitChars, sal_Int32 nNumDigits) const { // change to double precision usage to not lose decimal places after comma - const bool bNegative(nVal < 0); + const bool bNegative(fVal < 0.0); SvtSysLocale aSysLoc; const LocaleDataWrapper& rLoc(aSysLoc.GetLocaleData()); - double fLocalValue(double(nVal) * double(maUIUnitScale)); + double fLocalValue(fVal * double(maUIUnitScale)); if(bNegative) { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index efe778a1c129..35f0ecb14130 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -1354,11 +1354,6 @@ basegfx::B2DPolyPolygon SdrObject::TakeCreatePoly(const SdrDragStat& rDrag) cons return basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(rDrag.TakeCreateRange())); } -Pointer SdrObject::GetCreatePointer(const SdrView& /*rSdrView*/) const -{ - return Pointer(POINTER_CROSS); -} - void SdrObject::SetAnchorPos(const basegfx::B2DPoint& rPnt) { if(!rPnt.equalZero() && !mpPlusData) diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index aafb0e58e0b8..e263b1ec659b 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -648,11 +648,6 @@ basegfx::B2DPolyPolygon SdrCaptionObj::TakeCreatePoly(const SdrDragStat& /*rDrag return aRetval; } -Pointer SdrCaptionObj::GetCreatePointer(const SdrView& /*rSdrView*/) const -{ - return Pointer(POINTER_DRAW_CAPTION); -} - void SdrCaptionObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransformation) { SdrRectObj::setSdrObjectTransformation(rTransformation); @@ -722,7 +717,7 @@ void SdrCaptionObj::RestGeoData(const SdrObjGeoData& rGeo) SdrObject* SdrCaptionObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const { SdrObject* pRect = SdrRectObj::DoConvertToPolygonObject(bBezier, bAddText); - SdrObject* pTail = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aTailPoly.getB2DPolygon()), false, bBezier); + SdrObject* pTail = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aTailPoly.getB2DPolygon()), bBezier); SdrObject* pRet= (pTail) ? pTail : pRect; if(pTail && pRect) diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 33b78561f751..724be0b99b93 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -724,20 +724,6 @@ basegfx::B2DPolyPolygon SdrCircObj::TakeCreatePoly(const SdrDragStat& rDrag) con } } -Pointer SdrCircObj::GetCreatePointer(const SdrView& /*rSdrView*/) const -{ - switch (meSdrCircleObjType) - { - case CircleType_Circle: return Pointer(POINTER_DRAW_ELLIPSE); - case CircleType_Sector: return Pointer(POINTER_DRAW_PIE); - case CircleType_Arc: return Pointer(POINTER_DRAW_ARC); - case CircleType_Segment: return Pointer(POINTER_DRAW_CIRCLECUT); - default: break; - } - - return Pointer(POINTER_CROSS); -} - SdrObjGeoData* SdrCircObj::NewGeoData() const { return new SdrCircObjGeoData; @@ -809,14 +795,13 @@ basegfx::B2DPoint SdrCircObj::GetSnapPoint(sal_uInt32 i) const SdrObject* SdrCircObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const { - const bool bCanBeFilled(CircleType_Arc != meSdrCircleObjType); const basegfx::B2DPolygon aCircPolygon( ImpCalcXPolyCirc( GetSdrCircleObjType(), getSdrObjectTransformation(), GetStartAngle(), GetEndAngle())); - SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bCanBeFilled, bBezier); + SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bBezier); if(bAddText) { diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 1aca3e6a2e1f..b741ce590ce8 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -2276,11 +2276,6 @@ basegfx::B2DPolyPolygon SdrEdgeObj::TakeCreatePoly(const SdrDragStat& /*rStatDra return basegfx::B2DPolyPolygon(maEdgeTrack); } -Pointer SdrEdgeObj::GetCreatePointer(const SdrView& /*rSdrView*/) const -{ - return Pointer(POINTER_DRAW_CONNECT); -} - void SdrEdgeObj::FindConnector( const basegfx::B2DPoint& rPt, const SdrView& rSdrView, @@ -2489,7 +2484,7 @@ void SdrEdgeObj::setSdrObjectTransformation(const basegfx::B2DHomMatrix& rTransf SdrObject* SdrEdgeObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) const { - SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(maEdgeTrack), false, bBezier); + SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(maEdgeTrack), bBezier); if(bAddText) { diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 9344837d272d..ed23aee3930f 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -955,11 +955,6 @@ basegfx::B2DPolyPolygon SdrMeasureObj::TakeCreatePoly(const SdrDragStat& /*rDrag return ImpCalcXPoly(aMPol); } -Pointer SdrMeasureObj::GetCreatePointer(const SdrView& /*rSdrView*/) const -{ - return Pointer(POINTER_CROSS); -} - sal_uInt32 SdrMeasureObj::GetSnapPointCount() const { return 2L; diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx index 04f10ab7f331..4085a0e13827 100644 --- a/svx/source/svdraw/svdopath.cxx +++ b/svx/source/svdraw/svdopath.cxx @@ -394,7 +394,6 @@ public: bool EndCreate(SdrDragStat& rDrag, SdrCreateCmd eCmd); bool BckCreate(SdrDragStat& rDrag); void BrkCreate(SdrDragStat& rDrag); - Pointer GetCreatePointer() const; // helping stuff bool isClosed() const { return PathType_ClosedPolygon == mePathType || PathType_ClosedBezier == mePathType; } @@ -1579,34 +1578,6 @@ basegfx::B2DPolyPolygon ImpPathForDragAndCreate::TakeDragPolyPolygon(const SdrDr return aRetval; } -Pointer ImpPathForDragAndCreate::GetCreatePointer() const -{ - if(isFreeHand()) - { - return Pointer(POINTER_DRAW_FREEHAND); - } - - switch(mePathType) - { - case PathType_Line: - { - return Pointer(POINTER_DRAW_LINE); - } - case PathType_OpenPolygon: - case PathType_ClosedPolygon: - { - return Pointer(POINTER_DRAW_POLYGON); - } - case PathType_OpenBezier: - case PathType_ClosedBezier: - { - return Pointer(POINTER_DRAW_BEZIER); - } - } - - return Pointer(POINTER_CROSS); -} - ////////////////////////////////////////////////////////////////////////////// SdrPathObjGeoData::SdrPathObjGeoData() @@ -1627,7 +1598,22 @@ void SdrPathObj::impSetPathPolyPolygonWithTransformationAdaption(const basegfx:: return; } - // remember if this was a line before geometry change + // the SdrPathObj has two basic states, line and other. Line is for two points + // and no bezier, it uses a specialized geometry (unified line from 0.0, to 1.0) + // and a specialized transformation which shows the rotation of the line what is + // wanted. + // When a third point is added that mode is left and the regular one entered, in + // this conversion when using the code below keeping the rotation of the former + // line object. This is not wrong and works as intended, but is irritating for the + // user, e.g: + // - when drawing a freehand or multi-line (non-bezier) polygon, it will be rotated + // after construction due to keeping the rotation of the first added line + // - this is also used e.g. in contour editors where it is not wanted + // - it is different from the behaviour of AOO before + // For this reason this is disabled and the old behaviour activated by adding this + // case to esp. change back to the most trivial transformation in the transition + // between line status and other. To try out the also possible new alternative, + // change the value of bResetCoordinateSystemAfterWasLine to false. static bool bResetCoordinateSystemAfterWasLine(true); const bool bWasLineAndReset(bResetCoordinateSystemAfterWasLine && isLine()); @@ -1650,34 +1636,6 @@ void SdrPathObj::impSetPathPolyPolygonWithTransformationAdaption(const basegfx:: return; } - - if(bWasLineAndReset) - { - // the SdrPathObj has two basic states, line and other. Line is for two points - // and no bezier, it uses a specialized geometry (unified line from 0.0, to 1.0) - // and a specialized transformation which shows the rotation of the line what is - // wanted. - // When a third point is added that mode is left and the regular one entered, in - // this conversion when using the code below keeping the rotation of the former - // line object. This is not wrong and works as intended, but is irritating for the - // user, e.g: - // - when drawing a freehand or multi-line (non-bezier) polygon, it will be rotated - // after construction due to keeping the rotation of the first added line - // - this is also used e.g. in contour editors where it is not wanted - // - it is different from the behaviour of AOO before - // For this reason this is disabled and the old behaviour activated by adding this - // case to esp. change back to the most trivial transformation in the transition - // between line status and other. To try out the also possible new alternative, - // change the value of bResetCoordinateSystemAfterWasLine to false. - const basegfx::B2DRange aRangeNewGeometry(rNew.getB2DRange()); - - maSdrObjectTransformation.setB2DHomMatrix( - basegfx::tools::createScaleTranslateB2DHomMatrix( - aRangeNewGeometry.getRange(), - aRangeNewGeometry.getMinimum())); - return; - } - // get range of the target geometry const basegfx::B2DRange aRangeNewGeometry(rNew.getB2DRange()); @@ -1698,37 +1656,43 @@ void SdrPathObj::impSetPathPolyPolygonWithTransformationAdaption(const basegfx:: } // break up current transformation - basegfx::B2DTuple aScale; - basegfx::B2DTuple aTranslate; - double fRotate, fShearX; + basegfx::B2DTuple aScale(1.0, 1.0); + basegfx::B2DTuple aTranslate(0.0, 0.0); + double fRotate(0.0), fShearX(0.0); - maSdrObjectTransformation.getB2DHomMatrix().decompose(aScale, aTranslate, fRotate, fShearX); + if(!bWasLineAndReset) + { + maSdrObjectTransformation.getB2DHomMatrix().decompose(aScale, aTranslate, fRotate, fShearX); + } // to preserve mirrorX, mirrorY, rotation and shear, create a transformation // containing those values in aHelpMatrix basegfx::B2DHomMatrix aHelpMatrix; - if(basegfx::fTools::less(aScale.getX(), 0.0)) + if(!bWasLineAndReset) { - aHelpMatrix.scale(-1.0, 1.0); - } + if(basegfx::fTools::less(aScale.getX(), 0.0)) + { + aHelpMatrix.scale(-1.0, 1.0); + } - if(basegfx::fTools::less(aScale.getY(), 0.0)) - { - aHelpMatrix.scale(1.0, -1.0); - } + if(basegfx::fTools::less(aScale.getY(), 0.0)) + { + aHelpMatrix.scale(1.0, -1.0); + } - if(!basegfx::fTools::equalZero(fShearX)) - { - aHelpMatrix.shearX(fShearX); - } + if(!basegfx::fTools::equalZero(fShearX)) + { + aHelpMatrix.shearX(fShearX); + } - if(!basegfx::fTools::equalZero(fRotate)) - { - aHelpMatrix.rotate(fRotate); + if(!basegfx::fTools::equalZero(fRotate)) + { + aHelpMatrix.rotate(fRotate); + } } - if(!aHelpMatrix.isIdentity()) + if(!bWasLineAndReset && !aHelpMatrix.isIdentity()) { // create inverse from it and back-transform polygon basegfx::B2DPolyPolygon aBackTransformed(rNew); @@ -2356,11 +2320,6 @@ basegfx::B2DPolyPolygon SdrPathObj::getDragPolyPolygon(const SdrDragStat& rDrag) return aRetval; } -Pointer SdrPathObj::GetCreatePointer(const SdrView& rSdrView) const -{ - return impGetDAC(rSdrView).GetCreatePointer(); -} - sal_uInt32 SdrPathObj::GetSnapPointCount() const { return getB2DPolyPolygonInObjectCoordinates().allPointCount(); @@ -2629,7 +2588,7 @@ SdrObject* SdrPathObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) con SdrObject* pRet = bHideContour ? 0 : - ImpConvertMakeObj(getB2DPolyPolygonInObjectCoordinates(), isClosed(), bBezier); + ImpConvertMakeObj(getB2DPolyPolygonInObjectCoordinates(), bBezier); SdrPathObj* pPath = dynamic_cast< SdrPathObj* >( pRet); diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx index 0f45eea4ce41..93b041c33695 100644 --- a/svx/source/svdraw/svdorect.cxx +++ b/svx/source/svdraw/svdorect.cxx @@ -460,16 +460,6 @@ basegfx::B2DPolyPolygon SdrRectObj::TakeCreatePoly(const SdrDragStat& rDrag) con return basegfx::B2DPolyPolygon(aUnitOutline); } -Pointer SdrRectObj::GetCreatePointer(const SdrView& /*rSdrView*/) const -{ - if (IsTextFrame()) - { - return Pointer(POINTER_DRAW_TEXT); - } - - return Pointer(POINTER_DRAW_RECT); -} - bool SdrRectObj::DoMacro(const SdrObjMacroHitRec& rRec) { return SdrTextObj::DoMacro(rRec); @@ -491,7 +481,7 @@ SdrObject* SdrRectObj::DoConvertToPolygonObject(bool bBezier, bool bAddText) con // when used with bAddText==false from other converters if((bAddText && !IsTextFrame()) || HasFill() || HasLine()) { - pRet = ImpConvertMakeObj(aPolyPolygon, true, bBezier); + pRet = ImpConvertMakeObj(aPolyPolygon, bBezier); } if(bAddText) diff --git a/svx/source/svdraw/svdotxdr.cxx b/svx/source/svdraw/svdotxdr.cxx index 5379c762ab48..0efbdbce8dc4 100644 --- a/svx/source/svdraw/svdotxdr.cxx +++ b/svx/source/svdraw/svdotxdr.cxx @@ -95,14 +95,4 @@ bool SdrTextObj::BckCreate(SdrDragStat& /*rStat*/) return true; } -Pointer SdrTextObj::GetCreatePointer(const SdrView& /*rSdrView*/) const -{ - if (IsTextFrame()) - { - return Pointer(POINTER_DRAW_TEXT); - } - - return Pointer(POINTER_CROSS); -} - // eof diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx index 183865394a69..14f491f197a0 100644 --- a/svx/source/svdraw/svdotxtr.cxx +++ b/svx/source/svdraw/svdotxtr.cxx @@ -250,7 +250,7 @@ bool SdrTextObj::ImpCanConvTextToCurve() const return !IsOutlText(); } -SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bClosed, bool bBezier, bool bNoSetAttr) const +SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPolygon, bool bBezier, bool bNoSetAttr) const { basegfx::B2DPolyPolygon aB2DPolyPolygon(rPolyPolygon); @@ -262,14 +262,14 @@ SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPol SdrPathObj* pPathObj = new SdrPathObj(getSdrModelFromSdrObject(), aB2DPolyPolygon); - if(bBezier) - { - // create bezier curves - pPathObj->setB2DPolyPolygonInObjectCoordinates(basegfx::tools::expandToCurve(pPathObj->getB2DPolyPolygonInObjectCoordinates())); - } - if(pPathObj) { + if(bBezier) + { + // create bezier curves + pPathObj->setB2DPolyPolygonInObjectCoordinates(basegfx::tools::expandToCurve(pPathObj->getB2DPolyPolygonInObjectCoordinates())); + } + pPathObj->SetAnchorPos(GetAnchorPos()); pPathObj->SetLayer(GetLayer()); diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index 7fe0a827ba26..63c905ba6047 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -789,7 +789,7 @@ void SdrPageView::SetPageOrigin(const basegfx::B2DPoint& rOrg) } } -void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const +void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt32 nNum) const { if(GetView().IsHlplVisible() && nNum < maHelpLines.GetCount()) { diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index cfe1e528ede9..7adee555e71c 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -628,7 +628,7 @@ void SdrPaintView::PostPaint() //////////////////////////////////////////////////////////////////////////////////////////////////// // #define SVX_REPAINT_TIMER_TEST -void SdrPaintView::CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector) +void SdrPaintView::CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector) const { #ifdef SVX_REPAINT_TIMER_TEST #define REMEMBERED_TIMES_COUNT (10) @@ -761,7 +761,7 @@ void SdrPaintView::CompleteRedraw(OutputDevice* pOut, const Region& rReg, sdr::c //////////////////////////////////////////////////////////////////////////////////////////////////// // #i72889# -SdrPaintWindow* SdrPaintView::BeginCompleteRedraw(OutputDevice* pOut) +SdrPaintWindow* SdrPaintView::BeginCompleteRedraw(OutputDevice* pOut) const { OSL_ENSURE(pOut, "SdrPaintView::BeginCompleteRedraw: No OutDev (!)"); SdrPaintWindow* pPaintWindow = FindPaintWindow(*pOut); @@ -783,7 +783,7 @@ SdrPaintWindow* SdrPaintView::BeginCompleteRedraw(OutputDevice* pOut) return pPaintWindow; } -void SdrPaintView::DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector) +void SdrPaintView::DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector) const { // redraw all PageViews with the target. This may expand the RedrawRegion // at the PaintWindow, plus taking care of FormLayer expansion @@ -793,7 +793,7 @@ void SdrPaintView::DoCompleteRedraw(SdrPaintWindow& rPaintWindow, const Region& } } -void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) +void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) const { if(rPaintWindow.getTemporaryTarget()) { @@ -814,7 +814,7 @@ void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFo // early and paint text edit to window. if(IsTextEdit() && GetSdrPageView()) { - static_cast< SdrView* >(this)->TextEditDrawing(rPaintWindow); + static_cast< const SdrView* >(this)->TextEditDrawing(rPaintWindow); } // draw Overlay, also to PreRender device if exists @@ -827,7 +827,7 @@ void SdrPaintView::EndCompleteRedraw(SdrPaintWindow& rPaintWindow, bool bPaintFo //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrPaintWindow* SdrPaintView::BeginDrawLayers(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect) +SdrPaintWindow* SdrPaintView::BeginDrawLayers(OutputDevice* pOut, const Region& rReg, bool bDisableIntersect) const { // #i74769# use BeginCompleteRedraw() as common base SdrPaintWindow* pPaintWindow = BeginCompleteRedraw(pOut); @@ -904,7 +904,7 @@ SdrPaintWindow* SdrPaintView::BeginDrawLayers(OutputDevice* pOut, const Region& return pPaintWindow; } -void SdrPaintView::EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) +void SdrPaintView::EndDrawLayers(SdrPaintWindow& rPaintWindow, bool bPaintFormLayer) const { // #i74769# use EndCompleteRedraw() as common base EndCompleteRedraw(rPaintWindow, bPaintFormLayer); diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx index 1d6db7d5af81..4fbc4b2a2ec8 100644 --- a/svx/source/svdraw/svdsnpv.cxx +++ b/svx/source/svdraw/svdsnpv.cxx @@ -670,7 +670,7 @@ bool SdrSnapView::PickHelpLine(const basegfx::B2DPoint& rPnt, double fTol, sal_u } // start HelpLine drag for new HelpLine -bool SdrSnapView::BegDragHelpLine(sal_uInt16 nHelpLineNum) +bool SdrSnapView::BegDragHelpLine(sal_uInt32 nHelpLineNum) { bool bRet(false); diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx index cdffb407d386..357451159731 100644 --- a/svx/source/svdraw/svdundo.cxx +++ b/svx/source/svdraw/svdundo.cxx @@ -1391,7 +1391,7 @@ String SdrUndoObjStrAttr::GetComment() const //////////////////////////////////////////////////////////////////////////////////////////////////// -SdrUndoLayer::SdrUndoLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) +SdrUndoLayer::SdrUndoLayer(sal_uInt32 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) : SdrUndoAction(rNewModel), mpLayer(rNewLayerAdmin.GetLayer(nLayerNum)), mrLayerAdmin(rNewLayerAdmin), @@ -1869,12 +1869,12 @@ SdrUndoAction* SdrUndoFactory::CreateUndoObjectStrAttr( SdrObject& rObject, SdrU } // layer -SdrUndoAction* SdrUndoFactory::CreateUndoNewLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) +SdrUndoAction* SdrUndoFactory::CreateUndoNewLayer(sal_uInt32 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) { return new SdrUndoNewLayer( nLayerNum, rNewLayerAdmin, rNewModel ); } -SdrUndoAction* SdrUndoFactory::CreateUndoDeleteLayer(sal_uInt16 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) +SdrUndoAction* SdrUndoFactory::CreateUndoDeleteLayer(sal_uInt32 nLayerNum, SdrLayerAdmin& rNewLayerAdmin, SdrModel& rNewModel) { return new SdrUndoDelLayer( nLayerNum, rNewLayerAdmin, rNewModel ); } diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx index 6025c9da7df0..05e6aec69b62 100644 --- a/svx/source/svdraw/svdview.cxx +++ b/svx/source/svdraw/svdview.cxx @@ -1288,7 +1288,7 @@ Pointer SdrView::GetPreferedPointer(const basegfx::B2DPoint& rMousePos, const Ou { if(GetCreateObj()) { - return GetCreateObj()->GetCreatePointer(*this); + return getCreatePointer(); } if(mpCurrentSdrDragMethod) diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index b88f2a98805b..9ce753979170 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -2444,13 +2444,6 @@ bool SdrTableObj::BckCreate(SdrDragStat& /*rStat*/) // -------------------------------------------------------------------- -Pointer SdrTableObj::GetCreatePointer(const SdrView& /*rSdrView*/) const -{ - return Pointer(POINTER_CROSS); -} - -// -------------------------------------------------------------------- - void SdrTableObj::createCell( CellRef& xNewCell ) { xNewCell = Cell::create( *this, 0 ); diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx b/svx/source/tbxctrls/SvxColorValueSet.cxx index f8dce8446bb6..e90836c79d26 100755 --- a/svx/source/tbxctrls/SvxColorValueSet.cxx +++ b/svx/source/tbxctrls/SvxColorValueSet.cxx @@ -71,7 +71,7 @@ void SvxColorValueSet::addEntriesForXColorList(const XColorListSharedPtr aXColor if(pEntry) { - InsertItem(nStartIndex, pEntry->GetColor(), pEntry->GetName()); + InsertItem(static_cast< sal_uInt16 >(nStartIndex), pEntry->GetColor(), pEntry->GetName()); } else { @@ -87,7 +87,7 @@ Size SvxColorValueSet::layoutAllVisible(sal_uInt32 nEntryCount) nEntryCount++; } - const sal_uInt32 nRowCount(ceil(double(nEntryCount)/getColumnCount())); + const sal_uInt32 nRowCount(basegfx::fround(ceil(double(nEntryCount)/getColumnCount()))); const Size aItemSize(getEntryEdgeLength() - 2, getEntryEdgeLength() - 2); const WinBits aWinBits(GetStyle() & ~WB_VSCROLL); @@ -100,8 +100,8 @@ Size SvxColorValueSet::layoutAllVisible(sal_uInt32 nEntryCount) SetStyle(aWinBits); } - SetColCount(getColumnCount()); - SetLineCount(std::min(nRowCount, getMaxRowCount())); + SetColCount(static_cast< sal_uInt16 >(getColumnCount())); + SetLineCount(static_cast< sal_uInt16 >(std::min(nRowCount, getMaxRowCount()))); SetItemWidth(aItemSize.Width()); SetItemHeight(aItemSize.Height()); @@ -121,11 +121,11 @@ Size SvxColorValueSet::layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntry // get size whith all fields disabled const WinBits aWinBitsNoScrollNoFields(GetStyle() & ~(WB_VSCROLL|WB_NAMEFIELD|WB_NONEFIELD)); SetStyle(aWinBitsNoScrollNoFields); - const Size aSizeNoScrollNoFields(CalcWindowSizePixel(aItemSize, getColumnCount())); + const Size aSizeNoScrollNoFields(CalcWindowSizePixel(aItemSize, static_cast< sal_uInt16 >(getColumnCount()))); // get size with all needed fields SetStyle(aWinBits); - Size aNewSize(CalcWindowSizePixel(aItemSize, getColumnCount())); + Size aNewSize(CalcWindowSizePixel(aItemSize, static_cast< sal_uInt16 >(getColumnCount()))); // evtl. activate vertical scroll const bool bAdaptHeight(static_cast< sal_uInt32 >(aNewSize.Height()) > nHeight); @@ -133,7 +133,7 @@ Size SvxColorValueSet::layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntry if(bAdaptHeight) { SetStyle(aWinBits|WB_VSCROLL); - aNewSize = CalcWindowSizePixel(aItemSize, getColumnCount()); + aNewSize = CalcWindowSizePixel(aItemSize, static_cast< sal_uInt16 >(getColumnCount())); } // calculate field height and available height for requested height @@ -149,8 +149,8 @@ Size SvxColorValueSet::layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntry SetItemWidth(aItemSize.Width()); SetItemHeight(aItemSize.Height()); - SetColCount(getColumnCount()); - SetLineCount(nLineCount); + SetColCount(static_cast< sal_uInt16 >(getColumnCount())); + SetLineCount(static_cast< sal_uInt16 >(nLineCount)); return aNewSize; } diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx index 18b31ac7620b..48445701f146 100644 --- a/svx/source/unodraw/UnoGraphicExporter.cxx +++ b/svx/source/unodraw/UnoGraphicExporter.cxx @@ -721,7 +721,6 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, aVDev.SetDrawMode( aVDev.GetDrawMode() | DRAWMODE_SETTINGSLINE | DRAWMODE_SETTINGSFILL | DRAWMODE_SETTINGSTEXT | DRAWMODE_SETTINGSGRADIENT ); aVDev.EnableOutput( sal_False ); aMtf.Record( &aVDev ); - Size aNewSize; // create a view SdrView* pView; @@ -738,6 +737,7 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, pView->SetBordVisible( sal_False ); pView->SetPageVisible( sal_False ); pView->ShowSdrPage( *pPage ); + Size aNewSize(0, 0); if ( pView && pPage ) { @@ -745,9 +745,12 @@ bool GraphicExporter::GetGraphic( ExportSettings& rSettings, Graphic& aGraphic, pView->SetPageVisible( sal_False ); pView->ShowSdrPage( *pPage ); - const Point aNewOrg( pPage->GetLeftPageBorder(), pPage->GetTopPageBorder() ); - aNewSize = Size( aSize.Width() - pPage->GetLeftPageBorder() - pPage->GetRightPageBorder(), - aSize.Height() - pPage->GetTopPageBorder() - pPage->GetBottomPageBorder() ); + const Point aNewOrg( + basegfx::fround(pPage->GetLeftPageBorder()), + basegfx::fround(pPage->GetTopPageBorder())); + aNewSize = Size( + basegfx::fround(pPage->GetInnerPageScale().getX()), + basegfx::fround(pPage->GetInnerPageScale().getY())); const Rectangle aClipRect( aNewOrg, aNewSize ); MapMode aVMap( aMap ); diff --git a/svx/source/unodraw/gluepts.cxx b/svx/source/unodraw/gluepts.cxx index 7d68c3fe877a..4c729eb92548 100644 --- a/svx/source/unodraw/gluepts.cxx +++ b/svx/source/unodraw/gluepts.cxx @@ -233,7 +233,7 @@ sal_Int32 SAL_CALL SvxUnoGluePointAccess::insert( const uno::Any& aElement ) thr { SdrGluePoint aSdrGlue; convert( aUnoGlue, aSdrGlue ); - sal_uInt16 nId = pList->Insert( aSdrGlue ); + sal_uInt32 nId = pList->Insert( aSdrGlue ); // only repaint, no objectchange mpObject->ActionChanged(); @@ -255,8 +255,8 @@ void SAL_CALL SvxUnoGluePointAccess::removeByIdentifier( sal_Int32 Identifier ) const sal_uInt16 nId = (sal_uInt16)(Identifier - NON_USER_DEFINED_GLUE_POINTS) + 1; SdrGluePointList* pList = const_cast<SdrGluePointList*>(mpObject->GetGluePointList()); - const sal_uInt16 nCount = pList ? pList->GetCount() : 0; - sal_uInt16 i; + const sal_uInt32 nCount = pList ? pList->GetCount() : 0; + sal_uInt32 i; for( i = 0; i < nCount; i++ ) { @@ -287,8 +287,8 @@ void SAL_CALL SvxUnoGluePointAccess::replaceByIdentifer( sal_Int32 Identifier, c const sal_uInt16 nId = (sal_uInt16)( Identifier - NON_USER_DEFINED_GLUE_POINTS ) + 1; SdrGluePointList* pList = const_cast< SdrGluePointList* >( mpObject->GetGluePointList() ); - const sal_uInt16 nCount = pList ? pList->GetCount() : 0; - sal_uInt16 i; + const sal_uInt32 nCount = pList ? pList->GetCount() : 0; + sal_uInt32 i; for( i = 0; i < nCount; i++ ) { if( (*pList)[i].GetId() == nId ) @@ -327,8 +327,9 @@ uno::Any SAL_CALL SvxUnoGluePointAccess::getByIdentifier( sal_Int32 Identifier ) const sal_uInt16 nId = (sal_uInt16)( Identifier - NON_USER_DEFINED_GLUE_POINTS ) + 1; const SdrGluePointList* pList = mpObject->GetGluePointList(); - const sal_uInt16 nCount = pList ? pList->GetCount() : 0; - for( sal_uInt16 i = 0; i < nCount; i++ ) + const sal_uInt32 nCount = pList ? pList->GetCount() : 0; + + for( sal_uInt32 i = 0; i < nCount; i++ ) { const SdrGluePoint& rTempPoint = (*pList)[i]; if( rTempPoint.GetId() == nId ) @@ -354,18 +355,17 @@ uno::Sequence< sal_Int32 > SAL_CALL SvxUnoGluePointAccess::getIdentifiers() thro if( mpObject.is() ) { const SdrGluePointList* pList = mpObject->GetGluePointList(); - const sal_uInt16 nCount = pList ? pList->GetCount() : 0; - - sal_uInt16 i; + const sal_uInt32 nCount = pList ? pList->GetCount() : 0; + sal_uInt32 i; uno::Sequence< sal_Int32 > aIdSequence( nCount + NON_USER_DEFINED_GLUE_POINTS ); sal_Int32 *pIdentifier = aIdSequence.getArray(); for( i = 0; i < NON_USER_DEFINED_GLUE_POINTS; i++ ) - *pIdentifier++ = (sal_Int32)i; + *pIdentifier++ = i; for( i = 0; i < nCount; i++ ) - *pIdentifier++ = (sal_Int32) ( (*pList)[i].GetId() + NON_USER_DEFINED_GLUE_POINTS ) - 1; + *pIdentifier++ = ( (*pList)[i].GetId() + NON_USER_DEFINED_GLUE_POINTS ) - 1; return aIdSequence; } diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx index d7785850bf34..36ff0e954897 100644 --- a/svx/source/unodraw/unomod.cxx +++ b/svx/source/unodraw/unomod.cxx @@ -711,8 +711,7 @@ void SAL_CALL SvxUnoDrawPagesAccess::remove( const uno::Reference< drawing::XDra throw(uno::RuntimeException) { OGuard aGuard( Application::GetSolarMutex() ); - - sal_uInt16 nPageCount = mrModel.mpDoc->GetPageCount(); + const sal_uInt32 nPageCount = mrModel.mpDoc->GetPageCount(); if( nPageCount > 1 ) { // pPage von xPage besorgen und dann die Id (nPos )ermitteln diff --git a/svx/source/unodraw/unoshap2.cxx b/svx/source/unodraw/unoshap2.cxx index 019ccd1cf107..cd0c47186112 100644 --- a/svx/source/unodraw/unoshap2.cxx +++ b/svx/source/unodraw/unoshap2.cxx @@ -1198,81 +1198,49 @@ bool SvxShapePolyPolygon::setPropertyValueImpl( const ::rtl::OUString& rName, co } case OWN_ATTR_BASE_GEOMETRY: { - if( rValue.getValue() ) + if( rValue.getValue() && mpObj.is() ) { + basegfx::B2DPolyPolygon aNewPolyPolygon; + if( rValue.getValueType() == ::getCppuType(( const drawing::PointSequenceSequence*)0)) { - if( mpObj.is() ) - { - // get polygpon data - basegfx::B2DPolyPolygon aNewPolyPolygon( - basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon( - *(const drawing::PointSequenceSequence*)rValue.getValue())); - - if(aNewPolyPolygon.count()) - { - // migrate to pool metric - ForceMetricToItemPoolMetric(aNewPolyPolygon); - - // BaseGeometry means the polygon is just scaled, but has no position, mirroring, shear - // or rotation. Apply these current values from the object - const basegfx::B2DHomMatrix aNoScaleTrans( - basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( - basegfx::B2DVector(mpObj->isMirroredX() ? -1.0 : 1.0, mpObj->isMirroredY() ? -1.0 : 1.0), - mpObj->getSdrObjectShearX(), - mpObj->getSdrObjectRotate(), - mpObj->getSdrObjectTranslate())); - - aNewPolyPolygon.transform(aNoScaleTrans); - - // position relative to anchor - if(isWriterAnchorUsed()) - { - aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos())); - } - } - - // set at object - SetPolygon(aNewPolyPolygon); - } - return true; + // get polygpon data from PointSequenceSequence + aNewPolyPolygon = basegfx::tools::UnoPointSequenceSequenceToB2DPolyPolygon( + *(const drawing::PointSequenceSequence*)rValue.getValue()); } else if( rValue.getValueType() == ::getCppuType(( const drawing::PolyPolygonBezierCoords*)0)) { - if( mpObj.is() ) - { - // get polygpon data - basegfx::B2DPolyPolygon aNewPolyPolygon( - basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon( - *(const drawing::PolyPolygonBezierCoords*)rValue.getValue())); + // get polygpon data from PolyPolygonBezierCoords + aNewPolyPolygon = basegfx::tools::UnoPolyPolygonBezierCoordsToB2DPolyPolygon( + *(const drawing::PolyPolygonBezierCoords*)rValue.getValue()); + } - if(aNewPolyPolygon.count()) - { - // migrate to pool metric - ForceMetricToItemPoolMetric(aNewPolyPolygon); - - // BaseGeometry means the polygon is just scaled, but has no position, shear - // or rotation. Apply these current values from the object - const basegfx::B2DHomMatrix aNoScaleTrans( - basegfx::tools::createShearXRotateTranslateB2DHomMatrix( - mpObj->getSdrObjectShearX(), - mpObj->getSdrObjectRotate(), - mpObj->getSdrObjectTranslate())); - - aNewPolyPolygon.transform(aNoScaleTrans); - - // position relative to anchor - if(isWriterAnchorUsed()) - { - aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos())); - } - } + if(aNewPolyPolygon.count()) + { + // migrate to pool metric + ForceMetricToItemPoolMetric(aNewPolyPolygon); + + // BaseGeometry means the polygon is just scaled, but has no position, mirroring, shear + // or rotation. Apply these current values from the object + const basegfx::B2DHomMatrix aNoScaleTrans( + basegfx::tools::createScaleShearXRotateTranslateB2DHomMatrix( + basegfx::B2DVector(mpObj->isMirroredX() ? -1.0 : 1.0, mpObj->isMirroredY() ? -1.0 : 1.0), + mpObj->getSdrObjectShearX(), + mpObj->getSdrObjectRotate(), + mpObj->getSdrObjectTranslate())); - // set at object - SetPolygon(aNewPolyPolygon); + aNewPolyPolygon.transform(aNoScaleTrans); + + // position relative to anchor + if(isWriterAnchorUsed()) + { + aNewPolyPolygon.transform(basegfx::tools::createTranslateB2DHomMatrix(mpObj->GetAnchorPos())); } - return true; } + + // set at object and return + SetPolygon(aNewPolyPolygon); + return true; } break; } diff --git a/svx/source/xoutdev/xtabgrdt.cxx b/svx/source/xoutdev/xtabgrdt.cxx index 9e63062fa5e2..f9b81b3654c9 100644 --- a/svx/source/xoutdev/xtabgrdt.cxx +++ b/svx/source/xoutdev/xtabgrdt.cxx @@ -216,7 +216,7 @@ Bitmap XGradientList::CreateBitmapForUI(long nIndex) } } - const sal_uInt16 nSteps((rSize.Width() + rSize.Height()) / 3); + const sal_uInt16 nSteps(static_cast< sal_uInt16 >((rSize.Width() + rSize.Height()) / 3)); const drawinglayer::attribute::FillGradientAttribute aFillGradient( aGradientStyle, (double)rGradient.GetBorder() * 0.01, diff --git a/xmloff/inc/xmloff/shapeimport.hxx b/xmloff/inc/xmloff/shapeimport.hxx index 5a783ec25ac8..3a3e10b16ade 100644 --- a/xmloff/inc/xmloff/shapeimport.hxx +++ b/xmloff/inc/xmloff/shapeimport.hxx @@ -253,14 +253,26 @@ class SvXMLShapeContext : public SvXMLImportContext { protected: com::sun::star::uno::Reference< com::sun::star::drawing::XShape > mxShape; - sal_Bool mbTemporaryShape; rtl::OUString msHyperlink; -public: - SvXMLShapeContext( SvXMLImport& rImp, sal_uInt16 nPrfx, - const ::rtl::OUString& rLName, sal_Bool bTemporaryShape ) : SvXMLImportContext( rImp, nPrfx, rLName ), mbTemporaryShape(bTemporaryShape) {} + /// bitfield + bool mbTemporaryShape : 1; - const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const { return mxShape; } +public: + SvXMLShapeContext( + SvXMLImport& rImp, + sal_uInt16 nPrfx, + const ::rtl::OUString& rLName, + bool bTemporaryShape ) + : SvXMLImportContext( rImp, nPrfx, rLName ), + mbTemporaryShape(bTemporaryShape) + { + } + + const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& getShape() const + { + return mxShape; + } void setHyperlink( const ::rtl::OUString& rHyperlink ); }; @@ -322,7 +334,7 @@ public: SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape = sal_False); + bool bTemporaryShape = false); SvXMLShapeContext* CreateFrameChildContext( SvXMLImport& rImport, sal_uInt16 nPrefix, const rtl::OUString& rLocalName, diff --git a/xmloff/inc/xmloff/xmlmultiimagehelper.hxx b/xmloff/inc/xmloff/xmlmultiimagehelper.hxx index ea5edc92fe1b..6058afdcfb10 100644 --- a/xmloff/inc/xmloff/xmlmultiimagehelper.hxx +++ b/xmloff/inc/xmloff/xmlmultiimagehelper.hxx @@ -40,7 +40,7 @@ protected: public: multiImageImportHelper(); - ~multiImageImportHelper(); + virtual ~multiImageImportHelper(); /// solve multiple imported images. The most valuable one is choosen, /// see imlementation for evtl. changing weights and/or adding filetypes. diff --git a/xmloff/inc/xmloff/xmluconv.hxx b/xmloff/inc/xmloff/xmluconv.hxx index add54a241df4..822c242eb0b6 100644 --- a/xmloff/inc/xmloff/xmluconv.hxx +++ b/xmloff/inc/xmloff/xmluconv.hxx @@ -253,24 +253,21 @@ public: /** convert double number to string (using ::rtl::math) and DO convert to export MapUnit */ - void convertDouble(::rtl::OUStringBuffer& rBuffer, - double fNumber, sal_Bool bWriteUnits) const; + void convertDoubleAndUnit(::rtl::OUStringBuffer& rBuffer, double fNumber) const; /** convert double number to string (using ::rtl::math) and DO convert from eSrcUnit to export MapUnit */ - static void convertDouble( ::rtl::OUStringBuffer& rBuffer, - double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit); - - /** convert double number to string (using ::rtl::math) without unit conversion */ - static void convertDouble( ::rtl::OUStringBuffer& rBuffer, double fNumber); + static void convertDoubleAndUnit( ::rtl::OUStringBuffer& rBuffer, double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit); /** convert string to double number (using ::rtl::math) and DO convert. */ - sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString, sal_Bool bLookForUnits) const; + sal_Bool convertDoubleAndUnit(double& rValue, const ::rtl::OUString& rString) const; /** convert string to double number (using ::rtl::math) and DO convert from SrcUnit to DstUnit. */ - static sal_Bool convertDouble(double& rValue, - const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit); + static sal_Bool convertDoubleAndUnit(double& rValue, const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit); + + /** convert double number to string (using ::rtl::math) without unit conversion */ + static void convertDouble( ::rtl::OUStringBuffer& rBuffer, double fNumber); /** convert string to double number (using ::rtl::math) without unit conversion */ static sal_Bool convertDouble(double& rValue, const ::rtl::OUString& rString); diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index 88c3cd7a57db..b7bbdf68bb50 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx index 76edeb34aa18..196208a06ec0 100644 --- a/xmloff/source/core/xmluconv.cxx +++ b/xmloff/source/core/xmluconv.cxx @@ -19,10 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include <com/sun/star/util/DateTime.hpp> #include <com/sun/star/util/Date.hpp> #include <com/sun/star/util/Time.hpp> @@ -706,16 +705,13 @@ sal_Bool SvXMLUnitConverter::convertNumber64( sal_Int64& rValue, } /** convert double number to string (using ::rtl::math) */ -void SvXMLUnitConverter::convertDouble(::rtl::OUStringBuffer& rBuffer, - double fNumber, sal_Bool bWriteUnits) const +void SvXMLUnitConverter::convertDoubleAndUnit(::rtl::OUStringBuffer& rBuffer, double fNumber) const { - SvXMLUnitConverter::convertDouble(rBuffer, fNumber, - bWriteUnits, meCoreMeasureUnit, meXMLMeasureUnit); + SvXMLUnitConverter::convertDoubleAndUnit(rBuffer, fNumber, true, meCoreMeasureUnit, meXMLMeasureUnit); } /** convert double number to string (using ::rtl::math) */ -void SvXMLUnitConverter::convertDouble( ::rtl::OUStringBuffer& rBuffer, - double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit) +void SvXMLUnitConverter::convertDoubleAndUnit( ::rtl::OUStringBuffer& rBuffer, double fNumber, sal_Bool bWriteUnits, MapUnit eCoreUnit, MapUnit eDstUnit) { if(MAP_RELATIVE == eCoreUnit) { @@ -743,25 +739,15 @@ void SvXMLUnitConverter::convertDouble( ::rtl::OUStringBuffer& rBuffer, double f } /** convert string to double number (using ::rtl::math) */ -sal_Bool SvXMLUnitConverter::convertDouble(double& rValue, - const ::rtl::OUString& rString, sal_Bool bLookForUnits) const +sal_Bool SvXMLUnitConverter::convertDoubleAndUnit(double& rValue, const ::rtl::OUString& rString) const { - if(bLookForUnits) - { - MapUnit eSrcUnit = SvXMLExportHelper::GetUnitFromString(rString, meCoreMeasureUnit); + const MapUnit eSrcUnit(SvXMLExportHelper::GetUnitFromString(rString, meCoreMeasureUnit)); - return SvXMLUnitConverter::convertDouble(rValue, rString, - eSrcUnit, meCoreMeasureUnit); - } - else - { - return SvXMLUnitConverter::convertDouble(rValue, rString); - } + return SvXMLUnitConverter::convertDoubleAndUnit(rValue, rString, eSrcUnit, meCoreMeasureUnit); } /** convert string to double number (using ::rtl::math) */ -sal_Bool SvXMLUnitConverter::convertDouble(double& rValue, - const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit) +sal_Bool SvXMLUnitConverter::convertDoubleAndUnit(double& rValue, const ::rtl::OUString& rString, MapUnit eSrcUnit, MapUnit eCoreUnit) { rtl_math_ConversionStatus eStatus; rValue = ::rtl::math::stringToDouble( rString, (sal_Unicode)('.'), (sal_Unicode)(','), &eStatus, NULL ); @@ -1465,11 +1451,11 @@ sal_Bool SvXMLUnitConverter::convertPosition3D( drawing::Position3D& rPosition, if ( !lcl_getPositions(rValue,aContentX,aContentY,aContentZ) ) return sal_False; - if ( !convertDouble( rPosition.PositionX, aContentX, sal_True ) ) + if ( !convertDoubleAndUnit( rPosition.PositionX, aContentX ) ) return sal_False; - if ( !convertDouble( rPosition.PositionY, aContentY, sal_True ) ) + if ( !convertDoubleAndUnit( rPosition.PositionY, aContentY ) ) return sal_False; - return convertDouble( rPosition.PositionZ, aContentZ, sal_True ); + return convertDoubleAndUnit( rPosition.PositionZ, aContentZ ); } /** convert Position3D to string */ @@ -1477,11 +1463,11 @@ void SvXMLUnitConverter::convertPosition3D( OUStringBuffer &rBuffer, const drawing::Position3D& rPosition ) { rBuffer.append( sal_Unicode('(') ); - convertDouble( rBuffer, rPosition.PositionX, sal_True ); + convertDoubleAndUnit(rBuffer, rPosition.PositionX); rBuffer.append( sal_Unicode(' ') ); - convertDouble( rBuffer, rPosition.PositionY, sal_True ); + convertDoubleAndUnit(rBuffer, rPosition.PositionY); rBuffer.append( sal_Unicode(' ') ); - convertDouble( rBuffer, rPosition.PositionZ, sal_True ); + convertDoubleAndUnit(rBuffer, rPosition.PositionZ); rBuffer.append( sal_Unicode(')') ); } diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx index 5fbd9c1748ea..4313e820759e 100644 --- a/xmloff/source/draw/shapeexport2.cxx +++ b/xmloff/source/draw/shapeexport2.cxx @@ -161,13 +161,13 @@ void XMLShapeExport::ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTR } // write positive svg:width - mrExport.GetMM100UnitConverter().convertDouble(sStringBuffer, aTRScale.getX(), true); + mrExport.GetMM100UnitConverter().convertDoubleAndUnit(sStringBuffer, aTRScale.getX()); //mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(aTRScale.getX())); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, aStr); // write positive svg:height - mrExport.GetMM100UnitConverter().convertDouble(sStringBuffer, aTRScale.getY(), true); + mrExport.GetMM100UnitConverter().convertDoubleAndUnit(sStringBuffer, aTRScale.getY()); //mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(aTRScale.getY())); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, aStr); @@ -234,7 +234,7 @@ void XMLShapeExport::ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTR if(nFeatures & SEF_EXPORT_X) { // svg: x - mrExport.GetMM100UnitConverter().convertDouble(sStringBuffer, rTRTranslate.getX(), true); + mrExport.GetMM100UnitConverter().convertDoubleAndUnit(sStringBuffer, rTRTranslate.getX()); //mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(rTRTranslate.getX())); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_X, aStr); @@ -243,7 +243,7 @@ void XMLShapeExport::ImpExportNewTrans_FeaturesAndWrite(::basegfx::B2DTuple& rTR if(nFeatures & SEF_EXPORT_Y) { // svg: y - mrExport.GetMM100UnitConverter().convertDouble(sStringBuffer, rTRTranslate.getY(), true); + mrExport.GetMM100UnitConverter().convertDoubleAndUnit(sStringBuffer, rTRTranslate.getY()); //mrExport.GetMM100UnitConverter().convertMeasure(sStringBuffer, FRound(rTRTranslate.getY())); aStr = sStringBuffer.makeStringAndClear(); mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_Y, aStr); diff --git a/xmloff/source/draw/shapeexport4.cxx b/xmloff/source/draw/shapeexport4.cxx index 1ba6dd4eeb60..cced808a9a31 100644 --- a/xmloff/source/draw/shapeexport4.cxx +++ b/xmloff/source/draw/shapeexport4.cxx @@ -549,7 +549,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionBrightness = 0; if ( rProp.Value >>= fExtrusionBrightness ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionBrightness, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionBrightness, sal_False, MAP_RELATIVE, MAP_RELATIVE ); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_BRIGHTNESS, aStr ); @@ -564,7 +564,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fDepth = 0; if ( aDepthParaPair.First.Value >>= fDepth ) { - rExport.GetMM100UnitConverter().convertDouble( aStrBuffer, fDepth, sal_True ); + rExport.GetMM100UnitConverter().convertDoubleAndUnit(aStrBuffer, fDepth); ExportParameter( aStrBuffer, aDepthParaPair.Second ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_DEPTH, aStr ); @@ -577,7 +577,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionDiffusion = 0; if ( rProp.Value >>= fExtrusionDiffusion ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionDiffusion, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionDiffusion, sal_False, MAP_RELATIVE, MAP_RELATIVE ); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_DIFFUSION, aStr ); @@ -620,7 +620,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionFirstLightLevel = 0; if ( rProp.Value >>= fExtrusionFirstLightLevel ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionFirstLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionFirstLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE ); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_FIRST_LIGHT_LEVEL, aStr ); @@ -632,7 +632,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionSecondLightLevel = 0; if ( rProp.Value >>= fExtrusionSecondLightLevel ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionSecondLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionSecondLightLevel, sal_False, MAP_RELATIVE, MAP_RELATIVE ); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SECOND_LIGHT_LEVEL, aStr ); @@ -726,7 +726,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionShininess = 0; if ( rProp.Value >>= fExtrusionShininess ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionShininess, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionShininess, sal_False, MAP_RELATIVE, MAP_RELATIVE ); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SHININESS, aStr ); @@ -750,7 +750,7 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean double fExtrusionSpecularity = 0; if ( rProp.Value >>= fExtrusionSpecularity ) { - rUnitConverter.convertDouble( aStrBuffer, fExtrusionSpecularity, sal_False, MAP_RELATIVE, MAP_RELATIVE ); + rUnitConverter.convertDoubleAndUnit( aStrBuffer, fExtrusionSpecularity, sal_False, MAP_RELATIVE, MAP_RELATIVE ); aStrBuffer.append( (sal_Unicode)'%' ); aStr = aStrBuffer.makeStringAndClear(); rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_EXTRUSION_SPECULARITY, aStr ); diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index caa90145cd42..730ef08bc718 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -19,23 +19,15 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" #include <tools/debug.hxx> - #include <com/sun/star/text/PositionLayoutDir.hpp> #include <com/sun/star/chart/XChartDocument.hpp> - #include "unointerfacetouniqueidentifiermapper.hxx" - #include <list> - -#ifndef _XMLOFF_SHAPEIMPORT_HXX #include <xmloff/shapeimport.hxx> -#endif #include <xmloff/xmltkmap.hxx> #include "xmloff/xmlnmspe.hxx" #include <xmloff/xmltoken.hxx> @@ -47,7 +39,6 @@ #include "ximp3dobject.hxx" #include "ximpgrp.hxx" #include "ximplink.hxx" - #include <map> #include <vector> @@ -789,7 +780,7 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateGroupChildContext( const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) { SdXMLShapeContext *pContext = 0L; @@ -889,7 +880,7 @@ SvXMLShapeContext* XMLShapeImportHelper::CreateGroupChildContext( case XML_TOK_GROUP_CUSTOM_SHAPE: { // draw:customshape - pContext = new SdXMLCustomShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes, sal_False ); + pContext = new SdXMLCustomShapeContext( rImport, p_nPrefix, rLocalName, xAttrList, rShapes, false ); break; } case XML_TOK_GROUP_A: diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx index 125ea9a3997c..7ee9bddab83c 100644 --- a/xmloff/source/draw/xexptran.cxx +++ b/xmloff/source/draw/xexptran.cxx @@ -19,10 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" + #include "xexptran.hxx" #include <tools/debug.hxx> #include <rtl/ustrbuf.hxx> @@ -237,7 +236,7 @@ double Imp_GetDoubleChar(const OUString& rStr, sal_Int32& rPos, const sal_Int32 if(sNumberString.getLength()) { if(bLookForUnits) - rConv.convertDouble(fRetval, sNumberString.makeStringAndClear(), true); + rConv.convertDoubleAndUnit(fRetval, sNumberString.makeStringAndClear()); else rConv.convertDouble(fRetval, sNumberString.makeStringAndClear()); } @@ -251,7 +250,7 @@ void Imp_PutDoubleChar(OUString& rStr, const SvXMLUnitConverter& rConv, double f OUStringBuffer sStringBuffer; if(bConvertUnits) - rConv.convertDouble(sStringBuffer, fValue, true); + rConv.convertDoubleAndUnit(sStringBuffer, fValue); else rConv.convertDouble(sStringBuffer, fValue); diff --git a/xmloff/source/draw/ximp3dobject.cxx b/xmloff/source/draw/ximp3dobject.cxx index e350cb0b1888..1d673cffec6c 100644 --- a/xmloff/source/draw/ximp3dobject.cxx +++ b/xmloff/source/draw/ximp3dobject.cxx @@ -54,7 +54,7 @@ SdXML3DObjectContext::SdXML3DObjectContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mbSetTransform( sal_False ) { @@ -188,7 +188,7 @@ SdXML3DCubeObjectShapeContext::SdXML3DCubeObjectShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), maMinEdge(-2500.0, -2500.0, -2500.0), maMaxEdge(2500.0, 2500.0, 2500.0), @@ -297,7 +297,7 @@ SdXML3DSphereObjectShapeContext::SdXML3DSphereObjectShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), maCenter(0.0, 0.0, 0.0), maSize(5000.0, 5000.0, 5000.0), @@ -403,7 +403,7 @@ SdXML3DPolygonBasedShapeContext::SdXML3DPolygonBasedShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXML3DObjectContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) { sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; @@ -552,7 +552,7 @@ SdXML3DLatheObjectShapeContext::SdXML3DLatheObjectShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) { } @@ -594,7 +594,7 @@ SdXML3DExtrudeObjectShapeContext::SdXML3DExtrudeObjectShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXML3DPolygonBasedShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) { } diff --git a/xmloff/source/draw/ximp3dobject.hxx b/xmloff/source/draw/ximp3dobject.hxx index 6dc2c6f875ea..b86ebc029d7d 100644 --- a/xmloff/source/draw/ximp3dobject.hxx +++ b/xmloff/source/draw/ximp3dobject.hxx @@ -54,7 +54,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXML3DObjectContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -76,7 +76,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXML3DCubeObjectShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -98,7 +98,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXML3DSphereObjectShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -118,7 +118,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXML3DPolygonBasedShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -135,7 +135,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXML3DLatheObjectShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -152,7 +152,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXML3DExtrudeObjectShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx index a9b150a24f59..5406781e8f98 100644 --- a/xmloff/source/draw/ximp3dscene.cxx +++ b/xmloff/source/draw/ximp3dscene.cxx @@ -101,8 +101,9 @@ SdXML3DSceneShapeContext::SdXML3DSceneShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShapes) -: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShapes ), SdXML3DSceneAttributesHelper( rImport ) + bool bTemporaryShapes) +: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShapes ), + SdXML3DSceneAttributesHelper( rImport ) { } diff --git a/xmloff/source/draw/ximp3dscene.hxx b/xmloff/source/draw/ximp3dscene.hxx index 3d49f2ec210c..21b6d426ca9c 100644 --- a/xmloff/source/draw/ximp3dscene.hxx +++ b/xmloff/source/draw/ximp3dscene.hxx @@ -54,7 +54,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXML3DSceneShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx index f6d2c35bce06..80a6505210af 100644 --- a/xmloff/source/draw/ximpcustomshape.cxx +++ b/xmloff/source/draw/ximpcustomshape.cxx @@ -125,7 +125,7 @@ void GetDistance( std::vector< com::sun::star::beans::PropertyValue >& rDest, { double fAttrDouble; MapUnit eSrcUnit( SvXMLExportHelper::GetUnitFromString( rValue, MAP_100TH_MM ) ); - if ( SvXMLUnitConverter::convertDouble( fAttrDouble, rValue, eSrcUnit, MAP_100TH_MM ) ) + if ( SvXMLUnitConverter::convertDoubleAndUnit( fAttrDouble, rValue, eSrcUnit, MAP_100TH_MM ) ) { beans::PropertyValue aProp; aProp.Name = EASGet( eDestProp ); diff --git a/xmloff/source/draw/ximpgrp.cxx b/xmloff/source/draw/ximpgrp.cxx index 5a9d988b6c43..49a90338dbf3 100644 --- a/xmloff/source/draw/ximpgrp.cxx +++ b/xmloff/source/draw/ximpgrp.cxx @@ -43,7 +43,7 @@ SdXMLGroupShapeContext::SdXMLGroupShapeContext( sal_uInt16 nPrfx, const OUString& rLocalName, const uno::Reference< xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) { } diff --git a/xmloff/source/draw/ximpgrp.hxx b/xmloff/source/draw/ximpgrp.hxx index f08dcbcc03d0..cb6c2ab0f667 100644 --- a/xmloff/source/draw/ximpgrp.hxx +++ b/xmloff/source/draw/ximpgrp.hxx @@ -46,7 +46,7 @@ public: SdXMLGroupShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLGroupShapeContext(); virtual SvXMLImportContext *CreateChildContext( diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index f234c55ce195..09b73db45f61 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -149,21 +149,36 @@ SdXMLShapeContext::SdXMLShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) -: SvXMLShapeContext( rImport, nPrfx, rLocalName, bTemporaryShape ) -, mxShapes( rShapes ) -, mxAttrList(xAttrList) -, mbListContextPushed( false ) -, mnStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_ID) -, mbIsPlaceholder(sal_False) -, mbClearDefaultAttributes( true ) -, mbIsUserTransformed(sal_False) -, mnZOrder(-1) -, maSize(1, 1) -, maPosition(0, 0) -, maUsedTransformation() -, mbVisible(true) -, mbPrintable(true) + bool bTemporaryShape) +: SvXMLShapeContext( rImport, nPrfx, rLocalName, bTemporaryShape ), + mxShapes( rShapes ), + mxCursor(), + mxOldCursor(), + mxAttrList(xAttrList), + mxGluePoints(), + mxLockable(), + maDrawStyleName(), + maTextStyleName(), + maPresentationClass(), + maShapeName(), + maThumbnailURL(), + mnStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_ID), + mnClass(0), + mnZOrder(-1), + maShapeId(), + maLayerName(), + maShapeTitle(), + maShapeDescription(), + mnTransform(), + maObjectSize(1.0, 1.0), + maObjectPosition(0.0, 0.0), + maUsedTransformation(), + mbVisible(true), + mbPrintable(true), + mbListContextPushed(false), + mbIsPlaceholder(false), + mbClearDefaultAttributes(true), + mbIsUserTransformed(false) { } @@ -537,26 +552,24 @@ void SdXMLShapeContext::SetTransformation() if(mxShape.is()) { uno::Reference< beans::XPropertySet > xPropSet(mxShape, uno::UNO_QUERY); + if(xPropSet.is()) { maUsedTransformation.identity(); - if(maSize.Width != 1 || maSize.Height != 1) + if(!basegfx::fTools::equal(maObjectSize.getX(), 1.0) || !basegfx::fTools::equal(maObjectSize.getY(), 1.0)) { // take care there are no zeros used by error - if(0 == maSize.Width) - maSize.Width = 1; - if(0 == maSize.Height) - maSize.Height = 1; - // set global size. This should always be used. - maUsedTransformation.scale(maSize.Width, maSize.Height); + maUsedTransformation.scale( + basegfx::fTools::equalZero(maObjectSize.getX()) ? 1.0 : maObjectSize.getX(), + basegfx::fTools::equalZero(maObjectSize.getY()) ? 1.0 : maObjectSize.getY()); } - if(maPosition.X != 0 || maPosition.Y != 0) + if(!basegfx::fTools::equalZero(maObjectPosition.getX()) || !basegfx::fTools::equalZero(maObjectPosition.getY())) { // if global position is used, add it to transformation - maUsedTransformation.translate(maPosition.X, maPosition.Y); + maUsedTransformation.translate(maObjectPosition.getX(), maObjectPosition.getY()); } if(mnTransform.NeedsAction()) @@ -567,20 +580,20 @@ void SdXMLShapeContext::SetTransformation() // rotate used herein is applied around the (0,0) position // of the PAGE object !!! ::basegfx::B2DHomMatrix aMat; + mnTransform.GetFullTransform(aMat); // now add to transformation - maUsedTransformation *= aMat; + maUsedTransformation = aMat * maUsedTransformation; } // now set transformation for this object - uno::Any aAny; drawing::HomogenMatrix3 aMatrix; basegfx::tools::B2DHomMatrixToUnoHomogenMatrix3(maUsedTransformation, aMatrix); + uno::Any aAny; aAny <<= aMatrix; - xPropSet->setPropertyValue( - OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")), aAny); + xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")), aAny); } } } @@ -847,19 +860,31 @@ void SdXMLShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::OUStr { if( IsXMLToken( rLocalName, XML_X ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(maPosition.X, rValue); + //GetImport().GetMM100UnitConverter().convertMeasure(maPosition.X, rValue); + double fValue(0.0); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(fValue, rValue); + maObjectPosition.setX(fValue); } else if( IsXMLToken( rLocalName, XML_Y ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(maPosition.Y, rValue); + //GetImport().GetMM100UnitConverter().convertMeasure(maPosition.Y, rValue); + double fValue(0.0); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(fValue, rValue); + maObjectPosition.setY(fValue); } else if( IsXMLToken( rLocalName, XML_WIDTH ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(maSize.Width, rValue); + //GetImport().GetMM100UnitConverter().convertMeasure(maSize.Width, rValue); + double fValue(0.0); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(fValue, rValue); + maObjectSize.setX(fValue); } else if( IsXMLToken( rLocalName, XML_HEIGHT ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(maSize.Height, rValue); + //GetImport().GetMM100UnitConverter().convertMeasure(maSize.Height, rValue); + double fValue(0.0); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(fValue, rValue); + maObjectSize.setY(fValue); } else if( IsXMLToken( rLocalName, XML_TRANSFORM ) ) { @@ -916,7 +941,7 @@ SdXMLRectShapeContext::SdXMLRectShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mnRadius( 0L ) { @@ -988,12 +1013,12 @@ SdXMLLineShapeContext::SdXMLLineShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), - mnX1( 0L ), - mnY1( 0L ), - mnX2( 1L ), - mnY2( 1L ) + mfX1( 0.0 ), + mfY1( 0.0 ), + mfX2( 1.0 ), + mfY2( 1.0 ) { } @@ -1012,22 +1037,26 @@ void SdXMLLineShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl::O { if( IsXMLToken( rLocalName, XML_X1 ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(mnX1, rValue); + // GetImport().GetMM100UnitConverter().convertMeasure(mnX1, rValue); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfX1, rValue); return; } if( IsXMLToken( rLocalName, XML_Y1 ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(mnY1, rValue); + //GetImport().GetMM100UnitConverter().convertMeasure(mnY1, rValue); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfY1, rValue); return; } if( IsXMLToken( rLocalName, XML_X2 ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(mnX2, rValue); + //GetImport().GetMM100UnitConverter().convertMeasure(mnX2, rValue); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfX2, rValue); return; } if( IsXMLToken( rLocalName, XML_Y2 ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(mnY2, rValue); + //GetImport().GetMM100UnitConverter().convertMeasure(mnY2, rValue); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfY2, rValue); return; } } @@ -1065,9 +1094,9 @@ void SdXMLLineShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib awt::Point* pInnerSequence = pOuterSequence->getArray(); uno::Any aAny; - *pInnerSequence = awt::Point(mnX1, mnY1); + *pInnerSequence = awt::Point(basegfx::fround(mfX1), basegfx::fround(mfY1)); pInnerSequence++; - *pInnerSequence = awt::Point(mnX2, mnY2); + *pInnerSequence = awt::Point(basegfx::fround(mfX2), basegfx::fround(mfY2)); aAny <<= aPolyPoly; xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Geometry")), aAny); @@ -1105,12 +1134,12 @@ SdXMLEllipseShapeContext::SdXMLEllipseShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), - mnCX( 0L ), - mnCY( 0L ), - mnRX( 1L ), - mnRY( 1L ), + mfCX( 0.0 ), + mfCY( 0.0 ), + mfRX( 1.0 ), + mfRY( 1.0 ), meKind( drawing::CircleKind_FULL ), mnStartAngle( 0 ), mnEndAngle( 0 ) @@ -1132,29 +1161,34 @@ void SdXMLEllipseShapeContext::processAttribute( sal_uInt16 nPrefix, const ::rtl { if( IsXMLToken( rLocalName, XML_RX ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue); + // GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfRX, rValue); return; } if( IsXMLToken( rLocalName, XML_RY ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(mnRY, rValue); + // GetImport().GetMM100UnitConverter().convertMeasure(mnRY, rValue); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfRY, rValue); return; } if( IsXMLToken( rLocalName, XML_CX ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(mnCX, rValue); + // GetImport().GetMM100UnitConverter().convertMeasure(mnCX, rValue); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfCX, rValue); return; } if( IsXMLToken( rLocalName, XML_CY ) ) { - GetImport().GetMM100UnitConverter().convertMeasure(mnCY, rValue); + // GetImport().GetMM100UnitConverter().convertMeasure(mnCY, rValue); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfCY, rValue); return; } if( IsXMLToken( rLocalName, XML_R ) ) { // single radius, it's a circle and both radii are the same - GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue); - mnRY = mnRX; + // GetImport().GetMM100UnitConverter().convertMeasure(mnRX, rValue); + GetImport().GetMM100UnitConverter().convertDoubleAndUnit(mfRX, rValue); + mfRY = mfRX; return; } } @@ -1200,13 +1234,16 @@ void SdXMLEllipseShapeContext::StartElement(const uno::Reference< xml::sax::XAtt SetStyle(); SetLayer(); - if(mnCX != 0 || mnCY != 0 || mnRX != 1 || mnRY != 1) + if(!basegfx::fTools::equalZero(mfCX) + || !basegfx::fTools::equalZero(mfCY) + || !basegfx::fTools::equalZero(mfRX) + || !basegfx::fTools::equalZero(mfRY)) { // #121972# center/radius is used, put to pos and size - maSize.Width = 2 * mnRX; - maSize.Height = 2 * mnRY; - maPosition.X = mnCX - mnRX; - maPosition.Y = mnCY - mnRY; + maObjectSize.setX(2.0 * mfRX); + maObjectSize.setY(2.0 * mfRY); + maObjectPosition.setX(mfCX - mfRX); + maObjectPosition.setY(mfCY - mfRY); } // set pos, size, shear and rotate @@ -1241,7 +1278,9 @@ SdXMLPolygonShapeContext::SdXMLPolygonShapeContext( sal_uInt16 nPrfx, const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, - uno::Reference< drawing::XShapes >& rShapes, sal_Bool bClosed, sal_Bool bTemporaryShape) + uno::Reference< drawing::XShapes >& rShapes, + bool bClosed, + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mbClosed( bClosed ) { @@ -1305,10 +1344,9 @@ void SdXMLPolygonShapeContext::StartElement(const uno::Reference< xml::sax::XAtt // TTTT: Is this correct? It overrides ViewBox stuff; OTOH it makes no // sense to have the geometry content size different from object size - if(maSize.Width != 0 && maSize.Height !=0) + if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY())) { - aSize.setX(maSize.Width); - aSize.setY(maSize.Height); + aSize = maObjectSize; } basegfx::B2DPolygon aPolygon; @@ -1368,7 +1406,7 @@ SdXMLPathShapeContext::SdXMLPathShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mbClosed( sal_True ) { @@ -1414,10 +1452,9 @@ void SdXMLPathShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib // TTTT: Is this correct? It overrides ViewBox stuff; OTOH it makes no // sense to have the geometry content size different from object size - if(maSize.Width != 0 && maSize.Height !=0) + if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY())) { - aSize.setX(maSize.Width); - aSize.setY(maSize.Height); + aSize = maObjectSize; } basegfx::B2DPolyPolygon aPolyPolygon; @@ -1610,7 +1647,7 @@ SdXMLTextBoxShapeContext::SdXMLTextBoxShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mnRadius(0) { @@ -1782,7 +1819,7 @@ SdXMLControlShapeContext::SdXMLControlShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) { } @@ -1854,7 +1891,7 @@ SdXMLConnectorShapeContext::SdXMLConnectorShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), maStart(0,0), maEnd(1,1), @@ -2145,7 +2182,7 @@ SdXMLMeasureShapeContext::SdXMLMeasureShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), maStart(0,0), maEnd(1,1) @@ -2258,7 +2295,7 @@ SdXMLPageShapeContext::SdXMLPageShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mnPageNumber(0) { mbClearDefaultAttributes = false; @@ -2353,7 +2390,7 @@ SdXMLCaptionShapeContext::SdXMLCaptionShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), // #86616# for correct edge rounding import mnRadius needs to be initialized mnRadius( 0L ) @@ -2456,7 +2493,7 @@ SdXMLGraphicObjectShapeContext::SdXMLGraphicObjectShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), maURL(), mbLateAddToIdentifierMapper(false) @@ -2633,7 +2670,7 @@ SdXMLChartShapeContext::SdXMLChartShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mpChartContext( NULL ) { @@ -2738,10 +2775,10 @@ SvXMLImportContext * SdXMLChartShapeContext::CreateChildContext( sal_uInt16 nPre ////////////////////////////////////////////////////////////////////////////// SdXMLObjectShapeContext::SdXMLObjectShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, - const rtl::OUString& rLocalName, - const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, - com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) { } @@ -2955,10 +2992,10 @@ SvXMLImportContext* SdXMLObjectShapeContext::CreateChildContext( ////////////////////////////////////////////////////////////////////////////// SdXMLAppletShapeContext::SdXMLAppletShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, - const rtl::OUString& rLocalName, - const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, - com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mbIsScript( sal_False ) { @@ -3024,10 +3061,10 @@ void SdXMLAppletShapeContext::EndElement() { uno::Any aAny; - if ( maSize.Width && maSize.Height ) + if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY())) { // the visual area for applet must be set on loading - awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height ); + awt::Rectangle aRect(0, 0, basegfx::fround(maObjectSize.getX()), basegfx::fround(maObjectSize.getY())); aAny <<= aRect; xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), aAny ); } @@ -3118,10 +3155,10 @@ SvXMLImportContext * SdXMLAppletShapeContext::CreateChildContext( sal_uInt16 p_n ////////////////////////////////////////////////////////////////////////////// SdXMLPluginShapeContext::SdXMLPluginShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, - const rtl::OUString& rLocalName, - const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, - com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) : + const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), mbMedia( false ) { @@ -3230,14 +3267,14 @@ void SdXMLPluginShapeContext::EndElement() { uno::Any aAny; - if ( maSize.Width && maSize.Height ) + if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY())) { const rtl::OUString sVisibleArea( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ); uno::Reference< beans::XPropertySetInfo > aXPropSetInfo( xProps->getPropertySetInfo() ); if ( !aXPropSetInfo.is() || aXPropSetInfo->hasPropertyByName( sVisibleArea ) ) { // the visual area for a plugin must be set on loading - awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height ); + awt::Rectangle aRect(0, 0, basegfx::fround(maObjectSize.getX()), basegfx::fround(maObjectSize.getY())); aAny <<= aRect; xProps->setPropertyValue( sVisibleArea, aAny ); } @@ -3388,10 +3425,10 @@ SvXMLImportContext * SdXMLPluginShapeContext::CreateChildContext( sal_uInt16 p_n ////////////////////////////////////////////////////////////////////////////// SdXMLFloatingFrameShapeContext::SdXMLFloatingFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, - const rtl::OUString& rLocalName, - const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, - com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) { } @@ -3466,10 +3503,10 @@ void SdXMLFloatingFrameShapeContext::EndElement() if( xProps.is() ) { - if ( maSize.Width && maSize.Height ) + if(!basegfx::fTools::equalZero(maObjectSize.getX()) && !basegfx::fTools::equalZero(maObjectSize.getY())) { // the visual area for a floating frame must be set on loading - awt::Rectangle aRect( 0, 0, maSize.Width, maSize.Height ); + awt::Rectangle aRect(0, 0, basegfx::fround(maObjectSize.getX()), basegfx::fround(maObjectSize.getY())); uno::Any aAny; aAny <<= aRect; xProps->setPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ), aAny ); @@ -3483,10 +3520,10 @@ void SdXMLFloatingFrameShapeContext::EndElement() ////////////////////////////////////////////////////////////////////////////// SdXMLFrameShapeContext::SdXMLFrameShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, - const rtl::OUString& rLocalName, - const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, - com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + const rtl::OUString& rLocalName, + const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ), multiImageImportHelper(), mbSupportsReplacement( sal_False ), @@ -3755,7 +3792,7 @@ SdXMLCustomShapeContext::SdXMLCustomShapeContext( const OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, uno::Reference< drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape) + bool bTemporaryShape) : SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape ) { } diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx index 4f60136d2269..7d11fb72b4d5 100644 --- a/xmloff/source/draw/ximpshap.hxx +++ b/xmloff/source/draw/ximpshap.hxx @@ -36,6 +36,8 @@ #include <xmloff/shapeimport.hxx> #include <xmloff/xmlmultiimagehelper.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> +#include <basegfx/point/b2dpoint.hxx> +#include <basegfx/vector/b2dvector.hxx> ////////////////////////////////////////////////////////////////////////////// // common shape context @@ -57,14 +59,8 @@ protected: rtl::OUString maShapeName; rtl::OUString maThumbnailURL; - /// whether to restore list context (#91964#) - bool mbListContextPushed; - sal_uInt16 mnStyleFamily; sal_uInt16 mnClass; - sal_Bool mbIsPlaceholder; - bool mbClearDefaultAttributes; - sal_Bool mbIsUserTransformed; sal_Int32 mnZOrder; rtl::OUString maShapeId; rtl::OUString maLayerName; @@ -74,12 +70,22 @@ protected: rtl::OUString maShapeDescription; SdXMLImExTransform2D mnTransform; - com::sun::star::awt::Size maSize; - com::sun::star::awt::Point maPosition; + basegfx::B2DVector maObjectSize; + basegfx::B2DPoint maObjectPosition; + //com::sun::star::awt::Size maSize; + //com::sun::star::awt::Point maPosition; basegfx::B2DHomMatrix maUsedTransformation; - bool mbVisible; - bool mbPrintable; + /// bitfield + bool mbVisible : 1; + bool mbPrintable : 1; + + /// whether to restore list context (#91964#) + bool mbListContextPushed : 1; + + bool mbIsPlaceholder : 1; + bool mbClearDefaultAttributes : 1; + bool mbIsUserTransformed : 1; /** if bSupportsStyle is false, auto styles will be set but not a style */ void SetStyle( bool bSupportsStyle = true ); @@ -103,7 +109,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -131,7 +137,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLRectShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -144,17 +150,18 @@ public: class SdXMLLineShapeContext : public SdXMLShapeContext { - sal_Int32 mnX1; - sal_Int32 mnY1; - sal_Int32 mnX2; - sal_Int32 mnY2; +private: + double mfX1; + double mfY1; + double mfX2; + double mfY2; public: SdXMLLineShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLLineShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -167,12 +174,12 @@ public: class SdXMLEllipseShapeContext : public SdXMLShapeContext { - sal_Int32 mnCX; - sal_Int32 mnCY; - sal_Int32 mnRX; - sal_Int32 mnRY; + double mfCX; + double mfCY; + double mfRX; + double mfRY; - sal_uInt16 meKind; + sal_uInt16 meKind; sal_Int32 mnStartAngle; sal_Int32 mnEndAngle; public: @@ -180,7 +187,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLEllipseShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -195,13 +202,15 @@ class SdXMLPolygonShapeContext : public SdXMLShapeContext { rtl::OUString maPoints; rtl::OUString maViewBox; - sal_Bool mbClosed; + bool mbClosed; public: SdXMLPolygonShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, - com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, sal_Bool bClosed, sal_Bool bTemporaryShape); + com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, + bool bClosed, + bool bTemporaryShape); virtual ~SdXMLPolygonShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -216,14 +225,14 @@ class SdXMLPathShapeContext : public SdXMLShapeContext { rtl::OUString maD; rtl::OUString maViewBox; - sal_Bool mbClosed; + bool mbClosed; public: SdXMLPathShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLPathShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -243,7 +252,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLTextBoxShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -264,7 +273,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLControlShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -299,7 +308,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLConnectorShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -321,7 +330,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLMeasureShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); virtual void EndElement(); @@ -342,7 +351,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLPageShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -364,7 +373,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLCaptionShapeContext(); virtual void StartElement(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList); @@ -389,7 +398,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLGraphicObjectShapeContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -417,7 +426,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLChartShapeContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -444,7 +453,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLObjectShapeContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -476,7 +485,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLAppletShapeContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -506,7 +515,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLPluginShapeContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -533,7 +542,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLFloatingFrameShapeContext(); virtual void StartElement( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttrList ); @@ -563,7 +572,7 @@ public: const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLFrameShapeContext(); virtual SvXMLImportContext * CreateChildContext( sal_uInt16 nPrefix, const ::rtl::OUString& rLocalName, @@ -590,7 +599,7 @@ public: SdXMLCustomShapeContext( SvXMLImport& rImport, sal_uInt16 nPrfx, const rtl::OUString& rLocalName, const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList, com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rShapes, - sal_Bool bTemporaryShape); + bool bTemporaryShape); virtual ~SdXMLCustomShapeContext(); virtual void StartElement( const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList ); diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx index e67ebdc6d096..6f0c74907b0e 100644 --- a/xmloff/source/style/chrhghdl.cxx +++ b/xmloff/source/style/chrhghdl.cxx @@ -58,7 +58,7 @@ sal_Bool XMLCharHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rV if( rStrImpValue.indexOf( sal_Unicode('%') ) == -1 ) { MapUnit eSrcUnit = SvXMLExportHelper::GetUnitFromString( rStrImpValue, MAP_POINT ); - if( SvXMLUnitConverter::convertDouble( fSize, rStrImpValue, eSrcUnit, MAP_POINT )) + if( SvXMLUnitConverter::convertDoubleAndUnit( fSize, rStrImpValue, eSrcUnit, MAP_POINT )) { rValue <<= (float)fSize; return sal_True; @@ -75,7 +75,7 @@ sal_Bool XMLCharHeightHdl::exportXML( OUString& rStrExpValue, const uno::Any& rV float fSize = 0; if( rValue >>= fSize ) { - SvXMLUnitConverter::convertDouble( aOut, (double)fSize, sal_True, MAP_POINT, MAP_POINT ); + SvXMLUnitConverter::convertDoubleAndUnit( aOut, (double)fSize, sal_True, MAP_POINT, MAP_POINT ); aOut.append( sal_Unicode('p')); aOut.append( sal_Unicode('t')); } |