Kaydet (Commit) caeb6ff6 authored tarafından László Németh's avatar László Németh

DOCX import: clean-up FinalizeImport() of change tracking

FinalizeImport() could be triggered by accident while
editing the document. Now we set it by checking
PROP_REDLINE_REVERT_PROPERTIES used only in OOXML import.

This is a clean-up of the commit 8acc15b5
"tdf#118699 DOCX import: don't add numbering."

Change-Id: Ib1f4ee41ba94d640788396037b668b85b800f9d0
Reviewed-on: https://gerrit.libreoffice.org/73043
Tested-by: Jenkins
Reviewed-by: 's avatarLászló Németh <nemeth@numbertext.org>
üst 67fd47e9
...@@ -229,6 +229,10 @@ public: ...@@ -229,6 +229,10 @@ public:
virtual void SetRedlinePassword( virtual void SetRedlinePassword(
/*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) = 0; /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) = 0;
virtual bool IsFinalizeImport() const = 0;
virtual void SetFinalizeImport(bool const bFinalizeImport) = 0;
protected: protected:
virtual ~IDocumentRedlineAccess() {}; virtual ~IDocumentRedlineAccess() {};
}; };
......
...@@ -820,10 +820,10 @@ RedlineFlags DocumentRedlineManager::GetRedlineFlags() const ...@@ -820,10 +820,10 @@ RedlineFlags DocumentRedlineManager::GetRedlineFlags() const
void DocumentRedlineManager::SetRedlineFlags( RedlineFlags eMode ) void DocumentRedlineManager::SetRedlineFlags( RedlineFlags eMode )
{ {
if ( m_bFinalizeImport ) if ( IsFinalizeImport() )
{ {
FinalizeImport(); FinalizeImport();
m_bFinalizeImport = false; SetFinalizeImport( false );
} }
if( meRedlineFlags != eMode ) if( meRedlineFlags != eMode )
...@@ -1424,8 +1424,6 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall ...@@ -1424,8 +1424,6 @@ DocumentRedlineManager::AppendRedline(SwRangeRedline* pNewRedl, bool const bCall
// better fix it. // better fix it.
n = 0; n = 0;
bDec = true; bDec = true;
// or simply this is an OOXML import
m_bFinalizeImport = true;
} }
mpRedlineTable->DeleteAndDestroy( nToBeDeleted ); mpRedlineTable->DeleteAndDestroy( nToBeDeleted );
...@@ -3000,6 +2998,16 @@ void DocumentRedlineManager::SetRedlinePassword( ...@@ -3000,6 +2998,16 @@ void DocumentRedlineManager::SetRedlinePassword(
m_rDoc.getIDocumentState().SetModified(); m_rDoc.getIDocumentState().SetModified();
} }
bool DocumentRedlineManager::IsFinalizeImport() const
{
return m_bFinalizeImport;
}
void DocumentRedlineManager::SetFinalizeImport(bool const bFinalizeImport)
{
m_bFinalizeImport = bFinalizeImport;
}
/// Set comment text for the Redline, which is inserted later on via /// Set comment text for the Redline, which is inserted later on via
/// AppendRedline. Is used by Autoformat. /// AppendRedline. Is used by Autoformat.
/// A null pointer resets the mode. The pointer is not copied, so it /// A null pointer resets the mode. The pointer is not copied, so it
......
...@@ -117,6 +117,10 @@ public: ...@@ -117,6 +117,10 @@ public:
virtual void SetRedlinePassword( virtual void SetRedlinePassword(
/*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) override; /*[in]*/const css::uno::Sequence <sal_Int8>& rNewPassword) override;
virtual bool IsFinalizeImport() const override;
virtual void SetFinalizeImport(bool const bFinalizeImport) override;
//Non Interface methods; //Non Interface methods;
/** Set comment-text for Redline. It then comes in via AppendRedLine. /** Set comment-text for Redline. It then comes in via AppendRedLine.
......
...@@ -1260,6 +1260,10 @@ void makeRedline( SwPaM const & rPaM, ...@@ -1260,6 +1260,10 @@ void makeRedline( SwPaM const & rPaM,
pRedlineExtraData = new SwRedlineExtraData_FormattingChanges( &aItemSet ); pRedlineExtraData = new SwRedlineExtraData_FormattingChanges( &aItemSet );
} }
} }
// to finalize DOCX import
if ( eType == RedlineType::Delete && !pRedlineAccess->IsFinalizeImport() )
pRedlineAccess->SetFinalizeImport( true );
} }
SwRangeRedline* pRedline = new SwRangeRedline( aRedlineData, rPaM ); SwRangeRedline* pRedline = new SwRangeRedline( aRedlineData, rPaM );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment