[Libreoffice-commits] .: Branch 'integration/dev300_m98' - 2 commits - chart2/source

Michael Meeks mmeeks at kemper.freedesktop.org
Fri Mar 4 13:09:59 PST 2011


 chart2/source/controller/dialogs/tp_ChartType.cxx          |   14 -
 chart2/source/controller/main/ChartController_TextEdit.cxx |    2 
 chart2/source/controller/main/ChartController_Tools.cxx    |    2 
 chart2/source/controller/main/ChartController_Window.cxx   |   10 
 chart2/source/controller/main/DrawCommandDispatch.hrc      |   50 ++++
 chart2/source/tools/DiagramHelper.cxx                      |  134 -------------
 6 files changed, 57 insertions(+), 155 deletions(-)

New commits:
commit 1a0d9b7509ec837f94469457c945160154b5d51b
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Fri Mar 4 21:07:09 2011 +0000

    fix misc merge issues

diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx
index 04dca35..0edab9d 100644
--- a/chart2/source/controller/dialogs/tp_ChartType.cxx
+++ b/chart2/source/controller/dialogs/tp_ChartType.cxx
@@ -855,20 +855,6 @@ ChartTypeTabPage::ChartTypeTabPage( Window* pParent
         }
     }
 
-    bool bDisableComplexChartTypes = false;
-    uno::Reference< beans::XPropertySet > xProps( m_xChartModel, uno::UNO_QUERY );
-    if ( xProps.is() )
-    {
-        try
-        {
-            xProps->getPropertyValue( C2U( "DisableComplexChartTypes" ) ) >>= bDisableComplexChartTypes;
-        }
-        catch( uno::Exception& e )
-        {
-            ASSERT_EXCEPTION( e );
-        }
-    }
-
     m_aChartTypeDialogControllerList.push_back(new ColumnChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new BarChartDialogController() );
     m_aChartTypeDialogControllerList.push_back(new PieChartDialogController() );
diff --git a/chart2/source/controller/main/DrawCommandDispatch.hrc b/chart2/source/controller/main/DrawCommandDispatch.hrc
new file mode 100644
index 0000000..4e31faf
--- /dev/null
+++ b/chart2/source/controller/main/DrawCommandDispatch.hrc
@@ -0,0 +1,50 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef CHART_DRAWCOMMANDDISPATCH_HRC
+#define CHART_DRAWCOMMANDDISPATCH_HRC
+
+//-----------------------------------------------------------------------------
+//Command Ids:
+#define COMMAND_ID_OBJECT_SELECT                1
+#define COMMAND_ID_DRAW_LINE                    2
+#define COMMAND_ID_LINE_ARROW_END               3
+#define COMMAND_ID_DRAW_RECT                    4
+#define COMMAND_ID_DRAW_ELLIPSE                 5
+#define COMMAND_ID_DRAW_FREELINE_NOFILL         6
+#define COMMAND_ID_DRAW_TEXT                    7
+#define COMMAND_ID_DRAW_TEXT_VERTICAL           8
+#define COMMAND_ID_DRAW_CAPTION                 9
+#define COMMAND_ID_DRAW_CAPTION_VERTICAL       10
+#define COMMAND_ID_DRAWTBX_CS_BASIC            11
+#define COMMAND_ID_DRAWTBX_CS_SYMBOL           12
+#define COMMAND_ID_DRAWTBX_CS_ARROW            13
+#define COMMAND_ID_DRAWTBX_CS_FLOWCHART        14
+#define COMMAND_ID_DRAWTBX_CS_CALLOUT          15
+#define COMMAND_ID_DRAWTBX_CS_STAR             16
+
+// CHART_DRAWCOMMANDDISPATCH_HRC
+#endif
diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx
index a7bad42..eeaf613 100755
--- a/chart2/source/tools/DiagramHelper.cxx
+++ b/chart2/source/tools/DiagramHelper.cxx
@@ -1487,140 +1487,6 @@ awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const uno::Reference
     xDiaProps->getPropertyValue(C2U("RelativeSize") ) >>= aRelSize;
 
     awt::Size aAbsSize(
-        static_cast< sal_Int32 >( aRelSize.Primary * aPageSize.Width ),
-        static_cast< sal_Int32 >( aRelSize.Secondary * aPageSize.Height ));
-    
-    awt::Point aAbsPos(
-        static_cast< sal_Int32 >( aRelPos.Primary * aPageSize.Width ),
-        static_cast< sal_Int32 >( aRelPos.Secondary * aPageSize.Height ));
-
-    awt::Point aAbsPosLeftTop = RelativePositionHelper::getUpperLeftCornerOfAnchoredObject( aAbsPos, aAbsSize, aRelPos.Anchor );
-
-    aRet = awt::Rectangle(aAbsPosLeftTop.X, aAbsPosLeftTop.Y, aAbsSize.Width, aAbsSize.Height );
-    
-    return aRet;
-}
-
-bool DiagramHelper::switchDiagramPositioningToExcludingPositioning(
-    const uno::Reference< frame::XModel >& xChartModel
-    , bool bResetModifiedState, bool bConvertAlsoFromAutoPositioning )
-{
-    //return true if something was changed
-    const SvtSaveOptions::ODFDefaultVersion nCurrentODFVersion( SvtSaveOptions().GetODFDefaultVersion() );
-    if( nCurrentODFVersion == SvtSaveOptions::ODFVER_LATEST )//#i100778# todo: change this dependent on fileformat evolution
-    {
-        uno::Reference< ::com::sun::star::chart::XChartDocument > xOldDoc( xChartModel, uno::UNO_QUERY ) ;
-        if( xOldDoc.is() )
-        {
-            uno::Reference< ::com::sun::star::chart::XDiagramPositioning > xDiagramPositioning( xOldDoc->getDiagram(), uno::UNO_QUERY );
-            if( xDiagramPositioning.is() && ( bConvertAlsoFromAutoPositioning || !xDiagramPositioning->isAutomaticDiagramPositioning() )
-                && !xDiagramPositioning->isExcludingDiagramPositioning() )
-            {
-                ControllerLockGuard aCtrlLockGuard( xChartModel );
-                uno::Reference< util::XModifiable > xModifiable( xChartModel, uno::UNO_QUERY );
-                bool bModelWasModified = xModifiable.is() && xModifiable->isModified();
-                xDiagramPositioning->setDiagramPositionExcludingAxes( xDiagramPositioning->calculateDiagramPositionExcludingAxes() );
-                if(bResetModifiedState && !bModelWasModified && xModifiable.is() )
-                    xModifiable->setModified(sal_False);
-                return true;
-            }
-        }
-    }
-    return false;
-}
-
-DiagramPositioningMode DiagramHelper::getDiagramPositioningMode( const uno::Reference<
-                chart2::XDiagram > & xDiagram )
-{
-    DiagramPositioningMode eMode = DiagramPositioningMode_AUTO;
-    uno::Reference< beans::XPropertySet > xDiaProps( xDiagram, uno::UNO_QUERY );
-    if( xDiaProps.is() )
-    {
-        RelativePosition aRelPos;
-        RelativeSize aRelSize;
-        if( (xDiaProps->getPropertyValue(C2U("RelativePosition")) >>= aRelPos ) &&
-            (xDiaProps->getPropertyValue(C2U("RelativeSize")) >>= aRelSize ) )
-        {
-            bool bPosSizeExcludeAxes=false;
-            xDiaProps->getPropertyValue(C2U("PosSizeExcludeAxes")) >>= bPosSizeExcludeAxes;
-            if( bPosSizeExcludeAxes )
-                eMode = DiagramPositioningMode_EXCLUDING;
-            else
-                eMode = DiagramPositioningMode_INCLUDING;
-        }
-    }
-    return eMode;
-}
-
-void lcl_ensureRange0to1( double& rValue )
-{
-    if(rValue<0.0)
-        rValue=0.0;
-    if(rValue>1.0)
-        rValue=1.0;
-}
-
-bool DiagramHelper::setDiagramPositioning( const uno::Reference< frame::XModel >& xChartModel,
-        const awt::Rectangle& rPosRect /*100th mm*/ )
-{
-    ControllerLockGuard aCtrlLockGuard( xChartModel );
-
-    bool bChanged = false;
-    awt::Size aPageSize( ChartModelHelper::getPageSize(xChartModel) );
-    uno::Reference< beans::XPropertySet > xDiaProps( ChartModelHelper::findDiagram( xChartModel ), uno::UNO_QUERY );
-    if( !xDiaProps.is() )
-        return bChanged;
-
-    RelativePosition aOldPos;
-    RelativeSize aOldSize;
-    xDiaProps->getPropertyValue(C2U("RelativePosition") ) >>= aOldPos;
-    xDiaProps->getPropertyValue(C2U("RelativeSize") ) >>= aOldSize;
-
-    RelativePosition aNewPos;
-    aNewPos.Anchor = drawing::Alignment_TOP_LEFT;
-    aNewPos.Primary = double(rPosRect.X)/double(aPageSize.Width);
-    aNewPos.Secondary = double(rPosRect.Y)/double(aPageSize.Height);
-    
-    chart2::RelativeSize aNewSize;
-    aNewSize.Primary = double(rPosRect.Width)/double(aPageSize.Width);
-    aNewSize.Secondary = double(rPosRect.Height)/double(aPageSize.Height);
-
-    lcl_ensureRange0to1( aNewPos.Primary );
-    lcl_ensureRange0to1( aNewPos.Secondary );
-    lcl_ensureRange0to1( aNewSize.Primary );
-    lcl_ensureRange0to1( aNewSize.Secondary );
-    if( (aNewPos.Primary + aNewSize.Primary) > 1.0 )
-        aNewPos.Primary = 1.0 - aNewSize.Primary;
-    if( (aNewPos.Secondary + aNewSize.Secondary) > 1.0 )
-        aNewPos.Secondary = 1.0 - aNewSize.Secondary;
-    
-    xDiaProps->setPropertyValue( C2U( "RelativePosition" ), uno::makeAny(aNewPos) );
-    xDiaProps->setPropertyValue( C2U( "RelativeSize" ), uno::makeAny(aNewSize) );
-
-    bChanged = (aOldPos.Anchor!=aNewPos.Anchor) ||
-        (aOldPos.Primary!=aNewPos.Primary) ||
-        (aOldPos.Secondary!=aNewPos.Secondary) ||
-        (aOldSize.Primary!=aNewSize.Primary) ||
-        (aOldSize.Secondary!=aNewSize.Secondary);
-    return bChanged;
-}
-
-awt::Rectangle DiagramHelper::getDiagramRectangleFromModel( const uno::Reference< frame::XModel >& xChartModel )
-{
-    awt::Rectangle aRet(-1,-1,-1,-1);
-
-    uno::Reference< beans::XPropertySet > xDiaProps( ChartModelHelper::findDiagram( xChartModel ), uno::UNO_QUERY );
-    if( !xDiaProps.is() )
-        return aRet;
-
-    awt::Size aPageSize( ChartModelHelper::getPageSize(xChartModel) );
-
-    RelativePosition aRelPos;
-    RelativeSize aRelSize;
-    xDiaProps->getPropertyValue(C2U("RelativePosition") ) >>= aRelPos;
-    xDiaProps->getPropertyValue(C2U("RelativeSize") ) >>= aRelSize;
-
-    awt::Size aAbsSize(
         aRelSize.Primary * aPageSize.Width,
         aRelSize.Secondary * aPageSize.Height );
     
commit b0455423d6d640fe65215e0a26297c96594e5a02
Author: Michael Meeks <michael.meeks at novell.com>
Date:   Fri Mar 4 20:28:03 2011 +0000

    build / merge fixes

diff --git a/chart2/source/controller/main/ChartController_TextEdit.cxx b/chart2/source/controller/main/ChartController_TextEdit.cxx
index 1559b88..3ee985e 100644
--- a/chart2/source/controller/main/ChartController_TextEdit.cxx
+++ b/chart2/source/controller/main/ChartController_TextEdit.cxx
@@ -74,7 +74,7 @@ void ChartController::StartTextEdit( const Point* pMousePixel )
 {
     //the first marked object will be edited
 
-    ::vos::OGuard aGuard( Application::GetSolarMutex() );
+    SolarMutexGuard aGuard;
     SdrObject* pTextObj = m_pDrawViewWrapper->getTextEditObject();
     if(!pTextObj)
         return;
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index 87d743f..e67875e 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -253,7 +253,7 @@ void ChartController::executeDispatch_ScaleText()
 
 void ChartController::executeDispatch_Paste()
 {
-    ::vos::OGuard aGuard( Application::GetSolarMutex() );
+    SolarMutexGuard aGuard;
     if( m_pChartWindow )
     {
         Graphic aGraphic;
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 4ee9113..d13c373 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -244,7 +244,7 @@ const short HITPIX=2; //hit-tolerance in pixel
             , sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags )
             throw (uno::RuntimeException)
 {
-    ::vos::OGuard aGuard( Application::GetSolarMutex() );
+    SolarMutexGuard aGuard;
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
     
     if(xWindow.is() && m_pChartWindow)
@@ -562,7 +562,7 @@ bool isDoubleClick( const MouseEvent& rMEvt )
 
 void ChartController::startDoubleClickWaiting()
 {
-    ::vos::OGuard aGuard( Application::GetSolarMutex() );
+    SolarMutexGuard aGuard;
 
     m_bWaitingForDoubleClick = true;
 
@@ -589,7 +589,7 @@ IMPL_LINK( ChartController, DoubleClickWaitingHdl, void*, EMPTYARG )
     if( !m_bWaitingForMouseUp && m_aSelection.maybeSwitchSelectionAfterSingleClickWasEnsured() )
     {
         this->impl_selectObjectAndNotiy();
-        ::vos::OGuard aGuard( Application::GetSolarMutex() );
+        SolarMutexGuard aGuard;
         if( m_pChartWindow )
         {
             Window::PointerState aPointerState( m_pChartWindow->GetPointerState() );
@@ -967,7 +967,7 @@ void ChartController::execute_DoubleClick( const Point* pMousePixel )
 
 void ChartController::execute_Resize()
 {
-    ::vos::OGuard aGuard( Application::GetSolarMutex() );
+    SolarMutexGuard aGuard;
     if(m_pChartWindow)
         m_pChartWindow->Invalidate();
 }
@@ -1005,7 +1005,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
     if(rCEvt.GetCommand() == COMMAND_CONTEXTMENU && !bIsAction)
     {
         {
-            ::vos::OGuard aGuard( Application::GetSolarMutex() );
+            SolarMutexGuard aGuard;
             if(m_pChartWindow)
                 m_pChartWindow->ReleaseMouse();
         }


More information about the Libreoffice-commits mailing list