diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-11-19 16:32:49 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-11-22 12:57:32 +0100 |
commit | f853ec317f6af1b8c65cc5bd758371689c75118d (patch) | |
tree | b86d729bf9a9465ee619ead3b5635efa62a1804e /sc/source/ui/vba | |
parent | f31d36966bceb90e261cbecd42634bde4448d527 (diff) |
Extend loplugin:external to warn about classes
...following up on 314f15bff08b76bf96acf99141776ef64d2f1355 "Extend
loplugin:external to warn about enums".
Cases where free functions were moved into an unnamed namespace along with a
class, to not break ADL, are in:
filter/source/svg/svgexport.cxx
sc/source/filter/excel/xelink.cxx
sc/source/filter/excel/xilink.cxx
svx/source/sdr/contact/viewobjectcontactofunocontrol.cxx
All other free functions mentioning moved classes appear to be harmless and not
give rise to (silent, even) ADL breakage. (One remaining TODO in
compilerplugins/clang/external.cxx is that derived classes are not covered by
computeAffectedTypes, even though they could also be affected by ADL-breakage---
but don't seem to be in any acutal case across the code base.)
For friend declarations using elaborate type specifiers, like
class C1 {};
class C2 { friend class C1; };
* If C2 (but not C1) is moved into an unnamed namespace, the friend declaration
must be changed to not use an elaborate type specifier (i.e., "friend C1;"; see
C++17 [namespace.memdef]/3: "If the name in a friend declaration is neither
qualified nor a template-id and the declaration is a function or an
elaborated-type-specifier, the lookup to determine whether the entity has been
previously declared shall not consider any scopes outside the innermost
enclosing namespace.")
* If C1 (but not C2) is moved into an unnamed namespace, the friend declaration
must be changed too, see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71882>
"elaborated-type-specifier friend not looked up in unnamed namespace".
Apart from that, to keep changes simple and mostly mechanical (which should help
avoid regressions), out-of-line definitions of class members have been left in
the enclosing (named) namespace. But explicit specializations of class
templates had to be moved into the unnamed namespace to appease
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92598> "explicit specialization of
template from unnamed namespace using unqualified-id in enclosing namespace".
Also, accompanying declarations (of e.g. typedefs or static variables) that
could arguably be moved into the unnamed namespace too have been left alone.
And in some cases, mention of affected types in blacklists in other loplugins
needed to be adapted.
And sc/qa/unit/mark_test.cxx uses a hack of including other .cxx, one of which
is sc/source/core/data/segmenttree.cxx where e.g. ScFlatUInt16SegmentsImpl is
not moved into an unnamed namespace (because it is declared in
sc/inc/segmenttree.hxx), but its base ScFlatSegmentsImpl is. GCC warns about
such combinations with enabled-by-default -Wsubobject-linkage, but "The compiler
doesn’t give this warning for types defined in the main .C file, as those are
unlikely to have multiple definitions."
(<https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Warning-Options.html>) The
warned-about classes also don't have multiple definitions in the given test, so
disable the warning when including the .cxx.
Change-Id: Ib694094c0d8168be68f8fe90dfd0acbb66a3f1e4
Reviewed-on: https://gerrit.libreoffice.org/83239
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sc/source/ui/vba')
-rw-r--r-- | sc/source/ui/vba/excelvbahelper.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaapplication.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaborders.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/vba/vbachartobjects.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbacomments.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbafiledialogitems.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbamenubars.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbamenuitems.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbamenus.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbanames.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbapagebreaks.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/vba/vbapalette.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbapivottables.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 28 | ||||
-rw-r--r-- | sc/source/ui/vba/vbasheetobjects.cxx | 12 | ||||
-rw-r--r-- | sc/source/ui/vba/vbawindow.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbawindows.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworkbooks.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworksheets.cxx | 4 |
19 files changed, 121 insertions, 0 deletions
diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index 3a1e025bd717..b1f98144fd93 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -110,6 +110,8 @@ void implSetZoom( const uno::Reference< frame::XModel >& xModel, sal_Int16 nZoom const OUString REPLACE_CELLS_WARNING( "ReplaceCellsWarning"); +namespace { + class PasteCellsWarningReseter { private: @@ -154,6 +156,8 @@ public: } }; +} + void implnPaste( const uno::Reference< frame::XModel>& xModel ) { diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 4c09ace2e90c..877020e061c5 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -115,6 +115,8 @@ ScVbaAppSettings::ScVbaAppSettings() : { } +namespace { + struct ScVbaStaticAppSettings : public ::rtl::Static< ScVbaAppSettings, ScVbaStaticAppSettings > {}; class ScVbaApplicationOutgoingConnectionPoint : public cppu::WeakImplHelper<XConnectionPoint> @@ -130,6 +132,8 @@ public: void SAL_CALL Unadvise( sal_uInt32 Cookie ) override; }; +} + sal_uInt32 ScVbaApplication::AddSink( const uno::Reference< XSink >& xSink ) { diff --git a/sc/source/ui/vba/vbaborders.cxx b/sc/source/ui/vba/vbaborders.cxx index 815f007676fa..406cea8a410b 100644 --- a/sc/source/ui/vba/vbaborders.cxx +++ b/sc/source/ui/vba/vbaborders.cxx @@ -49,6 +49,8 @@ const static sal_Int32 OOLineMedium = 88; const static sal_Int32 OOLineThick = 141; const static sal_Int32 OOLineHairline = 2; +namespace { + class ScVbaBorder : public ScVbaBorder_Base { private: @@ -350,12 +352,16 @@ public: } }; +} + static uno::Reference< container::XIndexAccess > rangeToBorderIndexAccess( const uno::Reference< table::XCellRange >& xRange, const uno::Reference< uno::XComponentContext > & xContext, const ScVbaPalette& rPalette ) { return new RangeBorders( xRange, xContext, rPalette ); } +namespace { + class RangeBorderEnumWrapper : public EnumerationHelper_BASE { uno::Reference<container::XIndexAccess > m_xIndexAccess; @@ -375,6 +381,8 @@ public: } }; +} + ScVbaBorders::ScVbaBorders( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< table::XCellRange >& xRange, diff --git a/sc/source/ui/vba/vbachartobjects.cxx b/sc/source/ui/vba/vbachartobjects.cxx index 1ded0545c49e..dabe9a1a06dd 100644 --- a/sc/source/ui/vba/vbachartobjects.cxx +++ b/sc/source/ui/vba/vbachartobjects.cxx @@ -35,6 +35,8 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; +namespace { + class ChartObjectEnumerationImpl : public EnumerationHelperImpl { uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier; @@ -76,6 +78,8 @@ public: } }; +} + ScVbaChartObjects::ScVbaChartObjects( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::table::XTableCharts >& _xTableCharts, const uno::Reference< drawing::XDrawPageSupplier >& _xDrawPageSupplier ) : ChartObjects_BASE(_xParent, _xContext, css::uno::Reference< css::container::XIndexAccess >( _xTableCharts, css::uno::UNO_QUERY ) ), xTableCharts( _xTableCharts ) , xDrawPageSupplier( _xDrawPageSupplier ) { diff --git a/sc/source/ui/vba/vbacomments.cxx b/sc/source/ui/vba/vbacomments.cxx index a1b2001c522a..b8d933fc8378 100644 --- a/sc/source/ui/vba/vbacomments.cxx +++ b/sc/source/ui/vba/vbacomments.cxx @@ -38,6 +38,8 @@ static uno::Any AnnotationToComment( const uno::Any& aSource, const uno::Referen new ScVbaComment( uno::Reference< XHelperInterface >(), xContext, xModel, xCellRange ) ) ); } +namespace { + class CommentEnumeration : public EnumerationHelperImpl { css::uno::Reference< css::frame::XModel > mxModel; @@ -59,6 +61,8 @@ public: }; +} + ScVbaComments::ScVbaComments( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, diff --git a/sc/source/ui/vba/vbafiledialogitems.cxx b/sc/source/ui/vba/vbafiledialogitems.cxx index 66d6ea976b2a..14c7853ee178 100644 --- a/sc/source/ui/vba/vbafiledialogitems.cxx +++ b/sc/source/ui/vba/vbafiledialogitems.cxx @@ -21,6 +21,8 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; +namespace { + class FileDialogItemEnumeration : public ::cppu::WeakImplHelper< container::XEnumeration > { std::vector< OUString > m_sItems; @@ -40,6 +42,8 @@ public: } }; +} + ScVbaFileDialogSelectedItems::ScVbaFileDialogSelectedItems( const css::uno::Reference< ov::XHelperInterface >& xParent ,const css::uno::Reference< css::uno::XComponentContext >& xContext diff --git a/sc/source/ui/vba/vbamenubars.cxx b/sc/source/ui/vba/vbamenubars.cxx index c521cf562920..5e84e72139c0 100644 --- a/sc/source/ui/vba/vbamenubars.cxx +++ b/sc/source/ui/vba/vbamenubars.cxx @@ -15,6 +15,8 @@ using namespace com::sun::star; using namespace ooo::vba; +namespace { + class MenuBarEnumeration : public ::cppu::WeakImplHelper< container::XEnumeration > { uno::Reference< XHelperInterface > m_xParent; @@ -41,6 +43,8 @@ public: } }; +} + ScVbaMenuBars::ScVbaMenuBars( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBars >& xCommandBars ) : MenuBars_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBars( xCommandBars ) { } diff --git a/sc/source/ui/vba/vbamenuitems.cxx b/sc/source/ui/vba/vbamenuitems.cxx index c64fefb9e6a1..fb7271ef3f21 100644 --- a/sc/source/ui/vba/vbamenuitems.cxx +++ b/sc/source/ui/vba/vbamenuitems.cxx @@ -18,6 +18,8 @@ using namespace ooo::vba; typedef ::cppu::WeakImplHelper< container::XEnumeration > MenuEnumeration_BASE; +namespace { + class MenuEnumeration : public MenuEnumeration_BASE { uno::Reference< XHelperInterface > m_xParent; @@ -55,6 +57,8 @@ public: } }; +} + ScVbaMenuItems::ScVbaMenuItems( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) : MenuItems_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls ) { } diff --git a/sc/source/ui/vba/vbamenus.cxx b/sc/source/ui/vba/vbamenus.cxx index 84c001d9adec..f6b33fd89603 100644 --- a/sc/source/ui/vba/vbamenus.cxx +++ b/sc/source/ui/vba/vbamenus.cxx @@ -17,6 +17,8 @@ using namespace ooo::vba; typedef ::cppu::WeakImplHelper< container::XEnumeration > MenuEnumeration_BASE; +namespace { + class MenuEnumeration : public MenuEnumeration_BASE { uno::Reference< XHelperInterface > m_xParent; @@ -49,6 +51,8 @@ public: } }; +} + ScVbaMenus::ScVbaMenus( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< XCommandBarControls >& xCommandBarControls ) : Menus_BASE( xParent, xContext, uno::Reference< container::XIndexAccess>() ), m_xCommandBarControls( xCommandBarControls ) { } diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx index 357067363074..6f2c2c5a255a 100644 --- a/sc/source/ui/vba/vbanames.cxx +++ b/sc/source/ui/vba/vbanames.cxx @@ -37,6 +37,8 @@ using namespace ::ooo::vba; using namespace ::com::sun::star; +namespace { + class NamesEnumeration : public EnumerationHelperImpl { uno::Reference< frame::XModel > m_xModel; @@ -53,6 +55,8 @@ public: }; +} + ScVbaNames::ScVbaNames(const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::sheet::XNamedRanges >& xNames, diff --git a/sc/source/ui/vba/vbapagebreaks.cxx b/sc/source/ui/vba/vbapagebreaks.cxx index 3da93b39c235..6fafa9ec1420 100644 --- a/sc/source/ui/vba/vbapagebreaks.cxx +++ b/sc/source/ui/vba/vbapagebreaks.cxx @@ -29,6 +29,8 @@ using namespace ::com::sun::star; using namespace ::ooo::vba; +namespace { + class RangePageBreaks : public ::cppu::WeakImplHelper<container::XIndexAccess > { private: @@ -102,6 +104,8 @@ public: } }; +} + /** @TODO Unlike MS Excel this method only considers the pagebreaks that intersect the used range * To become completely compatible the print area has to be considered. As far as I found out this printarea * also considers the position and sizes of shapes and manually inserted page breaks @@ -184,6 +188,8 @@ uno::Any RangePageBreaks::Add( const css::uno::Any& Before ) return uno::makeAny( uno::Reference< excel::XHPageBreak >( new ScVbaHPageBreak( mxParent, mxContext, xRowColPropertySet, aTablePageBreakData) )); } +namespace { + class RangePageBreaksEnumWrapper : public EnumerationHelper_BASE { uno::Reference<container::XIndexAccess > m_xIndexAccess; @@ -203,6 +209,8 @@ public: } }; +} + ScVbaHPageBreaks::ScVbaHPageBreaks( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< sheet::XSheetPageBreak >& xSheetPageBreak): diff --git a/sc/source/ui/vba/vbapalette.cxx b/sc/source/ui/vba/vbapalette.cxx index 36b658a2e596..86bbc1031f15 100644 --- a/sc/source/ui/vba/vbapalette.cxx +++ b/sc/source/ui/vba/vbapalette.cxx @@ -51,6 +51,8 @@ static const Color spnDefColorTable8[] = typedef ::cppu::WeakImplHelper< container::XIndexAccess > XIndexAccess_BASE; +namespace { + class DefaultPalette : public XIndexAccess_BASE { public: @@ -81,6 +83,8 @@ public: }; +} + ScVbaPalette::ScVbaPalette( const uno::Reference< frame::XModel >& rxModel ) : m_pShell( excel::getDocShell( rxModel ) ) { diff --git a/sc/source/ui/vba/vbapivottables.cxx b/sc/source/ui/vba/vbapivottables.cxx index 383faf3ee2b9..8dad4b638624 100644 --- a/sc/source/ui/vba/vbapivottables.cxx +++ b/sc/source/ui/vba/vbapivottables.cxx @@ -30,6 +30,8 @@ static uno::Any DataPilotToPivotTable( const uno::Any& aSource, const uno::Refer return uno::makeAny( uno::Reference< excel::XPivotTable > ( new ScVbaPivotTable( xContext, xTable ) ) ); } +namespace { + class PivotTableEnumeration : public EnumerationHelperImpl { public: @@ -43,6 +45,8 @@ public: }; +} + ScVbaPivotTables::ScVbaPivotTables( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xIndexAccess ): ScVbaPivotTables_BASE( xParent, xContext, xIndexAccess ) { } diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 7b049cb1c6ca..6233f5c5aaa0 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -269,6 +269,8 @@ void ScVbaRange::fireChangeEvent() } } +namespace { + class SingleRangeEnumeration : public EnumerationHelper_BASE { uno::Reference< table::XCellRange > m_xRange; @@ -347,6 +349,8 @@ public: }; +} + uno::Reference< container::XEnumeration > SAL_CALL ScVbaRangeAreas::createEnumeration() { @@ -472,6 +476,8 @@ const ScRangeList& ScVbaRange::getScRangeList( const uno::Reference< excel::XRan throw uno::RuntimeException("Cannot obtain VBA range implementation object" ); } +namespace { + class NumFormatHelper { uno::Reference< util::XNumberFormatsSupplier > mxSupplier; @@ -576,9 +582,13 @@ sal_Int32 const m_nCol; sal_Int32 const m_nArea; }; +} + typedef ::cppu::WeakImplHelper< container::XEnumeration > CellsEnumeration_BASE; typedef ::std::vector< CellPos > vCellPos; +namespace { + // #FIXME - QUICK // we could probably could and should modify CellsEnumeration below // to handle rows and columns (but I do this separately for now @@ -661,6 +671,8 @@ public: } }; +} + static const char ISVISIBLE[] = "IsVisible"; static const char EQUALS[] = "="; static const char NOTEQUALS[] = "<>"; @@ -671,6 +683,8 @@ static const char LESSTHANEQUALS[] = "<="; static const char STR_ERRORMESSAGE_APPLIESTOSINGLERANGEONLY[] = "The command you chose cannot be performed with multiple selections.\nSelect a single range and click the command again"; static const char CELLSTYLE[] = "CellStyle"; +namespace { + class CellValueSetter : public ValueSetter { protected: @@ -682,6 +696,8 @@ public: }; +} + CellValueSetter::CellValueSetter( const uno::Any& aValue ): maValue( aValue ) {} void @@ -765,6 +781,8 @@ CellValueSetter::processValue( const uno::Any& aValue, const uno::Reference< tab } +namespace { + class CellValueGetter : public ValueGetter { protected: @@ -777,6 +795,8 @@ public: }; +} + void CellValueGetter::processValue( const uno::Any& aValue ) { @@ -833,6 +853,8 @@ void CellValueGetter::visitNode( sal_Int32 /*x*/, sal_Int32 /*y*/, const uno::Re processValue( aValue ); } +namespace { + class CellFormulaValueSetter : public CellValueSetter { private: @@ -946,8 +968,12 @@ public: }; +} + static const char sNA[] = "#N/A"; +namespace { + class Dim1ArrayValueSetter : public ArrayVisitor { uno::Sequence< uno::Any > aMatrix; @@ -1117,6 +1143,8 @@ public: }; +} + bool ScVbaRange::getCellRangesForAddress( ScRefFlags& rResFlags, const OUString& sAddress, ScDocShell* pDocSh, ScRangeList& rCellRanges, formula::FormulaGrammar::AddressConvention eConv, char cDelimiter ) { diff --git a/sc/source/ui/vba/vbasheetobjects.cxx b/sc/source/ui/vba/vbasheetobjects.cxx index 2d8568526039..672c638c37c1 100644 --- a/sc/source/ui/vba/vbasheetobjects.cxx +++ b/sc/source/ui/vba/vbasheetobjects.cxx @@ -267,6 +267,8 @@ void ScVbaObjectContainer::implOnShapeCreated( const uno::Reference< drawing::XS { } +namespace { + class ScVbaObjectEnumeration : public SimpleEnumerationBase { public: @@ -277,6 +279,8 @@ private: ScVbaObjectContainerRef mxContainer; }; +} + ScVbaObjectEnumeration::ScVbaObjectEnumeration( const ScVbaObjectContainerRef& rxContainer ) : SimpleEnumerationBase( rxContainer.get() ), mxContainer( rxContainer ) @@ -362,6 +366,8 @@ uno::Any SAL_CALL ScVbaGraphicObjectsBase::Add( const uno::Any& rLeft, const uno // Drawing controls +namespace { + class ScVbaControlContainer : public ScVbaObjectContainer { public: @@ -391,6 +397,8 @@ protected: sal_Int16 /* css::form::FormComponentType */ meType; }; +} + ScVbaControlContainer::ScVbaControlContainer( const uno::Reference< XHelperInterface >& rxParent, const uno::Reference< uno::XComponentContext >& rxContext, @@ -475,6 +483,8 @@ void ScVbaControlContainer::implOnShapeCreated( const uno::Reference< drawing::X // Push button +namespace { + class ScVbaButtonContainer : public ScVbaControlContainer { bool mbOptionButtons; @@ -492,6 +502,8 @@ protected: virtual bool implCheckProperties( const uno::Reference< beans::XPropertySet >& rxModelProps ) const override; }; +} + ScVbaButtonContainer::ScVbaButtonContainer( const uno::Reference< XHelperInterface >& rxParent, const uno::Reference< uno::XComponentContext >& rxContext, diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx index fd07496d5f1a..34e2e95d54b3 100644 --- a/sc/source/ui/vba/vbawindow.cxx +++ b/sc/source/ui/vba/vbawindow.cxx @@ -62,6 +62,8 @@ typedef ::cppu::WeakImplHelper< container::XEnumerationAccess , css::container::XNameAccess > SelectedSheets_BASE; +namespace { + class SelectedSheetsEnum : public ::cppu::WeakImplHelper< container::XEnumeration > { public: @@ -182,6 +184,8 @@ public: }; +} + ScVbaWindow::ScVbaWindow( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, diff --git a/sc/source/ui/vba/vbawindows.cxx b/sc/source/ui/vba/vbawindows.cxx index 648109031e46..b9b869f60412 100644 --- a/sc/source/ui/vba/vbawindows.cxx +++ b/sc/source/ui/vba/vbawindows.cxx @@ -51,6 +51,9 @@ static uno::Any ComponentToWindow( const uno::Any& aSource, const uno::Reference } typedef std::vector < uno::Reference< sheet::XSpreadsheetDocument > > Components; + +namespace { + // #TODO more or less the same as class in workwindows ( code sharing needed ) class WindowComponentEnumImpl : public EnumerationHelper_BASE { @@ -106,11 +109,15 @@ public: } }; +} + typedef ::cppu::WeakImplHelper< container::XEnumerationAccess , css::container::XIndexAccess , css::container::XNameAccess > WindowsAccessImpl_BASE; +namespace { + class WindowsAccessImpl : public WindowsAccessImpl_BASE { uno::Reference< uno::XComponentContext > m_xContext; @@ -192,6 +199,8 @@ public: }; +} + ScVbaWindows::ScVbaWindows( const uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext ) : ScVbaWindows_BASE( xParent, xContext, uno::Reference< container::XIndexAccess > ( new WindowsAccessImpl( xContext ) ) ) { } diff --git a/sc/source/ui/vba/vbaworkbooks.cxx b/sc/source/ui/vba/vbaworkbooks.cxx index b5a53c772930..61edd810ba9c 100644 --- a/sc/source/ui/vba/vbaworkbooks.cxx +++ b/sc/source/ui/vba/vbaworkbooks.cxx @@ -56,6 +56,8 @@ getWorkbook( const uno::Reference< uno::XComponentContext >& xContext, return uno::Any( uno::Reference< excel::XWorkbook > (pWb) ); } +namespace { + class WorkBookEnumImpl : public EnumerationHelperImpl { public: @@ -70,6 +72,8 @@ public: }; +} + ScVbaWorkbooks::ScVbaWorkbooks( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext >& xContext ) : ScVbaWorkbooks_BASE( xParent, xContext, VbaDocumentsBase::EXCEL_DOCUMENT ) { } diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index d2c6a882658c..5e6e384433c5 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -49,6 +49,8 @@ typedef std::vector< uno::Reference< sheet::XSpreadsheet > > SheetMap; // #FIXME #TODO the implementation of the Sheets collections sucks, // e.g. there is no support for tracking sheets added/removed from the collection +namespace { + class WorkSheetsEnumeration : public ::cppu::WeakImplHelper< container::XEnumeration > { SheetMap mSheetMap; @@ -155,6 +157,8 @@ public: }; +} + ScVbaWorksheets::ScVbaWorksheets( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< css::uno::XComponentContext > & xContext, const uno::Reference< container::XIndexAccess >& xSheets, const uno::Reference< frame::XModel >& xModel ): ScVbaWorksheets_BASE( xParent, xContext, xSheets ), mxModel( xModel ), m_xSheets( uno::Reference< sheet::XSpreadsheets >( xSheets, uno::UNO_QUERY ) ) { } |