Kaydet (Commit) de8c1938 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:indentation in helpcompiler..io

Change-Id: Ia3f05662cc9542feeac3096d29e9dec6d1858620
Reviewed-on: https://gerrit.libreoffice.org/67558
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst cfadf87c
......@@ -52,12 +52,11 @@ bool LibXmlTreeWalker::end() const
BasicCodeTagger::BasicCodeTagger( xmlDocPtr rootDoc ):
m_Highlighter(HighlighterLanguage::Basic)
{
if ( rootDoc == nullptr )
throw NULL_DOCUMENT;
m_pDocument = rootDoc;
if ( rootDoc == nullptr )
throw NULL_DOCUMENT;
m_pDocument = rootDoc;
m_pXmlTreeWalker = nullptr;
m_bTaggingCompleted = false;
}
BasicCodeTagger::~BasicCodeTagger()
......@@ -69,7 +68,7 @@ BasicCodeTagger::~BasicCodeTagger()
*/
void BasicCodeTagger::getBasicCodeContainerNodes()
{
xmlNodePtr currentNode;
xmlNodePtr currentNode;
m_BasicCodeContainerTags.clear();
......@@ -163,7 +162,7 @@ void BasicCodeTagger::tagParagraph( xmlNodePtr paragraph )
*/
void BasicCodeTagger::tagBasicCodes()
{
if ( m_bTaggingCompleted )
if ( m_bTaggingCompleted )
return;
//gather <bascode> nodes
try
......
......@@ -275,9 +275,9 @@ static bool LoadCommonHeader(HWPDrawingObject * hdo, unsigned short * link_info)
return false;
common_size += 278;
}
if( ( size >= common_size + 3 ) && ( hdo->property.flag & HWPDO_FLAG_WATERMARK ) )
if( ( size >= common_size + 3 ) && ( hdo->property.flag & HWPDO_FLAG_WATERMARK ) )
//if( ( size >= common_size ) && ( hdo->property.flag >> 20 & 0x01 ) )
{
{
if (size - common_size >= 5)
hmem->skipBlock(2);
unsigned char tmp8;
......@@ -311,9 +311,9 @@ static bool LoadCommonHeader(HWPDrawingObject * hdo, unsigned short * link_info)
return false;
}
if (size <= common_size)
if (size <= common_size)
return true;
return hmem->skipBlock(size - common_size ) != 0;
return hmem->skipBlock(size - common_size ) != 0;
}
static std::unique_ptr<HWPDrawingObject> LoadDrawingObject(void)
......
......@@ -149,9 +149,9 @@ int getRepFamilyName(const char* orig, char *buf, double &ratio)
for( int i = 0 ; i < int(SAL_N_ELEMENTS(FontMapTab)); i++)
{
if( !strcmp(orig, FontMapTab[i].familyname) ){
ratio = FontMapTab[i].ratio;
ratio = FontMapTab[i].ratio;
return strlen( strcpy(buf,RepFontTab[FontMapTab[i].key]) );
}
}
}
ratio = FontMapTab[0].ratio;
return strlen( strcpy(buf, RepFontTab[0] ) );
......
......@@ -88,24 +88,24 @@ void Formula::makeLines(Node *res)
void Formula::makeLine(Node *res)
{
if( !res ) return;
if( !res ) return;
#ifdef DEBUG
inds; fprintf(stderr,"<math:mrow>\n");
inds; fprintf(stderr,"<math:mrow>\n");
#else
rstartEl("math:mrow", mxList.get());
rstartEl("math:mrow", mxList.get());
#endif
if( res->child )
if( res->child )
makeExprList( res->child );
#ifdef DEBUG
inde; fprintf(stderr,"</math:mrow>\n");
inde; fprintf(stderr,"</math:mrow>\n");
#else
rendEl("math:mrow");
rendEl("math:mrow");
#endif
}
void Formula::makeExprList(Node *res)
{
if( !res ) return;
if( !res ) return;
Node *tmp = res->child;
if( !tmp ) return ;
......@@ -121,7 +121,7 @@ void Formula::makeExprList(Node *res)
void Formula::makeExpr(Node *res)
{
if( !res ) return;
if( !res ) return;
Node *tmp = res->child;
if( !tmp ) return;
switch( tmp->id ) {
......@@ -184,10 +184,10 @@ void Formula::makeExpr(Node *res)
void Formula::makeIdentifier(Node *res)
{
Node *tmp = res;
if( !tmp ) return;
if( !tmp->value ) return;
switch( tmp->id ){
Node *tmp = res;
if( !tmp ) return;
if( !tmp->value ) return;
switch( tmp->id ){
case ID_CHARACTER :
#ifdef DEBUG
inds;
......
......@@ -540,7 +540,7 @@ enum
hchar_string Outline::GetUnicode() const
{
const hchar *p;
hchar buffer[255];
hchar buffer[255];
buffer[0] = 0;
if (kind == OUTLINE_NUM)
......@@ -583,12 +583,12 @@ hchar_string Outline::GetUnicode() const
p = GetOutlineStyleChars(shape);
buffer[0] = p[level];
buffer[1] = 0;
return hstr2ucsstr(buffer);
return hstr2ucsstr(buffer);
}
case OLSTY_USER:
case OLSTY_BULUSER:
{
char dest[80];
char dest[80];
int l = 0;
int i = level;
if( deco[i][0] ){
......@@ -660,7 +660,7 @@ hchar_string Outline::GetUnicode() const
}
str2hstr(buf, buffer + l);
l += strlen(buf);
break;
break;
}
default:
buffer[l++] = user_shape[i];
......
......@@ -891,7 +891,7 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
unsigned char lo;
//printf("hcharconv[%04x]\n",ch);
if (ch < 128){
dest[0] = ch;
dest[0] = ch;
return 1;
}
if (IsHangul(ch))
......@@ -921,10 +921,10 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
*/
if ((index = ch - 0x4000) >= 4888)
{
if( codeType == UNICODE )
dest[0]= 0x25A1;
else
dest[0]= 0xA1E0;
if( codeType == UNICODE )
dest[0]= 0x25A1;
else
dest[0]= 0xA1E0;
return 1;
}
if (codeType == KS)
......@@ -951,12 +951,12 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
ch = (hi << 8) | lo;
}
//printf("hcharconv Hanja[%04x]\n",ch);
dest[0] = ch;
dest[0] = ch;
return 1;
}
if (LineCharDir(ch))
{
dest[0] = lineCharConv(ch);
dest[0] = lineCharConv(ch);
return 1;
}
else if (0x2f00 <= ch && ch <= 0x2f6f && (ch & 0x0f) < 9)
......@@ -975,7 +975,7 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
else ch = 0xa2b9;
ch = (lo < 6) ? ch : ch + 1;
if( codeType == UNICODE)
if( codeType == UNICODE)
ch = ksc5601_sym_to_ucs2(ch);
}
else
......@@ -990,7 +990,7 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
ch = (lo < 6) ? ch : ch + 1;
}
//printf("hcharconv Bullet[%04x]\n",ch);
dest[0] = ch;
dest[0] = ch;
return 1 ;
}
/*
......@@ -1002,13 +1002,13 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
if( codeType != KSSM )
{
//printf("code[0x%04x]\n",ch);
hchar ch2 = ch;
hchar ch2 = ch;
ch = s_hh2ks(ch);
//printf("code ks[0x%04x]\n",ch);
if( codeType == UNICODE ){
if( codeType == UNICODE ){
if (ch < 128){
dest[0] = ch;
return 1;
dest[0] = ch;
return 1;
}
/* Hangul and Computer: 0x37c0 ~ 0x37c5 */
if( ch2 >= 0x37c0 && ch2 <= 0x37c5 ){
......@@ -1037,7 +1037,7 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
ch = ksc5601_sym_to_ucs2(ch);
}
//printf("code ucs2[0x%04x]\n",ch);
}
}
}
else{
ch = s_hh2kssm(ch);
......@@ -1051,7 +1051,7 @@ int hcharconv(hchar ch, hchar *dest, int codeType)
return 1;
}
//printf("hcharconv Special[%04x]\n",ch);
dest[0] = ch;
dest[0] = ch;
return 1;
}
}
......@@ -1067,7 +1067,7 @@ int kssm_hangul_to_ucs2(hchar ch, hchar *dest)
//printf("kssm_hangul_to_ucs2 : [%d,%d,%d]\n", choseong,joongseong,jongseong);
if( joongseong < 2 ){ /* Not combined area, medial sound = 0,1 */
if( joongseong < 2 ){ /* Not combined area, medial sound = 0,1 */
if( joongseong == 0 && ch < 0xa414 ){ /* consonants and vowels includes old characters */
int index = choseong * 32 + jongseong;
dest[0] = jamo_to_unicode[index];
......@@ -1090,8 +1090,8 @@ int kssm_hangul_to_ucs2(hchar ch, hchar *dest)
return 1;
}
else if ( joongseong == 2 && jongseong == 1 ){ /* Consonant */
dest[0] = choseong_to_unicode[choseong];
return 1;
dest[0] = choseong_to_unicode[choseong];
return 1;
}
else if( choseong > 20 || choseong == 0 ||
joongseong == 17 || joongseong == 24 ||
......@@ -1130,7 +1130,7 @@ int kssm_hangul_to_ucs2(hchar ch, hchar *dest)
joongseong *= NUM_JONGSEONG;
jongseong -= jongseong > 0x12 ? 2 : 1;
dest[0] = UNI_HANGUL_FIRST + choseong + joongseong + jongseong;
dest[0] = UNI_HANGUL_FIRST + choseong + joongseong + jongseong;
return 1;
}
......@@ -1179,11 +1179,11 @@ hchar_string hstr2ucsstr(hchar const* hstr)
{
::std::string ret;
int j;
hchar dest[3];
hchar dest[3];
for( ; *hstr ; )
{
int res = hcharconv(*hstr++, dest, KS);
for( j = 0 ; j < res ; j++ ){
for( j = 0 ; j < res ; j++ ){
int c = dest[j];
if( c < 32 )
c = ' ';
......@@ -1196,7 +1196,7 @@ hchar_string hstr2ucsstr(hchar const* hstr)
ret.push_back(sal::static_int_cast<char>((c >> 8 ) & 0xff));
ret.push_back(sal::static_int_cast<char>(c & 0xff));
}
}
}
}
return ret;
}
......@@ -1334,16 +1334,16 @@ char *hcolor2str(uchar color, uchar shade, char *buf, bool bIsChar)
ret.append("http://");
}
}
}
for (; i < strlen(src); i++)
{
}
for (; i < strlen(src); i++)
{
if (src[i] == '\\') {
ret.push_back('/');
} else {
ret.push_back(src[i]);
}
}
return ret;
}
return ret;
}
#ifdef _WIN32
......
......@@ -170,7 +170,7 @@ bool HWPPara::Read(HWPFile & hwpf, unsigned char flag)
return false;
if (hhstr[ii]->hh == CH_END_PARA)
break;
if( hhstr[ii]->hh < CH_END_PARA )
if( hhstr[ii]->hh < CH_END_PARA )
pshape->reserved[0] = 0;
ii += hhstr[ii]->WSize();
}
......
......@@ -250,11 +250,11 @@ void HWPFile::ReadParaList(std::vector< std::unique_ptr<HWPPara> > &aplist, unsi
unsigned char prev_etcflag = 0;
while (spNode->Read(*this, flag))
{
if( !(spNode->etcflag & 0x04) ){
if( !(spNode->etcflag & 0x04) ){
tmp_etcflag = spNode->etcflag;
spNode->etcflag = prev_etcflag;
prev_etcflag = tmp_etcflag;
}
}
if (spNode->nch && spNode->reuse_shape)
{
if (!aplist.empty()){
......
......@@ -100,7 +100,7 @@ bool FieldCode::Read(HWPFile & hwpf)
hwpf.SkipBlock(binlen);
if( type[0] == 3 && type[1] == 2 ){ /* It must create a format as created date. */
if( type[0] == 3 && type[1] == 2 ){ /* It must create a format as created date. */
DateCode *pDate = new DateCode;
for (int i = 0 ; i < static_cast<int>(len3_); i++) {
if(str3[i] == 0 ) break;
......@@ -109,7 +109,7 @@ bool FieldCode::Read(HWPFile & hwpf)
}
hwpf.AddDateFormat(pDate);
m_pDate.reset( pDate );
}
}
return true;
}
......@@ -225,7 +225,7 @@ bool TxtBox::Read(HWPFile & hwpf)
hwpf.Read2b(&dummy2, 1);
style.boxnum = fboxnum++;
zorder = zindex++;
zorder = zindex++;
hwpf.Read1b(style.anchor_type);
hwpf.Read1b(style.txtflow);
hwpf.Read2b(&style.xpos, 1);
......@@ -249,7 +249,7 @@ bool TxtBox::Read(HWPFile & hwpf)
hwpf.Read2b(&pgx, 1);
hwpf.Read2b(&pgy, 1);
hwpf.Read2b(&pgno, 1);
if( ( pgno +1 ) != hwpf.getCurrentPage() )
if( ( pgno +1 ) != hwpf.getCurrentPage() )
pgno = sal::static_int_cast<short>(hwpf.getCurrentPage() -1) ;
hwpf.Read2b(&showpg, 1);
......@@ -380,7 +380,7 @@ bool Picture::Read(HWPFile & hwpf)
hwpf.Read2b(&dummy2, 1);
style.boxnum = fboxnum++;
zorder = zindex++;
zorder = zindex++;
hwpf.Read1b(style.anchor_type); /* Reference position */
hwpf.Read1b(style.txtflow); /* Avoid painting. 0-2 (seat occupied, transparency, harmony) */
hwpf.Read2b(&style.xpos, 1); /* Horizontal position: 1=left, 2=right, 3=center, and others=any */
......@@ -515,7 +515,7 @@ bool Line::Read(HWPFile & hwpf)
hwpf.AddBox(this);
style.boxnum = fboxnum++;
zorder = zindex++;
zorder = zindex++;
style.boxtype = 'L';
hwpf.ReadBlock(&reserved2, 8);
hwpf.Read1b(style.anchor_type);
......@@ -603,9 +603,9 @@ bool HeaderFooter::Read(HWPFile & hwpf)
lnnumber = 0;
hwpf.ReadParaList(plist, CH_HEADER_FOOTER);
linenumber = sal::static_int_cast<unsigned char>(lnnumber);
m_nPageNumber = hwpf.getCurrentPage();
hwpf.setMaxSettedPage();
hwpf.AddHeaderFooter(this);
m_nPageNumber = hwpf.getCurrentPage();
hwpf.setMaxSettedPage();
hwpf.AddHeaderFooter(this);
return !hwpf.State();
}
......@@ -704,8 +704,8 @@ bool ShowPageNum::Read(HWPFile & hwpf)
if (hh != dummy){
return hwpf.SetState(HWP_InvalidFileFormat);
}
m_nPageNumber = hwpf.getCurrentPage();
hwpf.setMaxSettedPage();
m_nPageNumber = hwpf.getCurrentPage();
hwpf.setMaxSettedPage();
hwpf.AddPageNumber(this);
return !hwpf.State();
}
......
This diff is collapsed.
......@@ -622,13 +622,13 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal
// start empty
OUString result;
// append prefix
if( !should_ignore(prefix) ) result += prefix;
// append prefix
if( !should_ignore(prefix) ) result += prefix;
// append formatted number
using namespace style::NumberingType;
switch( numType )
{
// append formatted number
using namespace style::NumberingType;
switch( numType )
{
case CHARS_UPPER_LETTER:
lcl_formatChars( upperLetter, 26, number-1, result ); // 1=>A, 2=>B, ..., 26=>Z, 27=>AA, 28=>AB, ...
break;
......@@ -905,23 +905,23 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal
default:
OSL_ASSERT(false);
throw IllegalArgumentException();
}
}
if (natNum) {
if (natNum) {
rtl::Reference<NativeNumberSupplierService> xNatNum(new NativeNumberSupplierService);
result += xNatNum->getNativeNumberStringParams(OUString::number(number), locale,
natNum, sNatNumParams);
} else if (tableSize) {
} else if (tableSize) {
if ( number > tableSize && !bRecycleSymbol)
result += OUString::number( number);
else
result += OUString(&table[--number % tableSize], 1);
}
}
// append suffix
if( !should_ignore(suffix) ) result += suffix;
// append suffix
if( !should_ignore(suffix) ) result += suffix;
return result;
return result;
}
#define LANG_ALL (1 << 0)
......
......@@ -113,7 +113,7 @@ InputSequenceChecker_hi::checkInputSequence(const OUString& Text,
sal_Int16 inputCheckMode)
{
sal_Unicode currentChar = Text[nStartPos];
sal_uInt16 ch1 = getCharType(inputChar);
sal_uInt16 ch1 = getCharType(inputChar);
sal_uInt16 ch2 = getCharType(currentChar);
return (DEV_Composible[inputCheckMode][dev_cell_check[ch2][ch1]]);
......
......@@ -109,10 +109,10 @@ LocaleNode* LocaleNode::createNode (const OUString& name, const Reference< XAttr
return new LCSearchNode (name,attr);
if ( name == "LC_MISC" )
return new LCMiscNode (name,attr);
if ( name == "LC_NumberingLevel" )
return new LCNumberingLevelNode (name, attr);
if ( name == "LC_OutLineNumberingLevel" )
return new LCOutlineNumberingLevelNode (name, attr);
if ( name == "LC_NumberingLevel" )
return new LCNumberingLevelNode (name, attr);
if ( name == "LC_OutLineNumberingLevel" )
return new LCOutlineNumberingLevelNode (name, attr);
return new LocaleNode(name,attr);
}
......
......@@ -180,7 +180,7 @@ static TransliterationModules operator|(TransliterationModules lhs, Transliterat
void SAL_CALL
TransliterationImpl::loadModule( TransliterationModules modType, const Locale& rLocale )
{
clear();
clear();
if (bool(modType & TransliterationModules_IGNORE_MASK) &&
bool(modType & TransliterationModules_NON_IGNORE_MASK))
{
......
......@@ -70,13 +70,13 @@ OUString widthfolding::decompose_ja_voiced_sound_marks (const OUString& inStr, s
int i = int(c - 0x3040);
sal_Unicode first = decomposition_table[i].decomposited_character_1;
if (first != 0x0000) {
*dst ++ = first;
*dst ++ = decomposition_table[i].decomposited_character_2; // second
*dst ++ = first;
*dst ++ = decomposition_table[i].decomposited_character_2; // second
if (useOffset) {
*p ++ = position;
*p ++ = position ++;
}
continue;
continue;
}
}
*dst ++ = c;
......@@ -113,7 +113,7 @@ OUString widthfolding::compose_ja_voiced_sound_marks (const OUString& inStr, sal
sal_Unicode* dst = newStr->buffer;
// This conversion algorithm requires at least one character.
if (nCount > 0) {
if (nCount > 0) {
// .. .. KA VOICE .. ..
// ^ ^
......@@ -169,10 +169,10 @@ OUString widthfolding::compose_ja_voiced_sound_marks (const OUString& inStr, sal
position ++;
*p ++ = position ++;
}
*dst ++ = composition_table[i][j];
previousChar = *src ++;
nCount --;
continue;
*dst ++ = composition_table[i][j];
previousChar = *src ++;
nCount --;
continue;
}
}
if (useOffset)
......
......@@ -532,7 +532,7 @@ void SvMetaSlot::WriteSlot( const OString& rShellName, sal_uInt16 nCount,
rOutStm.WriteCharPtr( "SfxSlotMode::NONE" );
rOutStm.WriteChar( ',' ) << endl;
WriteTab( rOutStm, 4 );
WriteTab( rOutStm, 4 );
if ( GetDisableFlags().isEmpty() )
rOutStm.WriteCharPtr( "SfxDisableFlags::NONE" );
else
......
......@@ -313,7 +313,7 @@ AstDeclaration* AstScope::lookupForAdd(AstDeclaration const * pDecl) const
AstDeclaration* pRetDecl = lookupByNameLocal(pDecl->getLocalName());
return pRetDecl;
return pRetDecl;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -287,7 +287,8 @@ bool Options::initOptions(std::vector< std::string > & rArgs)
{
return badOption("invalid", option);
}
OString param("-D"); param += OString((*first).c_str(), (*first).size());
OString param("-D");
param += OString((*first).c_str(), (*first).size());
if (m_options.count("-D") > 0)
{
OStringBuffer buffer(m_options["-D"]);
......
......@@ -491,7 +491,7 @@ interface_decl :
identifier
{
idlc()->setParseState(PS_InterfaceIDSeen);
checkIdentifier($3);
checkIdentifier($3);
$$ = $3;
}
;
......@@ -823,7 +823,7 @@ opt_attrflag :
}
| error ']'
{
yyerror("unknown property|attribute flag");
yyerror("unknown property|attribute flag");
yyerrok;
}
;
......@@ -920,7 +920,7 @@ operation :
identifier
{
idlc()->setParseState(PS_OpIDSeen);
checkIdentifier($3);
checkIdentifier($3);
AstInterface * pScope = static_cast< AstInterface * >(
idlc()->scopes()->top());
......
......@@ -99,7 +99,7 @@ namespace io_acceptor {
template<class T>
static void notifyListeners(SocketConnection * pCon, bool * notified, T t)
{
XStreamListener_hash_set listeners;
XStreamListener_hash_set listeners;
{
::osl::MutexGuard guard(pCon->_mutex);
......
......@@ -33,7 +33,7 @@ namespace stoc_connector {
template<class T>
static void notifyListeners(SocketConnection * pCon, bool * notified, T t)
{
XStreamListener_hash_set listeners;
XStreamListener_hash_set listeners;
{
::osl::MutexGuard guard(pCon->_mutex);
......
......@@ -181,7 +181,7 @@ void OMarkableOutputStream::closeOutput()
m_mapMarks.clear();
m_nCurrentPos = m_pBuffer->getSize();
checkMarksAndFlush();
checkMarksAndFlush();
m_output->closeOutput();
......
......@@ -75,7 +75,7 @@ void MemRingBuffer::resizeBuffer( sal_Int32 nMinSize )
}
if( nNewLen != m_nBufferLen ) {
if (auto p = static_cast<sal_Int8*>(std::realloc(m_p, nNewLen)))
if (auto p = static_cast<sal_Int8*>(std::realloc(m_p, nNewLen)))
m_p = p;
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment