Kaydet (Commit) dcda5569 authored tarafından Noel Grandin's avatar Noel Grandin

remove unused TableChgWidthHeightType::InsertDeleteMode

looks like as a consequence of
    commit 2d5ce0e1
	Date:   Mon Mar 26 13:08:54 2018 +0200
    tdf#116452 Remove "3 seconds to add/delete col/row" functions

Change-Id: Iae3e2876ed0a0bc916bb4a53f3050d9baa45b0e7
Reviewed-on: https://gerrit.libreoffice.org/63923
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 32e3238a
......@@ -1442,8 +1442,6 @@ sw/inc/poolfmt.hxx:422
enum RES_POOL_COLLFMT_TYPE RES_POOLCOLL_DOC_TITEL
sw/inc/reffld.hxx:38
enum REFERENCESUBTYPE REF_OUTLINE
sw/inc/tblenum.hxx:37
enum TableChgWidthHeightType InsertDeleteMode
sw/inc/undobj.hxx:134
enum DelContentType Fly
sw/inc/undobj.hxx:135
......
......@@ -34,14 +34,10 @@ enum class TableChgWidthHeightType : sal_uInt16
InvalidPos = 0x0f,
// The following can be "or"ed in.
InsertDeleteMode = 0x4000, // Insert/Del-mode: the Bigger-Flag
// tells what happens:
// bBigger -> box gets removed.
// !bBigger-> box gets inserted.
BiggerMode = 0x8000, // Box becomes larger -> else smaller.
};
namespace o3tl {
template<> struct typed_flags<TableChgWidthHeightType> : is_typed_flags<TableChgWidthHeightType, 0xc00f> {};
template<> struct typed_flags<TableChgWidthHeightType> : is_typed_flags<TableChgWidthHeightType, 0x800f> {};
}
constexpr TableChgWidthHeightType extractPosition(TableChgWidthHeightType e) {
return static_cast<TableChgWidthHeightType>(static_cast<sal_uInt16>(e) & 0xf);
......
This diff is collapsed.
......@@ -3934,9 +3934,6 @@ bool SwDoc::SetColRowWidthHeight( SwTableBox& rCurrentBox, TableChgWidthHeightTy
SwTableNode* pTableNd = const_cast<SwTableNode*>(rCurrentBox.GetSttNd()->FindTableNode());
std::unique_ptr<SwUndo> pUndo;
if( (TableChgWidthHeightType::InsertDeleteMode & eType) && dynamic_cast<const SwDDETable*>( &pTableNd->GetTable()) != nullptr)
return false;
SwTableFormulaUpdate aMsgHint( &pTableNd->GetTable() );
aMsgHint.m_eFlags = TBL_BOXPTR;
getIDocumentFieldsAccess().UpdateTableFields( &aMsgHint );
......@@ -3974,8 +3971,6 @@ bool SwDoc::SetColRowWidthHeight( SwTableBox& rCurrentBox, TableChgWidthHeightTy
if( bRet )
{
getIDocumentState().SetModified();
if( TableChgWidthHeightType::InsertDeleteMode & eType )
getIDocumentFieldsAccess().SetFieldsDirty( true, nullptr, 0 );
}
return bRet;
}
......
......@@ -2141,32 +2141,6 @@ void SwFEShell::SetTableAttr( const SfxItemSet &rNew )
}
}
/** move cursor within a table into previous/next row (same column)
* @param pShell cursor shell whose cursor is to be moved
* @param bUp true: move up, false: move down
* @returns true if successful
*/
static bool lcl_GoTableRow( SwCursorShell* pShell, bool bUp )
{
OSL_ENSURE( pShell != nullptr, "need shell" );
SwPaM* pPam = pShell->GetCursor();
const SwStartNode* pTableBox = pPam->GetNode().FindTableBoxStartNode();
OSL_ENSURE( pTableBox != nullptr, "I'm living in a box... NOT!" );
// move cursor to start node of table box
pPam->GetPoint()->nNode = pTableBox->GetIndex();
pPam->GetPoint()->nContent.Assign( nullptr, 0 );
GoInContent( *pPam, fnMoveForward );
// go to beginning end of table box
SwMoveFnCollection const & fnPosSect = bUp ? fnSectionStart : fnSectionEnd;
pShell->MoveSection( GoCurrSection, fnPosSect );
// and go up/down into next content
return bUp ? pShell->Up() : pShell->Down();
}
// change a cell width/cell height/column width/row height
void SwFEShell::SetColRowWidthHeight( TableChgWidthHeightType eType, sal_uInt16 nDiff )
{
......@@ -2174,15 +2148,6 @@ void SwFEShell::SetColRowWidthHeight( TableChgWidthHeightType eType, sal_uInt16
if( !pFrame || !pFrame->IsInTab() )
return;
if( (TableChgWidthHeightType::InsertDeleteMode & eType) &&
dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
vcl::Window* pWin = GetWin();
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR, pWin ? pWin->GetFrameWeld() : nullptr,
DialogMask::MessageInfo | DialogMask::ButtonsOk );
return;
}
SET_CURR_SHELL( this );
StartAllAction();
......@@ -2208,66 +2173,17 @@ void SwFEShell::SetColRowWidthHeight( TableChgWidthHeightType eType, sal_uInt16
pTab->GetFormat()->SetFormatAttr( aSz );
}
if( (eType & TableChgWidthHeightType::BiggerMode) &&
(eType & TableChgWidthHeightType::InsertDeleteMode) )
{
nDiff = sal_uInt16(aRectFnSet.GetWidth(pFrame->getFrameArea()));
// we must move the cursor outside the current cell before
// deleting the cells.
switch( eTypePos )
{
case TableChgWidthHeightType::RowBottom:
lcl_GoTableRow( this, false );
break;
case TableChgWidthHeightType::ColLeft:
GoPrevCell();
break;
case TableChgWidthHeightType::ColRight:
GoNextCell();
break;
default:
break;
}
}
SwTwips nLogDiff = nDiff;
nLogDiff *= pTab->GetFormat()->GetFrameSize().GetWidth();
nLogDiff /= nPrtWidth;
/** The cells are destroyed in here */
bool bRet = GetDoc()->SetColRowWidthHeight(
GetDoc()->SetColRowWidthHeight(
*const_cast<SwTableBox*>(static_cast<SwCellFrame*>(pFrame)->GetTabBox()),
eType, nDiff, nLogDiff );
ClearFEShellTabCols(*GetDoc(), nullptr);
EndAllActionAndCall();
if( bRet && (eType & (TableChgWidthHeightType::BiggerMode | TableChgWidthHeightType::InsertDeleteMode)) == TableChgWidthHeightType::InsertDeleteMode )
{
switch(extractPosition(eType))
{
case TableChgWidthHeightType::CellLeft:
case TableChgWidthHeightType::ColLeft:
GoPrevCell();
break;
case TableChgWidthHeightType::CellRight:
case TableChgWidthHeightType::ColRight:
GoNextCell();
break;
case TableChgWidthHeightType::CellTop:
lcl_GoTableRow( this, true );
break;
case TableChgWidthHeightType::CellBottom:
case TableChgWidthHeightType::RowBottom:
lcl_GoTableRow( this, false );
break;
default: break;
}
}
}
static bool lcl_IsFormulaSelBoxes( const SwTable& rTable, const SwTableBoxFormula& rFormula,
......
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