• Stephan Bergmann's avatar
    SwGluePortion::GetPrtGlue() can legitimately be larger than 'short` · 60c12198
    Stephan Bergmann yazdı
    At least during JunitTest_sw_unoapi_4
    sw.SwXTextTable::com::sun::star::text::TextTable::TableColumnSeparators, some
    SwFormatFrameSize is created with a width of USHRT_MAX ("Set USHRT_MAX as the
    Table's default SSize") in SwDoc::InsertTable
    (sw/source/core/docnode/ndtbl.cxx).  In SwTabFrame::Format
    (sw/source/core/layout/tabfrm.cxx) that leads to nWishedTableWidth with a value
    near USHRT_MAX and substantially larger than nMax, causing nLeftSpacing to be a
    large negative value in the text::HoriOrientation::CENTER case.  That in turn
    causes SwTextAdjuster::CalcRightMargin (sw/source/core/text/itradj.cxx) to
    set
    
        pRight->PrtWidth( sal_uInt16( nRealWidth - nPrtWidth ) );
    
    with a value of 32768 (where pRight is a SwGluePortion).  And a later call to
    that SwGluePortion's GetPrtGlue would try to convert that 32768 to 'short',
    getting flagged by Clang's -fsanitize=implicit-signed-integer-truncation.
    
    In addition to changing GetPrtGlue (and MoveGlue) to use 'long' instead of
    'short', drop some unncessary narrowing casts from client code.
    
    Change-Id: I6a0d763acfad1fc3b550ec6107adf9f5429dd005
    Reviewed-on: https://gerrit.libreoffice.org/68253
    Tested-by: Jenkins
    Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
    60c12198
Adı
Son kayıt (commit)
Son güncelleme
..
inc Loading commit data...
qa Loading commit data...
sdi Loading commit data...
source Loading commit data...
uiconfig Loading commit data...
util Loading commit data...
AllLangMoTarget_sw.mk Loading commit data...
CppunitTest_sw_accessible_relation_set.mk Loading commit data...
CppunitTest_sw_apitests.mk Loading commit data...
CppunitTest_sw_dialogs_test.mk Loading commit data...
CppunitTest_sw_dialogs_test_2.mk Loading commit data...
CppunitTest_sw_docbookexport.mk Loading commit data...
CppunitTest_sw_filters_test.mk Loading commit data...
CppunitTest_sw_fodfexport.mk Loading commit data...
CppunitTest_sw_globalfilter.mk Loading commit data...
CppunitTest_sw_htmlexport.mk Loading commit data...
CppunitTest_sw_htmlimport.mk Loading commit data...
CppunitTest_sw_layoutwriter.mk Loading commit data...
CppunitTest_sw_macros_test.mk Loading commit data...
CppunitTest_sw_mailmerge.mk Loading commit data...
CppunitTest_sw_odfexport.mk Loading commit data...
CppunitTest_sw_odfimport.mk Loading commit data...
CppunitTest_sw_ooxmlencryption.mk Loading commit data...
CppunitTest_sw_ooxmlexport.mk Loading commit data...
CppunitTest_sw_ooxmlexport10.mk Loading commit data...
CppunitTest_sw_ooxmlexport11.mk Loading commit data...
CppunitTest_sw_ooxmlexport12.mk Loading commit data...
CppunitTest_sw_ooxmlexport13.mk Loading commit data...
CppunitTest_sw_ooxmlexport2.mk Loading commit data...
CppunitTest_sw_ooxmlexport3.mk Loading commit data...
CppunitTest_sw_ooxmlexport4.mk Loading commit data...
CppunitTest_sw_ooxmlexport5.mk Loading commit data...
CppunitTest_sw_ooxmlexport6.mk Loading commit data...
CppunitTest_sw_ooxmlexport7.mk Loading commit data...
CppunitTest_sw_ooxmlexport8.mk Loading commit data...
CppunitTest_sw_ooxmlexport9.mk Loading commit data...
CppunitTest_sw_ooxmlexport_template.mk Loading commit data...
CppunitTest_sw_ooxmlfieldexport.mk Loading commit data...
CppunitTest_sw_ooxmlimport.mk Loading commit data...
CppunitTest_sw_ooxmlimport2.mk Loading commit data...
CppunitTest_sw_ooxmllinks.mk Loading commit data...
CppunitTest_sw_ooxmlw14export.mk Loading commit data...
CppunitTest_sw_rtfexport.mk Loading commit data...
CppunitTest_sw_rtfexport2.mk Loading commit data...
CppunitTest_sw_rtfexport3.mk Loading commit data...
CppunitTest_sw_rtfexport4.mk Loading commit data...
CppunitTest_sw_rtfexport5.mk Loading commit data...
CppunitTest_sw_rtfimport.mk Loading commit data...
CppunitTest_sw_tiledrendering.mk Loading commit data...
CppunitTest_sw_txtexport.mk Loading commit data...
CppunitTest_sw_uibase_unit.mk Loading commit data...
CppunitTest_sw_uiwriter.mk Loading commit data...
CppunitTest_sw_unowriter.mk Loading commit data...
CppunitTest_sw_uwriter.mk Loading commit data...
CppunitTest_sw_ww8export.mk Loading commit data...
CppunitTest_sw_ww8export2.mk Loading commit data...
CppunitTest_sw_ww8export3.mk Loading commit data...
CppunitTest_sw_ww8import.mk Loading commit data...
CppunitTest_sw_xhtmlexport.mk Loading commit data...
CustomTarget_generated.mk Loading commit data...
IwyuFilter_sw.yaml Loading commit data...
JunitTest_sw_complex.mk Loading commit data...
JunitTest_sw_unoapi_1.mk Loading commit data...
JunitTest_sw_unoapi_2.mk Loading commit data...
JunitTest_sw_unoapi_3.mk Loading commit data...
JunitTest_sw_unoapi_4.mk Loading commit data...
Library_msword.mk Loading commit data...
Library_sw.mk Loading commit data...
Library_swd.mk Loading commit data...
Library_swui.mk Loading commit data...
Library_vbaswobj.mk Loading commit data...
Makefile Loading commit data...
Module_sw.mk Loading commit data...
PythonTest_sw_python.mk Loading commit data...
README Loading commit data...
UIConfig_sglobal.mk Loading commit data...
UIConfig_sweb.mk Loading commit data...
UIConfig_swform.mk Loading commit data...
UIConfig_swreport.mk Loading commit data...
UIConfig_swriter.mk Loading commit data...
UIConfig_swxform.mk Loading commit data...
UITest_chapterNumbering.mk Loading commit data...
UITest_classification.mk Loading commit data...
UITest_findReplace.mk Loading commit data...
UITest_librelogo.mk Loading commit data...
UITest_options.mk Loading commit data...
UITest_table.mk Loading commit data...
UITest_writer_tests.mk Loading commit data...
UITest_writer_tests2.mk Loading commit data...
UITest_writer_tests3.mk Loading commit data...
UITest_writer_tests4.mk Loading commit data...
UITest_writer_tests5.mk Loading commit data...
ooxmlexport_setup.mk Loading commit data...