Commit graph

11824 commits

Author SHA1 Message Date
Caolán McNamara
6fa618722e coverity#1219793 Uncaught exception
and hopefully a gadzillion others

Change-Id: I853e997aa6510ed99c1af39eecfd80dba2d5c2a9
2014-06-02 16:59:58 +01:00
Caolán McNamara
31a480cf71 coverity#1202815 Missing break in switch
Change-Id: Ic18a984c4c05367ac1a863a27620c83391d5bac5
2014-05-30 14:19:07 +01:00
Caolán McNamara
7a211e834f Resolves: fdo#79360 impress hangs on using sidebar new style
because those styles are "pseudo-styles" and a new one cannot be
added. The possibility is supposed to be disabled, and it is
disabled in the floating stylelist. The old code assumes there
can only be one of these stylelists and when a stylelist
queries if the "new" should be disabled the callback asks
the stylelist what family is selected, but only asks the floating one.

So, floating closed, sidebar open, the new is not disabled.
Implement the ancient TODO now that we have to. Instead of asking
the stylelist what family is selected, query the frame for what
is the current SID_STYLE_FAMILY as set by whatever is the active
stylelist.

What's disturbing is the SID_STYLE_FAMILY values are not SfxStyleFamily, but
indexes that have to be mapped to SfxStyleFamily. I bet there are a pile of
bugs around that, especially with little islands of different conversion
codesites

Change-Id: I85c8032d7c26ae6eea245685748f89b2a860e767
2014-05-30 11:38:04 +01:00
Caolán McNamara
f48f5138ec convert from NId to FamilyId instead of FamilyId to NId
should be equivalent for comparison purposes

Change-Id: I45ed21ee3b45425b5e1ca39e0774c6d34cd2ee76
2014-05-29 15:34:50 +01:00
Caolán McNamara
fa551c4224 remove unused virtual method, slim this down initially
Change-Id: Ie4a912cc3c144c47a4bb59551ebb1c68f302569e
2014-05-29 12:01:23 +01:00
Caolán McNamara
da6df38b41 Related: fdo#79392 std::out_or_range -> terminate
Change-Id: I0aada90e9ea4e9fc92fd9c365aa9c7171cb10a55
2014-05-29 11:02:46 +01:00
Caolán McNamara
c24272c797 the dubious SfxModelSubComponent and friends aren't used outside sfx2
so move out of the globals headers and drop their public visibility
markup

Change-Id: Ie0a852c962a9d05488022397e83152d1c73cfa29
2014-05-29 11:02:45 +01:00
Caolán McNamara
a65b6a4626 valgrind: memleak when sidebar open in writer on close
==3768== 512 bytes in 1 blocks are possibly lost in loss record 25,532 of 28,010
==3768==    at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==3768==    by 0xB52FA41: __gnu_cxx::new_allocator<bool>::allocate(unsigned long, void const*) (new_allocator.h:104)
==3768==    by 0xB52EC00: std::__cxx1998::_Deque_base<bool, std::allocator<bool> >::_M_allocate_node() (stl_deque.h:533)
==3768==    by 0xB52DE4E: std::__cxx1998::_Deque_base<bool, std::allocator<bool> >::_M_create_nodes(bool**, bool**) (stl_deque.h:627)
==3768==    by 0xB52C624: std::__cxx1998::_Deque_base<bool, std::allocator<bool> >::_M_initialize_map(unsigned long) (stl_deque.h:601)
==3768==    by 0xB52ACA0: std::__cxx1998::_Deque_base<bool, std::allocator<bool> >::_Deque_base(std::allocator<bool> const&, unsigned long) (stl_deque.h:461)
==3768==    by 0xB5296D3: std::__cxx1998::deque<bool, std::allocator<bool> >::deque(std::allocator<bool> const&) (stl_deque.h:791)
==3768==    by 0xB52840E: std::__debug::deque<bool, std::allocator<bool> >::deque(std::allocator<bool> const&) (deque:73)
==3768==    by 0xB52786B: framework::UndoManagerHelper_Impl::UndoManagerHelper_Impl(framework::IUndoManagerImplementation&) (undomanagerhelper.cxx:221)
==3768==    by 0xB525882: framework::UndoManagerHelper::UndoManagerHelper(framework::IUndoManagerImplementation&) (undomanagerhelper.cxx:879)
==3768==    by 0x6872683: sfx2::DocumentUndoManager_Impl::DocumentUndoManager_Impl(sfx2::DocumentUndoManager&) (docundomanager.cxx:88)
==3768==    by 0x6870FB6: sfx2::DocumentUndoManager::DocumentUndoManager(SfxBaseModel&) (docundomanager.cxx:227)
==3768==    by 0x687A272: SfxBaseModel::getUndoManager() (sfxbasemodel.cxx:1677)
==3768==    by 0x260E562A: (anonymous namespace)::getUndoManager(com::sun::uno::Reference<com::sun::frame::XFrame> const&) (PagePropertyPanel.cxx:74)
==3768==    by 0x260E6C60: sw::sidebar::PagePropertyPanel::PagePropertyPanel(Window*, com::sun::uno::Reference<com::sun::frame::XFrame> const&, SfxBindings*) (PagePropertyPanel.cxx:189)
==3768==    by 0x260E593C: sw::sidebar::PagePropertyPanel::Create(Window*, com::sun::uno::Reference<com::sun::frame::XFrame> const&, SfxBindings*) (PagePropertyPanel.cxx:101)

The SfxBaseModel creates the DocumentUndoManager on demand at
sfx2/source/doc/sfxbasemodel.cxx:1685

m_pDocumentUndoManager is a rtl::Reference but debugging into the
acquire/release I see that the
DocumentUndoManager::acquire/DocumentUndoManager::release forward to those of
SfxModelSubComponent which forward them to its rModel without doing anything
else, so the implementations of
DocumentUndoManager::acquire/DocumentUndoManager::release don't actually do
anything directly to the DocumentUndoManager itself so there is nothing that
will really release it.

Either the rModel needs to explicitly destroy it somehow, given that the
acquire/release delegate responsibility to it, or the whole thing is addled.

I rather feel it's addled, so implement as a normal WeakImplHelper1, but
cowardly in addition also keep acquire/release on the rModel.

Change-Id: Ib52544a9276fd8d9d489ad6b6afda12498cc39fa
2014-05-29 11:02:45 +01:00
Caolán McNamara
947feaa896 pTemplateCommon is never set, so always NULL
Change-Id: I2311b33034c281cba66d7cce80a6556e27b2b322
2014-05-29 10:30:28 +01:00
Noel Grandin
f0ae48b684 remove unnecessary NULL parameter passed to UNO Exception
.. now that we have a default value for that parameter

Change-Id: I54d6b0a0a01ce2f2e5168ada0c427424de0477bc
2014-05-29 09:01:40 +02:00
Thomas Arnhold
5e62d30fa2 update_pch
Change-Id: I5316693452427ed76a7738b090de023b110caa40
2014-05-28 15:53:10 +02:00
Caolán McNamara
05e2fd162e Related: fdo#79142 make SetName default to Reindexing
Change-Id: I408042bc7bf1a5a955203d65d2c68ebf9527b9b5
2014-05-28 13:25:12 +01:00
Caolán McNamara
aa8b268935 Resolves: fdo#79142 When Creating Styles - The 2nd One Always Replaces the 1st
regression from 0c17ccc493

I think it might actually make more sense for SetName to always Reindex
and have another SetNameNoReindex for selective use where its known
safe to get away with it

Change-Id: I6bf7e1f45130f741954ab525b838f3ac5ff61a89
2014-05-28 10:44:59 +01:00
Thomas Arnhold
92b447876d css already means ::com::sun::star
Change-Id: I48d7b746d7cc49246743c62480b0d225d2519342
2014-05-27 14:00:28 +02:00
Caolán McNamara
9b47595a34 Resolves: fdo#79275 File Properties dialog’s layout is subpar
Change-Id: I594d93c0630528841a1f243e6b6e9eda67b6138d
2014-05-27 12:28:33 +01:00
Noel Grandin
56c4dbe523 cid#707147 Uncaught exception
Change-Id: Ie49e70c3fa7704727129e613814aaf559d1a7fb6
2014-05-27 10:50:04 +02:00
Noel Grandin
0f2824b117 remove more unnecessary use of OUString constructor
Change-Id: Iae14cb3df65295b6894fd9e05411c5698e9c8aba
2014-05-27 08:20:12 +02:00
Noel Grandin
9af0abebfd remove unnecessary use of Reference constructor in throw
Convert code like this:
  throw IOException("xx",
     Reference< XInterface >(static_cast<OWeakObject*>(this)) );
to this:
  throw IOException("xx",
     static_cast<OWeakObject*>(this) );

Change-Id: Ife9f645f0f1810a8e80219126193015502c43dbb
2014-05-27 08:20:11 +02:00
Peter Senna Tschudin
3b24dcc8a8 Remove unnecessary semicolons
A simplified version of the semantic match that finds this problem is
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r1@
statement S;
position p,p1;
@@
S@p1;@p

@script:python r2@
p << r1.p;
p1 << r1.p1;
@@
if p[0].line != p1[0].line_end:
    cocci.include_match(False)
@@
position r1.p;
@@
-;@p
// </smpl>

Change-Id: Ib9708d37fbb4c6060f88d5dae3814a2d37b2091e
Reviewed-on: https://gerrit.libreoffice.org/9493
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-27 01:19:00 -05:00
Caolán McNamara
178c5d8cfd coverity#704795 Unchecked dynamic_cast
Change-Id: I8526944acfb319f3e8e1e1927e94ea44eb59f5d6
2014-05-26 17:00:58 +01:00
Caolán McNamara
e576deff6a coverity#705232 Missing break in switch
Change-Id: Ifa6de9e9d1138e4962cd8cf0716fd6e06894c34f
2014-05-26 10:18:24 +01:00
Caolán McNamara
f3c9e8471a Resolves: fdo#79161 sidebar crash on deactivating
Change-Id: I0d559bd8c16243fdc398f6bff0aa915a83a29dff
2014-05-25 16:10:51 +01:00
Tor Lillqvist
5befa0c5c2 Correct #endif placement (avoid linking error for TiledLibreOffice)
Change-Id: I37577456740b4dd255df22047ce7740bd1e43ace
2014-05-23 18:30:18 +03:00
Noel Grandin
e7bc3cab01 remove boilerplate in UNO Exception constructor calls
Now that we have default values for Exception constructor params,
remove lots of boilerplate code.

Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
2014-05-23 15:06:00 +02:00
Tor Lillqvist
43bea0e2f7 Avoid including <config_features.h> in <sfx2/objsh.hxx>
Change-Id: I36969367e47c1ed1368ed46638ff9e7768e8a008
2014-05-23 14:29:59 +03:00
Caolán McNamara
93dd12a160 coverity#1215382 Uncaught exception
and hopefully a gadzillion more, but I've said that before :-(

Change-Id: I2e36485ae2ce831fdf250464b254d42f5bc55fe3
2014-05-23 08:54:37 +01:00
Matúš Kukan
6e87f0bb75 Update also revision and editing time when setting 'modified' properties.
Change-Id: Id756ef6dd62ca8df2e62265b9cc930f07d13f2e3
2014-05-22 13:56:23 +02:00
Matúš Kukan
fee87c6fda Use proper constructor to fill with system time.
Probably 86adb5cacb did not mean to change
the behaviour here.

Change-Id: If39c150973c502323b3c785a9738cf65cdd74e5d
2014-05-22 13:56:22 +02:00
Matúš Kukan
5c2ab70cc2 cp#1000077: Set 'modified' document property more consistently.
Update document info at one place, so that it works for other formats
like .doc, .docx, ... too.

Change-Id: If71799b491d2210f0d3bdbdb05f91f26c986a260
2014-05-22 13:55:53 +02:00
Thomas Arnhold
1e6ccc7f7e cppcheck: Function parameter 'aFocusLocation' should be passed by reference
Change-Id: I2d2b9ae3ea81bd725be2af460f6c57bd0897883c
2014-05-22 12:50:50 +02:00
Tomaž Vajngerl
0f9f8e05dc speed-up writer conversion in headless mode
Change-Id: Ie5ccd62608c0643e3c8f019aea136ba74b282274
2014-05-21 20:55:08 +02:00
Kohei Yoshida
50454f3822 cp#1000072: Skip styles import for external link cache documents.
This reduces external link update time by 10%.

Change-Id: Ic14d9ea7530818f839330a2004f6aa67ef1e831e
2014-05-21 13:25:37 -04:00
Stephan Bergmann
1b0402f87c Use varying aElement name
Change-Id: Idc135ef5031a01961cc18d897a734b598bc833f4
2014-05-21 15:30:19 +02:00
Julien Nabet
227af32d8c Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part18
Change-Id: Ibf958dbfbf7cdbe6ad31d390138be8d4d468c225
2014-05-20 23:29:53 +02:00
Noel Grandin
8d54796bf1 enhance pass-by-ref plugin to detect large arguments
Detect arguments larger than 64 chars passed by value.

Change-Id: I9b0ea9ccb99d115984a26eab67c9cf6afd5f6cae
Signed-off-by: Stephan Bergmann <sbergman@redhat.com>
2014-05-20 11:17:22 +02:00
Stephan Bergmann
d09124d942 Fix overriding exception specification
Change-Id: I6eb46f1ffccc1d98b1a1485486cbc355ce296cd3
2014-05-19 22:52:42 +02:00
Michael Stahl
b18ff2a2ef fdo#78536: sfx2: remove (likely) accidentally duplicated call
It looks like commit dda842bec3
wanted to #ifdef this Execute_Impl() call but somehow duplicated it.

Change-Id: I745e16cb0be19cf38eb70dd261204c879aa6986e
2014-05-19 22:24:07 +02:00
Michael Stahl
838c580fdb fdo#78536: sfx2: template dialog: make the am-i-dead-yet check reentrant
In the fine tradition of our enterprise-grade code base, this lets the
check in SfxCommonTemplateDialog_Impl::Execute_Impl() do an early
return if the "this" instance has signalled its untimely demise even if
there are multiple calls of Execute_Impl() on the stack; extending
the scheme with further epicycles to make it work if the Execute_Impl()
calls happen on 2 different threads is left as an exercise for the
interested reader.

(regression from bcc52fb2ebdf77a1cc089857775fd742085b45b6)

Change-Id: I1d9f0d82bf6d9f5da8f9bd2be57d01937d71fd26
2014-05-19 22:24:07 +02:00
Kohei Yoshida
2fc4f5cd75 Register OpenGL windows to ScGridWindow upon file load.
Change-Id: I6fdce232ef41079f20a983dc72da032196078858
2014-05-19 16:03:28 -04:00
Thomas Arnhold
6c29c3d178 remove commented out line
Change-Id: If80632525d88ed889291913b172fa3cb2a3ac956
2014-05-19 20:04:23 +02:00
Thomas Arnhold
3db8d606d5 hrc and src files: squeeze multiple newlines
for i in `find . -name *.src -or -name *.hrc`; do FILE=$(cat -s "$i"); echo "$FILE" > "$i"; done

Change-Id: I2bac5ad3e1eb3c566e5c867ccf45893a19e1561e
2014-05-19 20:04:22 +02:00
Michael Stahl
805fd1ca34 fdo#78742: SfxFilterMatcher: respect requested document service if set
sfx2::DocumentInserter::CreateMediumList() creates a SfxFilterMatcher
that should match Writer filters only, but actually Calc filters may be
returned; check that the document service matches.

(regression from 3da8f36805)

Change-Id: I6208d38c1110355105aa5d1ffa1b57142193a4d7
2014-05-19 18:49:46 +02:00
Caolán McNamara
c5e114c00c valgrind: memory leak
Change-Id: Ica30df49caf79117bbce36ec461ec5ef37bef20c
2014-05-19 16:36:19 +01:00
Tsutomu Uchino
61ce018658 Resolves: #i86528# use the module manager to identify the context...
for addons menu merging

(cherry picked from commit 2aac0070dbef6c1ad7eeccf7d4015cdcbffe067e)

Conflicts:
	framework/source/classes/menumanager.cxx
	framework/source/fwe/classes/addonmenu.cxx
	framework/source/uielement/menubarmanager.cxx
	include/framework/addonmenu.hxx

Change-Id: I3b606671db3a4c6ba8ed2b850e01e1ac91db7581
2014-05-19 13:28:17 +01:00
Maxim Monastirsky
435c1b15dc fdo#78782 startcenter: open document on enter key
Change-Id: I501dbd6a0f4e5323a003afbb19707aad67897cd0
2014-05-17 21:56:17 +03:00
Chris Laplante
3c1e30b77d Correct common misspellings, and remove some ASCII art along the way.
Change-Id: I42787db31769e8bde984c5f4f0aa90335e889b1c
Reviewed-on: https://gerrit.libreoffice.org/9356
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
2014-05-17 12:38:38 +00:00
Caolán McNamara
fdca15fb86 valgrind: SfxBaseModel's pImpl of fallback TargetDocument for paste leaks
e.g. repeatedly pasting a metafile into writer and deleting it.

==13369== 342 (232 direct, 110 indirect) bytes in 1 blocks are definitely lost in loss record 19,396 of 22,170
==13369==    at 0x4A06965: operator new(unsigned long) (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13369==    by 0x686D72E: SfxBaseModel::SfxBaseModel(SfxObjectShell*) (sfxbasemodel.cxx:518)
==13369==    by 0x288CA9C1: SvxUnoDrawingModel::SvxUnoDrawingModel(SdrModel*) (unomod.cxx:255)
==13369==    by 0x28961055: SvxDrawingLayerImport(SdrModel*, com::sun::uno::Reference<com::sun::io::XInputStream> const&, com::sun::uno::Reference<com::sun::lang::XComponent> const&, char const*) (xmlexport.cxx:164)
==13369==    by 0x28960FA2: SvxDrawingLayerImport(SdrModel*, com::sun::uno::Reference<com::sun::io::XInputStream> const&, com::sun::uno::Reference<com::sun::lang::XComponent> const&) (xmlexport.cxx:148)
==13369==    by 0x2896175E: SvxDrawingLayerImport(SdrModel*, com::sun::uno::Reference<com::sun::io::XInputStream> const&) (xmlexport.cxx:254)
==13369==    by 0x240B1002: SwFEShell::Paste(SvStream&, unsigned short, Point const*) (fecopy.cxx:1333)
==13369==    by 0x247B981A: SwTransferable::_PasteSdrFormat(TransferableDataHelper&, SwWrtShell&, unsigned short, Point const*, unsigned char, bool) (swdtflvr.cxx:2207)
==13369==    by 0x247B678E: SwTransferable::PasteData(TransferableDataHelper&, SwWrtShell&, unsigned short, unsigned long, unsigned short, bool, bool, Point const*, signed char, bool) (swdtflvr.cxx:1481)
==13369==    by 0x247B5AE4: SwTransferable::Paste(SwWrtShell&, TransferableDataHelper&) (swdtflvr.cxx:1150)
==13369==    by 0x2488FCCE: SwBaseShell::ExecClpbrd(SfxRequest&) (basesh.cxx:277)

     Reference< lang::XComponent > xTargetDocument( xComponent );
     if( !xTargetDocument.is() )
     {
>        xTargetDocument = new SvxUnoDrawingModel( pModel );
         pModel->setUnoModel( Reference< XInterface >::query( xTargetDocument ) );
     }

Change-Id: I3bd0fc983d9b6bdcdc91071a4ec3d2c584397ebf
2014-05-16 21:05:02 +01:00
Thomas Arnhold
a6ef8ed1d6 clean up, remove eof comments
Change-Id: I166e781cb54181a8e5d08021cf5f6dfcd1fde5cb
2014-05-16 14:37:27 +02:00
Thomas Arnhold
2bd7767d01 Resolves fdo#70681: fixincludeguards.pl: all that's left
Change-Id: I3e51a62710bb46c8255fd228d41d9300c90a1fb5
Reviewed-on: https://gerrit.libreoffice.org/9360
Reviewed-by: Thomas Arnhold <thomas@arnhold.org>
Tested-by: Thomas Arnhold <thomas@arnhold.org>
2014-05-15 12:50:46 +00:00
Stephan Bergmann
3385b0da3d Minor utl::TempFile clean up
Change-Id: I20de8b2321d2656d17d25c6343d72c534d47e597
2014-05-15 11:35:38 +02:00