/* -*- 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 .
*/
// inserting a footnote with OK void SwInsFootNoteDlg::Apply()
{
OUString aStr; if ( m_xNumberCharBtn->get_active() )
aStr = m_xNumberCharEdit->get_text();
// go to the next foot/endnote here
m_rSh.ResetSelect(nullptr, false, ScrollSizeMode::ScrollSizeDefault); if (&rBtn == m_xNextBT.get())
m_rSh.GotoNextFootnoteAnchor(); else
m_rSh.GotoPrevFootnoteAnchor();
m_xNumberCharEdit->set_text(sNumStr);
m_xNumberCharBtn->set_active(bNumChar);
m_xNumberAutoBtn->set_active(!bNumChar); if (bNumChar)
m_xNumberCharEdit->grab_focus();
if (bFootnote)
m_xFootnoteBtn->set_active(true); else
m_xEndNoteBtn->set_active(true);
// Do not move the shell cursor; move a collapsed SwCursor created in the correct position. // Moving a cursor with a mark will attempt to move only the point, thus a selection from // outside of a table to inside of it could be possible, which would fail. // bNext and bPrev are only false (simultaneously) for single-footnote documents, because // GotoNextFootnoteAnchor / GotoPrevFootnoteAnchor may wrap. const SwPosition& anchorPos = *m_rSh.GetCursor()->GetPoint();
{
SwCursor test(anchorPos, nullptr); bool bNext = test.GotoNextFootnoteAnchor() && *test.GetPoint() != anchorPos;
m_xNextBT->set_sensitive(bNext);
}
{
SwCursor test(anchorPos, nullptr); constbool bPrev = test.GotoPrevFootnoteAnchor() && *test.GetPoint() != anchorPos;
m_xPrevBT->set_sensitive(bPrev);
}
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.