[Libreoffice-commits] core.git: 3 commits - sd/source sw/source
Caolán McNamara
caolanm at redhat.com
Wed Jan 25 15:06:56 UTC 2017
sd/source/ui/docshell/docshel4.cxx | 20 ++++++++++----------
sw/source/ui/index/cnttab.cxx | 1 +
2 files changed, 11 insertions(+), 10 deletions(-)
New commits:
commit 1337932c038d0a0f689e59de7c8ffd272dbdafa4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 25 15:05:27 2017 +0000
fix index widget control positions on first view
Change-Id: Ic70006d65100b0ed8b337d43ff81577fb4579192
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index 536326d..d1c630b 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -2736,6 +2736,7 @@ void SwTokenWindow::setAllocation(const Size &rAllocation)
aSize.Height() = aControlSize.Height();
pControl->SetSizePixel(aSize);
}
+ AdjustPositions();
}
SwTokenWindow::~SwTokenWindow()
commit f08d33f87799848597e2818cd5e173ab3fdc510b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 25 13:12:03 2017 +0000
use a std::unique_ptr
Change-Id: I1ab99995e35714d6ef3358400b0805723c44678c
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 697323d..686ce6a 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -603,47 +603,45 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium )
{
std::shared_ptr<const SfxFilter> pMediumFilter = rMedium.GetFilter();
const OUString aTypeName( pMediumFilter->GetTypeName() );
- SdFilter* pFilter = nullptr;
+ std::unique_ptr<SdFilter> xFilter;
if( aTypeName.indexOf( "graphic_HTML" ) >= 0 )
{
- pFilter = new SdHTMLFilter( rMedium, *this );
+ xFilter = std::make_unique<SdHTMLFilter>(rMedium, *this);
}
else if( aTypeName.indexOf( "MS_PowerPoint_97" ) >= 0 )
{
- pFilter = new SdPPTFilter( rMedium, *this );
- static_cast<SdPPTFilter*>(pFilter)->PreSaveBasic();
+ xFilter = std::make_unique<SdPPTFilter>(rMedium, *this);
+ static_cast<SdPPTFilter*>(xFilter.get())->PreSaveBasic();
}
else if ( aTypeName.indexOf( "CGM_Computer_Graphics_Metafile" ) >= 0 )
{
- pFilter = new SdCGMFilter( rMedium, *this );
+ xFilter = std::make_unique<SdCGMFilter>(rMedium, *this);
}
else if( aTypeName.indexOf( "draw8" ) >= 0 ||
aTypeName.indexOf( "impress8" ) >= 0 )
{
- pFilter = new SdXMLFilter( rMedium, *this );
+ xFilter = std::make_unique<SdXMLFilter>(rMedium, *this);
}
else if( aTypeName.indexOf( "StarOffice_XML_Impress" ) >= 0 ||
aTypeName.indexOf( "StarOffice_XML_Draw" ) >= 0 )
{
- pFilter = new SdXMLFilter( rMedium, *this, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60 );
+ xFilter = std::make_unique<SdXMLFilter>(rMedium, *this, SDXMLMODE_Normal, SOFFICE_FILEFORMAT_60);
}
else
{
- pFilter = new SdGRFFilter( rMedium, *this );
+ xFilter = std::make_unique<SdGRFFilter>(rMedium, *this);
}
- if( pFilter )
+ if (xFilter)
{
const SdrSwapGraphicsMode nOldSwapMode = mpDoc->GetSwapGraphicsMode();
mpDoc->SetSwapGraphicsMode( SdrSwapGraphicsMode::TEMP );
- bRet = pFilter->Export();
+ bRet = xFilter->Export();
if( !bRet )
mpDoc->SetSwapGraphicsMode( nOldSwapMode );
-
- delete pFilter;
}
}
commit 160e11fed1ebc4df8e3ce0afdb636ef42e5b54fe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 25 13:01:58 2017 +0000
valgrind: fix leak
since...
commit e94d5233dd7939c54eb52fff456e817cecdf0a4c
Date: Fri Mar 11 06:43:06 2016 +0100
work on sane lifecylce for SfxFilter
which removed "delete pFilter" though it was
pMediumFilter which was in question in this method
Change-Id: I598dd44a8498ebd6b3e63d1c89147bee5ab3bb55
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index b52e137..697323d 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -642,6 +642,8 @@ bool DrawDocShell::ConvertTo( SfxMedium& rMedium )
bRet = pFilter->Export();
if( !bRet )
mpDoc->SetSwapGraphicsMode( nOldSwapMode );
+
+ delete pFilter;
}
}
More information about the Libreoffice-commits
mailing list