summaryrefslogtreecommitdiff
path: root/unotools
AgeCommit message (Collapse)AuthorFilesLines
2013-11-20Elide utl::ConfigItem_ImplStephan Bergmann2-163/+109
...and utl::ConfigItem::IsValidConfigMgr is always true. Change-Id: I37e295729c3d0ae12719f0ae6f5a5628c58d0b9f
2013-11-19remove unnecessary use of OUString constructor when assigningNoel Grandin1-2/+2
change code like aStr = OUString("xxxx"); to aStr = "xxxx"; Change-Id: Ib981a5cc735677ec5dba76ef9279a107d22e99d4
2013-11-17bugs.freedesktop.org -> bugs.libreoffice.orgAndras Timar1-2/+2
Change-Id: I56c1190c93333636981acf2dd271515170a8a904
2013-11-14SAL_WARN_UNUSED com::sun::star::uno::AnyStephan Bergmann1-1/+0
Change-Id: I9058044d13f696e07667dce706f6c311af6dbea0
2013-11-14Adapt MediaDescriptor log area codeStephan Bergmann1-6/+7
...post 24cad6a6490b245bd88ec3e3c87195628914f6a2 "Move MediaDescriptor from comphelper to unotools." Change-Id: I71b4f4e1c1b68c3281f77dc15a2df30bfbf7e587
2013-11-14rhbz#887420 Implement "block untrusted referer links" featureStephan Bergmann1-0/+6
For now, this checks for a trusted referer (if the BlockUntrustedRefererLinks configuration prop is set) in utl::MediaDescriptor::impl_openStreamWithURL and SvxBrushItem::GetGraphicObject. Checking in additional places will probably be necessary to block /all/ unwanted communication. Also, some places marked /*TODO?*/ currently pass in an empty referer (which is always considered trusted) and will probably need to be adapted. Ideally, Referer URIs would never be empty (and consistently use something like <private:user> for cases where access is explicitly initiated by the user and should never be blocked), but that's a very daunting task, so start small by identifying the places that potentially need blocking and adding appropriate Referer URIs there. Also, Referer information should always be computed as freshly as possible from the context in which an access attempt is made, but, again, always carrying the information from the context all the way to the relevant functions is a very daunting task, so for now store the information upon object instantiation in some cases (SvxBrushItem, SdrGrafObj, ...). The Referer URI (css.document.MediaDescriptor property; SID_REFERER) was already used to track macro execution, and there is one place in SfxApplication::OpenDocExec_Impl where opening of hyperlinks (explicitly clicked by the user) is done that needs the current document's URI as Referer to check execution of macro URIs but needs an empty (or <private:user>, see above) Referer to not block non-macro URIs. Special code has been added there to handle that. Change-Id: Iafbdc07a9fe925d9ee580d4f5778448f18f2ebd9
2013-11-14Move MediaDescriptor from comphelper to unotoolsStephan Bergmann2-0/+758
...so it will be able to use SvtSecurityOptions internally. Change-Id: Id7433247e8fc53651935578510bedbcca5aa2ac9
2013-11-14Add "block untrusted referer links" switchStephan Bergmann1-5/+40
Change-Id: Id2f2a3dafc3bb7ec6fada6bfda5843348dfac5a1
2013-11-14remove unnecessary sal_Unicode casts in various placesNoel Grandin5-10/+10
Change-Id: Ibf04062ca86ed866202d748c3b62a210d30ed6ec
2013-11-11String clean-upStephan Bergmann1-63/+47
Change-Id: Ib97256e3c00db61e53998571114dab5d74ce18be
2013-11-11convert OUString compareToAscii == 0 to equalsAsciiNoel Grandin3-13/+13
Convert code like aStr.compareToAscii("XXX") == 0 to aStr.equalsAscii("XXX") which is both easier to read and faster. Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
2013-11-11convert OUString 0==compareToAscii to equalsAsciiNoel Grandin2-3/+3
Convert code like: 0 == aStr.compareToAscii("XXX") to aStr.equalsAscii("XXX") which is both clearer and faster. Change-Id: I2e906d7d38494db38eb292702fadb781b1251e07
2013-11-09Converge on SvtSecurityOptions::isTrustedLocationStephan Bergmann1-18/+17
Change-Id: Ibcf4b7d9d11295c7679637a37d41dc2960e04f8f
2013-11-08Clean up IsSecureURLStephan Bergmann1-57/+32
...to not use WildCard (in case a trusted location URI already contains an unescaped "*"), be specific about matching only past a final "/", and rename to isSecureMacroUri for clarification. The check with an INET_PROT_NOT_VALID default INetURLObject in SfxApplication::OpenDocExec_Impl ("we have to check the referer before executing") had efficiently been dead since its inception in 14237ac4bf497decdde8b742acea23780833ba12 "#90880#: security checks corrected," as INET_PROT_NOT_VALID is considered secure regardless of referer anyway. Change-Id: I03bca5e6dac89bb2aac52909aff273ea640228d8
2013-11-07remove unnecessary use of OUString constructor in UNOTOOLS moduleNoel Grandin5-13/+13
Change-Id: Iad166e6b9ce0877200bd58c388b3914b15167196
2013-11-04remove redundant calls to OUString constructor in if expressionNoel Grandin1-3/+3
Convert code like: if( aStr == OUString("xxxx") ) to this: if( aStr == "xxxx" ) Change-Id: I8d201f048477731eff590fb988259ef0935c080c
2013-10-31Convert indexOf->startsWith and lastIndexOf->endsWithNoel Grandin1-1/+1
This is both an optimisation and a cleanup. This converts code like aStr.indexOf("XX") == 0 to aStr.startsWith("XX") and converts code like aStr.lastIndexOf("XXX") == aStr.getLength() - 3 to aStr.endsWith("XXX") Note that in general aStr.lastIndexOf("X") == aStr.getLength() - 1 converts to aStr.isEmpty() || aStr.endsWith("X") so I used the surrounding context to determine if aStr could be empty when modifying the code. Change-Id: I22cb8ca7c2a4d0288b001f72adb27fd63af87669
2013-10-28fixincludeguards.sh: unotoolsThomas Arnhold2-5/+5
Change-Id: Idf4bee8c51e3082d2b815d9cf5c3d7374e598622
2013-10-23convert code to use OUString::endsWithNoel Grandin2-9/+8
Convert places that call aStr[aStr.getLength()-1] == 'x' to use the shorter form aStr.endsWith("x") Change-Id: I1b3a19c0e89b8989cdbeed440f95fc76f9a4b6b6
2013-10-22Bin comments that claim to say why some header is includedTor Lillqvist3-4/+4
They are practically always useless, often misleading or obsolete. Change-Id: I2d32182a31349c9fb3b982498fd22d93e84c0c0c
2013-10-16unotools: add menu option to enable/disable Smart-Art lockJacobo Aragunde Pérez1-3/+20
The point of this menu option is that locked Smart-Art shapes would preserve the original XML files attached so they could be exported back to docx with no loss. The new menu option is located at Options -> Load/Save -> MS Office -> SmartArt to LibreOffice shapes or reverse. Change-Id: I6aafc2eb83404ee2c0b8538b2f6fbbbd4363e7d3 Reviewed-on: https://gerrit.libreoffice.org/6138 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2013-10-08No longer used header includeStephan Bergmann1-1/+0
Change-Id: I74034503b4d2d1eb438b4213bf135d831a08e9fc
2013-10-02-Werror,-Wunused-variableStephan Bergmann1-1/+0
Change-Id: Ibef564f992f3d62eab7711be66d7d465346222da
2013-10-02-Werror,-Wunused-variableStephan Bergmann1-1/+0
Change-Id: Id1fc880fa713b03fe846cee8e5c5edd733f6bdb5
2013-10-01desktop: stop replacing %PRODUCTNAME %PRODUCTXMLFILEFORMATVERSIONMichael Stahl1-12/+0
... and %PRODUCTXMLFILEFORMATNAME at runtime and hard-code OpenOffice.org 1.0 for these too. Change-Id: Id96390506d2a0f367f932e85d3115362ad483bc3
2013-10-01remove run-time replacement of %WRITERCOMPATIBILITYVERSIONOOO11Michael Stahl1-6/+0
Instead hard-code OpenOffice.org 1.1 as the value, since StarOffice and StarSuite are irrelevant. Change-Id: I9ab3d1cf38cf64cd4e440b3ae43158f748ead7d2
2013-09-26use makeFallback() in MakeRalLocale()/MakeRealUILocale()Eike Rathke1-4/+4
The old MsLangId::convert...() methods did implicitly fall back to a known locale, this behavior is explicitly needed here to select a proper completely known locale. Change-Id: I350989f3af679890ddb0de964c2d107420331160
2013-09-26typo fixes in commentsAndras Timar3-4/+4
Change-Id: Iaadec33715f8e0e0c6595c5e684606905274fdab
2013-09-21drop various tools/string.hxx includeCaolán McNamara2-2/+0
Change-Id: If4271c97025a56922c4f0b143cc3af214218a153
2013-09-20cook up a scheme to allow windows to have per-module settingsCaolán McNamara1-10/+9
Change-Id: I5fa62c3c2af2ccbbc7e8a61e5537488515b2808c
2013-09-17remove OUStringHashCode in favor of OUStringHashCaolán McNamara4-39/+6
(and as always if you find one, you can be sure there are 6 others in there when you grep for them) Change-Id: I9296ddbdda266c7b6d8a0ac0bc13ec5b6340cee7
2013-09-12certainly it is enough to obtain the disables dictionaries once?Eike Rathke1-1/+2
Change-Id: I323719e9c74d7c117062fb225a890a5e65c042ab
2013-09-11let us use the standard library instead of an own pow functionMarkus Mohrhard1-26/+3
Change-Id: Ib1c28fbb5d34409a42b7ea594cde9c1c1cdccdd8
2013-09-10unusedcode: remove AttributeListImplMatúš Kukan1-140/+0
Change-Id: I9c3c0d742bc2941fcf40ad69bfb744a57b3e7be6
2013-09-09Make SvtHistoryOptions not return files if they can't be openedKrisztian Pinter1-6/+22
Change-Id: I68cb3363a33b2d6ceb2330486e26d5cfa913c5e7 Reviewed-on: https://gerrit.libreoffice.org/5841 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2013-09-05getFallbackStrings() with bIncludeFullBcp47 parameterEike Rathke1-3/+2
so the various places that check the full tag first do not have to get it just to delete it again. Change-Id: Ib4e3cf1b16988464db875f1b6ac5cf4a0ab60fe5
2013-09-04Remove more unused methodsMarcos Paulo de Souza1-38/+0
Change-Id: I8fec40d767905bcca366257a67f669eaa1055cbc Reviewed-on: https://gerrit.libreoffice.org/5789 Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org> Reviewed-by: Marcos Souza <marcos.souza.org@gmail.com> Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
2013-09-03was convertIsoStringToLanguage(), use convertToLanguageTypeWithFallback()Eike Rathke1-1/+1
Change-Id: I4cfda0f08e1d85acc7f1b5819b8e0f64c4985bb1
2013-09-03was convertIsoStringToLanguage(), use convertToLanguageTypeWithFallback()Eike Rathke1-1/+1
Change-Id: If5dfd19368e2bd94aa55e06a65d68f422bae3877
2013-09-03WaE: unused defineCaolán McNamara1-2/+0
Change-Id: I2e4c9f695529a7692b1624d2bce54441d44806b9
2013-09-03Remove more unused methodsMarcos Paulo de Souza1-63/+0
Change-Id: I79548f9dd1b83ef940e7a1302cf7b728610fed4a Reviewed-on: https://gerrit.libreoffice.org/5757 Reviewed-by: Thomas Arnhold <thomas@arnhold.org> Tested-by: Thomas Arnhold <thomas@arnhold.org>
2013-08-28Mark as constTakeshi Abe2-7/+7
Change-Id: If20ac542f31dd650d6d1cc22ced618f73e1ce773
2013-08-27Resolves: fdo#67743 ensure user autocorr config dir existsCaolán McNamara1-0/+20
We try and copy the shared one to the user location the first time we create a customized user file. If the dir doesn't exist then that migration doesn't happen. The new autocorr file is then written, creating the dir, and any further operations will reattempt the skipped share copy, and this time succeed because the dir now exists. Which overwrites the previously written customized content. This is similar to fdo#65501 "ensure configured backup dir exists before using it", so reuse that code and move it into unotools. Change-Id: I38fa621b8d7295d70b09172a028569ea95404120
2013-08-21finish deprecation of O(U)String::valueOf()Luboš Luňák6-19/+19
Compiler plugin to replace with matching number(), boolean() or OUString ctor, ran it, few manual tweaks, mark as really deprecated. Change-Id: I4a79bdbcf4c460d21e73b635d2bd3725c22876b2
2013-08-19Introduce rtl::compareIgnoreCase and deprecate rtl/character.hxx equivalents.Arnaud Versini1-7/+8
Change-Id: Id90935fd2b0f904f89477792edc8140cfc31e91f Reviewed-on: https://gerrit.libreoffice.org/5412 Reviewed-by: Petr Mladek <pmladek@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
2013-08-18Use subfolder names from <config_folders.h>Tor Lillqvist1-2/+3
Change all instances of hardcoded "program", "share" etc subfolder names to use those from <config_folders.h> instead. In normal builds, the end result will not change. Change-Id: I91c95cd8e482818be67307e889ae6df887763f53
2013-08-10fdo#46037: 1 less occurrence comphelper/configurationhelper in unotoolsJulien Nabet2-49/+14
Change-Id: If188eecd0f5ea3802ec795866d21c41e643cbd63
2013-07-30Typos in debug messagesMatteo Casalin1-2/+2
Change-Id: I0b06af28959d7254b1aaca6e05c51311294bc3e7
2013-07-29Just quiet cppcheckJulien Nabet1-2/+2
Change-Id: I82d65a2ebc8023eaddb6dd1aefb872224f90b47a
2013-07-26targetted clean of redundant header piece from 62badf3828Michael Meeks1-3/+0
Change-Id: Ic1240114d667fb7797afae4847427cc889f3cb48