/* -*- 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/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
// TODO undo can mess things up when another view is editing a cell in the range of group entry // this is a temporarily workaround if (!comphelper::LibreOfficeKit::isActive() && bRecord )
{
std::unique_ptr<ScOutlineTable> pUndoTab(new ScOutlineTable( *pTable ));
ScDocumentUniquePtr pUndoDoc(new ScDocument( SCDOCMODE_UNDO )); if (bColumns)
{
pUndoDoc->InitUndo( rDoc, nTab, nTab, true );
rDoc.CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false,
*pUndoDoc);
} else
{
pUndoDoc->InitUndo( rDoc, nTab, nTab, false, true );
rDoc.CopyToDocument(0, nStart, nTab, rDoc.MaxCol(), nEnd, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc);
}
rDocShell.GetUndoManager()->AddUndoAction(
std::make_unique<ScUndoOutlineLevel>( rDocShell,
nStart, nEnd, nTab, //! calculate start and end
std::move(pUndoDoc), std::move(pUndoTab),
bColumns, nLevel ) );
}
// TODO undo can mess things up when another view is editing a cell in the range of group entry // this is a temporarily workaround if ( !comphelper::LibreOfficeKit::isActive() && bRecord )
{
std::unique_ptr<ScOutlineTable> pUndoTab(new ScOutlineTable( *pTable ));
ScDocumentUniquePtr pUndoDoc(new ScDocument( SCDOCMODE_UNDO ));
pUndoDoc->InitUndo( rDoc, nTab, nTab, true, true );
rDoc.CopyToDocument(nStartCol, 0, nTab, nEndCol, rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false, *pUndoDoc);
rDoc.CopyToDocument(0, nStartRow, nTab, rDoc.MaxCol(), nEndRow, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc);
// TODO undo can mess things up when another view is editing a cell in the range of group entry // this is a temporarily workaround if ( !comphelper::LibreOfficeKit::isActive() && bRecord )
{
std::unique_ptr<ScOutlineTable> pUndoTab(new ScOutlineTable( *pTable ));
ScDocumentUniquePtr pUndoDoc(new ScDocument( SCDOCMODE_UNDO ));
pUndoDoc->InitUndo( rDoc, nTab, nTab, true, true );
rDoc.CopyToDocument(static_cast<SCCOL>(nEffStartCol), 0, nTab, static_cast<SCCOL>(nEffEndCol), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false, *pUndoDoc);
rDoc.CopyToDocument(0, nEffStartRow, nTab, rDoc.MaxCol(), nEffEndRow, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc);
// TODO undo can mess things up when another view is editing a cell in the range of group entry // this is a temporarily workaround if ( !comphelper::LibreOfficeKit::isActive() && bRecord )
{
ScDocumentUniquePtr pUndoDoc(new ScDocument( SCDOCMODE_UNDO )); if (bColumns)
{
pUndoDoc->InitUndo( rDoc, nTab, nTab, true );
rDoc.CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false,
*pUndoDoc);
} else
{
pUndoDoc->InitUndo( rDoc, nTab, nTab, false, true );
rDoc.CopyToDocument(0, nStart, nTab, rDoc.MaxCol(), nEnd, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc);
}
rDocShell.GetUndoManager()->AddUndoAction(
std::make_unique<ScUndoDoOutline>( rDocShell,
nStart, nEnd, nTab, std::move(pUndoDoc), //! calc start and end
bColumns, nLevel, nEntry, true ) );
}
pEntry->SetHidden(false);
SCCOLROW i; for ( i = nStart; i <= nEnd; i++ )
{ if ( bColumns )
rDoc.ShowCol( static_cast<SCCOL>(i), nTab, true ); else
{ // show several rows together, don't show filtered rows
SCROW nFilterEnd = i; bool bFiltered = rDoc.RowFiltered( i, nTab, nullptr, &nFilterEnd );
nFilterEnd = std::min( nEnd, nFilterEnd ); if ( !bFiltered )
rDoc.ShowRows( i, nFilterEnd, nTab, true );
i = nFilterEnd;
}
}
ScSubOutlineIterator aIter( &rArray, nLevel, nEntry ); while ((pEntry=aIter.GetNext()) != nullptr)
{ if ( pEntry->IsHidden() )
{
SCCOLROW nSubStart = pEntry->GetStart();
SCCOLROW nSubEnd = pEntry->GetEnd(); if ( bColumns ) for ( i = nSubStart; i <= nSubEnd; i++ )
rDoc.ShowCol( static_cast<SCCOL>(i), nTab, false ); else
rDoc.ShowRows( nSubStart, nSubEnd, nTab, false );
}
}
// TODO undo can mess things up when another view is editing a cell in the range of group entry // this is a temporarily workaround if ( !comphelper::LibreOfficeKit::isActive() && bRecord )
{
ScDocumentUniquePtr pUndoDoc(new ScDocument( SCDOCMODE_UNDO )); if (bColumns)
{
pUndoDoc->InitUndo( rDoc, nTab, nTab, true );
rDoc.CopyToDocument(static_cast<SCCOL>(nStart), 0, nTab, static_cast<SCCOL>(nEnd), rDoc.MaxRow(), nTab, InsertDeleteFlags::NONE, false,
*pUndoDoc);
} else
{
pUndoDoc->InitUndo( rDoc, nTab, nTab, false, true );
rDoc.CopyToDocument(0, nStart, nTab, rDoc.MaxCol(), nEnd, nTab, InsertDeleteFlags::NONE, false, *pUndoDoc);
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.16Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.