summaryrefslogtreecommitdiff
path: root/sw/source/core/edit
AgeCommit message (Collapse)AuthorFilesLines
2015-10-27fdo#79409 allow selection from list field in protected sectionAndras Timar1-1/+1
Change-Id: I4840ab7e24c8569aea727a537e00e88a8e9ed15b Reviewed-on: https://gerrit.libreoffice.org/12983 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 7a091b24ef3abc2f27bfaebdd47714d936f4e9c9) Reviewed-on: https://gerrit.libreoffice.org/19625 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
2015-04-27rhbz#1205072: sw: resource mangement SNAFU caused by SwPaM copy ctorMichael Stahl2-2/+5
SwPaM copy ctor has the surprising habit of linking the new one into the old one's Ring. If you copy a shell cursor, *this* epic fail happens: ==948== Thread 6 SelectionManager: ==948== Invalid free() / delete / delete[] / realloc() ==948== at 0x4A07CE9: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==948== by 0x222F542B: SwPaM::operator delete(void*, unsigned long) (in /libreoffice-4-3/instdir/program/libswlo.so) ==948== by 0x2239E20E: SwPaM::~SwPaM() (pam.cxx:422) ==948== by 0x22368630: CheckRange(SwCursor*) (crsrsh.cxx:111) ==948== by 0x2236DECC: SwCrsrShell::UpdateCrsr(unsigned short, bool) (crsrsh.cxx:1397) ==948== by 0x22369113: SwCrsrShell::EndAction(bool) (crsrsh.cxx:290) ==948== by 0x2268971F: SwEditShell::EndAllAction() (edws.cxx:87) ==948== by 0x2262BEF3: SwBaseLink::DataChanged(rtl::OUString const&, com::sun::star::uno::Any const&) (swbaslnk.cxx:274) ==948== by 0x2262C78E: SwBaseLink::SwapIn(bool, bool) (swbaslnk.cxx:411) ==948== by 0x227102EC: SwGrfNode::SwapIn(bool) (ndgrf.cxx:539) ==948== by 0x227121BC: SwGrfNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndgrf.cxx:999) ==948== by 0x22610E4D: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1862) ==948== by 0x225B98E0: SwDoc::CopyWithFlyInFly(SwNodeRange const&, int, SwNodeIndex const&, SwPaM const*, bool, bool, bool) const (ndcopy.cxx:1336) ==948== by 0x224AC1FF: SwDoc::CopyLayoutFmt(SwFrmFmt const&, SwFmtAnchor const&, bool, bool) (doclay.cxx:446) ==948== by 0x2294D2D4: SwTxtFlyCnt::CopyFlyFmt(SwDoc*) (atrflyin.cxx:130) ==948== by 0x229A5B96: MakeTxtAttr(SwDoc&, SfxPoolItem&, int, int, CopyOrNew_t, SwTxtNode*) (thints.cxx:1060) ==948== by 0x229A64E6: SwTxtNode::InsertItem(SfxPoolItem&, int, int, unsigned short) (thints.cxx:1224) ==948== by 0x2298E536: SwTxtNode::CopyText(SwTxtNode*, SwIndex const&, SwIndex const&, int, bool) (ndtxt.cxx:1773) ==948== by 0x2298DC08: SwTxtNode::CopyText(SwTxtNode*, SwIndex const&, int, bool) (ndtxt.cxx:1555) ==948== by 0x225B4C9D: SwTxtNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndcopy.cxx:286) ==948== by 0x22610E4D: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1862) ==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) ==948== by 0x225B5D8D: SwTableNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndcopy.cxx:475) ==948== by 0x22610ACA: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1790) ==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) ==948== by 0x225CA663: SwSectionNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndsect.cxx:1270) ==948== by 0x22610BFC: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1817) ==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) ==948== by 0x225CA663: SwSectionNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndsect.cxx:1270) ==948== by 0x22610BFC: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1817) ==948== by 0x223EF3C2: SwNodes::_Copy(SwNodeRange const&, SwNodeIndex const&, bool) const (ndarr.hxx:182) ==948== by 0x225CA663: SwSectionNode::MakeCopy(SwDoc*, SwNodeIndex const&) const (ndsect.cxx:1270) ==948== by 0x22610BFC: SwNodes::_CopyNodes(SwNodeRange const&, SwNodeIndex const&, bool, bool) const (nodes.cxx:1817) ==948== by 0x225B98E0: SwDoc::CopyWithFlyInFly(SwNodeRange const&, int, SwNodeIndex const&, SwPaM const*, bool, bool, bool) const (ndcopy.cxx:1336) ==948== by 0x225B8F15: SwDoc::CopyImpl(SwPaM&, SwPosition&, bool, bool, SwPaM*) const (ndcopy.cxx:1239) ==948== by 0x225B6EE0: SwDoc::CopyRange(SwPaM&, SwPosition&, bool) const (ndcopy.cxx:707) ==948== by 0x22667E69: SwEditShell::_CopySelToDoc(SwDoc*, SwNodeIndex*) (edglss.cxx:244) ==948== by 0x226C8400: SwFEShell::Copy(SwDoc*, rtl::OUString const*) (fecopy.cxx:214) ==948== by 0x22DBF72B: (anonymous namespace)::lclOverWriteDoc(SwWrtShell&, SwDoc&) (swdtflvr.cxx:373) ==948== by 0x22DBFBC6: SwTransferable::GetData(com::sun::star::datatransfer::DataFlavor const&, rtl::OUString const&) (swdtflvr.cxx:439) ==948== by 0x7CB36C7: TransferableHelper::getTransferData2(com::sun::star::datatransfer::DataFlavor const&, rtl::OUString const&) (transfer.cxx:332) ==948== by 0x7CB34B5: TransferableHelper::getTransferData(com::sun::star::datatransfer::DataFlavor const&) (transfer.cxx:306) ==948== by 0x17A7E949: x11::SelectionManager::convertData(com::sun::star::uno::Reference<com::sun::star::datatransfer::XTransferable> const&, unsigned long, unsigned long, int&, com::sun::star::uno::Sequence<signed char>&) (X11_selection.cxx:655) ==948== by 0x17A823CA: x11::SelectionManager::sendData(x11::SelectionAdaptor*, unsigned long, unsigned long, unsigned long, unsigned long) (X11_selection.cxx:1503) ==948== by 0x17A82E03: x11::SelectionManager::handleSelectionRequest(XSelectionRequestEvent&) (X11_selection.cxx:1729) ==948== by 0x17A8A08A: x11::SelectionManager::handleXEvent(_XEvent&) (X11_selection.cxx:3574) ==948== Address 0x21e31a60 is on thread 6's stack ==948== in frame #40, created by SwEditShell::_CopySelToDoc(SwDoc*, SwNodeIndex*) (edglss.cxx:158) (regression from 49505336a629a75f4fb48bbe0c532b402e857ed4) (cherry picked from commit c55599fd0e7198773087c6433031f7119aaaca36) Conflicts: sw/source/core/edit/edglss.cxx Change-Id: I3d0a288a83b4719dda7977b4898dea656ea67388 Reviewed-on: https://gerrit.libreoffice.org/15533 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
2015-04-09Resolves: tdf#87548 don't create a new list for each multiselection portionCaolán McNamara1-4/+14
create one list and share it among all the subsections possibly a regression from/triggered by author Oliver-Rainer Wittmann <orw@apache.org> 2014-03-18 14:33:39 (GMT) Resolves: #i124371# When changing the numbering or bullet styling... of a set of paragraph which have more than one different List Style applied create a new List Style and put the paragraphs into a new list. (cherry picked from commit 0087ca89e3905009ed947c651f3dc70f3d61ea93) Change-Id: I9416b97d6afe323ac99150fdcc23f71ecea98a58 (cherry picked from commit db41e274747e6f1d3eee2bd5efb3321cfcbd6b75) Reviewed-on: https://gerrit.libreoffice.org/15138 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
2015-04-03sw: fix crash on SwUndoDelete after select-all with table at startMichael Stahl1-0/+1
Somehow the Redo leaves the shell cursor at an invalid offset into the paragraph, which then leads to out-of-bounds string access. Noticed that SwUndRng::SetPaM() leaves an invalid nContent.m_nIndex on the start position, due to a surprising omission in SwIndex::ChgValue(). (regression from 555ff26501d1bbd8a7872c20671c6303db1e1701) Change-Id: I6e6ad7f70835d7e9d6da1fb680e2ae15469fad71 (cherry picked from commit b24a15a0aaea310806259eaa20a7d509ce30e5c8) Reviewed-on: https://gerrit.libreoffice.org/15128 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-04-03tdf#87400: sw: fix ~SwIndexReg assertion in AutoCorrectMichael Stahl1-4/+10
SwAutoFormat::DoUnderline() calls DeleteSel() with a SwPaM that is not corrected, except if it's passed along directly to SwDoc methods. (regression from f9b62506b22c3eb885ffd5a4ec8025c33df7b2d4) Change-Id: I741e0391e7f8e09a64bcfe99ca4d650f1016aaa7 (cherry picked from commit 41e4998cdeb54a6fc316f349de61296be820fe47) Reviewed-on: https://gerrit.libreoffice.org/15127 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-11-20sw: convert more legacy assertsMichael Stahl1-9/+6
Change-Id: I602913a1cfb8dda072945770a585e6cd9fd3e134
2014-11-19loplugin: cstylecastNoel Grandin16-74/+74
Change-Id: I322c6f9cd106a0ac3ad5c67dd0d49660b608e079
2014-11-19Use SwNode::GetTxtNode()Miklos Vajna3-4/+4
Change-Id: Icf3e1013d5eba5702badf19aa6c1f5e6708ed154
2014-11-16sw: convert 'a ? b : sal_False' to 'a && b'Matteo Casalin1-3/+2
Change-Id: I4b7829a1abe1459f2e4915159588fd3e16a14eea
2014-11-16sw: avoid 'condition ? sal_True : sal_False' expressionsMatteo Casalin1-4/+1
Change-Id: Idd6c9f9752659fc5da575e5a3f0ffc15ce5dbe1c
2014-11-16sal_True/sal_False to true/false in sw comments (also delete obsolete ones)Matteo Casalin3-5/+5
Change-Id: Ifb29bd3e9c5dc7671c189fd9daa010305f7a85a4
2014-11-12Fix common typos. No automatic tools. Handmade…Andrea Gelmini2-3/+3
Change-Id: I1ab4e23b0539f8d39974787f226e57a21f96e959 Reviewed-on: https://gerrit.libreoffice.org/12164 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-11-08coverity#1251172 Dereference null return valueCaolán McNamara1-1/+1
Change-Id: Ic1f1c7f055f3fb21e7361a2e14f6eebe3dac4216
2014-11-07More replacements of manual swapping with SwGrfNode::GetGrf()/GetGrfObj()Zolnai Tamás1-31/+2
Change-Id: Ie56584c03af8a6d3ea8f8d4294f5492a841933b7
2014-11-03fdo#35862 De-/Increase font when multi-sized textDaniel Sikeler1-1/+175
Added two new function to the SwEditShell. The first returns all items of a specific WhichId wich belong to the current selection. The items from the attribute set and from the hints are used. The second returns SwPaMs separated at borders of an itemtype identified by its WhichId. The SwPaMs must be deleted after yous. Change-Id: I00e6d1b0f75b9f184343711c6d2bdc7e5694c711 Reviewed-on: https://gerrit.libreoffice.org/11857 Tested-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com> Reviewed-by: Samuel Mehrbrodt <s.mehrbrodt@gmail.com>
2014-09-30fdo#82577: Handle PolyPolygonNoel Grandin1-2/+2
Put the TOOLS PolyPolygon class in the tools namespace. Avoids clash with the Windows PolyPolygon typedef. Change-Id: I811ecbb3d55ba4ce66e4555a8586f60fcd57fb66
2014-09-26remove unnecessary casts in calls to SvStream.WriteUInt16Noel Grandin1-1/+1
left over from our conversion of the SvStream output operators to more specific methods Change-Id: I482ca7abb84613971e7e8f839f7aa67a65cd71ff
2014-09-23fdo#82577: Handle WindowNoel Grandin1-2/+2
Put the VCL Window class in the vcl namespace. Avoids clash with the X11 Window typedef. Change-Id: Ib1beb7ab4ad75562a42aeb252732a073d25eff1a
2014-09-18fdo#82577: Handle FontNoel Grandin1-1/+1
Put the VCL Font class in the vcl namespace. Avoids clash with the X11 Font typedef. Change-Id: I1a84f7cad8b31697b9860a3418f7dff794ff6537
2014-09-17callcatcher: update unused codeCaolán McNamara1-8/+0
Change-Id: I2ddda0600ee876e9886ee3221f0ac5ad515fbd22
2014-09-12Turn SfxItemState into a C++11 scoped enumerationStephan Bergmann6-14/+14
...to gain further confidence in the claim "that none of the existing code tries to uses combinations of these enum values" (d92602c5b13d0a60439d86c5a033d124178726ca "more fixes for SfxItemState") Change-Id: I987922d945e8738e38adfde83b869adf3ff35b13 Reviewed-on: https://gerrit.libreoffice.org/11384 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Stephan Bergmann <sbergman@redhat.com>
2014-09-06Use size_t consistently, constify, reduce scopeMatteo Casalin1-3/+3
Change-Id: Ie5de70645becc5ac584f1b3ffe6048969d2a19a9
2014-08-16Consistently use size_t and SAL_MAX_SIZEMatteo Casalin1-1/+1
Instead of a mix of sal_uIntPtr, sal_uLong, int, and so on. Also change CONTAINER_ENTRY_NOTFOUND=ULONG_MAX to SAL_MAX_SIZE as return value in case of failure and in the related tests. Change-Id: Ie778a849253b4be84fbcdab9557b7c4240233927
2014-08-12Refactored IDocumentStylePoolAccess out of SwDoc.Valentin Kettner2-5/+7
Added non const SwDoc::GetDfltTxtFmtColl and SwDoc::GetTxtFmtColls and SwDoc::GetCharFmts. Had to make the manager friend of SwTxtFmtColl and SwConditionTxtFmtColl Had to make SwDoc::_MakeCharFmt and SwDoc::_MakeFrmFmt public. Change-Id: I19a36d91f92b3781a6c4313ec12eb8f7d4dfacc3
2014-08-12Refactored IDocumentState out of SwDoc.Valentin Kettner6-17/+23
Into the new class DocumentStateManager. Change-Id: I91c9097b091ff6118d58fd15fff2a4cefe0171fd
2014-08-12Refactored IDocumentStatistics our of SwDoc.Valentin Kettner1-2/+3
Into the new class DocumentStatisticsManager. Change-Id: I281232dc09dbd79c2faf3c2a78ae49625bbe88ee
2014-08-12Refactored IDocumentFieldsAccess out of SwDoc.Valentin Kettner5-23/+28
Into the new class DocumentFieldsManager. Removed SwDoc::_MakeFldList because it is not defined anywhere. Also moved a few non interface methods that belong to the manager. Change-Id: Icefd7ca7adcbb05a18d6fae0529fc54150b862fd
2014-08-12Refactored IDocumentRedlineAccess out of SwDoc.Valentin Kettner5-34/+38
Into the new class DocumentRedlineManager. Added an non const version of GetRedlineTbl to the interface. Also Moved SetAutoFmtRedlineComment which is not part of interface. Change-Id: I600d5821d5d5831557f5fc5375fb1203fe67a295
2014-07-22SwpHintsArray/SwpHints and related: sal_uInt16 to size_tMatteo Casalin1-3/+2
Change-Id: I9a7674109b05683287e12cbce6bc417b40ca5084
2014-07-15Refactored IDocumentContentOperations out of SwDoc.Valentin Kettner13-63/+67
Into the new class DocumentContentOperationsManager. Made SwNodes in sw/inc/ndarr.hxx friend class to DocumentContentOperationsManager so it can call DelNodes at end of DocumentContentOperationsManager::DeleteSection . Added DeleteAutoCorrExceptWord to SwDoc, its needed in the Manager. Added a non const version of SwDoc::GetDfltGrfFmtColl() to SwDoc because its needed in the Manager. Made SwDoc a friend class to DocumentContentOperationsManager so it can call SwDoc::checkRedlining and SwDocL::_MakeFlySection. Moved SwDoc::CopyImpl_ , SwDoc::CopyWithFlyInFly and SwDoc::CopyFlyInFlyImpl into the Manager. Moved "struct ParaRstFmt" and "lcl_RstTxtAttr" from docfmt.cxx in DocumentContentOperationsManager.hxx . Change-Id: Icaab57f4a8c158a85e549ecb4aacc752bc95bbc9
2014-07-15Refactored IDocumentLinksAdministration out of SwDoc.Valentin Kettner1-1/+2
To the new class DocumentLinksAdministrationManager. Additional to the Interface methods SwDoc::SelectServerObj was also moved and sw/source/core/doc/docdde.cxx was deleted as it became empty. Also fixed OUString usage in IDocumentLinksAdministration.hxx . Change-Id: I1f2bf0881a7d4add9c657b6441851ae14ad8d161
2014-07-15Refactored IDocumentChartDataProviderAccess in SwDoc.Valentin Kettner1-1/+2
Into the new class DocumentChartDataProviderManager. Change-Id: I3be038ba276642546223c0c2fba3bea21980b33d
2014-07-03Resolves fdo#79276 Add fallback system for autocorrection of French variantsJulien Nabet1-1/+1
1) Replace the creation of acor_fr-FR.dat by acor_fr.dat since there's no specific for variants of fr 2) Add a fallback system to use it Change-Id: Ia3e11fff0f266839dc148077b50c1b2f798d1c50 Reviewed-on: https://gerrit.libreoffice.org/9825 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2014-06-27Related: #i78498# Do not keep OutlineLevel attribute at paragraph...Oliver-Rainer Wittmann1-2/+2
when a Paragraph Style is assigned. (cherry picked from commit 6a1564284d90c7e175f7848520924f7f6a5884b7) (cherry picked from commit 4a381b1124f60b76cabb558fa24827448a1caab0) Conflicts: sw/inc/doc.hxx sw/inc/editsh.hxx sw/inc/fmtcol.hxx sw/inc/ndtxt.hxx sw/source/core/attr/format.cxx sw/source/core/doc/docfmt.cxx sw/source/core/doc/docglbl.cxx sw/source/core/doc/doctxm.cxx sw/source/core/doc/fmtcol.cxx sw/source/core/edit/edfcol.cxx sw/source/core/txtnode/ndtxt.cxx sw/source/core/undo/unfmco.cxx sw/source/core/unocore/unosett.cxx sw/source/core/unocore/unostyle.cxx Change-Id: Ifa1214876df296f2e1210cc4a35f2df67f9f6bc4
2014-06-24new compilerplugin returnbyrefNoel Grandin9-52/+52
Find places where we are returning a pointer to something, where we can be returning a reference. e.g. class A { struct X x; public X* getX() { return &x; } } which can be: public X& getX() { return x; } Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
2014-06-03Removed IDocumentSettingAccess.hxx include in SwDoc.hxxValentin Kettner2-0/+2
Because it is not needed there anymore with IDocumentSettingManager. Change-Id: Iad5e0a03f2628c9d26698d23e691b3e6228eee0b
2014-06-03Removed DocumentSettingManager methods from SwDoc.Valentin Kettner1-1/+2
And moved all calls to those methods to GetDocumentSettingManager(). Change-Id: I9b6cc8c3aa9b57bbc0c39f39499dfb4f5f254ad9
2014-05-27Remove ASCII art and useless comments from sw moduleChris Laplante1-1/+0
Change-Id: I3ba4ac78fd4810e006b1034bbe7c28b1803895d2 Reviewed-on: https://gerrit.libreoffice.org/9494 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
2014-05-08various: sal_Bool->boolNoel Grandin1-2/+2
Change-Id: I30fa5227f30373f95060148f269450d2945c1bb9
2014-05-03sw: hypothetical crashes if last node is not SwTxtNodeMichael Stahl2-5/+9
Change-Id: I16c476ae83d01ea23891af36fd4bcca4e8992228
2014-05-02Rename SwDBMgr -> SwDBManager.Jan Holesovsky1-3/+3
We were renaming it recently from SwNewDBMgr, let's use the full name to make it more readable. Change-Id: I2ceb3f1790321b70d5936c35e13870439969e64d
2014-04-30sw: sal_Bool->boolNoel Grandin19-252/+252
Change-Id: I324a0ffde2ddcca105451c19e7aadcfad15211d8
2014-04-28allow accepting/rejecting changes in a selection (bnc#874790)Luboš Luňák1-0/+18
Adds 'Accept Changes'/'Reject Changes' to the RMB popup if appropriate, more convenient than handling them one by one. Change-Id: I4e2670aa9fdacaaaa1b7ecca36b9c150c82e2e72
2014-04-22There is nothing "new" with SwNewDBMgr any moreTor Lillqvist1-3/+3
Change-Id: Icbf3d5663a358bf31b58ab8086ffe9160c26bf8f
2014-04-22More hacking on --disable-database-connectivityTor Lillqvist1-0/+10
Work in progress, still lots of undefineds when attempting to link TiledLibreOffice. Change-Id: I80fa330768d9f9fa9ef65e3693f1d777c0713210
2014-04-22There is nothing "new" with SwNewDBMgr any moreTor Lillqvist1-1/+1
Change-Id: I28c48be099ba680a5d6ea91981a1e1bfadff3f84
2014-04-18coverity#1202830 Out-of-bounds accessCaolán McNamara1-4/+17
Change-Id: I25edea176b69c1c1f87bdbff790a39298a813660
2014-04-15Clean up function declarations and some unused functionsStephan Bergmann2-3/+1
Change-Id: I58c425ab9d2c01f8844226aff820dd56d88ec09c
2014-04-10coverity#708418 Uninitialized scalar fieldCaolán McNamara1-1/+6
Change-Id: Id33b99cbad88eea79a7ac75d8d99ffcc71d4f7b4
2014-03-29coverity#704354 Logically dead codeCaolán McNamara1-19/+3
also coverity#704355 and coverity#704356 Change-Id: I132b9881792fcc4bac59d8227141e53dda7ee725