Kaydet (Commit) b92fdaa1 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

bnc#885548: Initial work on importing revisions from xlsx.

Change-Id: Ie0528490d024093cbabf38541fe70be96a9caa2e
üst ffeb0362
......@@ -199,6 +199,7 @@ $(eval $(call gb_Library_add_exception_objects,scfilt,\
sc/source/filter/oox/pivottablefragment \
sc/source/filter/oox/querytablebuffer \
sc/source/filter/oox/querytablefragment \
sc/source/filter/oox/revisionfragment \
sc/source/filter/oox/richstringcontext \
sc/source/filter/oox/richstring \
sc/source/filter/oox/scenariobuffer \
......
......@@ -1099,7 +1099,7 @@ public:
sal_uLong nOldFormat, ScDocument* pRefDoc = NULL );
// after new value was set in the document,
// old value from pOldCell, format from Doc
void AppendContent( const ScAddress& rPos, const ScCellValue& rOldCell );
SC_DLLPUBLIC void AppendContent( const ScAddress& rPos, const ScCellValue& rOldCell );
// after new values were set in the document,
// old values from RefDoc/UndoDoc.
// All contents with a cell in RefDoc
......
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef INCLUDED_SC_OOX_XLS_REVISIONFRAGMENT_HXX
#define INCLUDED_SC_OOX_XLS_REVISIONFRAGMENT_HXX
#include <excelhandlers.hxx>
class ScChangeTrack;
namespace oox { namespace xls {
class RevisionHeadersFragment : public WorkbookFragmentBase
{
struct Impl;
Impl* mpImpl;
public:
explicit RevisionHeadersFragment(
const WorkbookHelper& rHelper, const OUString& rFragmentPath );
virtual ~RevisionHeadersFragment();
protected:
virtual oox::core::ContextHandlerRef onCreateContext(
sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
virtual void onStartElement( const AttributeList& rAttribs ) SAL_OVERRIDE;
virtual void onCharacters( const OUString& rChars ) SAL_OVERRIDE;
virtual void onEndElement() SAL_OVERRIDE;
virtual void finalizeImport() SAL_OVERRIDE;
private:
void importHeaders( const AttributeList& rAttribs );
void importHeader( const AttributeList& rAttribs );
};
class RevisionLogFragment : public WorkbookFragmentBase
{
struct Impl;
Impl* mpImpl;
public:
explicit RevisionLogFragment(
const WorkbookHelper& rHelper, const OUString& rFragmentPath, ScChangeTrack& rChangeTrack );
virtual ~RevisionLogFragment();
protected:
virtual oox::core::ContextHandlerRef onCreateContext(
sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
virtual void onStartElement( const AttributeList& rAttribs ) SAL_OVERRIDE;
virtual void onCharacters( const OUString& rChars ) SAL_OVERRIDE;
virtual void onEndElement() SAL_OVERRIDE;
virtual void finalizeImport() SAL_OVERRIDE;
private:
void importCommon( const AttributeList& rAttribs );
void importRcc( const AttributeList& rAttribs );
void importRrc( const AttributeList& rAttribs );
void pushRevision();
};
}}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This diff is collapsed.
......@@ -36,6 +36,7 @@
#include "pivotcachebuffer.hxx"
#include "sharedstringsbuffer.hxx"
#include "sharedstringsfragment.hxx"
#include "revisionfragment.hxx"
#include "stylesfragment.hxx"
#include "tablebuffer.hxx"
#include "themebuffer.hxx"
......@@ -293,7 +294,7 @@ public:
}
};
static void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVector& rSheets )
void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVector& rSheets )
{
sal_Int32 nThreads = std::min( rSheets.size(), (size_t) 4 /* FIXME: ncpus/2 */ );
......@@ -490,6 +491,14 @@ void WorkbookFragment::finalizeImport()
// final conversions, e.g. calculation settings and view settings
finalizeWorkbookImport();
OUString aRevHeadersPath = getFragmentPathFromFirstType(CREATE_OFFICEDOC_RELATION_TYPE("revisionHeaders"));
if (!aRevHeadersPath.isEmpty())
{
boost::scoped_ptr<oox::core::FastParser> xParser(getOoxFilter().createParser());
rtl::Reference<oox::core::FragmentHandler> xFragment(new RevisionHeadersFragment(*this, aRevHeadersPath));
importOoxFragment(xFragment, *xParser);
}
}
// private --------------------------------------------------------------------
......
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