Commit Graph

112 Commits

Author SHA1 Message Date
ae13a6819e Fix typos
Change-Id: Id66432ef80fc2963fd2cbc6fad5d8e135e8975b0
Reviewed-on: https://gerrit.libreoffice.org/18956
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Tested-by: Oliver Specht <oliver.specht@cib.de>
2015-09-30 12:38:23 +00:00
350b9e36af Add OString::startsWithIgnoreAsciiCase
...analogous to the existing OUString::startsWihtIgnoreAsciiCase, to be used in
the next commit

Change-Id: Iad6989c16e1bda6b2b0a58e6c768f7852560bb00
2015-09-10 23:04:32 +02:00
9d307abeec new loplugin: defaultparams
find places where we do not need to be passing a parameter to a
function, because that function has a default value which matches the
value we are passing.

Change-Id: I04d1fd6275204dd4925e6563282464f461123632
2015-08-11 08:25:33 +02:00
69df701742 Fix a copy-paste error
Change-Id: Ifabb905819e32cf4db603f3f7bb18e6cc8fdfdcf
2015-08-03 17:57:58 +09:00
a6c47236a4 Apply special treatment of OUStringLiteral1 to MSVC 2015
Change-Id: I56e69fbdb555bb30cd88d75717d6f716c81ae237
Reviewed-on: https://gerrit.libreoffice.org/16804
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
2015-07-22 17:56:03 +00:00
f20162304d Rule out OString(std::nullptr_t)
(This is no issue for OUString, as it has two ctors taking a single pointer
argument, so passing a null pointer is ambiguous anyway.)

Change-Id: I36f44b29eb84eb83e284fa080d706eabb4b485d5
2015-07-12 18:14:37 +02:00
799cc41b53 Fix typos
Change-Id: I70b03c152f63e48341dc5629a99b0eeab7b497c0
Reviewed-on: https://gerrit.libreoffice.org/16834
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2015-07-08 05:48:18 +00:00
420923ba76 Fix typos
Change-Id: Ie2bbe020fc6e3a4a4f913208c245f395849bb9ee
Reviewed-on: https://gerrit.libreoffice.org/16708
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2015-07-03 09:32:26 +00:00
14255b68e0 Coverity 1308555, 1308562, 1308600: Drop some SAL_THROW_EXTERN_C
...from most rtl/bootstrap.h functions.  They are effectively only called from
C++ code (there is no plain C UNO binding), so it should be fine to let std
exceptions (like bad_alloc or length_error) propagate from their implementations
to call sites.

(The exception is rtl_bootstrap_args_close, which is typically called from C++
dtors, so should not throw anyway.)

This would strictly speaking be an [API CHANGE], but it should make no practical
difference whether a process terminates abruptly because an exception cannot
pass through a SAL_THROW_EXTERN_C() nothrow specification or because legacy
client code does not expect exceptions to be thrown from functions from which
SAL_THROW_EXTERN_C() has now been removed.

Change-Id: I08e8479e9c5731e46021aadd6a725c1793024d10
2015-06-30 17:07:59 +02:00
edc96a157e Add optimized OUString += literal overload
Change-Id: Ib34196185f90204a71598f2c659c3fddce7a0e4d
2015-06-26 13:55:30 +02:00
1de776a492 SAL_WARN_UNUSED_RESULT missing from some of the operator+ overloads
Change-Id: I70acf02c36ced3ff19f424768f293f2221ef7af5
2015-06-26 13:55:30 +02:00
9a850b8078 Unnecessary nested #ifdef LIBO_INTERNAL_ONLY
Change-Id: I889aa10e0cb7b5779527e5ef2be5d707dd493e90
2015-06-26 13:55:29 +02:00
8007417c31 Revert "Revert "Generalize OUStringLiteral1""
This reverts commit 5cba714b4d03ed54debf71534ad8c8edc383a01e, now including a
workaround for <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53658> "internal
compiler error -- segmentation fault."

Change-Id: I31f6d9ddcb0b884134703df2b9dc1800ba0a84be
2015-06-25 12:38:32 +02:00
5cba714b4d Revert "Generalize OUStringLiteral1"
This reverts commit 4d4f3512db0cf0bf47c2ba1b39c3813842903ef7, at least "gcc
version 4.8.3 20140627 [gcc-4_8-branch revision 212064] (SUSE Linux)" fails with
"include/rtl/stringutils.hxx:175:49: internal compiler error: Segmentation
fault."
2015-06-24 16:33:50 +02:00
4d4f3512db Generalize OUStringLiteral1
...by making all places that accept a string literal via ConstCharArrayDetector
also accept an OUStringLiteral1 via ConstCharArrayDetector (which required some
tweaking of the ConstCharArrayDetector internals).  That removes the need for
special-purpose OUStringLiteral1 overloads, and will allow OUStringLiteral1 to
be used in more places.

Change-Id: I370de8480e02f8423cde5677dd38479b81bccdb2
2015-06-24 15:48:21 +02:00
fd7889a9cf Implement full set of OUString::replaceFirst/All literal overloads
Change-Id: I5f525d91ce24d1d2653a6855f1c4fffc039ae398
2015-06-23 14:53:56 +02:00
1b60c3d62d Avoid conversion warnings in rtl::get[High|Low]Surrogate
Change-Id: I5eec1f7505e27eedd39081669011f7af42b8a26f
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2015-06-23 12:33:36 +02:00
cbe3b2fe0b Avoid conversion warning in O[U]String[Buffer] constructors
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>, modifying the patch to
carefully keep the undefined behavior in the already existing additions that may
potentially overflow, instead of making the static_cast<sal_Int32> introduction
look like end - pData->buffer will be guaranteed to fit into sal_Int32 (which it
is not).

Change-Id: Id2fb64dc4585dae34257be6968a8905254a3b42d
2015-06-23 12:33:36 +02:00
cbe944e323 Catch inadvertent uses of OUString(sal_Unicode) ctor
...with numeric values that are not meant to be characters.  Inspired by
<https://gerrit.libreoffice.org/#/c/16339/> "OUString: add constructor from
single Unicode code point" and ecaf1cb3861c1b519a1495487fc796884cf37b92 "seems
to be what was meant."  Found e46e8d19458fd64ff20b1013e5eeabd07e62379c "Shall
this produce a string representation of a number?" and
f2a0e4032734d6be635f14ade3dea499c29ec6c2 "Don't truncate a UTF-32 code point to
a UTF-16 code unit."

(LIBO_INTERNAL_ONLY mostly because it uses a C++11 delegating ctor for
simplicity, but also because it requires mild modifications to client code, see
additional changes in this commit and some other recent commits.)

Change-Id: I8a156f01d1b772c6052d7afaa088ae13ed234e2b
2015-06-19 13:26:09 +02:00
3fa7b0b70f Fix typos
Change-Id: Id8c7cf460cba5af89891c470e1aaa61b227d356e
Reviewed-on: https://gerrit.libreoffice.org/16310
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
2015-06-16 11:25:13 +00:00
e8b97a52c9 Merge remote-tracking branch 'origin/feature/vclptr'
Resolve several thousand lines of conflicts.

Conflicts:
	accessibility/source/extended/accessiblelistbox.cxx
	accessibility/source/standard/vclxaccessiblecombobox.cxx
	accessibility/source/standard/vclxaccessibledropdowncombobox.cxx
	accessibility/source/standard/vclxaccessibledropdownlistbox.cxx
	accessibility/source/standard/vclxaccessiblelistbox.cxx
	accessibility/source/standard/vclxaccessibletextfield.cxx
	basctl/source/basicide/basidesh.cxx
	cui/source/inc/chardlg.hxx
	cui/source/tabpages/tpbitmap.cxx
	dbaccess/source/ui/dlg/UserAdmin.cxx
	dbaccess/source/ui/querydesign/ConnectionLineAccess.cxx
	extensions/source/propctrlr/propertyeditor.hxx
	extensions/source/scanner/sanedlg.cxx
	filter/source/pdf/impdialog.cxx
	include/sfx2/mgetempl.hxx
	include/sfx2/sidebar/SidebarToolBox.hxx
	include/sfx2/viewsh.hxx
	include/svtools/brwbox.hxx
	include/svtools/filectrl.hxx
	include/svtools/scrwin.hxx
	include/svx/dlgctrl.hxx
	include/svx/sidebar/Popup.hxx
	include/svx/sidebar/PopupContainer.hxx
	include/svx/sidebar/PopupControl.hxx
	include/svx/sidebar/SidebarDialControl.hxx
	include/svx/sidebar/ValueSetWithTextControl.hxx
	sc/source/ui/condformat/condformatdlgentry.cxx
	sc/source/ui/navipi/navipi.cxx
	sc/source/ui/sidebar/CellBorderStyleControl.hxx
	sd/source/ui/animations/CustomAnimationDialog.cxx
	sd/source/ui/inc/DrawViewShell.hxx
	sd/source/ui/inc/Ruler.hxx
	sd/source/ui/inc/SlideSorter.hxx
	sd/source/ui/inc/ViewTabBar.hxx
	sd/source/ui/inc/Window.hxx
	sd/source/ui/inc/morphdlg.hxx
	sd/source/ui/inc/sdpreslt.hxx
	sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
	sd/source/ui/sidebar/LayoutMenu.hxx
	sd/source/ui/sidebar/MasterPagesSelector.hxx
	sd/source/ui/sidebar/NavigatorWrapper.hxx
	sd/source/ui/sidebar/PanelBase.hxx
	sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
	sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
	sd/source/ui/slideshow/showwindow.hxx
	sd/source/ui/slidesorter/view/SlsInsertAnimator.cxx
	sd/source/ui/slidesorter/view/SlsLayeredDevice.hxx
	sd/source/ui/view/ViewShellBase.cxx
	sd/source/ui/view/drviewsa.cxx
	sfx2/source/appl/fileobj.hxx
	sfx2/source/appl/opengrf.cxx
	sfx2/source/control/thumbnailviewacc.hxx
	sfx2/source/dialog/securitypage.cxx
	sfx2/source/dialog/templdlg.cxx
	sfx2/source/doc/docinsert.cxx
	sfx2/source/doc/guisaveas.cxx
	sfx2/source/inc/alienwarn.hxx
	sfx2/source/sidebar/Deck.cxx
	sfx2/source/sidebar/Deck.hxx
	sfx2/source/sidebar/DeckTitleBar.cxx
	sfx2/source/sidebar/DeckTitleBar.hxx
	sfx2/source/sidebar/MenuButton.cxx
	sfx2/source/sidebar/MenuButton.hxx
	sfx2/source/sidebar/Panel.cxx
	sfx2/source/sidebar/Panel.hxx
	sfx2/source/sidebar/PanelTitleBar.hxx
	sfx2/source/sidebar/SidebarDockingWindow.hxx
	sfx2/source/sidebar/SidebarToolBox.cxx
	sfx2/source/sidebar/TabBar.hxx
	sfx2/source/sidebar/TabItem.cxx
	sfx2/source/sidebar/TabItem.hxx
	sfx2/source/sidebar/TitleBar.hxx
	sfx2/source/toolbox/imgmgr.cxx
	starmath/inc/edit.hxx
	starmath/inc/smmod.hxx
	starmath/qa/cppunit/test_starmath.cxx
	starmath/source/edit.cxx
	starmath/source/smmod.cxx
	svtools/source/brwbox/brwbox1.cxx
	svtools/source/brwbox/datwin.hxx
	svtools/source/contnr/fileview.cxx
	svtools/source/contnr/simptabl.cxx
	svtools/source/control/filectrl.cxx
	svtools/source/control/valueimp.hxx
	svx/inc/GalleryControl.hxx
	svx/source/dialog/dlgctrl.cxx
	svx/source/dialog/swframeexample.cxx
	svx/source/fmcomp/fmgridif.cxx
	svx/source/gallery2/GalleryControl.cxx
	svx/source/sidebar/EmptyPanel.hxx
	svx/source/sidebar/area/AreaPropertyPanel.hxx
	svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
	svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
	svx/source/sidebar/insert/InsertPropertyPanel.cxx
	svx/source/sidebar/insert/InsertPropertyPanel.hxx
	svx/source/sidebar/line/LinePropertyPanel.hxx
	svx/source/sidebar/line/LineWidthControl.cxx
	svx/source/sidebar/line/LineWidthControl.hxx
	svx/source/sidebar/line/LineWidthValueSet.hxx
	svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
	svx/source/sidebar/possize/SidebarDialControl.cxx
	svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
	svx/source/sidebar/text/TextPropertyPanel.hxx
	svx/source/sidebar/tools/PopupContainer.cxx
	svx/source/sidebar/tools/PopupControl.cxx
	svx/source/sidebar/tools/ValueSetWithTextControl.cxx
	svx/source/svdraw/svdfmtf.hxx
	svx/source/svdraw/svdibrow.cxx
	svx/source/tbxctrls/colrctrl.cxx
	svx/source/tbxctrls/tbcontrl.cxx
	sw/source/ui/dbui/mmaddressblockpage.cxx
	sw/source/ui/dialog/uiregionsw.cxx
	sw/source/ui/index/cnttab.cxx
	sw/source/uibase/inc/drpcps.hxx
	sw/source/uibase/sidebar/PageColumnControl.hxx
	sw/source/uibase/sidebar/PageMarginControl.hxx
	sw/source/uibase/sidebar/PageOrientationControl.hxx
	sw/source/uibase/sidebar/PagePropertyPanel.hxx
	sw/source/uibase/sidebar/PageSizeControl.hxx
	sw/source/uibase/uiview/view2.cxx
	sw/source/uibase/utlui/navipi.cxx
	vcl/inc/svdata.hxx
	vcl/source/control/combobox.cxx
	vcl/source/control/lstbox.cxx
	vcl/source/window/dockwin.cxx
	vcl/source/window/winproc.cxx

Change-Id: I056cf3026ff17d65cca0b6e6588bda4a88fa8d95
2015-04-28 15:08:48 +01:00
9561c2f679 Clean up new rtl/surrogates.h
Change-Id: Iec781bdbbf216cb14c9ba5be5955123273d7699c
2015-04-20 13:51:19 +02:00
fd8c06aded duplicate surrogate code
Change-Id: I9fad024e4b5c8a4ca272f2387df07351198cf5dc
2015-04-20 10:09:58 +01:00
582e89610b vclptr: create Instance helpers, and set initial ref-count to 1.
Document that in README.lifecycle; the problem is that our constructors
currently take and release references left/right on the object being
created, which ... means we need an initial reference.

Change-Id: I5de952b73ac67888c3fbb150d4a7cde2a7bc9abf
2015-04-10 13:13:53 +01:00
8e6c335c19 Update @since tags LO 4.5 -> 5.0
Change-Id: Idb2e46fcaa080d6763d2e3ed963f7673a2353eb2
2015-04-10 11:50:37 +02:00
026b17b7d7 V597: introduce a rtl_secureZeroMemory
Change-Id: Id28046eb318cd3b2ed0b813fd266617547cf6ee2
2015-03-31 13:38:01 +01:00
cc8a2d0038 tdf#88835 Calc: General format: 2 digits in exponent
Create 4 new formats enums rtl_math_StringFormat:
rtl_math_StringFormat_E1, rtl_math_StringFormat_E2,
rtl_math_StringFormat_G1, rtl_math_StringFormat_G2
to 1 or 2 digits in exponent for scientific notation.

Set General format to use rtl_math_StringFormat_E2.
Set trendline equation in status bar to use rtl_math_StringFormat_E1

Change-Id: I41466a6d4ba808ba5b9b38ba252b37c6b4560f12
Reviewed-on: https://gerrit.libreoffice.org/14562
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
2015-02-23 20:26:34 +00:00
48f0a5ed35 Typos
Change-Id: I845a85e1aad4a0708f2b43f7d94606b4b5513ee4
2015-02-18 21:59:02 +01:00
3d403f2af2 Related: tdf#63690 - remove rtl_logfile
This was unused since the earlier cleanup.

Change-Id: Ia56641c4242037a0ce501e43939b8dc862499f0e
2015-02-14 00:46:15 +01:00
78f25d565e Basic : Partially rewrite hex and octal constant reading.
Change-Id: I42f72e7b1ca897aba71950841f90b501cf3b6dc2
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2015-02-09 13:18:31 +01:00
4a2f646203 loplugin:deletedspecial
Change-Id: I646d55ee80ceeefbb3647ec64278460cc5af579f
2015-02-07 12:36:01 +01:00
f1359d1221 Make OUStringLiteral more useful
...don't dare make it non-explicit, yet.

Along the way, introduce SAL_CONSTEXPR.

Change-Id: Ia3179d0d5e001fd7aa92237c97437e9b74366ee1
2015-02-06 18:41:42 +01:00
d4cd001e31 sal: add back the append / insert assertions that were...
...removed in 2c03d6fb053319e61ed600a3c22c4fd39da84e4d.

Change-Id: I09194c55ac574bbc0f3065360b329fab8f0ba10c
2015-02-06 11:31:54 +01:00
b0ef5cf258 sal: add some argument checking assertions for strings and buffers
Also remove some now redundant asserts from headers.

Some of these actually trigger on unit tests so are commented out.

Change-Id: I07c6b2b2bd175361691a141f22eec584e3ab8f0b
2015-02-05 23:33:07 +01:00
598d8194b0 Visible function type RTTI for Clang -fsanitize=function
...by adding some further SAL_DLLPUBLIC_RTTI type annotations (cf.
b4f6b26b5a1a78fecfa95ec2eb7ac8b80495d8aa "SAL_DLLPUBLIC_RTTI for proper RTTI
visibility for LLVM") and by making sure relevant function types do not use
incomplete types in their parameter and return types (which would make the RTTI
hidden).

Change-Id: Id7aadcbc0704b9759968ae36266fc9ce11a2e340
2015-01-26 15:17:28 +01:00
4c752c44f8 sal: remove GCC 4.6 check, it does not claim C++11 support
Change-Id: Ica0ff6a36e64c732000ef900fa7aeafaf6da3e04
2015-01-23 15:50:27 +01:00
102b259754 sal: try to fix prematurely pushed 853c2fc71a96755a9dee629fd5d0e1cff9a48034
Change-Id: Id00e2579edcc9856c0fa3985e34c4a2f3e7ae5ec
2015-01-23 14:28:39 +01:00
853c2fc71a sal: try to avoid abuse of OUStringBuffer(int) ctor
... to avoid bugs like commit f0d6e0e1e21afd0adf5bd01d771b2d83d8f13a48.

Change-Id: I1e41d421609e09bf62a7a04ba34f3a8e8d118fd3
2015-01-23 14:04:25 +01:00
b70b4e644b Some more loplugin:cstylecast: sal
Change-Id: Ie54d340478412e62b87d66e287fd8a3963e97898
2015-01-20 09:06:50 +01:00
c6686fee44 remove boost::unordered_* from comments
seeing as config.h has just changed

Change-Id: Ia4b78ec4c2522a1b5d6beb1f713855b654234a24
2015-01-07 13:46:01 +00:00
b63571f510 Typos
Change-Id: I3475be796cf2655d9b619b86c9686aeef4b97b82
2014-12-20 16:39:24 +01:00
a5bdf3c606 Make O[U]StringLiteral ctor explicit
Change-Id: Ide8b167d544447dd6844f5249fe6831ef4d2b4eb
2014-12-19 14:28:14 +01:00
ffd00464f8 This is not java.lang.StringBuffer
Change-Id: Iea1ebb8ec79647b279fde359aa4d617d9c360e56
2014-12-19 14:28:14 +01:00
240f9bcb70 No need for RTL_FAST_STRING in addition to LIBO_INTERNAL_ONLY
Change-Id: I5514898f588b21bafceefca95e3276826cb9a882
2014-12-19 14:28:14 +01:00
d5c86be04e No need for RTL_USING in addition to LIBO_INTERNAL_ONLY
Change-Id: Iaa65658aed6bb4abb20a4d95dc9c6caf7c1c764b
2014-12-19 14:28:13 +01:00
86ba184394 Introduce gb_*_set_external_code
...to harmonize the mechanisms to not define LIBO_INTERNAL_ONLY for extension
code and CppunitTest_odk_checkapi.  (It also needs to revert any -Wundef, as the
config_host/config_*.h files will not be included, so the HAVE_* macros will be
undefined.)

This obsoletes the need for RTL_DISABLE_FAST_STRING.

Change-Id: If5eacba80c349efb90762aade8f2ea6d2db7e314
2014-12-18 16:39:43 +01:00
d0ec8c4901 rtl::OUStringLiteral to the rescue
...for cases where ? "a" : "bb" does not work, as well as to work around the
MSVC bug for cases like ? "a" : "b".

Change-Id: Id404716047aca5cc81440f291616d92365379b8f
2014-12-17 16:39:33 +01:00
0f5e917024 Introduce rtl::OUStringLiteral1
...to use single ASCII character literals "more directly" in the OUString API
(instead of having to go via an intermediary OUString ctor call).  Especially
useful for character literals that are defined as const variables or via macros
("direct" uses of character literals in the OUString API can often simply be
replaced with single-character string literals, for improved readability).

(The functions overloaded for OUStringLiteral1 are those that are actually used
by the existing LO code; more could potentially be added.  The asymmetry in the
operator ==/!= parameter types is by design, though---writing code like

  'x' == s

is an abomination that shall not be abetted.)

Change-Id: Ic5264714be7439eed56b5dfca6ccaee277306f1f
2014-12-17 16:39:33 +01:00
5252652ac5 Introduce OStringBuffer::appendUninitialized
...corresponding to the OUStringBuffer couterpart

Change-Id: I3ab03343696e6755cf1ccc470e4decc2f41d2558
2014-11-20 08:34:07 +01:00
186990395d Clean up Mac _imp_getProcessLocale
Introduces OUStringBuffer::appendUninitialized.

Change-Id: If225ec4d798e0df91cad60130e3f22ee26b88abb
2014-11-20 08:34:06 +01:00