chart2/inc/ChartView.hxx | 10 chart2/qa/extras/chart2import.cxx | 2 chart2/source/view/axes/Tickmarks.hxx | 5 chart2/source/view/axes/VAxisBase.cxx | 4 chart2/source/view/axes/VAxisBase.hxx | 2 chart2/source/view/axes/VAxisProperties.cxx | 9 chart2/source/view/axes/VAxisProperties.hxx | 4 chart2/source/view/axes/VCartesianAxis.cxx | 445 +++++++++++++------ chart2/source/view/axes/VCartesianAxis.hxx | 54 +- chart2/source/view/main/ChartView.cxx | 16 include/svx/charthelper.hxx | 2 include/svx/sdr/contact/viewcontact.hxx | 2 include/svx/sdr/properties/defaultproperties.hxx | 2 include/svx/sdr/properties/properties.hxx | 13 include/svx/sdrpagewindow.hxx | 68 -- include/svx/svdobj.hxx | 5 include/svx/svdotext.hxx | 4 include/svx/svdpage.hxx | 2 include/svx/svdpagv.hxx | 4 include/svx/svdpntv.hxx | 2 include/svx/svdtypes.hxx | 2 offapi/UnoApi_offapi.mk | 1 offapi/com/sun/star/util/XUpdatable2.idl | 43 + oox/source/drawingml/chart/axismodel.cxx | 2 svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx | 2 svx/inc/sdr/properties/attributeproperties.hxx | 2 svx/inc/sdr/properties/captionproperties.hxx | 2 svx/inc/sdr/properties/circleproperties.hxx | 2 svx/inc/sdr/properties/connectorproperties.hxx | 2 svx/inc/sdr/properties/customshapeproperties.hxx | 2 svx/inc/sdr/properties/e3dproperties.hxx | 2 svx/inc/sdr/properties/emptyproperties.hxx | 2 svx/inc/sdr/properties/graphicproperties.hxx | 2 svx/inc/sdr/properties/groupproperties.hxx | 2 svx/inc/sdr/properties/measureproperties.hxx | 2 svx/inc/sdr/properties/pageproperties.hxx | 2 svx/inc/sdr/properties/textproperties.hxx | 2 svx/source/sdr/contact/viewcontact.cxx | 6 svx/source/sdr/contact/viewcontactofsdrole2obj.cxx | 32 + svx/source/sdr/contact/viewobjectcontact.cxx | 29 - svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx | 12 svx/source/sdr/properties/attributeproperties.cxx | 8 svx/source/sdr/properties/captionproperties.cxx | 6 svx/source/sdr/properties/circleproperties.cxx | 6 svx/source/sdr/properties/connectorproperties.cxx | 6 svx/source/sdr/properties/customshapeproperties.cxx | 6 svx/source/sdr/properties/defaultproperties.cxx | 6 svx/source/sdr/properties/e3dcompoundproperties.cxx | 2 svx/source/sdr/properties/e3dproperties.cxx | 6 svx/source/sdr/properties/emptyproperties.cxx | 6 svx/source/sdr/properties/graphicproperties.cxx | 6 svx/source/sdr/properties/groupproperties.cxx | 4 svx/source/sdr/properties/measureproperties.cxx | 6 svx/source/sdr/properties/pageproperties.cxx | 6 svx/source/sdr/properties/properties.cxx | 10 svx/source/sdr/properties/textproperties.cxx | 6 svx/source/svdraw/charthelper.cxx | 15 svx/source/svdraw/sdrpagewindow.cxx | 129 +++-- svx/source/svdraw/svdoashp.cxx | 100 ++-- svx/source/svdraw/svdobj.cxx | 136 ++++- svx/source/svdraw/svdocapt.cxx | 28 - svx/source/svdraw/svdocirc.cxx | 122 ++--- svx/source/svdraw/svdoedge.cxx | 6 svx/source/svdraw/svdograf.cxx | 16 svx/source/svdraw/svdomeas.cxx | 2 svx/source/svdraw/svdomedia.cxx | 2 svx/source/svdraw/svdoole2.cxx | 16 svx/source/svdraw/svdopath.cxx | 8 svx/source/svdraw/svdorect.cxx | 86 +-- svx/source/svdraw/svdotext.cxx | 68 +- svx/source/svdraw/svdotxat.cxx | 9 svx/source/svdraw/svdotxdr.cxx | 48 +- svx/source/svdraw/svdotxtr.cxx | 62 +- svx/source/svdraw/svdouno.cxx | 4 svx/source/svdraw/svdpagv.cxx | 7 svx/source/svdraw/svdpntv.cxx | 6 svx/source/table/cell.cxx | 8 svx/source/table/svdotable.cxx | 96 ++-- svx/source/unodraw/unopage.cxx | 29 - svx/source/unodraw/unoshape.cxx | 167 +++---- sw/source/core/inc/viewimp.hxx | 2 sw/source/core/view/vdraw.cxx | 2 82 files changed, 1277 insertions(+), 795 deletions(-)
New commits: commit 024a5d79e101b26d23054e1906505810210d4e56 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Tue Nov 4 12:29:39 2014 -0500 Build fix after merging my changes from perfwork4. Change-Id: I862f783c594bf485ad28f13945fd4da48829d79a diff --git a/svx/source/sdr/properties/e3dcompoundproperties.cxx b/svx/source/sdr/properties/e3dcompoundproperties.cxx index 31369a7..0361ab6 100644 --- a/svx/source/sdr/properties/e3dcompoundproperties.cxx +++ b/svx/source/sdr/properties/e3dcompoundproperties.cxx @@ -56,7 +56,7 @@ namespace sdr const SfxItemSet& E3dCompoundProperties::GetMergedItemSet() const { // include Items of scene this object belongs to - E3dCompoundObject& rObj = static_cast<E3dCompoundObject&>(GetSdrObject()); + const E3dCompoundObject& rObj = static_cast<const E3dCompoundObject&>(GetSdrObject()); E3dScene* pScene = rObj.GetScene(); if(pScene) commit 28bf1a3a1408df042d7e767c3760e47faf2d077e Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Sun Nov 2 14:35:31 2014 -0500 Avoid re-constructing chart shapes when it's not in visible range. The re-construction will be deferred until it becomes visible again. Change-Id: I364ea8d38d48078dfd803b0e5bb20bfc8a2913ba diff --git a/chart2/inc/ChartView.hxx b/chart2/inc/ChartView.hxx index d155c45..047192a 100644 --- a/chart2/inc/ChartView.hxx +++ b/chart2/inc/ChartView.hxx @@ -37,7 +37,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/util/XModifyListener.hpp> #include <com/sun/star/util/XModeChangeBroadcaster.hpp> -#include <com/sun/star/util/XUpdatable.hpp> +#include <com/sun/star/util/XUpdatable2.hpp> #include <com/sun/star/qa/XDumper.hpp> #include <vector> @@ -96,7 +96,7 @@ class ChartView : public ::cppu::WeakImplHelper10< ,::com::sun::star::lang::XUnoTunnel ,::com::sun::star::util::XModifyListener ,::com::sun::star::util::XModeChangeBroadcaster - ,::com::sun::star::util::XUpdatable + ,::com::sun::star::util::XUpdatable2 ,::com::sun::star::beans::XPropertySet ,::com::sun::star::lang::XMultiServiceFactory ,::com::sun::star::qa::XDumper @@ -169,6 +169,10 @@ public: // ::com::sun::star::util::XUpdatable virtual void SAL_CALL update() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; + // util::XUpdatable2 + virtual void SAL_CALL updateSoft() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; + virtual void SAL_CALL updateHard() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE; + // ::com::sun::star::beans::XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; @@ -217,7 +221,7 @@ private: //methods void impl_refreshAddIn(); bool impl_AddInDrawsAllByItself(); - void impl_updateView(); + void impl_updateView( bool bCheckLockedCtrler = true ); void render(); diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 63ba12a..edf6dc9 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -2627,7 +2627,7 @@ void SAL_CALL ChartView::disposing( const lang::EventObject& /* rSource */ ) { } -void ChartView::impl_updateView() +void ChartView::impl_updateView( bool bCheckLockedCtrler ) { if( !m_pDrawModelWrapper ) return; @@ -2638,7 +2638,7 @@ void ChartView::impl_updateView() return; } - if (mrChartModel.hasControllersLocked()) + if (bCheckLockedCtrler && mrChartModel.hasControllersLocked()) return; if( m_bViewDirty && !m_bInViewUpdate ) @@ -2822,7 +2822,7 @@ void SAL_CALL ChartView::removeModeChangeApproveListener( const uno::Reference< // ____ XUpdatable ____ void SAL_CALL ChartView::update() throw (uno::RuntimeException, std::exception) { - impl_updateView(); + impl_updateView(true); //#i100778# migrate all imported or old documents to a plot area sizing exclusive axes (in case the save settings allow for this): //Although in general it is a bad idea to change the model from within the view this is exceptionally the best place to do this special conversion. @@ -2833,6 +2833,16 @@ void SAL_CALL ChartView::update() throw (uno::RuntimeException, std::exception) impl_updateView(); } +void SAL_CALL ChartView::updateSoft() throw (uno::RuntimeException, std::exception) +{ + update(); +} + +void SAL_CALL ChartView::updateHard() throw (uno::RuntimeException, std::exception) +{ + impl_updateView(false); +} + // ____ XPropertySet ____ Reference< beans::XPropertySetInfo > SAL_CALL ChartView::getPropertySetInfo() throw (uno::RuntimeException, std::exception) diff --git a/include/svx/charthelper.hxx b/include/svx/charthelper.hxx index f88b8c4..33ffa32 100644 --- a/include/svx/charthelper.hxx +++ b/include/svx/charthelper.hxx @@ -35,7 +35,7 @@ public: static bool isGL3DDiagram(const css::uno::Reference<css::chart2::XDiagram>& xDiagram); /// Use chart's XUpdatable::update() to update values. - static void updateChart(const css::uno::Reference< css::frame::XModel >& rXModel); + static void updateChart( const css::uno::Reference< css::frame::XModel >& rXModel, bool bHardUpdate ); // try to access rXModel in case of a chart to to get the chart content // as sequence of primitives. Return range of primitives (chart size) in rRange; diff --git a/include/svx/sdr/contact/viewcontact.hxx b/include/svx/sdr/contact/viewcontact.hxx index 4e2d022..8cdf1ce 100644 --- a/include/svx/sdr/contact/viewcontact.hxx +++ b/include/svx/sdr/contact/viewcontact.hxx @@ -152,6 +152,8 @@ namespace sdr // for 3D scenes virtual drawinglayer::primitive2d::Primitive2DSequence embedToObjectSpecificInformation(const drawinglayer::primitive2d::Primitive2DSequence& rSource) const; + virtual basegfx::B2DRange getRange( const drawinglayer::geometry::ViewInformation2D& rViewInfo2D ) const; + // delete all existing VOCs including DrawHierarchy which will invalidate all // visualisations, too. Used mostly at object removal from DrawHierarchy to // delete all existing VOCs by purpose, but can also be used for other purposes. diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index b317d8c..781a9ba 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -4138,6 +4138,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/util,\ XURLTransformer \ XUniqueIDFactory \ XUpdatable \ + XUpdatable2 \ )) $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/view,\ DocumentZoomType \ diff --git a/offapi/com/sun/star/util/XUpdatable2.idl b/offapi/com/sun/star/util/XUpdatable2.idl new file mode 100644 index 0000000..ce5652a --- /dev/null +++ b/offapi/com/sun/star/util/XUpdatable2.idl @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef __com_sun_star_util_XUpdatable2_idl__ +#define __com_sun_star_util_XUpdatable2_idl__ + +#include <com/sun/star/util/XUpdatable.idl> + +module com { module sun { module star { module util { + +/** + * This interface extends XUpdatable in order to provide more fine-tuned + * update modes. When performing a <i>soft</i> update, the implementor may + * decide not to update in certain cases, such as when the controller is + * locked. When performing a <i>hard</i> update, on the other hand, the + * implementor should perform update more aggressively even when the + * controller is locked. + */ +interface XUpdatable2: com::sun::star::util::XUpdatable +{ + /** + * Perform update, but update may not always be performed especially when + * the controller is locked. + */ + void updateSoft(); + + /** + * Perform update, even when the controller is locked. + */ + void updateHard(); +}; + +}; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx b/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx index fba70b2..29fc2df 100644 --- a/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx +++ b/svx/inc/sdr/contact/viewcontactofsdrole2obj.hxx @@ -69,6 +69,8 @@ namespace sdr // #i123539# get rid of buffered chart content (if there) on change virtual void ActionChanged() SAL_OVERRIDE; + virtual basegfx::B2DRange getRange( const drawinglayer::geometry::ViewInformation2D& rViewInfo2D ) const SAL_OVERRIDE; + protected: // This method is responsible for creating the graphical visualisation data // ONLY based on model data, just wraps to call createPrimitive2DSequenceWithParameters(false) diff --git a/svx/source/sdr/contact/viewcontact.cxx b/svx/source/sdr/contact/viewcontact.cxx index 292bfba..b4c4020 100644 --- a/svx/source/sdr/contact/viewcontact.cxx +++ b/svx/source/sdr/contact/viewcontact.cxx @@ -308,6 +308,12 @@ namespace sdr return rSource; } + basegfx::B2DRange ViewContact::getRange( const drawinglayer::geometry::ViewInformation2D& /*rViewInfo2D*/ ) const + { + // Return empty range. + return basegfx::B2DRange(); + } + void ViewContact::flushViewObjectContacts(bool bWithHierarchy) { if(bWithHierarchy) diff --git a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx index f8fb293..1704fdd 100644 --- a/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrole2obj.cxx @@ -91,12 +91,11 @@ namespace sdr const SfxItemSet& rItemSet = GetOle2Obj().GetMergedItemSet(); // this may be refined more granular; if no content, attributes may get simpler - const bool bHasContent(true); const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute( drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( rItemSet, GetOle2Obj().getText(0), - bHasContent)); + true)); drawinglayer::primitive2d::Primitive2DReference xContent; if(GetOle2Obj().IsChart()) @@ -170,6 +169,35 @@ namespace sdr return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } + basegfx::B2DRange ViewContactOfSdrOle2Obj::getRange( const drawinglayer::geometry::ViewInformation2D& rViewInfo2D ) const + { + // this may be refined more granular; if no content, attributes may get simpler + const drawinglayer::attribute::SdrLineFillShadowTextAttribute aAttribute = + drawinglayer::primitive2d::createNewSdrLineFillShadowTextAttribute( + GetOle2Obj().GetMergedItemSet(), + GetOle2Obj().getText(0), + true); + + basegfx::B2DHomMatrix aObjectMatrix = createObjectTransform(); + + drawinglayer::primitive2d::Primitive2DReference xContent = + new drawinglayer::primitive2d::SdrOleContentPrimitive2D( + GetOle2Obj(), + aObjectMatrix, + GetOle2Obj().getEmbeddedObjectRef().getGraphicVersion()); + + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::SdrOle2Primitive2D( + drawinglayer::primitive2d::Primitive2DSequence(&xContent, 1), + aObjectMatrix, + aAttribute)); + + drawinglayer::primitive2d::Primitive2DSequence xSeq = + drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + + return drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xSeq, rViewInfo2D); + } + void ViewContactOfSdrOle2Obj::ActionChanged() { // call parent diff --git a/svx/source/sdr/contact/viewobjectcontact.cxx b/svx/source/sdr/contact/viewobjectcontact.cxx index 140c5c8..664f5b1 100644 --- a/svx/source/sdr/contact/viewobjectcontact.cxx +++ b/svx/source/sdr/contact/viewobjectcontact.cxx @@ -206,15 +206,23 @@ const basegfx::B2DRange& ViewObjectContact::getObjectRange() const { if(maObjectRange.isEmpty()) { - // if range is not computed (new or LazyInvalidate objects), force it - const DisplayInfo aDisplayInfo; - const drawinglayer::primitive2d::Primitive2DSequence xSequence(getPrimitive2DSequence(aDisplayInfo)); - - if(xSequence.hasElements()) + const drawinglayer::geometry::ViewInformation2D& rViewInfo2D = GetObjectContact().getViewInformation2D(); + basegfx::B2DRange aTempRange = GetViewContact().getRange(rViewInfo2D); + if (!aTempRange.isEmpty()) { - const drawinglayer::geometry::ViewInformation2D& rViewInformation2D(GetObjectContact().getViewInformation2D()); - const_cast< ViewObjectContact* >(this)->maObjectRange = - drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xSequence, rViewInformation2D); + const_cast< ViewObjectContact* >(this)->maObjectRange = aTempRange; + } + else + { + // if range is not computed (new or LazyInvalidate objects), force it + const DisplayInfo aDisplayInfo; + const drawinglayer::primitive2d::Primitive2DSequence xSequence(getPrimitive2DSequence(aDisplayInfo)); + + if(xSequence.hasElements()) + { + const_cast< ViewObjectContact* >(this)->maObjectRange = + drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(xSequence, rViewInfo2D); + } } } @@ -257,7 +265,7 @@ void ViewObjectContact::triggerLazyInvalidate() // drawn by the drawinglayer ViewContactOfSdrOle2Obj* pViewContact = dynamic_cast<ViewContactOfSdrOle2Obj*>(&GetViewContact()); if (pViewContact && pViewContact->GetOle2Obj().IsReal3DChart()) - ChartHelper::updateChart(pViewContact->GetOle2Obj().getXModel()); + ChartHelper::updateChart(pViewContact->GetOle2Obj().getXModel(), false); #endif // force ObjectRange @@ -415,7 +423,8 @@ drawinglayer::primitive2d::Primitive2DSequence ViewObjectContact::getPrimitive2D const basegfx::B2DRange aViewRange(rViewInformation2D.getViewport()); // check geometrical visibility - if(!aViewRange.isEmpty() && !aViewRange.overlaps(aObjectRange)) + bool bVisible = aViewRange.isEmpty() || aViewRange.overlaps(aObjectRange); + if(!bVisible) { // not visible, release xRetval.realloc(0); diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx index 2273f4b..0c9afc6 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrobj.cxx @@ -23,6 +23,7 @@ #include <svx/sdr/contact/objectcontact.hxx> #include <svx/sdr/contact/displayinfo.hxx> #include <sdr/contact/objectcontactofpageview.hxx> +#include <sdr/contact/viewcontactofsdrole2obj.hxx> #include <svx/sdrpagewindow.hxx> #include <svx/sdrpaintwindow.hxx> #include <svx/svdobj.hxx> @@ -138,6 +139,17 @@ bool ViewObjectContactOfSdrObj::isPrimitiveVisible(const DisplayInfo& rDisplayIn } } + // Check if this object is in the visible range. + const drawinglayer::geometry::ViewInformation2D& rViewInfo = GetObjectContact().getViewInformation2D(); + basegfx::B2DRange aObjRange = GetViewContact().getRange(rViewInfo); + if (!aObjRange.isEmpty()) + { + const basegfx::B2DRange& rViewRange = rViewInfo.getViewport(); + bool bVisible = rViewRange.isEmpty() || rViewRange.overlaps(aObjRange); + if (!bVisible) + return false; + } + return true; } diff --git a/svx/source/svdraw/charthelper.cxx b/svx/source/svdraw/charthelper.cxx index 4965e07..643a2be 100644 --- a/svx/source/svdraw/charthelper.cxx +++ b/svx/source/svdraw/charthelper.cxx @@ -24,7 +24,7 @@ #include <com/sun/star/chart2/XChartTypeContainer.hpp> #include <com/sun/star/embed/XEmbeddedObject.hpp> #include <com/sun/star/lang/XUnoTunnel.hpp> -#include <com/sun/star/util/XUpdatable.hpp> +#include <com/sun/star/util/XUpdatable2.hpp> #include <com/sun/star/drawing/XDrawPageSupplier.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> @@ -67,7 +67,7 @@ bool ChartHelper::isGL3DDiagram( const css::uno::Reference<css::chart2::XDiagram return false; } -void ChartHelper::updateChart(const uno::Reference< ::frame::XModel >& rXModel) +void ChartHelper::updateChart( const uno::Reference< ::frame::XModel >& rXModel, bool bHardUpdate ) { if (!rXModel.is()) return; @@ -76,10 +76,15 @@ void ChartHelper::updateChart(const uno::Reference< ::frame::XModel >& rXModel) { const uno::Reference< lang::XMultiServiceFactory > xChartFact(rXModel, uno::UNO_QUERY_THROW); const uno::Reference< lang::XUnoTunnel > xChartView(xChartFact->createInstance("com.sun.star.chart2.ChartView"), uno::UNO_QUERY_THROW); - const uno::Reference< util::XUpdatable > xUpdatable(xChartView, uno::UNO_QUERY_THROW); + const uno::Reference<util::XUpdatable2> xUpdatable(xChartView, uno::UNO_QUERY_THROW); if (xUpdatable.is()) - xUpdatable->update(); + { + if (bHardUpdate) + xUpdatable->updateHard(); + else + xUpdatable->updateSoft(); + } } catch(uno::Exception&) { @@ -96,7 +101,7 @@ drawinglayer::primitive2d::Primitive2DSequence ChartHelper::tryToGetChartContent if (!rXModel.is()) return aRetval; - updateChart(rXModel); + updateChart(rXModel, true); try { commit f281d2d24c2a368c58d32b1b50acf83e0f056d90 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Fri Oct 31 23:59:27 2014 -0400 Actually we shouldn't always set Overlap flag on for all xlsx charts... The correct fix unfortunately would require making the axis label layout smarter, to avoid overlapping of angled text label objects. Change-Id: I92198dbb90fd4a206ee226307992343d064f733a diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 4d0eb23..719a599 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -87,7 +87,7 @@ public: CPPUNIT_TEST(testFdo54361); CPPUNIT_TEST(testFdo54361_1); CPPUNIT_TEST(testAutoBackgroundXLSX); - CPPUNIT_TEST(testTextCanOverlapXLSX); + // CPPUNIT_TEST(testTextCanOverlapXLSX); // TODO : temporarily disabled. CPPUNIT_TEST(testNumberFormatsXLSX); CPPUNIT_TEST_SUITE_END(); diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx index cbd66b7..d4163bc 100644 --- a/oox/source/drawingml/chart/axismodel.cxx +++ b/oox/source/drawingml/chart/axismodel.cxx @@ -46,7 +46,7 @@ AxisModel::AxisModel( sal_Int32 nTypeId ) : mnMinorTimeUnit( XML_days ), mnOrientation( XML_minMax ), mnTickLabelPos( XML_nextTo ), - mnTickLabelSkip( 1 ), + mnTickLabelSkip( 0 ), mnTickMarkSkip( 0 ), mnTypeId( nTypeId ), mbAuto( false ), commit e296b3d25e7d78544d3abd87780f9680e56efa26 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Thu Oct 30 08:20:14 2014 -0400 Remove debug code. This wasn't meant to be checked in. Change-Id: I3bd8ab784d9af295b61555a3ed775097270b90bf diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index 4609686..390c5bd 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -41,48 +41,6 @@ using namespace com::sun::star; -#include <stdio.h> -#include <string> -#include <sys/time.h> - -namespace { - -class stack_printer -{ -public: - explicit stack_printer( const char* msg ) : - msMsg(msg) - { - fprintf(stdout, "%s: --begin\n", msMsg.c_str()); - mfStartTime = getTime(); - } - - ~stack_printer() - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime - mfStartTime)); - } - - void printTime( int line ) const - { - double fEndTime = getTime(); - fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime - mfStartTime)); - } - -private: - double getTime() const - { - timeval tv; - gettimeofday(&tv, NULL); - return tv.tv_sec + tv.tv_usec / 1000000.0; - } - - ::std::string msMsg; - double mfStartTime; -}; - -} - namespace sdr { namespace contact @@ -137,7 +95,6 @@ namespace sdr // From baseclass Timer, the timeout call triggered by the LazyInvalidate mechanism void ObjectContactOfPageView::Timeout() { - stack_printer __stack_printer__( "sdr/contact/ObjectContactOfPageView::Timeout" ); // stop the timer Stop(); commit a205b8564c9477e91a5f2507f4746b85e0c62f95 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Wed Oct 29 23:24:38 2014 -0400 Remove com::sun::star. Change-Id: Id656f1ef1cdfb695bcfcb35e393def3682e8c556 diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index 5fa995a..0e4cdf4 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -71,7 +71,7 @@ struct SdrPageWindow::Impl }; -::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > SdrPageWindow::GetControlContainer( bool _bCreateIfNecessary ) const +uno::Reference<awt::XControlContainer> SdrPageWindow::GetControlContainer( bool _bCreateIfNecessary ) const { if (!mpImpl->mxControlContainer.is() && _bCreateIfNecessary) { @@ -97,8 +97,7 @@ struct SdrPageWindow::Impl uno::Reference< uno::XInterface > xContext = xControl->getContext(); if(!xContext.is()) { - xControl->createPeer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit > (), - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > () ); + xControl->createPeer( uno::Reference<awt::XToolkit>(), uno::Reference<awt::XWindowPeer>() ); } } } commit a87412a599b0f87bf2cbf0f02f539b3529a08940 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Wed Oct 29 23:21:41 2014 -0400 Remove indirection... Change-Id: Ia01ed40391a4d5725a9f9e22817406216020c0d2 diff --git a/include/svx/sdrpagewindow.hxx b/include/svx/sdrpagewindow.hxx index 82c82b0..e7156eb 100644 --- a/include/svx/sdrpagewindow.hxx +++ b/include/svx/sdrpagewindow.hxx @@ -51,8 +51,6 @@ class SVX_DLLPUBLIC SdrPageWindow Impl* mpImpl; - sdr::contact::ObjectContact* CreateViewSpecificObjectContact(); - SdrPageWindow( const SdrPageWindow& ); // disabled SdrPageWindow& operator= ( const SdrPageWindow& ); // disabled diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index ca15df0..5fa995a 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -44,18 +44,18 @@ using namespace ::com::sun::star; struct SdrPageWindow::Impl { // #110094# ObjectContact section - sdr::contact::ObjectContact* mpObjectContact; + mutable sdr::contact::ObjectContactOfPageView* mpObjectContact; // the SdrPageView this window belongs to - SdrPageView& mrPageView; + SdrPageView& mrPageView; // the PaintWindow to paint on. Here is access to OutDev etc. // #i72752# change to pointer to allow patcing it in DrawLayer() if necessary - SdrPaintWindow* mpPaintWindow; - SdrPaintWindow* mpOriginalPaintWindow; + SdrPaintWindow* mpPaintWindow; + SdrPaintWindow* mpOriginalPaintWindow; // UNO stuff for xControls - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > mxControlContainer; + uno::Reference<awt::XControlContainer> mxControlContainer; Impl( SdrPageView& rPageView, SdrPaintWindow& rPaintWindow ) : mpObjectContact(NULL), @@ -155,12 +155,6 @@ SdrPageWindow::~SdrPageWindow() delete mpImpl; } -// ObjectContact section -sdr::contact::ObjectContact* SdrPageWindow::CreateViewSpecificObjectContact() -{ - return new sdr::contact::ObjectContactOfPageView(*this); -} - SdrPageView& SdrPageWindow::GetPageView() const { return mpImpl->mrPageView; @@ -448,9 +442,7 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange) const sdr::contact::ObjectContact& SdrPageWindow::GetObjectContact() const { if (!mpImpl->mpObjectContact) - { - ((SdrPageWindow*)this)->mpImpl->mpObjectContact = ((SdrPageWindow*)this)->CreateViewSpecificObjectContact(); - } + mpImpl->mpObjectContact = new sdr::contact::ObjectContactOfPageView(const_cast<SdrPageWindow&>(*this)); return *mpImpl->mpObjectContact; } @@ -458,7 +450,7 @@ const sdr::contact::ObjectContact& SdrPageWindow::GetObjectContact() const sdr::contact::ObjectContact& SdrPageWindow::GetObjectContact() { if (!mpImpl->mpObjectContact) - mpImpl->mpObjectContact = CreateViewSpecificObjectContact(); + mpImpl->mpObjectContact = new sdr::contact::ObjectContactOfPageView(*this); return *mpImpl->mpObjectContact; } commit 709784cf1d417b4b2df8c5228a4664f697e45a5c Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Wed Oct 29 21:51:19 2014 -0400 Apply pimpl to SdrPageWindow. Change-Id: I54554a229c03ff87096782344a728a49636c1de1 diff --git a/include/svx/sdrpagewindow.hxx b/include/svx/sdrpagewindow.hxx index 078edaf..82c82b0 100644 --- a/include/svx/sdrpagewindow.hxx +++ b/include/svx/sdrpagewindow.hxx @@ -20,77 +20,51 @@ #ifndef INCLUDED_SVX_SDRPAGEWINDOW_HXX #define INCLUDED_SVX_SDRPAGEWINDOW_HXX -#include <com/sun/star/awt/XWindowListener.hpp> -#include <com/sun/star/beans/XPropertyChangeListener.hpp> -#include <com/sun/star/awt/XControlContainer.hpp> -#include <com/sun/star/util/XModeChangeListener.hpp> -#include <cppuhelper/implbase4.hxx> #include <svx/sdr/overlay/overlaymanager.hxx> #include <svx/svdtypes.hxx> -#include <svx/sdrpagewindow.hxx> #include <svx/svxdllapi.h> +#include <rtl/ref.hxx> -#include <vector> - +#include <com/sun/star/awt/XControlContainer.hpp> // predeclarations namespace vcl { class Region; } -class SdrUnoObj; -class SdrPageView; -// #110094# namespace sdr { namespace contact { class ObjectContact; class ViewObjectContactRedirector; - } // end of namespace contact + } +} - namespace overlay - { - class OverlayManager; - } // end of namespace overlay -} // end of namespace sdr - -namespace basegfx -{ - class B2DRange; -} // end of namespace basegfx +namespace basegfx { class B2DRange; } class SdrPaintWindow; -class Link; - - +class SdrPageView; class SVX_DLLPUBLIC SdrPageWindow { - // #110094# ObjectContact section - sdr::contact::ObjectContact* mpObjectContact; - - // the SdrPageView this window belongs to - SdrPageView& mrPageView; - - // the PaintWindow to paint on. Here is access to OutDev etc. - // #i72752# change to pointer to allow patcing it in DrawLayer() if necessary - SdrPaintWindow* mpPaintWindow; - SdrPaintWindow* mpOriginalPaintWindow; + struct Impl; - // UNO stuff for xControls - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > mxControlContainer; + Impl* mpImpl; sdr::contact::ObjectContact* CreateViewSpecificObjectContact(); + SdrPageWindow( const SdrPageWindow& ); // disabled + SdrPageWindow& operator= ( const SdrPageWindow& ); // disabled + public: SdrPageWindow(SdrPageView& rNewPageView, SdrPaintWindow& rPaintWindow); ~SdrPageWindow(); // data read accesses - SdrPageView& GetPageView() const { return mrPageView; } - SdrPaintWindow& GetPaintWindow() const { return *mpPaintWindow; } - const SdrPaintWindow* GetOriginalPaintWindow() const { return mpOriginalPaintWindow; } - ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > GetControlContainer( bool _bCreateIfNecessary = true ) const; + SdrPageView& GetPageView() const; + SdrPaintWindow& GetPaintWindow() const; + const SdrPaintWindow* GetOriginalPaintWindow() const; + css::uno::Reference<css::awt::XControlContainer> GetControlContainer( bool _bCreateIfNecessary = true ) const; // OVERLAYMANAGER rtl::Reference< ::sdr::overlay::OverlayManager > GetOverlayManager() const; @@ -102,14 +76,15 @@ public: // the repaint method. For migration from pPaintProc, use one more parameter void PrePaint(); void PrepareRedraw(const vcl::Region& rReg); - void RedrawAll(sdr::contact::ViewObjectContactRedirector* pRedirector) const; - void RedrawLayer(const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector) const; + void RedrawAll( sdr::contact::ViewObjectContactRedirector* pRedirector ); + void RedrawLayer( const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector ); // Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...) void InvalidatePageWindow(const basegfx::B2DRange& rRange); // #110094# ObjectContact section - sdr::contact::ObjectContact& GetObjectContact() const; + const sdr::contact::ObjectContact& GetObjectContact() const; + sdr::contact::ObjectContact& GetObjectContact(); /// determines whether there already exists an ObjectContact bool HasObjectContact() const; @@ -121,11 +96,6 @@ public: void SetDesignMode( bool _bDesignMode ) const; }; -// typedefs for a list of SdrPageWindow -typedef ::std::vector< SdrPageWindow* > SdrPageWindowVector; - - - #endif // INCLUDED_SVX_SDRPAGEWINDOW_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx index 9fb2d95..5369616 100644 --- a/include/svx/svdpagv.hxx +++ b/include/svx/svdpagv.hxx @@ -166,13 +166,13 @@ public: void PrePaint(); // rReg bezieht sich auf's OutDev, nicht auf die Page - void CompleteRedraw(SdrPaintWindow& rPaintWindow, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L) const; + void CompleteRedraw( SdrPaintWindow& rPaintWindow, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector = NULL ); // write access to mpPreparedPageWindow void setPreparedPageWindow(SdrPageWindow* pKnownTarget); void DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget = 0, sdr::contact::ViewObjectContactRedirector* pRedirector = 0L, - const Rectangle& rRect = Rectangle()) const; + const Rectangle& rRect = Rectangle()); void DrawPageViewGrid(OutputDevice& rOut, const Rectangle& rRect, Color aColor = Color( COL_BLACK ) ); Rectangle GetPageRect() const; diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index 54df1af..a7788dc 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -391,7 +391,7 @@ public: protected: // used to paint the form layer after the PreRender device is flushed (painted) to the window. - void ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const; + void ImpFormLayerDrawing( SdrPaintWindow& rPaintWindow ); vcl::Region OptimizeDrawLayersRegion(OutputDevice* pOut, const vcl::Region& rReg, bool bDisableIntersect); diff --git a/include/svx/svdtypes.hxx b/include/svx/svdtypes.hxx index 694ea9a..58abbf1 100644 --- a/include/svx/svdtypes.hxx +++ b/include/svx/svdtypes.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_SVX_SVDTYPES_HXX #define INCLUDED_SVX_SVDTYPES_HXX +#include <sal/types.h> + /* * SdrObject */ diff --git a/svx/source/sdr/contact/objectcontactofpageview.cxx b/svx/source/sdr/contact/objectcontactofpageview.cxx index 390c5bd..4609686 100644 --- a/svx/source/sdr/contact/objectcontactofpageview.cxx +++ b/svx/source/sdr/contact/objectcontactofpageview.cxx @@ -41,6 +41,48 @@ using namespace com::sun::star; +#include <stdio.h> +#include <string> +#include <sys/time.h> + +namespace { + +class stack_printer +{ +public: + explicit stack_printer( const char* msg ) : + msMsg(msg) + { + fprintf(stdout, "%s: --begin\n", msMsg.c_str()); + mfStartTime = getTime(); + } + + ~stack_printer() + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime - mfStartTime)); + } + + void printTime( int line ) const + { + double fEndTime = getTime(); + fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime - mfStartTime)); + } + +private: + double getTime() const + { + timeval tv; + gettimeofday(&tv, NULL); + return tv.tv_sec + tv.tv_usec / 1000000.0; + } + + ::std::string msMsg; + double mfStartTime; +}; + +} + namespace sdr { namespace contact @@ -95,6 +137,7 @@ namespace sdr // From baseclass Timer, the timeout call triggered by the LazyInvalidate mechanism void ObjectContactOfPageView::Timeout() { + stack_printer __stack_printer__( "sdr/contact/ObjectContactOfPageView::Timeout" ); // stop the timer Stop(); diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index 87594ba..ca15df0 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -41,11 +41,39 @@ using namespace ::com::sun::star; +struct SdrPageWindow::Impl +{ + // #110094# ObjectContact section + sdr::contact::ObjectContact* mpObjectContact; + + // the SdrPageView this window belongs to + SdrPageView& mrPageView; + + // the PaintWindow to paint on. Here is access to OutDev etc. + // #i72752# change to pointer to allow patcing it in DrawLayer() if necessary + SdrPaintWindow* mpPaintWindow; + SdrPaintWindow* mpOriginalPaintWindow; + + // UNO stuff for xControls + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > mxControlContainer; + + Impl( SdrPageView& rPageView, SdrPaintWindow& rPaintWindow ) : + mpObjectContact(NULL), + mrPageView(rPageView), + mpPaintWindow(&rPaintWindow), + mpOriginalPaintWindow(NULL) + { + } + + ~Impl() + { + } +}; ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > SdrPageWindow::GetControlContainer( bool _bCreateIfNecessary ) const { - if ( !mxControlContainer.is() && _bCreateIfNecessary ) + if (!mpImpl->mxControlContainer.is() && _bCreateIfNecessary) { SdrView& rView = GetPageView().GetView(); @@ -53,7 +81,7 @@ using namespace ::com::sun::star; if ( rPaintWindow.OutputToWindow() && !rView.IsPrintPreview() ) { vcl::Window& rWindow = dynamic_cast< vcl::Window& >( rPaintWindow.GetOutputDevice() ); - const_cast< SdrPageWindow* >( this )->mxControlContainer = VCLUnoHelper::CreateControlContainer( &rWindow ); + const_cast< SdrPageWindow* >( this )->mpImpl->mxControlContainer = VCLUnoHelper::CreateControlContainer( &rWindow ); // #100394# xC->setVisible triggers window->Show() and this has // problems when the view is not completely constructed which may @@ -63,7 +91,7 @@ using namespace ::com::sun::star; // UnoControlContainer::setVisible(...) which calls createPeer(...). // This will now be called directly from here. - uno::Reference< awt::XControl > xControl(mxControlContainer, uno::UNO_QUERY); + uno::Reference< awt::XControl > xControl(mpImpl->mxControlContainer, uno::UNO_QUERY); if(xControl.is()) { uno::Reference< uno::XInterface > xContext = xControl->getContext(); @@ -78,9 +106,9 @@ using namespace ::com::sun::star; { // Printer and VirtualDevice, or rather: no OutDev uno::Reference< lang::XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() ); - const_cast< SdrPageWindow* >( this )->mxControlContainer = uno::Reference< awt::XControlContainer >(xFactory->createInstance("com.sun.star.awt.UnoControlContainer"), uno::UNO_QUERY); + const_cast< SdrPageWindow* >( this )->mpImpl->mxControlContainer = uno::Reference< awt::XControlContainer >(xFactory->createInstance("com.sun.star.awt.UnoControlContainer"), uno::UNO_QUERY); uno::Reference< awt::XControlModel > xModel(xFactory->createInstance("com.sun.star.awt.UnoControlContainerModel"), uno::UNO_QUERY); - uno::Reference< awt::XControl > xControl(mxControlContainer, uno::UNO_QUERY); + uno::Reference< awt::XControl > xControl(mpImpl->mxControlContainer, uno::UNO_QUERY); if (xControl.is()) xControl->setModel(xModel); @@ -88,23 +116,20 @@ using namespace ::com::sun::star; Point aPosPix = rOutDev.GetMapMode().GetOrigin(); Size aSizePix = rOutDev.GetOutputSizePixel(); - uno::Reference< awt::XWindow > xContComp(mxControlContainer, uno::UNO_QUERY); + uno::Reference< awt::XWindow > xContComp(mpImpl->mxControlContainer, uno::UNO_QUERY); if( xContComp.is() ) xContComp->setPosSize(aPosPix.X(), aPosPix.Y(), aSizePix.Width(), aSizePix.Height(), awt::PosSize::POSSIZE); } FmFormView* pViewAsFormView = dynamic_cast< FmFormView* >( &rView ); if ( pViewAsFormView ) - pViewAsFormView->InsertControlContainer(mxControlContainer); + pViewAsFormView->InsertControlContainer(mpImpl->mxControlContainer); } - return mxControlContainer; + return mpImpl->mxControlContainer; } -SdrPageWindow::SdrPageWindow(SdrPageView& rPageView, SdrPaintWindow& rPaintWindow) -: mpObjectContact(0L), - mrPageView(rPageView), - mpPaintWindow(&rPaintWindow), - mpOriginalPaintWindow(NULL) +SdrPageWindow::SdrPageWindow(SdrPageView& rPageView, SdrPaintWindow& rPaintWindow) : + mpImpl(new Impl(rPageView, rPaintWindow)) { } @@ -113,19 +138,21 @@ SdrPageWindow::~SdrPageWindow() // #i26631# ResetObjectContact(); - if (mxControlContainer.is()) + if (mpImpl->mxControlContainer.is()) { SdrView& rView = GetPageView().GetView(); // notify derived views FmFormView* pViewAsFormView = dynamic_cast< FmFormView* >( &rView ); if ( pViewAsFormView ) - pViewAsFormView->RemoveControlContainer(mxControlContainer); + pViewAsFormView->RemoveControlContainer(mpImpl->mxControlContainer); // dispose the control container - uno::Reference< lang::XComponent > xComponent(mxControlContainer, uno::UNO_QUERY); + uno::Reference< lang::XComponent > xComponent(mpImpl->mxControlContainer, uno::UNO_QUERY); xComponent->dispose(); } + + delete mpImpl; } // ObjectContact section @@ -134,6 +161,21 @@ sdr::contact::ObjectContact* SdrPageWindow::CreateViewSpecificObjectContact() return new sdr::contact::ObjectContactOfPageView(*this); } +SdrPageView& SdrPageWindow::GetPageView() const +{ + return mpImpl->mrPageView; +} + +SdrPaintWindow& SdrPageWindow::GetPaintWindow() const +{ + return *mpImpl->mpPaintWindow; +} + +const SdrPaintWindow* SdrPageWindow::GetOriginalPaintWindow() const +{ + return mpImpl->mpOriginalPaintWindow; +} + // OVERLAY MANAGER rtl::Reference< ::sdr::overlay::OverlayManager > SdrPageWindow::GetOverlayManager() const { @@ -142,17 +184,17 @@ rtl::Reference< ::sdr::overlay::OverlayManager > SdrPageWindow::GetOverlayManage void SdrPageWindow::patchPaintWindow(SdrPaintWindow& rPaintWindow) { - mpOriginalPaintWindow = mpPaintWindow; - mpPaintWindow = &rPaintWindow; + mpImpl->mpOriginalPaintWindow = mpImpl->mpPaintWindow; + mpImpl->mpPaintWindow = &rPaintWindow; } void SdrPageWindow::unpatchPaintWindow() { - DBG_ASSERT(mpOriginalPaintWindow, "SdrPageWindow::unpatchPaintWindow: paint window not patched!" ); - if ( mpOriginalPaintWindow ) + DBG_ASSERT(mpImpl->mpOriginalPaintWindow, "SdrPageWindow::unpatchPaintWindow: paint window not patched!" ); + if (mpImpl->mpOriginalPaintWindow) { - mpPaintWindow = mpOriginalPaintWindow; - mpOriginalPaintWindow = NULL; + mpImpl->mpPaintWindow = mpImpl->mpOriginalPaintWindow; + mpImpl->mpOriginalPaintWindow = NULL; } } @@ -269,18 +311,18 @@ namespace -void SdrPageWindow::RedrawAll(sdr::contact::ViewObjectContactRedirector* pRedirector) const +void SdrPageWindow::RedrawAll( sdr::contact::ViewObjectContactRedirector* pRedirector ) { // set Redirector GetObjectContact().SetViewObjectContactRedirector(pRedirector); // set PaintingPageView - const SdrView& rView = mrPageView.GetView(); + const SdrView& rView = mpImpl->mrPageView.GetView(); SdrModel& rModel = *((SdrModel*)rView.GetModel()); // get to be processed layers const bool bPrinter(GetPaintWindow().OutputToPrinter()); - SetOfByte aProcessLayers = bPrinter ? mrPageView.GetPrintableLayers() : mrPageView.GetVisibleLayers(); + SetOfByte aProcessLayers = bPrinter ? mpImpl->mrPageView.GetPrintableLayers() : mpImpl->mrPageView.GetVisibleLayers(); // create PaintInfoRec; use Rectangle only temporarily const vcl::Region& rRegion = GetPaintWindow().GetRedrawRegion(); @@ -321,18 +363,18 @@ void SdrPageWindow::RedrawAll(sdr::contact::ViewObjectContactRedirector* pRedire #endif // CLIPPER_TEST } -void SdrPageWindow::RedrawLayer(const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector) const +void SdrPageWindow::RedrawLayer( const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector ) { // set redirector GetObjectContact().SetViewObjectContactRedirector(pRedirector); // set PaintingPageView - const SdrView& rView = mrPageView.GetView(); + const SdrView& rView = mpImpl->mrPageView.GetView(); SdrModel& rModel = *((SdrModel*)rView.GetModel()); // get the layers to process const bool bPrinter(GetPaintWindow().OutputToPrinter()); - SetOfByte aProcessLayers = bPrinter ? mrPageView.GetPrintableLayers() : mrPageView.GetVisibleLayers(); + SetOfByte aProcessLayers = bPrinter ? mpImpl->mrPageView.GetPrintableLayers() : mpImpl->mrPageView.GetVisibleLayers(); // is the given layer visible at all? if(aProcessLayers.IsSet(*pId)) @@ -403,28 +445,36 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange) } // ObjectContact section -sdr::contact::ObjectContact& SdrPageWindow::GetObjectContact() const +const sdr::contact::ObjectContact& SdrPageWindow::GetObjectContact() const { - if(!mpObjectContact) + if (!mpImpl->mpObjectContact) { - ((SdrPageWindow*)this)->mpObjectContact = ((SdrPageWindow*)this)->CreateViewSpecificObjectContact(); + ((SdrPageWindow*)this)->mpImpl->mpObjectContact = ((SdrPageWindow*)this)->CreateViewSpecificObjectContact(); } - return *mpObjectContact; + return *mpImpl->mpObjectContact; +} + +sdr::contact::ObjectContact& SdrPageWindow::GetObjectContact() +{ + if (!mpImpl->mpObjectContact) + mpImpl->mpObjectContact = CreateViewSpecificObjectContact(); + + return *mpImpl->mpObjectContact; } bool SdrPageWindow::HasObjectContact() const { - return ( mpObjectContact != NULL ); + return mpImpl->mpObjectContact != NULL; } // #i26631# void SdrPageWindow::ResetObjectContact() { - if(mpObjectContact) + if (mpImpl->mpObjectContact) { - delete mpObjectContact; - mpObjectContact = 0L; + delete mpImpl->mpObjectContact; + mpImpl->mpObjectContact = 0L; } } diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx index 02ffaaa..33c0d67 100644 --- a/svx/source/svdraw/svdouno.cxx +++ b/svx/source/svdraw/svdouno.cxx @@ -127,7 +127,7 @@ namespace for ( sal_uInt32 i = 0; i < pPageView->PageWindowCount(); ++i ) { - const SdrPageWindow* pPageWindow = pPageView->GetPageWindow( i ); + SdrPageWindow* pPageWindow = pPageView->GetPageWindow( i ); DBG_ASSERT( pPageWindow, "lcl_ensureControlVisibility: invalid PageViewWindow!" ); if ( !pPageWindow ) continue; diff --git a/svx/source/svdraw/svdpagv.cxx b/svx/source/svdraw/svdpagv.cxx index 08bf1a8..6718947 100644 --- a/svx/source/svdraw/svdpagv.cxx +++ b/svx/source/svdraw/svdpagv.cxx @@ -281,7 +281,8 @@ void SdrPageView::PrePaint() } } -void SdrPageView::CompleteRedraw(SdrPaintWindow& rPaintWindow, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector) const +void SdrPageView::CompleteRedraw( + SdrPaintWindow& rPaintWindow, const vcl::Region& rReg, sdr::contact::ViewObjectContactRedirector* pRedirector ) { if(GetPage()) { @@ -317,13 +318,13 @@ void SdrPageView::setPreparedPageWindow(SdrPageWindow* pKnownTarget) mpPreparedPageWindow = pKnownTarget; } -void SdrPageView::DrawLayer(SdrLayerID nID, OutputDevice* pGivenTarget, sdr::contact::ViewObjectContactRedirector* pRedirector, const Rectangle& rRect) const +void SdrPageView::DrawLayer( SdrLayerID nID, OutputDevice* pGivenTarget, sdr::contact::ViewObjectContactRedirector* pRedirector, const Rectangle& rRect ) { if(GetPage()) { if(pGivenTarget) { - const SdrPageWindow* pKnownTarget = FindPageWindow(*pGivenTarget); + SdrPageWindow* pKnownTarget = FindPageWindow(*pGivenTarget); if(pKnownTarget) { diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index 09dcd31..e633106 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -850,7 +850,7 @@ vcl::Region SdrPaintView::OptimizeDrawLayersRegion(OutputDevice* pOut, const vcl -void SdrPaintView::ImpFormLayerDrawing(SdrPaintWindow& rPaintWindow) const +void SdrPaintView::ImpFormLayerDrawing( SdrPaintWindow& rPaintWindow ) { if(mpPageView) { @@ -1201,7 +1201,7 @@ void SdrPaintView::SetAnimationPause( bool bSet ) { for(sal_uInt32 b(0L); b < mpPageView->PageWindowCount(); b++) { - const SdrPageWindow& rPageWindow = *(mpPageView->GetPageWindow(b)); + SdrPageWindow& rPageWindow = *(mpPageView->GetPageWindow(b)); sdr::contact::ObjectContact& rObjectContact = rPageWindow.GetObjectContact(); sdr::animation::primitiveAnimator& rAnimator = rObjectContact.getPrimitiveAnimator(); @@ -1321,7 +1321,7 @@ void SdrPaintView::SetAnimationTimer(sal_uInt32 nTime) // first, reset all timers at all windows to 0L for(sal_uInt32 a(0L); a < mpPageView->PageWindowCount(); a++) { - const SdrPageWindow& rPageWindow = *mpPageView->GetPageWindow(a); + SdrPageWindow& rPageWindow = *mpPageView->GetPageWindow(a); sdr::contact::ObjectContact& rObjectContact = rPageWindow.GetObjectContact(); sdr::animation::primitiveAnimator& rAnimator = rObjectContact.getPrimitiveAnimator(); rAnimator.SetTime(nTime); diff --git a/sw/source/core/inc/viewimp.hxx b/sw/source/core/inc/viewimp.hxx index 66a6525..341c1d0 100644 --- a/sw/source/core/inc/viewimp.hxx +++ b/sw/source/core/inc/viewimp.hxx @@ -175,7 +175,7 @@ public: const SwRect& _rRect, const Color* _pPageBackgrdColor = 0, const bool _bIsPageRightToLeft = false, - sdr::contact::ViewObjectContactRedirector* pRedirector = 0 ) const; + sdr::contact::ViewObjectContactRedirector* pRedirector = 0 ); /** * Is passed to the DrawEngine as a Link and decides what is painted diff --git a/sw/source/core/view/vdraw.cxx b/sw/source/core/view/vdraw.cxx index 6c80d1f..f7aae19 100644 --- a/sw/source/core/view/vdraw.cxx +++ b/sw/source/core/view/vdraw.cxx @@ -87,7 +87,7 @@ void SwViewImp::PaintLayer( const SdrLayerID _nLayerID, const SwRect& aPaintRect, const Color* _pPageBackgrdColor, const bool _bIsPageRightToLeft, - sdr::contact::ViewObjectContactRedirector* pRedirector ) const + sdr::contact::ViewObjectContactRedirector* pRedirector ) { if ( HasDrawView() ) { commit 2ebf98e8225523186965a2ced928b0623020e41e Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Wed Oct 29 12:47:05 2014 -0400 Create a variant of MakeNewObject that takes snap rectangle. And absorb 2 special cases from SvxDrawPage::_CreateSdrObject(). Change-Id: I8e400794b9aef4b229b6760835b80dffd56cbc8d diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 3ae4f23..2645e78 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -1050,10 +1050,15 @@ public: SdrObjUserData* pNewData; private: + + static SVX_DLLPRIVATE SdrObject* CreateObjectFromFactory( + sal_uInt32 nInventor, sal_uInt16 nIdentifier, SdrPage* pPage, SdrModel* pModel ); + SVX_DLLPRIVATE SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pNewPage, SdrModel* pNewModel); public: static SdrObject* MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pPage, SdrModel* pModel=NULL); + static SdrObject* MakeNewObject( sal_uInt32 nInventor, sal_uInt16 nIdentifier, const Rectangle& rSnapRect, SdrPage* pPage ); static void InsertMakeObjectHdl(const Link& rLink); static void RemoveMakeObjectHdl(const Link& rLink); static void InsertMakeUserDataHdl(const Link& rLink); diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index 237b180..0ed5c64 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -3257,13 +3257,32 @@ SdrObjFactory::SdrObjFactory(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pNe pNewData=NULL; } +SdrObject* SdrObjFactory::CreateObjectFromFactory( sal_uInt32 nInventor, sal_uInt16 nIdentifier, SdrPage* pPage, SdrModel* pModel ) +{ + boost::scoped_ptr<SdrObjFactory> pFact(new SdrObjFactory(nInventor, nIdentifier, pPage, pModel)); + + SdrLinkList& rLL = ImpGetUserMakeObjHdl(); + unsigned n = rLL.GetLinkCount(); + unsigned i = 0; + SdrObject* pObj = NULL; + while (i < n && !pObj) + { + rLL.GetLink(i).Call((void*)pFact.get()); + pObj = pFact->pNewObj; + i++; + } + + return pObj; +} + SdrObject* SdrObjFactory::MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, SdrPage* pPage, SdrModel* pModel) { - if(pModel == NULL && pPage != NULL) + if (!pModel && pPage) pModel = pPage->GetModel(); + SdrObject* pObj = NULL; - if(nInvent == SdrInventor) + if (nInvent == SdrInventor) { switch (nIdent) { @@ -3304,32 +3323,111 @@ SdrObject* SdrObjFactory::MakeNewObject(sal_uInt32 nInvent, sal_uInt16 nIdent, S } } - if(pObj == NULL) + if (!pObj) + pObj = CreateObjectFromFactory(nInvent, nIdent, pPage, pModel); + + if (!pObj) { - boost::scoped_ptr<SdrObjFactory> pFact(new SdrObjFactory(nInvent,nIdent,pPage,pModel)); - SdrLinkList& rLL=ImpGetUserMakeObjHdl(); - unsigned nAnz=rLL.GetLinkCount(); - unsigned i=0; - while (i<nAnz && pObj==NULL) { - rLL.GetLink(i).Call((void*)pFact.get()); - pObj=pFact->pNewObj; - i++; - } + // Well, if no one wants it... + return NULL; } - if(pObj == NULL) + if (pPage) + pObj->SetPage(pPage); + else if (pModel) + pObj->SetModel(pModel); + + return pObj; +} + +SdrObject* SdrObjFactory::MakeNewObject( + sal_uInt32 nInventor, sal_uInt16 nIdentifier, const Rectangle& rSnapRect, SdrPage* pPage ) +{ + SdrModel* pModel = pPage ? pPage->GetModel() : NULL; + + SdrObject* pObj = NULL; + + bool bSetSnapRect = true; + + if (nInventor == SdrInventor) { - // Well, if no one wants it... + switch (nIdentifier) + { + case OBJ_MEASURE: + { + pObj = new SdrMeasureObj(rSnapRect.TopLeft(), rSnapRect.BottomRight()); + } + break; + case OBJ_LINE: + { + basegfx::B2DPolygon aPoly; + aPoly.append(basegfx::B2DPoint(rSnapRect.Left(), rSnapRect.Top())); + aPoly.append(basegfx::B2DPoint(rSnapRect.Right(), rSnapRect.Bottom())); + pObj = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly)); + } + break; + case OBJ_TEXT: + case OBJ_TEXTEXT: + case OBJ_TITLETEXT: + case OBJ_OUTLINETEXT: + { + pObj = new SdrRectObj(static_cast<SdrObjKind>(nIdentifier), rSnapRect); + bSetSnapRect = false; + } + break; + case OBJ_CIRC: + case OBJ_SECT: + case OBJ_CARC: + case OBJ_CCUT: + { + pObj = new SdrCircObj(static_cast<SdrObjKind>(nIdentifier), rSnapRect); + bSetSnapRect = false; + } + break; + case sal_uInt16(OBJ_NONE ): pObj=new SdrObject; break; + case sal_uInt16(OBJ_GRUP ): pObj=new SdrObjGroup; break; + case sal_uInt16(OBJ_POLY ): pObj=new SdrPathObj(OBJ_POLY ); break; + case sal_uInt16(OBJ_PLIN ): pObj=new SdrPathObj(OBJ_PLIN ); break; + case sal_uInt16(OBJ_PATHLINE ): pObj=new SdrPathObj(OBJ_PATHLINE ); break; + case sal_uInt16(OBJ_PATHFILL ): pObj=new SdrPathObj(OBJ_PATHFILL ); break; + case sal_uInt16(OBJ_FREELINE ): pObj=new SdrPathObj(OBJ_FREELINE ); break; + case sal_uInt16(OBJ_FREEFILL ): pObj=new SdrPathObj(OBJ_FREEFILL ); break; + case sal_uInt16(OBJ_PATHPOLY ): pObj=new SdrPathObj(OBJ_POLY ); break; + case sal_uInt16(OBJ_PATHPLIN ): pObj=new SdrPathObj(OBJ_PLIN ); break; + case sal_uInt16(OBJ_EDGE ): pObj=new SdrEdgeObj; break; + case sal_uInt16(OBJ_RECT ): pObj=new SdrRectObj; break; + case sal_uInt16(OBJ_GRAF ): pObj=new SdrGrafObj; break; + case sal_uInt16(OBJ_OLE2 ): pObj=new SdrOle2Obj; break; + case sal_uInt16(OBJ_FRAME ): pObj=new SdrOle2Obj(true); break; + case sal_uInt16(OBJ_CAPTION ): pObj=new SdrCaptionObj; break; + case sal_uInt16(OBJ_PAGE ): pObj=new SdrPageObj; break; + case sal_uInt16(OBJ_UNO ): pObj=new SdrUnoObj(OUString()); break; + case sal_uInt16(OBJ_CUSTOMSHAPE ): pObj=new SdrObjCustomShape(); break; +#if HAVE_FEATURE_AVMEDIA + case sal_uInt16(OBJ_MEDIA ): pObj=new SdrMediaObj(); break; +#endif + case sal_uInt16(OBJ_TABLE ): pObj=new ::sdr::table::SdrTableObj(pModel); break; + case sal_uInt16(OBJ_OPENGL ): pObj=new SdrOpenGLObj; break; + } } - if(pObj != NULL) + if (!pObj) + pObj = CreateObjectFromFactory(nInventor, nIdentifier, pPage, pModel); + + if (!pObj) { - if(pPage != NULL) - pObj->SetPage(pPage); - else if(pModel != NULL) - pObj->SetModel(pModel); + // Well, if no one wants it... + return NULL; } + if (pPage) + pObj->SetPage(pPage); + else if (pModel) + pObj->SetModel(pModel); + + if (bSetSnapRect) + pObj->SetSnapRect(rSnapRect); + return pObj; } diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx index b459cee..f7e0e50 100644 --- a/svx/source/unodraw/unopage.cxx +++ b/svx/source/unodraw/unopage.cxx @@ -500,43 +500,16 @@ SdrObject *SvxDrawPage::_CreateSdrObject(const Reference< drawing::XShape > & xS if (!nType) return NULL; - SdrObject* pNewObj = 0; - awt::Size aSize = xShape->getSize(); aSize.Width += 1; aSize.Height += 1; awt::Point aPos = xShape->getPosition(); Rectangle aRect( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) ); - // special cases - if( nInventor == SdrInventor ) - { - switch( nType ) - { - case OBJ_MEASURE: - { - pNewObj = new SdrMeasureObj( aRect.TopLeft(), aRect.BottomRight() ); - break; - } - case OBJ_LINE: - { - basegfx::B2DPolygon aPoly; - aPoly.append(basegfx::B2DPoint(aRect.Left(), aRect.Top())); - aPoly.append(basegfx::B2DPoint(aRect.Right(), aRect.Bottom())); - pNewObj = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly)); - break; - } - } - } - - if( pNewObj == NULL ) - pNewObj = SdrObjFactory::MakeNewObject( nInventor, nType, mpPage ); - + SdrObject* pNewObj = SdrObjFactory::MakeNewObject(nInventor, nType, aRect, mpPage); if (!pNewObj) return NULL; - pNewObj->SetSnapRect(aRect); - if( pNewObj->ISA(E3dPolyScene)) { // Szene initialisieren commit 222d79a895f5ee6b4ae3459d72e863e776c535e8 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Wed Oct 29 15:01:37 2014 -0400 Rename aRect -> maRect for a member variable. Conflicts: svx/source/svdraw/svdoashp.cxx svx/source/svdraw/svdocirc.cxx svx/source/svdraw/svdograf.cxx svx/source/svdraw/svdoole2.cxx svx/source/svdraw/svdorect.cxx svx/source/svdraw/svdotext.cxx svx/source/svdraw/svdotxdr.cxx svx/source/svdraw/svdotxtr.cxx Change-Id: I12dc6c12ee44753c63b15f03276cdaa24e57d395 diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx index b700255..c7a5850 100644 --- a/include/svx/svdotext.hxx +++ b/include/svx/svdotext.hxx @@ -175,7 +175,7 @@ protected: // Das aRect ist gleichzeig auch das Rect vom RectObj und CircObj. // Bei bTextFrame=sal_True wird der Text in dieses Rect hineinformatiert. // Bei bTextFrame=sal_False wird der Text am Mittelpunkt des Rect zentriert. - Rectangle aRect; + Rectangle maRect; // Der GeoStat enthaelt den Drehwinkel und einen Shearwinkel GeoStat aGeo; @@ -398,7 +398,7 @@ public: long GetMaxTextFrameWidth() const; SdrFitToSizeType GetFitToSize() const; - const Rectangle &GetGeoRect() const { return aRect; } + const Rectangle &GetGeoRect() const; // Feststellen, ob TextFontwork virtual bool IsFontwork() const; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 3c4026f..1814c00 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -1464,7 +1464,7 @@ void SdrObjCustomShape::AdaptTextMinSize() else { // recreate from CustomShape-specific TextBounds - Rectangle aTextBound(aRect); + Rectangle aTextBound(maRect); if(GetTextBounds(aTextBound)) { @@ -1486,8 +1486,8 @@ void SdrObjCustomShape::AdaptTextMinSize() void SdrObjCustomShape::NbcSetSnapRect( const Rectangle& rRect ) { - aRect=rRect; - ImpJustifyRect(aRect); + maRect = rRect; + ImpJustifyRect(maRect); InvalidateRenderGeometry(); // #115391# @@ -1497,6 +1497,7 @@ void SdrObjCustomShape::NbcSetSnapRect( const Rectangle& rRect ) SetRectsDirty(); SetChanged(); } + void SdrObjCustomShape::SetSnapRect( const Rectangle& rRect ) { Rectangle aBoundRect0; @@ -1506,10 +1507,11 @@ void SdrObjCustomShape::SetSnapRect( const Rectangle& rRect ) BroadcastObjectChange(); SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0); } + void SdrObjCustomShape::NbcSetLogicRect( const Rectangle& rRect ) { - aRect = rRect; - ImpJustifyRect( aRect ); + maRect = rRect; + ImpJustifyRect(maRect); InvalidateRenderGeometry(); // #115391# @@ -1518,6 +1520,7 @@ void SdrObjCustomShape::NbcSetLogicRect( const Rectangle& rRect ) SetRectsDirty(); SetChanged(); } + void SdrObjCustomShape::SetLogicRect( const Rectangle& rRect ) { Rectangle aBoundRect0; @@ -1527,6 +1530,7 @@ void SdrObjCustomShape::SetLogicRect( const Rectangle& rRect ) BroadcastObjectChange(); SendUserCall(SDRUSERCALL_RESIZE,aBoundRect0); } + void SdrObjCustomShape::Move( const Size& rSiz ) { if ( rSiz.Width() || rSiz.Height() ) @@ -1572,7 +1576,7 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co Fraction yFact( ryFact ); // taking care of handles that should not been changed - Rectangle aOld( aRect ); + Rectangle aOld( maRect ); std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() ); SdrTextObj::NbcResize( rRef, xFact, yFact ); @@ -1601,12 +1605,12 @@ void SdrObjCustomShape::NbcResize( const Point& rRef, const Fraction& rxFact, co aIter->xInteraction->setControllerPosition( aIter->aPosition ); if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_X ) { - sal_Int32 nX = ( aIter->aPosition.X - aOld.Left() ) + aRect.Left(); + sal_Int32 nX = ( aIter->aPosition.X - aOld.Left() ) + maRect.Left(); aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( nX, aIter->xInteraction->getPosition().Y ) ); } if ( aIter->nMode & CUSTOMSHAPE_HANDLE_RESIZE_ABSOLUTE_Y ) { - sal_Int32 nY = ( aIter->aPosition.Y - aOld.Top() ) + aRect.Top(); + sal_Int32 nY = ( aIter->aPosition.Y - aOld.Top() ) + maRect.Top(); aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( aIter->xInteraction->getPosition().X, nY ) ); } } @@ -1627,7 +1631,7 @@ void SdrObjCustomShape::NbcRotate( const Point& rRef, long nAngle, double sn, do // the rotation angle for ashapes is stored in fObjectRotation, this rotation // has to be applied to the text object (which is internally using aGeo.nAngle). - SdrTextObj::NbcRotate( aRect.TopLeft(), -aGeo.nRotationAngle, // retrieving the unrotated text object + SdrTextObj::NbcRotate( maRect.TopLeft(), -aGeo.nRotationAngle, // retrieving the unrotated text object sin( (-aGeo.nRotationAngle) * F_PI18000 ), cos( (-aGeo.nRotationAngle) * F_PI18000 ) ); aGeo.nRotationAngle = 0; // resetting aGeo data @@ -1641,7 +1645,7 @@ void SdrObjCustomShape::NbcRotate( const Point& rRef, long nAngle, double sn, do nW = nW % 36000; if ( nW < 0 ) nW = 36000 + nW; - SdrTextObj::NbcRotate( aRect.TopLeft(), nW, // applying text rotation + SdrTextObj::NbcRotate( maRect.TopLeft(), nW, // applying text rotation sin( nW * F_PI18000 ), cos( nW * F_PI18000 ) ); @@ -1751,13 +1755,13 @@ SdrGluePoint SdrObjCustomShape::GetVertexGluePoint(sal_uInt16 nPosNum) const Point aPt; switch (nPosNum) { - case 0: aPt=aRect.TopCenter(); aPt.Y()-=nWdt; break; - case 1: aPt=aRect.RightCenter(); aPt.X()+=nWdt; break; - case 2: aPt=aRect.BottomCenter(); aPt.Y()+=nWdt; break; - case 3: aPt=aRect.LeftCenter(); aPt.X()-=nWdt; break; + case 0: aPt=maRect.TopCenter(); aPt.Y()-=nWdt; break; + case 1: aPt=maRect.RightCenter(); aPt.X()+=nWdt; break; + case 2: aPt=maRect.BottomCenter(); aPt.Y()+=nWdt; break; + case 3: aPt=maRect.LeftCenter(); aPt.X()-=nWdt; break; } - if (aGeo.nShearAngle!=0) ShearPoint(aPt,aRect.TopLeft(),aGeo.nTan); - if (aGeo.nRotationAngle!=0) RotatePoint(aPt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); + if (aGeo.nShearAngle!=0) ShearPoint(aPt,maRect.TopLeft(),aGeo.nTan); + if (aGeo.nRotationAngle!=0) RotatePoint(aPt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos); aPt-=GetSnapRect().Center(); SdrGluePoint aGP(aPt); aGP.SetPercent(false); @@ -1804,19 +1808,19 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded() if ( aGeo.nRotationAngle || nShearAngle || bMirroredX || bMirroredY ) { - Polygon aPoly( aRect ); + Polygon aPoly( maRect ); if( nShearAngle ) { sal_uInt16 nPointCount=aPoly.GetSize(); for (sal_uInt16 i=0; i<nPointCount; i++) - ShearPoint(aPoly[i],aRect.Center(), fTan, false ); + ShearPoint(aPoly[i],maRect.Center(), fTan, false ); } if ( aGeo.nRotationAngle ) - aPoly.Rotate( aRect.Center(), aGeo.nRotationAngle / 10 ); + aPoly.Rotate( maRect.Center(), aGeo.nRotationAngle / 10 ); Rectangle aBoundRect( aPoly.GetBoundRect() ); - sal_Int32 nXDiff = aBoundRect.Left() - aRect.Left(); - sal_Int32 nYDiff = aBoundRect.Top() - aRect.Top(); + sal_Int32 nXDiff = aBoundRect.Left() - maRect.Left(); + sal_Int32 nYDiff = aBoundRect.Top() - maRect.Top(); if (nShearAngle&&((bMirroredX&&!bMirroredY)||(bMirroredY&&!bMirroredX))) { @@ -1824,7 +1828,7 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded() fTan = -fTan; } - Point aRef( aRect.GetWidth() / 2, aRect.GetHeight() / 2 ); + Point aRef( maRect.GetWidth() / 2, maRect.GetHeight() / 2 ); for ( a = 0; a < aNewList.GetCount(); a++ ) { SdrGluePoint& rPoint = aNewList[ a ]; @@ -1834,9 +1838,9 @@ void SdrObjCustomShape::ImpCheckCustomGluePointsAreAdded() RotatePoint( aGlue, aRef, sin( fObjectRotation * F_PI180 ), cos( fObjectRotation * F_PI180 ) ); if ( bMirroredX ) - aGlue.X() = aRect.GetWidth() - aGlue.X(); + aGlue.X() = maRect.GetWidth() - aGlue.X(); if ( bMirroredY ) - aGlue.Y() = aRect.GetHeight() - aGlue.Y(); + aGlue.Y() = maRect.GetHeight() - aGlue.Y(); aGlue.X() -= nXDiff; aGlue.Y() -= nYDiff; rPoint.SetPos( aGlue ); @@ -1975,7 +1979,7 @@ bool SdrObjCustomShape::beginSpecialDrag(SdrDragStat& rDrag) const void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect ) { - Rectangle aOld( aRect ); + Rectangle aOld( maRect ); bool bOldMirroredX( IsMirroredX() ); bool bOldMirroredY( IsMirroredY() ); @@ -1985,7 +1989,7 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect ) std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() ); GeoStat aGeoStat( GetGeoStat() ); - if ( aNewRect.TopLeft()!= aRect.TopLeft() && + if ( aNewRect.TopLeft()!= maRect.TopLeft() && ( aGeo.nRotationAngle || aGeo.nShearAngle ) ) { Point aNewPos( aNewRect.TopLeft() ); @@ -1993,7 +1997,7 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect ) if ( aGeo.nRotationAngle ) RotatePoint(aNewPos, aOld.TopLeft(), aGeoStat.nSin, aGeoStat.nCos ); aNewRect.SetPos( aNewPos ); } - if ( aNewRect != aRect ) + if ( aNewRect != maRect ) { SetLogicRect( aNewRect ); InvalidateRenderGeometry(); @@ -2025,17 +2029,17 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect ) { nX = ( aIter->aPosition.X - aOld.Right() ); if ( rNewRect.Left() > rNewRect.Right() ) - nX = aRect.Left() - nX; + nX = maRect.Left() - nX; else - nX += aRect.Right(); + nX += maRect.Right(); } else { nX = ( aIter->aPosition.X - aOld.Left() ); if ( rNewRect.Left() > rNewRect.Right() ) - nX = aRect.Right() - nX; + nX = maRect.Right() - nX; else - nX += aRect.Left(); + nX += maRect.Left(); } aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( nX, aIter->xInteraction->getPosition().Y ) ); } @@ -2046,17 +2050,17 @@ void SdrObjCustomShape::DragResizeCustomShape( const Rectangle& rNewRect ) { nY = ( aIter->aPosition.Y - aOld.Bottom() ); if ( rNewRect.Top() > rNewRect.Bottom() ) - nY = aRect.Top() - nY; + nY = maRect.Top() - nY; else - nY += aRect.Bottom(); + nY += maRect.Bottom(); } else { nY = ( aIter->aPosition.Y - aOld.Top() ); if ( rNewRect.Top() > rNewRect.Bottom() ) - nY = aRect.Bottom() - nY; + nY = maRect.Bottom() - nY; else - nY += aRect.Top(); + nY += maRect.Top(); } aIter->xInteraction->setControllerPosition( com::sun::star::awt::Point( aIter->xInteraction->getPosition().X, nY ) ); } @@ -2085,7 +2089,7 @@ void SdrObjCustomShape::DragMoveCustomShapeHdl( const Point aDestination, sal_Int32 nXDiff = aPt.X - aInteractionHandle.aPosition.X; sal_Int32 nYDiff = aPt.Y - aInteractionHandle.aPosition.Y; - aRect.Move( nXDiff, nYDiff ); + maRect.Move( nXDiff, nYDiff ); aOutRect.Move( nXDiff, nYDiff ); maSnapRect.Move( nXDiff, nYDiff ); SetRectsDirty(true); @@ -2171,12 +2175,12 @@ void SdrObjCustomShape::DragCreateObject( SdrDragStat& rStat ) if ( !aInteractionHandles.empty() ) { sal_Int32 nHandlePos = aInteractionHandles[ aInteractionHandles.size() - 1 ].xInteraction->getPosition().X; - aRect1.Move( aRect.Left() - nHandlePos, 0 ); + aRect1.Move( maRect.Left() - nHandlePos, 0 ); } } ImpJustifyRect( aRect1 ); rStat.SetActionRect( aRect1 ); - aRect = aRect1; + maRect = aRect1; SetRectsDirty(); for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() ); @@ -2475,9 +2479,9 @@ Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const bool bHgt, const bool { Rectangle aReturnValue; - Rectangle aOldTextRect( aRect ); // <- initial text rectangle + Rectangle aOldTextRect( maRect ); // <- initial text rectangle - Rectangle aNewTextRect( aRect ); // <- new text rectangle returned from the custom shape renderer, + Rectangle aNewTextRect( maRect ); // <- new text rectangle returned from the custom shape renderer, GetTextBounds( aNewTextRect ); // it depends to the current logical shape size Rectangle aAdjustedTextRect( aNewTextRect ); // <- new text rectangle is being tested by AdjustTextFrameWidthAndHeight to ensure @@ -2486,7 +2490,7 @@ Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const bool bHgt, const bool if (aAdjustedTextRect != aNewTextRect && aOldTextRect != aAdjustedTextRect && aNewTextRect.GetWidth() && aNewTextRect.GetHeight()) { - aReturnValue = aRect; + aReturnValue = maRect; double fXScale = (double)aOldTextRect.GetWidth() / (double)aNewTextRect.GetWidth(); double fYScale = (double)aOldTextRect.GetHeight() / (double)aNewTextRect.GetHeight(); double fRightDiff = (double)( aAdjustedTextRect.Right() - aNewTextRect.Right() ) * fXScale; @@ -2505,13 +2509,13 @@ Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const bool bHgt, const bool bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) { Rectangle aNewTextRect = ImpCalculateTextFrame( bHgt, bWdt ); - bool bRet = !aNewTextRect.IsEmpty() && ( aNewTextRect != aRect ); + bool bRet = !aNewTextRect.IsEmpty() && ( aNewTextRect != maRect ); if ( bRet ) { // taking care of handles that should not been changed std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() ); - aRect = aNewTextRect; + maRect = aNewTextRect; SetRectsDirty(); SetChanged(); @@ -2534,7 +2538,7 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) { Rectangle aNewTextRect = ImpCalculateTextFrame( bHgt, bWdt ); - bool bRet = !aNewTextRect.IsEmpty() && ( aNewTextRect != aRect ); + bool bRet = !aNewTextRect.IsEmpty() && ( aNewTextRect != maRect ); if ( bRet ) { Rectangle aBoundRect0; @@ -2544,7 +2548,7 @@ bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) // taking care of handles that should not been changed std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() ); - aRect = aNewTextRect; + maRect = aNewTextRect; SetRectsDirty(); for (std::vector< SdrCustomShapeInteraction >::const_iterator aIter( aInteractionHandles.begin() ), aEnd( aInteractionHandles.end() ) ; @@ -2936,7 +2940,7 @@ void SdrObjCustomShape::SetPage( SdrPage* pNewPage ) // invalidating rectangles by SetRectsDirty is not sufficient, // AdjustTextFrameWidthAndHeight() also has to be made, both // actions are done by NbcSetSnapRect - Rectangle aTmp( aRect ); //creating temporary rectangle #i61108# + Rectangle aTmp( maRect ); //creating temporary rectangle #i61108# NbcSetSnapRect( aTmp ); } } @@ -3086,7 +3090,7 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf double fShearX = (aGeo.nShearAngle / 100.0) * F_PI180; // get aRect, this is the unrotated snaprect - Rectangle aRectangle(aRect); + Rectangle aRectangle(maRect); bool bMirroredX = IsMirroredX(); bool bMirroredY = IsMirroredY(); @@ -3097,7 +3101,7 @@ bool SdrObjCustomShape::TRGetBaseGeometry(basegfx::B2DHomMatrix& rMatrix, basegf if ( bMirroredX ) { - Polygon aPol( Rect2Poly( aRect, aNewGeo ) ); + Polygon aPol = Rect2Poly(maRect, aNewGeo); Rectangle aBoundRect( aPol.GetBoundRect() ); Point aRef1( ( aBoundRect.Left() + aBoundRect.Right() ) >> 1, aBoundRect.Top() ); diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx index 1390794..d556b64 100644 --- a/svx/source/svdraw/svdocapt.cxx +++ b/svx/source/svdraw/svdocapt.cxx @@ -330,7 +330,7 @@ bool SdrCaptionObj::beginSpecialDrag(SdrDragStat& rDrag) const return false; rDrag.SetNoSnap(true); - rDrag.SetActionRect(aRect); + rDrag.SetActionRect(maRect); Point aHit(rDrag.GetStart()); @@ -367,7 +367,7 @@ bool SdrCaptionObj::applySpecialDrag(SdrDragStat& rDrag) if(!pHdl) { - aRect.Move(aDelt.X(),aDelt.Y()); + maRect.Move(aDelt.X(),aDelt.Y()); } else { @@ -436,7 +436,7 @@ void SdrCaptionObj::ImpRecalcTail() { ImpCaptParams aPara; ImpGetCaptParams(aPara); - ImpCalcTail(aPara,aTailPoly,aRect); + ImpCalcTail(aPara, aTailPoly, maRect); SetRectsDirty(); SetXPolyDirty(); } @@ -544,14 +544,14 @@ void SdrCaptionObj::ImpCalcTail(const ImpCaptParams& rPara, Polygon& rPoly, Rect bool SdrCaptionObj::BegCreate(SdrDragStat& rStat) { - if (aRect.IsEmpty()) return false; // Create currently only works with the given Rect + if (maRect.IsEmpty()) return false; // Create currently only works with the given Rect ImpCaptParams aPara; ImpGetCaptParams(aPara); - aRect.SetPos(rStat.GetNow()); + maRect.SetPos(rStat.GetNow()); aTailPoly[0]=rStat.GetStart(); - ImpCalcTail(aPara,aTailPoly,aRect); - rStat.SetActionRect(aRect); + ImpCalcTail(aPara,aTailPoly,maRect); + rStat.SetActionRect(maRect); return true; } @@ -559,9 +559,9 @@ bool SdrCaptionObj::MovCreate(SdrDragStat& rStat) { ImpCaptParams aPara; ImpGetCaptParams(aPara); - aRect.SetPos(rStat.GetNow()); - ImpCalcTail(aPara,aTailPoly,aRect); - rStat.SetActionRect(aRect); + maRect.SetPos(rStat.GetNow()); + ImpCalcTail(aPara,aTailPoly,maRect); + rStat.SetActionRect(maRect); SetBoundRectDirty(); bSnapRectDirty=true; return true; @@ -571,8 +571,8 @@ bool SdrCaptionObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) { ImpCaptParams aPara; ImpGetCaptParams(aPara); - aRect.SetPos(rStat.GetNow()); - ImpCalcTail(aPara,aTailPoly,aRect); + maRect.SetPos(rStat.GetNow()); + ImpCalcTail(aPara,aTailPoly,maRect); SetRectsDirty(); return (eCmd==SDRCREATE_FORCEEND || rStat.GetPointAnz()>=2); } @@ -589,7 +589,7 @@ void SdrCaptionObj::BrkCreate(SdrDragStat& /*rStat*/) basegfx::B2DPolyPolygon SdrCaptionObj::TakeCreatePoly(const SdrDragStat& /*rDrag*/) const { basegfx::B2DPolyPolygon aRetval; - const basegfx::B2DRange aRange(aRect.Left(), aRect.Top(), aRect.Right(), aRect.Bottom()); + const basegfx::B2DRange aRange(maRect.Left(), maRect.Top(), maRect.Right(), maRect.Bottom()); aRetval.append(basegfx::tools::createPolygonFromRect(aRange)); aRetval.append(aTailPoly.getB2DPolygon()); return aRetval; @@ -664,7 +664,7 @@ void SdrCaptionObj::NbcSetSnapRect(const Rectangle& rRect) const Rectangle& SdrCaptionObj::GetLogicRect() const { - return aRect; + return maRect; } void SdrCaptionObj::NbcSetLogicRect(const Rectangle& rRect) diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx index 25f2b7a..1542670 100644 --- a/svx/source/svdraw/svdocirc.cxx +++ b/svx/source/svdraw/svdocirc.cxx @@ -279,14 +279,15 @@ basegfx::B2DPolygon SdrCircObj::ImpCalcXPolyCirc(const SdrObjKind eCicrleKind, c void SdrCircObj::RecalcXPoly() { - const basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, aRect, nStartAngle, nEndAngle)); + const basegfx::B2DPolygon aPolyCirc(ImpCalcXPolyCirc(meCircleKind, maRect, nStartAngle, nEndAngle)); mpXPoly = new XPolygon(aPolyCirc); } OUString SdrCircObj::TakeObjNameSingul() const { sal_uInt16 nID=STR_ObjNameSingulCIRC; - if (aRect.GetWidth()==aRect.GetHeight() && aGeo.nShearAngle==0) { + if (maRect.GetWidth() == maRect.GetHeight() && aGeo.nShearAngle==0) + { switch (meCircleKind) { case OBJ_CIRC: nID=STR_ObjNameSingulCIRC; break; case OBJ_SECT: nID=STR_ObjNameSingulSECT; break; @@ -319,7 +320,8 @@ OUString SdrCircObj::TakeObjNameSingul() const OUString SdrCircObj::TakeObjNamePlural() const { sal_uInt16 nID=STR_ObjNamePluralCIRC; - if (aRect.GetWidth()==aRect.GetHeight() && aGeo.nShearAngle==0) { + if (maRect.GetWidth() == maRect.GetHeight() && aGeo.nShearAngle==0) + { switch (meCircleKind) { case OBJ_CIRC: nID=STR_ObjNamePluralCIRC; break; case OBJ_SECT: nID=STR_ObjNamePluralSECT; break; @@ -346,7 +348,7 @@ SdrCircObj* SdrCircObj::Clone() const basegfx::B2DPolyPolygon SdrCircObj::TakeXorPoly() const { - const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, aRect, nStartAngle, nEndAngle)); + const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, maRect, nStartAngle, nEndAngle)); return basegfx::B2DPolyPolygon(aCircPolygon); } @@ -405,57 +407,57 @@ SdrHdl* SdrCircObj::GetHdl(sal_uInt32 nHdlNum) const switch (nHdlNum) { case 0: - aPnt = GetAnglePnt(aRect,nStartAngle); + aPnt = GetAnglePnt(maRect,nStartAngle); eLocalKind = HDL_CIRC; nPNum = 1; break; case 1: - aPnt = GetAnglePnt(aRect,nEndAngle); + aPnt = GetAnglePnt(maRect,nEndAngle); eLocalKind = HDL_CIRC; nPNum = 2L; break; case 2: - aPnt = aRect.TopLeft(); + aPnt = maRect.TopLeft(); eLocalKind = HDL_UPLFT; break; case 3: - aPnt = aRect.TopCenter(); + aPnt = maRect.TopCenter(); eLocalKind = HDL_UPPER; break; case 4: - aPnt = aRect.TopRight(); + aPnt = maRect.TopRight(); eLocalKind = HDL_UPRGT; break; case 5: - aPnt = aRect.LeftCenter(); + aPnt = maRect.LeftCenter(); eLocalKind = HDL_LEFT; break; case 6: - aPnt = aRect.RightCenter(); + aPnt = maRect.RightCenter(); eLocalKind = HDL_RIGHT; break; case 7: - aPnt = aRect.BottomLeft(); + aPnt = maRect.BottomLeft(); eLocalKind = HDL_LWLFT; break; case 8: - aPnt = aRect.BottomCenter(); + aPnt = maRect.BottomCenter(); eLocalKind = HDL_LOWER; break; case 9: - aPnt = aRect.BottomRight(); + aPnt = maRect.BottomRight(); eLocalKind = HDL_LWRGT; break; } if (aGeo.nShearAngle) { - ShearPoint(aPnt,aRect.TopLeft(),aGeo.nTan); + ShearPoint(aPnt,maRect.TopLeft(),aGeo.nTan); } if (aGeo.nRotationAngle) { - RotatePoint(aPnt,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); + RotatePoint(aPnt,maRect.TopLeft(),aGeo.nSin,aGeo.nCos); } if (eLocalKind != HDL_MOVE) @@ -502,15 +504,15 @@ bool SdrCircObj::applySpecialDrag(SdrDragStat& rDrag) Point aPt(rDrag.GetNow()); if (aGeo.nRotationAngle!=0) - RotatePoint(aPt,aRect.TopLeft(),-aGeo.nSin,aGeo.nCos); + RotatePoint(aPt,maRect.TopLeft(),-aGeo.nSin,aGeo.nCos); if (aGeo.nShearAngle!=0) - ShearPoint(aPt,aRect.TopLeft(),-aGeo.nTan); + ShearPoint(aPt,maRect.TopLeft(),-aGeo.nTan); - aPt-=aRect.Center(); + aPt -= maRect.Center(); - long nWdt=aRect.Right()-aRect.Left(); - long nHgt=aRect.Bottom()-aRect.Top(); + long nWdt = maRect.Right() - maRect.Left(); + long nHgt = maRect.Bottom() - maRect.Top(); if(nWdt>=nHgt) { @@ -687,7 +689,7 @@ bool SdrCircObj::BegCreate(SdrDragStat& rStat) Rectangle aRect1(rStat.GetStart(), rStat.GetNow()); aRect1.Justify(); rStat.SetActionRect(aRect1); - aRect = aRect1; + maRect = aRect1; ImpSetCreateParams(rStat); return true; } @@ -697,8 +699,8 @@ bool SdrCircObj::MovCreate(SdrDragStat& rStat) ImpSetCreateParams(rStat); ImpCircUser* pU=static_cast<ImpCircUser*>(rStat.GetUser()); rStat.SetActionRect(pU->aR); - aRect=pU->aR; // for ObjName - ImpJustifyRect(aRect); + maRect = pU->aR; // for ObjName + ImpJustifyRect(maRect); nStartAngle=pU->nStart; nEndAngle=pU->nEnd; SetBoundRectDirty(); @@ -724,16 +726,16 @@ bool SdrCircObj::EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd) if (meCircleKind==OBJ_CIRC) { bRet=rStat.GetPointAnz()>=2; if (bRet) { - aRect=pU->aR; - ImpJustifyRect(aRect); + maRect = pU->aR; + ImpJustifyRect(maRect); } } else { rStat.SetNoSnap(rStat.GetPointAnz()>=2); rStat.SetOrtho4Possible(rStat.GetPointAnz()<2); bRet=rStat.GetPointAnz()>=4; if (bRet) { - aRect=pU->aR; - ImpJustifyRect(aRect); + maRect = pU->aR; + ImpJustifyRect(maRect); nStartAngle=pU->nStart; nEndAngle=pU->nEnd; } @@ -804,7 +806,7 @@ Pointer SdrCircObj::GetCreatePointer() const void SdrCircObj::NbcMove(const Size& aSiz) { - MoveRect(aRect,aSiz); + MoveRect(maRect,aSiz); MoveRect(aOutRect,aSiz); MoveRect(maSnapRect,aSiz); SetXPolyDirty(); @@ -875,9 +877,9 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2) Point aTmpPt1; Point aTmpPt2; if (bFreeMirr) { // some preparations for using an arbitrary axis of reflection - Point aCenter(aRect.Center()); - long nWdt=aRect.GetWidth()-1; - long nHgt=aRect.GetHeight()-1; + Point aCenter(maRect.Center()); + long nWdt=maRect.GetWidth()-1; + long nHgt=maRect.GetHeight()-1; long nMaxRad=((nWdt>nHgt ? nWdt : nHgt)+1) /2; double a; // starting point @@ -893,12 +895,12 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2) if (nHgt==0) aTmpPt2.Y()=0; aTmpPt2+=aCenter; if (aGeo.nRotationAngle!=0) { - RotatePoint(aTmpPt1,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); - RotatePoint(aTmpPt2,aRect.TopLeft(),aGeo.nSin,aGeo.nCos); + RotatePoint(aTmpPt1,maRect.TopLeft(),aGeo.nSin,aGeo.nCos); + RotatePoint(aTmpPt2,maRect.TopLeft(),aGeo.nSin,aGeo.nCos); } if (aGeo.nShearAngle!=0) { - ShearPoint(aTmpPt1,aRect.TopLeft(),aGeo.nTan); - ShearPoint(aTmpPt2,aRect.TopLeft(),aGeo.nTan); + ShearPoint(aTmpPt1,maRect.TopLeft(),aGeo.nTan); + ShearPoint(aTmpPt2,maRect.TopLeft(),aGeo.nTan); } } SdrTextObj::NbcMirror(rRef1,rRef2); @@ -907,15 +909,15 @@ void SdrCircObj::NbcMirror(const Point& rRef1, const Point& rRef2) MirrorPoint(aTmpPt2,rRef1,rRef2); // unrotate: if (aGeo.nRotationAngle!=0) { - RotatePoint(aTmpPt1,aRect.TopLeft(),-aGeo.nSin,aGeo.nCos); // -sin for reversion - RotatePoint(aTmpPt2,aRect.TopLeft(),-aGeo.nSin,aGeo.nCos); // -sin for reversion + RotatePoint(aTmpPt1,maRect.TopLeft(),-aGeo.nSin,aGeo.nCos); // -sin for reversion + RotatePoint(aTmpPt2,maRect.TopLeft(),-aGeo.nSin,aGeo.nCos); // -sin for reversion } // unshear: if (aGeo.nShearAngle!=0) { - ShearPoint(aTmpPt1,aRect.TopLeft(),-aGeo.nTan); // -tan for reversion - ShearPoint(aTmpPt2,aRect.TopLeft(),-aGeo.nTan); // -tan for reversion + ShearPoint(aTmpPt1,maRect.TopLeft(),-aGeo.nTan); // -tan for reversion + ShearPoint(aTmpPt2,maRect.TopLeft(),-aGeo.nTan); // -tan for reversion } - Point aCenter(aRect.Center()); + Point aCenter(maRect.Center()); aTmpPt1-=aCenter; aTmpPt2-=aCenter; // because it's mirrored, the angles are swapped, too @@ -963,36 +965,36 @@ void Union(Rectangle& rR, const Point& rP) void SdrCircObj::TakeUnrotatedSnapRect(Rectangle& rRect) const { - rRect=aRect; + rRect = maRect; if (meCircleKind!=OBJ_CIRC) { - const Point aPntStart(GetAnglePnt(aRect,nStartAngle)); - const Point aPntEnd(GetAnglePnt(aRect,nEndAngle)); + const Point aPntStart(GetAnglePnt(maRect,nStartAngle)); + const Point aPntEnd(GetAnglePnt(maRect,nEndAngle)); long a=nStartAngle; long e=nEndAngle; - rRect.Left ()=aRect.Right(); - rRect.Right ()=aRect.Left(); - rRect.Top ()=aRect.Bottom(); - rRect.Bottom()=aRect.Top(); + rRect.Left ()=maRect.Right(); + rRect.Right ()=maRect.Left(); + rRect.Top ()=maRect.Bottom(); + rRect.Bottom()=maRect.Top(); Union(rRect,aPntStart); Union(rRect,aPntEnd); if ((a<=18000 && e>=18000) || (a>e && (a<=18000 || e>=18000))) { - Union(rRect,aRect.LeftCenter()); + Union(rRect,maRect.LeftCenter()); } if ((a<=27000 && e>=27000) || (a>e && (a<=27000 || e>=27000))) { - Union(rRect,aRect.BottomCenter()); + Union(rRect,maRect.BottomCenter()); } if (a>e) { - Union(rRect,aRect.RightCenter()); + Union(rRect,maRect.RightCenter()); } if ((a<=9000 && e>=9000) || (a>e && (a<=9000 || e>=9000))) { - Union(rRect,aRect.TopCenter()); + Union(rRect,maRect.TopCenter()); } if (meCircleKind==OBJ_SECT) { - Union(rRect,aRect.Center()); + Union(rRect,maRect.Center()); } if (aGeo.nRotationAngle!=0) { Point aDst(rRect.TopLeft()); - aDst-=aRect.TopLeft(); + aDst-=maRect.TopLeft(); Point aDst0(aDst); RotatePoint(aDst,Point(),aGeo.nSin,aGeo.nCos); aDst-=aDst0; @@ -1034,8 +1036,8 @@ void SdrCircObj::NbcSetSnapRect(const Rectangle& rRect) NbcResize(maSnapRect.TopLeft(),Fraction(nWdt1,nWdt0),Fraction(nHgt1,nHgt0)); NbcMove(Size(rRect.Left()-aSR0.Left(),rRect.Top()-aSR0.Top())); } else { - aRect=rRect; - ImpJustifyRect(aRect); + maRect=rRect; + ImpJustifyRect(maRect); } SetRectsDirty(); SetXPolyDirty(); @@ -1054,9 +1056,9 @@ sal_uInt32 SdrCircObj::GetSnapPointCount() const Point SdrCircObj::GetSnapPoint(sal_uInt32 i) const { switch (i) { - case 1 : return GetAnglePnt(aRect,nStartAngle); - case 2 : return GetAnglePnt(aRect,nEndAngle); - default: return aRect.Center(); + case 1 : return GetAnglePnt(maRect,nStartAngle); + case 2 : return GetAnglePnt(maRect,nEndAngle); + default: return maRect.Center(); } } @@ -1147,7 +1149,7 @@ void SdrCircObj::ImpSetCircInfoToAttr() SdrObject* SdrCircObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const { const bool bFill(OBJ_CARC == meCircleKind ? sal_False : sal_True); - const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, aRect, nStartAngle, nEndAngle)); + const basegfx::B2DPolygon aCircPolygon(ImpCalcXPolyCirc(meCircleKind, maRect, nStartAngle, nEndAngle)); SdrObject* pRet = ImpConvertMakeObj(basegfx::B2DPolyPolygon(aCircPolygon), bFill, bBezier); if(bAddText) diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx index 3e8c25e..564d07c 100644 --- a/svx/source/svdraw/svdoedge.cxx +++ b/svx/source/svdraw/svdoedge.cxx @@ -1698,7 +1698,7 @@ void SdrEdgeObj::SetEdgeTrackPath( const basegfx::B2DPolyPolygon& rPoly ) // #i110629# also set aRect and maSnapeRect depending on pEdgeTrack const Rectangle aPolygonBounds(pEdgeTrack->GetBoundRect()); - aRect = aPolygonBounds; + maRect = aPolygonBounds; maSnapRect = aPolygonBounds; } } @@ -2229,11 +2229,11 @@ void SdrEdgeObj::NbcSetSnapRect(const Rectangle& rRect) if(aOld != rRect) { - if(aRect.IsEmpty() && 0 == pEdgeTrack->GetPointCount()) + if (maRect.IsEmpty() && 0 == pEdgeTrack->GetPointCount()) { // #i110629# When initializing, do not scale on empty Rectangle; this // will mirror the underlying text object (!) - aRect = rRect; + maRect = rRect; maSnapRect = rRect; } else diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index 1bf234f..ca73543 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -870,10 +870,10 @@ basegfx::B2DPolyPolygon SdrGrafObj::TakeXorPoly() const // take grown rectangle const sal_Int32 nHalfLineWidth(ImpGetLineWdt() / 2); const Rectangle aGrownRect( - aRect.Left() - nHalfLineWidth, - aRect.Top() - nHalfLineWidth, - aRect.Right() + nHalfLineWidth, - aRect.Bottom() + nHalfLineWidth); + maRect.Left() - nHalfLineWidth, + maRect.Top() - nHalfLineWidth, + maRect.Right() + nHalfLineWidth, + maRect.Bottom() + nHalfLineWidth); XPolygon aXPoly(ImpCalcXPoly(aGrownRect, GetEckenradius())); aRetval.append(aXPoly.getB2DPolygon()); @@ -1083,7 +1083,7 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const case GRAPHIC_GDIMETAFILE: { // Sort into group and return ONLY those objects that can be created from the MetaFile. - ImpSdrGDIMetaFileImport aFilter(*GetModel(), GetLayer(), aRect); + ImpSdrGDIMetaFileImport aFilter(*GetModel(), GetLayer(), maRect); SdrObjGroup* pGrp = new SdrObjGroup(); if(aFilter.DoImport(aMtf, *pGrp->GetSubList(), 0)) @@ -1095,13 +1095,13 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const if(aGeoStat.nShearAngle) { aGeoStat.RecalcTan(); - pGrp->NbcShear(aRect.TopLeft(), aGeoStat.nShearAngle, aGeoStat.nTan, false); + pGrp->NbcShear(maRect.TopLeft(), aGeoStat.nShearAngle, aGeoStat.nTan, false); } if(aGeoStat.nRotationAngle) { aGeoStat.RecalcSinCos(); - pGrp->NbcRotate(aRect.TopLeft(), aGeoStat.nRotationAngle, aGeoStat.nSin, aGeoStat.nCos); + pGrp->NbcRotate(maRect.TopLeft(), aGeoStat.nRotationAngle, aGeoStat.nSin, aGeoStat.nCos); } } @@ -1273,7 +1273,7 @@ void SdrGrafObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly ) } if( bShrinkOnly ) - aPos = aRect.TopLeft(); + aPos = maRect.TopLeft(); aPos.X() -= aSize.Width() / 2; aPos.Y() -= aSize.Height() / 2; diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx index 70ff1a4..b59409b 100644 --- a/svx/source/svdraw/svdomeas.cxx +++ b/svx/source/svdraw/svdomeas.cxx @@ -728,7 +728,7 @@ void SdrMeasureObj::TakeUnrotatedSnapRect(Rectangle& rRect) const aTextSize2.Width()++; aTextSize2.Height()++; // because of the Rect-Ctor's odd behavior rRect=Rectangle(aTextPos,aTextSize2); rRect.Justify(); - ((SdrMeasureObj*)this)->aRect=rRect; + ((SdrMeasureObj*)this)->maRect=rRect; if (aMPol.nTextAngle!=aGeo.nRotationAngle) { ((SdrMeasureObj*)this)->aGeo.nRotationAngle=aMPol.nTextAngle; diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index a9027d7..0a7615f 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -223,7 +223,7 @@ void SdrMediaObj::AdjustToMaxRect( const Rectangle& rMaxRect, bool bShrinkOnly / } if( bShrinkOnly ) - aPos = aRect.TopLeft(); + aPos = maRect.TopLeft(); aPos.X() -= aSize.Width() / 2; aPos.Y() -= aSize.Height() / 2; diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index d97e4cb..e26129f 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -1780,8 +1780,8 @@ void SdrOle2Obj::ImpSetVisAreaSize() // objects' visual area. The scaling will not change, but it might exist already and must // be used in calculations MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) ); - Size aVisSize( (long)( Fraction( aRect.GetWidth() ) / aScaleWidth ), - (long)( Fraction( aRect.GetHeight() ) / aScaleHeight ) ); + Size aVisSize( (long)( Fraction( maRect.GetWidth() ) / aScaleWidth ), + (long)( Fraction( maRect.GetHeight() ) / aScaleHeight ) ); aVisSize = OutputDevice::LogicToLogic( aVisSize, pModel->GetScaleUnit(), aMapUnit); awt::Size aSz; @@ -1804,14 +1804,14 @@ void SdrOle2Obj::ImpSetVisAreaSize() // server changed VisArea to its liking and the VisArea is different than the suggested one // store the new value as given by the object MapUnit aNewMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) ); - aRect.SetSize(OutputDevice::LogicToLogic( aAcceptedVisArea.GetSize(), aNewMapUnit, pModel->GetScaleUnit())); + maRect.SetSize(OutputDevice::LogicToLogic( aAcceptedVisArea.GetSize(), aNewMapUnit, pModel->GetScaleUnit())); } ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits