diff options
author | Philipp Hofer <philipp.hofer@protonmail.com> | 2020-11-12 13:03:16 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2020-11-21 13:19:17 +0100 |
commit | 01baeab99890e5650b3dabc15f8d900490a5a133 (patch) | |
tree | 64a1b30b20a53262605312fff4d035876fc7c811 /include/svl | |
parent | 0108cd51faf942b3fc3a292522d4b2f421f1cf45 (diff) |
tdf#123936 Formatting files in module include with clang-format
Change-Id: I0507dd797cd5a35e0ae14f4b69ee4e172d08a71a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105681
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Tested-by: Jenkins
Diffstat (limited to 'include/svl')
-rw-r--r-- | include/svl/IndexedStyleSheets.hxx | 59 | ||||
-rw-r--r-- | include/svl/cjkoptions.hxx | 11 | ||||
-rw-r--r-- | include/svl/converter.hxx | 1 | ||||
-rw-r--r-- | include/svl/currencytable.hxx | 4 | ||||
-rw-r--r-- | include/svl/gridprinter.hxx | 11 | ||||
-rw-r--r-- | include/svl/inettype.hxx | 16 | ||||
-rw-r--r-- | include/svl/itemiter.hxx | 11 | ||||
-rw-r--r-- | include/svl/outstrm.hxx | 14 | ||||
-rw-r--r-- | include/svl/sharedstringpool.hxx | 13 | ||||
-rw-r--r-- | include/svl/stylesheetuser.hxx | 3 | ||||
-rw-r--r-- | include/svl/svldllapi.h | 4 | ||||
-rw-r--r-- | include/svl/whiter.hxx | 12 |
12 files changed, 72 insertions, 87 deletions
diff --git a/include/svl/IndexedStyleSheets.hxx b/include/svl/IndexedStyleSheets.hxx index 2393073af04b..910acd9e2566 100644 --- a/include/svl/IndexedStyleSheets.hxx +++ b/include/svl/IndexedStyleSheets.hxx @@ -19,12 +19,13 @@ #include <unordered_map> #include <vector> -namespace svl { - +namespace svl +{ /** Function object to check whether a style sheet a fulfills specific criteria. * Derive from this class and override the Check() method. */ -struct StyleSheetPredicate { +struct StyleSheetPredicate +{ virtual bool Check(const SfxStyleSheetBase& styleSheet) = 0; virtual ~StyleSheetPredicate() {} }; @@ -32,7 +33,8 @@ struct StyleSheetPredicate { /** Function object for cleanup-Strategy for IndexedSfxStyleSheets::Clear(). * Derive from it and do what is necessary to dispose of a style sheet in Dispose(). */ -struct StyleSheetDisposer { +struct StyleSheetDisposer +{ virtual void Dispose(rtl::Reference<SfxStyleSheetBase> styleSheet) = 0; virtual ~StyleSheetDisposer() {} }; @@ -40,7 +42,8 @@ struct StyleSheetDisposer { /** Function object to apply a method on all style sheets. * Derive from it and do whatever you want to with the style sheet in the DoIt() method. */ -struct StyleSheetCallback { +struct StyleSheetCallback +{ virtual void DoIt(const SfxStyleSheetBase& styleSheet) = 0; virtual ~StyleSheetCallback() {} }; @@ -81,24 +84,19 @@ public: * * If the style sheet is already contained, this call has no effect. */ - void - AddStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style); + void AddStyleSheet(const rtl::Reference<SfxStyleSheetBase>& style); /** Removes a style sheet. */ - bool - RemoveStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style); + bool RemoveStyleSheet(const rtl::Reference<SfxStyleSheetBase>& style); /** Check whether a specified style sheet is stored. */ - bool - HasStyleSheet(const rtl::Reference< SfxStyleSheetBase >& style) const; + bool HasStyleSheet(const rtl::Reference<SfxStyleSheetBase>& style) const; /** Obtain the number of style sheets which are held */ - sal_Int32 - GetNumberOfStyleSheets() const; + sal_Int32 GetNumberOfStyleSheets() const; /** Obtain the number of style sheets for which a certain condition holds */ - sal_Int32 - GetNumberOfStyleSheetsWithPredicate(StyleSheetPredicate& predicate) const; + sal_Int32 GetNumberOfStyleSheetsWithPredicate(StyleSheetPredicate& predicate) const; /** Return the stylesheet by its position. * You can obtain the position by, e.g., FindStyleSheetPosition() @@ -111,43 +109,41 @@ public: * * @throws std::runtime_error if the style has not been found. */ - sal_Int32 - FindStyleSheetPosition(const SfxStyleSheetBase& style) const; + sal_Int32 FindStyleSheetPosition(const SfxStyleSheetBase& style) const; /** Obtain the positions of all styles which have a given name */ - std::vector<sal_Int32> - FindPositionsByName(const OUString& name) const; + std::vector<sal_Int32> FindPositionsByName(const OUString& name) const; - enum class SearchBehavior { ReturnAll, ReturnFirst }; + enum class SearchBehavior + { + ReturnAll, + ReturnFirst + }; /** Obtain the positions of all styles which have a certain name and fulfill a certain condition. * * This method is fast because it can use the name-based index */ std::vector<sal_Int32> FindPositionsByNameAndPredicate(const OUString& name, StyleSheetPredicate& predicate, - SearchBehavior behavior = SearchBehavior::ReturnAll) const; + SearchBehavior behavior = SearchBehavior::ReturnAll) const; /** Obtain the positions of all styles which fulfill a certain condition. * * This method is slow because it cannot use the name-based index */ - std::vector<sal_Int32> - FindPositionsByPredicate(StyleSheetPredicate& predicate) const; + std::vector<sal_Int32> FindPositionsByPredicate(StyleSheetPredicate& predicate) const; /** Execute a callback on all style sheets */ - void - ApplyToAllStyleSheets(StyleSheetCallback& callback) const; + void ApplyToAllStyleSheets(StyleSheetCallback& callback) const; /** Clear the contents of the index. * The StyleSheetDisposer::Dispose() method is called on each style sheet, e.g., if you want to broadcast * changes. */ - void - Clear(StyleSheetDisposer& cleanup); + void Clear(StyleSheetDisposer& cleanup); - void - Reindex(); + void Reindex(); /** Warning: counting for n starts at 0, i.e., the 0th style sheet is the first that is found. */ SfxStyleSheetBase* GetNthStyleSheetThatMatchesPredicate(sal_Int32 n, @@ -156,14 +152,13 @@ public: /** Get the positions of the style sheets which belong to a certain family. */ - const std::vector<sal_Int32>& - GetStyleSheetPositionsByFamily(SfxStyleFamily) const; + const std::vector<sal_Int32>& GetStyleSheetPositionsByFamily(SfxStyleFamily) const; private: /** Register the position of a styleName in the index */ void Register(const SfxStyleSheetBase& style, sal_Int32 pos); - typedef std::vector<rtl::Reference<SfxStyleSheetBase> > VectorType; + typedef std::vector<rtl::Reference<SfxStyleSheetBase>> VectorType; /** Vector with the stylesheets to allow for index-based access. */ VectorType mStyleSheets; diff --git a/include/svl/cjkoptions.hxx b/include/svl/cjkoptions.hxx index 7b646d118e0c..a371d74389ab 100644 --- a/include/svl/cjkoptions.hxx +++ b/include/svl/cjkoptions.hxx @@ -30,10 +30,9 @@ class SvtCJKOptions_Impl; class SVL_DLLPUBLIC SvtCJKOptions final : public utl::detail::Options { private: - std::shared_ptr<SvtCJKOptions_Impl> pImpl; + std::shared_ptr<SvtCJKOptions_Impl> pImpl; public: - enum EOption { E_CJKFONT, @@ -45,7 +44,7 @@ public: E_DOUBLELINES, E_EMPHASISMARKS, E_VERTICALCALLOUT, - E_ALL // special one for IsAnyEnabled()/SetAll() functionality + E_ALL // special one for IsAnyEnabled()/SetAll() functionality }; // bDontLoad is for referencing purposes only @@ -60,9 +59,9 @@ public: bool IsChangeCaseMapEnabled() const; bool IsDoubleLinesEnabled() const; - void SetAll(bool bSet); - bool IsAnyEnabled() const; - bool IsReadOnly(EOption eOption) const; + void SetAll(bool bSet); + bool IsAnyEnabled() const; + bool IsReadOnly(EOption eOption) const; }; #endif // INCLUDED_SVL_CJKOPTIONS_HXX diff --git a/include/svl/converter.hxx b/include/svl/converter.hxx index 0aeceeac2132..7b2000c88e5a 100644 --- a/include/svl/converter.hxx +++ b/include/svl/converter.hxx @@ -30,5 +30,4 @@ public: #endif //_CONVERTER_HXX_ - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svl/currencytable.hxx b/include/svl/currencytable.hxx index 275391649ff5..2214b1903a6a 100644 --- a/include/svl/currencytable.hxx +++ b/include/svl/currencytable.hxx @@ -31,8 +31,8 @@ public: iterator begin(); - NfCurrencyEntry& operator[] ( size_t i ); - const NfCurrencyEntry& operator[] ( size_t i ) const; + NfCurrencyEntry& operator[](size_t i); + const NfCurrencyEntry& operator[](size_t i) const; size_t size() const; diff --git a/include/svl/gridprinter.hxx b/include/svl/gridprinter.hxx index 52a01e33b9fa..e69d9f50ca8f 100644 --- a/include/svl/gridprinter.hxx +++ b/include/svl/gridprinter.hxx @@ -14,8 +14,8 @@ #include <svl/svldllapi.h> #include <memory> -namespace svl { - +namespace svl +{ /** * Print 2-dimensional data in a nice and pleasant fashion. Useful when * debugging grid layout data. @@ -26,12 +26,11 @@ class SVL_DLLPUBLIC GridPrinter std::unique_ptr<Impl> mpImpl; public: - GridPrinter( size_t nRows, size_t nCols, bool bPrint ); + GridPrinter(size_t nRows, size_t nCols, bool bPrint); ~GridPrinter(); - void set( size_t nRow, size_t nCol, const OUString& rStr ); - void print( const char* pHeader ) const; + void set(size_t nRow, size_t nCol, const OUString& rStr); + void print(const char* pHeader) const; }; - } #endif diff --git a/include/svl/inettype.hxx b/include/svl/inettype.hxx index 6d5d01852072..9bea57d26da0 100644 --- a/include/svl/inettype.hxx +++ b/include/svl/inettype.hxx @@ -23,7 +23,6 @@ #include <svl/svldllapi.h> #include <tools/inetmime.hxx> - /** Definitions for frequently used media type names. */ #define CONTENT_TYPE_STR_APP_OCTSTREAM "application/octet-stream" @@ -111,7 +110,6 @@ #define CONTENT_TYPE_STR_APP_VND_SUN_XML_WRITER_GLOBAL "application/vnd.sun.xml.writer-global" #define CONTENT_TYPE_STR_APP_VND_SUN_XML_IMPRESSPACKED "application/vnd.sun.xml.impress-packed" - /** Definitions for matching parts of URIs. */ #define INETTYPE_URL_PROT_DATA "data" @@ -212,23 +210,21 @@ enum INetContentType CONTENT_TYPE_LAST = CONTENT_TYPE_APP_VND_SUN_XML_IMPRESSPACKED }; - class SVL_DLLPUBLIC INetContentTypes { public: - static INetContentType GetContentType(OUString const & rTypeName); + static INetContentType GetContentType(OUString const& rTypeName); static OUString GetContentType(INetContentType eTypeID); - static INetContentType GetContentType4Extension(OUString const & rExtension); + static INetContentType GetContentType4Extension(OUString const& rExtension); - static INetContentType GetContentTypeFromURL(OUString const & rURL); + static INetContentType GetContentTypeFromURL(OUString const& rURL); - static bool GetExtensionFromURL(OUString const & rURL, OUString & rExtension); + static bool GetExtensionFromURL(OUString const& rURL, OUString& rExtension); - static bool parse(OUString const & rMediaType, OUString & rType, - OUString & rSubType, - INetContentTypeParameterList * pParameters = nullptr); + static bool parse(OUString const& rMediaType, OUString& rType, OUString& rSubType, + INetContentTypeParameterList* pParameters = nullptr); }; #endif // INCLUDED_SVL_INETTYPE_HXX diff --git a/include/svl/itemiter.hxx b/include/svl/itemiter.hxx index 3d690c98890d..c6d82e41b621 100644 --- a/include/svl/itemiter.hxx +++ b/include/svl/itemiter.hxx @@ -26,13 +26,13 @@ class SfxPoolItem; class SVL_DLLPUBLIC SfxItemIter { - const SfxItemSet& m_rSet; + const SfxItemSet& m_rSet; sal_uInt16 m_nStart; sal_uInt16 m_nEnd; sal_uInt16 m_nCurrent; public: - SfxItemIter( const SfxItemSet& rSet ); + SfxItemIter(const SfxItemSet& rSet); ~SfxItemIter(); /// get item, or null if no items @@ -42,15 +42,14 @@ public: } const SfxPoolItem* NextItem() { return (m_nCurrent < m_nEnd) ? ImplNextItem() : nullptr; } - bool IsAtEnd() const { return m_nCurrent == m_nEnd; } + bool IsAtEnd() const { return m_nCurrent == m_nEnd; } - sal_uInt16 GetCurPos() const { return m_nCurrent; } + sal_uInt16 GetCurPos() const { return m_nCurrent; } sal_uInt16 GetFirstPos() const { return m_nStart; } - sal_uInt16 GetLastPos() const { return m_nEnd; } + sal_uInt16 GetLastPos() const { return m_nEnd; } private: const SfxPoolItem* ImplNextItem(); - }; #endif diff --git a/include/svl/outstrm.hxx b/include/svl/outstrm.hxx index f4e736542586..ff694a5c97a5 100644 --- a/include/svl/outstrm.hxx +++ b/include/svl/outstrm.hxx @@ -24,18 +24,18 @@ #include <com/sun/star/uno/Reference.h> #include <tools/stream.hxx> -namespace com::sun::star::io { - class XOutputStream; +namespace com::sun::star::io +{ +class XOutputStream; } - class SVL_DLLPUBLIC SvOutputStream final : public SvStream { - css::uno::Reference< css::io::XOutputStream > m_xStream; + css::uno::Reference<css::io::XOutputStream> m_xStream; - SVL_DLLPRIVATE virtual std::size_t GetData(void *, std::size_t) override; + SVL_DLLPRIVATE virtual std::size_t GetData(void*, std::size_t) override; - SVL_DLLPRIVATE virtual std::size_t PutData(void const * pData, std::size_t nSize) override; + SVL_DLLPRIVATE virtual std::size_t PutData(void const* pData, std::size_t nSize) override; SVL_DLLPRIVATE virtual sal_uInt64 SeekPos(sal_uInt64) override; @@ -44,7 +44,7 @@ class SVL_DLLPUBLIC SvOutputStream final : public SvStream SVL_DLLPRIVATE virtual void SetSize(sal_uInt64) override; public: - SvOutputStream(css::uno::Reference< css::io::XOutputStream > const & rTheStream); + SvOutputStream(css::uno::Reference<css::io::XOutputStream> const& rTheStream); virtual ~SvOutputStream() override; }; diff --git a/include/svl/sharedstringpool.hxx b/include/svl/sharedstringpool.hxx index a2cae3a9a08c..ff270eef5aa6 100644 --- a/include/svl/sharedstringpool.hxx +++ b/include/svl/sharedstringpool.hxx @@ -16,8 +16,8 @@ class CharClass; -namespace svl { - +namespace svl +{ class SharedString; /** @@ -30,11 +30,11 @@ class SVL_DLLPUBLIC SharedStringPool struct Impl; std::unique_ptr<Impl> mpImpl; - SharedStringPool( const SharedStringPool& ) = delete; - SharedStringPool& operator=( const SharedStringPool& ) = delete; + SharedStringPool(const SharedStringPool&) = delete; + SharedStringPool& operator=(const SharedStringPool&) = delete; public: - SharedStringPool( const CharClass& rCharClass ); + SharedStringPool(const CharClass& rCharClass); ~SharedStringPool(); /** @@ -45,7 +45,7 @@ public: * @return a pointer to the string object stored inside the pool, or NULL * if the insertion fails. */ - SharedString intern( const OUString& rStr ); + SharedString intern(const OUString& rStr); /** * Go through all string objects in the pool, and clear those that are no @@ -57,7 +57,6 @@ public: size_t getCountIgnoreCase() const; }; - } #endif diff --git a/include/svl/stylesheetuser.hxx b/include/svl/stylesheetuser.hxx index 86975f6b25f6..ba69268da809 100644 --- a/include/svl/stylesheetuser.hxx +++ b/include/svl/stylesheetuser.hxx @@ -16,7 +16,6 @@ namespace svl { - /** Test whether object that uses a stylesheet is used itself. This interface should be implemented by all classes that use @@ -31,10 +30,10 @@ public: @return true, if the object is used, false otherwise */ virtual bool isUsedByModel() const = 0; + protected: ~StyleSheetUser() {} }; - } #endif diff --git a/include/svl/svldllapi.h b/include/svl/svldllapi.h index 0e62d3f3b177..31402a7b19eb 100644 --- a/include/svl/svldllapi.h +++ b/include/svl/svldllapi.h @@ -23,9 +23,9 @@ #include <sal/types.h> #if defined(SVL_DLLIMPLEMENTATION) -#define SVL_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#define SVL_DLLPUBLIC SAL_DLLPUBLIC_EXPORT #else -#define SVL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#define SVL_DLLPUBLIC SAL_DLLPUBLIC_IMPORT #endif #define SVL_DLLPRIVATE SAL_DLLPRIVATE diff --git a/include/svl/whiter.hxx b/include/svl/whiter.hxx index db4f3ccda7d8..be584fc23911 100644 --- a/include/svl/whiter.hxx +++ b/include/svl/whiter.hxx @@ -26,15 +26,15 @@ class SfxItemSet; class SVL_DLLPUBLIC SfxWhichIter { const sal_uInt16* const pStart; - const sal_uInt16* pRanges; - sal_uInt16 nOffset; + const sal_uInt16* pRanges; + sal_uInt16 nOffset; public: - SfxWhichIter( const SfxItemSet& rSet ); + SfxWhichIter(const SfxItemSet& rSet); - sal_uInt16 GetCurWhich() const { return pRanges[0] + nOffset; } - sal_uInt16 NextWhich(); - sal_uInt16 FirstWhich(); + sal_uInt16 GetCurWhich() const { return pRanges[0] + nOffset; } + sal_uInt16 NextWhich(); + sal_uInt16 FirstWhich(); }; #endif |