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
f0fdee8a
Kaydet (Commit)
f0fdee8a
authored
Haz 07, 2014
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
oox: replace redundant STATIC_ARRAY_SIZE macro with SAL_N_ELEMENTS
Change-Id: I8cf274902bb5fda9fa70ab2af9e399db82d85d1d
üst
effb5781
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
13 deletions
+10
-13
helper.hxx
include/oox/helper/helper.hxx
+3
-6
xmlfilterbase.cxx
oox/source/core/xmlfilterbase.cxx
+1
-1
defnamesbuffer.cxx
sc/source/filter/oox/defnamesbuffer.cxx
+4
-4
drawingmanager.cxx
sc/source/filter/oox/drawingmanager.cxx
+1
-1
stylesbuffer.cxx
sc/source/filter/oox/stylesbuffer.cxx
+1
-1
No files found.
include/oox/helper/helper.hxx
Dosyayı görüntüle @
f0fdee8a
...
...
@@ -23,6 +23,7 @@
#include <algorithm>
#include <limits>
#include <boost/static_assert.hpp>
#include <sal/macros.h>
#include <osl/endian.h>
#include <rtl/math.hxx>
#include <rtl/string.hxx>
...
...
@@ -33,19 +34,15 @@ namespace oox {
// Helper macros ==============================================================
/** Expands to the number of elements in a STATIC data array. */
#define STATIC_ARRAY_SIZE( array ) \
(sizeof(array)/sizeof(*(array)))
/** Expands to a pointer behind the last element of a STATIC data array (like
STL end()). */
#define STATIC_ARRAY_END( array ) \
((array)+S
TATIC_ARRAY_SIZE
(array))
((array)+S
AL_N_ELEMENTS
(array))
/** Expands to the 'index'-th element of a STATIC data array, or to 'def', if
'index' is out of the array limits. */
#define STATIC_ARRAY_SELECT( array, index, def ) \
((static_cast<size_t>(index) < S
TATIC_ARRAY_SIZE
(array)) ? ((array)[static_cast<size_t>(index)]) : (def))
((static_cast<size_t>(index) < S
AL_N_ELEMENTS
(array)) ? ((array)[static_cast<size_t>(index)]) : (def))
/** Expands to a temporary OString, created from a literal(!) character
array. */
...
...
oox/source/core/xmlfilterbase.cxx
Dosyayı görüntüle @
f0fdee8a
...
...
@@ -142,7 +142,7 @@ struct NamespaceIds: public rtl::StaticWithInit<
NMSP_xlsExtLst
};
Sequence
<
beans
::
Pair
<
OUString
,
sal_Int32
>
>
aRet
(
S
TATIC_ARRAY_SIZE
(
namespaceIds
));
Sequence
<
beans
::
Pair
<
OUString
,
sal_Int32
>
>
aRet
(
S
AL_N_ELEMENTS
(
namespaceIds
));
for
(
sal_Int32
i
=
0
;
i
<
aRet
.
getLength
();
++
i
)
aRet
[
i
]
=
make_Pair
(
OUString
::
createFromAscii
(
namespaceURIs
[
i
]),
...
...
sc/source/filter/oox/defnamesbuffer.cxx
Dosyayı görüntüle @
f0fdee8a
...
...
@@ -81,9 +81,9 @@ const sal_Char* const sppcBaseNames[] =
OUString
lclGetBaseName
(
sal_Unicode
cBuiltinId
)
{
OSL_ENSURE
(
cBuiltinId
<
S
TATIC_ARRAY_SIZE
(
sppcBaseNames
),
"lclGetBaseName - unsupported built-in identifier"
);
OSL_ENSURE
(
cBuiltinId
<
S
AL_N_ELEMENTS
(
sppcBaseNames
),
"lclGetBaseName - unsupported built-in identifier"
);
OUStringBuffer
aBuffer
;
if
(
cBuiltinId
<
S
TATIC_ARRAY_SIZE
(
sppcBaseNames
)
)
if
(
cBuiltinId
<
S
AL_N_ELEMENTS
(
sppcBaseNames
)
)
aBuffer
.
appendAscii
(
sppcBaseNames
[
cBuiltinId
]
);
else
aBuffer
.
append
(
static_cast
<
sal_Int32
>
(
cBuiltinId
)
);
...
...
@@ -102,7 +102,7 @@ sal_Unicode lclGetBuiltinIdFromPrefixedName( const OUString& rModelName )
sal_Int32
nPrefixLen
=
aPrefix
.
getLength
();
if
(
rModelName
.
matchIgnoreAsciiCase
(
aPrefix
)
)
{
for
(
sal_Unicode
cBuiltinId
=
0
;
cBuiltinId
<
S
TATIC_ARRAY_SIZE
(
sppcBaseNames
);
++
cBuiltinId
)
for
(
sal_Unicode
cBuiltinId
=
0
;
cBuiltinId
<
S
AL_N_ELEMENTS
(
sppcBaseNames
);
++
cBuiltinId
)
{
OUString
aBaseName
=
lclGetBaseName
(
cBuiltinId
);
sal_Int32
nBaseNameLen
=
aBaseName
.
getLength
();
...
...
@@ -116,7 +116,7 @@ sal_Unicode lclGetBuiltinIdFromPrefixedName( const OUString& rModelName )
/** returns the built-in name identifier from a built-in base name, e.g. 'Print_Area'. */
sal_Unicode
lclGetBuiltinIdFromBaseName
(
const
OUString
&
rModelName
)
{
for
(
sal_Unicode
cBuiltinId
=
0
;
cBuiltinId
<
S
TATIC_ARRAY_SIZE
(
sppcBaseNames
);
++
cBuiltinId
)
for
(
sal_Unicode
cBuiltinId
=
0
;
cBuiltinId
<
S
AL_N_ELEMENTS
(
sppcBaseNames
);
++
cBuiltinId
)
if
(
rModelName
.
equalsIgnoreAsciiCaseAscii
(
sppcBaseNames
[
cBuiltinId
]
)
)
return
cBuiltinId
;
return
BIFF_DEFNAME_UNKNOWN
;
...
...
sc/source/filter/oox/drawingmanager.cxx
Dosyayı görüntüle @
f0fdee8a
...
...
@@ -337,7 +337,7 @@ void BiffDrawingObjectBase::convertFillProperties( ShapePropertyMap& rPropMap, c
{ 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00 },
{ 0x80, 0x00, 0x08, 0x00, 0x80, 0x00, 0x08, 0x00 }
};
const sal_uInt8* const pnPattern = sppnPatterns[ ::std::min< size_t >( rFillData.mnPattern - 2, S
TATIC_ARRAY_SIZE
( sppnPatterns ) ) ];
const sal_uInt8* const pnPattern = sppnPatterns[ ::std::min< size_t >( rFillData.mnPattern - 2, S
AL_N_ELEMENTS
( sppnPatterns ) ) ];
// create 2-colored 8x8 DIB
SvMemoryStream aMemStrm;
// { 0x0C, 0x00, 0x00, 0x00, 0x08, 0x00, 0x08, 0x00, 0x01, 0x00, 0x01, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00 }
...
...
sc/source/filter/oox/stylesbuffer.cxx
Dosyayı görüntüle @
f0fdee8a
...
...
@@ -2503,7 +2503,7 @@ const sal_Char* const sppcStyleNames[] =
"60% - Accent6"
,
"Explanatory Text"
};
const
sal_Int32
snStyleNamesCount
=
static_cast
<
sal_Int32
>
(
S
TATIC_ARRAY_SIZE
(
sppcStyleNames
)
);
const
sal_Int32
snStyleNamesCount
=
static_cast
<
sal_Int32
>
(
S
AL_N_ELEMENTS
(
sppcStyleNames
)
);
OUString
lclGetBuiltinStyleName
(
sal_Int32
nBuiltinId
,
const
OUString
&
rName
,
sal_Int32
nLevel
=
0
)
{
...
...
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