Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #include <com/sun/star/container/XNamed.hpp>
20 : #include <com/sun/star/view/XSelectionSupplier.hpp>
21 : #include <com/sun/star/text/WrapTextMode.hpp>
22 : #include <ooo/vba/msforms/XShapeRange.hpp>
23 : #include <ooo/vba/office/MsoAutoShapeType.hpp>
24 : #include <ooo/vba/office/MsoTextOrientation.hpp>
25 : #include <com/sun/star/lang/XServiceInfo.hpp>
26 : #include <com/sun/star/text/XText.hpp>
27 : #include <com/sun/star/text/XTextDocument.hpp>
28 : #include <com/sun/star/text/XTextContent.hpp>
29 : #include <com/sun/star/text/TextContentAnchorType.hpp>
30 : #include <com/sun/star/text/HoriOrientation.hpp>
31 : #include <com/sun/star/text/VertOrientation.hpp>
32 : #include <com/sun/star/text/RelOrientation.hpp>
33 : #include <com/sun/star/text/SizeType.hpp>
34 : #include <com/sun/star/text/WritingMode.hpp>
35 : #include <com/sun/star/drawing/LineStyle.hpp>
36 :
37 : #include <vbahelper/vbahelper.hxx>
38 : #include <vbahelper/vbashape.hxx>
39 : #include <vbahelper/vbashapes.hxx>
40 : #include <vbahelper/vbashaperange.hxx>
41 :
42 : using namespace ::ooo::vba;
43 : using namespace ::com::sun::star;
44 :
45 0 : class VbShapeEnumHelper : public EnumerationHelper_BASE
46 : {
47 : uno::Reference<msforms::XShapes > m_xParent;
48 : uno::Reference<container::XIndexAccess > m_xIndexAccess;
49 : sal_Int32 nIndex;
50 : public:
51 0 : VbShapeEnumHelper( const uno::Reference< msforms::XShapes >& xParent, const uno::Reference< container::XIndexAccess >& xIndexAccess ) : m_xParent( xParent ), m_xIndexAccess( xIndexAccess ), nIndex( 0 ) {}
52 0 : virtual sal_Bool SAL_CALL hasMoreElements( ) throw (uno::RuntimeException, std::exception) SAL_OVERRIDE
53 : {
54 0 : return ( nIndex < m_xIndexAccess->getCount() );
55 : }
56 0 : virtual uno::Any SAL_CALL nextElement( ) throw (container::NoSuchElementException, lang::WrappedTargetException, uno::RuntimeException, std::exception) SAL_OVERRIDE
57 : {
58 0 : ScVbaShapes* pShapes = dynamic_cast< ScVbaShapes* >(m_xParent.get());
59 0 : if ( pShapes && hasMoreElements() )
60 0 : return pShapes->createCollectionObject( m_xIndexAccess->getByIndex( nIndex++ ) );
61 0 : throw container::NoSuchElementException();
62 : }
63 :
64 : };
65 :
66 42 : void ScVbaShapes::initBaseCollection()
67 : {
68 42 : if ( m_xNameAccess.is() ) // already has NameAccess
69 42 : return;
70 : // no NameAccess then use ShapeCollectionHelper
71 42 : XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec mShapes;
72 42 : sal_Int32 nLen = m_xIndexAccess->getCount();
73 42 : mShapes.reserve( nLen );
74 174 : for ( sal_Int32 index=0; index<nLen; ++index )
75 132 : mShapes.push_back( uno::Reference< drawing::XShape >( m_xIndexAccess->getByIndex( index ) , uno::UNO_QUERY ) );
76 84 : uno::Reference< container::XIndexAccess > xShapes( new XNamedObjectCollectionHelper< drawing::XShape >( mShapes ) );
77 42 : m_xIndexAccess.set( xShapes, uno::UNO_QUERY );
78 84 : m_xNameAccess.set( xShapes, uno::UNO_QUERY );
79 : }
80 :
81 42 : ScVbaShapes::ScVbaShapes( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xShapes, const uno::Reference< frame::XModel>& xModel ): ScVbaShapes_BASE( xParent, xContext, xShapes, true ), m_nNewShapeCount(0), m_xModel( xModel )
82 : {
83 42 : m_xShapes.set( xShapes, uno::UNO_QUERY_THROW );
84 42 : m_xDrawPage.set( xShapes, uno::UNO_QUERY_THROW );
85 42 : initBaseCollection();
86 42 : }
87 :
88 : uno::Reference< container::XEnumeration >
89 0 : ScVbaShapes::createEnumeration() throw (uno::RuntimeException)
90 : {
91 0 : return new VbShapeEnumHelper( this, m_xIndexAccess );
92 : }
93 :
94 : uno::Any
95 33 : ScVbaShapes::createCollectionObject( const css::uno::Any& aSource ) throw (uno::RuntimeException)
96 : {
97 33 : if( aSource.hasValue() )
98 : {
99 33 : uno::Reference< drawing::XShape > xShape( aSource, uno::UNO_QUERY_THROW );
100 33 : return uno::makeAny( uno::Reference< msforms::XShape >( new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) ) ) );
101 : }
102 0 : return uno::Any();
103 : }
104 :
105 : uno::Type
106 0 : ScVbaShapes::getElementType() throw (uno::RuntimeException)
107 : {
108 0 : return cppu::UnoType<ooo::vba::msforms::XShape>::get();
109 : }
110 :
111 : OUString
112 0 : ScVbaShapes::getServiceImplName()
113 : {
114 0 : return OUString("ScVbaShapes");
115 : }
116 :
117 : uno::Sequence< OUString >
118 0 : ScVbaShapes::getServiceNames()
119 : {
120 0 : static uno::Sequence< OUString > aServiceNames;
121 0 : if ( aServiceNames.getLength() == 0 )
122 : {
123 0 : aServiceNames.realloc( 1 );
124 0 : aServiceNames[ 0 ] = "ooo.vba.msform.Shapes";
125 : }
126 0 : return aServiceNames;
127 : }
128 :
129 : css::uno::Reference< css::container::XIndexAccess >
130 6 : ScVbaShapes::getShapesByArrayIndices( const uno::Any& Index ) throw (uno::RuntimeException)
131 : {
132 6 : if ( Index.getValueTypeClass() != uno::TypeClass_SEQUENCE )
133 0 : throw uno::RuntimeException();
134 :
135 6 : uno::Reference< script::XTypeConverter > xConverter = getTypeConverter(mxContext);
136 12 : uno::Any aConverted;
137 6 : aConverted = xConverter->convertTo( Index, cppu::UnoType<uno::Sequence< uno::Any >>::get() );
138 :
139 12 : uno::Sequence< uno::Any > sIndices;
140 6 : aConverted >>= sIndices;
141 12 : XNamedObjectCollectionHelper< drawing::XShape >::XNamedVec mShapes;
142 6 : sal_Int32 nElems = sIndices.getLength();
143 16 : for( sal_Int32 index = 0; index < nElems; ++index )
144 : {
145 10 : uno::Reference< drawing::XShape > xShape;
146 10 : if ( sIndices[ index ].getValueTypeClass() == uno::TypeClass_STRING )
147 : {
148 3 : OUString sName;
149 3 : sIndices[ index ] >>= sName;
150 3 : xShape.set( m_xNameAccess->getByName( sName ), uno::UNO_QUERY );
151 : }
152 : else
153 : {
154 7 : sal_Int32 nIndex = 0;
155 7 : sIndices[ index ] >>= nIndex;
156 : // adjust for 1 based mso indexing
157 7 : xShape.set( m_xIndexAccess->getByIndex( nIndex - 1 ), uno::UNO_QUERY );
158 :
159 : }
160 : // populate map with drawing::XShapes
161 10 : if ( xShape.is() )
162 10 : mShapes.push_back( xShape );
163 10 : }
164 6 : uno::Reference< container::XIndexAccess > xIndexAccess( new XNamedObjectCollectionHelper< drawing::XShape >( mShapes ) );
165 12 : return xIndexAccess;
166 : }
167 :
168 : uno::Any SAL_CALL
169 33 : ScVbaShapes::Item(const uno::Any& Index, const uno::Any& Index2)
170 : throw (lang::IndexOutOfBoundsException, script::BasicErrorException, uno::RuntimeException)
171 : {
172 : // I don't think we need to support Array of indices for shapes
173 : /*
174 : if ( Index.getValueTypeClass() == uno::TypeClass_SEQUENCE )
175 : {
176 : uno::Reference< container::XIndexAccess > xIndexAccess( getShapesByArrayIndices( Index ) );
177 : // return new collection instance
178 : uno::Reference< XCollection > xShapesCollection( new ScVbaShapes( this->getParent(), mxContext, xIndexAccess ) );
179 : return uno::makeAny( xShapesCollection );
180 : }
181 : */
182 33 : return ScVbaShapes_BASE::Item( Index, Index2 );
183 : }
184 :
185 : uno::Reference< msforms::XShapeRange > SAL_CALL
186 6 : ScVbaShapes::Range( const uno::Any& shapes ) throw (css::uno::RuntimeException, std::exception)
187 : {
188 : // shapes, can be an index or an array of indices
189 6 : uno::Reference< container::XIndexAccess > xShapes;
190 6 : if ( shapes.getValueTypeClass() == uno::TypeClass_SEQUENCE )
191 3 : xShapes = getShapesByArrayIndices( shapes );
192 : else
193 : {
194 : // wrap single index into a sequence
195 3 : uno::Sequence< uno::Any > sIndices(1);
196 3 : sIndices[ 0 ] = shapes;
197 6 : uno::Any aIndex;
198 3 : aIndex <<= sIndices;
199 6 : xShapes = getShapesByArrayIndices( aIndex );
200 : }
201 6 : return new ScVbaShapeRange( getParent(), mxContext, xShapes, m_xDrawPage, m_xModel );
202 : }
203 :
204 : void SAL_CALL
205 1 : ScVbaShapes::SelectAll() throw (uno::RuntimeException, std::exception)
206 : {
207 1 : uno::Reference< view::XSelectionSupplier > xSelectSupp( m_xModel->getCurrentController(), uno::UNO_QUERY_THROW );
208 : try
209 : {
210 2 : xSelectSupp->select( uno::makeAny( m_xShapes ) );
211 : }
212 : // viewuno.cxx ScTabViewObj::select will throw IllegalArgumentException
213 : // if one of the shapes is no 'markable' e.g. a button
214 : // the method still works
215 1 : catch(const lang::IllegalArgumentException&)
216 : {
217 1 : }
218 1 : }
219 :
220 : uno::Reference< drawing::XShape >
221 2 : ScVbaShapes::createShape( const OUString& service ) throw (css::uno::RuntimeException)
222 : {
223 2 : uno::Reference< lang::XMultiServiceFactory > xMSF( m_xModel, uno::UNO_QUERY_THROW );
224 2 : uno::Reference< drawing::XShape > xShape( xMSF->createInstance( service ), uno::UNO_QUERY_THROW );
225 2 : return xShape;
226 : }
227 :
228 : uno::Any
229 1 : ScVbaShapes::AddRectangle(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, const uno::Any& rRange) throw (css::uno::RuntimeException)
230 : {
231 1 : OUString sCreateShapeName( "com.sun.star.drawing.RectangleShape" );
232 1 : sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX );
233 1 : sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY );
234 1 : sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
235 1 : sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
236 :
237 2 : uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
238 1 : m_xShapes->add( xShape );
239 :
240 2 : OUString sName(createName( "Rectangle" ));
241 1 : setDefaultShapeProperties( xShape );
242 1 : setShape_NameProperty( xShape, sName );
243 :
244 1 : awt::Point aMovePositionIfRange(0, 0);
245 1 : awt::Point position;
246 1 : position.X = nXPos - aMovePositionIfRange.X;
247 1 : position.Y = nYPos - aMovePositionIfRange.Y;
248 1 : xShape->setPosition( position );
249 :
250 1 : awt::Size size;
251 1 : size.Height = nHeight;
252 1 : size.Width = nWidth;
253 1 : xShape->setSize( size );
254 :
255 1 : ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
256 1 : pScVbaShape->setRange(rRange);
257 2 : return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
258 : }
259 :
260 : uno::Any
261 0 : ScVbaShapes::AddEllipse(sal_Int32 startX, sal_Int32 startY, sal_Int32 nLineWidth, sal_Int32 nLineHeight, const uno::Any& rRange) throw (css::uno::RuntimeException)
262 : {
263 0 : OUString sCreateShapeName( "com.sun.star.drawing.EllipseShape" );
264 0 : sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( startX );
265 0 : sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( startY );
266 0 : sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
267 0 : sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
268 :
269 0 : uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
270 0 : m_xShapes->add( xShape );
271 :
272 0 : awt::Point aMovePositionIfRange( 0, 0 );
273 : //TODO helperapi using a writer document
274 : /*
275 : XDocument xDocument = (XDocument)getParent();
276 : if (AnyConverter.isVoid(_aRange))
277 : {
278 : _aRange = xDocument.Range(new Integer(0), new Integer(1));
279 : // Top&Left in Word is Top&Left of the paper and not the writeable area.
280 : aMovePositionIfRange = calculateTopLeftMargin((HelperInterfaceAdaptor)xDocument);
281 : }
282 :
283 : setShape_AnchorTypeAndRangeProperty(xShape, _aRange);
284 : */
285 0 : OUString name(createName( "Oval" ));
286 0 : setDefaultShapeProperties(xShape);
287 0 : setShape_NameProperty(xShape, name);
288 :
289 0 : awt::Point position;
290 0 : position.X = nXPos - aMovePositionIfRange.X;
291 0 : position.Y = nYPos - aMovePositionIfRange.Y;
292 0 : xShape->setPosition(position);
293 :
294 0 : awt::Size size;
295 0 : size.Height = nHeight;
296 0 : size.Width = nWidth;
297 0 : xShape->setSize(size);
298 :
299 0 : ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
300 0 : pScVbaShape->setRange(rRange);
301 0 : return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
302 : }
303 :
304 : //helpeapi calc
305 : uno::Any SAL_CALL
306 1 : ScVbaShapes::AddLine( sal_Int32 StartX, sal_Int32 StartY, sal_Int32 endX, sal_Int32 endY ) throw (uno::RuntimeException, std::exception)
307 : {
308 1 : sal_Int32 nLineWidth = endX - StartX;
309 1 : sal_Int32 nLineHeight = endY - StartY;
310 :
311 1 : sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( nLineHeight );
312 1 : sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( nLineWidth );
313 1 : sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( StartX );
314 1 : sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( StartY );
315 :
316 1 : uno::Reference< drawing::XShape > xShape( createShape( "com.sun.star.drawing.LineShape" ), uno::UNO_QUERY_THROW );
317 1 : m_xShapes->add( xShape );
318 :
319 1 : awt::Point aMovePositionIfRange( 0, 0 );
320 :
321 2 : OUString name(createName( "Line" ));
322 1 : setDefaultShapeProperties(xShape);
323 1 : setShape_NameProperty(xShape, name);
324 :
325 1 : awt::Point position;
326 1 : position.X = nXPos - aMovePositionIfRange.X;
327 1 : position.Y = nYPos - aMovePositionIfRange.Y;
328 1 : xShape->setPosition(position);
329 :
330 1 : awt::Size size;
331 1 : size.Height = nHeight;
332 1 : size.Width = nWidth;
333 1 : xShape->setSize(size);
334 :
335 1 : ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
336 2 : return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
337 : }
338 :
339 : uno::Any SAL_CALL
340 1 : ScVbaShapes::AddShape( sal_Int32 _nType, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException, std::exception)
341 : {
342 1 : uno::Any _aAnchor;
343 1 : if (_nType == office::MsoAutoShapeType::msoShapeRectangle)
344 : {
345 1 : return AddRectangle(_nLeft, _nTop, _nWidth, _nHeight, _aAnchor);
346 : }
347 0 : else if (_nType == office::MsoAutoShapeType::msoShapeOval)
348 : {
349 0 : return AddEllipse(_nLeft, _nTop, _nWidth, _nHeight, _aAnchor);
350 : }
351 0 : return uno::Any();
352 : }
353 :
354 : uno::Any SAL_CALL
355 0 : ScVbaShapes::AddTextbox( sal_Int32 _nOrientation, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException, std::exception)
356 : {
357 0 : uno::Reference< lang::XServiceInfo > xServiceInfo( m_xModel, uno::UNO_QUERY_THROW );
358 0 : if( xServiceInfo->supportsService( "com.sun.star.text.TextDocument" ) )
359 : {
360 0 : return AddTextboxInWriter( _nOrientation, _nLeft, _nTop, _nWidth, _nHeight );
361 : }
362 0 : throw uno::RuntimeException( "Not implemented" );
363 : }
364 :
365 : uno::Any
366 0 : ScVbaShapes::AddTextboxInWriter( sal_Int32 /*_nOrientation*/, sal_Int32 _nLeft, sal_Int32 _nTop, sal_Int32 _nWidth, sal_Int32 _nHeight ) throw (uno::RuntimeException)
367 : {
368 0 : OUString sCreateShapeName( "com.sun.star.drawing.TextShape" );
369 0 : sal_Int32 nXPos = Millimeter::getInHundredthsOfOneMillimeter( _nLeft );
370 0 : sal_Int32 nYPos = Millimeter::getInHundredthsOfOneMillimeter( _nTop );
371 0 : sal_Int32 nWidth = Millimeter::getInHundredthsOfOneMillimeter( _nWidth );
372 0 : sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( _nHeight );
373 :
374 0 : uno::Reference< drawing::XShape > xShape( createShape( sCreateShapeName ), uno::UNO_QUERY_THROW );
375 0 : m_xShapes->add( xShape );
376 :
377 0 : setDefaultShapeProperties(xShape);
378 :
379 0 : OUString sName(createName( "Text Box" ));
380 0 : setShape_NameProperty( xShape, sName );
381 :
382 0 : awt::Size size;
383 0 : size.Height = nHeight;
384 0 : size.Width = nWidth;
385 0 : xShape->setSize(size);
386 :
387 0 : uno::Reference< beans::XPropertySet > xShapeProps( xShape, uno::UNO_QUERY_THROW );
388 0 : xShapeProps->setPropertyValue( "AnchorType", uno::makeAny( text::TextContentAnchorType_AT_PAGE ) );
389 0 : xShapeProps->setPropertyValue( "HoriOrientRelation", uno::makeAny( text::RelOrientation::PAGE_LEFT ) );
390 0 : xShapeProps->setPropertyValue( "HoriOrient", uno::makeAny( text::HoriOrientation::NONE ) );
391 0 : xShapeProps->setPropertyValue( "HoriOrientPosition", uno::makeAny( nXPos ) );
392 :
393 0 : xShapeProps->setPropertyValue( "VertOrientRelation", uno::makeAny( text::RelOrientation::PAGE_FRAME ) );
394 0 : xShapeProps->setPropertyValue( "VertOrient", uno::makeAny( text::VertOrientation::NONE ) );
395 0 : xShapeProps->setPropertyValue( "VertOrientPosition", uno::makeAny( nYPos ) );
396 :
397 : // set to visible
398 0 : drawing::LineStyle aLineStyle = drawing::LineStyle_SOLID;
399 0 : xShapeProps->setPropertyValue( "LineStyle", uno::makeAny( aLineStyle ) );
400 : // set to font
401 0 : sal_Int16 nLayerId = 1;
402 0 : OUString sLayerName("Heaven");
403 0 : xShapeProps->setPropertyValue( "LayerID", uno::makeAny( nLayerId ) );
404 0 : xShapeProps->setPropertyValue( "LayerName", uno::makeAny( sLayerName ) );
405 :
406 :
407 0 : ScVbaShape *pScVbaShape = new ScVbaShape( getParent(), mxContext, xShape, m_xShapes, m_xModel, ScVbaShape::getType( xShape ) );
408 0 : return uno::makeAny( uno::Reference< msforms::XShape > ( pScVbaShape ) );
409 : }
410 :
411 : void
412 2 : ScVbaShapes::setDefaultShapeProperties( uno::Reference< drawing::XShape > xShape ) throw (uno::RuntimeException)
413 : {
414 2 : uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW );
415 2 : xPropertySet->setPropertyValue( "FillStyle", uno::makeAny( OUString("SOLID") ) );
416 2 : xPropertySet->setPropertyValue( "FillColor", uno::makeAny( sal_Int32(0xFFFFFF) ) );
417 2 : xPropertySet->setPropertyValue( "TextWordWrap", uno::makeAny( text::WrapTextMode_THROUGHT ) );
418 : //not find in OOo2.3
419 : //xPropertySet->setPropertyValue("Opaque", uno::makeAny( sal_True ) );
420 2 : }
421 :
422 : void
423 2 : ScVbaShapes::setShape_NameProperty( uno::Reference< css::drawing::XShape > xShape, const OUString& sName )
424 : {
425 2 : uno::Reference< beans::XPropertySet > xPropertySet( xShape, uno::UNO_QUERY_THROW );
426 : try
427 : {
428 2 : xPropertySet->setPropertyValue( "Name", uno::makeAny( sName ) );
429 : }
430 0 : catch(const script::BasicErrorException&)
431 : {
432 2 : }
433 2 : }
434 :
435 : OUString
436 2 : ScVbaShapes::createName( const OUString& sName )
437 : {
438 2 : sal_Int32 nActNumber = 1 + m_nNewShapeCount;
439 2 : m_nNewShapeCount++;
440 2 : return sName + OUString::number( nActNumber );
441 : }
442 :
443 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|