There were over 150 places in *::Notify() functions that did some
dynamic_cast<SfxSimpleHint*> of which ~98% were unnecessary because the
base class SfxHint passed was an SfxSimpleHint anyway. dynamic_cast
operations come with quite some cost, so avoid if possible. Specifically
for ScFormulaCell::Notify() that created a bottleneck in scenarios where
cells were notified that already handled a previous notification. In
mass operations doing the dynamic_cast before it could be decided
whether having to act on it or not this made 2/3 of all time spent in
the Notify() call.
To get rid of that rename/move SfxSimpleHint to SfxHint and let classes
derive from SfxHint instead of SfxSimpleHint. This comes only with a
slight cost that an additional sal_uInt32 is transported in such hints,
initialized to 0, but this is neglectable compared to the huge gain.
For the rare cases where a Notify() actually expects both, an SfxHint
(formerly SfxSimpleHint) and a derived hint, this changed order of the
dynamic_cast involved so the simple SfxHint::GetId() is handled last.
Modules using such combinations can further optimize by treating the
simple SfxHint::GetId() first once verified that none of the other
derived hints use an ID not equal to zero respectively none of the ID
values the simple hint uses.
Change-Id: I9fcf723e3a4487ceb92336189d23a62c344cf0ce
Reviewed-on: https://gerrit.libreoffice.org/29205
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
...after 1658bd231bc662504a072097dc614c29fe2e116d "loplugin:unusedenumvalues"
broke it again after 992fba98f4d0b6ff0d20c15b0ddff09edd37847c "ubsan: 9 is not a
valid value for type ´SvxNumType´" had fixed it the last time.
This time, acknowledge that SvxNumType can apparently take on rather arbitrary
sal_Int16 values from the css::style::NumberingTypes constants, and make it an
alias for sal_Int16 (whether or not keeping such a trivial alias is good or bad
overall).
Or is the bug elsewhere, and values of type SvxNumType should really only take
on the restricted set of values originally encoded by the enum? At least the
below UBSan backtrace (from CppunitTest_sw_rtfexport) suggests otherwise, but
then again there's also an SvxExtNumType enum (include/editeng/svxenum.hxx),
encompassing more parts of css::style::NumberingTypes. Oh, my.
> svx/source/items/pageitem.cxx:49:25: runtime error: load of value 9, which is not a valid value for type 'SvxNumType'
> #0 0x2aafdaebe669 in SvxPageItem::SvxPageItem(SvxPageItem const&) svx/source/items/pageitem.cxx:49:25
> #1 0x2aafdaebf194 in SvxPageItem::Clone(SfxItemPool*) const svx/source/items/pageitem.cxx:59:16
> #2 0x2aaf7fab9b7c in SfxItemPool::Put(SfxPoolItem const&, unsigned short) svl/source/items/itempool.cxx:632:40
> #3 0x2aaf7fc4794a in SfxItemSet::Put(SfxPoolItem const&, unsigned short) svl/source/items/itemset.cxx:467:56
> #4 0x2aaf7fb96635 in SfxItemSet::Put(SfxPoolItem const&) include/svl/itemset.hxx:131:42
> #5 0x2aaf7fb89539 in SfxItemPropertySet::setPropertyValue(SfxItemPropertySimpleEntry const&, com::sun:⭐:uno::Any const&, SfxItemSet&) const svl/source/items/itemprop.cxx:256:14
> #6 0x2aaf9ef1a5d4 in void SwXStyle::SetPropertyValue<(unsigned short)1>(SfxItemPropertySimpleEntry const&, SfxItemPropertySet const&, com::sun:⭐:uno::Any const&, SwStyleBase_Impl&) sw/source/core/unocore/unostyle.cxx:1596:14
> #7 0x2aaf9ef3c72f in SwXStyle::SetStyleProperty(SfxItemPropertySimpleEntry const&, SfxItemPropertySet const&, com::sun:⭐:uno::Any const&, SwStyleBase_Impl&) sw/source/core/unocore/unostyle.cxx:2013:9
> #8 0x2aaf9ef8103d in SwXPageStyle::SetPropertyValues_Impl(com::sun:⭐:uno::Sequence<rtl::OUString> const&, com::sun:⭐:uno::Sequence<com::sun:⭐:uno::Any> const&) sw/source/core/unocore/unostyle.cxx:3025:17
> #9 0x2aaf9ef821ee in SwXPageStyle::setPropertyValues(com::sun:⭐:uno::Sequence<rtl::OUString> const&, com::sun:⭐:uno::Sequence<com::sun:⭐:uno::Any> const&) sw/source/core/unocore/unostyle.cxx:3053:9
> #10 0x2ab00730d08b in writerfilter::dmapper::SectionPropertyMap::ApplyProperties_(com::sun:⭐:uno::Reference<com::sun:⭐🫘:XPropertySet> const&) writerfilter/source/dmapper/PropertyMap.cxx:1489:24
> #11 0x2ab00731cede in writerfilter::dmapper::SectionPropertyMap::CloseSectionGroup(writerfilter::dmapper::DomainMapper_Impl&) writerfilter/source/dmapper/PropertyMap.cxx:1331:13
> #12 0x2ab006b9ede2 in writerfilter::dmapper::DomainMapper::lcl_endSectionGroup() writerfilter/source/dmapper/DomainMapper.cxx:2823:30
> #13 0x2ab0071db9f9 in writerfilter::LoggedStream::endSectionGroup() writerfilter/source/dmapper/LoggedResources.cxx:101:5
> #14 0x2ab006712a3b in writerfilter::rtftok::RTFDocumentImpl::sectBreak(bool) writerfilter/source/rtftok/rtfdocumentimpl.cxx:633:18
> #15 0x2ab0067a8c13 in writerfilter::rtftok::RTFDocumentImpl::popState() writerfilter/source/rtftok/rtfdocumentimpl.cxx:2789:13
> #16 0x2ab006a26134 in writerfilter::rtftok::RTFTokenizer::resolveParse() writerfilter/source/rtftok/rtftokenizer.cxx:105:33
> #17 0x2ab0067194f9 in writerfilter::rtftok::RTFDocumentImpl::resolve(writerfilter::Stream&) writerfilter/source/rtftok/rtfdocumentimpl.cxx:740:27
> #18 0x2ab0075ebae7 in RtfFilter::filter(com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&) writerfilter/source/filter/RtfFilter.cxx:147:20
> #19 0x2aafcf2873a5 in SfxObjectShell::ImportFrom(SfxMedium&, com::sun:⭐:uno::Reference<com::sun:⭐:text::XTextRange> const&) sfx2/source/doc/objstor.cxx:2261:30
> #20 0x2aafcf22d4d2 in SfxObjectShell::DoLoad(SfxMedium*) sfx2/source/doc/objstor.cxx:764:23
> #21 0x2aafcf4a4d09 in SfxBaseModel::load(com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&) sfx2/source/doc/sfxbasemodel.cxx:1841:36
> #22 0x2aafcfde31b3 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&, com::sun:⭐:uno::Reference<com::sun:⭐:frame::XFrame> const&) sfx2/source/view/frmload.cxx:698:28
> #23 0x2aaffef07028 in framework::LoadEnv::impl_loadContent() framework/source/loadenv/loadenv.cxx:1110:37
> #24 0x2aaffeeead5a in framework::LoadEnv::startLoading() framework/source/loadenv/loadenv.cxx:379:20
> #25 0x2aaffeee3919 in framework::LoadEnv::loadComponentFromURL(com::sun:⭐:uno::Reference<com::sun:⭐:frame::XComponentLoader> const&, com::sun:⭐:uno::Reference<com::sun:⭐:uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&) framework/source/loadenv/loadenv.cxx:165:14
> #26 0x2aafff10ddac in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&) framework/source/services/desktop.cxx:596:12
> #27 0x2aafff10e11a in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&) framework/source/services/desktop.cxx:582:64
> #28 0x2aafab4c3938 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun:⭐:uno::Sequence<com::sun:⭐🫘:PropertyValue> const&) unotest/source/cpp/macros_test.cxx:50:60
> #29 0x2aaf90aee900 in SwModelTestBase::loadURL(rtl::OUString const&, char const*) sw/qa/extras/inc/swmodeltestbase.hxx:621:23
> #30 0x2aaf90aed267 in SwModelTestBase::load(char const*, char const*) sw/qa/extras/inc/swmodeltestbase.hxx:610:16
> #31 0x2aaf90aec404 in SwModelTestBase::executeImportTest(char const*) sw/qa/extras/inc/swmodeltestbase.hxx:222:13
> #32 0x2aaf90cf4d31 in testTdf65642::Import() sw/qa/extras/rtfexport/rtfexport.cxx:1013:1
> #33 0x2aaf90cf62af in CppUnit::TestCaller<testTdf65642>::runTest() workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:166:6
> #34 0x2aaf4ee5d7dd in CppUnit::TestCaseMethodFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5
> #35 0x2aaf680c4cd6 in (anonymous namespace)::Protector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) test/source/vclbootstrapprotector.cxx:36:14
> #36 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #37 0x2aaf5ea4a8a6 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89:12
> #38 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #39 0x2aaf5abd5ef4 in (anonymous namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) unotest/source/cpp/unoexceptionprotector/unoexceptionprotector.cxx:65:16
> #40 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #41 0x2aaf4ed8c2ef in CppUnit::DefaultProtector::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/DefaultProtector.cpp:15:12
> #42 0x2aaf4ee17a87 in CppUnit::ProtectorChain::ProtectFunctor::operator()() const workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:25
> #43 0x2aaf4ee14101 in CppUnit::ProtectorChain::protect(CppUnit::Functor const&, CppUnit::ProtectorContext const&) workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:77:18
> #44 0x2aaf4eede065 in CppUnit::TestResult::protect(CppUnit::Functor const&, CppUnit::Test*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:181:28
> #45 0x2aaf4ee5a929 in CppUnit::TestCase::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:91:13
> #46 0x2aaf4ee60ad3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
> #47 0x2aaf4ee5fa3d in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
> #48 0x2aaf4ee60ad3 in CppUnit::TestComposite::doRunChildTests(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:64:30
> #49 0x2aaf4ee5fa3d in CppUnit::TestComposite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestComposite.cpp:23:3
> #50 0x2aaf4ef1eeb6 in CppUnit::TestRunner::WrappingSuite::run(CppUnit::TestResult*) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:47:27
> #51 0x2aaf4eedbe79 in CppUnit::TestResult::runTest(CppUnit::Test*) workdir/UnpackedTarball/cppunit/src/cppunit/TestResult.cpp:148:9
> #52 0x2aaf4ef20440 in CppUnit::TestRunner::run(CppUnit::TestResult&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) workdir/UnpackedTarball/cppunit/src/cppunit/TestRunner.cpp:96:14
> #53 0x52b642 in (anonymous namespace)::ProtectedFixtureFunctor::run() const sal/cppunittester/cppunittester.cxx:305:20
> #54 0x52604d in sal_main() sal/cppunittester/cppunittester.cxx:455:20
> #55 0x524192 in main sal/cppunittester/cppunittester.cxx:362:1
> #56 0x2aaf50b3c730 in __libc_start_main (/lib64/libc.so.6+0x20730)
> #57 0x437658 in _start (workdir/LinkTarget/Executable/cppunittester+0x437658)
Change-Id: Id170860cbff9f4cae5c87cb5cfc70ffe3bc8c9c5
Also fix obvious bug in the initialisation of the
connectivity::odbc::OConnection::m_bClosed field.
Probably closes some kind of connection leak there.
Change-Id: I04579cf91bcd6d6c51c697d83971da4142743a82
Reviewed-on: https://gerrit.libreoffice.org/28932
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Add 'Icons Only', 'Text Only', and 'Icons & Text' radio buttons
to the 'Toolbar' tab of the 'Customize' dialog. And remove the
corresponding items from the 'Toolbar' menu button.
Also removed some unused literals and code pieces.
This patch is towards achieving the design and functionality
suggested in the related bug report.
Change-Id: I072b05ae64817e93c0dbd5fb434126b525c2fd48
Reviewed-on: https://gerrit.libreoffice.org/28773
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Configurable through the options dialog. The default behavior
depends on the current vclplug (hide for gtk2/3 and OS X, show
otherwise).
Menus currently affected by this change:
- SfxDispatcher based context menus
- chart2 context menus
- vcl's Edit control context menu
- Several MenuBarManager based toolbar dropdowns.
Change-Id: Iad9fb99dc90e01c17cba9c07c1a2b262b920e11d
Reviewed-on: https://gerrit.libreoffice.org/28849
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
The issue of 362d4f0cd4e50111edfae9d30c90602c37ed65a2 "Explicitly mark
overriding destructors as 'virtual'" appears to no longer be a problem with
MSVC 2013.
(The little change in the rewriting code of compilerplugins/clang/override.cxx
was necessary to prevent an endless loop when adding "override" to
OOO_DLLPUBLIC_CHARTTOOLS virtual ~CloseableLifeTimeManager();
in chart2/source/inc/LifeTime.hxx, getting stuck in the leading
OOO_DLLPUBLIC_CHARTTOOLS macro. Can't remember what that
isAtEndOfImmediateMacroExpansion thing was originally necessary for, anyway.)
Change-Id: I534c634504d7216b9bb632c2775c04eaf27e927e
Add 'Add Separator' button to the 'Customize' dialog's
'Menus', 'Context Menus', and 'Toolbars' tabs. And remove the
'Add Separator' item from the 'Modify' menu.
In the following commits, more widgets will be added
and moved around to achieve the suggested appearance
and functionality in the related bug report.
Change-Id: I1961e2ebeb326eca69d8f967b2b636793200aba0
Reviewed-on: https://gerrit.libreoffice.org/28681
Tested-by: Jenkins <ci@libreoffice.org>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Add 'Reset' button to the toolbar customization dialog,
and remove the 'Restore Default Settings' item from the
'Toolbar' menu.
Note that this 'Reset' button does not only reset
the selected item but also restores the selected
top-level toolbar to default settings.
Since there is no 'Restore Default Settings' option
in the other tabs of the config dialog, the button is
disabled and hidded in the parent class ctor, then
made visible again in the child class ctor.
In the following commits, more widgets will be added
and moved around to achieve the suggested appearance
and functionality in the related bug report.
Change-Id: I028c082daf423761e3511101069a0dc842743e3b
Reviewed-on: https://gerrit.libreoffice.org/28621
Tested-by: Jenkins <ci@libreoffice.org>
Tested-by: Yousuf Philips <philipz85@hotmail.com>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
but don't hide it at the end of every RunDialog::run so that the
dialog still exists and is visible if the "sure you want to overwrite"
dialog needs to be displayed
and restore the cui options stuff to its original state as well,
undoing the earlier efforts of...
commit c1bd3156cf66318023f36d81ce809a38072588e4
Author: Caolán McNamara <caolanm@redhat.com>
Date: Thu Jul 21 21:44:06 2016 +0100
Resolves: tdf#101054 crash on options->path with non-native file picker
and
commit 3bbc0574d78d129359638b74612de2f93419eeb0
Author: Caolán McNamara <caolanm@redhat.com>
Date: Tue Jul 5 10:16:51 2016 +0100
Resolves: rhbz#1352835 path options doesn't promptly destroy folder picker
Change-Id: I5d6bcee9fb0a73a95cc29e8f3f2ee2aea91a135a
... for both OS X and gtk3. The reason is that it was
filled in item highlight handler, which isn't implemented
for native menus. For now use the menu activation handler,
like for the similar button in SvxLineTabPage.
Change-Id: I437fd6536dbd9e6ba51282eaacc8b43c3a2d6cbf
cause the tip is the color name and that's not stored, so store
the name when we have one, generate a #rrggbb if there isn't one
and on loading the names, "repair" the names if the names didnt't
exist because this option didn't exist when the colors were last
saved
Change-Id: I33d373081e8a5a46ac585bc55fe449dba0519f99
cancel button works, hyphen all works, but closing it via wm close
skips the cancel callback.
simplest thing seems to be to call SpellEnd when necessary, flagging
that its not necessary by disabling the close button on the RET_OK
case
Change-Id: Ib0a67c4395e9d20941e735ebb14f6bd7f7ddb66c