summaryrefslogtreecommitdiff
path: root/framework
AgeCommit message (Collapse)Author
2016-02-05Fix typosAndrea Gelmini
Change-Id: Ice72f8d9971e15dd6ef365e64cd567b8581a92d3 Reviewed-on: https://gerrit.libreoffice.org/21797 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-02-04framework: clean up ugly _ prefixed identifiersMichael Stahl
Change-Id: If965ad91e771c84e89c6690a4e1b733d4e70f1b4
2016-02-04loplugin:sallogareasStephan Bergmann
Change-Id: I27a0fa8318fa50ef6e3ccd3a736c5fcbc36bbaa0
2016-02-04framework: replace boost::bind with C++11 lambda or for loopMichael Stahl
Change-Id: I3bee504b5a3dce7d89af77c8fcf2f9e24d5119ca Reviewed-on: https://gerrit.libreoffice.org/22105 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-02-04tdf#43157 Cleanup DBG_ASSERT for fpicker and frameworkBerk Gureken
Change-Id: I1b79a39a9d709184cc72a905647f73dbf85eef27 Signed-off-by: Berk Gureken <berkgureken@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/21991 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2016-02-04vcl: take into account the font width is the average font widthChris Sherlock
I'm changing the Font class function names: - SetSize -> SetFontSize - GetSize -> GetFontSize - SetHeight -> SetFontHeight - GetHeight -> GetFontHeight - SetWidth -> SetAverageFontWidth - GetWidth -> GetAverageFontWidth That's because it really makes no sense to say that there is a single constant font width because obviously proportional fonts don't have one - the best we can do is an average font width, which is what folks like Microsoft sort of do already. On a fixed font, the average is still accurate, for obvious reasons :-) I'm also not a fan of GetSize/SetSize as I find it a might too generic. Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70 Reviewed-on: https://gerrit.libreoffice.org/22069 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2016-02-03tdf#88205 Delete 'css::uno::Sequence' in frameworkkerem
Change-Id: I66857f640e2e4c397b4f9baf7903356a0510c0b7 Reviewed-on: https://gerrit.libreoffice.org/22035 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-02boost::hash->std::hashNoel Grandin
Change-Id: If4d1e4071995f07212fad958b0226d5824d168f8 Reviewed-on: https://gerrit.libreoffice.org/21989 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-31OSL_THIS_FUNC is a rip-off of BOOST_CURRENT_FUNCTION so we can use thatCaolán McNamara
as a direct drop in I guess Change-Id: I3add63f1459f4e659019bd6db54da2f5431958ce Reviewed-on: https://gerrit.libreoffice.org/21941 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2016-01-31unnecessary use of OUString constructorNoel Grandin
Change-Id: Idd31b0a53c8318af69bbcd32f6798721ec8eb8e1 Reviewed-on: https://gerrit.libreoffice.org/21945 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-29Use ResourceMenuController for toolbar-based menus tooMaxim Monastirsky
No need for yet another controller that does similar things. Change-Id: I4ad79d82ea34a90a43e36082d1fb834201dba3a1
2016-01-29tdf#97411 ResourceMenuController: Don't forget to dispose MenuBarManagerMaxim Monastirsky
Change-Id: Ib41952dae6bcca80436355fa5a0707e671fd3698
2016-01-28tdf#97419 Need to take SolarMutex hereMaxim Monastirsky
Change-Id: I97886c8dbd7b56d155ad9598ca127df0c7420d2c
2016-01-28Missing includesStephan Bergmann
Change-Id: I734b1bf07a4c964c738b24d5145720cb502f624c
2016-01-26No need for ~PresetHandler to be virtualStephan Bergmann
Change-Id: Ia5a3a94ce03af23c44485aedc5ae1c088f1a2d85
2016-01-26Remove nonsense commentStephan Bergmann
Change-Id: Ib0570622ac2853c83d701c207ff3aa0a3781d689
2016-01-26Replace salhelper::SingletonRef with rtl::StaticStephan Bergmann
Change-Id: I2ff6462472292de7cdeb5c7ed748299e58399bdb
2016-01-26Replace salhelper::SingletonRef with rtl::StaticStephan Bergmann
When destroying the static vcl::CommandInfoProvider aProvider from vcl::CommandInfoProvider::Instance (vcl/source/helper/commandinfoprovider.cxx) during exit, it releases its mxCachedGlobalAcceleratorConfiguration reference on GlobalAcceleratorConfiguration (framework/source/accelerators/globalacceleratorconfiguration.cxx), which may get destroyed, whose base class framework::XCUBasedAcceleratorConfiguration (framework/source/inc/accelerators/acceleratorconfiguration.hxx) has a salhelper::SingletonRef<framework::KeyMapping> member, whose destructor (include/salhelper/singletonref.hxx) uses salhelper::SingletonRef<framework::KeyMapping>::SingletonLockInit::operator ()'s static osl::Mutex aInstance. If, during construction, the instantiation of salhelper::SingletonRef<framework::KeyMapping>::SingletonLockInit::operator ()'s static osl::Mutex aInstance finishes before the instantiation of vcl::CommandInfoProvider::Instance's static vcl::CommandInfoProvider aProvider, the corresponding atexit cleanup actions will be recorded in the right order, causing the above chain of calls to find the static Mutex still alive when used from within the static CommandInfoProvider's destruction. However, vcl::CommandInfoProvider's mxCachedGlobalAcceleratorConfiguration is only set to css::ui::GlobalAcceleratorConfiguration::create in vcl::CommandInfoProvider::GetGlobalAcceleratorConfiguration, so the instantiation of the static Mutex instance can finish after the instantiation of the static CommandInfoProvider instance, recording the atexit cleanup actions in the wrong order, causing the static Mutex to be used after destruction. This occasionally caused PythonTest_sfx2_python to hang during exit for me on Linux, where trying to lock a destroyed pthread mutex can apparently deadlock. rtl::Static does away with the need to do anything in the destructor, at the expense of always keeping the instance alive until exit (and not being able to recreate an already destroyed instance during exit, but code that would require that behavior would probably already be broken to begin with), so the order of creation of the CommandInfoProvider and GlobalAcceleratorConfiguration instances becomes less of a concern. Change-Id: Id6e3860ad9e5b7045980a0b9bf9eaef2e24129bb
2016-01-25InterfaceContainer2 with vector instead of SequenceNoel Grandin
create an InterfaceContainer2 class to replace InterfaceContainer. It uses a std::vector instead of a Sequence for the mutable listener list, which provides far better performance. Switch all our internal use-sites to the new class. Change-Id: I6b56cfa511ded2395faa22e68fab3b2f16c3cb88
2016-01-25MenuBarManager: Pass the module identifier to the factoryMaxim Monastirsky
Change-Id: I681054715e943791bddb4b33f01c903c78b717d7
2016-01-24Manually reset the active flag for popup menusMaxim Monastirsky
Change-Id: I942f42bbc43e041a7dae1e83663171c0f2978378
2016-01-22Fix wrong use of OUString::copyMaxim Monastirsky
Code like: if( aCommandURL.copy(5) != ".uno:" ) is obviously wrong, as OUString::copy(sal_Int32) takes the _beginning_ index, so for this condition to be false the command URL must have ".uno:" in the _middle_ of the string. This created some weird things like an empty label attribute added to any submenu item. Moreover, the command URL can be easily shorter than 5 (like when a custom submenu added by the user). Using copy(5) in such case officially considered as "undefined behavior" and will trigger an assert in debug build (that's how I discovered this code actually). Most likely the original intent was to check whether the command URL doesn't start with ".uno:", and so should be changed to use OUString::startsWith. But doing that will create a regression, as it won't be possible anymore to change labels of commands that start with ".uno:". Simply dropping this check seems to be better solution here. Change-Id: I2f88807eceae1006066a14750f2003e235f49ad4
2016-01-18loplugin: unused return valuesNoel Grandin
Change-Id: I9c61a46c57894bc63a57740206c0bcb4a16553af Reviewed-on: https://gerrit.libreoffice.org/21571 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-01-18Don't update the save icon on every keystrokeMaxim Monastirsky
Change-Id: Iad6195ea8b082ca5e6c1a7e9fa48742ff2b495a6
2016-01-16tdf#96949 Remove global static variable m_bPreferrFirstInterceptor and ↵shubhamtibra
unused code Remove global static variable "m_bPreferrFirstInterceptor" which is always true, and remove the ifs where it is false. Change-Id: I54dcea7a6010c825a66020ec3f7448bb32d120b8 Reviewed-on: https://gerrit.libreoffice.org/21519 Reviewed-by: jan iversen <jani@documentfoundation.org> Tested-by: jan iversen <jani@documentfoundation.org>
2016-01-15framework: loplugin:defaultparamsMiklos Vajna
Change-Id: Ie1a5c11c7ae8c2288bba7e2ef228d85479d7808e
2016-01-15Related tdf#96059 Fix icons in File->New menuSusobhan Ghosh
Change-Id: Iecfa69ab9db76ce0390a06d9d9574f30469c131a Reviewed-on: https://gerrit.libreoffice.org/21483 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2016-01-14tdf#95845 Use CommandInfoProvider to receive UNO command labelsSusobhan Ghosh
Replaced getUINameFromCommand by GetMenuLabelForCommand Change-Id: Icd89fed4d9944653996a2218c6ed80af72cefe89 Reviewed-on: https://gerrit.libreoffice.org/21464 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
2016-01-14fix the MSVC 2013 --enable-lto buildMichael Stahl
... by sacrificing the appropriate number of chickens to the template dllexport gods. Change-Id: I27fb6a1f0a8a32c9bdc67574b3a2f3ec9f27b00f Reviewed-on: https://gerrit.libreoffice.org/21442 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-01-13-Werror=attributes (GCC 6)Stephan Bergmann
Change-Id: I4450caf9411fcfbe979a41a67a38e7238ece0be6
2016-01-13Increase relevancyTor Lillqvist
Change-Id: I3a7e46f96898d535b4beff35fdf7245c0eea989e
2016-01-13Modified state icons not packaged into zipMaxim Monastirsky
It seems that images must be mentioned in some src file. Unfortunately had to copy the save icon in place of the modified icon in galaxy, to satisfy the resource compiler. Change-Id: If3fa7a8a194a0289c79fa10987138dfb35eaeca2
2016-01-12GetImageFromURL/SetImageProducer unusedNoel Grandin
looks like these have been abandoned recently in the toolbar manager update Change-Id: I5556833dfef0db5958a5779bdb32482c18a46a5f
2016-01-11loplugin:unusedmethods unused return value in frameworkNoel Grandin
Change-Id: I6e02f34702ba59a961c3fec3d025e775f4e26760
2016-01-10Fix typosAndrea Gelmini
Change-Id: I9a5940027423ff0791fa7da0b79b617412ce6b86 Reviewed-on: https://gerrit.libreoffice.org/21209 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
2016-01-09Fix Addons.xcu toolbar items width handlingMaxim Monastirsky
This is useful for some complex controls (e.g. Combobox). Regression of cb4177b5f6d2c63548fa544a19b36001c57193e4 Change-Id: I683cc20e9db72a4dd58d89063ec6bfcd05a1068e
2016-01-08framework: re-enable two dispatch tests, and make them work harder.Michael Meeks
Change-Id: I63d72b2d8f0b4835ab0ead51b518deab635ff3b0 Reviewed-on: https://gerrit.libreoffice.org/21222 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
2016-01-07framework: restore dispatch API test.Michael Meeks
Change-Id: I8a78fee2b43c67feaffb8dbbcd36e96743ca2c9c Reviewed-on: https://gerrit.libreoffice.org/21208 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
2016-01-07Some cleanup for sal_uIntPtr usageJohannes Hauf
Change-Id: Ia9779e6477d8848588f3543d09ea6b4477f594a2 Reviewed-on: https://gerrit.libreoffice.org/21022 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2016-01-05tdf#96059 Replaced imageproducer with CommandInfoProvidersusobhang70
Replaced all instances of framework::GetImageFromURL with vcl::CommandInfoProvider::Instance().GetImageForCommand Change-Id: I895a4a80d0219a6523b62d90ca88ec67a433b01c Reviewed-on: https://gerrit.libreoffice.org/21101 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org>
2016-01-04Related tdf#82775: Check for disposed-nessStephan Bergmann
...instead of dereferencing null pointers Change-Id: I9d1709468a5b601b9f3d86dadea7a8e817f449d8
2016-01-04Cleanup after removing vcl::FontInfo classChris Sherlock
Change-Id: I544eac439cb7277e47a23a90c6fbc45496161c3b
2016-01-03vcl: Excise vcl::FontInfo classChris Sherlock
This may sound crazy, but literally vcl::FontInfo serves no purpose that I can see. The inheritance chain is like this: ┌────────────────────────┐ │ │ │ vcl::Font │ │ │ └────────────────────────┘ ^ ╱ ╲ │ │ ┌────────────────────────┐ │ │ │ vcl::FontInfo │ │ │ └────────────────────────┘ ^ ╱ ╲ │ │ ┌────────────────────────┐ │ │ │ FontMetric │ │ │ └────────────────────────┘ vcl::FontInfo (which, incidentally, needs to be put into the vcl namespace due to collisions with poppler!) literally does nothing and is acting as a bridge between FontMetric and vcl::Font. Unlike a bridge though, this bridge doesn't actually *do* anything. So I'm removing it, which means one less class to deal with in the vcl fonts world. Change-Id: I32725669c9bca7fbb0846b6a062135464046e4f6 Reviewed-on: https://gerrit.libreoffice.org/21058 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-12-29cppcheck: noExplicitConstructorCaolán McNamara
Change-Id: Ib43e53d5b6c9c130adb765ac9b769f58060ac640
2015-12-29PopupMenuToolbarController: Update the menu before openingMaxim Monastirsky
Just like we do for the menubar, we must tell the popup menu controller to update itself. Change-Id: Ib914b22b909f9e5c1c4ebc8af58496d73e867416
2015-12-27Small OUStringBuffer cleanupMatúš Kukan
Change-Id: I7b608400eea39eef4c620a1d4d67b11637c54436
2015-12-23New saving behaviorMaxim Monastirsky
Changes in this commit: - AlwaysAllowSave config is gone. Saving is always permitted, unless in a read only document. Also changed the behavior in dbaccess to match sfx2. - The toolbar save button is always enabled, to always give access to the dropdown. That's the case even in a read only document, except that it changes to DROPDOWNONLY, and the save as command icon+tooltip. In table/query designers we still disable the button in read only state. - When the document is modified, the toolbar button gets a special icon to indicate that. TODO: - Icons for the document modified state are still missing. I added some fake links to Tango's links.txt in order to test the new behavior. These links shouldn't stay as-is in a production version! Change-Id: I56c169bf48b78faaf53c2989ce8624f8297ffb6e Reviewed-on: https://gerrit.libreoffice.org/20839 Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com> Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
2015-12-23loplugin:unusedfields in frameworkNoel Grandin
Change-Id: Ic6cfbe9f0c7589804b7ffddac0350c188d974c3d
2015-12-21loplugin:unusedmethodsNoel Grandin
Change-Id: Ifafdaf6da0225f244853a0042a6458643b570623
2015-12-20Probably a better way to detect readonly docMaxim Monastirsky
Change-Id: I91f260ad878eba0bd7459c4246357e768c158765