[Libreoffice-commits] core.git: 3 commits - sd/inc sd/source solenv/bin vcl/unx
Caolán McNamara
caolanm at redhat.com
Wed Mar 16 09:30:20 UTC 2016
sd/inc/drawdoc.hxx | 2 +-
sd/source/core/drawdoc3.cxx | 16 ++++++++--------
sd/source/ui/dlg/sdtreelb.cxx | 2 +-
solenv/bin/concat-deps.c | 2 +-
vcl/unx/gtk/gtksalmenu.cxx | 4 ++--
5 files changed, 13 insertions(+), 13 deletions(-)
New commits:
commit 8c249068fc2d41ca7025e41cc0672cbcff964d75
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 16 09:27:02 2016 +0000
match types for legibility
Change-Id: Ifd84a9a9dc54772a56d3bf0e345782f7f77562bd
diff --git a/vcl/unx/gtk/gtksalmenu.cxx b/vcl/unx/gtk/gtksalmenu.cxx
index 0378b49..2b64f3f 100644
--- a/vcl/unx/gtk/gtksalmenu.cxx
+++ b/vcl/unx/gtk/gtksalmenu.cxx
@@ -847,8 +847,8 @@ bool GtkSalMenu::NativeSetItemCommand( unsigned nSection,
if ( aCurrentCommand == nullptr || g_strcmp0( aCurrentCommand, aCommand ) != 0 )
{
- bool bOldHasSubmenu = g_lo_menu_get_submenu_from_item_in_section(pMenu, nSection, nItemPos) != nullptr;
- bSubMenuAddedOrRemoved = static_cast<gboolean>(bOldHasSubmenu) != bIsSubmenu;
+ gboolean bOldHasSubmenu = g_lo_menu_get_submenu_from_item_in_section(pMenu, nSection, nItemPos) != nullptr;
+ bSubMenuAddedOrRemoved = bOldHasSubmenu != bIsSubmenu;
if (bSubMenuAddedOrRemoved)
{
//tdf#98636 its not good enough to unset the "submenu-action" attribute to change something
commit 5873b3643d5b0b71a1de3df7fea4534a1fa6ebcd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 16 09:19:39 2016 +0000
coverity#1356337 Resource leak
Change-Id: Id00ee8abd5f22bf0594ad41e3922222872d6c5ca
diff --git a/sd/inc/drawdoc.hxx b/sd/inc/drawdoc.hxx
index f3a599a..af57988 100644
--- a/sd/inc/drawdoc.hxx
+++ b/sd/inc/drawdoc.hxx
@@ -259,7 +259,7 @@ public:
SdDrawDocument* pSourceDoc, bool bMaster, bool bCheckMasters);
SdDrawDocument* OpenBookmarkDoc(const OUString& rBookmarkFile);
- SAL_DLLPRIVATE SdDrawDocument* OpenBookmarkDoc(SfxMedium& rMedium);
+ SAL_DLLPRIVATE SdDrawDocument* OpenBookmarkDoc(SfxMedium* pMedium);
SAL_DLLPRIVATE void InsertBookmark(const std::vector<OUString> &rBookmarkList,
std::vector<OUString> &rExchangeList, bool bLink,
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index 176cc32..f1559fa 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -197,16 +197,16 @@ static void lcl_IterateBookmarkPages( SdDrawDocument &rDoc, SdDrawDocument* pBoo
}
// Opens a bookmark document
-SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
+SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium* pMedium)
{
bool bOK = true;
SdDrawDocument* pBookmarkDoc = nullptr;
- OUString aBookmarkName = rMedium.GetName();
- std::shared_ptr<const SfxFilter> pFilter = rMedium.GetFilter();
+ OUString aBookmarkName = pMedium->GetName();
+ std::shared_ptr<const SfxFilter> pFilter = pMedium->GetFilter();
if ( !pFilter )
{
- rMedium.UseInteractionHandler( true );
- SfxGetpApp()->GetFilterMatcher().GuessFilter( rMedium, pFilter );
+ pMedium->UseInteractionHandler( true );
+ SfxGetpApp()->GetFilterMatcher().GuessFilter(*pMedium, pFilter);
}
if ( !pFilter )
@@ -231,7 +231,7 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(SfxMedium& rMedium)
// Impress
mxBookmarkDocShRef = new ::sd::DrawDocShell(SfxObjectCreateMode::STANDARD, true);
- bOK = mxBookmarkDocShRef->DoLoad(&rMedium);
+ bOK = mxBookmarkDocShRef->DoLoad(pMedium);
if( bOK )
{
maBookmarkFile = aBookmarkName;
@@ -265,8 +265,8 @@ SdDrawDocument* SdDrawDocument::OpenBookmarkDoc(const OUString& rBookmarkFile)
if (!rBookmarkFile.isEmpty() && maBookmarkFile != rBookmarkFile)
{
- SfxMedium* pMedium = new SfxMedium( rBookmarkFile, StreamMode::READ );
- pBookmarkDoc = OpenBookmarkDoc(*pMedium);
+ std::unique_ptr<SfxMedium> xMedium(new SfxMedium(rBookmarkFile, StreamMode::READ));
+ pBookmarkDoc = OpenBookmarkDoc(xMedium.release());
}
else if (mxBookmarkDocShRef.Is())
{
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 27979f8..ccd9063 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1008,7 +1008,7 @@ SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
// in this mode the document is owned and controlled by the SdDrawDocument
// it can be released by calling the corresponding CloseBookmarkDoc method
// successful creation of a document makes this the owner of the medium
- mpBookmarkDoc = const_cast<SdDrawDocument*>(mpDoc)->OpenBookmarkDoc(*mpMedium);
+ mpBookmarkDoc = const_cast<SdDrawDocument*>(mpDoc)->OpenBookmarkDoc(mpMedium);
if ( !mpBookmarkDoc )
{
commit 95548f1615e506ed70d304d2d540430a30b2f7b5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 16 09:21:13 2016 +0000
coverity#1356338 inline markup didn't work
Change-Id: I8b1bb924afe13a034125c892205aae8167a10bd1
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index fb2caee..bb419ba 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -1092,8 +1092,8 @@ off_t size;
* this is on purpose, to avoid cloning the 'key' out of it and our special
* 'hash' just store the pointer to the key inside of buffer, hence it need
* to remain allocated
- * coverity[leaked_storage] - this is on purpose
*/
+ // coverity[leaked_storage] - this is on purpose
return rc;
}
More information about the Libreoffice-commits
mailing list