[Libreoffice-commits] core.git: chart2/source

Balazs Varga (via logerrit) logerrit at kemper.freedesktop.org
Fri Oct 2 14:43:13 UTC 2020


 chart2/source/controller/main/ChartController_Position.cxx |   16 ++++++-------
 1 file changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 17b0eb43ac23cd82a06d54432a0ec22cffa5b3c7
Author:     Balazs Varga <balazs.varga991 at gmail.com>
AuthorDate: Thu Oct 1 11:29:26 2020 +0200
Commit:     László Németh <nemeth at numbertext.org>
CommitDate: Fri Oct 2 16:42:20 2020 +0200

    tdf#137165 chart2: fix label position in Position and Size
    
    dialog window.
    
    Follow-up of commit 4223ff2be69f03e571464b0b09ad0d278918631b
    (tdf#48436 Chart: add CustomLabelPosition UNO API property).
    
    Change-Id: Ie676af7b9438b928041a404fb1efac6919b30030
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103750
    Tested-by: László Németh <nemeth at numbertext.org>
    Reviewed-by: László Németh <nemeth at numbertext.org>

diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 32c4bd78522e..52664c356257 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -114,11 +114,6 @@ void ChartController::executeDispatch_PositionAndSize(const ::css::uno::Sequence
     if( aCID.isEmpty() )
         return;
 
-    awt::Size aSelectedSize;
-    ExplicitValueProvider* pProvider( comphelper::getUnoTunnelImplementation<ExplicitValueProvider>( m_xChartView ) );
-    if( pProvider )
-        aSelectedSize = ToSize( pProvider->getRectangleOfObject( aCID ) );
-
     ObjectType eObjectType = ObjectIdentifier::getObjectType( aCID );
 
     UndoGuard aUndoGuard(
@@ -181,8 +176,13 @@ void ChartController::executeDispatch_PositionAndSize(const ::css::uno::Sequence
 
         if(pOutItemSet || pArgs)
         {
-            awt::Rectangle aObjectRect;
-            lcl_getPositionAndSizeFromItemSet( aItemSet, aObjectRect, aSelectedSize );
+            awt::Rectangle aOldObjectRect;
+            ExplicitValueProvider* pProvider(comphelper::getUnoTunnelImplementation<ExplicitValueProvider>( m_xChartView ));
+            if( pProvider )
+                aOldObjectRect = pProvider->getRectangleOfObject(aCID);
+
+            awt::Rectangle aNewObjectRect;
+            lcl_getPositionAndSizeFromItemSet( aItemSet, aNewObjectRect, ToSize(aOldObjectRect) );
             awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) );
             awt::Rectangle aPageRect( 0,0,aPageSize.Width,aPageSize.Height );
 
@@ -194,7 +194,7 @@ void ChartController::executeDispatch_PositionAndSize(const ::css::uno::Sequence
             }
 
             bool bMoved = PositionAndSizeHelper::moveObject( m_aSelection.getSelectedCID(), getModel()
-                        , aObjectRect, awt::Rectangle(), aPageRect );
+                        , aNewObjectRect, aOldObjectRect, aPageRect );
             if( bMoved || bChanged )
                 aUndoGuard.commit();
         }


More information about the Libreoffice-commits mailing list