diff options
Diffstat (limited to 'sc/source/ui')
36 files changed, 259 insertions, 5 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 836106cf193e..74d0b60ffe52 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -86,6 +86,8 @@ using namespace ::com::sun::star::accessibility; //===== internal ======================================================== +namespace { + struct ScAccessibleShapeData { ScAccessibleShapeData(css::uno::Reference< css::drawing::XShape > xShape_); @@ -100,6 +102,8 @@ struct ScAccessibleShapeData boost::optional<sal_Int32> mxZOrder; }; +} + ScAccessibleShapeData::ScAccessibleShapeData(css::uno::Reference< css::drawing::XShape > xShape_) : xShape(xShape_), bSelected(false), bSelectable(true) @@ -128,6 +132,8 @@ ScAccessibleShapeData::~ScAccessibleShapeData() } } +namespace { + struct ScShapeDataLess { static void ConvertLayerId(sal_Int16& rLayerID) // changes the number of the LayerId so it the accessibility order @@ -193,6 +199,8 @@ struct ScShapeDataLess } }; +} + class ScChildrenShapes : public SfxListener, public ::accessibility::IAccessibleParent { diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index a6d7f5f08169..f887784bd92d 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -61,6 +61,8 @@ using namespace ::com::sun::star::accessibility; typedef std::vector< uno::Reference< XAccessible > > ScXAccVector; +namespace { + struct ScAccNote { OUString maNoteText; @@ -78,6 +80,8 @@ struct ScAccNote } }; +} + class ScNotesChildren { public: @@ -120,6 +124,8 @@ ScNotesChildren::ScNotesChildren(ScPreviewShell* pViewShell, ScAccessibleDocumen { } +namespace { + struct DeleteAccNote { void operator()(ScAccNote& rNote) @@ -129,6 +135,8 @@ struct DeleteAccNote } }; +} + ScNotesChildren::~ScNotesChildren() { std::for_each(maNotes.begin(), maNotes.end(), DeleteAccNote()); @@ -196,6 +204,8 @@ void ScNotesChildren::Init(const tools::Rectangle& rVisRect, sal_Int32 nOffset) } } +namespace { + struct ScParaFound { sal_Int32 mnIndex; @@ -211,6 +221,8 @@ struct ScParaFound } }; +} + uno::Reference<XAccessible> ScNotesChildren::GetChild(sal_Int32 nIndex) const { uno::Reference<XAccessible> xAccessible; @@ -252,6 +264,8 @@ uno::Reference<XAccessible> ScNotesChildren::GetChild(sal_Int32 nIndex) const return xAccessible; } +namespace { + struct ScPointFound { tools::Rectangle const maPoint; @@ -268,6 +282,8 @@ struct ScPointFound } }; +} + uno::Reference<XAccessible> ScNotesChildren::GetAt(const awt::Point& rPoint) const { uno::Reference<XAccessible> xAccessible; @@ -410,6 +426,8 @@ sal_Int32 ScNotesChildren::CheckChanges(const ScPreviewLocationData& rData, return nParagraphs; } +namespace { + struct ScChildGone { ScAccessibleDocumentPagePreview* const mpAccDoc; @@ -446,6 +464,8 @@ struct ScChildNew } }; +} + void ScNotesChildren::DataChanged(const tools::Rectangle& rVisRect) { if (mpViewShell && mpAccDoc) @@ -472,6 +492,8 @@ inline ScDocument* ScNotesChildren::GetDocument() const return pDoc; } +namespace { + class ScIAccessibleViewForwarder : public ::accessibility::IAccessibleViewForwarder { public: @@ -492,6 +514,8 @@ private: MapMode maMapMode; }; +} + ScIAccessibleViewForwarder::ScIAccessibleViewForwarder() : mpViewShell(nullptr), mpAccDoc(nullptr) { @@ -548,6 +572,8 @@ Size ScIAccessibleViewForwarder::LogicToPixel (const Size& rSize) const return aSize; } +namespace { + struct ScShapeChild { ScShapeChild() @@ -560,6 +586,8 @@ struct ScShapeChild sal_Int32 mnRangeId; }; +} + ScShapeChild::~ScShapeChild() { if (mpAccShape.is()) @@ -568,6 +596,8 @@ ScShapeChild::~ScShapeChild() } } +namespace { + struct ScShapeChildLess { bool operator()(const ScShapeChild& rChild1, const ScShapeChild& rChild2) const @@ -579,8 +609,12 @@ struct ScShapeChildLess } }; +} + typedef std::vector<ScShapeChild> ScShapeChildVec; +namespace { + struct ScShapeRange { ScShapeChildVec maBackShapes; @@ -589,6 +623,8 @@ struct ScShapeRange ScIAccessibleViewForwarder maViewForwarder; }; +} + typedef std::vector<ScShapeRange> ScShapeRangeVec; class ScShapeChildren : public ::accessibility::IAccessibleParent @@ -856,6 +892,8 @@ uno::Reference<XAccessible> ScShapeChildren::GetControl(sal_Int32 nIndex) const return xAccessible; } +namespace { + struct ScShapePointFound { Point const maPoint; @@ -869,6 +907,8 @@ struct ScShapePointFound } }; +} + uno::Reference<XAccessible> ScShapeChildren::GetForegroundShapeAt(const awt::Point& rPoint) const //inclusive Controls { uno::Reference<XAccessible> xAcc; @@ -1016,6 +1056,8 @@ SdrPage* ScShapeChildren::GetDrawPage() const return pDrawPage; } +namespace { + struct ScPagePreviewCountData { // order is background shapes, header, table or notes, footer, foreground shapes, controls @@ -1038,6 +1080,8 @@ struct ScPagePreviewCountData } }; +} + ScPagePreviewCountData::ScPagePreviewCountData( const ScPreviewLocationData& rData, const vcl::Window* pSizeWindow, const ScNotesChildren* pNotesChildren, const ScShapeChildren* pShapeChildren) : diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 2fa6f42415c7..0c167403cac6 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -249,48 +249,64 @@ void ScPreviewViewForwarder::SetInvalid() mpViewShell = nullptr; } +namespace { + class ScPreviewHeaderFooterViewForwarder : public ScPreviewViewForwarder { public: ScPreviewHeaderFooterViewForwarder(ScPreviewShell* pViewShell); }; +} + ScPreviewHeaderFooterViewForwarder::ScPreviewHeaderFooterViewForwarder(ScPreviewShell* pViewShell) : ScPreviewViewForwarder(pViewShell) { } +namespace { + class ScPreviewCellViewForwarder : public ScPreviewViewForwarder { public: ScPreviewCellViewForwarder(ScPreviewShell* pViewShell); }; +} + ScPreviewCellViewForwarder::ScPreviewCellViewForwarder(ScPreviewShell* pViewShell) : ScPreviewViewForwarder(pViewShell) { } +namespace { + class ScPreviewHeaderCellViewForwarder : public ScPreviewViewForwarder { public: ScPreviewHeaderCellViewForwarder(ScPreviewShell* pViewShell); }; +} + ScPreviewHeaderCellViewForwarder::ScPreviewHeaderCellViewForwarder(ScPreviewShell* pViewShell) : ScPreviewViewForwarder(pViewShell) { } +namespace { + class ScPreviewNoteViewForwarder : public ScPreviewViewForwarder { public: ScPreviewNoteViewForwarder(ScPreviewShell* pViewShell); }; +} + ScPreviewNoteViewForwarder::ScPreviewNoteViewForwarder(ScPreviewShell* pViewShell) : ScPreviewViewForwarder(pViewShell) diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index 1275113c7f29..5d3500097e24 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -49,6 +49,8 @@ #include <editutil.hxx> // *** edit engine *** +namespace { + struct Func_SetType { sal_Int32 const mnType; @@ -65,6 +67,8 @@ struct Func_Select { rState.Select( mbSelect ); } }; +} + ScCsvGrid::ScCsvGrid(const ScCsvLayoutData& rData, std::unique_ptr<weld::Menu> xPopup, ScCsvTableBox* pTableBox) : ScCsvControl(rData) , mpTableBox(pTableBox) diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx index 722ffee83bdc..3f2592516319 100644 --- a/sc/source/ui/dbgui/dbnamdlg.cxx +++ b/sc/source/ui/dbgui/dbnamdlg.cxx @@ -36,8 +36,12 @@ #include <dbnamdlg.hxx> #include <dbdocfun.hxx> +namespace { + class DBSaveData; +} + static DBSaveData* pSaveObj = nullptr; namespace @@ -49,7 +53,6 @@ namespace rString)); xBox->run(); } -} // class DBSaveData @@ -94,6 +97,8 @@ private: bool bDirty:1; }; +} + void DBSaveData::Save() { aArea = rCurArea; diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 6ce6664c024d..7b6794f2445d 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1099,6 +1099,8 @@ void ScDocFunc::NotifyInputHandler( const ScAddress& rPos ) } } + namespace { + struct ScMyRememberItem { sal_Int32 const nIndex; @@ -1108,6 +1110,8 @@ void ScDocFunc::NotifyInputHandler( const ScAddress& rPos ) nIndex(nTempIndex), aItemSet(rItemSet) {} }; + } + typedef ::std::vector<std::unique_ptr<ScMyRememberItem>> ScMyRememberItemVector; void ScDocFunc::PutData( const ScAddress& rPos, ScEditEngineDefaulter& rEngine, bool bApi ) diff --git a/sc/source/ui/docshell/macromgr.cxx b/sc/source/ui/docshell/macromgr.cxx index 6f262bc5b35b..832dc35917b9 100644 --- a/sc/source/ui/docshell/macromgr.cxx +++ b/sc/source/ui/docshell/macromgr.cxx @@ -102,6 +102,8 @@ ScMacroManager::~ScMacroManager() typedef ::cppu::WeakImplHelper< css::container::XContainerListener > ContainerListenerHelper; +namespace { + class VBAProjectListener : public ContainerListenerHelper { ScMacroManager* mpMacroMgr; @@ -123,6 +125,8 @@ public: }; +} + void ScMacroManager::InitUserFuncData() { // Clear unordered_map diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index ce9f4f6d7c66..9e6333db4679 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -35,6 +35,8 @@ using namespace com::sun::star; +namespace { + /// Helper for sorting properties struct ScSolverOptionsEntry { @@ -49,6 +51,8 @@ struct ScSolverOptionsEntry } }; +} + ScSolverOptionsDialog::ScSolverOptionsDialog(weld::Window* pParent, const uno::Sequence<OUString>& rImplNames, const uno::Sequence<OUString>& rDescriptions, diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index 45df3be40ddc..8696bda0a8ff 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -138,6 +138,8 @@ using namespace com::sun::star; +namespace { + class ScNamedEntry { OUString aName; @@ -151,6 +153,8 @@ public: const ScRange& GetRange() const { return aRange; } }; +} + // The names in the maps must be sorted according to strcmp! //! Instead of Which-ID 0 use special IDs and do not compare via names! @@ -9071,6 +9075,8 @@ void ScUniqueCellFormatsObj::Notify( SfxBroadcaster&, const SfxHint& rHint ) // Fill the list of formats from the document +namespace { + // hash code to access the range lists by ScPatternAttr pointer struct ScPatternHashCode { @@ -9080,11 +9086,15 @@ struct ScPatternHashCode } }; +} + // Hash map to find a range by its start row typedef std::unordered_map< SCROW, ScRange > ScRowRangeHashMap; typedef std::vector<ScRange> ScRangeVector; +namespace { + // Hash map entry. // The Join method depends on the column-wise order of ScAttrRectIterator class ScUniqueFormatsEntry @@ -9105,6 +9115,8 @@ public: void Clear() { aReturnRanges.clear(); } // aJoinedRanges and aCompletedRanges are cleared in GetRanges }; +} + void ScUniqueFormatsEntry::Join( const ScRange& rNewRange ) { // Special-case handling for single range @@ -9192,6 +9204,8 @@ const ScRangeList& ScUniqueFormatsEntry::GetRanges() typedef std::unordered_map< const ScPatternAttr*, ScUniqueFormatsEntry, ScPatternHashCode > ScUniqueFormatsHashMap; +namespace { + // function object to sort the range lists by start of first range struct ScUniqueFormatsOrder { @@ -9205,6 +9219,8 @@ struct ScUniqueFormatsOrder } }; +} + ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rRange) : pDocShell( pDocSh ), aTotalRange( rRange ), diff --git a/sc/source/ui/unoobj/fielduno.cxx b/sc/source/ui/unoobj/fielduno.cxx index 4e6b6332be89..331b38de448a 100644 --- a/sc/source/ui/unoobj/fielduno.cxx +++ b/sc/source/ui/unoobj/fielduno.cxx @@ -157,8 +157,6 @@ enum ScUnoCollectMode SC_UNO_COLLECT_FINDPOS }; -} - /** * This class exists solely to allow searching through field items. TODO: * Look into providing the same functionality directly in EditEngine, to @@ -189,6 +187,8 @@ public: sal_Int32 GetFieldPos() const { return nFieldPos; } }; +} + ScUnoEditEngine::ScUnoEditEngine(ScEditEngineDefaulter* pSource) : ScEditEngineDefaulter(*pSource) , eMode(SC_UNO_COLLECT_NONE) diff --git a/sc/source/ui/unoobj/funcuno.cxx b/sc/source/ui/unoobj/funcuno.cxx index 128811bf1ae7..b65b34d168e7 100644 --- a/sc/source/ui/unoobj/funcuno.cxx +++ b/sc/source/ui/unoobj/funcuno.cxx @@ -57,6 +57,8 @@ using namespace com::sun::star; // helper to use cached document if not in use, temporary document otherwise +namespace { + class ScTempDocSource { private: @@ -72,6 +74,8 @@ public: ScDocument* GetDocument(); }; +} + ScDocument* ScTempDocSource::CreateDocument() { ScDocument* pDoc = new ScDocument( SCDOCMODE_FUNCTIONACCESS ); @@ -312,6 +316,8 @@ static void lcl_AddRef( ScTokenArray& rArray, long nStartRow, long nColCount, lo rArray.AddDoubleReference(aRef); } +namespace { + class SimpleVisitor { protected: @@ -439,6 +445,8 @@ static void processSequences( ScDocument* pDoc, const uno::Any& rArg, ScTokenArr } }; +} + uno::Any SAL_CALL ScFunctionAccess::callFunction( const OUString& aName, const uno::Sequence<uno::Any>& aArguments ) { diff --git a/sc/source/ui/unoobj/servuno.cxx b/sc/source/ui/unoobj/servuno.cxx index 23c7c4b93d27..ac0409d1cf15 100644 --- a/sc/source/ui/unoobj/servuno.cxx +++ b/sc/source/ui/unoobj/servuno.cxx @@ -81,6 +81,8 @@ static bool isInVBAMode( ScDocShell& rDocSh ) #endif +namespace { + class ScVbaObjectForCodeNameProvider : public ::cppu::WeakImplHelper< container::XNameAccess > { uno::Any maWorkbook; @@ -240,8 +242,6 @@ public: } }; -namespace { - using Type = ScServiceProvider::Type; struct ProvNamesId_Type 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 ) ) { } diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx index d25183400750..07a61bf4fc64 100644 --- a/sc/source/ui/view/dbfunc3.cxx +++ b/sc/source/ui/view/dbfunc3.cxx @@ -1619,6 +1619,8 @@ static void lcl_MoveToEnd( ScDPSaveDimension& rDim, const OUString& rItemName ) // puts it to the end of the list even if it was in the list before. } +namespace { + struct ScOUStringCollate { CollatorWrapper* const mpCollator; @@ -1631,6 +1633,8 @@ struct ScOUStringCollate } }; +} + void ScDBFunc::DataPilotSort(ScDPObject* pDPObj, long nDimIndex, bool bAscending, const sal_uInt16* pUserListId) { if (!pDPObj) diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 992e716e0657..74d054f092a0 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -1147,6 +1147,8 @@ namespace sdr { namespace contact { + namespace { + class ObjectContactOfScDrawView final : public ObjectContactOfPageView { private: @@ -1168,6 +1170,8 @@ namespace sdr const basegfx::B2DRange& rB2DRange) const override; }; + } + ObjectContactOfScDrawView::ObjectContactOfScDrawView( const ScDrawView& rScDrawView, SdrPageWindow& rPageWindow, diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index e5b7d9e8756e..f6b63b2186da 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -306,6 +306,8 @@ void ScFilterListBox::SelectHdl() } } +namespace { + // use a System floating window for the above filter listbox class ScFilterFloatingWindow : public FloatingWindow { @@ -315,6 +317,8 @@ public: virtual void dispose() override; }; +} + ScFilterFloatingWindow::ScFilterFloatingWindow( vcl::Window* pParent, WinBits nStyle ) : FloatingWindow( pParent, nStyle|WB_SYSTEMWINDOW ) // make it a system floater {} diff --git a/sc/source/ui/view/scextopt.cxx b/sc/source/ui/view/scextopt.cxx index 167b75d721ab..4f8fa5eae9dc 100644 --- a/sc/source/ui/view/scextopt.cxx +++ b/sc/source/ui/view/scextopt.cxx @@ -50,6 +50,8 @@ ScExtTabSettings::ScExtTabSettings() : { } +namespace { + /** A container for ScExtTabSettings objects. @descr Internally, a std::map with shared pointers to ScExtTabSettings is used. The copy constructor and assignment operator make deep copies of the @@ -76,6 +78,8 @@ private: ScExtTabSettingsMap maMap; }; +} + ScExtTabSettingsCont::ScExtTabSettingsCont() { } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 76c330dadc50..8f3e89b2b50a 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -93,6 +93,8 @@ void ScTabViewShell::ConnectObject( const SdrOle2Obj* pObj ) } } +namespace { + class PopupCallback : public cppu::WeakImplHelper<css::awt::XCallback> { ScTabViewShell* m_pViewShell; @@ -134,6 +136,8 @@ public: } }; +} + void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb ) { // Do not leave the hint message box on top of the object |