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
1800862c
Kaydet (Commit)
1800862c
authored
Kas 25, 2016
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:stringconstant: look into 'char const * const var = "..."'
Change-Id: I52a97b8ec273509131c2200e47527221cb62d7ee
üst
b33b4413
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
47 additions
and
58 deletions
+47
-58
stringconstant.cxx
compilerplugins/clang/stringconstant.cxx
+36
-36
axfontdata.hxx
include/oox/ole/axfontdata.hxx
+0
-3
axfontdata.cxx
oox/source/ole/axfontdata.cxx
+1
-1
test_oustring_compare.cxx
sal/qa/rtl/strings/test_oustring_compare.cxx
+3
-3
defnamesbuffer.cxx
sc/source/filter/oox/defnamesbuffer.cxx
+4
-6
stylesbuffer.cxx
sc/source/filter/oox/stylesbuffer.cxx
+1
-3
scripthandler.cxx
scripting/source/protocolhandler/scripthandler.cxx
+2
-6
No files found.
compilerplugins/clang/stringconstant.cxx
Dosyayı görüntüle @
1800862c
...
...
@@ -929,21 +929,17 @@ bool StringConstant::isStringConstant(
// Look inside RTL_CONSTASCII_STRINGPARAM:
if
(
loplugin
::
TypeCheck
(
t
).
Pointer
().
Const
().
Char
())
{
auto
e2
=
dyn_cast
<
UnaryOperator
>
(
expr
);
if
(
e2
==
nullptr
||
e2
->
getOpcode
()
!=
UO_AddrOf
)
{
return
false
;
}
auto
e3
=
dyn_cast
<
ArraySubscriptExpr
>
(
e2
->
getSubExpr
()
->
IgnoreParenImpCasts
());
if
(
e3
==
nullptr
||
!
isZero
(
e3
->
getIdx
()
->
IgnoreParenImpCasts
()))
{
return
false
;
if
(
e2
!=
nullptr
&&
e2
->
getOpcode
()
==
UO_AddrOf
)
{
auto
e3
=
dyn_cast
<
ArraySubscriptExpr
>
(
e2
->
getSubExpr
()
->
IgnoreParenImpCasts
());
if
(
e3
==
nullptr
||
!
isZero
(
e3
->
getIdx
()
->
IgnoreParenImpCasts
()))
{
return
false
;
}
expr
=
e3
->
getBase
()
->
IgnoreParenImpCasts
();
t
=
expr
->
getType
();
}
expr
=
e3
->
getBase
()
->
IgnoreParenImpCasts
();
t
=
expr
->
getType
();
}
if
(
!
(
t
->
isConstantArrayType
()
&&
t
.
isConstQualified
()
&&
(
loplugin
::
TypeCheck
(
t
->
getAsArrayTypeUnsafe
()
->
getElementType
())
.
Char
())))
{
if
(
!
t
.
isConstQualified
())
{
return
false
;
}
DeclRefExpr
const
*
dre
=
dyn_cast
<
DeclRefExpr
>
(
expr
);
...
...
@@ -956,6 +952,14 @@ bool StringConstant::isStringConstant(
}
}
}
if
(
!
(
loplugin
::
TypeCheck
(
t
).
Pointer
().
Const
().
Char
()
||
(
t
->
isConstantArrayType
()
&&
(
loplugin
::
TypeCheck
(
t
->
getAsArrayTypeUnsafe
()
->
getElementType
())
.
Char
()))))
{
return
false
;
}
StringLiteral
const
*
lit
=
dyn_cast
<
StringLiteral
>
(
expr
);
if
(
lit
!=
nullptr
)
{
if
(
!
lit
->
isAscii
())
{
...
...
@@ -986,7 +990,9 @@ bool StringConstant::isStringConstant(
case
APValue
:
:
LValue
:
{
Expr
const
*
e
=
v
.
getLValueBase
().
dyn_cast
<
Expr
const
*>
();
assert
(
e
!=
nullptr
);
//TODO???
if
(
e
==
nullptr
)
{
return
false
;
}
if
(
!
v
.
getLValueOffset
().
isZero
())
{
return
false
;
//TODO
}
...
...
@@ -1140,6 +1146,12 @@ void StringConstant::reportChange(
<<
call
->
getSourceRange
();
return
;
}
report
(
DiagnosticsEngine
::
Warning
,
"TODO call inside %0"
,
getMemberLocation
(
expr
))
<<
fdecl
->
getQualifiedNameAsString
()
<<
expr
->
getSourceRange
();
return
;
}
else
{
assert
(
pass
==
PassThrough
::
NonEmptyConstantString
);
if
((
dc
.
Function
(
"equals"
).
Class
(
"OUString"
)
...
...
@@ -1160,29 +1172,17 @@ void StringConstant::reportChange(
<<
expr
->
getSourceRange
();
return
;
}
if
((
dc
.
Operator
(
OO_Plus
).
Namespace
(
"rtl"
)
.
GlobalNamespace
())
||
(
dc
.
Operator
(
OO_Plus
).
Class
(
"OUString"
)
.
Namespace
(
"rtl"
).
GlobalNamespace
()))
{
report
(
DiagnosticsEngine
::
Warning
,
(
"rewrite call of "
+
original
+
" with "
+
describeChangeKind
(
kind
)
+
(
" in call of %0 as (implicit) construction"
" of rtl::OUString"
)),
getMemberLocation
(
expr
))
<<
fdecl
->
getQualifiedNameAsString
()
<<
expr
->
getSourceRange
();
return
;
}
report
(
DiagnosticsEngine
::
Warning
,
(
"rewrite call of "
+
original
+
" with "
+
describeChangeKind
(
kind
)
+
(
" in call of %0 as (implicit) construction of"
" rtl::OUString"
)),
getMemberLocation
(
expr
))
<<
fdecl
->
getQualifiedNameAsString
()
<<
expr
->
getSourceRange
();
return
;
}
report
(
DiagnosticsEngine
::
Warning
,
"TODO call inside %0"
,
getMemberLocation
(
expr
))
<<
fdecl
->
getQualifiedNameAsString
()
<<
expr
->
getSourceRange
();
return
;
}
else
if
(
isa
<
CXXConstructExpr
>
(
call
))
{
auto
cdecl
=
cast
<
CXXConstructExpr
>
(
call
)
->
getConstructor
()
->
getParent
();
...
...
include/oox/ole/axfontdata.hxx
Dosyayı görüntüle @
1800862c
...
...
@@ -32,9 +32,6 @@ namespace oox {
namespace
oox
{
namespace
ole
{
const
sal_Char
*
const
AX_GUID_CFONT
=
"{AFC20920-DA4E-11CE-B943-00AA006887B4}"
;
const
sal_uInt32
AX_FONTDATA_BOLD
=
0x00000001
;
const
sal_uInt32
AX_FONTDATA_ITALIC
=
0x00000002
;
const
sal_uInt32
AX_FONTDATA_UNDERLINE
=
0x00000004
;
...
...
oox/source/ole/axfontdata.cxx
Dosyayı görüntüle @
1800862c
...
...
@@ -102,7 +102,7 @@ bool AxFontData::importStdFont( BinaryInputStream& rInStrm )
bool
AxFontData
::
importGuidAndFont
(
BinaryInputStream
&
rInStrm
)
{
OUString
aGuid
=
OleHelper
::
importGuid
(
rInStrm
);
if
(
aGuid
.
equalsAscii
(
AX_GUID_CFONT
)
)
if
(
aGuid
==
"{AFC20920-DA4E-11CE-B943-00AA006887B4}"
)
return
importBinaryModel
(
rInStrm
);
if
(
aGuid
==
OLE_GUID_STDFONT
)
return
importStdFont
(
rInStrm
);
...
...
sal/qa/rtl/strings/test_oustring_compare.cxx
Dosyayı görüntüle @
1800862c
...
...
@@ -45,9 +45,9 @@ CPPUNIT_TEST_SUITE_REGISTRATION(test::oustring::Compare);
void
test
::
oustring
::
Compare
::
equalsIgnoreAsciiCaseAscii
()
{
const
char
*
const
abc
=
"abc"
;
const
char
*
const
abcd
=
"abcd"
;
const
char
*
const
empty
=
""
;
const
char
*
abc
=
"abc"
;
const
char
*
abcd
=
"abcd"
;
const
char
*
empty
=
""
;
CPPUNIT_ASSERT
(
!
rtl
::
OUString
().
equalsIgnoreAsciiCaseAscii
(
abc
));
CPPUNIT_ASSERT
(
!
rtl
::
OUString
().
equalsIgnoreAsciiCaseAsciiL
(
abc
,
3
));
CPPUNIT_ASSERT
(
!
rtl
::
OUString
(
"abc"
).
...
...
sc/source/filter/oox/defnamesbuffer.cxx
Dosyayı görüntüle @
1800862c
...
...
@@ -59,7 +59,7 @@ const sal_uInt16 BIFF_REFFLAG_ROW1REL = 0x0002;
const
sal_uInt16
BIFF_REFFLAG_COL2REL
=
0x0004
;
const
sal_uInt16
BIFF_REFFLAG_ROW2REL
=
0x0008
;
const
sal_Char
*
const
spcOoxPrefix
=
"_xlnm."
;
const
OUStringLiteral
spcOoxPrefix
(
"_xlnm."
)
;
const
sal_Char
*
const
sppcBaseNames
[]
=
{
...
...
@@ -92,21 +92,19 @@ OUString lclGetBaseName( sal_Unicode cBuiltinId )
OUString
lclGetPrefixedName
(
sal_Unicode
cBuiltinId
)
{
return
OUStringBuffer
(
).
appendAscii
(
spcOoxPrefix
).
append
(
lclGetBaseName
(
cBuiltinId
)
).
makeStringAndClear
();
return
OUStringBuffer
(
spcOoxPrefix
).
append
(
lclGetBaseName
(
cBuiltinId
)
).
makeStringAndClear
();
}
/** returns the built-in name identifier from a prefixed built-in name, e.g. '_xlnm.Print_Area'. */
sal_Unicode
lclGetBuiltinIdFromPrefixedName
(
const
OUString
&
rModelName
)
{
OUString
aPrefix
=
OUString
::
createFromAscii
(
spcOoxPrefix
);
sal_Int32
nPrefixLen
=
aPrefix
.
getLength
();
if
(
rModelName
.
matchIgnoreAsciiCase
(
aPrefix
)
)
if
(
rModelName
.
matchIgnoreAsciiCase
(
spcOoxPrefix
)
)
{
for
(
sal_Unicode
cBuiltinId
=
0
;
cBuiltinId
<
SAL_N_ELEMENTS
(
sppcBaseNames
);
++
cBuiltinId
)
{
OUString
aBaseName
=
lclGetBaseName
(
cBuiltinId
);
sal_Int32
nBaseNameLen
=
aBaseName
.
getLength
();
if
(
(
rModelName
.
getLength
()
==
nPrefixLen
+
nBaseNameLen
)
&&
rModelName
.
matchIgnoreAsciiCase
(
aBaseName
,
nPrefixLen
)
)
if
(
(
rModelName
.
getLength
()
==
spcOoxPrefix
.
size
+
nBaseNameLen
)
&&
rModelName
.
matchIgnoreAsciiCase
(
aBaseName
,
spcOoxPrefix
.
size
)
)
return
cBuiltinId
;
}
}
...
...
sc/source/filter/oox/stylesbuffer.cxx
Dosyayı görüntüle @
1800862c
...
...
@@ -2326,7 +2326,6 @@ void Dxf::fillToItemSet( SfxItemSet& rSet ) const
namespace
{
const
sal_Char
*
const
spcStyleNamePrefix
=
"Excel Built-in "
;
const
sal_Char
*
const
sppcStyleNames
[]
=
{
"Normal"
,
...
...
@@ -2389,8 +2388,7 @@ const sal_Int32 snStyleNamesCount = static_cast< sal_Int32 >( SAL_N_ELEMENTS( sp
OUString
lclGetBuiltinStyleName
(
sal_Int32
nBuiltinId
,
const
OUString
&
rName
,
sal_Int32
nLevel
=
0
)
{
OSL_ENSURE
(
(
0
<=
nBuiltinId
)
&&
(
nBuiltinId
<
snStyleNamesCount
),
"lclGetBuiltinStyleName - unknown built-in style"
);
OUStringBuffer
aStyleName
;
aStyleName
.
appendAscii
(
spcStyleNamePrefix
);
OUStringBuffer
aStyleName
(
"Excel Built-in "
);
if
(
(
0
<=
nBuiltinId
)
&&
(
nBuiltinId
<
snStyleNamesCount
)
&&
(
sppcStyleNames
[
nBuiltinId
]
!=
nullptr
)
)
aStyleName
.
appendAscii
(
sppcStyleNames
[
nBuiltinId
]
);
else
if
(
!
rName
.
isEmpty
()
)
...
...
scripting/source/protocolhandler/scripthandler.cxx
Dosyayı görüntüle @
1800862c
...
...
@@ -67,9 +67,6 @@ using namespace ::com::sun::star::document;
namespace
scripting_protocolhandler
{
const
sal_Char
*
const
MYSERVICENAME
=
"com.sun.star.frame.ProtocolHandler"
;
const
sal_Char
*
const
MYIMPLNAME
=
"com.sun.star.comp.ScriptProtocolHandler"
;
void
SAL_CALL
ScriptProtocolHandler
::
initialize
(
const
css
::
uno
::
Sequence
<
css
::
uno
::
Any
>&
aArguments
)
throw
(
css
::
uno
::
Exception
,
std
::
exception
)
...
...
@@ -468,14 +465,13 @@ throw( RuntimeException, std::exception )
/* Helper for XServiceInfo */
Sequence
<
OUString
>
ScriptProtocolHandler
::
impl_getStaticSupportedServiceNames
()
{
Sequence
<
OUString
>
seqServiceNames
{
OUString
::
createFromAscii
(
::
scripting_protocolhandler
::
MYSERVICENAME
)
};
return
seqServiceNames
;
return
{
"com.sun.star.frame.ProtocolHandler"
};
}
/* Helper for XServiceInfo */
OUString
ScriptProtocolHandler
::
impl_getStaticImplementationName
()
{
return
OUString
::
createFromAscii
(
::
scripting_protocolhandler
::
MYIMPLNAME
);
return
OUString
(
"com.sun.star.comp.ScriptProtocolHandler"
);
}
/* Helper for registry */
...
...
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