Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e82fe5f0
Kaydet (Commit)
e82fe5f0
authored
May 12, 2016
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert BOOL_ATTR to scoped enum
Change-Id: I7991c6d05503dcbc1e5fd45d07227b766c409f65
üst
8bcacdc8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
18 deletions
+23
-18
elementexport.cxx
xmloff/source/forms/elementexport.cxx
+7
-7
propertyexport.cxx
xmloff/source/forms/propertyexport.cxx
+4
-4
propertyexport.hxx
xmloff/source/forms/propertyexport.hxx
+12
-7
No files found.
xmloff/source/forms/elementexport.cxx
Dosyayı görüntüle @
e82fe5f0
...
...
@@ -579,9 +579,9 @@ namespace xmloff
PROPERTY_READONLY
,
PROPERTY_DEFAULT_STATE
,
PROPERTY_TABSTOP
,
PROPERTY_ENABLEVISIBLE
};
static
const
sal_Int8
nBooleanPropertyAttrFlags
[]
=
static
const
BoolAttrFlags
nBooleanPropertyAttrFlags
[]
=
{
// attribute defaults
B
OOLATTR_DEFAULT_FALSE
,
BOOLATTR_DEFAULT_FALSE
|
BOOLATTR_INVERSE_SEMANTICS
,
BOOLATTR_DEFAULT_FALSE
,
BOOLATTR_DEFAULT_TRUE
,
BOOLATTR_DEFAULT_FALSE
,
BOOLATTR_DEFAULT_FALSE
,
BOOLATTR_DEFAULT_VOID
,
BOOLATTR_DEFAULT_FALSE
B
oolAttrFlags
::
DefaultFalse
,
BoolAttrFlags
::
DefaultFalse
|
BoolAttrFlags
::
InverseSemantics
,
BoolAttrFlags
::
DefaultFalse
,
BoolAttrFlags
::
DefaultTrue
,
BoolAttrFlags
::
DefaultFalse
,
BoolAttrFlags
::
DefaultFalse
,
BoolAttrFlags
::
DefaultVoid
,
BoolAttrFlags
::
DefaultFalse
};
#if OSL_DEBUG_LEVEL > 0
static
const
sal_Int32
nIdCount
=
SAL_N_ELEMENTS
(
nBooleanPropertyAttributeIds
);
...
...
@@ -843,7 +843,7 @@ namespace xmloff
OAttributeMetaData
::
getDatabaseAttributeNamespace
(
DA_INPUT_REQUIRED
),
OAttributeMetaData
::
getDatabaseAttributeName
(
DA_INPUT_REQUIRED
),
PROPERTY_INPUT_REQUIRED
,
B
OOLATTR_DEFAULT_TRUE
B
oolAttrFlags
::
DefaultTrue
);
RESET_BIT
(
nIncludeDatabase
,
DA_INPUT_REQUIRED
);
}
...
...
@@ -867,7 +867,7 @@ namespace xmloff
OAttributeMetaData
::
getDatabaseAttributeNamespace
(
DA_CONVERT_EMPTY
),
OAttributeMetaData
::
getDatabaseAttributeName
(
DA_CONVERT_EMPTY
),
PROPERTY_EMPTY_IS_NULL
,
B
OOLATTR_DEFAULT_FALSE
B
oolAttrFlags
::
DefaultFalse
);
RESET_BIT
(
nIncludeDatabase
,
DA_CONVERT_EMPTY
);
}
...
...
@@ -992,7 +992,7 @@ namespace xmloff
OAttributeMetaData
::
getSpecialAttributeNamespace
(
*
pAttributeId
),
OAttributeMetaData
::
getSpecialAttributeName
(
*
pAttributeId
),
OUString
::
createFromAscii
(
pBooleanPropertyNames
[
i
]),
(
*
pAttributeId
==
SCA_FOCUS_ON_CLICK
)
?
B
OOLATTR_DEFAULT_TRUE
:
BOOLATTR_DEFAULT_FALSE
(
*
pAttributeId
==
SCA_FOCUS_ON_CLICK
)
?
B
oolAttrFlags
::
DefaultTrue
:
BoolAttrFlags
::
DefaultFalse
);
#if OSL_DEBUG_LEVEL > 0
// reset the bit for later checking
...
...
@@ -2142,9 +2142,9 @@ namespace xmloff
PROPERTY_ESCAPEPROCESSING
,
PROPERTY_IGNORERESULT
};
static
const
sal_Int8
nBooleanPropertyAttrFlags
[]
=
static
const
BoolAttrFlags
nBooleanPropertyAttrFlags
[]
=
{
B
OOLATTR_DEFAULT_TRUE
,
BOOLATTR_DEFAULT_TRUE
,
BOOLATTR_DEFAULT_TRUE
,
BOOLATTR_DEFAULT_FALSE
,
BOOLATTR_DEFAULT_TRUE
,
BOOLATTR_DEFAULT_FALSE
B
oolAttrFlags
::
DefaultTrue
,
BoolAttrFlags
::
DefaultTrue
,
BoolAttrFlags
::
DefaultTrue
,
BoolAttrFlags
::
DefaultFalse
,
BoolAttrFlags
::
DefaultTrue
,
BoolAttrFlags
::
DefaultFalse
};
static
const
sal_Int32
nIdCount
=
SAL_N_ELEMENTS
(
eBooleanPropertyIds
);
#if OSL_DEBUG_LEVEL > 0
...
...
xmloff/source/forms/propertyexport.cxx
Dosyayı görüntüle @
e82fe5f0
...
...
@@ -268,14 +268,14 @@ namespace xmloff
}
void
OPropertyExport
::
exportBooleanPropertyAttribute
(
const
sal_uInt16
_nNamespaceKey
,
const
sal_Char
*
_pAttributeName
,
const
OUString
&
_rPropertyName
,
const
sal_Int8
_nBooleanAttributeFlags
)
const
OUString
&
_rPropertyName
,
const
BoolAttrFlags
_nBooleanAttributeFlags
)
{
DBG_CHECK_PROPERTY_NO_TYPE
(
_rPropertyName
);
// no check of the property value type: this method is allowed to be called with any integer properties
// (e.g. sal_Int32, sal_uInt16 etc)
bool
bDefault
=
(
B
OOLATTR_DEFAULT_TRUE
==
(
BOOLATTR_DEFAULT_MASK
&
_nBooleanAttributeFlags
));
bool
bDefaultVoid
=
(
B
OOLATTR_DEFAULT_VOID
==
(
BOOLATTR_DEFAULT_MASK
&
_nBooleanAttributeFlags
));
bool
bDefault
=
(
B
oolAttrFlags
::
DefaultTrue
==
(
BoolAttrFlags
::
DefaultMask
&
_nBooleanAttributeFlags
));
bool
bDefaultVoid
=
(
B
oolAttrFlags
::
DefaultVoid
==
(
BoolAttrFlags
::
DefaultMask
&
_nBooleanAttributeFlags
));
// get the value
bool
bCurrentValue
=
bDefault
;
...
...
@@ -285,7 +285,7 @@ namespace xmloff
bCurrentValue
=
::
cppu
::
any2bool
(
aCurrentValue
);
// this will extract a boolean value even if the Any contains a int or short or something like that ...
if
(
_nBooleanAttributeFlags
&
B
OOLATTR_INVERSE_SEMANTICS
)
if
(
_nBooleanAttributeFlags
&
B
oolAttrFlags
::
InverseSemantics
)
bCurrentValue
=
!
bCurrentValue
;
// we have a non-void current value
...
...
xmloff/source/forms/propertyexport.hxx
Dosyayı görüntüle @
e82fe5f0
...
...
@@ -31,15 +31,20 @@
#include "callbacks.hxx"
#include "strings.hxx"
enum
class
BoolAttrFlags
{
DefaultFalse
=
0x00
,
DefaultTrue
=
0x01
,
DefaultVoid
=
0x02
,
DefaultMask
=
0x03
,
InverseSemantics
=
0x04
,
};
namespace
o3tl
{
template
<>
struct
typed_flags
<
BoolAttrFlags
>
:
is_typed_flags
<
BoolAttrFlags
,
0x0a
>
{};
}
namespace
xmloff
{
#define BOOLATTR_DEFAULT_FALSE 0x00
#define BOOLATTR_DEFAULT_TRUE 0x01
#define BOOLATTR_DEFAULT_VOID 0x02
#define BOOLATTR_DEFAULT_MASK 0x03
#define BOOLATTR_INVERSE_SEMANTICS 0x04
// if sal_True, indicates that the semantic of the property referred by <arg>_pPropertyName</arg>
// is inverse to the semantic of the XML attribute.<br/>
// I.e. if the property value is <TRUE/>, <FALSE/> has to be written and vice versa.
...
...
@@ -146,7 +151,7 @@ namespace xmloff
const
sal_uInt16
_nNamespaceKey
,
const
sal_Char
*
_pAttributeName
,
const
OUString
&
_rPropertyName
,
const
sal_Int8
_nBooleanAttributeFlags
);
const
BoolAttrFlags
_nBooleanAttributeFlags
);
/** add an attribute which is represented by a sal_Int16 property to the export context
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment