vbachartobject.cxx (b3f79822) vbachartobject.cxx (7d1ce60b)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 5 unchanged lines hidden (view full) ---

14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 5 unchanged lines hidden (view full) ---

14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23#include "vbachart.hxx"
24#include <com/sun/star/beans/XPropertySet.hpp>
25#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
26#include <com/sun/star/container/XNamed.hpp>
27#include <com/sun/star/script/BasicErrorException.hpp>
28#include <basic/sberrors.hxx>
29#include "vbachartobject.hxx"
30#include "vbachartobjects.hxx"
31
32using namespace ::com::sun::star;
33using namespace ::ooo::vba;
34
35const rtl::OUString CHART_NAME( RTL_CONSTASCII_USTRINGPARAM("Name") );
36const rtl::OUString PERSIST_NAME( RTL_CONSTASCII_USTRINGPARAM("PersistName") );
37
38ScVbaChartObject::ScVbaChartObject( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::table::XTableChart >& _xTableChart, const css::uno::Reference< css::drawing::XDrawPageSupplier >& _xDrawPageSupplier ) : ChartObjectImpl_BASE( _xParent, _xContext ), xTableChart( _xTableChart ), xDrawPageSupplier( _xDrawPageSupplier )
39{
22#include "vbachart.hxx"
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
25#include <com/sun/star/container/XNamed.hpp>
26#include <com/sun/star/script/BasicErrorException.hpp>
27#include <basic/sberrors.hxx>
28#include "vbachartobject.hxx"
29#include "vbachartobjects.hxx"
30
31using namespace ::com::sun::star;
32using namespace ::ooo::vba;
33
34const rtl::OUString CHART_NAME( RTL_CONSTASCII_USTRINGPARAM("Name") );
35const rtl::OUString PERSIST_NAME( RTL_CONSTASCII_USTRINGPARAM("PersistName") );
36
37ScVbaChartObject::ScVbaChartObject( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::table::XTableChart >& _xTableChart, const css::uno::Reference< css::drawing::XDrawPageSupplier >& _xDrawPageSupplier ) : ChartObjectImpl_BASE( _xParent, _xContext ), xTableChart( _xTableChart ), xDrawPageSupplier( _xDrawPageSupplier )
38{
40 xDrawPage = xDrawPageSupplier->getDrawPage();
41 xEmbeddedObjectSupplier.set( xTableChart, uno::UNO_QUERY_THROW );
42 xNamed.set( xTableChart, uno::UNO_QUERY_THROW );
43 sPersistName = getPersistName();
44 xShape = setShape();
45 setName(sPersistName);
46 oShapeHelper.reset(new ShapeHelper(xShape));
39 xDrawPage = xDrawPageSupplier->getDrawPage();
40 xEmbeddedObjectSupplier.set( xTableChart, uno::UNO_QUERY_THROW );
41 xNamed.set( xTableChart, uno::UNO_QUERY_THROW );
42 sPersistName = getPersistName();
43 xShape = setShape();
44// #i121178#: don't set the persist name to the object but the OLE object's name(displaying name)
45// setName(sPersistName);
46 setName(xNamed->getDisplayName());
47 oShapeHelper.reset(new ShapeHelper(xShape));
47}
48
49rtl::OUString ScVbaChartObject::getPersistName()
50{
51 if ( !sPersistName.getLength() )
52 sPersistName = xNamed->getName();
53 return sPersistName;
54}

--- 28 unchanged lines hidden (view full) ---

83}
84
85void SAL_CALL
86ScVbaChartObject::setName( const rtl::OUString& sName ) throw (css::uno::RuntimeException)
87{
88 xNamedShape->setName(sName);
89}
90
48}
49
50rtl::OUString ScVbaChartObject::getPersistName()
51{
52 if ( !sPersistName.getLength() )
53 sPersistName = xNamed->getName();
54 return sPersistName;
55}

--- 28 unchanged lines hidden (view full) ---

84}
85
86void SAL_CALL
87ScVbaChartObject::setName( const rtl::OUString& sName ) throw (css::uno::RuntimeException)
88{
89 xNamedShape->setName(sName);
90}
91
91
92::rtl::OUString SAL_CALL
93ScVbaChartObject::getName() throw (css::uno::RuntimeException)
94{
95 return xNamedShape->getName();
96}
97
98void SAL_CALL
99ScVbaChartObject::Delete() throw ( css::script::BasicErrorException )

--- 107 unchanged lines hidden ---
92::rtl::OUString SAL_CALL
93ScVbaChartObject::getName() throw (css::uno::RuntimeException)
94{
95 return xNamedShape->getName();
96}
97
98void SAL_CALL
99ScVbaChartObject::Delete() throw ( css::script::BasicErrorException )

--- 107 unchanged lines hidden ---