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
5b6b61b0
Kaydet (Commit)
5b6b61b0
authored
May 12, 2016
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert BA flags to scoped enum
Change-Id: I22a6f41091d69ad4ed91a745e9b7cbcebd9fad55
üst
4baf56e6
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
45 deletions
+52
-45
elementexport.cxx
xmloff/source/forms/elementexport.cxx
+27
-27
elementexport.hxx
xmloff/source/forms/elementexport.hxx
+1
-1
elementimport.cxx
xmloff/source/forms/elementimport.cxx
+3
-3
formattributes.cxx
xmloff/source/forms/formattributes.cxx
+4
-4
formattributes.hxx
xmloff/source/forms/formattributes.hxx
+17
-10
No files found.
xmloff/source/forms/elementexport.cxx
Dosyayı görüntüle @
5b6b61b0
...
...
@@ -238,7 +238,7 @@ namespace xmloff
,
m_nIncludeDatabase
(
DAFlags
::
NONE
)
,
m_nIncludeSpecial
(
0
)
,
m_nIncludeEvents
(
0
)
,
m_nIncludeBindings
(
0
)
,
m_nIncludeBindings
(
BAFlags
::
NONE
)
,
m_pOuterElement
(
nullptr
)
{
OSL_ENSURE
(
m_xProps
.
is
(),
"OControlExport::OControlExport: invalid arguments!"
);
...
...
@@ -902,56 +902,56 @@ namespace xmloff
void
OControlExport
::
exportBindingAtributes
()
{
#if OSL_DEBUG_LEVEL > 0
sal_Int32
nIncludeBinding
=
m_nIncludeBindings
;
BAFlags
nIncludeBinding
=
m_nIncludeBindings
;
#endif
if
(
m_nIncludeBindings
&
BA
_LINKED_CELL
)
if
(
m_nIncludeBindings
&
BA
Flags
::
LinkedCell
)
{
exportCellBindingAttributes
(
(
m_nIncludeBindings
&
BA_LIST_LINKING_TYPE
)
!=
0
);
exportCellBindingAttributes
(
bool
(
m_nIncludeBindings
&
BAFlags
::
ListLinkingType
)
);
#if OSL_DEBUG_LEVEL > 0
// reset the bit for later checking
nIncludeBinding
=
nIncludeBinding
&
~
(
BA_LINKED_CELL
|
BA_LIST_LINKING_TYPE
);
nIncludeBinding
=
nIncludeBinding
&
~
BAFlags
(
BAFlags
::
LinkedCell
|
BAFlags
::
ListLinkingType
);
#endif
}
if
(
m_nIncludeBindings
&
BA
_LIST_CELL_RANGE
)
if
(
m_nIncludeBindings
&
BA
Flags
::
ListCellRange
)
{
exportCellListSourceRange
();
#if OSL_DEBUG_LEVEL > 0
// reset the bit for later checking
nIncludeBinding
=
nIncludeBinding
&
~
BA
_LIST_CELL_RANGE
;
nIncludeBinding
=
nIncludeBinding
&
~
BA
Flags
::
ListCellRange
;
#endif
}
if
(
m_nIncludeBindings
&
BA
_XFORMS_BIND
)
if
(
m_nIncludeBindings
&
BA
Flags
::
XFormsBind
)
{
exportXFormsBindAttributes
();
#if OSL_DEBUG_LEVEL > 0
// reset the bit for later checking
nIncludeBinding
=
nIncludeBinding
&
~
BA
_XFORMS_BIND
;
nIncludeBinding
=
nIncludeBinding
&
~
BA
Flags
::
XFormsBind
;
#endif
}
if
(
m_nIncludeBindings
&
BA
_XFORMS_LISTBIND
)
if
(
m_nIncludeBindings
&
BA
Flags
::
XFormsListBind
)
{
exportXFormsListAttributes
();
#if OSL_DEBUG_LEVEL > 0
// reset the bit for later checking
nIncludeBinding
=
nIncludeBinding
&
~
BA
_XFORMS_LISTBIND
;
nIncludeBinding
=
nIncludeBinding
&
~
BA
Flags
::
XFormsListBind
;
#endif
}
if
(
m_nIncludeBindings
&
BA
_XFORMS_SUBMISSION
)
if
(
m_nIncludeBindings
&
BA
Flags
::
XFormsSubmission
)
{
exportXFormsSubmissionAttributes
();
#if OSL_DEBUG_LEVEL > 0
// reset the bit for later checking
nIncludeBinding
=
nIncludeBinding
&
~
BA
_XFORMS_SUBMISSION
;
nIncludeBinding
=
nIncludeBinding
&
~
BA
Flags
::
XFormsSubmission
;
#endif
}
#if OSL_DEBUG_LEVEL > 0
OSL_ENSURE
(
0
==
nIncludeBinding
,
OSL_ENSURE
(
BAFlags
::
NONE
==
nIncludeBinding
,
"OControlExport::exportBindingAtributes: forgot some flags!"
);
// in the debug version, we should have removed every bit we handled from the mask, so it should
// be 0 now ...
...
...
@@ -1441,7 +1441,7 @@ namespace xmloff
void
OControlExport
::
examine
()
{
OSL_ENSURE
(
(
m_nIncludeCommon
==
CCAFlags
::
NONE
)
&&
(
m_nIncludeSpecial
==
0
)
&&
(
m_nIncludeDatabase
==
DAFlags
::
NONE
)
&&
(
m_nIncludeEvents
==
0
)
&&
(
m_nIncludeBindings
==
0
),
&&
(
m_nIncludeEvents
==
0
)
&&
(
m_nIncludeBindings
==
BAFlags
::
NONE
),
"OControlExport::examine: called me twice? Not initialized?"
);
// get the class id to decide which kind of element we need in the XML stream
...
...
@@ -1735,35 +1735,35 @@ namespace xmloff
{
if
(
FormCellBindingHelper
::
isCellBinding
(
aHelper
.
getCurrentBinding
(
)
)
)
{
m_nIncludeBindings
|=
BA
_LINKED_CELL
;
m_nIncludeBindings
|=
BA
Flags
::
LinkedCell
;
if
(
m_nClassId
==
FormComponentType
::
LISTBOX
)
m_nIncludeBindings
|=
BA
_LIST_LINKING_TYPE
;
m_nIncludeBindings
|=
BA
Flags
::
ListLinkingType
;
}
}
// is it a list-like control which uses a calc cell range as list source?
{
if
(
FormCellBindingHelper
::
isCellRangeListSource
(
aHelper
.
getCurrentListSource
(
)
)
)
m_nIncludeBindings
|=
BA
_LIST_CELL_RANGE
;
m_nIncludeBindings
|=
BA
Flags
::
ListCellRange
;
}
}
// is control bound to XForms?
if
(
!
getXFormsBindName
(
m_xProps
).
isEmpty
()
)
{
m_nIncludeBindings
|=
BA
_XFORMS_BIND
;
m_nIncludeBindings
|=
BA
Flags
::
XFormsBind
;
}
// is (list-)control bound to XForms list?
if
(
!
getXFormsListBindName
(
m_xProps
).
isEmpty
()
)
{
m_nIncludeBindings
|=
BA
_XFORMS_LISTBIND
;
m_nIncludeBindings
|=
BA
Flags
::
XFormsListBind
;
}
// does the control have an XForms submission?
if
(
!
getXFormsSubmissionName
(
m_xProps
).
isEmpty
()
)
{
m_nIncludeBindings
|=
BA
_XFORMS_SUBMISSION
;
m_nIncludeBindings
|=
BA
Flags
::
XFormsSubmission
;
}
}
...
...
@@ -1777,8 +1777,8 @@ namespace xmloff
if
(
xBinding
.
is
()
)
{
AddAttribute
(
OAttributeMetaData
::
getBindingAttributeNamespace
(
BA
_LINKED_CELL
),
OAttributeMetaData
::
getBindingAttributeName
(
BA
_LINKED_CELL
),
OAttributeMetaData
::
getBindingAttributeNamespace
(
BA
Flags
::
LinkedCell
),
OAttributeMetaData
::
getBindingAttributeName
(
BA
Flags
::
LinkedCell
),
aHelper
.
getStringAddressFromCellBinding
(
xBinding
)
);
...
...
@@ -1794,8 +1794,8 @@ namespace xmloff
);
AddAttribute
(
OAttributeMetaData
::
getBindingAttributeNamespace
(
BA
_LIST_LINKING_TYPE
),
OAttributeMetaData
::
getBindingAttributeName
(
BA
_LIST_LINKING_TYPE
),
OAttributeMetaData
::
getBindingAttributeNamespace
(
BA
Flags
::
ListLinkingType
),
OAttributeMetaData
::
getBindingAttributeName
(
BA
Flags
::
ListLinkingType
),
sBuffer
.
makeStringAndClear
()
);
}
...
...
@@ -1838,8 +1838,8 @@ namespace xmloff
FormCellBindingHelper
aHelper
(
m_xProps
,
nullptr
);
AddAttribute
(
OAttributeMetaData
::
getBindingAttributeNamespace
(
BA
_LIST_CELL_RANGE
),
OAttributeMetaData
::
getBindingAttributeName
(
BA
_LIST_CELL_RANGE
),
OAttributeMetaData
::
getBindingAttributeNamespace
(
BA
Flags
::
ListCellRange
),
OAttributeMetaData
::
getBindingAttributeName
(
BA
Flags
::
ListCellRange
),
aHelper
.
getStringAddressFromCellListSource
(
xSource
)
);
}
...
...
xmloff/source/forms/elementexport.hxx
Dosyayı görüntüle @
5b6b61b0
...
...
@@ -98,7 +98,7 @@ namespace xmloff
DAFlags
m_nIncludeDatabase
;
// common database attributes to include
sal_Int32
m_nIncludeSpecial
;
// special attributes to include
sal_Int32
m_nIncludeEvents
;
// events to include
sal_Int32
m_nIncludeBindings
;
// binding attributes to include
BAFlags
m_nIncludeBindings
;
// binding attributes to include
SvXMLElementExport
*
m_pOuterElement
;
// XML element doing the concrete startElement etc. for the outer element
...
...
xmloff/source/forms/elementimport.cxx
Dosyayı görüntüle @
5b6b61b0
...
...
@@ -701,7 +701,7 @@ namespace xmloff
bool
OControlImport
::
handleAttribute
(
sal_uInt16
_nNamespaceKey
,
const
OUString
&
_rLocalName
,
const
OUString
&
_rValue
)
{
static
const
sal_Char
*
pLinkedCellAttributeName
=
OAttributeMetaData
::
getBindingAttributeName
(
BA
_LINKED_CELL
);
static
const
sal_Char
*
pLinkedCellAttributeName
=
OAttributeMetaData
::
getBindingAttributeName
(
BA
Flags
::
LinkedCell
);
if
(
IsXMLToken
(
_rLocalName
,
XML_ID
))
{
// it's the control id
...
...
@@ -1669,13 +1669,13 @@ namespace xmloff
return
true
;
}
if
(
_rLocalName
.
equalsAscii
(
OAttributeMetaData
::
getBindingAttributeName
(
BA
_LIST_CELL_RANGE
)
)
)
if
(
_rLocalName
.
equalsAscii
(
OAttributeMetaData
::
getBindingAttributeName
(
BA
Flags
::
ListCellRange
)
)
)
{
m_sCellListSource
=
_rValue
;
return
true
;
}
if
(
_rLocalName
.
equalsAscii
(
OAttributeMetaData
::
getBindingAttributeName
(
BA
_LIST_LINKING_TYPE
)
)
)
if
(
_rLocalName
.
equalsAscii
(
OAttributeMetaData
::
getBindingAttributeName
(
BA
Flags
::
ListLinkingType
)
)
)
{
sal_Int16
nLinkageType
=
0
;
PropertyConversion
::
convertString
(
...
...
xmloff/source/forms/formattributes.cxx
Dosyayı görüntüle @
5b6b61b0
...
...
@@ -140,13 +140,13 @@ namespace xmloff
return
""
;
}
const
sal_Char
*
OAttributeMetaData
::
getBindingAttributeName
(
sal_Int32
_nId
)
const
sal_Char
*
OAttributeMetaData
::
getBindingAttributeName
(
BAFlags
_nId
)
{
switch
(
_nId
)
{
case
BA
_LINKED_CELL
:
return
"linked-cell"
;
case
BA
_LIST_LINKING_TYPE
:
return
"list-linkage-type"
;
case
BA
_LIST_CELL_RANGE
:
return
"source-cell-range"
;
case
BA
Flags
:
:
LinkedCell
:
return
"linked-cell"
;
case
BA
Flags
:
:
ListLinkingType
:
return
"list-linkage-type"
;
case
BA
Flags
:
:
ListCellRange
:
return
"source-cell-range"
;
default
:
OSL_FAIL
(
"OAttributeMetaData::getBindingAttributeName: invalid id (maybe you or-ed two flags?)!"
);
}
...
...
xmloff/source/forms/formattributes.hxx
Dosyayı görüntüle @
5b6b61b0
...
...
@@ -79,17 +79,24 @@ namespace o3tl {
template
<>
struct
typed_flags
<
DAFlags
>
:
is_typed_flags
<
DAFlags
,
0x003f
>
{};
}
// flags for binding related control attributes
enum
class
BAFlags
{
NONE
=
0x0000
,
LinkedCell
=
0x0001
,
ListLinkingType
=
0x0002
,
ListCellRange
=
0x0004
,
XFormsBind
=
0x0008
,
XFormsListBind
=
0x0010
,
XFormsSubmission
=
0x0020
};
namespace
o3tl
{
template
<>
struct
typed_flags
<
BAFlags
>
:
is_typed_flags
<
BAFlags
,
0x003f
>
{};
}
namespace
xmloff
{
// flags for binding related control attributes
#define BA_LINKED_CELL 0x00000001
#define BA_LIST_LINKING_TYPE 0x00000002
#define BA_LIST_CELL_RANGE 0x00000004
#define BA_XFORMS_BIND 0x00000008
#define BA_XFORMS_LISTBIND 0x00000010
#define BA_XFORMS_SUBMISSION 0x00000020
// flags for event attributes
#define EA_CONTROL_EVENTS 0x00000001
#define EA_ON_CHANGE 0x00000002
...
...
@@ -211,13 +218,13 @@ namespace xmloff
@param _nId
the id of the attribute. Has to be one of the BA_* constants.
*/
static
const
sal_Char
*
getBindingAttributeName
(
sal_Int32
_nId
);
static
const
sal_Char
*
getBindingAttributeName
(
BAFlags
_nId
);
/** calculates the xml namespace key to use for a binding attribute.
@param _nId
the id of the attribute. Has to be one of the BA_* constants.
*/
static
inline
sal_uInt16
getBindingAttributeNamespace
(
sal_Int32
)
static
inline
sal_uInt16
getBindingAttributeNamespace
(
BAFlags
)
{
// nothing special here
return
XML_NAMESPACE_FORM
;
...
...
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