[Libreoffice-commits] core.git: 2 commits - cui/source stoc/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Jan 31 11:32:00 UTC 2019
cui/source/tabpages/numfmt.cxx | 2 +-
stoc/source/inspect/introspection.cxx | 14 ++++++--------
2 files changed, 7 insertions(+), 9 deletions(-)
New commits:
commit 5617d1e577bdb9a94b1aa062fb9474cb00a69c6b
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Jan 31 10:48:02 2019 +0100
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Jan 31 12:31:37 2019 +0100
weld::TreeView::get_selected_index returns int
With Clang -fsanitize=implicit-signed-integer-truncation during
UITest_calc_tests3:
> cui/source/tabpages/numfmt.cxx:1714:31: runtime error: implicit conversion from type 'int' of value -1 (32-bit, signed) to type 'sal_uInt16' (aka 'unsigned short') changed the value to 65535
> #0 in SvxNumberFormatTabPage::SetCategory(unsigned short) at cui/source/tabpages/numfmt.cxx:1714:31
> #1 in SvxNumberFormatTabPage::Reset(SfxItemSet const*) at cui/source/tabpages/numfmt.cxx:531:9
> #2 in SfxTabDialogController::CreatePages() at sfx2/source/dialog/tabdlg.cxx:1964:32
> #3 in SfxTabDialogController::Start_Impl() at sfx2/source/dialog/tabdlg.cxx:2038:5
> #4 in SfxTabDialogController::runAsync(std::shared_ptr<SfxTabDialogController> const&, std::function<void (int)> const&) at sfx2/source/dialog/tabdlg.cxx:2077:18
> #5 in ScAbstractTabController_Impl::StartExecuteAsync(VclAbstractDialog::AsyncContext&) at sc/source/ui/attrdlg/scdlgfact.cxx:699:12
> #6 in VclAbstractDialog::StartExecuteAsync(std::function<void (int)> const&) at include/vcl/abstdlg.hxx:73:16
> #7 in ScTabViewShell::ExecuteCellFormatDlg(SfxRequest&, rtl::OString const&) at sc/source/ui/view/tabvwsha.cxx:550:11
> #8 in ScCellShell::Execute(SfxRequest&) at sc/source/ui/view/cellsh3.cxx:359:36
> #9 in SfxStubScCellShellExecute(SfxShell*, SfxRequest&) at workdir/SdiTarget/sc/sdi/scslots.hxx:7275:1
> #10 in SfxShell::CallExec(void (*)(SfxShell*, SfxRequest&), SfxRequest&) at include/sfx2/shell.hxx:207:35
> #11 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&, SfxRequest&, bool) at sfx2/source/control/dispatch.cxx:355:20
> #12 in SfxDispatcher::PostMsgHandler(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >) at sfx2/source/control/dispatch.cxx:1092:17
> #13 in void std::__invoke_impl<void, void (SfxDispatcher::*&)(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >), SfxDispatcher*&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> > >(std::__invoke_memfun_deref, void (SfxDispatcher::*&)(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >), SfxDispatcher*&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >&&) at lib/gcc/x86_64-pc-linux-gnu/9.0.1/../../../../include/c++/9.0.1/bits/invoke.h:73:14
> #14 in std::__invoke_result<void (SfxDispatcher::*&)(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >), SfxDispatcher*&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> > >::type std::__invoke<void (SfxDispatcher::*&)(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >), SfxDispatcher*&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> > >(void (SfxDispatcher::*&)(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >), SfxDispatcher*&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >&&) at lib/gcc/x86_64-pc-linux-gnu/9.0.1/../../../../include/c++/9.0.1/bits/invoke.h:95:14
> #15 in void std::_Bind<void (SfxDispatcher::* (SfxDispatcher*, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >)>::__call<void, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >&&, 0ul, 1ul>(std::tuple<std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >&&>&&, std::_Index_tuple<0ul, 1ul>) at lib/gcc/x86_64-pc-linux-gnu/9.0.1/../../../../include/c++/9.0.1/functional:400:11
> #16 in void std::_Bind<void (SfxDispatcher::* (SfxDispatcher*, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >)>::operator()<std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >, void>(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >&&) at lib/gcc/x86_64-pc-linux-gnu/9.0.1/../../../../include/c++/9.0.1/functional:482:17
> #17 in std::_Function_handler<void (std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >), std::_Bind<void (SfxDispatcher::* (SfxDispatcher*, std::_Placeholder<1>))(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >)> >::_M_invoke(std::_Any_data const&, std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >&&) at lib/gcc/x86_64-pc-linux-gnu/9.0.1/../../../../include/c++/9.0.1/bits/std_function.h:300:2
> #18 in std::function<void (std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >)>::operator()(std::unique_ptr<SfxRequest, std::default_delete<SfxRequest> >) const at lib/gcc/x86_64-pc-linux-gnu/9.0.1/../../../../include/c++/9.0.1/bits/std_function.h:690:14
> #19 in SfxHintPoster::DoEvent_Impl(void*) at sfx2/source/notify/hintpost.cxx:46:9
> #20 in SfxHintPoster::LinkStubDoEvent_Impl(void*, void*) at sfx2/source/notify/hintpost.cxx:43:1
> #21 in Link<void*, void>::Call(void*) const at include/tools/link.hxx:84:45
> #22 in ImplHandleUserEvent(ImplSVEvent*) at vcl/source/window/winproc.cxx:1932:30
> #23 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) at vcl/source/window/winproc.cxx:2485:13
> #24 in SalFrame::CallCallback(SalEvent, void const*) const at vcl/inc/salframe.hxx:285:29
> #25 in SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/headless/svpinst.cxx:284:22
> #26 in non-virtual thunk to SvpSalInstance::ProcessEvent(SalUserEventList::SalUserEvent) at vcl/headless/svpinst.cxx
> #27 in SalUserEventList::DispatchUserEvents(bool) at vcl/source/app/salusereventlist.cxx:110:17
> #28 in SvpSalInstance::DoYield(bool, bool) at vcl/headless/svpinst.cxx:423:19
> #29 in ImplYield(bool, bool) at vcl/source/app/svapp.cxx:441:48
> #30 in Application::Yield() at vcl/source/app/svapp.cxx:505:5
> #31 in Application::Execute() at vcl/source/app/svapp.cxx:422:9
> #32 in desktop::Desktop::Main() at desktop/source/app/app.cxx:1621:17
Change-Id: I5b6aba4c4b832cea4209e3adc1c079e3fdd34924
Reviewed-on: https://gerrit.libreoffice.org/67194
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index d933643f8611..c0e66b6ceb05 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -1711,7 +1711,7 @@ void SvxNumberFormatTabPage::FillCurrencyBox()
void SvxNumberFormatTabPage::SetCategory(sal_uInt16 nPos)
{
- sal_uInt16 nCurCategory = m_xLbCategory->get_selected_index();
+ int nCurCategory = m_xLbCategory->get_selected_index();
sal_uInt16 nTmpCatPos;
if (bOneAreaFlag)
commit b7e89cd6c05360714fe0df5894580f8188538d30
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Jan 31 10:30:25 2019 +0100
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Thu Jan 31 12:31:25 2019 +0100
const_cast is not needed here
Change-Id: Ifdc1b9006fb325f14ce7623d9a28acc41a067167
Reviewed-on: https://gerrit.libreoffice.org/67193
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx
index 53e045c6dc2b..faa23511d4d4 100644
--- a/stoc/source/inspect/introspection.cxx
+++ b/stoc/source/inspect/introspection.cxx
@@ -287,9 +287,8 @@ IntrospectionAccessStatic_Impl::IntrospectionAccessStatic_Impl( Reference< XIdlR
sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const OUString& aPropertyName ) const
{
- IntrospectionAccessStatic_Impl* pThis = const_cast<IntrospectionAccessStatic_Impl*>(this);
- IntrospectionNameMap::iterator aIt = pThis->maPropertyNameMap.find( aPropertyName );
- if (aIt != pThis->maPropertyNameMap.end())
+ auto aIt = maPropertyNameMap.find(aPropertyName);
+ if (aIt != maPropertyNameMap.end())
return aIt->second;
return -1;
@@ -297,9 +296,8 @@ sal_Int32 IntrospectionAccessStatic_Impl::getPropertyIndex( const OUString& aPro
sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMethodName ) const
{
- IntrospectionAccessStatic_Impl* pThis = const_cast<IntrospectionAccessStatic_Impl*>(this);
- IntrospectionNameMap::iterator aIt = pThis->maMethodNameMap.find( aMethodName );
- if (aIt != pThis->maMethodNameMap.end())
+ auto aIt = maMethodNameMap.find(aMethodName);
+ if (aIt != maMethodNameMap.end())
{
return aIt->second;
}
@@ -315,8 +313,8 @@ sal_Int32 IntrospectionAccessStatic_Impl::getMethodIndex( const OUString& aMetho
OUString aPureMethodName = aMethodName.copy( nFound + 1 );
- aIt = pThis->maMethodNameMap.find( aPureMethodName );
- if (aIt != pThis->maMethodNameMap.end())
+ aIt = maMethodNameMap.find( aPureMethodName );
+ if (aIt != maMethodNameMap.end())
{
// Check if it can be a type?
// Problem: Does not work if package names contain _ ?!
More information about the Libreoffice-commits
mailing list