Bump version to 6.4.7.2.M8
[LibreOffice.git] / svx / source / unodraw / unomod.cxx
blobe3017b41ecfbe96ff9c414cac9555d1e8ac356fa
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <sal/config.h>
22 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
23 #include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
24 #include <com/sun/star/lang/NoSupportException.hpp>
25 #include <com/sun/star/drawing/XShape.hpp>
26 #include <vcl/svapp.hxx>
27 #include <svl/itempool.hxx>
28 #include <svl/itemprop.hxx>
29 #include <svtools/unoevent.hxx>
30 #include <comphelper/sequence.hxx>
31 #include <cppuhelper/supportsservice.hxx>
32 #include <tools/debug.hxx>
34 #include <cppuhelper/implbase.hxx>
35 #include <svx/unofill.hxx>
36 #include <editeng/unonrule.hxx>
37 #include <svtools/unoimap.hxx>
38 #include <sfx2/event.hxx>
39 #include <svx/fmdpage.hxx>
40 #include <svx/fmmodel.hxx>
41 #include <svx/fmpage.hxx>
42 #include <svx/unoapi.hxx>
44 #include <svx/svdmodel.hxx>
45 #include <svx/globl3d.hxx>
46 #include <svx/svdtypes.hxx>
47 #include <svx/unoprov.hxx>
48 #include <svx/unopage.hxx>
49 #include <editeng/unofield.hxx>
50 #include <svx/unomod.hxx>
51 #include <svx/unomodel.hxx>
52 #include <svx/svdobj.hxx>
53 #include <svx/svdpage.hxx>
54 #include <svx/unoshape.hxx>
55 #include <svx/xmlgrhlp.hxx>
57 #include <com/sun/star/text/textfield/Type.hpp>
59 //-
61 using namespace ::com::sun::star;
63 //-
65 #define QUERYINT( xint ) \
66 if( rType == cppu::UnoType<xint>::get() ) \
67 aAny <<= uno::Reference< xint >(this)
69 //-
71 class SvxUnoDrawPagesAccess : public ::cppu::WeakImplHelper< css::drawing::XDrawPages, css::lang::XServiceInfo >
73 private:
74 SvxUnoDrawingModel& mrModel;
76 public:
77 explicit SvxUnoDrawPagesAccess( SvxUnoDrawingModel& rMyModel ) throw();
79 // XDrawPages
80 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL insertNewByIndex( sal_Int32 nIndex ) override;
81 virtual void SAL_CALL remove( const css::uno::Reference< css::drawing::XDrawPage >& xPage ) override;
83 // XIndexAccess
84 virtual sal_Int32 SAL_CALL getCount() override ;
85 virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
87 // XElementAccess
88 virtual css::uno::Type SAL_CALL getElementType() override;
89 virtual sal_Bool SAL_CALL hasElements() override;
91 // XServiceInfo
92 virtual OUString SAL_CALL getImplementationName( ) override;
93 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
94 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
96 //-
98 static const SvEventDescription* ImplGetSupportedMacroItems()
100 static const SvEventDescription aMacroDescriptionsImpl[] =
102 { SvMacroItemId::OnMouseOver, "OnMouseOver" },
103 { SvMacroItemId::OnMouseOut, "OnMouseOut" },
104 { SvMacroItemId::NONE, nullptr }
107 return aMacroDescriptionsImpl;
112 /** fills the given EventObject from the given SdrHint.
113 @returns
114 true if the SdrHint could be translated to an EventObject<br>
115 false if not
117 bool SvxUnoDrawMSFactory::createEvent( const SdrModel* pDoc, const SdrHint* pSdrHint, css::document::EventObject& aEvent )
119 const SdrObject* pObj = nullptr;
120 const SdrPage* pPage = nullptr;
122 switch( pSdrHint->GetKind() )
124 // case SdrHintKind::LayerChange: // layer definition changed
125 // case SdrHintKind::LayerOrderChange: // layer order changed (Insert/Remove/ChangePos)
126 // case HINT_LAYERSETCHG: // layer set changed
127 // case HINT_LAYERSETORDERCHG: // layer set order changed (Insert/Remove/ChangePos)
129 // case HINT_PAGECHG: // page changed
130 // aEvent.EventName = "PageModified";
131 // pPage = pSdrHint->GetPage();
132 // break;
133 case SdrHintKind::PageOrderChange: // draw or master page order changed (Insert/Remove/ChangePos)
134 aEvent.EventName = "PageOrderModified";
135 pPage = pSdrHint->GetPage();
136 break;
137 case SdrHintKind::ObjectChange: // object changed
138 aEvent.EventName = "ShapeModified";
139 pObj = pSdrHint->GetObject();
140 break;
141 case SdrHintKind::ObjectInserted: // add new draw object
142 aEvent.EventName = "ShapeInserted";
143 pObj = pSdrHint->GetObject();
144 break;
145 case SdrHintKind::ObjectRemoved: // removed draw object from list
146 aEvent.EventName = "ShapeRemoved";
147 pObj = pSdrHint->GetObject();
148 break;
149 // SdrHintKind::DefaultTabChange, // default tab width changed
150 // SdrHintKind::SwitchToPage, // #94278# UNDO/REDO at an object evtl. on another page
151 // HINT_OBJLISTCLEAR // Is called before an SdrObjList will be cleared
152 default:
153 return false;
156 if( pObj )
157 aEvent.Source = const_cast<SdrObject*>(pObj)->getUnoShape();
158 else if( pPage )
159 aEvent.Source = const_cast<SdrPage*>(pPage)->getUnoPage();
160 else
161 aEvent.Source = const_cast<SdrModel*>(pDoc)->getUnoModel();
163 return true;
166 namespace {
168 css::uno::Reference<css::uno::XInterface> create(
169 OUString const & rServiceSpecifier, OUString const & referer)
171 if( rServiceSpecifier.startsWith("com.sun.star.drawing.") )
173 sal_uInt32 nType = UHashMap::getId( rServiceSpecifier );
174 if( nType != UHASHMAP_NOTFOUND )
176 sal_uInt16 nT = static_cast<sal_uInt16>(nType & ~E3D_INVENTOR_FLAG);
177 SdrInventor nI = (nType & E3D_INVENTOR_FLAG) ? SdrInventor::E3d : SdrInventor::Default;
179 return uno::Reference< uno::XInterface >( static_cast<drawing::XShape*>(SvxDrawPage::CreateShapeByTypeAndInventor( nT, nI, nullptr, nullptr, referer )) );
182 else if (rServiceSpecifier == "com.sun.star.document.ImportGraphicStorageHandler")
184 rtl::Reference<SvXMLGraphicHelper> pGraphicHelper = SvXMLGraphicHelper::Create( SvXMLGraphicHelperMode::Read );
185 uno::Reference< uno::XInterface> xRet( static_cast< ::cppu::OWeakObject* >( pGraphicHelper.get() ) );
186 return xRet;
189 uno::Reference< uno::XInterface > xRet( SvxUnoDrawMSFactory::createTextField( rServiceSpecifier ) );
190 if( !xRet.is() )
191 throw lang::ServiceNotRegisteredException("unknown service: " + rServiceSpecifier);
193 return xRet;
198 uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstance( const OUString& rServiceSpecifier )
200 return create(rServiceSpecifier, "");
203 uno::Reference< uno::XInterface > SvxUnoDrawMSFactory::createTextField( const OUString& ServiceSpecifier )
205 return SvxUnoTextCreateTextField( ServiceSpecifier );
208 uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawMSFactory::createInstanceWithArguments( const OUString& ServiceSpecifier, const uno::Sequence< css::uno::Any >& Arguments )
210 OUString arg;
211 if ((ServiceSpecifier == "com.sun.star.drawing.GraphicObjectShape"
212 || ServiceSpecifier == "com.sun.star.drawing.MediaShape")
213 && Arguments.getLength() == 1 && (Arguments[0] >>= arg))
215 return create(ServiceSpecifier, arg);
217 throw lang::NoSupportException();
220 uno::Sequence< OUString > SAL_CALL SvxUnoDrawMSFactory::getAvailableServiceNames()
222 return UHashMap::getServiceNames();
225 SdrModel& SvxUnoDrawingModel::getSdrModelFromUnoModel() const
227 OSL_ENSURE(mpDoc, "No SdrModel in UnoDrawingModel, should not happen");
228 return *mpDoc;
231 SvxUnoDrawingModel::SvxUnoDrawingModel(SdrModel* pDoc) throw()
232 : SfxBaseModel(nullptr),
233 SvxFmMSFactory(),
234 css::drawing::XDrawPagesSupplier(),
235 css::lang::XServiceInfo(),
236 css::ucb::XAnyCompareFactory(),
237 mpDoc(pDoc),
238 mxDrawPagesAccess(),
239 mxDashTable(),
240 mxGradientTable(),
241 mxHatchTable(),
242 mxBitmapTable(),
243 mxTransGradientTable(),
244 mxMarkerTable(),
245 maTypeSequence()
249 SvxUnoDrawingModel::~SvxUnoDrawingModel() throw()
253 uno::Any SAL_CALL SvxUnoDrawingModel::queryInterface( const uno::Type & rType )
255 uno::Any aAny;
257 QUERYINT(lang::XServiceInfo);
258 else QUERYINT(lang::XMultiServiceFactory);
259 else QUERYINT(drawing::XDrawPagesSupplier);
260 else QUERYINT(css::ucb::XAnyCompareFactory);
261 else
262 return SfxBaseModel::queryInterface( rType );
264 return aAny;
267 void SAL_CALL SvxUnoDrawingModel::acquire() throw ( )
269 SfxBaseModel::acquire();
272 void SAL_CALL SvxUnoDrawingModel::release() throw ( )
274 SfxBaseModel::release();
277 // XTypeProvider
278 uno::Sequence< uno::Type > SAL_CALL SvxUnoDrawingModel::getTypes( )
280 if( !maTypeSequence.hasElements() )
282 maTypeSequence = comphelper::concatSequences( SfxBaseModel::getTypes(),
283 uno::Sequence {
284 cppu::UnoType<lang::XServiceInfo>::get(),
285 cppu::UnoType<lang::XMultiServiceFactory>::get(),
286 cppu::UnoType<drawing::XDrawPagesSupplier>::get(),
287 cppu::UnoType<css::ucb::XAnyCompareFactory>::get() });
289 return maTypeSequence;
292 uno::Sequence< sal_Int8 > SAL_CALL SvxUnoDrawingModel::getImplementationId( )
294 return css::uno::Sequence<sal_Int8>();
297 void SAL_CALL SvxUnoDrawingModel::lockControllers( )
299 if( mpDoc )
300 mpDoc->setLock(true);
303 void SAL_CALL SvxUnoDrawingModel::unlockControllers( )
305 if( mpDoc && mpDoc->isLocked() )
307 mpDoc->setLock(false);
311 sal_Bool SAL_CALL SvxUnoDrawingModel::hasControllersLocked( )
313 return mpDoc && mpDoc->isLocked();
316 // XDrawPagesSupplier
317 uno::Reference< drawing::XDrawPages > SAL_CALL SvxUnoDrawingModel::getDrawPages()
319 ::SolarMutexGuard aGuard;
321 uno::Reference< drawing::XDrawPages > xDrawPages( mxDrawPagesAccess );
323 if( !xDrawPages.is() )
324 mxDrawPagesAccess = xDrawPages = new SvxUnoDrawPagesAccess(*this);
326 return xDrawPages;
329 // XMultiServiceFactory ( SvxFmMSFactory )
330 uno::Reference< uno::XInterface > SAL_CALL SvxUnoDrawingModel::createInstance( const OUString& aServiceSpecifier )
332 ::SolarMutexGuard aGuard;
334 if( aServiceSpecifier == "com.sun.star.drawing.DashTable" )
336 if( !mxDashTable.is() )
337 mxDashTable = SvxUnoDashTable_createInstance( mpDoc );
338 return mxDashTable;
340 if( aServiceSpecifier == "com.sun.star.drawing.GradientTable" )
342 if( !mxGradientTable.is() )
343 mxGradientTable = SvxUnoGradientTable_createInstance( mpDoc );
344 return mxGradientTable;
346 if( aServiceSpecifier == "com.sun.star.drawing.HatchTable" )
348 if( !mxHatchTable.is() )
349 mxHatchTable = SvxUnoHatchTable_createInstance( mpDoc );
350 return mxHatchTable;
352 if( aServiceSpecifier == "com.sun.star.drawing.BitmapTable" )
354 if( !mxBitmapTable.is() )
355 mxBitmapTable = SvxUnoBitmapTable_createInstance( mpDoc );
356 return mxBitmapTable;
358 if( aServiceSpecifier == "com.sun.star.drawing.TransparencyGradientTable" )
360 if( !mxTransGradientTable.is() )
361 mxTransGradientTable = SvxUnoTransGradientTable_createInstance( mpDoc );
362 return mxTransGradientTable;
364 if( aServiceSpecifier == "com.sun.star.drawing.MarkerTable" )
366 if( !mxMarkerTable.is() )
367 mxMarkerTable = SvxUnoMarkerTable_createInstance( mpDoc );
368 return mxMarkerTable;
370 if( aServiceSpecifier == "com.sun.star.text.NumberingRules" )
372 return uno::Reference< uno::XInterface >( SvxCreateNumRule( mpDoc ), uno::UNO_QUERY );
375 if ( aServiceSpecifier == "com.sun.star.image.ImageMapRectangleObject" )
377 return SvUnoImageMapRectangleObject_createInstance( ImplGetSupportedMacroItems() );
380 if ( aServiceSpecifier == "com.sun.star.image.ImageMapCircleObject" )
382 return SvUnoImageMapCircleObject_createInstance( ImplGetSupportedMacroItems() );
385 if ( aServiceSpecifier == "com.sun.star.image.ImageMapPolygonObject" )
387 return SvUnoImageMapPolygonObject_createInstance( ImplGetSupportedMacroItems() );
390 if( aServiceSpecifier == "com.sun.star.text.TextField.DateTime" )
392 return static_cast<cppu::OWeakObject *>(new SvxUnoTextField(text::textfield::Type::DATE));
395 uno::Reference< uno::XInterface > xRet;
397 const OUString aPackagePrefix( "com.sun.star.presentation." );
398 if( aServiceSpecifier.startsWith( aPackagePrefix ) )
400 SvxShape* pShape = nullptr;
402 sal_uInt16 nType = OBJ_TEXT;
403 OUString aTypeName = aServiceSpecifier.copy( aPackagePrefix.getLength() );
404 // create a shape wrapper
405 if( aTypeName.startsWith("TitleTextShape") )
407 nType = OBJ_TEXT;
409 else if( aTypeName.startsWith( "OutlinerShape" ) )
411 nType = OBJ_TEXT;
413 else if( aTypeName.startsWith( "SubtitleShape" ) )
415 nType = OBJ_TEXT;
417 else if( aTypeName.startsWith( "GraphicObjectShape" ) )
419 nType = OBJ_GRAF;
421 else if( aTypeName.startsWith( "PageShape" ) )
423 nType = OBJ_PAGE;
425 else if( aTypeName.startsWith( "OLE2Shape" ) )
427 nType = OBJ_OLE2;
429 else if( aTypeName.startsWith( "ChartShape" ) )
431 nType = OBJ_OLE2;
433 else if( aTypeName.startsWith( "OrgChartShape" ) )
435 nType = OBJ_OLE2;
437 else if( aTypeName.startsWith( "NotesShape" ) )
439 nType = OBJ_TEXT;
441 else if( aTypeName.startsWith( "HandoutShape" ) )
443 nType = OBJ_PAGE;
445 else if( aTypeName.startsWith( "FooterShape" ) )
447 nType = OBJ_TEXT;
449 else if( aTypeName.startsWith( "HeaderShape" ) )
451 nType = OBJ_TEXT;
453 else if( aTypeName.startsWith( "SlideNumberShape" ) )
455 nType = OBJ_TEXT;
457 else if( aTypeName.startsWith( "DateTimeShape" ) )
459 nType = OBJ_TEXT;
461 else if( aTypeName.startsWith( "TableShape" ) )
463 nType = OBJ_TABLE;
465 else
467 throw lang::ServiceNotRegisteredException();
470 // create the API wrapper
471 pShape = CreateSvxShapeByTypeAndInventor( nType, SdrInventor::Default, "" );
473 // set shape type
474 if( pShape )
475 pShape->SetShapeType(aServiceSpecifier);
477 xRet = static_cast<uno::XWeak*>(pShape);
479 else
481 xRet = SvxFmMSFactory::createInstance( aServiceSpecifier );
484 return xRet;
487 uno::Sequence< OUString > SAL_CALL SvxUnoDrawingModel::getAvailableServiceNames()
489 const uno::Sequence< OUString > aSNS_ORG( SvxFmMSFactory::getAvailableServiceNames() );
491 uno::Sequence< OUString > aSNS( 21 );
493 sal_uInt16 i = 0;
495 aSNS[i++] = "com.sun.star.drawing.DashTable";
496 aSNS[i++] = "com.sun.star.drawing.GradientTable";
497 aSNS[i++] = "com.sun.star.drawing.HatchTable";
498 aSNS[i++] = "com.sun.star.drawing.BitmapTable";
499 aSNS[i++] = "com.sun.star.drawing.TransparencyGradientTable";
500 aSNS[i++] = "com.sun.star.drawing.MarkerTable";
501 aSNS[i++] = "com.sun.star.text.NumberingRules";
502 aSNS[i++] = "com.sun.star.image.ImageMapRectangleObject";
503 aSNS[i++] = "com.sun.star.image.ImageMapCircleObject";
504 aSNS[i++] = "com.sun.star.image.ImageMapPolygonObject";
506 aSNS[i++] = "com.sun.star.presentation.TitleTextShape";
507 aSNS[i++] = "com.sun.star.presentation.OutlinerShape";
508 aSNS[i++] = "com.sun.star.presentation.SubtitleShape";
509 aSNS[i++] = "com.sun.star.presentation.GraphicObjectShape";
510 aSNS[i++] = "com.sun.star.presentation.ChartShape";
511 aSNS[i++] = "com.sun.star.presentation.PageShape";
512 aSNS[i++] = "com.sun.star.presentation.OLE2Shape";
513 aSNS[i++] = "com.sun.star.presentation.TableShape";
514 aSNS[i++] = "com.sun.star.presentation.OrgChartShape";
515 aSNS[i++] = "com.sun.star.presentation.NotesShape";
516 aSNS[i++] = "com.sun.star.presentation.HandoutShape";
518 DBG_ASSERT( i == aSNS.getLength(), "Sequence overrun!" );
520 return comphelper::concatSequences( aSNS_ORG, aSNS );
523 // lang::XServiceInfo
524 OUString SAL_CALL SvxUnoDrawingModel::getImplementationName()
526 return "SvxUnoDrawingModel";
529 sal_Bool SAL_CALL SvxUnoDrawingModel::supportsService( const OUString& ServiceName )
531 return cppu::supportsService( this, ServiceName );
534 uno::Sequence< OUString > SAL_CALL SvxUnoDrawingModel::getSupportedServiceNames()
536 return { "com.sun.star.drawing.DrawingDocument" };
539 // XAnyCompareFactory
540 uno::Reference< css::ucb::XAnyCompare > SAL_CALL SvxUnoDrawingModel::createAnyCompareByName( const OUString& )
542 return SvxCreateNumRuleCompare();
545 SvxUnoDrawPagesAccess::SvxUnoDrawPagesAccess( SvxUnoDrawingModel& rMyModel ) throw()
546 : mrModel(rMyModel)
550 // XIndexAccess
551 sal_Int32 SAL_CALL SvxUnoDrawPagesAccess::getCount()
553 ::SolarMutexGuard aGuard;
555 sal_Int32 nCount = 0;
557 if( mrModel.mpDoc )
558 nCount = mrModel.mpDoc->GetPageCount();
560 return nCount;
563 uno::Any SAL_CALL SvxUnoDrawPagesAccess::getByIndex( sal_Int32 Index )
565 ::SolarMutexGuard aGuard;
567 uno::Any aAny;
569 if( mrModel.mpDoc )
571 if( (Index < 0) || (Index >= mrModel.mpDoc->GetPageCount() ) )
572 throw lang::IndexOutOfBoundsException();
574 SdrPage* pPage = mrModel.mpDoc->GetPage( static_cast<sal_uInt16>(Index) );
575 if( pPage )
577 uno::Reference< uno::XInterface > xPage( pPage->mxUnoPage );
579 if( !xPage.is() )
581 if( dynamic_cast<FmFormModel*>( mrModel.mpDoc ) )
582 xPage = static_cast<drawing::XDrawPage*>(new SvxFmDrawPage( pPage ));
583 else
584 xPage = static_cast<drawing::XDrawPage*>(new SvxDrawPage( pPage ));
586 pPage->mxUnoPage = xPage;
589 aAny <<= xPage;
592 return aAny;
595 // XElementAccess
596 uno::Type SAL_CALL SvxUnoDrawPagesAccess::getElementType()
598 return cppu::UnoType<drawing::XDrawPage>::get();
601 sal_Bool SAL_CALL SvxUnoDrawPagesAccess::hasElements()
603 return getCount() > 0;
606 // XDrawPages
608 // create a new page with model at given position
609 // and return corresponding SdDrawPage
610 uno::Reference< drawing::XDrawPage > SAL_CALL SvxUnoDrawPagesAccess::insertNewByIndex( sal_Int32 nIndex )
612 ::SolarMutexGuard aGuard;
614 uno::Reference< drawing::XDrawPage > xDrawPage;
616 if( mrModel.mpDoc )
618 SdrPage* pPage;
620 if( dynamic_cast<FmFormModel*>( mrModel.mpDoc ) )
621 pPage = new FmFormPage(*static_cast<FmFormModel*>(mrModel.mpDoc));
622 else
623 pPage = new SdrPage(*mrModel.mpDoc);
625 mrModel.mpDoc->InsertPage( pPage, static_cast<sal_uInt16>(nIndex) );
626 xDrawPage.set( pPage->getUnoPage(), uno::UNO_QUERY );
629 return xDrawPage;
632 void SAL_CALL SvxUnoDrawPagesAccess::remove( const uno::Reference< drawing::XDrawPage >& xPage )
634 ::SolarMutexGuard aGuard;
636 sal_uInt16 nPageCount = mrModel.mpDoc->GetPageCount();
637 if( nPageCount > 1 )
639 // get pPage from xPage and get Id (nPos)
640 SvxDrawPage* pSvxPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
641 if( pSvxPage )
643 SdrPage* pPage = pSvxPage->GetSdrPage();
644 if(pPage)
646 sal_uInt16 nPage = pPage->GetPageNum();
647 mrModel.mpDoc->DeletePage( nPage );
653 // XServiceInfo
655 OUString SAL_CALL SvxUnoDrawPagesAccess::getImplementationName( )
657 return "SvxUnoDrawPagesAccess";
660 sal_Bool SAL_CALL SvxUnoDrawPagesAccess::supportsService( const OUString& ServiceName )
662 return cppu::supportsService(this, ServiceName);
665 uno::Sequence< OUString > SAL_CALL SvxUnoDrawPagesAccess::getSupportedServiceNames( )
667 return { "com.sun.star.drawing.DrawPages" };
670 css::uno::Reference< css::container::XIndexReplace > SvxCreateNumRule(SdrModel* pModel)
672 const SvxNumRule* pDefaultRule = nullptr;
673 if( pModel )
675 const SvxNumBulletItem* pItem = pModel->GetItemPool().GetSecondaryPool()->GetPoolDefaultItem(EE_PARA_NUMBULLET);
676 if( pItem )
678 pDefaultRule = pItem->GetNumRule();
682 if( pDefaultRule )
684 return SvxCreateNumRule( pDefaultRule );
686 else
688 SvxNumRule aTempRule( SvxNumRuleFlags::NONE, 10, false );
689 return SvxCreateNumRule( &aTempRule );
694 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */