/* -*- 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 .
*/ #ifndef INCLUDED_SW_INC_TBLSEL_HXX #define INCLUDED_SW_INC_TBLSEL_HXX
class SwCursorShell; class SwCursor; class SwTableCursor; class SwFrame; class SwTabFrame; class SwLayoutFrame; class SwPaM; class SwNode; class SwUndoTableMerge; class SwCellFrame;
// Collects all boxes in table that are selected. // Selection gets extended in given direction according to enum-parameter. // Boxes are collected via the Layout; works correctly if tables are split. // (Cf. MakeSelUnions().) enumclass SwTableSearchType : sal_uInt16
{
NONE = 0x01, // No extension.
Row = 0x02, // Extend to rows.
Col = 0x03, // Extend to columns.
// As flags to the other values!
Protect = 0x08, // Collect protected boxes too.
NoUnionCorrect = 0x10, // Do not correct collected Union.
}; namespace o3tl { template<> struct typed_flags<SwTableSearchType> : is_typed_flags<SwTableSearchType, 0x1b> {};
}
// As before, but don't start from selection but from Start- EndFrames. void GetTableSel( const SwLayoutFrame* pStart, const SwLayoutFrame* pEnd,
SwSelBoxes& rBoxes, SwCellFrames* pCells, const SwTableSearchType = SwTableSearchType::NONE );
// As before but directly via PaMs. void GetTableSelCrs( const SwCursorShell& rShell, SwSelBoxes& rBoxes ); void GetTableSelCrs( const SwTableCursor& rTableCursor, SwSelBoxes& rBoxes );
// Collect boxes relevant for auto sum. bool GetAutoSumSel( const SwCursorShell&, SwCellFrames& );
// Check if the SelBoxes contains protected Boxes. bool HasProtectedCells( const SwSelBoxes& rBoxes );
// Check if selection is balanced. bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd);
// Check if cell is part of SSelection. // (Became a function, in order to make sure that GetTableSel() and MakeTableCursor() // have always the same concept of the selection. bool IsFrameInTableSel( const SwRect& rUnion, const SwFrame* pCell );
// Determine boxes to be merged. // In this process the rectangle gets "adapted" on the base of the layout, // i.e. boxes are added if some overlap at the sides. // Additionally a new box is created and filled with the relevant content. void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
SwTableBox** ppMergeBox, SwUndoTableMerge* pUndo );
// Check if selected boxes allow for a valid merge.
TableMergeErr CheckMergeSel( const SwPaM& rPam );
TableMergeErr CheckMergeSel( const SwSelBoxes& rBoxes );
// Check if Split or InsertCol lead to a box becoming smaller than MINLAY. bool CheckSplitCells( const SwCursorShell& rShell, sal_uInt16 nDiv, const SwTableSearchType ); bool CheckSplitCells( const SwCursor& rCursor, sal_uInt16 nDiv, const SwTableSearchType );
// For working on tab selection also for split tables. class SwSelUnion
{
SwRect m_aUnion; // The rectangle enclosing the selection.
SwTabFrame *m_pTable; // The (Follow-)Table for the Union.
// Determines tables affected by a table selection and union rectangles // of the selection (also for split tables) typedef std::vector<SwSelUnion> SwSelUnions;
// Gets the tables involved in a table selection and the union-rectangles of the selections // - also for split tables. // If a parameter is passed that != SwTableSearchType::NONE // the selection is extended in the given direction. void MakeSelUnions( SwSelUnions&, const SwLayoutFrame *pStart, const SwLayoutFrame *pEnd, const SwTableSearchType = SwTableSearchType::NONE );
// These classes copy the current table selections (rBoxes) into a // separate structure while keeping the table structure.
/** This creates a structure mirroring the SwTable structure that contains all rows and non-leaf boxes (as pointers to SwTableBox/SwTableLine, not copies), plus the leaf boxes that are selected by pFndPara->rBoxes
*/
SW_DLLPUBLIC void ForEach_FndLineCopyCol(SwTableLines& rLines, FndPara* pFndPara );
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.