1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include <com/sun/star/style/XStyle.hpp>
22 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/lang/XComponent.hpp>
25 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
26 #include <com/sun/star/container/XIndexReplace.hpp>
27 #include <com/sun/star/container/XNameContainer.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/util/XModifiable.hpp>
30 #include <com/sun/star/util/XModifyListener.hpp>
31 #include <com/sun/star/form/XReset.hpp>
33 #include <vcl/svapp.hxx>
35 #include <comphelper/compbase.hxx>
36 #include <comphelper/interfacecontainer4.hxx>
37 #include <cppuhelper/implbase.hxx>
38 #include <cppuhelper/supportsservice.hxx>
39 #include <comphelper/sequence.hxx>
41 #include <svx/sdr/table/tabledesign.hxx>
42 #include <svx/dialmgr.hxx>
43 #include <svx/strings.hrc>
45 #include "sdrtableobjimpl.hxx"
52 using namespace ::com::sun::star::uno
;
53 using namespace ::com::sun::star::style
;
54 using namespace ::com::sun::star::lang
;
55 using namespace ::com::sun::star::beans
;
56 using namespace ::com::sun::star::util
;
57 using namespace ::com::sun::star::container
;
59 namespace sdr::table
{
61 typedef std::map
< OUString
, sal_Int32
> CellStyleNameMap
;
63 typedef ::comphelper::WeakComponentImplHelper
< XStyle
, XNameReplace
, XServiceInfo
, XIndexReplace
, XModifiable
, XModifyListener
, XPropertySet
> TableDesignStyleBase
;
67 class TableDesignStyle
: public TableDesignStyleBase
73 virtual OUString SAL_CALL
getImplementationName() override
;
74 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
75 virtual Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
78 virtual sal_Bool SAL_CALL
isUserDefined() override
;
79 virtual sal_Bool SAL_CALL
isInUse() override
;
80 virtual OUString SAL_CALL
getParentStyle() override
;
81 virtual void SAL_CALL
setParentStyle( const OUString
& aParentStyle
) override
;
84 virtual OUString SAL_CALL
getName() override
;
85 virtual void SAL_CALL
setName( const OUString
& aName
) override
;
88 virtual Any SAL_CALL
getByName( const OUString
& aName
) override
;
89 virtual Sequence
< OUString
> SAL_CALL
getElementNames() override
;
90 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
) override
;
93 virtual css::uno::Type SAL_CALL
getElementType() override
;
94 virtual sal_Bool SAL_CALL
hasElements() override
;
97 virtual sal_Int32 SAL_CALL
getCount() override
;
98 virtual Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
101 virtual void SAL_CALL
replaceByIndex( sal_Int32 Index
, const Any
& Element
) override
;
104 virtual void SAL_CALL
replaceByName( const OUString
& aName
, const Any
& aElement
) override
;
107 virtual Reference
<XPropertySetInfo
> SAL_CALL
getPropertySetInfo() override
;
108 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const Any
& aValue
) override
;
109 virtual Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
110 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const Reference
<XPropertyChangeListener
>& xListener
) override
;
111 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const Reference
<XPropertyChangeListener
>& aListener
) override
;
112 virtual void SAL_CALL
addVetoableChangeListener(const OUString
& PropertyName
, const Reference
<XVetoableChangeListener
>& aListener
) override
;
113 virtual void SAL_CALL
removeVetoableChangeListener(const OUString
& PropertyName
,const Reference
<XVetoableChangeListener
>&aListener
) override
;
116 virtual sal_Bool SAL_CALL
isModified() override
;
117 virtual void SAL_CALL
setModified( sal_Bool bModified
) override
;
119 // XModifyBroadcaster
120 virtual void SAL_CALL
addModifyListener( const Reference
< XModifyListener
>& aListener
) override
;
121 virtual void SAL_CALL
removeModifyListener( const Reference
< XModifyListener
>& aListener
) override
;
124 virtual void SAL_CALL
modified( const css::lang::EventObject
& aEvent
) override
;
125 virtual void SAL_CALL
disposing( const css::lang::EventObject
& Source
) override
;
127 void notifyModifyListener();
128 void resetUserDefined();
130 // this function is called upon disposing the component
131 virtual void disposing(std::unique_lock
<std::mutex
>& aGuard
) override
;
133 static const CellStyleNameMap
& getCellStyleNameMap();
135 bool mbUserDefined
, mbModified
;
137 Reference
< XStyle
> maCellStyles
[style_count
];
138 comphelper::OInterfaceContainerHelper4
<XModifyListener
> maModifyListeners
;
143 typedef std::vector
< Reference
< XStyle
> > TableDesignStyleVector
;
147 class TableDesignFamily
: public ::cppu::WeakImplHelper
< XNameContainer
, XNamed
, XIndexAccess
, XSingleServiceFactory
, XServiceInfo
, XComponent
, XPropertySet
, form::XReset
>
151 virtual OUString SAL_CALL
getImplementationName() override
;
152 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) override
;
153 virtual Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() override
;
156 virtual OUString SAL_CALL
getName( ) override
;
157 virtual void SAL_CALL
setName( const OUString
& aName
) override
;
160 virtual Any SAL_CALL
getByName( const OUString
& aName
) override
;
161 virtual Sequence
< OUString
> SAL_CALL
getElementNames() override
;
162 virtual sal_Bool SAL_CALL
hasByName( const OUString
& aName
) override
;
165 virtual Type SAL_CALL
getElementType() override
;
166 virtual sal_Bool SAL_CALL
hasElements() override
;
169 virtual sal_Int32 SAL_CALL
getCount() override
;
170 virtual Any SAL_CALL
getByIndex( sal_Int32 Index
) override
;
173 virtual void SAL_CALL
insertByName( const OUString
& aName
, const Any
& aElement
) override
;
174 virtual void SAL_CALL
removeByName( const OUString
& Name
) override
;
177 virtual void SAL_CALL
replaceByName( const OUString
& aName
, const Any
& aElement
) override
;
179 // XSingleServiceFactory
180 virtual Reference
< XInterface
> SAL_CALL
createInstance( ) override
;
181 virtual Reference
< XInterface
> SAL_CALL
createInstanceWithArguments( const Sequence
< Any
>& aArguments
) override
;
184 virtual void SAL_CALL
dispose( ) override
;
185 virtual void SAL_CALL
addEventListener( const Reference
< XEventListener
>& xListener
) override
;
186 virtual void SAL_CALL
removeEventListener( const Reference
< XEventListener
>& aListener
) override
;
189 virtual Reference
<XPropertySetInfo
> SAL_CALL
getPropertySetInfo() override
;
190 virtual void SAL_CALL
setPropertyValue( const OUString
& aPropertyName
, const Any
& aValue
) override
;
191 virtual Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) override
;
192 virtual void SAL_CALL
addPropertyChangeListener( const OUString
& aPropertyName
, const Reference
<XPropertyChangeListener
>& xListener
) override
;
193 virtual void SAL_CALL
removePropertyChangeListener( const OUString
& aPropertyName
, const Reference
<XPropertyChangeListener
>& aListener
) override
;
194 virtual void SAL_CALL
addVetoableChangeListener(const OUString
& PropertyName
, const Reference
<XVetoableChangeListener
>& aListener
) override
;
195 virtual void SAL_CALL
removeVetoableChangeListener(const OUString
& PropertyName
,const Reference
<XVetoableChangeListener
>&aListener
) override
;
198 virtual void SAL_CALL
reset() override
;
199 virtual void SAL_CALL
addResetListener( const Reference
<form::XResetListener
>& aListener
) override
;
200 virtual void SAL_CALL
removeResetListener( const Reference
<form::XResetListener
>& aListener
) override
;
202 TableDesignStyleVector maDesigns
;
207 TableDesignStyle::TableDesignStyle()
208 : mbUserDefined(true)
213 const CellStyleNameMap
& TableDesignStyle::getCellStyleNameMap()
215 static CellStyleNameMap
const aMap
217 { u
"first-row"_ustr
, first_row_style
},
218 { u
"last-row"_ustr
, last_row_style
},
219 { u
"first-column"_ustr
, first_column_style
},
220 { u
"last-column"_ustr
, last_column_style
},
221 { u
"body"_ustr
, body_style
},
222 { u
"even-rows"_ustr
, even_rows_style
},
223 { u
"odd-rows"_ustr
, odd_rows_style
},
224 { u
"even-columns"_ustr
, even_columns_style
},
225 { u
"odd-columns"_ustr
, odd_columns_style
},
226 { u
"background"_ustr
, background_style
},
233 OUString SAL_CALL
TableDesignStyle::getImplementationName()
235 return u
"TableDesignStyle"_ustr
;
238 sal_Bool SAL_CALL
TableDesignStyle::supportsService( const OUString
& ServiceName
)
240 return cppu::supportsService( this, ServiceName
);
243 Sequence
< OUString
> SAL_CALL
TableDesignStyle::getSupportedServiceNames()
245 return { u
"com.sun.star.style.Style"_ustr
};
249 sal_Bool SAL_CALL
TableDesignStyle::isUserDefined()
251 return mbUserDefined
;
254 void TableDesignStyle::resetUserDefined()
256 mbUserDefined
= false;
259 sal_Bool SAL_CALL
TableDesignStyle::isInUse()
261 std::unique_lock
aGuard( m_aMutex
);
262 if (maModifyListeners
.getLength(aGuard
))
264 comphelper::OInterfaceIteratorHelper4
it(aGuard
, maModifyListeners
);
265 while ( it
.hasMoreElements() )
267 SdrTableObjImpl
* pUser
= dynamic_cast< SdrTableObjImpl
* >( it
.next().get() );
268 if( pUser
&& pUser
->isInUse() )
276 OUString SAL_CALL
TableDesignStyle::getParentStyle()
282 void SAL_CALL
TableDesignStyle::setParentStyle( const OUString
& )
290 OUString SAL_CALL
TableDesignStyle::getName()
296 void SAL_CALL
TableDesignStyle::setName( const OUString
& rName
)
305 Any SAL_CALL
TableDesignStyle::getByName( const OUString
& rName
)
307 const CellStyleNameMap
& rMap
= getCellStyleNameMap();
309 CellStyleNameMap::const_iterator iter
= rMap
.find( rName
);
310 if( iter
== rMap
.end() )
311 throw NoSuchElementException();
313 return Any( maCellStyles
[(*iter
).second
] );
317 Sequence
< OUString
> SAL_CALL
TableDesignStyle::getElementNames()
319 return comphelper::mapKeysToSequence( getCellStyleNameMap() );
323 sal_Bool SAL_CALL
TableDesignStyle::hasByName( const OUString
& rName
)
325 const CellStyleNameMap
& rMap
= getCellStyleNameMap();
327 CellStyleNameMap::const_iterator iter
= rMap
.find( rName
);
328 return iter
!= rMap
.end();
335 Type SAL_CALL
TableDesignStyle::getElementType()
337 return cppu::UnoType
<XStyle
>::get();
341 sal_Bool SAL_CALL
TableDesignStyle::hasElements()
350 sal_Int32 SAL_CALL
TableDesignStyle::getCount()
356 Any SAL_CALL
TableDesignStyle::getByIndex( sal_Int32 Index
)
358 if( (Index
< 0) || (Index
>= style_count
) )
359 throw IndexOutOfBoundsException();
361 std::unique_lock
aGuard( m_aMutex
);
362 return Any( maCellStyles
[Index
] );
368 void SAL_CALL
TableDesignStyle::replaceByIndex( sal_Int32 Index
, const Any
& aElement
)
370 if( (Index
< 0) || (Index
>= style_count
) )
371 throw IndexOutOfBoundsException();
373 const CellStyleNameMap
& rMap
= getCellStyleNameMap();
374 auto iter
= std::find_if(rMap
.begin(), rMap
.end(),
375 [&Index
](const auto& item
) { return Index
== item
.second
; });
376 if (iter
!= rMap
.end())
377 replaceByName(iter
->first
, aElement
);
384 void SAL_CALL
TableDesignStyle::replaceByName( const OUString
& rName
, const Any
& aElement
)
386 const CellStyleNameMap
& rMap
= getCellStyleNameMap();
387 CellStyleNameMap::const_iterator iter
= rMap
.find( rName
);
388 if( iter
== rMap
.end() )
389 throw NoSuchElementException();
392 Reference
< XStyle
> xNewStyle
;
393 if( !(aElement
>>= xNewStyle
) )
394 throw IllegalArgumentException();
396 const sal_Int32 nIndex
= (*iter
).second
;
398 std::unique_lock
aGuard( m_aMutex
);
400 Reference
< XStyle
> xOldStyle( maCellStyles
[nIndex
] );
402 if( xNewStyle
== xOldStyle
)
405 Reference
< XModifyListener
> xListener( this );
407 // end listening to old style, if possible
408 Reference
< XModifyBroadcaster
> xOldBroadcaster( xOldStyle
, UNO_QUERY
);
409 if( xOldBroadcaster
.is() )
410 xOldBroadcaster
->removeModifyListener( xListener
);
412 // start listening to new style, if possible
413 Reference
< XModifyBroadcaster
> xNewBroadcaster( xNewStyle
, UNO_QUERY
);
414 if( xNewBroadcaster
.is() )
415 xNewBroadcaster
->addModifyListener( xListener
);
417 if (xNewStyle
&& xNewStyle
->isUserDefined())
420 maCellStyles
[nIndex
] = std::move(xNewStyle
);
427 void TableDesignStyle::disposing(std::unique_lock
<std::mutex
>& aGuard
)
429 maModifyListeners
.disposeAndClear(aGuard
, EventObject(Reference
<XComponent
>(this)));
431 for(Reference
<XStyle
> & rCellStyle
: maCellStyles
)
433 Reference
<XModifyBroadcaster
> xBroadcaster(rCellStyle
, UNO_QUERY
);
435 xBroadcaster
->removeModifyListener(this);
442 Reference
<XPropertySetInfo
> TableDesignStyle::getPropertySetInfo()
447 void TableDesignStyle::setPropertyValue( const OUString
&, const Any
& )
451 Any
TableDesignStyle::getPropertyValue( const OUString
& PropertyName
)
453 if (PropertyName
!= "IsPhysical")
454 throw UnknownPropertyException("unknown property: " + PropertyName
, getXWeak());
456 return Any(mbModified
|| mbUserDefined
);
459 void TableDesignStyle::addPropertyChangeListener( const OUString
&, const Reference
<XPropertyChangeListener
>& )
463 void TableDesignStyle::removePropertyChangeListener( const OUString
&, const Reference
<XPropertyChangeListener
>& )
467 void TableDesignStyle::addVetoableChangeListener( const OUString
&, const Reference
<XVetoableChangeListener
>& )
471 void TableDesignStyle::removeVetoableChangeListener( const OUString
&,const Reference
<XVetoableChangeListener
>& )
477 sal_Bool
TableDesignStyle::isModified()
482 void TableDesignStyle::setModified( sal_Bool bModified
)
484 mbModified
= bModified
;
485 notifyModifyListener();
489 // XModifyBroadcaster
492 void SAL_CALL
TableDesignStyle::addModifyListener( const Reference
< XModifyListener
>& xListener
)
494 std::unique_lock
aGuard( m_aMutex
);
498 EventObject
aEvt( getXWeak() );
499 xListener
->disposing( aEvt
);
503 maModifyListeners
.addInterface( aGuard
, xListener
);
508 void SAL_CALL
TableDesignStyle::removeModifyListener( const Reference
< XModifyListener
>& xListener
)
510 std::unique_lock
aGuard( m_aMutex
);
511 maModifyListeners
.removeInterface( aGuard
, xListener
);
515 void TableDesignStyle::notifyModifyListener()
517 std::unique_lock
aGuard( m_aMutex
);
519 if( maModifyListeners
.getLength(aGuard
) )
521 EventObject
aEvt( getXWeak() );
522 maModifyListeners
.forEach(aGuard
,
523 [&] (Reference
<XModifyListener
> const& xListener
)
524 { return xListener
->modified(aEvt
); });
532 // if we get a modify hint from a style, notify all registered XModifyListener
533 void SAL_CALL
TableDesignStyle::modified( const css::lang::EventObject
& )
535 notifyModifyListener();
539 void SAL_CALL
TableDesignStyle::disposing( const css::lang::EventObject
& )
548 OUString SAL_CALL
TableDesignFamily::getImplementationName()
550 return u
"TableDesignFamily"_ustr
;
553 sal_Bool SAL_CALL
TableDesignFamily::supportsService( const OUString
& ServiceName
)
555 return cppu::supportsService( this, ServiceName
);
558 Sequence
< OUString
> SAL_CALL
TableDesignFamily::getSupportedServiceNames()
560 return { u
"com.sun.star.style.StyleFamily"_ustr
};
564 OUString SAL_CALL
TableDesignFamily::getName()
566 return u
"table"_ustr
;
569 void SAL_CALL
TableDesignFamily::setName( const OUString
& )
574 Any SAL_CALL
TableDesignFamily::getByName( const OUString
& rName
)
576 SolarMutexGuard aGuard
;
578 auto iter
= std::find_if(maDesigns
.begin(), maDesigns
.end(),
579 [&rName
](const Reference
<XStyle
>& rpStyle
) { return rpStyle
->getName() == rName
; });
580 if (iter
!= maDesigns
.end())
581 return Any( (*iter
) );
583 throw NoSuchElementException();
587 Sequence
< OUString
> SAL_CALL
TableDesignFamily::getElementNames()
589 SolarMutexGuard aGuard
;
591 Sequence
< OUString
> aRet( maDesigns
.size() );
592 OUString
* pNames
= aRet
.getArray();
594 for( const auto& rpStyle
: maDesigns
)
595 *pNames
++ = rpStyle
->getName();
601 sal_Bool SAL_CALL
TableDesignFamily::hasByName( const OUString
& aName
)
603 SolarMutexGuard aGuard
;
605 return std::any_of(maDesigns
.begin(), maDesigns
.end(),
606 [&aName
](const Reference
<XStyle
>& rpStyle
) { return rpStyle
->getName() == aName
; });
613 Type SAL_CALL
TableDesignFamily::getElementType()
615 return cppu::UnoType
<XStyle
>::get();
619 sal_Bool SAL_CALL
TableDesignFamily::hasElements()
621 SolarMutexGuard aGuard
;
623 return !maDesigns
.empty();
630 sal_Int32 SAL_CALL
TableDesignFamily::getCount()
632 SolarMutexGuard aGuard
;
634 return sal::static_int_cast
< sal_Int32
>( maDesigns
.size() );
638 Any SAL_CALL
TableDesignFamily::getByIndex( sal_Int32 Index
)
640 SolarMutexGuard aGuard
;
642 if( (Index
>= 0) && (Index
< sal::static_int_cast
< sal_Int32
>( maDesigns
.size() ) ) )
643 return Any( maDesigns
[Index
] );
645 throw IndexOutOfBoundsException();
652 void SAL_CALL
TableDesignFamily::insertByName( const OUString
& rName
, const Any
& rElement
)
654 SolarMutexGuard aGuard
;
656 Reference
< XStyle
> xStyle( rElement
, UNO_QUERY
);
658 throw IllegalArgumentException();
660 xStyle
->setName( rName
);
661 if (std::any_of(maDesigns
.begin(), maDesigns
.end(),
662 [&rName
](const Reference
<XStyle
>& rpStyle
) { return rpStyle
->getName() == rName
; }))
663 throw ElementExistException();
665 maDesigns
.push_back( xStyle
);
669 void SAL_CALL
TableDesignFamily::removeByName( const OUString
& rName
)
671 SolarMutexGuard aGuard
;
673 auto iter
= std::find_if(maDesigns
.begin(), maDesigns
.end(),
674 [&rName
](const Reference
<XStyle
>& rpStyle
) { return rpStyle
->getName() == rName
; });
675 if (iter
!= maDesigns
.end())
677 Reference
<XComponent
> xComponent(*iter
, UNO_QUERY
);
679 xComponent
->dispose();
680 maDesigns
.erase( iter
);
684 throw NoSuchElementException();
691 void SAL_CALL
TableDesignFamily::replaceByName( const OUString
& rName
, const Any
& aElement
)
693 SolarMutexGuard aGuard
;
695 Reference
< XStyle
> xStyle( aElement
, UNO_QUERY
);
697 throw IllegalArgumentException();
699 auto iter
= std::find_if(maDesigns
.begin(), maDesigns
.end(),
700 [&rName
](const Reference
<XStyle
>& rpStyle
) { return rpStyle
->getName() == rName
; });
701 if (iter
!= maDesigns
.end())
703 if (!(*iter
)->isUserDefined())
704 static_cast<TableDesignStyle
*>(xStyle
.get())->resetUserDefined();
706 Reference
<XComponent
> xComponent(*iter
, UNO_QUERY
);
708 xComponent
->dispose();
710 xStyle
->setName( rName
);
714 throw NoSuchElementException();
718 // XSingleServiceFactory
721 Reference
< XInterface
> SAL_CALL
TableDesignFamily::createInstance()
723 return Reference
< XInterface
>( static_cast< XStyle
* >( new TableDesignStyle
) );
727 Reference
< XInterface
> SAL_CALL
TableDesignFamily::createInstanceWithArguments( const Sequence
< Any
>& )
729 return createInstance();
736 void SAL_CALL
TableDesignFamily::dispose( )
738 TableDesignStyleVector aDesigns
;
739 aDesigns
.swap( maDesigns
);
741 for( const auto& rStyle
: aDesigns
)
743 Reference
< XComponent
> xComp( rStyle
, UNO_QUERY
);
750 void SAL_CALL
TableDesignFamily::addEventListener( const Reference
< XEventListener
>& )
755 void SAL_CALL
TableDesignFamily::removeEventListener( const Reference
< XEventListener
>& )
763 Reference
<XPropertySetInfo
> TableDesignFamily::getPropertySetInfo()
765 OSL_FAIL( "###unexpected!" );
766 return Reference
<XPropertySetInfo
>();
770 void TableDesignFamily::setPropertyValue( const OUString
& , const Any
& )
772 OSL_FAIL( "###unexpected!" );
776 Any
TableDesignFamily::getPropertyValue( const OUString
& PropertyName
)
778 if ( PropertyName
!= "DisplayName" )
780 throw UnknownPropertyException( "unknown property: " + PropertyName
, getXWeak() );
783 OUString
sDisplayName( SvxResId( RID_SVXSTR_STYLEFAMILY_TABLEDESIGN
) );
784 return Any( sDisplayName
);
788 void TableDesignFamily::addPropertyChangeListener( const OUString
& , const Reference
<XPropertyChangeListener
>& )
790 OSL_FAIL( "###unexpected!" );
794 void TableDesignFamily::removePropertyChangeListener( const OUString
& , const Reference
<XPropertyChangeListener
>& )
796 OSL_FAIL( "###unexpected!" );
800 void TableDesignFamily::addVetoableChangeListener( const OUString
& , const Reference
<XVetoableChangeListener
>& )
802 OSL_FAIL( "###unexpected!" );
806 void TableDesignFamily::removeVetoableChangeListener( const OUString
& , const Reference
<XVetoableChangeListener
>& )
808 OSL_FAIL( "###unexpected!" );
813 void TableDesignFamily::reset()
815 for (const auto& aDesign
: maDesigns
)
817 auto aStyle
= static_cast<TableDesignStyle
*>(aDesign
.get());
818 aStyle
->resetUserDefined();
819 aStyle
->setModified(false);
823 void TableDesignFamily::addResetListener( const Reference
<form::XResetListener
>& )
827 void TableDesignFamily::removeResetListener( const Reference
<form::XResetListener
>& )
831 Reference
< XNameAccess
> CreateTableDesignFamily()
833 return new TableDesignFamily
;
838 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */