diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-22 10:21:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-28 10:47:34 +0200 |
commit | bfc1600c6ade6f006eb774bffe7caa9c948e8603 (patch) | |
tree | c660fa18fc6a9e5f05c3cc58fa34411cdc4f4257 /hwpfilter | |
parent | f9514beb9bfed51aee69227797e74504afed31c6 (diff) |
loplugin:indentation improve checks for brace alignment
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/drawing.h | 2 | ||||
-rw-r--r-- | hwpfilter/source/hcode.cxx | 18 | ||||
-rw-r--r-- | hwpfilter/source/hiodev.cxx | 2 | ||||
-rw-r--r-- | hwpfilter/source/hwpfile.cxx | 2 | ||||
-rw-r--r-- | hwpfilter/source/hwpread.cxx | 46 | ||||
-rw-r--r-- | hwpfilter/source/hwpreader.cxx | 13 | ||||
-rw-r--r-- | hwpfilter/source/lexer.cxx | 102 |
7 files changed, 93 insertions, 92 deletions
diff --git a/hwpfilter/source/drawing.h b/hwpfilter/source/drawing.h index 935b33171c15..c7526a4c591e 100644 --- a/hwpfilter/source/drawing.h +++ b/hwpfilter/source/drawing.h @@ -308,7 +308,7 @@ static bool LoadCommonHeader(HWPDrawingObject * hdo, unsigned short * link_info) return true; else return false; - } + } if (size <= common_size) return true; diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx index a895caec1eab..dfd9af78b4b8 100644 --- a/hwpfilter/source/hcode.cxx +++ b/hwpfilter/source/hcode.cxx @@ -563,9 +563,9 @@ static hchar jaso2ks(hchar hh) { for (size_t i = 0; i < SAL_N_ELEMENTS(jaso_hh_code); i++) if (hh == jaso_hh_code[i]) - { - return sal::static_int_cast<hchar>(0xa4a1 + i); - } + { + return sal::static_int_cast<hchar>(0xa4a1 + i); + } return 0; } @@ -1050,7 +1050,7 @@ int hcharconv(hchar ch, hchar *dest, int codeType) else dest[0] = 0xA1E0; return 1; - } + } //printf("hcharconv Special[%04x]\n",ch); dest[0] = ch; return 1; @@ -1085,16 +1085,16 @@ int kssm_hangul_to_ucs2(hchar ch, hchar *dest) dest[0] = 0x25a1; // empty square. return 1; } - } - else if ( choseong == 1 && jongseong == 1 ){ /* Vowel */ + } + else if ( choseong == 1 && jongseong == 1 ){ /* Vowel */ dest[0] = joongseong_to_unicode[joongseong]; return 1; - } - else if ( joongseong == 2 && jongseong == 1 ){ /* Consonant */ + } + else if ( joongseong == 2 && jongseong == 1 ){ /* Consonant */ dest[0] = choseong_to_unicode[choseong]; return 1; } - else if( choseong > 20 || choseong == 0 || + else if( choseong > 20 || choseong == 0 || joongseong == 17 || joongseong == 24 || joongseong == 25 || joongseong > 29 || jongseong == 0 || jongseong == 18 || diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx index a9bd14b57b11..6437004143cb 100644 --- a/hwpfilter/source/hiodev.cxx +++ b/hwpfilter/source/hiodev.cxx @@ -235,7 +235,7 @@ size_t HStreamIODev::skipBlock(size_t size) } return size - remain; } - } + } return _stream->skipBytes(size); } diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index 8be445919ed4..4c79a6c1211f 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -291,7 +291,7 @@ void HWPFile::TagsRead() return; if (size <= 0 && tag > 0){ continue; - } + } if (tag == FILETAG_END_OF_COMPRESSED || tag == FILETAG_END_OF_UNCOMPRESSED) diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx index 28506b369dac..be8cdc7bb82d 100644 --- a/hwpfilter/source/hwpread.cxx +++ b/hwpfilter/source/hwpread.cxx @@ -125,12 +125,12 @@ bool Bookmark::Read(HWPFile & hwpf) return false; if (len != 34)// 2 * (BMK_COMMENT_LEN + 1) + 2 - { + { return hwpf.SetState(HWP_InvalidFileFormat); - } + } if (hh != dummy || dummy != CH_BOOKMARK) { return hwpf.SetState(HWP_InvalidFileFormat); - } + } hwpf.Read2b(id, BMK_COMMENT_LEN + 1); hwpf.Read2b(&type, 1); @@ -145,7 +145,7 @@ bool DateFormat::Read(HWPFile & hwpf) return false; if (hh != dummy || CH_DATE_FORM != dummy) { return hwpf.SetState(HWP_InvalidFileFormat); - } + } return true; } @@ -158,7 +158,7 @@ bool DateCode::Read(HWPFile & hwpf) return false; if (hh != dummy || CH_DATE_CODE != dummy) { return hwpf.SetState(HWP_InvalidFileFormat); - } + } hwpf.AddDateFormat(this); return true; } @@ -176,7 +176,7 @@ bool Tab::Read(HWPFile & hwpf) return false; if (hh != dummy || CH_TAB != dummy) { return hwpf.SetState(HWP_InvalidFileFormat); - } + } return true; } @@ -217,7 +217,7 @@ bool TxtBox::Read(HWPFile & hwpf) if (hh != dummy || CH_TEXT_BOX != dummy) { return hwpf.SetState(HWP_InvalidFileFormat); - } + } hwpf.AddBox(this); hwpf.Read2b(&style.cap_len, 1); hwpf.Read2b(&dummy1, 1); @@ -539,7 +539,7 @@ bool Line::Read(HWPFile & hwpf) if (hh != dummy || CH_LINE != dummy) { return hwpf.SetState(HWP_InvalidFileFormat); - } + } hwpf.AddBox(this); style.boxnum = fboxnum++; @@ -598,7 +598,7 @@ bool Hidden::Read(HWPFile & hwpf) hwpf.Read2b(&dummy, 1); if (hh != dummy || CH_HIDDEN != dummy) { return hwpf.SetState(HWP_InvalidFileFormat); - } + } hwpf.ReadBlock(info, 8); hwpf.ReadParaList(plist); @@ -623,7 +623,7 @@ bool HeaderFooter::Read(HWPFile & hwpf) hwpf.Read2b(&dummy, 1); if (hh != dummy || CH_HEADER_FOOTER != dummy) { return hwpf.SetState(HWP_InvalidFileFormat); - } + } hwpf.ReadBlock(info, 8); hwpf.Read1b(type); @@ -655,7 +655,7 @@ bool Footnote::Read(HWPFile & hwpf) hwpf.Read2b(&dummy, 1); if (hh != dummy || CH_FOOTNOTE != dummy) { return hwpf.SetState(HWP_InvalidFileFormat); - } + } hwpf.ReadBlock(info, 8); hwpf.Read2b(&number, 1); @@ -686,7 +686,7 @@ bool AutoNum::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -709,7 +709,7 @@ bool NewNum::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -731,7 +731,7 @@ bool ShowPageNum::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } m_nPageNumber = hwpf.getCurrentPage(); hwpf.setMaxSettedPage(); hwpf.AddPageNumber(this); @@ -755,7 +755,7 @@ bool PageNumCtrl::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -773,7 +773,7 @@ bool MailMerge::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -791,7 +791,7 @@ bool Compose::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -810,7 +810,7 @@ bool Hyphen::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -831,7 +831,7 @@ bool TocMark::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -852,7 +852,7 @@ bool IndexMark::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -878,7 +878,7 @@ bool Outline::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -897,7 +897,7 @@ bool KeepSpace::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } @@ -916,7 +916,7 @@ bool FixedSpace::Read(HWPFile & hwpf) if (hh != dummy){ return hwpf.SetState(HWP_InvalidFileFormat); - } + } return !hwpf.State(); } diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 3b69da304af4..45cb722561ca 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -2935,12 +2935,12 @@ void HwpReader::make_text_p3(HWPPara * para,bool bParaStart) { if( n > 0 ) if( para->GetCharShape(n)->index != para->GetCharShape(n-1)->index && !infield ) - { + { if( !pstart ) {STARTP;} if( !tstart ) {STARTT;} makeChars(str); ENDT; - } + } if( para->hhstr[n]->hh == CH_SPACE ) firstspace = 0; else @@ -3749,7 +3749,7 @@ void HwpReader::makeHyperText(TxtBox * hbox) OUString(tmp2.c_str(), tmp2.size()+1, RTL_TEXTENCODING_EUC_KR)); } - } + } else { padd("xlink:type", sXML_CDATA, "simple"); @@ -4297,8 +4297,9 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) padd("draw:start-angle", sXML_CDATA, Double2Str(start_angle * 180. / PI)); padd("draw:end-angle", sXML_CDATA, Double2Str(end_angle * 180. / PI)); - } - else{ + } + else + { if( drawobj->u.line_arc.flip == 0 ) { padd("draw:start-angle", sXML_CDATA, "270"); @@ -4420,7 +4421,7 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, Picture * hbox) oustr.append(ascii(buf)); } - } + } padd("svg:d", sXML_CDATA, oustr.makeStringAndClear()); diff --git a/hwpfilter/source/lexer.cxx b/hwpfilter/source/lexer.cxx index 2cf76bf3e49f..5d0cef7e2f9d 100644 --- a/hwpfilter/source/lexer.cxx +++ b/hwpfilter/source/lexer.cxx @@ -1085,7 +1085,7 @@ YY_DECL int yy_act; if ( yy_init ) - { + { yy_init = 0; #ifdef YY_USER_INIT @@ -1106,10 +1106,10 @@ YY_DECL yy_create_buffer( yyin, YY_BUF_SIZE ); yy_load_buffer_state(); - } + } while ( true ) /* loops until end-of-file is reached */ - { + { yy_cp = yy_c_buf_p; /* Support of yytext. */ @@ -1123,32 +1123,32 @@ YY_DECL yy_current_state = yy_start; yy_match: do - { + { YY_CHAR yy_c = sal::static_int_cast<YY_CHAR>(yy_ec[YY_SC_TO_UI(*yy_cp)]); if ( yy_accept[yy_current_state] ) - { + { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; - } + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { + { yy_current_state = static_cast<int>(yy_def[yy_current_state]); if ( yy_current_state >= 994 ) yy_c = sal::static_int_cast<YY_CHAR>(yy_meta[static_cast<unsigned int>(yy_c)]); - } + } yy_current_state = yy_nxt[yy_base[yy_current_state] + static_cast<unsigned int>(yy_c)]; ++yy_cp; - } + } while ( yy_base[yy_current_state] != 1315 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) - { /* have to back up */ + { /* have to back up */ yy_cp = yy_last_accepting_cpos; yy_current_state = yy_last_accepting_state; yy_act = yy_accept[yy_current_state]; - } + } YY_DO_BEFORE_ACTION; @@ -1362,7 +1362,7 @@ case YY_STATE_EOF(INITIAL): YY_RESTORE_YY_MORE_OFFSET if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) - { + { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called @@ -1375,7 +1375,7 @@ case YY_STATE_EOF(INITIAL): yy_n_chars = yy_current_buffer->yy_n_chars; yy_current_buffer->yy_input_file = yyin; yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; - } + } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will @@ -1385,7 +1385,7 @@ case YY_STATE_EOF(INITIAL): * in input(). */ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) - { /* This was really a NUL. */ + { /* This was really a NUL. */ yy_state_type yy_next_state; yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; @@ -1406,19 +1406,19 @@ case YY_STATE_EOF(INITIAL): yy_bp = yytext_ptr + YY_MORE_ADJ; if ( yy_next_state ) - { + { /* Consume the NUL. */ yy_cp = ++yy_c_buf_p; yy_current_state = yy_next_state; goto yy_match; - } + } else - { + { yy_cp = yy_c_buf_p; goto yy_find_action; - } } + } else switch ( yy_get_next_buffer() ) { @@ -1427,7 +1427,7 @@ case YY_STATE_EOF(INITIAL): yy_did_buffer_switch_on_eof = 0; if ( yywrap() ) - { + { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up @@ -1441,13 +1441,13 @@ case YY_STATE_EOF(INITIAL): yy_act = YY_STATE_EOF(YY_START); goto do_action; - } + } else - { + { if ( ! yy_did_buffer_switch_on_eof ) YY_NEW_FILE; - } + } } break; @@ -1480,7 +1480,7 @@ case YY_STATE_EOF(INITIAL): YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ - } /* end of scanning one token */ + } /* end of scanning one token */ } /* end of yylex */ @@ -1504,23 +1504,23 @@ static int yy_get_next_buffer() "fatal flex scanner internal error--end of buffer missed" ); if ( yy_current_buffer->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ + { /* Don't try to fill the buffer, so this is an EOF. */ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) - { + { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; - } + } else - { + { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; - } } + } /* Try to read more data. */ @@ -1537,12 +1537,12 @@ static int yy_get_next_buffer() yy_current_buffer->yy_n_chars = yy_n_chars = 0; else - { + { int num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + { /* Not enough room in the buffer - grow it. */ #ifdef YY_USES_REJECT YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); @@ -1555,7 +1555,7 @@ static int yy_get_next_buffer() static_cast<int>(yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) - { + { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) @@ -1567,7 +1567,7 @@ static int yy_get_next_buffer() /* Include room in for 2 EOB chars. */ yy_flex_realloc( static_cast<void *>(b->yy_ch_buf), b->yy_buf_size + 2 )); - } + } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = nullptr; @@ -1581,7 +1581,7 @@ static int yy_get_next_buffer() num_to_read = yy_current_buffer->yy_buf_size - number_to_move - 1; #endif - } + } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; @@ -1591,23 +1591,23 @@ static int yy_get_next_buffer() yy_n_chars, num_to_read ); yy_current_buffer->yy_n_chars = yy_n_chars; - } + } if ( yy_n_chars == 0 ) - { + { if ( number_to_move == YY_MORE_ADJ ) - { + { ret_val = EOB_ACT_END_OF_FILE; yyrestart( yyin ); - } + } else - { + { ret_val = EOB_ACT_LAST_MATCH; yy_current_buffer->yy_buffer_status = YY_BUFFER_EOF_PENDING; - } } + } else ret_val = EOB_ACT_CONTINUE_SCAN; @@ -1632,21 +1632,21 @@ static yy_state_type yy_get_previous_state() yy_current_state = yy_start; for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) - { + { YY_CHAR yy_c = sal::static_int_cast<YY_CHAR>(*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) - { + { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; - } + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { + { yy_current_state = static_cast<int>(yy_def[yy_current_state]); if ( yy_current_state >= 994 ) yy_c = sal::static_int_cast<YY_CHAR>(yy_meta[static_cast<unsigned int>(yy_c)]); - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + static_cast<unsigned int>(yy_c)]; } + yy_current_state = yy_nxt[yy_base[yy_current_state] + static_cast<unsigned int>(yy_c)]; + } return yy_current_state; } @@ -1670,16 +1670,16 @@ yy_state_type yy_current_state; YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) - { + { yy_last_accepting_state = yy_current_state; yy_last_accepting_cpos = yy_cp; - } + } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { + { yy_current_state = static_cast<int>(yy_def[yy_current_state]); if ( yy_current_state >= 994 ) yy_c = sal::static_int_cast<YY_CHAR>(yy_meta[static_cast<unsigned int>(yy_c)]); - } + } yy_current_state = yy_nxt[yy_base[yy_current_state] + static_cast<unsigned int>(yy_c)]; yy_is_jam = (yy_current_state == 993); @@ -1712,12 +1712,12 @@ YY_BUFFER_STATE new_buffer; return; if ( yy_current_buffer ) - { + { /* Flush out information for old buffer. */ *yy_c_buf_p = yy_hold_char; yy_current_buffer->yy_buf_pos = yy_c_buf_p; yy_current_buffer->yy_n_chars = yy_n_chars; - } + } yy_current_buffer = new_buffer; yy_load_buffer_state(); |