/* -*- 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 .
*/
/** Get the content type of a shell * * @todo Is this called for every attribute?
*/
sal_uInt16 SwEditShell::GetCntType() const
{
sal_uInt16 nRet = 0; if( IsTableMode() )
nRet = CNT_TXT; else switch( GetCursor()->GetPointNode().GetNodeType() )
{ case SwNodeType::Text: nRet = CNT_TXT; break; case SwNodeType::Grf: nRet = CNT_GRF; break; case SwNodeType::Ole: nRet = CNT_OLE; break; default: break;
}
OSL_ASSERT( nRet ); return nRet;
}
bool SwEditShell::HasOtherCnt() const
{ if ( !GetDoc()->GetSpzFrameFormats()->empty() ) returntrue;
SwFrameFormat *SwEditShell::GetTableFormat() // fastest test on a table
{ const SwTableNode* pTableNd = IsCursorInTable(); return pTableNd ? static_cast<SwFrameFormat*>(pTableNd->GetTable().GetFrameFormat()) : nullptr;
}
// TODO: Why is this called 3x for a new document?
sal_uInt16 SwEditShell::GetTOXTypeCount(TOXTypes eTyp) const
{ return mxDoc->GetTOXTypeCount(eTyp);
}
// Combine continuous calls of Insert/Delete/Overwrite on characters. Default: sdbcx::Group-Undo.
/** open undo container * * @return nUndoId ID of the container
*/
SwUndoId SwEditShell::StartUndo( SwUndoId eUndoId, const SwRewriter *pRewriter )
{ return GetDoc()->GetIDocumentUndoRedo().StartUndo( eUndoId, pRewriter ); }
/** close undo container * * not used by UI * * @param eUndoId ID of the undo container * @param pRewriter ?
*/
SwUndoId SwEditShell::EndUndo(SwUndoId eUndoId, const SwRewriter *pRewriter)
{ return GetDoc()->GetIDocumentUndoRedo().EndUndo(eUndoId, pRewriter); }
SwAutoCorrDoc aSwAutoCorrDoc( *this, *pCursor, cChar ); // FIXME: this _must_ be called with reference to the actual node text!
SwTextFrame const*const pFrame(static_cast<SwTextFrame const*>(pTNd->getLayoutFrame(GetLayout())));
TextFrameIndex const nPos(pFrame->MapModelToViewPos(*pCursor->GetPoint())); // tdf#147414 sw_redlinehide: if cursor moved backward, it may be at the // start of a delete redline - but MapViewToModelPos() always returns end // of redline and it will be called when AutoCorrect actually inserts // something - so first normalize cursor point to end of redline so that // point will then be moved forward when something is inserted.
*pCursor->GetPoint() = pFrame->MapViewToModelPos(nPos); // The hope is that the AutoCorrect never deletes nodes, hence never // deletes SwTextFrames, hence we can pass in the SwTextFrame::GetText() // result and it will be updated via the SwTextFrame::SwClientNotify() // on editing operations.
OUString const& rMergedText(pFrame->GetText());
rACorr.DoAutoCorrect( aSwAutoCorrDoc,
rMergedText, sal_Int32(nPos),
cChar, bInsert, m_bNbspRunNext, GetWin() ); if( cChar )
SaveTableBoxContent( pCursor->GetPoint() );
EndAllAction();
}
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.