Extend loplugin:external to warn about enums

To mitigate the dangers of silently breaking ADL when moving enums into unnamed
namespaces (see the commit message of 206b5b2661
"New loplugin:external"), note all functions that are affected.  (The plan is to
extend loplugin:external further to also warn about classes and class templates,
and the code to identify affected functions already takes that into account, so
some parts of that code are not actually relevant for enums.)

But it appears that none of the functions that are actually affected by the
changes in this commit relied on being found through ADL, so no adaptions were
necessary for them.

(clang::DeclContext::collectAllContexts is non-const, which recursively means
that External's Visit... functions must take non-const Decl*.  Which required
compilerplugins/clang/sharedvisitor/analyzer.cxx to be generalized to support
such Visit... functions with non-const Decl* parameters.)

Change-Id: Ia215291402bf850d43defdab3cff4db5b270d1bd
Reviewed-on: https://gerrit.libreoffice.org/83001
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann
2019-11-17 00:28:17 +01:00
parent 46920005f7
commit 314f15bff0
155 changed files with 975 additions and 13 deletions
@@ -44,6 +44,8 @@ using namespace ::com::sun::star::util;
namespace unocontrols {
namespace {
enum PropertyHandle // values represent index in PropertyArray
{ // for FrameControl
Componenturl = 0,
@@ -51,6 +53,8 @@ enum PropertyHandle // values represent index in PropertyArray
Loaderarguments = 2
};
}
// construct/destruct
FrameControl::FrameControl( const Reference< XComponentContext >& rxContext)
@@ -52,12 +52,16 @@ namespace basctl
typedef ::cppu::WeakComponentImplHelper< XDocumentEventListener
> DocumentEventNotifier_Impl_Base;
namespace {
enum ListenerAction
{
RegisterListener,
RemoveListener
};
}
/** impl class for DocumentEventNotifier
*/
class DocumentEventNotifier::Impl :public ::cppu::BaseMutex
+6
View File
@@ -1488,11 +1488,17 @@ static void processAutomationParams( SbxArray* pParams, Sequence< Any >& args, s
}
}
namespace {
enum class INVOKETYPE
{
GetProp = 0,
Func
};
}
static Any invokeAutomationMethod( const OUString& Name, Sequence< Any > const & args, SbxArray* pParams, sal_uInt32 nParamCount, Reference< XInvocation > const & rxInvocation, INVOKETYPE invokeType )
{
Sequence< sal_Int16 > OutParamIndex;
+3
View File
@@ -1771,6 +1771,7 @@ void SbRtl_Weekday(StarBASIC *, SbxArray & rPar, bool)
}
}
namespace {
enum Interval
{
@@ -1786,6 +1787,8 @@ enum Interval
INTERVAL_S
};
}
struct IntervalInfo
{
Interval meInterval;
@@ -58,6 +58,8 @@
using namespace x86_64;
namespace {
/* Register class used for passing given 64bit part of the argument.
These represent classes as documented by the PS ABI, with the exception
of SSESF, SSEDF classes, that are basically SSE class, just gcc will
@@ -80,6 +82,8 @@ enum x86_64_reg_class
X86_64_MEMORY_CLASS
};
}
#define MAX_CLASSES 4
/* x86-64 register passing implementation. See x86-64 ABI for details. Goal
@@ -193,6 +193,8 @@ IMPL_LINK( ScaleTabPage, EnableValueHdl, weld::ToggleButton&, rCbx, void )
}
}
namespace {
enum AxisTypeListBoxEntry
{
TYPE_AUTO=0,
@@ -200,6 +202,8 @@ enum AxisTypeListBoxEntry
TYPE_DATE=2
};
}
IMPL_LINK_NOARG(ScaleTabPage, SelectAxisTypeHdl, weld::ComboBox&, void)
{
const sal_Int32 nPos = m_xLB_AxisType->get_active();
@@ -194,12 +194,14 @@ namespace comphelper
MapData m_aData;
};
namespace {
enum EnumerationType
{
eKeys, eValues, eBoth
};
}
class MapEnumerator final
{
@@ -26,6 +26,8 @@
#include <comphelper/syntaxhighlight.hxx>
#include <o3tl/typed_flags_set.hxx>
namespace {
// Flags for character properties
enum class CharFlags {
StartIdentifier = 0x0001,
@@ -39,6 +41,9 @@ enum class CharFlags {
Space = 0x0100,
EOL = 0x0200
};
}
namespace o3tl {
template<> struct typed_flags<CharFlags> : is_typed_flags<CharFlags, 0x03ff> {};
}
+231 -8
View File
@@ -10,6 +10,9 @@
#include <algorithm>
#include <cassert>
#include <iterator>
#include <list>
#include <set>
#include "clang/Sema/SemaDiagnostic.h"
@@ -45,6 +48,79 @@ bool isInjectedFunction(FunctionDecl const* decl)
return true;
}
// Whether type1 mentions type2 (in a way relevant for argument-dependent name lookup):
bool mentions(QualType type1, QualType type2)
{
auto t1 = type1;
for (;;)
{
if (auto const t2 = t1->getAs<ReferenceType>())
{
t1 = t2->getPointeeType();
}
else if (auto const t3 = t1->getAs<PointerType>())
{
t1 = t3->getPointeeType();
}
else if (auto const t4 = t1->getAsArrayTypeUnsafe())
{
t1 = t4->getElementType();
}
else
{
break;
}
}
if (t1.getCanonicalType().getTypePtr() == type2.getTypePtr())
{
return true;
}
if (auto const t2 = t1->getAs<TemplateSpecializationType>())
{
for (auto a = t2->begin(); a != t2->end(); ++a)
{
if (a->getKind() != TemplateArgument::Type)
{
continue;
}
if (mentions(a->getAsType(), type2))
{
return true;
}
}
auto const t3 = t2->desugar();
if (t3.getTypePtr() == t2)
{
return false;
}
return mentions(t3, type2);
}
if (auto const t2 = t1->getAs<FunctionProtoType>())
{
if (mentions(t2->getReturnType(), type2))
{
return true;
}
for (auto t3 = t2->param_type_begin(); t3 != t2->param_type_end(); ++t3)
{
if (mentions(*t3, type2))
{
return true;
}
}
return false;
}
if (auto const t2 = t1->getAs<MemberPointerType>())
{
if (t2->getClass()->getUnqualifiedDesugaredType() == type2.getTypePtr())
{
return true;
}
return mentions(t2->getPointeeType(), type2);
}
return false;
}
class External : public loplugin::FilteringPlugin<External>
{
public:
@@ -55,10 +131,11 @@ public:
void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); }
bool VisitTagDecl(TagDecl const* decl)
bool VisitTagDecl(TagDecl* decl)
{
/*TODO:*/
return true; // in general, moving classes or enumerations into an unnamed namespace can break ADL
if (!isa<EnumDecl>(decl))
return true; // in general, moving classes into an unnamed namespace can break ADL
if (isa<ClassTemplateSpecializationDecl>(decl))
{
return true;
@@ -102,7 +179,7 @@ public:
return handleDeclaration(decl);
}
bool VisitFunctionDecl(FunctionDecl const* decl)
bool VisitFunctionDecl(FunctionDecl* decl)
{
if (isa<CXXMethodDecl>(decl))
{
@@ -166,7 +243,7 @@ public:
return handleDeclaration(decl);
}
bool VisitVarDecl(VarDecl const* decl)
bool VisitVarDecl(VarDecl* decl)
{
if (decl->isStaticDataMember())
{
@@ -187,7 +264,7 @@ public:
return handleDeclaration(decl);
}
bool VisitClassTemplateDecl(ClassTemplateDecl const* decl)
bool VisitClassTemplateDecl(ClassTemplateDecl* decl)
{
/*TODO:*/
return true; // in general, moving classes or enumerations into an unnamed namespace can break ADL
@@ -202,7 +279,7 @@ public:
return handleDeclaration(decl);
}
bool VisitFunctionTemplateDecl(FunctionTemplateDecl const* decl)
bool VisitFunctionTemplateDecl(FunctionTemplateDecl* decl)
{
if (!decl->isThisDeclarationADefinition())
{
@@ -219,7 +296,7 @@ public:
return handleDeclaration(decl);
}
bool VisitVarTemplateDecl(VarTemplateDecl const* decl)
bool VisitVarTemplateDecl(VarTemplateDecl* decl)
{
if (!decl->isThisDeclarationADefinition())
{
@@ -243,7 +320,149 @@ private:
}
}
bool handleDeclaration(NamedDecl const* decl)
void computeAffectedTypes(Decl const* decl, std::vector<QualType>* affected)
{
assert(affected != nullptr);
if (auto const d = dyn_cast<EnumDecl>(decl))
{
affected->push_back(compiler.getASTContext().getEnumType(d));
}
else
{
CXXRecordDecl const* rec;
if (auto const d = dyn_cast<ClassTemplateDecl>(decl))
{
rec = d->getTemplatedDecl();
}
else
{
rec = cast<CXXRecordDecl>(decl);
}
affected->push_back(compiler.getASTContext().getRecordType(rec));
for (auto d = rec->decls_begin(); d != rec->decls_end(); ++d)
{
if (*d != (*d)->getCanonicalDecl())
{
continue;
}
if (isa<TagDecl>(*d) || isa<ClassTemplateDecl>(*d))
{
if (auto const d1 = dyn_cast<RecordDecl>(*d))
{
if (d1->isInjectedClassName())
{
continue;
}
}
computeAffectedTypes(*d, affected);
}
}
}
}
void reportAssociatingFunctions(std::vector<QualType> const& affected, Decl* decl)
{
auto c = decl->getDeclContext();
while (isa<LinkageSpecDecl>(c) || c->isInlineNamespace())
{
c = c->getParent();
}
assert(c->isTranslationUnit() || c->isNamespace());
SmallVector<DeclContext*, 2> parts;
c->collectAllContexts(parts);
std::list<DeclContext const*> ctxs;
std::copy(parts.begin(), parts.end(),
std::back_insert_iterator<std::list<DeclContext const*>>(ctxs));
if (auto const d = dyn_cast<CXXRecordDecl>(decl))
{
// To find friend functions declared in the class:
ctxs.push_back(d);
}
std::set<FunctionDecl const*> fdecls; // to report every function just once
for (auto ctx = ctxs.begin(); ctx != ctxs.end(); ++ctx)
{
for (auto i = (*ctx)->decls_begin(); i != (*ctx)->decls_end(); ++i)
{
auto d = *i;
if (auto const d1 = dyn_cast<LinkageSpecDecl>(d))
{
ctxs.push_back(d1);
continue;
}
if (auto const d1 = dyn_cast<NamespaceDecl>(d))
{
if (d1->isInline())
{
ctxs.push_back(d1);
}
continue;
}
if (auto const d1 = dyn_cast<FriendDecl>(d))
{
d = d1->getFriendDecl();
}
FunctionDecl const* f;
if (auto const d1 = dyn_cast<FunctionTemplateDecl>(d))
{
f = d1->getTemplatedDecl();
}
else
{
f = dyn_cast<FunctionDecl>(d);
if (f == nullptr)
{
continue;
}
}
if (!fdecls.insert(f->getCanonicalDecl()).second)
{
continue;
}
if (isa<CXXMethodDecl>(f))
{
continue;
}
for (auto const t : affected)
{
auto const tc = t.getCanonicalType();
for (auto p = f->param_begin(); p != f->param_end(); ++p)
{
if (mentions((*p)->getType(), tc))
{
report(DiagnosticsEngine::Note,
"a %select{function|function template|function template "
"specialization}0 associating %1 is declared here",
f->getLocation())
<< (f->isFunctionTemplateSpecialization()
? 2
: f->getDescribedFunctionTemplate() != nullptr ? 1 : 0)
<< t << f->getSourceRange();
for (auto f1 = f->redecls_begin(); f1 != f->redecls_end(); ++f1)
{
if (*f1 == f)
{
continue;
}
report(DiagnosticsEngine::Note, "another declaration is here",
f1->getLocation())
<< f1->getSourceRange();
}
break;
}
}
}
}
}
}
void reportAssociatingFunctions(Decl* decl)
{
std::vector<QualType> affected; // enum/class/class template + recursively affected members
computeAffectedTypes(decl, &affected);
reportAssociatingFunctions(affected, decl);
}
bool handleDeclaration(NamedDecl* decl)
{
if (ignoreLocation(decl))
{
@@ -364,6 +583,10 @@ private:
{
reportSpecializations(d->specializations());
}
if (isa<TagDecl>(decl) || isa<ClassTemplateDecl>(decl))
{
reportAssociatingFunctions(decl);
}
return true;
}
};
@@ -14,6 +14,7 @@
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/StringExtras.h"
#include <cassert>
#include <cstddef>
#include <cstring>
#include <iostream>
@@ -55,6 +56,8 @@ class CheckFileVisitor
: public RecursiveASTVisitor< CheckFileVisitor >
{
public:
void setContext(ASTContext const& context) { context_ = &context; }
bool VisitCXXRecordDecl(CXXRecordDecl *Declaration);
bool TraverseNamespaceDecl(NamespaceDecl * decl)
@@ -67,6 +70,21 @@ public:
}
return RecursiveASTVisitor<CheckFileVisitor>::TraverseNamespaceDecl(decl);
}
private:
ASTContext const* context_ = nullptr;
QualType unqualifyPointeeType(QualType type)
{
assert(context_ != nullptr);
if (auto const t = type->getAs<PointerType>())
{
return context_->getQualifiedType(
context_->getPointerType(t->getPointeeType().getUnqualifiedType()),
type.getQualifiers());
}
return type;
}
};
static bool inheritsPluginClassCheck( const Decl* decl )
@@ -116,7 +134,8 @@ bool CheckFileVisitor::VisitCXXRecordDecl( CXXRecordDecl* decl )
cout << "VisitFunctionStart" << endl;
cout << "VisitFunctionName:" << method->getName().str() << endl;
cout << "VisitFunctionArgument:"
<< method->getParamDecl( 0 )->getTypeSourceInfo()->getType().getAsString()
<< unqualifyPointeeType(
method->getParamDecl( 0 )->getTypeSourceInfo()->getType()).getAsString()
<< endl;
cout << "VisitFunctionEnd" << endl;
}
@@ -185,6 +204,10 @@ class FindNamedClassConsumer
: public ASTConsumer
{
public:
void Initialize(ASTContext& context) override
{
visitor.setContext(context);
}
virtual void HandleTranslationUnit(ASTContext& context) override
{
visitor.TraverseDecl( context.getTranslationUnitDecl());
+61
View File
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include <sal/config.h>
#include <vector>
// expected-error@+1 {{externally available entity 'n1' is not previously declared in an included file (if it is only used in this translation unit, make it static or put it in an unnamed namespace; otherwise, provide a declaration of it in an included file) [loplugin:external]}}
int n1 = 0;
// expected-note@+1 {{another declaration is here [loplugin:external]}}
@@ -42,11 +46,68 @@ static void g()
// expected-note@+1 {{another declaration is here [loplugin:external]}}
void f2();
namespace N
{
inline namespace I1
{
extern "C++" {
// expected-note@+1 {{another declaration is here [loplugin:external]}}
enum E : int;
// expected-error@+1 {{externally available entity 'E' is not previously declared in an included file (if it is only used in this translation unit, put it in an unnamed namespace; otherwise, provide a declaration of it in an included file) [loplugin:external]}}
enum E : int
{
};
}
}
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
static void g(std::vector<E>)
{
// expected-note@+1 {{another declaration is here [loplugin:external]}}
void f(E const*);
}
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
void f(E const*);
extern "C++" {
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
void fc(E const*);
}
struct S1
{
struct S2;
// No note about associating function; injected friend function not found by ADL:
friend void f2(E const*);
};
inline namespace I2
{
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
void f3(E);
inline namespace I3
{
// expected-note@+1 {{a function associating 'N::I1::E' is declared here [loplugin:external]}}
void f4(E);
}
}
}
struct N::S1::S2
{
// expected-note@+1 {{another declaration is here [loplugin:external]}}
friend void f(E const*);
};
int main()
{
(void)n2;
(void)n3;
g();
(void)&N::g;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
+13
View File
@@ -43,6 +43,8 @@ using namespace ::com::sun::star::ui::dialogs;
using namespace ::com::sun::star::beans;
using namespace ::basegfx;
namespace {
enum class UpdateFlags
{
NONE = 0x00,
@@ -54,6 +56,9 @@ enum class UpdateFlags
Hex = 0x20,
All = 0x3f,
};
}
namespace o3tl {
template<> struct typed_flags<UpdateFlags> : is_typed_flags<UpdateFlags, 0x3f> {};
}
@@ -62,6 +67,8 @@ namespace o3tl {
namespace cui
{
namespace {
enum class ColorComponent {
Red,
Green,
@@ -75,6 +82,7 @@ enum class ColorComponent {
Key,
};
}
// color space conversion helpers
@@ -171,7 +179,12 @@ void ColorPreviewControl::Paint(vcl::RenderContext& rRenderContext, const tools:
rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), GetOutputSizePixel()));
}
namespace {
enum ColorMode { HUE, SATURATION, BRIGHTNESS, RED, GREEN, BLUE };
}
const ColorMode DefaultMode = HUE;
class ColorFieldControl : public weld::CustomWidgetController
+4
View File
@@ -66,9 +66,13 @@ static OUString getNormDicEntry_Impl(const OUString &rText)
return aTmp.replaceAll("=", "");
}
namespace {
// Compare Dictionary Entry result
enum CDE_RESULT { CDE_EQUAL, CDE_SIMILAR, CDE_DIFFERENT };
}
static CDE_RESULT cmpDicEntry_Impl( const OUString &rText1, const OUString &rText2 )
{
CDE_RESULT eRes = CDE_DIFFERENT;
+4
View File
@@ -172,6 +172,8 @@ DicUserData::DicUserData(
Entry IDs for options listbox of dialog
--------------------------------------------------*/
namespace {
enum EID_OPTIONS
{
EID_SPELL_AUTO,
@@ -186,6 +188,8 @@ enum EID_OPTIONS
EID_HYPH_SPECIAL
};
}
//! this array must have an entry for every value of EID_OPTIONS.
// It is used to get the respective property name.
static const char * aEidToPropName[] =
+8
View File
@@ -321,6 +321,8 @@ public:
/* */
/*********************************************************************/
namespace {
enum OfaAutoFmtOptions
{
USE_REPLACE_TABLE,
@@ -343,6 +345,8 @@ enum OfaAutoFmtOptions
MERGE_SINGLE_LINE_PARA
};
}
OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage(weld::Container* pPage, weld::DialogController* pController,
const SfxItemSet& rSet )
: SfxTabPage(pPage, pController, "cui/ui/applyautofmtpage.ui", "ApplyAutoFmtPage", &rSet)
@@ -1516,12 +1520,16 @@ IMPL_LINK(OfaAutocorrExceptPage, ModifyHdl, weld::Entry&, rEdt, void)
}
}
namespace {
enum OfaQuoteOptions
{
ADD_NONBRK_SPACE,
REPLACE_1ST
};
}
void OfaQuoteTabPage::CreateEntry(weld::TreeView& rCheckLB, const OUString& rTxt, sal_uInt16 nCol, sal_uInt16 nTextCol)
{
rCheckLB.append();
+4
View File
@@ -84,6 +84,8 @@ const sal_uInt16 SvxExtParagraphTabPage::pExtRanges[] =
// according to BP
#define FIX_DIST_DEF 283 // standard fix distance 0,5 cm
namespace {
enum LineSpaceList
{
LLINESPACE_1 = 0,
@@ -96,6 +98,8 @@ enum LineSpaceList
LLINESPACE_FIX = 7
};
}
static void SetLineSpace_Impl( SvxLineSpacingItem&, int, long lValue = 0 );
void SetLineSpace_Impl( SvxLineSpacingItem& rLineSpace,
+9
View File
@@ -41,8 +41,12 @@ using namespace ::com::sun::star::text;
#define SwFPos SvxSwFramePosString
namespace {
enum class LB;
}
struct FrmMap
{
SvxSwFramePosString::StringId eStrId;
@@ -64,6 +68,8 @@ struct StringIdPair_Impl
SvxSwFramePosString::StringId eVert;
};
namespace {
enum class LB {
NONE = 0x000000,
Frame = 0x000001, // paragraph text area
@@ -96,6 +102,9 @@ enum class LB {
LAST = VertLine
};
}
namespace o3tl {
template<> struct typed_flags<LB> : is_typed_flags<LB, 0x0fffff> {};
}
+4
View File
@@ -32,6 +32,8 @@ using namespace com::sun::star;
// static ----------------------------------------------------------------
namespace {
enum FillType
{
TRANSPARENT,
@@ -42,6 +44,8 @@ enum FillType
PATTERN
};
}
const sal_uInt16 SvxAreaTabPage::pAreaRanges[] =
{
XATTR_GRADIENTSTEPCOUNT,
+4
View File
@@ -48,6 +48,8 @@
using namespace com::sun::star;
namespace {
enum BitmapStyle
{
CUSTOM,
@@ -61,6 +63,8 @@ enum TileOffset
COLUMN
};
}
const sal_uInt16 SvxBitmapTabPage::pBitmapRanges[] =
{
SID_ATTR_TRANSFORM_WIDTH,
+4
View File
@@ -4261,12 +4261,16 @@ static char* getStyles(LibreOfficeKitDocument* pThis, const char* pCommand)
return pJson;
}
namespace {
enum class UndoOrRedo
{
UNDO,
REDO
};
}
/// Returns the JSON representation of either an undo or a redo stack.
static char* getUndoOrRedo(LibreOfficeKitDocument* pThis, UndoOrRedo eCommand)
{
@@ -104,6 +104,8 @@ namespace emfplushelper
{
}
namespace {
typedef enum
{
StringAlignmentNear = 0x00000000,
@@ -111,6 +113,8 @@ namespace emfplushelper
StringAlignmentFar = 0x00000002
} StringAlignment;
}
float EmfPlusHelperData::getUnitToPixelMultiplier(const UnitType aUnitType)
{
switch (aUnitType)
+4
View File
@@ -28,6 +28,8 @@ using namespace ::basegfx;
namespace emfplushelper
{
namespace {
enum EmfPlusPenData
{
PenDataTransform = 0x00000001,
@@ -45,6 +47,8 @@ namespace emfplushelper
PenDataCustomEndCap = 0x00001000
};
}
EMFPPen::EMFPPen()
: EMFPBrush()
, penDataFlags(0)
+2
View File
@@ -67,6 +67,7 @@ SfxPoolItem* SvxFormatSplitItem::CreateDefault() { return new SvxFormatSplitIte
SfxPoolItem* SvxPageModelItem::CreateDefault() { return new SvxPageModelItem(0);}
SfxPoolItem* SvxParaVertAlignItem::CreateDefault() { return new SvxParaVertAlignItem(Align::Automatic, 0);}
namespace {
enum class SvxSpecialLineSpace
{
@@ -77,6 +78,7 @@ enum class SvxSpecialLineSpace
End
};
}
SvxLineSpacingItem::SvxLineSpacingItem( sal_uInt16 nHeight, const sal_uInt16 nId )
: SfxEnumItemInterface( nId )
+5
View File
@@ -89,12 +89,17 @@ using namespace ::com::sun::star;
using namespace ::xmloff::token;
using namespace ::utl;
namespace {
enum class Flags {
NONE = 0x00,
FullStop = 0x01,
ExclamationMark = 0x02,
QuestionMark = 0x04,
};
}
namespace o3tl {
template<> struct typed_flags<Flags> : is_typed_flags<Flags, 0x07> {};
}
@@ -59,6 +59,8 @@ namespace pcr
namespace PropertyControlType = ::com::sun::star::inspection::PropertyControlType;
namespace {
enum ControlEventType
{
FOCUS_GAINED,
@@ -66,6 +68,8 @@ namespace pcr
ACTIVATE_NEXT
};
}
struct ControlEvent : public ::comphelper::AnyEvent
{
Reference< XPropertyControl > xControl;
+4
View File
@@ -466,10 +466,14 @@ void Sane::SetOptionValue( int n, double const * pSet )
ControlOption( n, SANE_ACTION_SET_VALUE, pFixedSet.get() );
}
namespace {
enum FrameStyleType {
FrameStyle_BW, FrameStyle_Gray, FrameStyle_RGB, FrameStyle_Separated
};
}
#define BYTE_BUFFER_SIZE 32768
static sal_uInt8 ReadValue( FILE* fp, int depth )
@@ -35,8 +35,11 @@
class FilterConfigItem;
namespace {
enum PenStyle { PEN_NULL, PEN_SOLID, PEN_DOT, PEN_DASH, PEN_DASHDOT };
}
// -----------------------------Field Types-------------------------------
@@ -29,6 +29,8 @@
//============================ PCDReader ==================================
namespace {
// these resolutions are contained in a PCD file:
enum PCDResolution {
PCDRES_BASE16, // 192 x 128
@@ -40,6 +42,8 @@ enum PCDResolution {
PCDRES_16BASE // 3072 x 3072
};
}
class PCDReader {
private:
@@ -138,11 +138,15 @@ namespace PictReaderInternal {
//============================ PictReader ==================================
namespace {
enum class PictDrawingMethod {
FRAME, PAINT, ERASE, INVERT, FILL,
TEXT, UNDEFINED
};
}
class PictReader {
typedef class PictReaderInternal::Pattern Pattern;
private:
+2
View File
@@ -43,6 +43,7 @@ namespace frm
//=
namespace {
enum LocaleType
{
@@ -51,6 +52,7 @@ namespace frm
ltSystem
};
}
static const Locale& getLocale(LocaleType _eType)
{
+5
View File
@@ -82,6 +82,8 @@ using ::svt::FolderDescriptor;
#define QUICK_SEARCH_TIMEOUT 1500 // time in mSec before the quicksearch string will be reset
namespace {
enum class FileViewFlags
{
NONE = 0x00,
@@ -89,6 +91,9 @@ enum class FileViewFlags
SHOW_TYPE = 0x04,
SHOW_NONE = 0x20,
};
}
namespace o3tl
{
template<> struct typed_flags<FileViewFlags> : is_typed_flags<FileViewFlags, 0x26> {};
@@ -33,6 +33,8 @@ using namespace com::sun::star::awt;
//struct SAL_DLLPUBLIC_IMPORT ::cppu::OBroadcastHelperVar< OMultiTypeInterfaceContainerHelper, OMultiTypeInterfaceContainerHelper::keyType >;
namespace {
// Handles for properties
// (PLEASE SORT THIS FIELD, IF YOU ADD NEW PROPERTIES!)
// We use an enum to define these handles, to use all numbers from 0 to nn and
@@ -48,6 +50,8 @@ enum EPROPERTIES
PROPERTYCOUNT
};
}
namespace framework
{
@@ -31,6 +31,8 @@ using namespace com::sun::star::beans;
using namespace com::sun::star::lang;
using namespace com::sun::star::awt;
namespace {
// Handles for properties
// (PLEASE SORT THIS FIELD, IF YOU ADD NEW PROPERTIES!)
// We use an enum to define these handles, to use all numbers from 0 to nn and
@@ -42,6 +44,8 @@ enum EPROPERTIES
PROPERTYCOUNT
};
}
namespace framework
{
+4
View File
@@ -76,10 +76,14 @@
namespace framework{
namespace {
enum PropHandle {
ActiveFrame, DispatchRecorderSupplier, IsPlugged, SuspendQuickstartVeto,
Title };
}
OUString SAL_CALL Desktop::getImplementationName()
{
return "com.sun.star.comp.framework.Desktop";
+4
View File
@@ -9,11 +9,15 @@
#include <common.hxx>
namespace {
//flags for handleArguments()
enum class State {
NONE, Input, Output, MergeSrc, Languages
};
}
namespace common {
bool handleArguments(
+5
View File
@@ -30,6 +30,8 @@
using namespace com::sun::star;
namespace {
/// Flags to be used with the multi-path related functions
/// @see GetDictionaryPaths
enum class DictionaryPathFlags
@@ -38,6 +40,9 @@ enum class DictionaryPathFlags
INTERNAL = 0x01,
USER = 0x02,
};
}
namespace o3tl
{
template<> struct typed_flags<DictionaryPathFlags> : is_typed_flags<DictionaryPathFlags, 0x03> {};
+3
View File
@@ -15,9 +15,12 @@
using namespace ::o3tl;
namespace {
enum class ConfigurationChangedHint { NONE, ONE, TWO };
}
namespace o3tl
{
template<> struct typed_flags< ConfigurationChangedHint> : is_typed_flags< ConfigurationChangedHint, 0xFF> {};
+2 -2
View File
@@ -111,8 +111,6 @@ DocumentOpenedGuard::~DocumentOpenedGuard()
rUrlPool.maUrls.erase( maUrl );
}
} // namespace
/** Specifies whether this filter is an import or export filter. */
enum FilterDirection
{
@@ -121,6 +119,8 @@ enum FilterDirection
FILTERDIRECTION_EXPORT
};
} // namespace
struct FilterBaseImpl
{
typedef std::shared_ptr< GraphicHelper > GraphicHelperRef;
@@ -39,6 +39,8 @@ using namespace ::com::sun::star::xml::sax;
namespace oox { namespace drawingml {
namespace {
enum FormularCommand
{
FC_MULDIV = 0,
@@ -60,6 +62,9 @@ enum FormularCommand
FC_TAN,
FC_VAL
};
}
struct FormularCommandNameTable
{
const char* pS;
+4
View File
@@ -51,11 +51,15 @@
typedef time_t osl_TStamp;
namespace {
enum osl_TLockMode
{
un_lock, read_lock, write_lock
};
}
struct osl_TFile
{
int m_Handle;
+4
View File
@@ -22,6 +22,8 @@
using namespace osl;
namespace {
enum ConditionType
{
thread_type_set,
@@ -29,6 +31,8 @@ enum ConditionType
thread_type_wait
};
}
/** thread for testing Condition.
*/
class ConditionThread : public Thread
+4
View File
@@ -277,6 +277,8 @@ static void deleteTestDirectory(const OUString& basename, const OUString& dirnam
deleteTestDirectory(aBaseURL);
}
namespace {
/** Check for the file and directory access right.
*/
enum class oslCheckMode {
@@ -285,6 +287,8 @@ enum class oslCheckMode {
WriteAccess
};
}
/** check if the file exist
*/
static bool ifFileExist(const OUString & str)
+4
View File
@@ -890,11 +890,15 @@ void SAL_CALL rtl_string2UString( rtl_uString** ppThis,
/* ----------------------------------------------------------------------- */
namespace {
enum StrLifecycle {
CANNOT_RETURN,
CAN_RETURN = 1
};
}
static oslMutex
getInternMutex()
{
+4
View File
@@ -944,8 +944,12 @@ void Converter::convertDuration(OUStringBuffer& rBuffer,
}
}
namespace {
enum Result { R_NOTHING, R_OVERFLOW, R_SUCCESS };
}
static Result
readUnsignedNumber(const OUString & rString,
sal_Int32 & io_rnPos, sal_Int32 & o_rNumber)
+4
View File
@@ -7645,6 +7645,8 @@ void OpHypGeomDist::GenSlidingWindowFunction(std::stringstream &ss,
ss << "}\n";
}
namespace {
enum MixDoubleString
{
svDoubleVectorRefDoubleString,
@@ -7658,6 +7660,8 @@ enum MixDoubleString
svDoubleDouble
};
}
void OpMinA::GenSlidingWindowFunction(
std::stringstream &ss, const std::string &sSymName, SubArguments &vSubArguments)
{
@@ -32,6 +32,8 @@ using ::com::sun::star::uno::Sequence;
using namespace ::com::sun::star;
namespace {
enum LocaleMatch
{
LOCALE_MATCH_NONE = 0,
@@ -41,6 +43,8 @@ enum LocaleMatch
LOCALE_MATCH_ALL
};
}
static LocaleMatch lclLocaleCompare(const lang::Locale& rLocale1, const LanguageTag& rLanguageTag2)
{
LocaleMatch eMatchLevel = LOCALE_MATCH_NONE;
+4
View File
@@ -81,6 +81,8 @@ using ::std::vector;
CharClass* ScCompiler::pCharClassEnglish = nullptr;
const ScCompiler::Convention* ScCompiler::pConventions[ ] = { nullptr, nullptr, nullptr, nullptr, nullptr, nullptr };
namespace {
enum ScanState
{
ssGetChar,
@@ -97,6 +99,8 @@ enum ScanState
ssStop
};
}
static const sal_Char* pInternal[2] = { "TTT", "__DEBUG_VAR" };
using namespace ::com::sun::star::i18n;
+4
View File
@@ -81,12 +81,16 @@ using namespace com::sun::star;
// The checkForUniqueItem method then finds a unique name for the item's value.
#define SC_LINEEND_NAME EMPTY_OUSTRING
namespace {
enum DetInsertResult { // return-values for inserting in one level
DET_INS_CONTINUE,
DET_INS_INSERTED,
DET_INS_EMPTY,
DET_INS_CIRCULAR };
}
class ScDetectiveData
{
private:
+5
View File
@@ -43,6 +43,8 @@
#include <oox/token/properties.hxx>
#include <o3tl/typed_flags_set.hxx>
namespace {
enum class FuncFlags : sal_uInt16 {
NONE = 0x0000,
VOLATILE = 0x0001, /// Result is volatile (e.g. NOW() function).
@@ -64,6 +66,9 @@ enum class FuncFlags : sal_uInt16 {
INTERNAL = 0x2000, /// Function is internal in Calc.
EUROTOOL = 0x4000, /// function of euro tool lib, FUNCLIB_EUROTOOL
};
}
namespace o3tl {
template<> struct typed_flags<FuncFlags> : is_typed_flags<FuncFlags, 0x77ff> {};
}
+4
View File
@@ -343,6 +343,8 @@ void PageSettings::importPictureData( const Relations& rRelations, const OUStrin
}
}
namespace {
enum HFPortionId
{
HF_LEFT,
@@ -351,6 +353,8 @@ enum HFPortionId
HF_COUNT
};
}
struct HFPortionInfo
{
Reference<text::XText> mxText; /// XText interface of this portion.
+4
View File
@@ -88,6 +88,8 @@ using com::sun::star::uno::UNO_QUERY;
using com::sun::star::frame::XLayoutManager;
using com::sun::star::beans::XPropertySet;
namespace {
enum ScNameInputType
{
SC_NAME_INPUT_CELL,
@@ -102,6 +104,8 @@ enum ScNameInputType
SC_MANAGE_NAMES
};
}
ScTextWndBase::ScTextWndBase( vcl::Window* pParent, WinBits nStyle )
: Window ( pParent, nStyle )
{
+4
View File
@@ -42,6 +42,8 @@ const SCSIZE ASCIIDLG_MAXROWS = MAXROWCOUNT;
using namespace com::sun::star::uno;
namespace {
// Defines - CSV Import Preserve Options
enum CSVImportOptionsIndex
{
@@ -59,6 +61,8 @@ enum CSVImportOptionsIndex
CSVIO_PasteSkipEmptyCells
};
}
const ::std::vector<OUString> CSVImportOptionNames =
{
"MergeDelimiters",
+12
View File
@@ -85,6 +85,8 @@ namespace
}
}
namespace {
enum class SylkVersion
{
SCALC3, // Wrote wrongly quoted strings and unescaped semicolons.
@@ -93,6 +95,8 @@ enum class SylkVersion
OTHER // Assume that aliens wrote correct strings.
};
}
// Whole document without Undo
ScImportExport::ScImportExport( ScDocument* p )
: pDocSh( dynamic_cast< ScDocShell* >(p->GetDocumentShell()) ), pDoc( p ),
@@ -544,6 +548,8 @@ void ScImportExport::SetNoEndianSwap( SvStream& rStrm )
#endif
}
namespace {
enum QuoteType
{
FIELDSTART_QUOTE,
@@ -553,6 +559,8 @@ enum QuoteType
DONTKNOW_QUOTE
};
}
/** Determine if *p is a quote that ends a quoted field.
Precondition: we are parsing a quoted field already and *p is a quote.
@@ -638,12 +646,16 @@ static bool lcl_appendLineData( OUString& rField, const sal_Unicode* p1, const s
}
}
namespace {
enum class DoubledQuoteMode
{
KEEP_ALL, // both are taken, additionally start and end quote are included in string
ESCAPE, // escaped quote, one is taken, one ignored
};
}
static const sal_Unicode* lcl_ScanString( const sal_Unicode* p, OUString& rString,
const sal_Unicode* pSeps, sal_Unicode cStr, DoubledQuoteMode eMode, bool& rbOverflowCell )
{
+4
View File
@@ -147,6 +147,8 @@ sal_Int16 lcl_SvxToUnoFileFormat( SvxFileFormat nSvxValue )
SC_SIMPLE_SERVICE_INFO( ScCellFieldsObj, "ScCellFieldsObj", "com.sun.star.text.TextFields" )
SC_SIMPLE_SERVICE_INFO( ScHeaderFieldsObj, "ScHeaderFieldsObj", "com.sun.star.text.TextFields" )
namespace {
enum ScUnoCollectMode
{
SC_UNO_COLLECT_NONE,
@@ -155,6 +157,8 @@ 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
+4
View File
@@ -140,12 +140,16 @@
using namespace css;
using namespace css::uno;
namespace {
enum class ScFilterBoxMode
{
DataSelect,
Scenario
};
}
struct ScGridWindow::MouseEventState
{
bool mbActivatePart;
+4
View File
@@ -23,6 +23,8 @@
#include <osl/diagnose.h>
#include <vcl/outdev.hxx>
namespace {
enum ScPreviewLocationType
{
SC_PLOC_CELLRANGE,
@@ -36,6 +38,8 @@ enum ScPreviewLocationType
SC_PLOC_NOTETEXT
};
}
struct ScPreviewLocationEntry
{
ScPreviewLocationType const eType;
+4
View File
@@ -229,6 +229,8 @@ bool ScViewFunc::AdjustRowHeight( SCROW nStartRow, SCROW nEndRow )
return bChanged;
}
namespace {
enum ScAutoSum
{
ScAutoSumNone = 0,
@@ -240,6 +242,8 @@ enum ScAutoSum
ScAutoSumCount
};
}
static ScAutoSum lcl_IsAutoSumData( ScDocument* pDoc, SCCOL nCol, SCROW nRow,
SCTAB nTab, ScDirection eDir, SCCOLROW& nExtend )
{
+4
View File
@@ -133,6 +133,8 @@ void WriteSndAc(const FSHelperPtr& pFS, const OUString& sSoundRelId, const OUStr
}
}
namespace {
enum PPTXLayout
{
LAYOUT_BLANK,
@@ -150,6 +152,8 @@ enum PPTXLayout
LAYOUT_SIZE
};
}
struct PPTXLayoutInfo
{
int const nType;
+4
View File
@@ -67,6 +67,8 @@ using ::com::sun::star::uno::Reference;
namespace sd { namespace sidebar {
namespace {
enum eFillStyle
{
NONE,
@@ -77,6 +79,8 @@ enum eFillStyle
PATTERN
};
}
SlideBackground::SlideBackground(
Window * pParent,
ViewShellBase& rBase,
@@ -128,6 +128,8 @@ namespace sd
return static_cast<XWeak*>(new DocumentSettings( pModel ));
}
namespace {
enum SdDocumentSettingsPropertyHandles
{
HANDLE_PRINTDRAWING, HANDLE_PRINTNOTES, HANDLE_PRINTHANDOUT, HANDLE_PRINTOUTLINE, HANDLE_MEASUREUNIT, HANDLE_SCALE_NUM,
@@ -144,6 +146,8 @@ enum SdDocumentSettingsPropertyHandles
HANDLE_EMBED_LATIN_SCRIPT_FONTS, HANDLE_EMBED_ASIAN_SCRIPT_FONTS, HANDLE_EMBED_COMPLEX_SCRIPT_FONTS,
};
}
#define MID_PRINTER 1
static rtl::Reference<PropertySetInfo> createSettingsInfoImpl( bool bIsDraw )
+5
View File
@@ -33,11 +33,16 @@ using namespace com::sun::star;
// Declaration and initialization of a map from service names to locally
// unique factory identifiers.
namespace {
enum FactoryId
{
SdDrawingDocumentFactoryId,
SdPresentationDocumentFactoryId,
};
}
typedef std::unordered_map<OUString, FactoryId> FactoryMap;
namespace {
+5
View File
@@ -1080,6 +1080,8 @@ SdUnoEventsAccess::SdUnoEventsAccess( SdXShape* pShape ) throw()
{
}
namespace {
enum class FoundFlags {
NONE = 0x0000,
ClickAction = 0x0001,
@@ -1093,6 +1095,9 @@ enum class FoundFlags {
Macro = 0x0100,
Library = 0x0200,
};
}
namespace o3tl {
template<> struct typed_flags<FoundFlags> : is_typed_flags<FoundFlags, 0x03ff> {};
}
+4
View File
@@ -78,6 +78,8 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::office;
namespace {
// this are the ids for page properties
enum WID_PAGE
{
@@ -93,6 +95,8 @@ enum WID_PAGE
WID_NAVORDER, WID_PAGE_PREVIEWMETAFILE
};
}
static sal_Char const sEmptyPageName[sizeof("page")] = "page";
// this function stores the property maps for draw pages in impress and draw
+4
View File
@@ -82,6 +82,8 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
namespace {
enum URLTypeId
{
URLType_BOOL,
@@ -95,6 +97,8 @@ enum URLTypeId
URLType_COUNT
};
}
const char* const URLTypeNames[URLType_COUNT] =
{
"bool",
+5
View File
@@ -815,7 +815,12 @@ static bool lcl_isSystemFilePicker( const uno::Reference< XFilePicker3 >& _rxFP
return false;
}
namespace {
enum open_or_save_t {OPEN, SAVE, UNDEFINED};
}
static open_or_save_t lcl_OpenOrSave(sal_Int16 const nDialogType)
{
switch (nDialogType)
+3
View File
@@ -298,6 +298,7 @@ static OUString impl_retrieveFilterNameFromTypeAndModule(
return aFoundFilterName;
}
namespace {
/** search for an internal typename, which map to the current app module
and map also to a "family" of file formats as e.g. PDF/MS Doc/OOo Doc.
@@ -308,6 +309,8 @@ enum ETypeFamily
E_OOO_DOC
};
}
static OUString impl_searchFormatTypeForApp(const css::uno::Reference< css::frame::XFrame >& xFrame ,
ETypeFamily eTypeFamily)
{
+4
View File
@@ -154,6 +154,8 @@ SmPrintUIOptions::SmPrintUIOptions()
// class SmModel
namespace {
enum SmModelPropertyHandles
{
HANDLE_FORMULA,
@@ -225,6 +227,8 @@ enum SmModelPropertyHandles
HANDLE_INTEROP_GRAB_BAG,
};
}
static rtl::Reference<PropertySetInfo> lcl_createModelPropertyInfo ()
{
static PropertyMapEntry aModelPropertyInfoMap[] =
+3
View File
@@ -182,6 +182,7 @@ double ImpSvNumberInputScan::StringToDouble( const OUString& rStr, bool bForceFr
return fNum;
}
namespace {
/**
* Splits up the input into numbers and strings for further processing
@@ -209,6 +210,8 @@ enum ScanState // States of the Turing machine
SsGetString = 3
};
}
bool ImpSvNumberInputScan::NextNumberStringSymbol( const sal_Unicode*& pStr,
OUString& rSymbol )
{
+8
View File
@@ -348,6 +348,8 @@ bool ImpSvNumFor::GetNewCurrencySymbol( OUString& rSymbol,
* SvNumberformat
*/
namespace {
enum BracketFormatSymbolType
{
BRACKET_SYMBOLTYPE_FORMAT = -1, // subformat string
@@ -385,6 +387,8 @@ enum BracketFormatSymbolType
BRACKET_SYMBOLTYPE_NATNUM19 = -33
};
}
void SvNumberformat::ImpCopyNumberformat( const SvNumberformat& rFormat )
{
sFormatstring = rFormat.sFormatstring;
@@ -1408,6 +1412,8 @@ SvNumberformat::~SvNumberformat()
* ---------------+-------------------+----------------------------+---------------
*/
namespace {
enum ScanState
{
SsStop,
@@ -1420,6 +1426,8 @@ enum ScanState
SsGetQuoted // quoted text
};
}
// read a string until ']' and delete spaces in input
// static
sal_Int32 SvNumberformat::ImpGetNumber(OUStringBuffer& rString,
+4
View File
@@ -757,6 +757,8 @@ short ImpSvNumberformatScan::GetKeyWord( const OUString& sSymbol, sal_Int32 nPos
* we write back the rest of the characters!
*/
namespace {
enum ScanState
{
SsStop = 0,
@@ -768,6 +770,8 @@ enum ScanState
SsGetBlank = 6
};
}
short ImpSvNumberformatScan::Next_Symbol( const OUString& rStr,
sal_Int32& nPos,
OUString& sSymbol ) const
+2 -1
View File
@@ -38,7 +38,6 @@ using namespace com::sun::star;
namespace {
//global
std::weak_ptr<SvtHelpOptions_Impl> g_pHelpOptions;
}
enum class HelpProperty
{
@@ -50,6 +49,8 @@ enum class HelpProperty
OfflineHelpPopUp = 5
};
}
class SvtHelpOptions_Impl : public utl::ConfigItem
{
bool bExtendedHelp;
+5
View File
@@ -29,6 +29,8 @@
#include <o3tl/typed_flags_set.hxx>
#include <com/sun/star/uno/Sequence.hxx>
namespace {
enum class HtmlCfgFlags {
NONE = 0x000,
UnknownTags = 0x001,
@@ -39,6 +41,9 @@ enum class HtmlCfgFlags {
IsBasicWarning = 0x080,
NumbersEnglishUS = 0x100,
};
}
namespace o3tl {
template<> struct typed_flags<HtmlCfgFlags> : is_typed_flags<HtmlCfgFlags, 0x1f9> {};
}
+5
View File
@@ -89,12 +89,17 @@ public:
OutputDevice* GetDevice() const { return mpDevice; }
};
namespace {
enum class FontListFontNameType
{
NONE = 0x00,
PRINTER = 0x01,
SCREEN = 0x02,
};
}
namespace o3tl
{
template<> struct typed_flags<FontListFontNameType> : is_typed_flags<FontListFontNameType, 0x3> {};
+4
View File
@@ -1894,6 +1894,8 @@ bool HTMLParser::InternalImgToPrivateURL( OUString& rURL )
return bFound;
}
namespace {
enum class HtmlMeta {
NONE = 0,
Author,
@@ -1910,6 +1912,8 @@ enum class HtmlMeta {
ContentType
};
}
// <META NAME=xxx>
static HTMLOptionEnum<HtmlMeta> const aHTMLMetaNameTable[] =
{
+4
View File
@@ -777,8 +777,12 @@ void FmGridHeader::PreExecuteColumnContextMenu(sal_uInt16 nColId, PopupMenu& rMe
}
}
namespace {
enum InspectorAction { eOpenInspector, eCloseInspector, eUpdateInspector, eNone };
}
void FmGridHeader::PostExecuteColumnContextMenu(sal_uInt16 nColId, const PopupMenu& rMenu, sal_uInt16 nExecutionResult)
{
Reference< css::container::XIndexContainer > xCols(static_cast<FmGridControl*>(GetParent())->GetPeer()->getColumns());
@@ -45,6 +45,8 @@ const char UNO_SIDEBARGRADIENT[] = ".uno:sidebargradient";
namespace svx { namespace sidebar {
namespace {
enum eFillStyle
{
NONE,
@@ -55,6 +57,8 @@ enum eFillStyle
PATTERN
};
}
const sal_Int32 AreaPropertyPanelBase::DEFAULT_CENTERX = 50;
const sal_Int32 AreaPropertyPanelBase::DEFAULT_CENTERY = 50;
const sal_Int32 AreaPropertyPanelBase::DEFAULT_ANGLE = 0;
+3
View File
@@ -74,6 +74,8 @@ using namespace com::sun::star;
#define ITEM_NOT_FOUND std::numeric_limits<std::size_t>::max()
namespace {
enum class ItemType {
DONTKNOW, BYTE, INT16, UINT16, INT32, UINT32,
ENUM, BOOL, FLAG, STRING, POINT, RECT, RANGE,
@@ -83,6 +85,7 @@ enum class ItemType {
FONT, FONTHEIGHT, FONTWIDTH, FIELD
};
}
class ImpItemListRow
{
+3
View File
@@ -63,9 +63,12 @@
#include <vcl/canvastools.hxx>
#include <vcl/ptrstyle.hxx>
namespace {
enum EscDir {LKS,RTS,OBN,UNT};
}
class ImpCaptParams
{
public:
+5
View File
@@ -88,6 +88,8 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::text;
using namespace ::com::sun::star::style;
namespace {
enum class CellPosFlag // signals the relative position of a cell to a selection
{
NONE = 0x0000, // not set or inside
@@ -102,6 +104,9 @@ enum class CellPosFlag // signals the relative position of a cell to a selectio
Bottom = 0x0040,
Lower = 0x0080
};
}
namespace o3tl
{ template<> struct typed_flags<CellPosFlag> : is_typed_flags<CellPosFlag, 0xff> {}; }
+5
View File
@@ -2427,6 +2427,8 @@ void SvxFrameWindow_Impl::DataChanged( const DataChangedEvent& rDCEvt )
}
}
namespace {
enum class FrmValidFlags {
NONE = 0x00,
Left = 0x01,
@@ -2437,6 +2439,9 @@ enum class FrmValidFlags {
VInner = 0x20,
AllMask = 0x3f,
};
}
namespace o3tl {
template<> struct typed_flags<FrmValidFlags> : is_typed_flags<FrmValidFlags, 0x3f> {};
}
+3
View File
@@ -66,8 +66,11 @@ using namespace com::sun::star::xml::sax;
using namespace ::xmloff::token;
using namespace cppu;
namespace {
enum class SvxXMLTableImportContextEnum { Color, Marker, Dash, Hatch, Gradient, Bitmap };
}
class SvxXMLTableImportContext : public SvXMLImportContext
{
+4
View File
@@ -113,9 +113,13 @@ const SwCursorShell* SwAccessibleContext::GetCursorShell() const
return dynamic_cast<const SwCursorShell*>( pViewShell);
}
namespace {
enum class Action { NONE, SCROLLED, SCROLLED_WITHIN,
SCROLLED_IN, SCROLLED_OUT };
}
void SwAccessibleContext::ChildrenScrolled( const SwFrame *pFrame,
const SwRect& rOldVisArea )
{
+4
View File
@@ -191,8 +191,12 @@ std::ostream &operator <<(std::ostream& s, const SwPosition& position)
return s << "SwPosition (node " << position.nNode.GetIndex() << ", offset " << position.nContent.GetIndex() << ")";
}
namespace {
enum CHKSECTION { Chk_Both, Chk_One, Chk_None };
}
static CHKSECTION lcl_TstIdx( sal_uLong nSttIdx, sal_uLong nEndIdx, const SwNode& rEndNd )
{
sal_uLong nStt = rEndNd.StartOfSectionIndex(), nEnd = rEndNd.GetIndex();
+4
View File
@@ -51,12 +51,16 @@
using namespace ::com::sun::star;
namespace {
enum SwSplitDocType
{
SPLITDOC_TO_GLOBALDOC,
SPLITDOC_TO_HTML
};
}
bool SwDoc::GenerateGlobalDoc( const OUString& rPath,
const SwTextFormatColl* pSplitColl )
{
+10
View File
@@ -129,6 +129,8 @@ using std::make_pair;
struct SwPaintProperties;
namespace {
//Class declaration; here because they are only used in this file
enum class SubColFlags {
Page = 0x01, //Helplines of the page
@@ -136,6 +138,9 @@ enum class SubColFlags {
Fly = 0x10, //Helplines inside fly frames
Sect = 0x20, //Helplines inside sections
};
}
namespace o3tl {
template<> struct typed_flags<SubColFlags> : is_typed_flags<SubColFlags, 0x39> {};
}
@@ -5698,7 +5703,12 @@ bool SwPageFrame::IsLeftShadowNeeded() const
}
}
namespace {
enum PaintArea {LEFT, RIGHT, TOP, BOTTOM};
}
#define BORDER_TILE_SIZE 512
/// Wrapper around pOut->DrawBitmapEx.
+5
View File
@@ -181,7 +181,12 @@ bool isSplittable(const sal_uInt16 nWhich)
return false;
}
namespace {
enum Split_t { FAIL, SPLIT_NEW, SPLIT_OTHER };
}
/**
Calculate splitting policy for overlapping hints, based on what kind of
hint is inserted, and what kind of existing hint overlaps.
+4
View File
@@ -789,8 +789,12 @@ void SwXTextCursor::DeleteAndInsert(const OUString& rText,
}
}
namespace {
enum ForceIntoMetaMode { META_CHECK_BOTH, META_INIT_START, META_INIT_END };
}
static bool
lcl_ForceIntoMeta(SwPaM & rCursor,
uno::Reference<text::XText> const & xParentText,
+5
View File
@@ -99,6 +99,8 @@ using editeng::SvxBorderLine;
#define HTML_HEADSPACE (12*20)
namespace {
enum class Css1Background {
Attr = 1,
Page = 2,
@@ -115,6 +117,9 @@ enum class Css1FrameSize {
AnyHeight = 0x06,
Pixel = 0x10,
};
}
namespace o3tl {
template<> struct typed_flags<Css1FrameSize> : is_typed_flags<Css1FrameSize, 0x17> {};
}
+4
View File
@@ -1057,6 +1057,8 @@ HTMLStartEndPos::HTMLStartEndPos( const SfxPoolItem& rItem, sal_Int32 nStt,
typedef std::vector<HTMLStartEndPos *> HTMLStartEndPositions;
namespace {
enum HTMLOnOffState { HTML_NOT_SUPPORTED, // unsupported Attribute
HTML_REAL_VALUE, // Attribute with value
HTML_ON_VALUE, // Attribute is On-Tag
@@ -1067,6 +1069,8 @@ enum HTMLOnOffState { HTML_NOT_SUPPORTED, // unsupported Attribute
HTML_DROPCAP_VALUE, // DropCap-Attribute
HTML_AUTOFMT_VALUE }; // Attribute for automatic character styles
}
class HTMLEndPosLst
{
HTMLStartEndPositions aStartLst; // list, sorted for start positions
+4
View File
@@ -103,8 +103,12 @@ static HTMLOptionEnum<FormSubmitEncoding> const aHTMLFormEncTypeTable[] =
{ nullptr, FormSubmitEncoding(0) }
};
namespace {
enum HTMLWordWrapMode { HTML_WM_OFF, HTML_WM_HARD, HTML_WM_SOFT };
}
static HTMLOptionEnum<HTMLWordWrapMode> const aHTMLTextAreaWrapTable[] =
{
{ OOO_STRING_SVTOOLS_HTML_WW_off, HTML_WM_OFF },
+4
View File
@@ -170,8 +170,12 @@ static CSS1PropertyEnum const aBorderWidthTable[] =
{ nullptr, 0 }
};
namespace {
enum CSS1BorderStyle { CSS1_BS_NONE, CSS1_BS_SINGLE, CSS1_BS_DOUBLE, CSS1_BS_DOTTED, CSS1_BS_DASHED, CSS1_BS_GROOVE, CSS1_BS_RIDGE, CSS1_BS_INSET, CSS1_BS_OUTSET };
}
static CSS1PropertyEnum const aBorderStyleTable[] =
{
{ "none", CSS1_BS_NONE },
+4
View File
@@ -1626,6 +1626,8 @@ namespace
}
}
namespace {
enum wwTableSprm
{
sprmNil,
@@ -1637,6 +1639,8 @@ enum wwTableSprm
sprmTDefTableNewShd, sprmTCellPadding, sprmTCellPaddingDefault
};
}
static wwTableSprm GetTableSprm(sal_uInt16 nId, ww::WordVersion eVer)
{
switch (eVer)
+4
View File
@@ -40,6 +40,8 @@ using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::xmloff::token;
namespace {
enum SvXMLTokenMapAttrs
{
XML_TOK_BGIMG_HREF,
@@ -51,6 +53,8 @@ enum SvXMLTokenMapAttrs
XML_TOK_BGIMG_FILTER,
};
}
static const SvXMLTokenMapEntry aBGImgAttributesAttrTokenMap[] =
{
{ XML_NAMESPACE_XLINK, XML_HREF, XML_TOK_BGIMG_HREF },
+4
View File
@@ -104,6 +104,8 @@ using namespace ::com::sun::star::xforms;
using namespace ::xmloff::token;
using namespace ::std;
namespace {
enum SwXMLDocTokens
{
XML_TOK_DOC_FONTDECLS,
@@ -117,6 +119,8 @@ enum SwXMLDocTokens
XML_TOK_DOC_XFORMS,
};
}
static const SvXMLTokenMapEntry aDocTokenMap[] =
{
{ XML_NAMESPACE_OFFICE, XML_FONT_FACE_DECLS, XML_TOK_DOC_FONTDECLS },
+4
View File
@@ -72,6 +72,8 @@ SvXMLImportContext *SwXMLImport::CreateMetaContext(
return pContext;
}
namespace {
enum SvXMLTokenMapAttrs
{
XML_TOK_META_STAT_TABLE = 1,
@@ -85,6 +87,8 @@ enum SvXMLTokenMapAttrs
XML_TOK_META_STAT_END=XML_TOK_UNKNOWN
};
}
struct statistic {
SvXMLTokenMapAttrs const token;
const char* name;
+4
View File
@@ -77,6 +77,8 @@ using namespace ::com::sun::star::table;
using namespace ::com::sun::star::xml::sax;
using namespace ::xmloff::token;
namespace {
enum SwXMLTableElemTokens
{
XML_TOK_TABLE_HEADER_COLS,
@@ -105,6 +107,8 @@ enum SwXMLTableCellAttrTokens
XML_TOK_TABLE_VALUE_TYPE,
};
}
static const SvXMLTokenMapEntry aTableElemTokenMap[] =
{
{ XML_NAMESPACE_TABLE, XML_TABLE_HEADER_COLUMNS,
+4
View File
@@ -58,6 +58,8 @@ using namespace ::com::sun::star::document;
using namespace ::com::sun::star::io;
using namespace ::xmloff::token;
namespace {
enum SvEmbeddedObjectTypes
{
SV_EMBEDDED_OWN,
@@ -67,6 +69,8 @@ enum SvEmbeddedObjectTypes
SV_EMBEDDED_FRAME
};
}
SwNoTextNode *SwXMLTextParagraphExport::GetNoTextNode(
const Reference < XPropertySet >& rPropSet )
{
+4
View File
@@ -730,6 +730,8 @@ bool SwFieldRefPage::MatchSubstring( const OUString& rListString, const OUString
return aListString.indexOf(aSubstr) >= 0;
}
namespace {
enum FMT_REF_IDX
{
FMT_REF_PAGE_IDX = 0,
@@ -745,6 +747,8 @@ enum FMT_REF_IDX
FMT_REF_NUMBER_FULL_CONTEXT_IDX = 10
};
}
static const char* FMT_REF_ARY[] =
{
FMT_REF_PAGE,
+5
View File
@@ -91,6 +91,8 @@ struct StringIdPair_Impl
#define MAX_PERCENT_WIDTH 254
#define MAX_PERCENT_HEIGHT 254
namespace {
enum class LB {
NONE = 0x00000000L,
Frame = 0x00000001L, // text region of the paragraph
@@ -119,6 +121,9 @@ enum class LB {
VertLine = 0x00400000L, // vertical text line
};
}
namespace o3tl {
template<> struct typed_flags<LB> : is_typed_flags<LB, 0x00773fffL> {};
}
+5
View File
@@ -359,6 +359,8 @@ void SwRevisionConfig::Load()
}
}
namespace {
enum InsertConfigProp
{
INS_PROP_TABLE_HEADER = 0,
@@ -456,6 +458,9 @@ enum InsertConfigProp
INS_PROP_CAP_OBJECT_OLEMISC_CHARACTERSTYLE, //92
INS_PROP_CAP_OBJECT_OLEMISC_APPLYATTRIBUTES //93
};
}
const Sequence<OUString>& SwInsertConfig::GetPropertyNames() const
{
static Sequence<OUString> aNames

Some files were not shown because too many files have changed in this diff Show More