[Libreoffice-commits] core.git: 2 commits - sdext/source sw/source
Michael Stahl
mstahl at redhat.com
Thu Feb 15 15:00:14 UTC 2018
sdext/source/pdfimport/pdfparse/pdfparse.cxx | 11 +++++++++++
sw/source/core/inc/UndoSplitMove.hxx | 2 +-
sw/source/core/undo/unspnd.cxx | 24 ++++++++++++++----------
3 files changed, 26 insertions(+), 11 deletions(-)
New commits:
commit a8ea79b10bfc4851d092270f02fa8c817c9bc0d9
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Feb 14 20:49:21 2018 +0100
sdext: disable MSVC 2017 warnings from boost headers
Change-Id: I6eb816f155a222ca4299fd425c79d38bf2d464dc
diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
index e5350d26745d..a13b44b0a371 100644
--- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx
@@ -20,12 +20,23 @@
#include <pdfparse.hxx>
+// boost using obsolete stuff
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4996)
+#endif
+
// workaround windows compiler: do not include multi_pass.hpp
#include <boost/spirit/include/classic_core.hpp>
#include <boost/spirit/include/classic_utility.hpp>
#include <boost/spirit/include/classic_error_handling.hpp>
#include <boost/spirit/include/classic_file_iterator.hpp>
#include <boost/bind.hpp>
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
#include <string.h>
#include <rtl/strbuf.hxx>
commit 21c3a446ccc6fa0f812531b072f5d18875b7aaca
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Feb 14 14:37:16 2018 +0100
sw: replace DELETEZ with unique_ptr in SwUndoSplitNode
Change-Id: Iaac10057c7be6f49bc5930725dffa7884c35d814
diff --git a/sw/source/core/inc/UndoSplitMove.hxx b/sw/source/core/inc/UndoSplitMove.hxx
index 9119248bb5f5..d4a86dea4cbc 100644
--- a/sw/source/core/inc/UndoSplitMove.hxx
+++ b/sw/source/core/inc/UndoSplitMove.hxx
@@ -24,7 +24,7 @@
class SwUndoSplitNode: public SwUndo
{
- SwHistory* pHistory;
+ std::unique_ptr<SwHistory> m_pHistory;
SwRedlineData* pRedlData;
sal_uLong nNode;
sal_Int32 nContent;
diff --git a/sw/source/core/undo/unspnd.cxx b/sw/source/core/undo/unspnd.cxx
index 0b388491ef86..2253c3df5124 100644
--- a/sw/source/core/undo/unspnd.cxx
+++ b/sw/source/core/undo/unspnd.cxx
@@ -37,7 +37,7 @@
SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
bool bChkTable )
- : SwUndo( SwUndoId::SPLITNODE, pDoc ), pHistory( nullptr ), pRedlData( nullptr ), nNode( rPos.nNode.GetIndex() ),
+ : SwUndo( SwUndoId::SPLITNODE, pDoc ), pRedlData( nullptr ), nNode( rPos.nNode.GetIndex() ),
nContent( rPos.nContent.GetIndex() ),
bTableFlag( false ), bChkTableStt( bChkTable )
{
@@ -45,11 +45,13 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
OSL_ENSURE( pTextNd, "only for TextNode" );
if( pTextNd->GetpSwpHints() )
{
- pHistory = new SwHistory;
- pHistory->CopyAttr( pTextNd->GetpSwpHints(), nNode, 0,
+ m_pHistory.reset(new SwHistory);
+ m_pHistory->CopyAttr(pTextNd->GetpSwpHints(), nNode, 0,
pTextNd->GetText().getLength(), false );
- if( !pHistory->Count() )
- DELETEZ( pHistory );
+ if (!m_pHistory->Count())
+ {
+ m_pHistory.reset();
+ }
}
// consider Redline
if( pDoc->getIDocumentRedlineAccess().IsRedlineOn() )
@@ -63,7 +65,7 @@ SwUndoSplitNode::SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos,
SwUndoSplitNode::~SwUndoSplitNode()
{
- delete pHistory;
+ m_pHistory.reset();
delete pRedlData;
}
@@ -126,14 +128,14 @@ void SwUndoSplitNode::UndoImpl(::sw::UndoRedoContext & rContext)
RemoveIdxRel( nNode+1, *rPam.GetPoint() );
pTNd->JoinNext();
- if( pHistory )
+ if (m_pHistory)
{
rPam.GetPoint()->nContent = 0;
rPam.SetMark();
rPam.GetPoint()->nContent = pTNd->GetText().getLength();
pDoc->RstTextAttrs( rPam, true );
- pHistory->TmpRollback( pDoc, 0, false );
+ m_pHistory->TmpRollback( pDoc, 0, false );
}
pDoc->UpdateParRsid( pTNd, nParRsid );
@@ -159,8 +161,10 @@ void SwUndoSplitNode::RedoImpl(::sw::UndoRedoContext & rContext)
SwDoc* pDoc = rPam.GetDoc();
pDoc->getIDocumentContentOperations().SplitNode( *rPam.GetPoint(), bChkTableStt );
- if( pHistory )
- pHistory->SetTmpEnd( pHistory->Count() );
+ if (m_pHistory)
+ {
+ m_pHistory->SetTmpEnd(m_pHistory->Count());
+ }
if( ( pRedlData && IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) ||
( !( RedlineFlags::Ignore & GetRedlineFlags() ) &&
More information about the Libreoffice-commits
mailing list