summaryrefslogtreecommitdiff
path: root/chart2/source/controller
diff options
context:
space:
mode:
authorIngrid Halama <iha@openoffice.org>2010-10-07 19:02:44 +0200
committerIngrid Halama <iha@openoffice.org>2010-10-07 19:02:44 +0200
commit9767c7f18e9030097b198877e0ab87ae40a52a54 (patch)
tree3e796e1615d3cc44a85be3faab6ce4192fac695f /chart2/source/controller
parent5c43db9393f0581bbeb712cb4faf037554b5370e (diff)
parente443106e71a52fd1e7ee2e095dcbcbca70d19606 (diff)
chart49: merge with DEV300_m89
Diffstat (limited to 'chart2/source/controller')
-rwxr-xr-xchart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx11
-rwxr-xr-xchart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx8
-rwxr-xr-xchart2/source/controller/chartapiwrapper/DiagramWrapper.cxx15
-rw-r--r--chart2/source/controller/chartcontroller.component56
-rw-r--r--chart2/source/controller/dialogs/DialogModel.cxx15
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx12
-rw-r--r--chart2/source/controller/main/_serviceregistration_controller.cxx7
-rw-r--r--chart2/source/controller/makefile.mk8
8 files changed, 93 insertions, 39 deletions
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
index ffc1e95ca796..1b0d8fb4889c 100755
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
@@ -52,17 +52,6 @@ namespace chart
namespace wrapper
{
-namespace
-{
-
-rtl::OUString lcl_getCIDForDiagram( const Reference< frame::XModel >& xChartModel )
-{
- uno::Reference< XDiagram > xDiagram( ChartModelHelper::findDiagram( xChartModel ) );
- return ObjectIdentifier::createClassifiedIdentifierForObject( xDiagram, xChartModel );
-}
-
-} //anonymous namespace
-
Chart2ModelContact::Chart2ModelContact(
const Reference< uno::XComponentContext > & xContext ) :
m_xContext( xContext ),
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index a3e8eec763b2..e8d91cd6c124 100755
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -239,14 +239,14 @@ void lcl_AddPropertiesToVector(
Property( C2U( "DisableComplexChartTypes" ),
PROP_DOCUMENT_DISABLE_COMPLEX_CHARTTYPES,
::getBooleanCppuType(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT ) );
+ //#i112666# no PropertyChangeEvent is fired on change so far
+ beans::PropertyAttribute::MAYBEDEFAULT ) );
rOutProperties.push_back(
Property( C2U( "DisableDataTableDialog" ),
PROP_DOCUMENT_DISABLE_DATATABLE_DIALOG,
::getBooleanCppuType(),
- beans::PropertyAttribute::BOUND
- | beans::PropertyAttribute::MAYBEDEFAULT ) );
+ //#i112666# no PropertyChangeEvent is fired on change so far
+ beans::PropertyAttribute::MAYBEDEFAULT ) );
}
struct StaticChartDocumentWrapperPropertyArray_Initializer
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 19e7d5b2dcd4..c174614a0bf3 100755
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -750,20 +750,19 @@ void SAL_CALL DiagramWrapper::setPosition( const awt::Point& aPosition )
Reference< beans::XPropertySet > xProp( this->getInnerPropertySet() );
if( xProp.is() )
{
- if( aPosition.X < 0 || aPosition.Y < 0 || aPosition.X > 1 || aPosition.Y > 1 )
- {
- DBG_ERROR("DiagramWrapper::setPosition called with a position out of range -> automatic values are taken instead" );
- uno::Any aEmpty;
- xProp->setPropertyValue( C2U( "RelativePosition" ), aEmpty );
- return;
- }
-
awt::Size aPageSize( m_spChart2ModelContact->GetPageSize() );
chart2::RelativePosition aRelativePosition;
aRelativePosition.Anchor = drawing::Alignment_TOP_LEFT;
aRelativePosition.Primary = double(aPosition.X)/double(aPageSize.Width);
aRelativePosition.Secondary = double(aPosition.Y)/double(aPageSize.Height);
+ if( aRelativePosition.Primary < 0 || aRelativePosition.Secondary < 0 || aRelativePosition.Primary > 1 || aRelativePosition.Secondary > 1 )
+ {
+ DBG_ERROR("DiagramWrapper::setPosition called with a position out of range -> automatic values are taken instead" );
+ uno::Any aEmpty;
+ xProp->setPropertyValue( C2U( "RelativePosition" ), aEmpty );
+ return;
+ }
xProp->setPropertyValue( C2U( "RelativePosition" ), uno::makeAny(aRelativePosition) );
xProp->setPropertyValue( C2U( "PosSizeExcludeAxes" ), uno::makeAny(false) );
}
diff --git a/chart2/source/controller/chartcontroller.component b/chart2/source/controller/chartcontroller.component
new file mode 100644
index 000000000000..fc99913b5a74
--- /dev/null
+++ b/chart2/source/controller/chartcontroller.component
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--**********************************************************************
+*
+* 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.
+*
+**********************************************************************-->
+
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.chart.ElementSelectorToolbarController">
+ <service name="com.sun.star.frame.ToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartController">
+ <service name="com.sun.star.chart2.ChartController"/>
+ <service name="com.sun.star.frame.Controller"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartDocumentWrapper">
+ <service name="com.sun.star.beans.PropertySet"/>
+ <service name="com.sun.star.chart.ChartDocument"/>
+ <service name="com.sun.star.chart2.ChartDocumentWrapper"/>
+ <service name="com.sun.star.xml.UserDefinedAttributeSupplier"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartFrameLoader">
+ <service name="com.sun.star.frame.SynchronousFrameLoader"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ChartTypeDialog">
+ <service name="com.sun.star.chart2.ChartTypeDialog"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.ShapeToolbarController">
+ <service name="com.sun.star.chart2.ShapeToolbarController"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.chart2.WizardDialog">
+ <service name="com.sun.star.chart2.WizardDialog"/>
+ </implementation>
+</component>
diff --git a/chart2/source/controller/dialogs/DialogModel.cxx b/chart2/source/controller/dialogs/DialogModel.cxx
index eeeba4dda226..eedd2e3c6ba9 100644
--- a/chart2/source/controller/dialogs/DialogModel.cxx
+++ b/chart2/source/controller/dialogs/DialogModel.cxx
@@ -41,6 +41,7 @@
#include "CommonFunctors.hxx"
#include "ControllerLockGuard.hxx"
#include "ChartTypeHelper.hxx"
+#include "ThreeDHelper.hxx"
#include <com/sun/star/util/XCloneable.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
@@ -524,6 +525,9 @@ Reference< chart2::XDataSeries > DialogModel::insertSeriesAfter(
try
{
+ Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram() );
+ ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram );
+
sal_Int32 nSeriesInChartType = 0;
const sal_Int32 nTotalSeries = countSeries();
if( xChartType.is())
@@ -539,7 +543,7 @@ Reference< chart2::XDataSeries > DialogModel::insertSeriesAfter(
xChartType,
nTotalSeries, // new series' index
nSeriesInChartType,
- m_xChartDocument->getFirstDiagram(),
+ xDiagram,
m_xTemplate,
bCreateDataCachedSequences ));
@@ -560,6 +564,8 @@ Reference< chart2::XDataSeries > DialogModel::insertSeriesAfter(
aSeries.insert( aIt, xNewSeries );
xSeriesCnt->setDataSeries( ContainerToSequence( aSeries ));
}
+
+ ThreeDHelper::setScheme( xDiagram, e3DScheme );
}
catch( uno::Exception & ex )
{
@@ -693,14 +699,19 @@ bool DialogModel::setData(
m_xTemplate->getDataInterpreter());
if( xInterpreter.is())
{
+ Reference< chart2::XDiagram > xDiagram( m_xChartDocument->getFirstDiagram() );
+ ThreeDLookScheme e3DScheme = ThreeDHelper::detectScheme( xDiagram );
+
::std::vector< Reference< XDataSeries > > aSeriesToReUse(
- DiagramHelper::getDataSeriesFromDiagram( m_xChartDocument->getFirstDiagram()));
+ DiagramHelper::getDataSeriesFromDiagram( xDiagram ));
applyInterpretedData(
xInterpreter->interpretDataSource(
xDataSource, rArguments,
ContainerToSequence( aSeriesToReUse )),
aSeriesToReUse,
true /* bSetStyles */);
+
+ ThreeDHelper::setScheme( xDiagram, e3DScheme );
}
}
catch( uno::Exception & ex )
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index cddc1850eb40..330596f803f8 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -826,16 +826,14 @@ bool ChartController::executeDispatch_Delete()
else
{
//remove additional shape
- uno::Reference< drawing::XShape > xShape( m_aSelection.getSelectedAdditionalShape() );
- if( xShape.is() )
+ impl_ClearSelection();
{
- impl_ClearSelection();
+ ::vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ if ( m_pDrawViewWrapper )
{
- ::vos::OGuard aSolarGuard( Application::GetSolarMutex());
- if( m_pDrawViewWrapper )
- m_pDrawViewWrapper->UnmarkAll();
+ m_pDrawViewWrapper->DeleteMarked();
+ bReturn = true;
}
- bReturn = DrawModelWrapper::removeShape( xShape );
}
}
return bReturn;
diff --git a/chart2/source/controller/main/_serviceregistration_controller.cxx b/chart2/source/controller/main/_serviceregistration_controller.cxx
index cf8f5525e624..0371f50f9996 100644
--- a/chart2/source/controller/main/_serviceregistration_controller.cxx
+++ b/chart2/source/controller/main/_serviceregistration_controller.cxx
@@ -108,13 +108,6 @@ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//==================================================================================================
-SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(
- void * pServiceManager, void * pRegistryKey )
-{
- return ::cppu::component_writeInfoHelper(
- pServiceManager, pRegistryKey, g_entries_chart2_controller );
-}
-//==================================================================================================
SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory(
const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
{
diff --git a/chart2/source/controller/makefile.mk b/chart2/source/controller/makefile.mk
index b8a256181045..fbc888f38c3f 100644
--- a/chart2/source/controller/makefile.mk
+++ b/chart2/source/controller/makefile.mk
@@ -126,3 +126,11 @@ RESLIB1DEPN=$(RESLIB1LIST)
# --- Targets -----------------------------------------------------------------
.INCLUDE: target.mk
+
+ALLTAR : $(MISC)/chartcontroller.component
+
+$(MISC)/chartcontroller.component .ERRREMOVE : \
+ $(SOLARENV)/bin/createcomponent.xslt chartcontroller.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt chartcontroller.component